Author: stevef
Date: Tue Jul 27 17:50:51 2010
New Revision: 10666
URL:
http://source.netsurf-browser.org?rev=10666&view=rev
Log:
Enable sideways print option.
Modified:
trunk/netsurf/riscos/print.c
trunk/netsurf/riscos/templates/de
trunk/netsurf/riscos/templates/en
trunk/netsurf/riscos/templates/fr
trunk/netsurf/riscos/templates/nl
Modified: trunk/netsurf/riscos/print.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/riscos/print.c?rev=10666&...
==============================================================================
--- trunk/netsurf/riscos/print.c (original)
+++ trunk/netsurf/riscos/print.c Tue Jul 27 17:50:51 2010
@@ -84,6 +84,7 @@
static int print_num_copies = 1;
static bool print_bg_images = false;
static int print_max_sheets = -1;
+static bool print_sideways = false;
/** List of fonts in current print. */
static char **print_fonts_list = 0;
/** Number of entries in print_fonts_list. */
@@ -270,6 +271,8 @@
ICON_PRINT_IN_BACKGROUND);
print_text_black = ro_gui_get_icon_selected_state(dialog_print,
ICON_PRINT_TEXT_BLACK);
+ print_sideways = ro_gui_get_icon_selected_state(dialog_print,
+ ICON_PRINT_SIDEWAYS);
print_num_copies = copies;
if (ro_gui_get_icon_selected_state(dialog_print, ICON_PRINT_SHEETS))
print_max_sheets = sheets;
@@ -578,8 +581,13 @@
return false;
}
- width = (right - left) / 800;
- height = (top - bottom) / 800;
+ if (print_sideways) {
+ width = (top - bottom) / 800;
+ height = (right - left) / 800;
+ } else {
+ width = (right - left) / 800;
+ height = (top - bottom) / 800;
+ }
/* layout the document to the correct width */
saved_width = content_get_width(h);
@@ -628,11 +636,38 @@
do {
int clip_x0, clip_y0, clip_x1, clip_y1;
- os_box b = {left / 400 - 2, bottom / 400 - 2,
- right / 400 + 2, top / 400 + 2};
- os_hom_trfm t = { { {65536, 0}, {0, 65536} } };
- os_coord p = {left, bottom};
+ os_box b;
+ os_hom_trfm t;
+ os_coord p;
osbool more;
+
+ if (print_sideways) {
+ b.x0 = bottom / 400 -2;
+ b.y0 = left / 400 - 2;
+ b.x1 = top / 400 + 2;
+ b.y1 = right / 400 + 2;
+ t.entries[0][0] = 0;
+ t.entries[0][1] = 65536;
+ t.entries[1][0] = -65536;
+ t.entries[1][1] = 0;
+ p.x = right;
+ p.y = bottom;
+ ro_plot_origin_x = bottom / 400;
+ ro_plot_origin_y = right / 400 + yscroll * 2;
+ } else {
+ b.x0 = left / 400 -2;
+ b.y0 = bottom / 400 - 2;
+ b.x1 = right / 400 + 2;
+ b.y1 = top / 400 + 2;
+ t.entries[0][0] = 65536;
+ t.entries[0][1] = 0;
+ t.entries[1][0] = 0;
+ t.entries[1][1] = 65536;
+ p.x = left;
+ p.y = bottom;
+ ro_plot_origin_x = left / 400;
+ ro_plot_origin_y = top / 400 + yscroll * 2;
+ }
xhourglass_percentage((int) (yscroll * 100 /
content_get_height(h)));
@@ -658,9 +693,6 @@
error_message = error->errmess;
goto error;
}
-
- ro_plot_origin_x = left / 400;
- ro_plot_origin_y = top / 400 + yscroll * 2;
while (more) {
LOG(("redrawing area: [(%d, %d), (%d, %d)]",
Modified: trunk/netsurf/riscos/templates/de
URL:
http://source.netsurf-browser.org/trunk/netsurf/riscos/templates/de?rev=1...
==============================================================================
--- trunk/netsurf/riscos/templates/de (original)
+++ trunk/netsurf/riscos/templates/de Tue Jul 27 17:50:51 2010
@@ -2174,7 +2174,7 @@
}
wimp_icon {
extent:12,-452,228,-408
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED |
wimp_ICON_INDIRECTED | wimp_ICON_SHADED | wimp_BUTTON_RADIO
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED |
wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
Modified: trunk/netsurf/riscos/templates/en
URL:
http://source.netsurf-browser.org/trunk/netsurf/riscos/templates/en?rev=1...
==============================================================================
--- trunk/netsurf/riscos/templates/en (original)
+++ trunk/netsurf/riscos/templates/en Tue Jul 27 17:50:51 2010
@@ -2330,7 +2330,7 @@
}
wimp_icon {
extent:12,-452,196,-408
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED |
wimp_ICON_INDIRECTED | wimp_ICON_SHADED | wimp_BUTTON_RADIO
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED |
wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
Modified: trunk/netsurf/riscos/templates/fr
URL:
http://source.netsurf-browser.org/trunk/netsurf/riscos/templates/fr?rev=1...
==============================================================================
--- trunk/netsurf/riscos/templates/fr (original)
+++ trunk/netsurf/riscos/templates/fr Tue Jul 27 17:50:51 2010
@@ -2184,7 +2184,7 @@
}
wimp_icon {
extent:12,-452,196,-408
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED |
wimp_ICON_INDIRECTED | wimp_ICON_SHADED | wimp_BUTTON_RADIO
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED |
wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
Modified: trunk/netsurf/riscos/templates/nl
URL:
http://source.netsurf-browser.org/trunk/netsurf/riscos/templates/nl?rev=1...
==============================================================================
--- trunk/netsurf/riscos/templates/nl (original)
+++ trunk/netsurf/riscos/templates/nl Tue Jul 27 17:50:51 2010
@@ -2334,7 +2334,7 @@
}
wimp_icon {
extent:12,-452,196,-408
- icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED |
wimp_ICON_INDIRECTED | wimp_ICON_SHADED | wimp_BUTTON_RADIO
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_SPRITE | wimp_ICON_VCENTRED |
wimp_ICON_INDIRECTED | wimp_BUTTON_RADIO
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
icon_bg:wimp_COLOUR_VERY_LIGHT_GREY