Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fb6d9b4

Browse filesBrowse files
committed
Use new cairo_pango container
1 parent 3c60f5c commit fb6d9b4
Copy full SHA for fb6d9b4

File tree

Expand file treeCollapse file tree

4 files changed

+21
-3
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+21
-3
lines changed

‎CMakeLists.txt

Copy file name to clipboardExpand all lines: CMakeLists.txt
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ set(SOURCE ${LITEBROWSER_PATH}/main.cpp
2626
${LITEBROWSER_PATH}/browser_wnd.cpp
2727
${LITEBROWSER_PATH}/web_history.cpp
2828
${CONTAINER_PATH}/cairo_borders.cpp
29+
${CONTAINER_PATH}/cairo_pango.cpp
2930
${LITEBROWSER_PATH}/http_request.cpp
3031
${LITEBROWSER_PATH}/web_page.cpp
3132
${LITEBROWSER_PATH}/http_requests_pool.cpp
@@ -36,6 +37,7 @@ set(HEADERS ${LITEBROWSER_PATH}/browser_wnd.h
3637
${LITEBROWSER_PATH}/globals.h
3738
${CONTAINER_PATH}/container_linux.h
3839
${CONTAINER_PATH}/cairo_borders.h
40+
${CONTAINER_PATH}/cairo_pango.h
3941
${LITEBROWSER_PATH}/web_history.h
4042
${LITEBROWSER_PATH}/http_request.h
4143
${LITEBROWSER_PATH}/web_page.h

‎litehtml

Copy file name to clipboard

‎src/web_page.cpp

Copy file name to clipboardExpand all lines: src/web_page.cpp
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ void litebrowser::web_page::on_pool_update_state()
327327
m_html_host->queue_action(html_host_interface::queue_action_update_state);
328328
}
329329

330+
double litebrowser::web_page::get_screen_dpi() const
331+
{
332+
GdkScreen* screen = gdk_screen_get_default();
333+
return gdk_screen_get_resolution(screen);
334+
}
335+
330336
//////////////////////////////////////////////////////////
331337

332338
litebrowser::image_file::image_file(std::string url, bool redraw_on_ready) :

‎src/web_page.h

Copy file name to clipboardExpand all lines: src/web_page.h
+12-2Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#ifndef LITEBROWSER_WEB_PAGE_H
22
#define LITEBROWSER_WEB_PAGE_H
33

4-
#include "../litehtml/containers/linux/container_linux.h"
4+
#include "../litehtml/containers/linux/cairo_pango.h"
5+
#include <gtkmm.h>
56
#include "html_host.h"
67
#include "http_requests_pool.h"
78

@@ -90,7 +91,7 @@ namespace litebrowser
9091
cairo_surface_t* get() { return cairo_surface_reference(surface); }
9192
};
9293

93-
class web_page : public container_linux,
94+
class web_page : public cairo_pango,
9495
public std::enable_shared_from_this<web_page>
9596
{
9697
litehtml::string m_url;
@@ -123,6 +124,15 @@ namespace litebrowser
123124
void make_url( const char* url, const char* basepath, litehtml::string& out ) override;
124125
void load_image(const char* src, const char* baseurl, bool redraw_on_ready) override;
125126
static cairo_surface_wrapper surface_from_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& bmp);
127+
double get_screen_dpi() const override;
128+
int get_screen_width() const override
129+
{
130+
return Gdk::screen_width();
131+
}
132+
int get_screen_height() const override
133+
{
134+
return Gdk::screen_height();
135+
}
126136

127137
void show_hash(const litehtml::string& hash);
128138
void show_hash_and_reset()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.