X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=src%2Fplugins%2Flitehtml_viewer%2Flh_widget.h;h=9b95ef83beb6c80d842ba961c2df276e5f19ddd0;hp=a7921978e164df4eb53e7141cbaa1d0f1945f843;hb=HEAD;hpb=1efad926768a8f609ad15f9ee3926ba38d4b601c diff --git a/src/plugins/litehtml_viewer/lh_widget.h b/src/plugins/litehtml_viewer/lh_widget.h index a7921978e..495412bf1 100644 --- a/src/plugins/litehtml_viewer/lh_widget.h +++ b/src/plugins/litehtml_viewer/lh_widget.h @@ -1,9 +1,36 @@ +/* + * Claws Mail -- A GTK based, lightweight, and fast e-mail client + * Copyright(C) 2019 the Claws Mail Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write tothe Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + #include #include #include +#include + +#include "procmime.h" #include "container_linux.h" +struct pango_font +{ + PangoFontDescription *font; + bool underline; + bool strikethrough; +}; + class lh_widget : public container_linux { public: @@ -13,42 +40,52 @@ 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; }; - GdkPixbuf *get_image(const litehtml::tchar_t* url, bool redraw_on_ready); void draw(cairo_t *cr); + void rerender(); void redraw(); void open_html(const gchar *contents); void clear(); - void update_cursor(); + void update_cursor(const char *cursor); void update_font(); void print(); - 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 char *get_href_at(litehtml::element::const_ptr element); + 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::string url) const; + + void set_cairo_context(cairo_t *cr); litehtml::document::ptr m_html; - litehtml::tstring m_clicked_url; + litehtml::string m_clicked_url; + litehtml::string m_base_url; private: - void paint_white(); - gint m_rendered_width; GtkWidget *m_drawing_area; GtkWidget *m_scrolled_window; GtkWidget *m_viewport; GtkWidget *m_context_menu; - litehtml::context m_context; gint m_height; - litehtml::tstring m_cursor; + litehtml::element::const_ptr m_over_element; + gboolean m_showing_url; + MimeInfo *m_partinfo; + cairo_t *m_cairo_context; - litehtml::tchar_t *m_font_name; + char *m_font_name; int m_font_size; + std::atomic m_force_render; + std::atomic m_blank; };