2 * Claws Mail -- A GTK based, lightweight, and fast e-mail client
3 * Copyright(C) 2019 the Claws Mail Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write tothe Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 #include "container_linux.h"
29 PangoFontDescription
*font
;
34 class lh_widget
: public container_linux
40 GtkWidget
*get_widget() const;
42 /* Methods that litehtml calls */
43 void set_caption(const char *caption
);
44 void set_base_url(const char *base_url
);
45 void on_anchor_click(const char *url
, const litehtml::element::ptr
& el
);
46 void set_cursor(const char *cursor
);
47 void import_css(litehtml::string
& text
, const litehtml::string
& url
, litehtml::string
& baseurl
);
48 void get_client_rect(litehtml::position
& client
) const;
49 inline const char *get_default_font_name() const { return m_font_name
; };
51 inline int get_default_font_size() const { return m_font_size
; };
53 void draw(cairo_t
*cr
);
56 void open_html(const gchar
*contents
);
58 void update_cursor(const char *cursor
);
62 const char *get_href_at(litehtml::element::const_ptr element
);
63 void popup_context_menu(const char *url
, GdkEventButton
*event
);
64 const litehtml::string
fullurl(const char *url
) const;
66 void set_partinfo(MimeInfo
*partinfo
);
67 GdkPixbuf
*get_local_image(const litehtml::string url
) const;
69 void set_cairo_context(cairo_t
*cr
);
71 litehtml::document::ptr m_html
;
72 litehtml::string m_clicked_url
;
73 litehtml::string m_base_url
;
76 gint m_rendered_width
;
77 GtkWidget
*m_drawing_area
;
78 GtkWidget
*m_scrolled_window
;
79 GtkWidget
*m_viewport
;
80 GtkWidget
*m_context_menu
;
82 litehtml::element::const_ptr m_over_element
;
83 gboolean m_showing_url
;
85 cairo_t
*m_cairo_context
;
89 std::atomic
<bool> m_force_render
;
90 std::atomic
<bool> m_blank
;