mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-03-16 20:12:53 +03:00
[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
This commit is contained in:
parent
c7fab5b727
commit
5611d2c739
Binary file not shown.
Binary file not shown.
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user