Commit e2cef7b423511b4487ec309495b9bea05b0ed55b

Authored by perry.werneck@gmail.com
1 parent 8e0eafe5

Implementando toggles no objeto rexx

src/plugins/rx3270/rexx_methods.cc
... ... @@ -188,3 +188,83 @@ RexxMethod4(int, rx3270_method_cmp_text_at, CSELF, sessionPtr, int, row, int, co
188 188 return rc;
189 189 }
190 190  
  191 +RexxMethod2(int, rx3270_method_event_trace, CSELF, sessionPtr, int, flag)
  192 +{
  193 + rx3270 *hSession = (rx3270 *) sessionPtr;
  194 + if(!hSession)
  195 + return -1;
  196 + hSession->set_toggle(LIB3270_TOGGLE_EVENT_TRACE,flag);
  197 + return 0;
  198 +}
  199 +
  200 +RexxMethod2(int, rx3270_method_screen_trace, CSELF, sessionPtr, int, flag)
  201 +{
  202 + rx3270 *hSession = (rx3270 *) sessionPtr;
  203 + if(!hSession)
  204 + return -1;
  205 + hSession->set_toggle(LIB3270_TOGGLE_SCREEN_TRACE,flag);
  206 + return 0;
  207 +
  208 +}
  209 +
  210 +RexxMethod2(int, rx3270_method_data_trace, CSELF, sessionPtr, int, flag)
  211 +{
  212 + rx3270 *hSession = (rx3270 *) sessionPtr;
  213 + if(!hSession)
  214 + return -1;
  215 + hSession->set_toggle(LIB3270_TOGGLE_DS_TRACE,flag);
  216 + return 0;
  217 +}
  218 +
  219 +RexxMethod3(int, rx3270_method_set_toggle, CSELF, sessionPtr, CSTRING, name, int, flag)
  220 +{
  221 + static const struct _toggle_info
  222 + {
  223 + const char * name;
  224 + LIB3270_TOGGLE id;
  225 + }
  226 + toggle[LIB3270_TOGGLE_COUNT] =
  227 + {
  228 + { "monocase", LIB3270_TOGGLE_MONOCASE },
  229 + { "cursorblink", LIB3270_TOGGLE_CURSOR_BLINK },
  230 + { "showtiming", LIB3270_TOGGLE_SHOW_TIMING },
  231 + { "cursorpos", LIB3270_TOGGLE_CURSOR_POS },
  232 + { "dstrace", LIB3270_TOGGLE_DS_TRACE },
  233 + { "linewrap", LIB3270_TOGGLE_LINE_WRAP },
  234 + { "blankfill", LIB3270_TOGGLE_BLANK_FILL },
  235 + { "screentrace", LIB3270_TOGGLE_SCREEN_TRACE },
  236 + { "eventtrace", LIB3270_TOGGLE_EVENT_TRACE },
  237 + { "marginedpaste", LIB3270_TOGGLE_MARGINED_PASTE },
  238 + { "rectselect", LIB3270_TOGGLE_RECTANGLE_SELECT },
  239 + { "crosshair", LIB3270_TOGGLE_CROSSHAIR },
  240 + { "fullscreen", LIB3270_TOGGLE_FULL_SCREEN },
  241 + { "reconnect", LIB3270_TOGGLE_RECONNECT },
  242 + { "insert", LIB3270_TOGGLE_INSERT },
  243 + { "smartpaste", LIB3270_TOGGLE_SMART_PASTE },
  244 + { "bold", LIB3270_TOGGLE_BOLD },
  245 + { "keepselected", LIB3270_TOGGLE_KEEP_SELECTED },
  246 + { "underline", LIB3270_TOGGLE_UNDERLINE },
  247 + { "autoconnect", LIB3270_TOGGLE_CONNECT_ON_STARTUP },
  248 + { "kpalternative", LIB3270_TOGGLE_KP_ALTERNATIVE },
  249 + { "beep", LIB3270_TOGGLE_BEEP },
  250 + { "fieldattr", LIB3270_TOGGLE_VIEW_FIELD },
  251 + { "altscreen", LIB3270_TOGGLE_ALTSCREEN }
  252 + };
  253 +
  254 + rx3270 *hSession = (rx3270 *) sessionPtr;
  255 + if(hSession)
  256 + {
  257 + for(int f = 0; f < LIB3270_TOGGLE_COUNT; f++)
  258 + {
  259 + if(!strcasecmp(name,toggle[f].name))
  260 + {
  261 + hSession->set_toggle(toggle[f].id,flag);
  262 + return 0;
  263 + }
  264 + }
  265 + return ENOENT;
  266 + }
  267 + return -1;
  268 +}
  269 +
  270 +
... ...
src/plugins/rx3270/rx3270.cls
... ... @@ -53,6 +53,11 @@
53 53 ::METHOD PFKEY EXTERNAL "LIBRARY rx3270 rx3270_method_pfkey"
54 54 ::METHOD PFKEY EXTERNAL "LIBRARY rx3270 rx3270_method_pakey"
55 55  
  56 +::METHOD OPTION EXTERNAL "LIBRARY rx3270 rx3270_method_set_toggle"
  57 +::METHOD EVENTTRACE EXTERNAL "LIBRARY rx3270 rx3270_method_event_trace"
  58 +::METHOD SCREENTRACE EXTERNAL "LIBRARY rx3270 rx3270_method_screen_trace"
  59 +::METHOD DSTRACE EXTERNAL "LIBRARY rx3270 rx3270_method_ds_trace"
  60 +
56 61 ::METHOD GETTEXTAT EXTERNAL "LIBRARY rx3270 rx3270_method_get_text_at"
57 62 ::METHOD SETTEXTAT EXTERNAL "LIBRARY rx3270 rx3270_method_set_text_at"
58 63 ::METHOD CMPTEXTAT EXTERNAL "LIBRARY rx3270 rx3270_method_cmp_text_at"
... ...
src/plugins/rx3270/rx3270.h
... ... @@ -85,6 +85,10 @@
85 85 REXX_METHOD_PROTOTYPE(rx3270_method_get_text_at);
86 86 REXX_METHOD_PROTOTYPE(rx3270_method_set_text_at);
87 87 REXX_METHOD_PROTOTYPE(rx3270_method_cmp_text_at);
  88 + REXX_METHOD_PROTOTYPE(rx3270_method_event_trace);
  89 + REXX_METHOD_PROTOTYPE(rx3270_method_screen_trace);
  90 + REXX_METHOD_PROTOTYPE(rx3270_method_data_trace);
  91 + REXX_METHOD_PROTOTYPE(rx3270_method_set_toggle);
88 92  
89 93 /*---[ Globals ]---------------------------------------------------------------------------------------------*/
90 94  
... ...
src/plugins/rx3270/rxapimain.cc
... ... @@ -126,6 +126,10 @@ RexxMethodEntry rx3270_methods[] =
126 126 REXX_METHOD(rx3270_method_get_text_at, rx3270_method_get_text_at ),
127 127 REXX_METHOD(rx3270_method_set_text_at, rx3270_method_set_text_at ),
128 128 REXX_METHOD(rx3270_method_cmp_text_at, rx3270_method_cmp_text_at ),
  129 + REXX_METHOD(rx3270_method_event_trace, rx3270_method_event_trace ),
  130 + REXX_METHOD(rx3270_method_screen_trace, rx3270_method_screen_trace ),
  131 + REXX_METHOD(rx3270_method_data_trace, rx3270_method_data_trace ),
  132 + REXX_METHOD(rx3270_method_set_toggle, rx3270_method_set_toggle ),
129 133  
130 134 REXX_LAST_METHOD()
131 135 };
... ...