diff --git a/src/gtk/actions.c b/src/gtk/actions.c index be97a65..d18f988 100644 --- a/src/gtk/actions.c +++ b/src/gtk/actions.c @@ -163,6 +163,8 @@ void ui_connect_toggle(GtkAction *action, GtkWidget *widget, const gchar *name, if(toggle != -1) { + GtkAction **list = (GtkAction **) g_object_get_data(G_OBJECT(widget),"toggle_actions"); + list[toggle] = action; g_object_set_data(G_OBJECT(action),"toggle_id",(gpointer) toggle); gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action),(lib3270_get_toggle(GTK_V3270(widget)->host,toggle) != 0)); g_signal_connect(action,"toggled",G_CALLBACK(lib3270_toggle_action),widget); @@ -175,6 +177,11 @@ void ui_connect_toggle(GtkAction *action, GtkWidget *widget, const gchar *name, gtk_action_set_sensitive(action,FALSE); } +void ui_connect_target_action(GtkAction *action, GtkWidget *widget, const gchar *target, const gchar *direction, GError **error) +{ + #warning TODO: Implementar +} + static void action_pfkey(GtkAction *action, GtkWidget *widget) { trace("Action %s activated on widget %p key=%d",gtk_action_get_name(action),widget,g_object_get_data(G_OBJECT(action),"pfkey")); @@ -208,6 +215,11 @@ static void action_unfullscreen(GtkAction *action, GtkWidget *widget) lib3270_set_toggle(GTK_V3270(widget)->host,LIB3270_TOGGLE_FULL_SCREEN,0); } +static void action_pastnext(GtkAction *action, GtkWidget *widget) +{ + lib3270_pastenext(GTK_V3270(widget)->host); +} + void ui_connect_pakey(GtkAction *action, GtkWidget *widget, const gchar *name, const gchar *id) { g_object_set_data(G_OBJECT(action),"pakey",(gpointer) atoi(id)); @@ -221,6 +233,7 @@ void ui_connect_index_action(GtkAction *action, GtkWidget *widget, int ix, GtkAc switch(ix) { case ACTION_PASTENEXT: + g_signal_connect(action,"activate",G_CALLBACK(action_pastnext),widget); break; case ACTION_FULLSCREEN: diff --git a/src/gtk/mainwindow.c b/src/gtk/mainwindow.c index bb9b308..4020674 100644 --- a/src/gtk/mainwindow.c +++ b/src/gtk/mainwindow.c @@ -83,6 +83,7 @@ static void toggle_changed(GtkWidget *widget, LIB3270_TOGGLE id, gboolean toggled, const gchar *name, GtkWindow *toplevel) { + GtkAction **list = (GtkAction **) g_object_get_data(G_OBJECT(widget),"toggle_actions"); gchar *nm = g_ascii_strdown(name,-1); set_boolean_to_config("toggle",nm,toggled); g_free(nm); @@ -95,7 +96,8 @@ gtk_window_unfullscreen(GTK_WINDOW(toplevel)); } - #warning TODO: Update toggle actions. + if(list[id]) + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(list[id]),toggled); } @@ -286,6 +288,7 @@ GtkWidget **popup; int f; + g_object_set_data_full(G_OBJECT(terminal),"toggle_actions",g_new0(GtkAction *,LIB3270_TOGGLE_COUNT),g_free); // Initialize terminal config for(f=0;f #include "3270ds.h" #include "appres.h" -#include "ctlr.h" +// #include "ctlr.h" #include "screen.h" #include "resources.h" @@ -503,7 +503,7 @@ process_ds(unsigned char *buf, int buflen) if (!buflen) return PDS_OKAY_NO_OUTPUT; - scroll_to_bottom(); +// scroll_to_bottom(); trace_ds("< "); @@ -2329,7 +2329,7 @@ ctlr_clear(H3270 *session, Boolean can_snap) if (can_snap && !trace_skipping && toggled(SCREEN_TRACE)) trace_screen(); #endif /*]*/ - scroll_save(session->maxROWS, ever_3270 ? False : True); +// scroll_save(session->maxROWS, ever_3270 ? False : True); } #if defined(X3270_TRACE) /*[*/ trace_skipping = False; @@ -2389,7 +2389,7 @@ ctlr_add(int baddr, unsigned char c, unsigned char cs) if (toggled(SCREEN_TRACE)) trace_screen(); #endif /*]*/ - scroll_save(session->maxROWS, False); +// scroll_save(session->maxROWS, False); trace_primed = False; } /* diff --git a/src/lib3270/ctlr.h b/src/lib3270/ctlr.h index e3e52af..6548621 100644 --- a/src/lib3270/ctlr.h +++ b/src/lib3270/ctlr.h @@ -17,5 +17,7 @@ * External declarations for ctlr.c data structures. */ + #warning Deprecated ctlr.h, please remove it + // extern int buffer_addr; /**< buffer address */ // extern struct ea *ea_buf; /**< 3270 device buffer */ diff --git a/src/lib3270/dialogc.h b/src/lib3270/dialogc.h index 6a9aa40..320f12e 100644 --- a/src/lib3270/dialogc.h +++ b/src/lib3270/dialogc.h @@ -16,3 +16,5 @@ * dialogc.h * Empty definitions for dialog.c. */ + +#warning deprecated dialogc.h diff --git a/src/lib3270/ft.c b/src/lib3270/ft.c index ec02637..eae9493 100644 --- a/src/lib3270/ft.c +++ b/src/lib3270/ft.c @@ -43,7 +43,7 @@ #include "ft_cutc.h" #include "ft_dftc.h" #include "ftc.h" -#include "dialogc.h" +// #include "dialogc.h" #include "hostc.h" #if defined(C3270) || defined(WC3270) #include "icmdc.h" diff --git a/src/lib3270/ft_cut.c b/src/lib3270/ft_cut.c index 3ed1cb4..f37a219 100644 --- a/src/lib3270/ft_cut.c +++ b/src/lib3270/ft_cut.c @@ -44,7 +44,7 @@ // #include #include "appres.h" -#include "ctlr.h" +// #include "ctlr.h" #include "3270ds.h" #include "actionsc.h" diff --git a/src/lib3270/keypadc.h b/src/lib3270/keypadc.h index 175f27e..14d1ea3 100644 --- a/src/lib3270/keypadc.h +++ b/src/lib3270/keypadc.h @@ -17,17 +17,14 @@ * Global declarations for keypad.c. */ -LIB3270_INTERNAL Boolean keypad_changed; - -#if defined(X3270_KEYPAD) /*[*/ +// LIB3270_INTERNAL Boolean keypad_changed; +/* +#if defined(X3270_KEYPAD) -LIB3270_INTERNAL enum kp_placement { - kp_right, kp_left, kp_bottom, kp_integral, kp_inside_right -} kp_placement; +LIB3270_INTERNAL enum kp_placement { kp_right, kp_left, kp_bottom, kp_integral, kp_inside_right } kp_placement; LIB3270_INTERNAL void keypad_first_up(void); -LIB3270_INTERNAL Widget keypad_init(Widget container, Dimension voffset, - Dimension screen_width, Boolean floating, Boolean vert); +LIB3270_INTERNAL Widget keypad_init(Widget container, Dimension voffset, Dimension screen_width, Boolean floating, Boolean vert); LIB3270_INTERNAL void keypad_move(void); LIB3270_INTERNAL void keypad_placement_init(void); LIB3270_INTERNAL void keypad_popup_init(void); @@ -37,7 +34,7 @@ LIB3270_INTERNAL void keypad_set_temp_keymap(XtTranslations trans); LIB3270_INTERNAL void keypad_shift(void); LIB3270_INTERNAL Dimension min_keypad_width(void); -#else /*][*/ +#else #define keypad_qheight() 0 #define min_keypad_width() 0 @@ -50,4 +47,5 @@ LIB3270_INTERNAL Dimension min_keypad_width(void); #define keypad_set_temp_keymap(n) #define keypad_shift() -#endif /*]*/ +#endif +*/ diff --git a/src/lib3270/kybd.c b/src/lib3270/kybd.c index 2fed494..04b3d85 100644 --- a/src/lib3270/kybd.c +++ b/src/lib3270/kybd.c @@ -49,7 +49,7 @@ #include #include "3270ds.h" #include "appres.h" -#include "ctlr.h" +// #include "ctlr.h" #include "resources.h" #include "actionsc.h" @@ -58,7 +58,7 @@ #include "ctlrc.h" #include "ftc.h" #include "hostc.h" -#include "keypadc.h" +// #include "keypadc.h" #include "kybdc.h" #include "popupsc.h" #include "printc.h" @@ -232,7 +232,7 @@ static int enq_chk(void) else { ta_head = ta; - status_typeahead(True); + status_typeahead(&h3270,True); } ta_tail = ta; @@ -263,7 +263,7 @@ static void enq_ta(XtActionProc fn, char *parm1, char *parm2) ta_tail->next = ta; else { ta_head = ta; - status_typeahead(True); + status_typeahead(&h3270,True); } ta_tail = ta; @@ -282,7 +282,7 @@ Boolean run_ta(void) if ((ta_head = ta->next) == (struct ta *)NULL) { ta_tail = (struct ta *)NULL; - status_typeahead(False); + status_typeahead(&h3270,False); } switch(ta->type) @@ -337,7 +337,7 @@ flush_ta(void) any = True; } ta_head = ta_tail = (struct ta *) NULL; - status_typeahead(False); + status_typeahead(&h3270,False); return any; } diff --git a/src/lib3270/objects.h b/src/lib3270/objects.h index 11c8990..c0ce6bd 100644 --- a/src/lib3270/objects.h +++ b/src/lib3270/objects.h @@ -17,10 +17,10 @@ * x3270 object names. */ -#define ObjConfirmButton "confirmButton" -#define ObjConfirm2Button "confirm2Button" -#define ObjCancelButton "cancelButton" +// #define ObjConfirmButton "confirmButton" +// #define ObjConfirm2Button "confirm2Button" +// #define ObjCancelButton "cancelButton" #define ObjDialog "dialog" -#define ObjSmallLabel "smallLabel" +// #define ObjSmallLabel "smallLabel" #define ObjNameLabel "nameLabel" #define ObjDataLabel "dataLabel" diff --git a/src/lib3270/paste.c b/src/lib3270/paste.c index 81487dd..9d2109b 100644 --- a/src/lib3270/paste.c +++ b/src/lib3270/paste.c @@ -47,7 +47,7 @@ #include #include "3270ds.h" #include "appres.h" -#include "ctlr.h" +// #include "ctlr.h" #include "resources.h" #include "actionsc.h" @@ -56,7 +56,7 @@ #include "ctlrc.h" #include "ftc.h" #include "hostc.h" -#include "keypadc.h" +// #include "keypadc.h" #include "kybdc.h" #include "popupsc.h" #include "printc.h" diff --git a/src/lib3270/print.c b/src/lib3270/print.c index 93cb123..53fe28f 100644 --- a/src/lib3270/print.c +++ b/src/lib3270/print.c @@ -39,7 +39,7 @@ #include "appres.h" #include "3270ds.h" -#include "ctlr.h" +// #include "ctlr.h" #include "ctlrc.h" #include "tablesc.h" diff --git a/src/lib3270/printer.c b/src/lib3270/printer.c index 1396aff..78de4e4 100644 --- a/src/lib3270/printer.c +++ b/src/lib3270/printer.c @@ -54,7 +54,7 @@ #include "appres.h" #include "objects.h" #include "resources.h" -#include "ctlr.h" +// #include "ctlr.h" #include "charsetc.h" #include "ctlrc.h" diff --git a/src/lib3270/savec.h b/src/lib3270/savec.h index f38a6a7..5aa4bf6 100644 --- a/src/lib3270/savec.h +++ b/src/lib3270/savec.h @@ -14,6 +14,9 @@ /* Non-display version of savec.h */ +/* + #define save_yourself() LIB3270_INTERNAL char *command_string; +*/ diff --git a/src/lib3270/screen.c b/src/lib3270/screen.c index 581aba9..5530784 100644 --- a/src/lib3270/screen.c +++ b/src/lib3270/screen.c @@ -40,7 +40,7 @@ #include "appres.h" #include "3270ds.h" #include "resources.h" -#include "ctlr.h" +// #include "ctlr.h" #include "actionsc.h" #include "ctlrc.h" @@ -708,7 +708,7 @@ LIB3270_EXPORT void lib3270_set_popup_handler(int (*handler)(H3270 *, LIB3270_NO popup_handler = handler ? handler : logpopup; } -LIB3270_EXPORT lib3270_popup_dialog(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, ...) +LIB3270_EXPORT void lib3270_popup_dialog(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, ...) { va_list args; diff --git a/src/lib3270/screen.h b/src/lib3270/screen.h index 4214aa6..7c2dafc 100644 --- a/src/lib3270/screen.h +++ b/src/lib3270/screen.h @@ -14,9 +14,9 @@ /* Non-display version of screen.h */ -#define SELECTED(baddr) False +// #define SELECTED(baddr) False LIB3270_INTERNAL int *char_width, *char_height; -LIB3270_INTERNAL Boolean screen_has_changes; +// LIB3270_INTERNAL Boolean screen_has_changes; // LIB3270_INTERNAL void screen_update(H3270 *session, int bstart, int bend); diff --git a/src/lib3270/scrollc.h b/src/lib3270/scrollc.h index 6a54525..4cfb82e 100644 --- a/src/lib3270/scrollc.h +++ b/src/lib3270/scrollc.h @@ -14,5 +14,5 @@ /* Non-display version of scrollc.h */ -#define scroll_save(n, trim_blanks) -#define scroll_to_bottom() +// #define scroll_save(n, trim_blanks) +// #define scroll_to_bottom() diff --git a/src/lib3270/selection.c b/src/lib3270/selection.c index 88d328a..20d4505 100644 --- a/src/lib3270/selection.c +++ b/src/lib3270/selection.c @@ -28,7 +28,7 @@ */ #include "globals.h" - #include "ctlr.h" +// #include "ctlr.h" #include "appres.h" #include #include @@ -347,3 +347,45 @@ LIB3270_EXPORT char * lib3270_get_selected(H3270 *hSession) return realloc(ret,sz+1); } +LIB3270_EXPORT int lib3270_move_selection(H3270 *hSession, LIB3270_DIRECTION dir) +{ + if(!hSession->selected || hSession->select.begin == hSession->select.end) + return ENOENT; + + switch(dir) + { + case LIB3270_DIR_UP: + if(hSession->select.begin <= hSession->cols) + return EINVAL; + hSession->select.begin -= hSession->cols; + hSession->select.end -= hSession->cols; + break; + + case LIB3270_DIR_DOWN: + if(hSession->select.end >= (hSession->cols * (hSession->rows-1))) + return EINVAL; + hSession->select.begin += hSession->cols; + hSession->select.end += hSession->cols; + break; + + case LIB3270_DIR_LEFT: + if( (hSession->select.begin % hSession->cols) < 1) + return EINVAL; + hSession->select.begin--; + hSession->select.end--; + break; + + case LIB3270_DIR_RIGHT: + if( (hSession->select.end % hSession->cols) >= hSession->cols) + return EINVAL; + hSession->select.begin++; + hSession->select.end++; + break; + + default: + return -1; + } + + update_selection(hSession); + return 0; +} diff --git a/src/lib3270/sf.c b/src/lib3270/sf.c index c4d0f9a..f79eaa4 100644 --- a/src/lib3270/sf.c +++ b/src/lib3270/sf.c @@ -45,7 +45,7 @@ #include "3270ds.h" #include "appres.h" #include "screen.h" -#include "ctlr.h" +// #include "ctlr.h" #include "resources.h" #include "charsetc.h" diff --git a/src/lib3270/statusc.h b/src/lib3270/statusc.h index d683223..633cd0a 100644 --- a/src/lib3270/statusc.h +++ b/src/lib3270/statusc.h @@ -34,7 +34,7 @@ LIB3270_INTERNAL void status_changed(H3270 *session, LIB3270_STATUS id); LIB3270_INTERNAL void set_status(H3270 *session, OIA_FLAG id, Boolean on); -#define status_typeahead(on) set_status(NULL,OIA_FLAG_TYPEAHEAD,on) +#define status_typeahead(h,on) set_status(h,OIA_FLAG_TYPEAHEAD,on) #define status_kybdlock() status_changed(NULL,LIB3270_STATUS_KYBDLOCK) #define status_syswait() status_changed(NULL,LIB3270_STATUS_SYSWAIT) #define status_minus() status_changed(NULL,LIB3270_STATUS_MINUS) diff --git a/src/lib3270/trace_ds.c b/src/lib3270/trace_ds.c index 83ee48b..a99ccf3 100644 --- a/src/lib3270/trace_ds.c +++ b/src/lib3270/trace_ds.c @@ -56,7 +56,7 @@ #include "appres.h" #include "objects.h" #include "resources.h" -#include "ctlr.h" +// #include "ctlr.h" #include "charsetc.h" #include "childc.h" @@ -422,7 +422,7 @@ create_tracefile_header(const char *mode) clk = time((time_t *)0); wtrace("Trace %s %s", mode, ctime(&clk)); wtrace(" Version: %s\n", build); - save_yourself(); +// save_yourself(); // wtrace(" Command: %s\n", command_string); wtrace(" Model %s", h3270.model_name); wtrace(", %s display", appres.mono ? "monochrome" : "color"); -- libgit2 0.21.2