blob: 055c67665781be03d3cc54f64da2b117ae9f8030 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001#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
13typedef void (*SIGNAL1CALLBACK)(const gchar*);
14typedef void (*SIGNAL2CALLBACK)(const gint, const gchar*);
15typedef struct signalcallback
16{
17 SIGNAL1CALLBACK callback1;
18 SIGNAL2CALLBACK callback2;
19}S_SIGNAL_CALLBACK;
20
21typedef void (*METHOD1CALLBACK)(const gchar*, const GError*);
22typedef void (*METHOD2CALLBACK)(const gchar*, const gint, GError*);
23typedef struct methodcallback
24{
25 METHOD1CALLBACK callback1;
26 METHOD2CALLBACK callback2;
27}S_METHOD_CALLBACK;
28
29
30static gboolean My_Signal_1_Handler(_ZMoDbusName *object, const gchar *arg, gpointer userdata);
31static gboolean My_Signal_2_Handler(_ZMoDbusName *object, GVariant *arg, gpointer userdata);
32static void cb_OwnerNameChangedNotify(GObject *object, GParamSpec *pspec, gpointer userdata);
33bool registerClientSignalHandler(_ZMoDbusName *pProxy);
34void registerSignalCallback(S_SIGNAL_CALLBACK *callback);
35void registerMethodCallback(S_METHOD_CALLBACK *callback);
36static void MethodCallback_1(GObject* source_object, GAsyncResult* res, gpointer userdata);
37void myMethodAsync_1(const char* in_arg);
38void myMethod_1(const gchar *in_arg, gchar** out_arg, GError** pError);
39static void MethodCallback_2(GObject* source_object, GAsyncResult* res, gpointer user_data);
40void myMethodAsync_2(const gint in_arg1, const gint in_arg2);
41void myMethod_2(const gint in_arg1, const gint in_arg2, gchar **out_arg1, gint *out_arg2, GError** pError);
42void *client_run_tread(void* arg);
43int client_thread_create(void);
44bool ExampleDBusServiceIsReady(void);
45bool InitDBusCommunication(const gchar* bus_name, const gchar* object_path);
46bool DeInitDBusCommunication(void);
47#endif