Prefix all RISC OS print global variables and functions with "ro_" in order to avoid the print_cleanup function name clash in desktop/print.c and

riscos/print.c.

svn path=/trunk/netsurf/; revision=4867
This commit is contained in:
John Tytgat 2008-08-02 20:07:44 +00:00
parent 611e4f8cbe
commit 48070139d8
4 changed files with 42 additions and 45 deletions

View File

@ -89,7 +89,6 @@ bool print_set_up(struct content *content,
const struct printer *printer, struct print_settings *settings, const struct printer *printer, struct print_settings *settings,
double *height) double *height)
{ {
printed_content = print_init(content, settings); printed_content = print_init(content, settings);
if (!printed_content) if (!printed_content)
@ -116,7 +115,6 @@ bool print_set_up(struct content *content,
bool print_draw_next_page(const struct printer *printer, bool print_draw_next_page(const struct printer *printer,
struct print_settings *settings) struct print_settings *settings)
{ {
/*TODO:Plotter will have to be duplicated and passed /*TODO:Plotter will have to be duplicated and passed
as an argument - to allow simultaneous screen and as an argument - to allow simultaneous screen and
page plotting*/ page plotting*/
@ -244,7 +242,6 @@ bool print_cleanup(struct content *content,
*/ */
struct print_settings *print_make_settings(print_configuration configuration) struct print_settings *print_make_settings(print_configuration configuration)
{ {
struct print_settings *settings; struct print_settings *settings;
switch (configuration){ switch (configuration){

View File

@ -1296,8 +1296,8 @@ void ro_gui_user_message(wimp_event_no event, wimp_message *message)
if (event == wimp_USER_MESSAGE_ACKNOWLEDGE) { if (event == wimp_USER_MESSAGE_ACKNOWLEDGE) {
#ifdef WITH_PRINT #ifdef WITH_PRINT
if (print_current_window) if (ro_print_current_window)
print_dataload_bounce(message); ro_print_dataload_bounce(message);
#endif #endif
} }
else else
@ -1306,8 +1306,8 @@ void ro_gui_user_message(wimp_event_no event, wimp_message *message)
case message_DATA_LOAD_ACK: case message_DATA_LOAD_ACK:
#ifdef WITH_PRINT #ifdef WITH_PRINT
if (print_current_window) if (ro_print_current_window)
print_cleanup(); ro_print_cleanup();
#endif #endif
break; break;
@ -1404,13 +1404,13 @@ void ro_gui_user_message(wimp_event_no event, wimp_message *message)
#ifdef WITH_PRINT #ifdef WITH_PRINT
case message_PRINT_SAVE: case message_PRINT_SAVE:
if (event == wimp_USER_MESSAGE_ACKNOWLEDGE) if (event == wimp_USER_MESSAGE_ACKNOWLEDGE)
print_save_bounce(message); ro_print_save_bounce(message);
break; break;
case message_PRINT_ERROR: case message_PRINT_ERROR:
print_error(message); ro_print_error(message);
break; break;
case message_PRINT_TYPE_ODD: case message_PRINT_TYPE_ODD:
print_type_odd(message); ro_print_type_odd(message);
break; break;
#endif #endif
@ -1826,7 +1826,7 @@ void ro_msg_datasave_ack(wimp_message *message)
ro_msg_terminate_filename((wimp_full_message_data_xfer*)message); ro_msg_terminate_filename((wimp_full_message_data_xfer*)message);
#ifdef WITH_PRINT #ifdef WITH_PRINT
if (print_ack(message)) if (ro_print_ack(message))
return; return;
#endif #endif

View File

@ -71,7 +71,7 @@
* \todo make use of print stylesheets * \todo make use of print stylesheets
*/ */
struct gui_window *print_current_window = NULL; struct gui_window *ro_print_current_window = NULL;
bool print_text_black = false; bool print_text_black = false;
bool print_active = false; bool print_active = false;
@ -200,7 +200,7 @@ void ro_gui_print_prepare(struct gui_window *g)
assert(g); assert(g);
print_current_window = g; ro_print_current_window = g;
print_prev_message = 0; print_prev_message = 0;
/* Read Printer Driver name */ /* Read Printer Driver name */
@ -289,11 +289,11 @@ bool ro_gui_print_apply(wimp_w w)
print_max_sheets = sheets; print_max_sheets = sheets;
else else
print_max_sheets = -1; print_max_sheets = -1;
print_current_window->option.background_images = ro_print_current_window->option.background_images =
ro_gui_get_icon_selected_state(dialog_print, ro_gui_get_icon_selected_state(dialog_print,
ICON_PRINT_BG_IMAGES); ICON_PRINT_BG_IMAGES);
print_send_printsave(print_current_window->bw->current_content); print_send_printsave(ro_print_current_window->bw->current_content);
return true; return true;
} }
@ -346,7 +346,7 @@ void print_send_printsave(struct content *c)
LOG(("xwimp_send_message: 0x%x: %s", LOG(("xwimp_send_message: 0x%x: %s",
e->errnum, e->errmess)); e->errnum, e->errmess));
warn_user("WimpError", e->errmess); warn_user("WimpError", e->errmess);
print_cleanup(); ro_print_cleanup();
} }
print_prev_message = m.my_ref; print_prev_message = m.my_ref;
} }
@ -384,16 +384,16 @@ bool print_send_printtypeknown(wimp_message *m)
* \param m the bounced message * \param m the bounced message
*/ */
void print_save_bounce(wimp_message *m) void ro_print_save_bounce(wimp_message *m)
{ {
if (m->my_ref == 0 || m->my_ref != print_prev_message) if (m->my_ref == 0 || m->my_ref != print_prev_message)
return; return;
/* try to print anyway (we're graphics printing) */ /* try to print anyway (we're graphics printing) */
if (print_current_window) { if (ro_print_current_window) {
print_document(print_current_window, "printer:"); print_document(ro_print_current_window, "printer:");
} }
print_cleanup(); ro_print_cleanup();
} }
@ -403,7 +403,7 @@ void print_save_bounce(wimp_message *m)
* \param m the message containing the error * \param m the message containing the error
*/ */
void print_error(wimp_message *m) void ro_print_error(wimp_message *m)
{ {
pdriver_message_print_error *p = (pdriver_message_print_error*)&m->data; pdriver_message_print_error *p = (pdriver_message_print_error*)&m->data;
if (m->your_ref == 0 || m->your_ref != print_prev_message) if (m->your_ref == 0 || m->your_ref != print_prev_message)
@ -414,7 +414,7 @@ void print_error(wimp_message *m)
else else
warn_user("PrintError", p->errmess); warn_user("PrintError", p->errmess);
print_cleanup(); ro_print_cleanup();
} }
@ -424,15 +424,15 @@ void print_error(wimp_message *m)
* \param m the message to handle * \param m the message to handle
*/ */
void print_type_odd(wimp_message *m) void ro_print_type_odd(wimp_message *m)
{ {
if ((m->your_ref == 0 || m->your_ref == print_prev_message) && if ((m->your_ref == 0 || m->your_ref == print_prev_message) &&
!print_in_background) { !print_in_background) {
/* reply to a previous message (ie printsave) */ /* reply to a previous message (ie printsave) */
if (print_current_window && print_send_printtypeknown(m)) { if (ro_print_current_window && print_send_printtypeknown(m)) {
print_document(print_current_window, "printer:"); print_document(ro_print_current_window, "printer:");
} }
print_cleanup(); ro_print_cleanup();
} }
else { else {
/* broadcast message */ /* broadcast message */
@ -462,14 +462,14 @@ void print_type_odd(wimp_message *m)
* a fair bit) * a fair bit)
*/ */
bool print_ack(wimp_message *m) bool ro_print_ack(wimp_message *m)
{ {
pdriver_info_type info_type; pdriver_info_type info_type;
pdriver_type type; pdriver_type type;
os_error *error; os_error *error;
if (m->your_ref == 0 || m->your_ref != print_prev_message || if (m->your_ref == 0 || m->your_ref != print_prev_message ||
!print_current_window) !ro_print_current_window)
return false; return false;
/* read printer driver type */ /* read printer driver type */
@ -478,15 +478,15 @@ bool print_ack(wimp_message *m)
LOG(("xpdriver_info: 0x%x: %s", LOG(("xpdriver_info: 0x%x: %s",
error->errnum, error->errmess)); error->errnum, error->errmess));
warn_user("PrintError", error->errmess); warn_user("PrintError", error->errmess);
print_cleanup(); ro_print_cleanup();
return true; return true;
} }
type = info_type >> 16; type = info_type >> 16;
/* print to file */ /* print to file */
if (!print_document(print_current_window, if (!print_document(ro_print_current_window,
m->data.data_xfer.file_name)) { m->data.data_xfer.file_name)) {
print_cleanup(); ro_print_cleanup();
return true; return true;
} }
@ -510,7 +510,7 @@ bool print_ack(wimp_message *m)
} }
print_prev_message = m->my_ref; print_prev_message = m->my_ref;
print_cleanup(); ro_print_cleanup();
return true; return true;
} }
@ -521,13 +521,13 @@ bool print_ack(wimp_message *m)
* \param m the message to handle * \param m the message to handle
*/ */
void print_dataload_bounce(wimp_message *m) void ro_print_dataload_bounce(wimp_message *m)
{ {
if (m->your_ref == 0 || m->your_ref != print_prev_message) if (m->your_ref == 0 || m->your_ref != print_prev_message)
return; return;
xosfile_delete(m->data.data_xfer.file_name, 0, 0, 0, 0, 0); xosfile_delete(m->data.data_xfer.file_name, 0, 0, 0, 0, 0);
print_cleanup(); ro_print_cleanup();
} }
@ -535,12 +535,12 @@ void print_dataload_bounce(wimp_message *m)
* Cleanup after printing * Cleanup after printing
*/ */
void print_cleanup(void) void ro_print_cleanup(void)
{ {
if (print_current_window) if (ro_print_current_window)
print_current_window->option.background_images = ro_print_current_window->option.background_images =
print_bg_images; print_bg_images;
print_current_window = 0; ro_print_current_window = NULL;
print_text_black = false; print_text_black = false;
print_prev_message = 0; print_prev_message = 0;
print_max_sheets = -1; print_max_sheets = -1;

View File

@ -27,14 +27,14 @@
struct gui_window; struct gui_window;
extern struct gui_window *print_current_window; extern struct gui_window *ro_print_current_window;
void print_save_bounce(wimp_message *m); void ro_print_save_bounce(wimp_message *m);
void print_error(wimp_message *m); void ro_print_error(wimp_message *m);
void print_type_odd(wimp_message *m); void ro_print_type_odd(wimp_message *m);
bool print_ack(wimp_message *m); bool ro_print_ack(wimp_message *m);
void print_dataload_bounce(wimp_message *m); void ro_print_dataload_bounce(wimp_message *m);
void print_cleanup(void); void ro_print_cleanup(void);
#endif /* WITH_PRINT */ #endif /* WITH_PRINT */