Commit ba9c900fcf2a9a193614857c85c5ce347b282c6f
1 parent
0b04128a
Exists in
master
and in
5 other branches
Incluindo parâmetro para definir quebra de linha na requisição via D-Bus.
Showing
4 changed files
with
14 additions
and
3 deletions
Show diff stats
src/plugins/dbus3270/gobject.c
| ... | ... | @@ -314,7 +314,7 @@ void pw3270_dbus_get_text_at(PW3270Dbus *object, int row, int col, int len, DBus |
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | - void pw3270_dbus_get_text(PW3270Dbus *object, int offset, int len, DBusGMethodInvocation *context) | |
| 317 | + void pw3270_dbus_get_text(PW3270Dbus *object, int offset, int len, char lf, DBusGMethodInvocation *context) | |
| 318 | 318 | { |
| 319 | 319 | gchar * text; |
| 320 | 320 | H3270 * hSession = pw3270_dbus_get_session_handle(object); |
| ... | ... | @@ -323,7 +323,11 @@ void pw3270_dbus_get_text_at(PW3270Dbus *object, int row, int col, int len, DBus |
| 323 | 323 | if(pw3270_dbus_check_valid_state(object,context)) |
| 324 | 324 | return; |
| 325 | 325 | |
| 326 | - text = lib3270_get_text(hSession,offset,len,'\n'); | |
| 326 | + if(len < 0) { | |
| 327 | + len = lib3270_get_length(hSession); | |
| 328 | + } | |
| 329 | + | |
| 330 | + text = lib3270_get_text(hSession,offset,len,lf); | |
| 327 | 331 | if(!text) |
| 328 | 332 | { |
| 329 | 333 | GError *error = pw3270_dbus_get_error_from_errno(errno); |
| ... | ... | @@ -336,6 +340,8 @@ void pw3270_dbus_get_text_at(PW3270Dbus *object, int row, int col, int len, DBus |
| 336 | 340 | |
| 337 | 341 | lib3270_free(text); |
| 338 | 342 | |
| 343 | + debug("\n%s\n",utftext); | |
| 344 | + | |
| 339 | 345 | dbus_g_method_return(context,utftext); |
| 340 | 346 | |
| 341 | 347 | g_free(utftext); | ... | ... |
src/plugins/dbus3270/pw3270dbus.xml
| ... | ... | @@ -79,6 +79,7 @@ |
| 79 | 79 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> |
| 80 | 80 | <arg type="i" name="addr" direction="in" /> |
| 81 | 81 | <arg type="i" name="len" direction="in" /> |
| 82 | + <arg type="y" name="lf" direction="in" /> | |
| 82 | 83 | <arg type="s" name="text" direction="out" /> |
| 83 | 84 | </method> |
| 84 | 85 | <method name="setClipboard"> | ... | ... |
src/plugins/dbus3270/service.h
| ... | ... | @@ -113,7 +113,7 @@ |
| 113 | 113 | void pw3270_dbus_pa_key(PW3270Dbus *object, int key, DBusGMethodInvocation *context); |
| 114 | 114 | void pw3270_dbus_set_text_at(PW3270Dbus *object, int row, int col, const gchar *text, DBusGMethodInvocation *context); |
| 115 | 115 | void pw3270_dbus_get_text_at(PW3270Dbus *object, int row, int col, int len, DBusGMethodInvocation *context); |
| 116 | - void pw3270_dbus_get_text(PW3270Dbus *object, int offset, int len, DBusGMethodInvocation *context); | |
| 116 | + void pw3270_dbus_get_text(PW3270Dbus *object, int offset, int len, char lf, DBusGMethodInvocation *context); | |
| 117 | 117 | void pw3270_dbus_cmp_text_at(PW3270Dbus *object, int row, int col, const gchar *text, DBusGMethodInvocation *context); |
| 118 | 118 | void pw3270_dbus_input(PW3270Dbus *object, const gchar *utftext, DBusGMethodInvocation *context); |
| 119 | 119 | ... | ... |
src/plugins/dbus3270/test.sh
| ... | ... | @@ -41,6 +41,10 @@ run_command() |
| 41 | 41 | dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getScreenContents |
| 42 | 42 | ;; |
| 43 | 43 | |
| 44 | + gettext) | |
| 45 | + dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getText int32:1 int32:-1 byte:0 | |
| 46 | + ;; | |
| 47 | + | |
| 44 | 48 | protect) |
| 45 | 49 | dbus-send --session --print-reply --dest=$DEST.$SESSION $BPATH $DEST.getIsProtectedAt int32:$2 int32:$3 |
| 46 | 50 | ;; | ... | ... |