Commit 1324352da51d4dac0541c04fad58f76d200a1305

Authored by Perry Werneck
1 parent 4955a7c4

Updating print methods.

src/include/pw3270.h
@@ -91,17 +91,7 @@ @@ -91,17 +91,7 @@
91 91
92 LIB3270_EXPORT void pw3270_set_action_state(GtkAction *action, gboolean on); 92 LIB3270_EXPORT void pw3270_set_action_state(GtkAction *action, gboolean on);
93 93
94 -  
95 - typedef enum pw3270_src  
96 - {  
97 - PW3270_SRC_ALL, /**< Screen contents */  
98 - PW3270_SRC_SELECTED, /**< Selected region */  
99 - PW3270_SRC_COPY, /**< Copy buffer */  
100 -  
101 - PW3270_SRC_USER  
102 - } PW3270_SRC;  
103 -  
104 - LIB3270_EXPORT int pw3270_print(GtkWidget *widget, GObject *action, GtkPrintOperationAction oper, PW3270_SRC src); 94 + LIB3270_EXPORT int pw3270_print(GtkWidget *widget, GObject *action, GtkPrintOperationAction oper, LIB3270_PRINT_MODE src);
105 95
106 #ifdef HAVE_GTKMAC 96 #ifdef HAVE_GTKMAC
107 #include <gtk-mac-bundle.h> 97 #include <gtk-mac-bundle.h>
src/plugins/dbus3270/gobject.c
@@ -559,7 +559,7 @@ void pw3270_dbus_erase_eof(PW3270Dbus *object, DBusGMethodInvocation *context) @@ -559,7 +559,7 @@ void pw3270_dbus_erase_eof(PW3270Dbus *object, DBusGMethodInvocation *context)
559 559
560 void pw3270_dbus_print(PW3270Dbus *object, DBusGMethodInvocation *context) 560 void pw3270_dbus_print(PW3270Dbus *object, DBusGMethodInvocation *context)
561 { 561 {
562 - dbus_g_method_return(context,lib3270_print(pw3270_dbus_get_session_handle(object))); 562 + dbus_g_method_return(context,lib3270_print_all(pw3270_dbus_get_session_handle(object)));
563 } 563 }
564 564
565 void pw3270_dbus_set_unlock_delay(PW3270Dbus *object, int value, DBusGMethodInvocation *context) 565 void pw3270_dbus_set_unlock_delay(PW3270Dbus *object, int value, DBusGMethodInvocation *context)
src/pw3270/print.c
@@ -48,9 +48,9 @@ @@ -48,9 +48,9 @@
48 48
49 typedef struct _print_info 49 typedef struct _print_info
50 { 50 {
51 - GdkRGBA color[V3270_COLOR_COUNT]; 51 + GdkRGBA color[V3270_COLOR_COUNT];
52 int show_selection : 1; 52 int show_selection : 1;
53 - PW3270_SRC src; 53 + LIB3270_PRINT_MODE src;
54 54
55 GtkWidget * widget; 55 GtkWidget * widget;
56 H3270 * session; 56 H3270 * session;
@@ -185,7 +185,7 @@ @@ -185,7 +185,7 @@
185 unsigned char c; 185 unsigned char c;
186 unsigned short attr; 186 unsigned short attr;
187 187
188 - if(!lib3270_get_element(info->session,baddr++,&c,&attr) && (info->src == PW3270_SRC_ALL || (attr & LIB3270_ATTR_SELECTED))) 188 + if(!lib3270_get_element(info->session,baddr++,&c,&attr) && (info->src == LIB3270_PRINT_ALL || (attr & LIB3270_ATTR_SELECTED)))
189 { 189 {
190 if(!info->show_selection) 190 if(!info->show_selection)
191 attr &= ~LIB3270_ATTR_SELECTED; 191 attr &= ~LIB3270_ATTR_SELECTED;
@@ -506,7 +506,7 @@ static gchar * enum_to_string(GType type, guint enum_value) @@ -506,7 +506,7 @@ static gchar * enum_to_string(GType type, guint enum_value)
506 // Selection checkbox 506 // Selection checkbox
507 widget = gtk_check_button_new_with_label( _("Print selection box") ); 507 widget = gtk_check_button_new_with_label( _("Print selection box") );
508 508
509 - if(info->src == PW3270_SRC_ALL) 509 + if(info->src == LIB3270_PRINT_ALL)
510 { 510 {
511 info->show_selection = get_boolean_from_config("print","selection",FALSE); 511 info->show_selection = get_boolean_from_config("print","selection",FALSE);
512 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),info->show_selection); 512 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),info->show_selection);
@@ -798,12 +798,12 @@ static gchar * enum_to_string(GType type, guint enum_value) @@ -798,12 +798,12 @@ static gchar * enum_to_string(GType type, guint enum_value)
798 798
799 void print_all_action(GtkAction *action, GtkWidget *widget) 799 void print_all_action(GtkAction *action, GtkWidget *widget)
800 { 800 {
801 - pw3270_print(widget,G_OBJECT(action),GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, PW3270_SRC_ALL); 801 + pw3270_print(widget,G_OBJECT(action),GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, LIB3270_PRINT_ALL);
802 } 802 }
803 803
804 void print_selected_action(GtkAction *action, GtkWidget *widget) 804 void print_selected_action(GtkAction *action, GtkWidget *widget)
805 { 805 {
806 - pw3270_print(widget,G_OBJECT(action),GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, PW3270_SRC_SELECTED); 806 + pw3270_print(widget,G_OBJECT(action),GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, LIB3270_PRINT_SELECTED);
807 } 807 }
808 808
809 static void draw_text(GtkPrintOperation *prt, GtkPrintContext *context, gint pg, PRINT_INFO *info) 809 static void draw_text(GtkPrintOperation *prt, GtkPrintContext *context, gint pg, PRINT_INFO *info)
@@ -833,10 +833,10 @@ static gchar * enum_to_string(GType type, guint enum_value) @@ -833,10 +833,10 @@ static gchar * enum_to_string(GType type, guint enum_value)
833 833
834 void print_copy_action(GtkAction *action, GtkWidget *widget) 834 void print_copy_action(GtkAction *action, GtkWidget *widget)
835 { 835 {
836 - pw3270_print(widget,G_OBJECT(action),GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, PW3270_SRC_COPY); 836 + pw3270_print(widget,G_OBJECT(action),GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, LIB3270_PRINT_COPY);
837 } 837 }
838 838
839 - LIB3270_EXPORT int pw3270_print(GtkWidget *widget, GObject *action, GtkPrintOperationAction oper, PW3270_SRC src) 839 + LIB3270_EXPORT int pw3270_print(GtkWidget *widget, GObject *action, GtkPrintOperationAction oper, LIB3270_PRINT_MODE src)
840 { 840 {
841 PRINT_INFO * info = NULL; 841 PRINT_INFO * info = NULL;
842 GtkPrintOperation * print; 842 GtkPrintOperation * print;
@@ -862,13 +862,12 @@ static gchar * enum_to_string(GType type, guint enum_value) @@ -862,13 +862,12 @@ static gchar * enum_to_string(GType type, guint enum_value)
862 862
863 switch(src) 863 switch(src)
864 { 864 {
865 - case PW3270_SRC_ALL:  
866 - case PW3270_SRC_SELECTED:  
867 - case PW3270_SRC_USER: 865 + case LIB3270_PRINT_ALL:
  866 + case LIB3270_PRINT_SELECTED:
868 g_signal_connect(print,"draw_page",G_CALLBACK(draw_screen),info); 867 g_signal_connect(print,"draw_page",G_CALLBACK(draw_screen),info);
869 break; 868 break;
870 869
871 - case PW3270_SRC_COPY: 870 + case LIB3270_PRINT_COPY:
872 871
873 text = v3270_get_copy(widget); 872 text = v3270_get_copy(widget);
874 873
src/pw3270/window.c
@@ -652,7 +652,7 @@ @@ -652,7 +652,7 @@
652 652
653 static void print_all(GtkWidget *widget, GtkWidget *window) 653 static void print_all(GtkWidget *widget, GtkWidget *window)
654 { 654 {
655 - pw3270_print(widget, NULL, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, PW3270_SRC_ALL); 655 + pw3270_print(widget, NULL, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, LIB3270_PRINT_ALL);
656 } 656 }
657 657
658 static void toggle_changed(GtkWidget *widget, LIB3270_TOGGLE id, gboolean toggled, const gchar *name, GtkWindow *toplevel) 658 static void toggle_changed(GtkWidget *widget, LIB3270_TOGGLE id, gboolean toggled, const gchar *name, GtkWindow *toplevel)