From 5611d2c739df0b56a9fedaf5f89f5e1af86df949 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 19 Aug 2004 01:01:31 +0000 Subject: [project @ 2004-08-19 01:01:31 by jmb] Add option to force text colour to black when printing svn path=/import/netsurf/; revision=1245 --- !NetSurf/Resources/en/Templates,fec | Bin 8838 -> 8908 bytes !NetSurf/Resources/fr/Templates,fec | Bin 8972 -> 9042 bytes riscos/gui.h | 3 ++- riscos/htmlredraw.c | 10 +++++++--- riscos/print.c | 6 ++++++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/!NetSurf/Resources/en/Templates,fec b/!NetSurf/Resources/en/Templates,fec index 43d9f783d..8f637ae40 100644 Binary files a/!NetSurf/Resources/en/Templates,fec and b/!NetSurf/Resources/en/Templates,fec differ diff --git a/!NetSurf/Resources/fr/Templates,fec b/!NetSurf/Resources/fr/Templates,fec index 1b016891a..14aa4b72c 100644 Binary files a/!NetSurf/Resources/fr/Templates,fec and b/!NetSurf/Resources/fr/Templates,fec differ diff --git a/riscos/gui.h b/riscos/gui.h index ef500cfd0..8a825257c 100644 --- a/riscos/gui.h +++ b/riscos/gui.h @@ -40,7 +40,7 @@ extern wimp_menu *current_menu; extern osspriteop_area *gui_sprites; extern struct toolbar *hotlist_toolbar; extern bool dialog_folder_add, dialog_entry_add, hotlist_insert; -extern bool print_active; +extern bool print_active, print_text_black; typedef enum { GUI_SAVE_SOURCE, @@ -382,5 +382,6 @@ bool ro_gui_print_keypress(wimp_key *key); #define ICON_PRINT_COPIES_UP 14 #define ICON_PRINT_CANCEL 15 #define ICON_PRINT_PRINT 16 +#define ICON_PRINT_TEXT_BLACK 20 #endif diff --git a/riscos/htmlredraw.c b/riscos/htmlredraw.c index 089378282..592398131 100644 --- a/riscos/htmlredraw.c +++ b/riscos/htmlredraw.c @@ -363,7 +363,9 @@ bool html_redraw_box(struct box *box, } else if (box->gadget && box->gadget->type == GADGET_FILE) { error = xcolourtrans_set_font_colours(box->font->handle, current_background_color << 8, - box->style->color << 8, 14, 0, 0, 0); + print_text_black ? os_COLOUR_BLACK : + box->style->color << 8, + 14, 0, 0, 0); if (error) { LOG(("xcolourtrans_set_font_colours: 0x%x: %s", error->errnum, error->errmess)); @@ -377,7 +379,9 @@ bool html_redraw_box(struct box *box, error = xcolourtrans_set_font_colours(box->font->handle, current_background_color << 8, - box->style->color << 8, 14, 0, 0, 0); + print_text_black ? os_COLOUR_BLACK : + box->style->color << 8, + 14, 0, 0, 0); if (error) { LOG(("xcolourtrans_set_font_colours: 0x%x: %s", error->errnum, error->errmess)); @@ -385,7 +389,7 @@ bool html_redraw_box(struct box *box, } /* antialias colour for under/overline */ - colour = box->style->color; + colour = print_text_black ? os_COLOUR_BLACK : box->style->color; colour = ((((colour >> 16) + (current_background_color >> 16)) / 2) << 16) | (((((colour >> 8) & 0xff) + ((current_background_color >> 8) & 0xff)) / 2) << 8) diff --git a/riscos/print.c b/riscos/print.c index 8cb35c319..573ae50a3 100644 --- a/riscos/print.c +++ b/riscos/print.c @@ -40,6 +40,7 @@ /* extern globals */ struct gui_window *print_current_window = 0; bool print_active = false; +bool print_text_black = false; /* static globals */ static int print_prev_message = 0; @@ -107,6 +108,8 @@ void ro_gui_print_open(struct gui_window *g, int x, int y, bool sub_menu, bool k ro_gui_set_icon_selected_state(dialog_print, ICON_PRINT_UPRIGHT, true); ro_gui_set_icon_selected_state(dialog_print, ICON_PRINT_SIDEWAYS, false); + ro_gui_set_icon_selected_state(dialog_print, ICON_PRINT_TEXT_BLACK, false); + ro_gui_set_icon_integer(dialog_print, ICON_PRINT_COPIES, 1); if (!printers_exists) { @@ -169,6 +172,7 @@ void ro_gui_print_click(wimp_pointer *pointer) break; case ICON_PRINT_PRINT: print_in_background = ro_gui_get_icon_selected_state(dialog_print, ICON_PRINT_IN_BACKGROUND); + print_text_black = ro_gui_get_icon_selected_state(dialog_print, ICON_PRINT_TEXT_BLACK); print_num_copies = copies; if (ro_gui_get_icon_selected_state(dialog_print, ICON_PRINT_SHEETS)) print_max_sheets = sheets; @@ -213,6 +217,7 @@ bool ro_gui_print_keypress(wimp_key *key) return true; print_in_background = ro_gui_get_icon_selected_state(dialog_print, ICON_PRINT_IN_BACKGROUND); + print_text_black = ro_gui_get_icon_selected_state(dialog_print, ICON_PRINT_TEXT_BLACK); print_num_copies = atoi(ro_gui_get_icon_string(dialog_print, ICON_PRINT_COPIES)); if (ro_gui_get_icon_selected_state(dialog_print, ICON_PRINT_SHEETS)) print_max_sheets = atoi(ro_gui_get_icon_string(dialog_print, ICON_PRINT_SHEETS_VALUE)); @@ -454,6 +459,7 @@ void print_cleanup(void) print_current_window->option.background_images = print_bg_images; print_current_window = 0; + print_text_black = false; print_prev_message = 0; print_max_sheets = -1; xwimp_create_menu((wimp_menu *)-1, 0, 0); -- cgit v1.2.3