Commit 0c538e094194347795ea435b8191d55a8b921df9
1 parent
5d49399a
Exists in
master
Implementando mais métodos no módulo de serviço.
Showing
3 changed files
with
41 additions
and
0 deletions
Show diff stats
src/gobject.c
... | ... | @@ -348,3 +348,29 @@ void pw3270_dbus_set_auto_close(PW3270Dbus *object, const gchar *id, int timeout |
348 | 348 | |
349 | 349 | dbus_g_method_return(context,0); |
350 | 350 | } |
351 | + | |
352 | +void pw3270_dbus_get_program_message(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context) { | |
353 | + | |
354 | + struct session * ses = session_find(id); | |
355 | + | |
356 | + if(!ses) { | |
357 | + pw3270_dbus_return_error(context,ENOENT); | |
358 | + return; | |
359 | + } | |
360 | + | |
361 | + dbus_g_method_return(context,lib3270_get_program_message(ses->host)); | |
362 | + | |
363 | +} | |
364 | + | |
365 | +void pw3270_dbus_get_secure_state(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context) { | |
366 | + | |
367 | + struct session * ses = session_find(id); | |
368 | + | |
369 | + if(!ses) { | |
370 | + pw3270_dbus_return_error(context,ENOENT); | |
371 | + return; | |
372 | + } | |
373 | + | |
374 | + dbus_g_method_return(context,(int) lib3270_get_secure(ses->host)); | |
375 | + | |
376 | +} | ... | ... |
src/pw3270service.xml
... | ... | @@ -141,6 +141,18 @@ |
141 | 141 | <arg type="i" name="rc" direction="out" /> |
142 | 142 | </method> |
143 | 143 | |
144 | + <method name="getProgramMessage"> | |
145 | + <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
146 | + <arg type="s" name="id" direction="in" /> | |
147 | + <arg type="i" name="status" direction="out" /> | |
148 | + </method> | |
149 | + | |
150 | + <method name="getSecureState"> | |
151 | + <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | |
152 | + <arg type="s" name="id" direction="in" /> | |
153 | + <arg type="i" name="status" direction="out" /> | |
154 | + </method> | |
155 | + | |
144 | 156 | </interface> |
145 | 157 | |
146 | 158 | </node> | ... | ... |
src/service.h
... | ... | @@ -86,6 +86,9 @@ |
86 | 86 | void pw3270_dbus_set_timeout(PW3270Dbus *object, const gchar *id, int timeout, DBusGMethodInvocation *context); |
87 | 87 | void pw3270_dbus_set_auto_close(PW3270Dbus *object, const gchar *id, int timeout, DBusGMethodInvocation *context); |
88 | 88 | |
89 | + void pw3270_dbus_get_program_message(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context); | |
90 | + void pw3270_dbus_get_secure_state(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context); | |
91 | + | |
89 | 92 | /* |
90 | 93 | void pw3270_dbus_quit(PW3270Dbus *object, DBusGMethodInvocation *context); |
91 | 94 | void pw3270_dbus_get_ur_l(PW3270Dbus *object, DBusGMethodInvocation *context); | ... | ... |