diff --git a/src/gobject.c b/src/gobject.c index 5c82a4d..4b41e08 100644 --- a/src/gobject.c +++ b/src/gobject.c @@ -280,3 +280,39 @@ void pw3270_dbus_get_connection_state(PW3270Dbus *object, const gchar *id, DBusG dbus_g_method_return(context,lib3270_get_connection_state(ses->host)); } + +void pw3270_dbus_get_screen_width(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context) { + + struct session * ses = session_find(id); + + if(!ses) { + pw3270_dbus_return_error(context,ENOENT); + return; + } + + dbus_g_method_return(context,lib3270_get_width(ses->host)); +} + +void pw3270_dbus_get_screen_height(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context) { + + struct session * ses = session_find(id); + + if(!ses) { + pw3270_dbus_return_error(context,ENOENT); + return; + } + + dbus_g_method_return(context,lib3270_get_height(ses->host)); +} + +void pw3270_dbus_get_screen_length(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context) { + + struct session * ses = session_find(id); + + if(!ses) { + pw3270_dbus_return_error(context,ENOENT); + return; + } + + dbus_g_method_return(context,lib3270_get_length(ses->host)); +} diff --git a/src/pw3270service.xml b/src/pw3270service.xml index 144f960..2a5f867 100644 --- a/src/pw3270service.xml +++ b/src/pw3270service.xml @@ -109,6 +109,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/service.h b/src/service.h index e8da267..30ac243 100644 --- a/src/service.h +++ b/src/service.h @@ -79,6 +79,10 @@ void pw3270_dbus_get_connection_state(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context); + void pw3270_dbus_get_screen_width(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context); + void pw3270_dbus_get_screen_height(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context); + void pw3270_dbus_get_screen_length(PW3270Dbus *object, const gchar *id, DBusGMethodInvocation *context); + /* void pw3270_dbus_quit(PW3270Dbus *object, DBusGMethodInvocation *context); void pw3270_dbus_connect(PW3270Dbus *object, const gchar *uri, DBusGMethodInvocation *context); @@ -101,9 +105,6 @@ void pw3270_dbus_set_cursor_address(PW3270Dbus *object, int addr, DBusGMethodInvocation *context); void pw3270_dbus_get_cursor_address(PW3270Dbus *object, DBusGMethodInvocation *context); - void pw3270_dbus_get_screen_width(PW3270Dbus *object, DBusGMethodInvocation *context); - void pw3270_dbus_get_screen_height(PW3270Dbus *object, DBusGMethodInvocation *context); - void pw3270_dbus_get_screen_length(PW3270Dbus *object, DBusGMethodInvocation *context); void pw3270_dbus_set_toggle(PW3270Dbus *object, int id, int value, DBusGMethodInvocation *context); diff --git a/testscripts/getheight.sh b/testscripts/getheight.sh new file mode 100755 index 0000000..3d2b56c --- /dev/null +++ b/testscripts/getheight.sh @@ -0,0 +1,5 @@ +#!/bin/bash +DEST=br.com.bb.pw3270.service +PATH=/br/com/bb/pw3270/service +/bin/dbus-send --session --print-reply --dest=$DEST $PATH $DEST.getScreenHeight string:$1 + diff --git a/testscripts/getlength.sh b/testscripts/getlength.sh new file mode 100755 index 0000000..f5c546f --- /dev/null +++ b/testscripts/getlength.sh @@ -0,0 +1,5 @@ +#!/bin/bash +DEST=br.com.bb.pw3270.service +PATH=/br/com/bb/pw3270/service +/bin/dbus-send --session --print-reply --dest=$DEST $PATH $DEST.getScreenLength string:$1 + diff --git a/testscripts/getwidth.sh b/testscripts/getwidth.sh new file mode 100755 index 0000000..3a72f40 --- /dev/null +++ b/testscripts/getwidth.sh @@ -0,0 +1,5 @@ +#!/bin/bash +DEST=br.com.bb.pw3270.service +PATH=/br/com/bb/pw3270/service +/bin/dbus-send --session --print-reply --dest=$DEST $PATH $DEST.getScreenWidth string:$1 + -- libgit2 0.21.2