Commit 5076a548ef127fe540f78ffe5bc87079349eefc2
1 parent
4baf2f92
Exists in
master
and in
5 other branches
Incluindo mais métodos na interface dbus
Showing
4 changed files
with
27 additions
and
0 deletions
Show diff stats
src/plugins/dbus3270/gobject.c
| @@ -391,6 +391,12 @@ void pw3270_dbus_get_clipboard(PW3270Dbus *object, int row, int col, int len, DB | @@ -391,6 +391,12 @@ void pw3270_dbus_get_clipboard(PW3270Dbus *object, int row, int col, int len, DB | ||
| 391 | } | 391 | } |
| 392 | } | 392 | } |
| 393 | 393 | ||
| 394 | +void pw3270_dbus_set_clipboard(PW3270Dbus *object, const gchar *text, DBusGMethodInvocation *context) | ||
| 395 | +{ | ||
| 396 | + gtk_clipboard_set_text(gtk_widget_get_clipboard(pw3270_get_toplevel(),GDK_SELECTION_CLIPBOARD),(gchar *) text, -1); | ||
| 397 | + dbus_g_method_return(context,0); | ||
| 398 | +} | ||
| 399 | + | ||
| 394 | void pw3270_dbus_set_script(PW3270Dbus *object, const gchar *text, int mode, DBusGMethodInvocation *context) | 400 | void pw3270_dbus_set_script(PW3270Dbus *object, const gchar *text, int mode, DBusGMethodInvocation *context) |
| 395 | { | 401 | { |
| 396 | GtkWidget *widget = pw3270_get_terminal_widget(NULL); | 402 | GtkWidget *widget = pw3270_get_terminal_widget(NULL); |
src/plugins/dbus3270/pw3270dbus.xml
| @@ -61,6 +61,10 @@ | @@ -61,6 +61,10 @@ | ||
| 61 | <arg type="i" name="len" direction="in" /> | 61 | <arg type="i" name="len" direction="in" /> |
| 62 | <arg type="s" name="text" direction="out" /> | 62 | <arg type="s" name="text" direction="out" /> |
| 63 | </method> | 63 | </method> |
| 64 | + <method name="setClipboard"> | ||
| 65 | + <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | ||
| 66 | + <arg type="s" name="text" direction="in" /> | ||
| 67 | + </method> | ||
| 64 | <method name="getClipboard"> | 68 | <method name="getClipboard"> |
| 65 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | 69 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> |
| 66 | <arg type="s" name="text" direction="out" /> | 70 | <arg type="s" name="text" direction="out" /> |
src/plugins/dbus3270/service.h
| @@ -99,6 +99,8 @@ | @@ -99,6 +99,8 @@ | ||
| 99 | void pw3270_dbus_get_text_at(PW3270Dbus *object, int row, int col, int len, DBusGMethodInvocation *context); | 99 | void pw3270_dbus_get_text_at(PW3270Dbus *object, int row, int col, int len, DBusGMethodInvocation *context); |
| 100 | void pw3270_dbus_cmp_text_at(PW3270Dbus *object, int row, int col, const gchar *text, DBusGMethodInvocation *context); | 100 | void pw3270_dbus_cmp_text_at(PW3270Dbus *object, int row, int col, const gchar *text, DBusGMethodInvocation *context); |
| 101 | void pw3270_dbus_input(PW3270Dbus *object, const gchar *utftext, DBusGMethodInvocation *context); | 101 | void pw3270_dbus_input(PW3270Dbus *object, const gchar *utftext, DBusGMethodInvocation *context); |
| 102 | + | ||
| 103 | + void pw3270_dbus_set_clipboard(PW3270Dbus *object, const gchar *text, DBusGMethodInvocation *context); | ||
| 102 | void pw3270_dbus_get_clipboard(PW3270Dbus *object, int row, int col, int len, DBusGMethodInvocation *context); | 104 | void pw3270_dbus_get_clipboard(PW3270Dbus *object, int row, int col, int len, DBusGMethodInvocation *context); |
| 103 | 105 | ||
| 104 | G_END_DECLS | 106 | G_END_DECLS |
src/plugins/rx3270/remote.cc
| @@ -1165,6 +1165,21 @@ int remote::get_next_unprotected(int baddr) | @@ -1165,6 +1165,21 @@ int remote::get_next_unprotected(int baddr) | ||
| 1165 | 1165 | ||
| 1166 | int remote::set_clipboard(const char *text) | 1166 | int remote::set_clipboard(const char *text) |
| 1167 | { | 1167 | { |
| 1168 | +#if defined(WIN32) | ||
| 1169 | + | ||
| 1170 | + return -1; | ||
| 1171 | + | ||
| 1172 | +#elif defined(HAVE_DBUS) | ||
| 1173 | + | ||
| 1174 | + DBusMessage * msg = create_message("setClipboard"); | ||
| 1175 | + if(msg) | ||
| 1176 | + { | ||
| 1177 | + dbus_message_append_args(msg, DBUS_TYPE_STRING, &text, DBUS_TYPE_INVALID); | ||
| 1178 | + return get_intval(call(msg)); | ||
| 1179 | + } | ||
| 1180 | + | ||
| 1181 | +#endif | ||
| 1182 | + | ||
| 1168 | return -1; | 1183 | return -1; |
| 1169 | } | 1184 | } |
| 1170 | 1185 |