Commit b7cc91ca9019231adc232377060bd499f820d6c4
1 parent
96ed31d5
Exists in
master
and in
5 other branches
Incluindo método para setar string no plugin dbus
Showing
4 changed files
with
27 additions
and
0 deletions
Show diff stats
src/plugins/dbus3270/gobject.c
... | ... | @@ -198,3 +198,19 @@ void pw3270_dbus_enter(PW3270Dbus *object, DBusGMethodInvocation *context) |
198 | 198 | return; |
199 | 199 | dbus_g_method_return(context,lib3270_enter(pw3270_dbus_get_session_handle(object))); |
200 | 200 | } |
201 | + | |
202 | +void pw3270_dbus_set_text_at(PW3270Dbus *object, int row, int col, const gchar *utftext, DBusGMethodInvocation *context) | |
203 | +{ | |
204 | + gchar * text; | |
205 | + H3270 * hSession = pw3270_dbus_get_session_handle(object); | |
206 | + | |
207 | + trace("%s object=%p context=%p",__FUNCTION__,object,context); | |
208 | + if(pw3270_dbus_check_valid_state(object,context)) | |
209 | + return; | |
210 | + | |
211 | + text = g_convert_with_fallback(utftext,-1,lib3270_get_charset(hSession),"UTF-8","?",NULL,NULL,NULL); | |
212 | + | |
213 | + dbus_g_method_return(context,lib3270_set_string_at(hSession,row,col,(const unsigned char *) text)); | |
214 | + | |
215 | + g_free(text); | |
216 | +} | ... | ... |
src/plugins/dbus3270/pw3270dbus.xml
... | ... | @@ -30,5 +30,11 @@ |
30 | 30 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> |
31 | 31 | <arg type="i" name="result" direction="out" /> |
32 | 32 | </method> |
33 | + <method name="setTextAt"> | |
34 | + <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
35 | + <arg type="i" name="row" direction="in" /> | |
36 | + <arg type="i" name="col" direction="in" /> | |
37 | + <arg type="s" name="text" direction="in" /> | |
38 | + </method> | |
33 | 39 | </interface> |
34 | 40 | </node> | ... | ... |
src/plugins/dbus3270/service.h
src/plugins/dbus3270/test.sh
... | ... | @@ -26,6 +26,10 @@ case $1 in |
26 | 26 | dbus-send --session --print-reply --dest=br.com.bb.pw3270 /br/com/bb/pw3270 br.com.bb.pw3270.getScreenContents |
27 | 27 | ;; |
28 | 28 | |
29 | + set) | |
30 | + dbus-send --session --print-reply --dest=br.com.bb.pw3270 /br/com/bb/pw3270 br.com.bb.pw3270.setTextAt int32:$2 int32:$3 string:$4 | |
31 | + ;; | |
32 | + | |
29 | 33 | enter) |
30 | 34 | dbus-send --session --print-reply --dest=br.com.bb.pw3270 /br/com/bb/pw3270 br.com.bb.pw3270.enter |
31 | 35 | ;; | ... | ... |