summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-08-19 01:01:31 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-08-19 01:01:31 +0000
commit5611d2c739df0b56a9fedaf5f89f5e1af86df949 (patch)
treedb60c2d0ef6125a8aa25a0a25e14520ed5b6d989 /riscos
parentc7fab5b727863a54ef1bc5b30ba9ac805bbaaec0 (diff)
downloadnetsurf-5611d2c739df0b56a9fedaf5f89f5e1af86df949.tar.gz
netsurf-5611d2c739df0b56a9fedaf5f89f5e1af86df949.tar.bz2
[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
Diffstat (limited to 'riscos')
-rw-r--r--riscos/gui.h3
-rw-r--r--riscos/htmlredraw.c10
-rw-r--r--riscos/print.c6
3 files changed, 15 insertions, 4 deletions
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);