rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | #ifndef __LIB_CLIENT__ |
| 2 | #define __LIB_CLIENT__ |
| 3 | |
| 4 | #include <string.h> |
| 5 | #include <stdlib.h> |
| 6 | #include <ctype.h> |
| 7 | #include <stdbool.h> |
| 8 | #include <glib-2.0/glib.h> |
| 9 | |
| 10 | #include "dbusCommon.h" |
| 11 | #define RET_SIGNAL_HANDLE_SIZE 3 |
| 12 | |
| 13 | typedef void (*SIGNAL1CALLBACK)(const gchar*); |
| 14 | typedef void (*SIGNAL2CALLBACK)(const gint, const gchar*); |
| 15 | typedef struct signalcallback |
| 16 | { |
| 17 | SIGNAL1CALLBACK callback1; |
| 18 | SIGNAL2CALLBACK callback2; |
| 19 | }S_SIGNAL_CALLBACK; |
| 20 | |
| 21 | typedef void (*METHOD1CALLBACK)(const gchar*, const GError*); |
| 22 | typedef void (*METHOD2CALLBACK)(const gchar*, const gint, GError*); |
| 23 | typedef struct methodcallback |
| 24 | { |
| 25 | METHOD1CALLBACK callback1; |
| 26 | METHOD2CALLBACK callback2; |
| 27 | }S_METHOD_CALLBACK; |
| 28 | |
| 29 | |
| 30 | static gboolean My_Signal_1_Handler(_ZMoDbusName *object, const gchar *arg, gpointer userdata); |
| 31 | static gboolean My_Signal_2_Handler(_ZMoDbusName *object, GVariant *arg, gpointer userdata); |
| 32 | static void cb_OwnerNameChangedNotify(GObject *object, GParamSpec *pspec, gpointer userdata); |
| 33 | bool registerClientSignalHandler(_ZMoDbusName *pProxy); |
| 34 | void registerSignalCallback(S_SIGNAL_CALLBACK *callback); |
| 35 | void registerMethodCallback(S_METHOD_CALLBACK *callback); |
| 36 | static void MethodCallback_1(GObject* source_object, GAsyncResult* res, gpointer userdata); |
| 37 | void myMethodAsync_1(const char* in_arg); |
| 38 | void myMethod_1(const gchar *in_arg, gchar** out_arg, GError** pError); |
| 39 | static void MethodCallback_2(GObject* source_object, GAsyncResult* res, gpointer user_data); |
| 40 | void myMethodAsync_2(const gint in_arg1, const gint in_arg2); |
| 41 | void myMethod_2(const gint in_arg1, const gint in_arg2, gchar **out_arg1, gint *out_arg2, GError** pError); |
| 42 | void *client_run_tread(void* arg); |
| 43 | int client_thread_create(void); |
| 44 | bool ExampleDBusServiceIsReady(void); |
| 45 | bool InitDBusCommunication(const gchar* bus_name, const gchar* object_path); |
| 46 | bool DeInitDBusCommunication(void); |
| 47 | #endif |