[Commits] [SCM] claws branch, gtk2, updated. 3.19.1-80-g552890d94
jonathan at claws-mail.org
jonathan at claws-mail.org
Sun Oct 22 11:52:37 UTC 2023
The branch, gtk2 has been updated
via 552890d94d2dc15052074ab8f9bdd2db3f267c04 (commit)
from 755c995444e2bcb307cf5903df0158d1548b9060 (commit)
Summary of changes:
.../litehtml_viewer/container_linux_images.cpp | 4 +--
src/plugins/litehtml_viewer/lh_widget.cpp | 30 +++++++++---------
src/plugins/litehtml_viewer/lh_widget.h | 36 +++++++++++-----------
src/plugins/litehtml_viewer/lh_widget_text.cpp | 6 ++--
4 files changed, 38 insertions(+), 38 deletions(-)
- Log -----------------------------------------------------------------
commit 552890d94d2dc15052074ab8f9bdd2db3f267c04
Author: Jonathan Boeing <jonathan at claws-mail.org>
Date: Mon Oct 9 00:51:08 2023 -0700
String api updates
Upstream replaced tstring with string and tchar_t* with char*
diff --git a/src/plugins/litehtml_viewer/container_linux_images.cpp b/src/plugins/litehtml_viewer/container_linux_images.cpp
index 042797868..e66962a8c 100644
--- a/src/plugins/litehtml_viewer/container_linux_images.cpp
+++ b/src/plugins/litehtml_viewer/container_linux_images.cpp
@@ -26,9 +26,9 @@
#include "container_linux.h"
#include "http.h"
-typedef std::pair<litehtml::tstring, struct timeval> lru_entry;
+typedef std::pair<litehtml::string, struct timeval> lru_entry;
-static GdkPixbuf *lh_get_image(const litehtml::tchar_t* url)
+static GdkPixbuf *lh_get_image(const char *url)
{
GError *error = NULL;
GdkPixbuf *pixbuf = NULL;
diff --git a/src/plugins/litehtml_viewer/lh_widget.cpp b/src/plugins/litehtml_viewer/lh_widget.cpp
index ccfb44d2c..c5567f20f 100644
--- a/src/plugins/litehtml_viewer/lh_widget.cpp
+++ b/src/plugins/litehtml_viewer/lh_widget.cpp
@@ -132,13 +132,13 @@ GtkWidget *lh_widget::get_widget() const
return m_scrolled_window;
}
-void lh_widget::set_caption(const litehtml::tchar_t* caption)
+void lh_widget::set_caption(const char *caption)
{
debug_print("lh_widget set_caption\n");
return;
}
-void lh_widget::set_base_url(const litehtml::tchar_t* base_url)
+void lh_widget::set_base_url(const char *base_url)
{
debug_print("lh_widget set_base_url '%s'\n",
(base_url ? base_url : "(null)"));
@@ -150,7 +150,7 @@ void lh_widget::set_base_url(const litehtml::tchar_t* base_url)
return;
}
-void lh_widget::on_anchor_click(const litehtml::tchar_t* url, const litehtml::element::ptr& el)
+void lh_widget::on_anchor_click(const char *url, const litehtml::element::ptr& el)
{
debug_print("lh_widget on_anchor_click. url -> %s\n", url);
@@ -158,7 +158,7 @@ void lh_widget::on_anchor_click(const litehtml::tchar_t* url, const litehtml::el
return;
}
-void lh_widget::import_css(litehtml::tstring& text, const litehtml::tstring& url, litehtml::tstring& baseurl)
+void lh_widget::import_css(litehtml::string& text, const litehtml::string& url, litehtml::string& baseurl)
{
debug_print("lh_widget import_css\n");
baseurl = master_css;
@@ -294,7 +294,7 @@ void lh_widget::clear()
m_clicked_url.clear();
}
-void lh_widget::set_cursor(const litehtml::tchar_t* cursor)
+void lh_widget::set_cursor(const char *cursor)
{
litehtml::element::ptr over_el = m_html->over_element();
@@ -310,10 +310,10 @@ void lh_widget::set_cursor(const litehtml::tchar_t* cursor)
}
}
-void lh_widget::update_cursor(const litehtml::tchar_t* cursor)
+void lh_widget::update_cursor(const char *cursor)
{
GdkCursorType cursType = GDK_ARROW;
- const litehtml::tchar_t *href = get_href_at(m_over_element);
+ const char *href = get_href_at(m_over_element);
/* If there is a href, and litehtml is okay with showing a pointer
* cursor ("pointer" or "auto"), set it, otherwise keep the
@@ -336,7 +336,7 @@ void lh_widget::update_cursor(const litehtml::tchar_t* cursor)
}
}
-const litehtml::tchar_t *lh_widget::get_href_at(litehtml::element::ptr element) const
+const char *lh_widget::get_href_at(litehtml::element::ptr element) const
{
litehtml::element::ptr el;
@@ -360,10 +360,10 @@ const litehtml::tchar_t *lh_widget::get_href_at(litehtml::element::ptr element)
/* At this point, over_el is pointing at an anchor tag, so let's
* grab its href attribute. */
- return el->get_attr(_t("href"));
+ return el->get_attr("href");
}
-const litehtml::tchar_t *lh_widget::get_href_at(const gint x, const gint y) const
+const char *lh_widget::get_href_at(const gint x, const gint y) const
{
litehtml::element::ptr over_el, el;
@@ -383,7 +383,7 @@ void lh_widget::print()
gtk_widget_realize(GTK_WIDGET(m_drawing_area));
}
-void lh_widget::popup_context_menu(const litehtml::tchar_t *url,
+void lh_widget::popup_context_menu(const char *url,
GdkEventButton *event)
{
cm_return_if_fail(url != NULL);
@@ -415,12 +415,12 @@ void lh_widget::update_font()
debug_print("Font set to '%s', size %d\n", m_font_name, m_font_size);
}
-const litehtml::tstring lh_widget::fullurl(const litehtml::tchar_t *url) const
+const litehtml::string lh_widget::fullurl(const char *url) const
{
if (*url == '#' && !m_base_url.empty())
return m_base_url + url;
- return _t(url);
+ return url;
}
void lh_widget::set_partinfo(MimeInfo *partinfo)
@@ -428,7 +428,7 @@ void lh_widget::set_partinfo(MimeInfo *partinfo)
m_partinfo = partinfo;
}
-GdkPixbuf *lh_widget::get_local_image(const litehtml::tstring url) const
+GdkPixbuf *lh_widget::get_local_image(const litehtml::string url) const
{
GdkPixbuf *pixbuf;
const gchar *name;
@@ -493,7 +493,7 @@ static gboolean button_press_event(GtkWidget *widget, GdkEventButton *event,
/* Right-click */
if (event->button == 3) {
- const litehtml::tchar_t *url = w->get_href_at((gint)event->x, (gint)event->y);
+ const char *url = w->get_href_at((gint)event->x, (gint)event->y);
if (url != NULL)
w->popup_context_menu(url, event);
diff --git a/src/plugins/litehtml_viewer/lh_widget.h b/src/plugins/litehtml_viewer/lh_widget.h
index cc0b12ef2..859b9d0dc 100644
--- a/src/plugins/litehtml_viewer/lh_widget.h
+++ b/src/plugins/litehtml_viewer/lh_widget.h
@@ -40,40 +40,40 @@ class lh_widget : public container_linux
GtkWidget *get_widget() const;
/* Methods that litehtml calls */
- void set_caption(const litehtml::tchar_t* caption);
- void set_base_url(const litehtml::tchar_t* base_url);
- void on_anchor_click(const litehtml::tchar_t* url, const litehtml::element::ptr& el);
- void set_cursor(const litehtml::tchar_t* cursor);
- void import_css(litehtml::tstring& text, const litehtml::tstring& url, litehtml::tstring& baseurl);
+ void set_caption(const char *caption);
+ void set_base_url(const char *base_url);
+ void on_anchor_click(const char *url, const litehtml::element::ptr& el);
+ void set_cursor(const char *cursor);
+ void import_css(litehtml::string& text, const litehtml::string& url, litehtml::string& baseurl);
void get_client_rect(litehtml::position& client) const;
- inline const litehtml::tchar_t *get_default_font_name() const { return m_font_name; };
+ inline const char *get_default_font_name() const { return m_font_name; };
inline int get_default_font_size() const { return m_font_size; };
- litehtml::uint_ptr create_font(const litehtml::tchar_t* faceName, int size, int weight, litehtml::font_style italic, unsigned int decoration, litehtml::font_metrics* fm);
+ litehtml::uint_ptr create_font(const char *faceName, int size, int weight, litehtml::font_style italic, unsigned int decoration, litehtml::font_metrics* fm);
void delete_font(litehtml::uint_ptr hFont);
- int text_width(const litehtml::tchar_t* text, litehtml::uint_ptr hFont);
- void draw_text(litehtml::uint_ptr hdc, const litehtml::tchar_t* text, litehtml::uint_ptr hFont, litehtml::web_color color, const litehtml::position& pos);
+ int text_width(const char *text, litehtml::uint_ptr hFont);
+ void draw_text(litehtml::uint_ptr hdc, const char *text, litehtml::uint_ptr hFont, litehtml::web_color color, const litehtml::position& pos);
void draw(cairo_t *cr);
void rerender();
void redraw();
void open_html(const gchar *contents);
void clear();
- void update_cursor(const litehtml::tchar_t* cursor);
+ void update_cursor(const char *cursor);
void update_font();
void print();
- const litehtml::tchar_t *get_href_at(litehtml::element::ptr element) const;
- const litehtml::tchar_t *get_href_at(const gint x, const gint y) const;
- void popup_context_menu(const litehtml::tchar_t *url, GdkEventButton *event);
- const litehtml::tstring fullurl(const litehtml::tchar_t *url) const;
+ const char *get_href_at(litehtml::element::ptr element) const;
+ const char *get_href_at(const gint x, const gint y) const;
+ void popup_context_menu(const char *url, GdkEventButton *event);
+ const litehtml::string fullurl(const char *url) const;
void set_partinfo(MimeInfo *partinfo);
- GdkPixbuf *get_local_image(const litehtml::tstring url) const;
+ GdkPixbuf *get_local_image(const litehtml::string url) const;
litehtml::document::ptr m_html;
- litehtml::tstring m_clicked_url;
- litehtml::tstring m_base_url;
+ litehtml::string m_clicked_url;
+ litehtml::string m_base_url;
private:
gint m_rendered_width;
@@ -87,7 +87,7 @@ class lh_widget : public container_linux
gboolean m_showing_url;
MimeInfo *m_partinfo;
- litehtml::tchar_t *m_font_name;
+ char *m_font_name;
int m_font_size;
std::atomic<bool> m_force_render;
std::atomic<bool> m_blank;
diff --git a/src/plugins/litehtml_viewer/lh_widget_text.cpp b/src/plugins/litehtml_viewer/lh_widget_text.cpp
index f6161a05e..c8f9c5998 100644
--- a/src/plugins/litehtml_viewer/lh_widget_text.cpp
+++ b/src/plugins/litehtml_viewer/lh_widget_text.cpp
@@ -25,7 +25,7 @@
#include "lh_widget.h"
-litehtml::uint_ptr lh_widget::create_font( const litehtml::tchar_t* faceName, int size, int weight, litehtml::font_style italic, unsigned int decoration, litehtml::font_metrics* fm )
+litehtml::uint_ptr lh_widget::create_font( const char *faceName, int size, int weight, litehtml::font_style italic, unsigned int decoration, litehtml::font_metrics* fm )
{
PangoFontDescription *desc =
pango_font_description_from_string(faceName);
@@ -78,7 +78,7 @@ void lh_widget::delete_font( litehtml::uint_ptr hFont )
}
}
-int lh_widget::text_width( const litehtml::tchar_t* text, litehtml::uint_ptr hFont )
+int lh_widget::text_width( const char *text, litehtml::uint_ptr hFont )
{
pango_font *fnt = (pango_font *) hFont;
PangoContext *context = gtk_widget_get_pango_context(m_drawing_area);
@@ -96,7 +96,7 @@ int lh_widget::text_width( const litehtml::tchar_t* text, litehtml::uint_ptr hFo
return rect.width;
}
-void lh_widget::draw_text( litehtml::uint_ptr hdc, const litehtml::tchar_t* text, litehtml::uint_ptr hFont, litehtml::web_color color, const litehtml::position& pos )
+void lh_widget::draw_text( litehtml::uint_ptr hdc, const char *text, litehtml::uint_ptr hFont, litehtml::web_color color, const litehtml::position& pos )
{
pango_font *fnt = (pango_font *)hFont;
cairo_t *cr = (cairo_t *)hdc;
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list