summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-07-23 23:05:34 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-07-23 23:05:34 +0000
commitddeadd1c02880367ad786b113d352a519f45ec73 (patch)
tree00b8b46ee1a3fc84e5492c2183dfaa8192d261f9 /gtk
parentb20949a35025b23da1bf0ac6003f4575eb94281d (diff)
downloadnetsurf-ddeadd1c02880367ad786b113d352a519f45ec73.tar.gz
netsurf-ddeadd1c02880367ad786b113d352a519f45ec73.tar.bz2
Merge LibCSS port to trunk.
svn path=/trunk/netsurf/; revision=8752
Diffstat (limited to 'gtk')
-rw-r--r--gtk/font_pango.c12
-rw-r--r--gtk/gtk_gui.c5
-rw-r--r--gtk/gtk_print.c6
-rw-r--r--gtk/gtk_scaffolding.c7
l---------gtk/res/quirks.css1
5 files changed, 15 insertions, 16 deletions
diff --git a/gtk/font_pango.c b/gtk/font_pango.c
index c0d789344..e4944f0be 100644
--- a/gtk/font_pango.c
+++ b/gtk/font_pango.c
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <gtk/gtk.h>
#include "css/css.h"
+#include "css/utils.h"
#include "gtk/font_pango.h"
#include "gtk/gtk_plotters.h"
#include "render/font.h"
@@ -55,10 +56,6 @@ const struct font_functions nsfont = {
nsfont_split
};
-
-
-
-
/**
* Measure the width of a string.
*
@@ -302,12 +299,7 @@ PangoFontDescription *nsfont_style_to_description(
break;
}
- size = fstyle->size;
-
- if (size < (unsigned)abs(option_font_min_size / 10) * FONT_SIZE_SCALE)
- size = (option_font_min_size / 10) * FONT_SIZE_SCALE;
-
- size = (size * PANGO_SCALE) / FONT_SIZE_SCALE;
+ size = (fstyle->size * PANGO_SCALE) / FONT_SIZE_SCALE;
if (fstyle->flags & FONTF_ITALIC)
style = PANGO_STYLE_ITALIC;
diff --git a/gtk/gtk_gui.c b/gtk/gtk_gui.c
index b8217b7f1..58bc18ed6 100644
--- a/gtk/gtk_gui.c
+++ b/gtk/gtk_gui.c
@@ -65,6 +65,7 @@
bool gui_in_multitask = false;
char *default_stylesheet_url;
+char *quirks_stylesheet_url;
char *adblock_stylesheet_url;
char *options_file_location;
char *glade_file_location;
@@ -307,6 +308,9 @@ void gui_init(int argc, char** argv)
default_stylesheet_url = path_to_url(buf);
LOG(("Using '%s' as Default CSS URL", default_stylesheet_url));
+ find_resource(buf, "quirks.css", "./gtk/res/quirks.css");
+ quirks_stylesheet_url = path_to_url(buf);
+
find_resource(buf, "adblock.css", "./gtk/res/adblock.css");
adblock_stylesheet_url = path_to_url(buf);
LOG(("Using '%s' as AdBlock CSS URL", adblock_stylesheet_url));
@@ -417,6 +421,7 @@ void gui_quit(void)
urldb_save_cookies(option_cookie_jar);
urldb_save(option_url_file);
free(default_stylesheet_url);
+ free(quirks_stylesheet_url);
free(adblock_stylesheet_url);
free(option_cookie_file);
free(option_cookie_jar);
diff --git a/gtk/gtk_print.c b/gtk/gtk_print.c
index 8daa21df8..98b43cb89 100644
--- a/gtk/gtk_print.c
+++ b/gtk/gtk_print.c
@@ -449,7 +449,6 @@ static const struct plotter_table nsgtk_print_plotters = {
.option_knockout = false,
};
-
static bool gtk_print_begin(struct print_settings* settings)
{
return true;
@@ -504,8 +503,9 @@ void gtk_print_signal_begin_print (GtkPrintOperation *operation,
settings->page_width, settings->page_height, height_to_print));
height_on_page = settings->page_height;
- height_on_page = height_on_page - settings->margins[MARGINTOP]
- - settings->margins[MARGINBOTTOM];
+ height_on_page = height_on_page -
+ FIXTOFLT(FSUB(settings->margins[MARGINTOP],
+ settings->margins[MARGINBOTTOM]));
height_to_print *= settings->scale;
page_number = height_to_print / height_on_page;
diff --git a/gtk/gtk_scaffolding.c b/gtk/gtk_scaffolding.c
index d6c4f1e55..6905408fa 100644
--- a/gtk/gtk_scaffolding.c
+++ b/gtk/gtk_scaffolding.c
@@ -24,6 +24,7 @@
#include <gtk/gtk.h>
#include <libxml/debugXML.h>
#include "content/content.h"
+#include "css/utils.h"
#include "desktop/browser.h"
#include "desktop/history_core.h"
#include "desktop/gui.h"
@@ -1241,9 +1242,9 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
g->preferences_dialog = NULL;
- css_screen_dpi = gdk_screen_get_resolution(
- gtk_widget_get_screen(GTK_WIDGET(g->window)));
- LOG(("Set CSS DPI to %f", css_screen_dpi));
+ nscss_screen_dpi = FLTTOFIX(gdk_screen_get_resolution(
+ gtk_widget_get_screen(GTK_WIDGET(g->window))));
+ LOG(("Set CSS DPI to %f", FIXTOFLT(nscss_screen_dpi)));
/* set this window's size and position to what's in the options, or
* or some sensible default if they're not set yet.
diff --git a/gtk/res/quirks.css b/gtk/res/quirks.css
new file mode 120000
index 000000000..d9fb80334
--- /dev/null
+++ b/gtk/res/quirks.css
@@ -0,0 +1 @@
+../../!NetSurf/Resources/Quirks,f79 \ No newline at end of file