erscribble/test/ipc.c File Reference

#include <sys/stat.h>
#include <unistd.h>
#include <gtk/gtk.h>
#include <liberipc/eripc.h>
#include <liberipc/eripc_support.h>
#include "config.h"
#include "i18n.h"
#include "ipc.h"
Include dependency graph for erscribble/test/ipc.c:

Go to the source code of this file.

Defines

#define SCRIBBLETEST_MENU   "scribbletest_menu"
#define DBUS_APPL_NAME   PACKAGE_NAME
#define DBUS_SERVICE   "com.irexnet."DBUS_APPL_NAME
#define DBUS_PATH   "/com/irexnet/"DBUS_APPL_NAME
#define DBUS_INTERFACE   "com.irexnet."DBUS_APPL_NAME
#define DBUS_SERVICE_SYSD   "com.irexnet.sysd"
#define DBUS_SERVICE_CTB   "com.irexnet.ctb"

Functions

void main_quit ()
static void on_window_activated (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_window_deactivated (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
gboolean ipc_set_services ()
 Setup IPC connection and register API functions.
void ipc_unset_services ()
 Unregister API functions.
void ipc_sys_startup_complete (void)
 Report "content browser started" to sysd.
gboolean ipc_set_stylus (const char *state)
 Request popup menu state.

Variables

static eripc_client_context_teripcClient = NULL
static eripc_callback_function_t service_functions []

Define Documentation

#define DBUS_APPL_NAME   PACKAGE_NAME

Definition at line 56 of file erscribble/test/ipc.c.

#define DBUS_INTERFACE   "com.irexnet."DBUS_APPL_NAME

Definition at line 59 of file erscribble/test/ipc.c.

#define DBUS_PATH   "/com/irexnet/"DBUS_APPL_NAME

Definition at line 58 of file erscribble/test/ipc.c.

#define DBUS_SERVICE   "com.irexnet."DBUS_APPL_NAME

Definition at line 57 of file erscribble/test/ipc.c.

#define DBUS_SERVICE_CTB   "com.irexnet.ctb"

Definition at line 63 of file erscribble/test/ipc.c.

Referenced by ipc_ctb_goto(), ipc_refresh_ctb(), and main().

#define DBUS_SERVICE_SYSD   "com.irexnet.sysd"

Definition at line 62 of file erscribble/test/ipc.c.

Referenced by ipc_get_battery_state(), ipc_sys_is_in_portrait_mode(), and main().

#define SCRIBBLETEST_MENU   "scribbletest_menu"

Copyright (C) 2008 iRex Technologies B.V. All rights reserved.

Definition at line 53 of file erscribble/test/ipc.c.


Function Documentation

gboolean ipc_set_services (  ) 

Setup IPC connection and register API functions.

File Name : index_ipc.h

Description: The dbus-based eripc functions Copyright (C) 2009 IREX Technologies B.V. All rights reserved.---------------------------------------------------------------------------

Name : ipc_set_services

Parameters:
None 
Returns:
--

--------------------------------------------------------------------------

Definition at line 106 of file erscribble/test/ipc.c.

References DBUS_APPL_NAME, DBUS_INTERFACE, DBUS_PATH, DBUS_SERVICE, eripc_client_context_new(), and service_functions.

00107 {
00108     eripcClient = eripc_client_context_new(
00109                     DBUS_APPL_NAME,
00110                     "1.0",
00111                     DBUS_SERVICE,
00112                     DBUS_PATH,
00113                     DBUS_INTERFACE,
00114                     service_functions);
00115 
00116     return TRUE;
00117 }

Here is the call graph for this function:

gboolean ipc_set_stylus ( const char *  state  ) 

Request popup menu state.

---------------------------------------------------------------------------

Name : ipc_set_stylus

Parameters:
state [Input] State ("enable", "disable", "suspend", "resume", "high", "normal")
Returns:
FALSE if failed to set stylus state

--------------------------------------------------------------------------

Definition at line 132 of file erscribble/test/ipc.c.

00133 {
00134     g_return_val_if_fail( (state != NULL), FALSE);
00135     return eripc_menu_set_statusitem_state(eripcClient, "statusbar_stylus", state);
00136 }

void ipc_sys_startup_complete (  ) 

Report "content browser started" to sysd.

Report "application started" to sysd.

Report "settings started" to sysd.

Report "application started" to system daemon.

---------------------------------------------------------------------------

Name : ipc_sys_startup_complete

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 126 of file erscribble/test/ipc.c.

References eripc_sysd_startup_complete().

00127 {
00128     eripc_sysd_startup_complete( eripcClient, getpid(), FALSE, 0 );
00129 }

Here is the call graph for this function:

void ipc_unset_services ( void   ) 

Unregister API functions.

---------------------------------------------------------------------------

Name : ipc_unset_services

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 120 of file erscribble/test/ipc.c.

References eripc_client_context_free(), and service_functions.

Here is the call graph for this function:

void main_quit ( void   ) 

Definition at line 79 of file erscribble/test/ipc.c.

References ipc_unset_services().

00080 {
00081     ipc_unset_services();
00082     gtk_main_quit();
00083 }

Here is the call graph for this function:

static void on_window_activated ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 143 of file erscribble/test/ipc.c.

References eripc_event_info_t::args, eripc_reply_bool(), ERIPC_TYPE_INT, and eripc_event_info_t::message_id.

00146 {
00147     gboolean          result      = FALSE; 
00148     const eripc_arg_t *arg_array  = info->args;
00149 
00150     if (arg_array[0].type == ERIPC_TYPE_INT)
00151     {
00152         result = TRUE;
00153     }
00154 
00155     // return result to caller
00156     eripc_reply_bool(context, info->message_id, result);
00157 }

Here is the call graph for this function:

static void on_window_deactivated ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 159 of file erscribble/test/ipc.c.

References eripc_event_info_t::args, eripc_reply_bool(), ERIPC_TYPE_INT, main_quit(), and eripc_event_info_t::message_id.

00162 {
00163     gboolean          result      = FALSE; 
00164     const eripc_arg_t *arg_array  = info->args;
00165 
00166     if (arg_array[0].type == ERIPC_TYPE_INT)
00167     {
00168         // gtk_main_quit();
00169         main_quit();
00170         result = TRUE;
00171     }
00172 
00173     // return result to caller
00174     eripc_reply_bool(context, info->message_id, result);
00175 }

Here is the call graph for this function:


Variable Documentation

Definition at line 72 of file erscribble/test/ipc.c.

Initial value:
 {
    { on_window_activated,  "activatedWindow",     NULL,              0 },
    { on_window_deactivated,"deactivatedWindow",   NULL,              0 },
    { NULL }  
}

Definition at line 95 of file erscribble/test/ipc.c.

Referenced by ipc_set_services(), and ipc_unset_services().

Generated by  doxygen 1.6.2-20100208