Commit 3d16be9a32cd7dc2959e8838633299e4c75be68d
1 parent
6d7b2852
Exists in
master
and in
5 other branches
Incluindo novos métodos para limpeza de tela
Showing
9 changed files
with
163 additions
and
0 deletions
Show diff stats
src/include/pw3270/hllapi.h
... | ... | @@ -101,7 +101,12 @@ extern "C" { |
101 | 101 | HLLAPI_API_CALL hllapi_pakey(WORD key); |
102 | 102 | HLLAPI_API_CALL hllapi_setcursor(WORD key); |
103 | 103 | HLLAPI_API_CALL hllapi_getcursor(); |
104 | + | |
105 | + HLLAPI_API_CALL hllapi_erase(void); | |
104 | 106 | HLLAPI_API_CALL hllapi_erase_eof(void); |
107 | + HLLAPI_API_CALL hllapi_erase_eol(void); | |
108 | + HLLAPI_API_CALL hllapi_erase_input(void); | |
109 | + | |
105 | 110 | HLLAPI_API_CALL hllapi_print(void); |
106 | 111 | |
107 | 112 | HLLAPI_API_CALL hllapi(const LPWORD func, LPSTR str, LPWORD length, LPWORD rc); | ... | ... |
src/java/actions.cc
... | ... | @@ -72,6 +72,63 @@ JNIEXPORT jint JNICALL Java_pw3270_terminal_erase_1eof(JNIEnv *env, jobject obj) |
72 | 72 | |
73 | 73 | } |
74 | 74 | |
75 | +JNIEXPORT jint JNICALL Java_pw3270_terminal_erase(JNIEnv *env, jobject obj) { | |
76 | + | |
77 | + jint rc = -1; | |
78 | + | |
79 | + try { | |
80 | + | |
81 | + rc = java::getHandle(env,obj)->erase(); | |
82 | + | |
83 | + } catch(std::exception &e) { | |
84 | + | |
85 | + env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); | |
86 | + return -1; | |
87 | + | |
88 | + } | |
89 | + | |
90 | + return rc; | |
91 | + | |
92 | +} | |
93 | +JNIEXPORT jint JNICALL Java_pw3270_terminal_erase_1eol(JNIEnv *env, jobject obj) { | |
94 | + | |
95 | + jint rc = -1; | |
96 | + | |
97 | + try { | |
98 | + | |
99 | + rc = java::getHandle(env,obj)->erase_eol(); | |
100 | + | |
101 | + } catch(std::exception &e) { | |
102 | + | |
103 | + env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); | |
104 | + return -1; | |
105 | + | |
106 | + } | |
107 | + | |
108 | + return rc; | |
109 | + | |
110 | +} | |
111 | + | |
112 | +JNIEXPORT jint JNICALL Java_pw3270_terminal_erase_1input(JNIEnv *env, jobject obj) { | |
113 | + | |
114 | + jint rc = -1; | |
115 | + | |
116 | + try { | |
117 | + | |
118 | + rc = java::getHandle(env,obj)->erase_input(); | |
119 | + | |
120 | + } catch(std::exception &e) { | |
121 | + | |
122 | + env->ThrowNew(env->FindClass("java/lang/Exception"), e.what()); | |
123 | + return -1; | |
124 | + | |
125 | + } | |
126 | + | |
127 | + return rc; | |
128 | + | |
129 | +} | |
130 | + | |
131 | + | |
75 | 132 | JNIEXPORT jint JNICALL Java_pw3270_terminal_print(JNIEnv *env, jobject obj) { |
76 | 133 | |
77 | 134 | jint rc = -1; | ... | ... |
src/java/terminal.java
... | ... | @@ -201,6 +201,11 @@ public class terminal |
201 | 201 | */ |
202 | 202 | public native int quit(); |
203 | 203 | |
204 | + public native int erase(); | |
205 | + public native int erase_eol(); | |
206 | + public native int erase_input(); | |
207 | + | |
208 | + | |
204 | 209 | /** |
205 | 210 | * Erase from cursor position until the end of the field. |
206 | 211 | * | ... | ... |
src/plugins/hllapi/calls.cc
... | ... | @@ -290,12 +290,31 @@ |
290 | 290 | return HLLAPI_STATUS_SUCCESS; |
291 | 291 | } |
292 | 292 | |
293 | + HLLAPI_API_CALL hllapi_erase(void) | |
294 | + { | |
295 | + session::get_default()->erase(); | |
296 | + return HLLAPI_STATUS_SUCCESS; | |
297 | + } | |
298 | + | |
293 | 299 | HLLAPI_API_CALL hllapi_erase_eof(void) |
294 | 300 | { |
295 | 301 | session::get_default()->erase_eof(); |
296 | 302 | return HLLAPI_STATUS_SUCCESS; |
297 | 303 | } |
298 | 304 | |
305 | + HLLAPI_API_CALL hllapi_erase_eol(void) | |
306 | + { | |
307 | + session::get_default()->erase_eol(); | |
308 | + return HLLAPI_STATUS_SUCCESS; | |
309 | + } | |
310 | + | |
311 | + HLLAPI_API_CALL hllapi_erase_input(void) | |
312 | + { | |
313 | + session::get_default()->erase_input(); | |
314 | + return HLLAPI_STATUS_SUCCESS; | |
315 | + } | |
316 | + | |
317 | + | |
299 | 318 | HLLAPI_API_CALL hllapi_print(void) |
300 | 319 | { |
301 | 320 | return session::get_default()->print(); | ... | ... |
src/plugins/rx3270/rexx_methods.cc
... | ... | @@ -185,6 +185,39 @@ RexxMethod1(int, rx3270_method_enter, CSELF, sessionPtr) |
185 | 185 | return hSession->enter(); |
186 | 186 | } |
187 | 187 | |
188 | +RexxMethod1(int, rx3270_method_erase, CSELF, sessionPtr) | |
189 | +{ | |
190 | + session *hSession = (session *) sessionPtr; | |
191 | + if(!hSession) | |
192 | + return -1; | |
193 | + return hSession->erase(); | |
194 | +} | |
195 | + | |
196 | +RexxMethod1(int, rx3270_method_erase_eof, CSELF, sessionPtr) | |
197 | +{ | |
198 | + session *hSession = (session *) sessionPtr; | |
199 | + if(!hSession) | |
200 | + return -1; | |
201 | + return hSession->erase_eof(); | |
202 | +} | |
203 | + | |
204 | +RexxMethod1(int, rx3270_method_erase_eol, CSELF, sessionPtr) | |
205 | +{ | |
206 | + session *hSession = (session *) sessionPtr; | |
207 | + if(!hSession) | |
208 | + return -1; | |
209 | + return hSession->erase_eol(); | |
210 | +} | |
211 | + | |
212 | +RexxMethod1(int, rx3270_method_erase_input, CSELF, sessionPtr) | |
213 | +{ | |
214 | + session *hSession = (session *) sessionPtr; | |
215 | + if(!hSession) | |
216 | + return -1; | |
217 | + return hSession->erase_input(); | |
218 | +} | |
219 | + | |
220 | + | |
188 | 221 | RexxMethod2(int, rx3270_method_pfkey, CSELF, sessionPtr, int, key) |
189 | 222 | { |
190 | 223 | session *hSession = (session *) sessionPtr; | ... | ... |
src/plugins/rx3270/rx3270.cls
... | ... | @@ -59,6 +59,11 @@ |
59 | 59 | ::METHOD PFKEY EXTERNAL "LIBRARY rx3270 rx3270_method_pfkey" |
60 | 60 | ::METHOD PAKEY EXTERNAL "LIBRARY rx3270 rx3270_method_pakey" |
61 | 61 | |
62 | +::METHOD ERASE EXTERNAL "LIBRARY rx3270 rx3270_method_erase" | |
63 | +::METHOD ERASEEOF EXTERNAL "LIBRARY rx3270 rx3270_method_erase_eof" | |
64 | +::METHOD ERASEEOL EXTERNAL "LIBRARY rx3270 rx3270_method_erase_eol" | |
65 | +::METHOD ERASEINPUT EXTERNAL "LIBRARY rx3270 rx3270_method_erase_input" | |
66 | + | |
62 | 67 | ::METHOD OPTION EXTERNAL "LIBRARY rx3270 rx3270_method_set_option" |
63 | 68 | ::METHOD EVENTTRACE EXTERNAL "LIBRARY rx3270 rx3270_method_event_trace" |
64 | 69 | ::METHOD SCREENTRACE EXTERNAL "LIBRARY rx3270 rx3270_method_screen_trace" | ... | ... |
src/plugins/rx3270/rx3270.h
... | ... | @@ -88,6 +88,11 @@ |
88 | 88 | REXX_TYPED_ROUTINE_PROTOTYPE(ebc2asc); |
89 | 89 | REXX_TYPED_ROUTINE_PROTOTYPE(asc2ebc); |
90 | 90 | |
91 | + REXX_TYPED_ROUTINE_PROTOTYPE(rx3270Erase); | |
92 | + REXX_TYPED_ROUTINE_PROTOTYPE(rx3270EraseEOF); | |
93 | + REXX_TYPED_ROUTINE_PROTOTYPE(rx3270EraseEOL); | |
94 | + REXX_TYPED_ROUTINE_PROTOTYPE(rx3270EraseInput); | |
95 | + | |
91 | 96 | REXX_METHOD_PROTOTYPE(rx3270_method_version); |
92 | 97 | REXX_METHOD_PROTOTYPE(rx3270_method_revision); |
93 | 98 | REXX_METHOD_PROTOTYPE(rx3270_method_init); |
... | ... | @@ -102,6 +107,10 @@ |
102 | 107 | REXX_METHOD_PROTOTYPE(rx3270_method_get_cursor_addr); |
103 | 108 | REXX_METHOD_PROTOTYPE(rx3270_method_set_cursor_addr); |
104 | 109 | REXX_METHOD_PROTOTYPE(rx3270_method_enter); |
110 | + REXX_METHOD_PROTOTYPE(rx3270_method_erase); | |
111 | + REXX_METHOD_PROTOTYPE(rx3270_method_erase_eof); | |
112 | + REXX_METHOD_PROTOTYPE(rx3270_method_erase_eol); | |
113 | + REXX_METHOD_PROTOTYPE(rx3270_method_erase_input); | |
105 | 114 | REXX_METHOD_PROTOTYPE(rx3270_method_pfkey); |
106 | 115 | REXX_METHOD_PROTOTYPE(rx3270_method_pakey); |
107 | 116 | REXX_METHOD_PROTOTYPE(rx3270_method_get_text); | ... | ... |
src/plugins/rx3270/rxapimain.cc
... | ... | @@ -113,6 +113,12 @@ RexxRoutineEntry rx3270_functions[] = |
113 | 113 | REXX_TYPED_ROUTINE(rx3270queryStringAt, rx3270queryStringAt), |
114 | 114 | REXX_TYPED_ROUTINE(rx3270SetStringAt, rx3270SetStringAt), |
115 | 115 | REXX_TYPED_ROUTINE(rx3270CloseApplication, rx3270CloseApplication), |
116 | + | |
117 | + REXX_TYPED_ROUTINE(rx3270Erase, rx3270Erase), | |
118 | + REXX_TYPED_ROUTINE(rx3270EraseEOF, rx3270EraseEOF), | |
119 | + REXX_TYPED_ROUTINE(rx3270EraseEOL, rx3270EraseEOL), | |
120 | + REXX_TYPED_ROUTINE(rx3270EraseInput, rx3270EraseInput), | |
121 | + | |
116 | 122 | REXX_TYPED_ROUTINE(ebc2asc, ebc2asc), |
117 | 123 | REXX_TYPED_ROUTINE(asc2ebc, asc2ebc), |
118 | 124 | |
... | ... | @@ -138,6 +144,10 @@ RexxMethodEntry rx3270_methods[] = |
138 | 144 | REXX_METHOD(rx3270_method_set_cursor, rx3270_method_get_cursor_addr ), |
139 | 145 | REXX_METHOD(rx3270_method_set_cursor, rx3270_method_set_cursor_addr ), |
140 | 146 | REXX_METHOD(rx3270_method_enter, rx3270_method_enter ), |
147 | + REXX_METHOD(rx3270_method_enter, rx3270_method_erase ), | |
148 | + REXX_METHOD(rx3270_method_enter, rx3270_method_erase_eof ), | |
149 | + REXX_METHOD(rx3270_method_enter, rx3270_method_erase_eol ), | |
150 | + REXX_METHOD(rx3270_method_enter, rx3270_method_erase_input ), | |
141 | 151 | REXX_METHOD(rx3270_method_pfkey, rx3270_method_pfkey ), |
142 | 152 | REXX_METHOD(rx3270_method_pakey, rx3270_method_pakey ), |
143 | 153 | REXX_METHOD(rx3270_method_get_text, rx3270_method_get_text ), | ... | ... |
src/plugins/rx3270/typed_routines.cc
... | ... | @@ -116,6 +116,26 @@ RexxRoutine0(int, rx3270SendENTERKey) |
116 | 116 | return session::get_default()->enter(); |
117 | 117 | } |
118 | 118 | |
119 | +RexxRoutine0(int, rx3270Erase) | |
120 | +{ | |
121 | + return session::get_default()->erase(); | |
122 | +} | |
123 | + | |
124 | +RexxRoutine0(int, rx3270EraseEOF) | |
125 | +{ | |
126 | + return session::get_default()->erase_eof(); | |
127 | +} | |
128 | + | |
129 | +RexxRoutine0(int, rx3270EraseEOL) | |
130 | +{ | |
131 | + return session::get_default()->erase_eol(); | |
132 | +} | |
133 | + | |
134 | +RexxRoutine0(int, rx3270EraseInput) | |
135 | +{ | |
136 | + return session::get_default()->erase_input(); | |
137 | +} | |
138 | + | |
119 | 139 | RexxRoutine1(int, rx3270SendPFKey, int, key) |
120 | 140 | { |
121 | 141 | return session::get_default()->pfkey(key); | ... | ... |