erbrowser/src/ipc.c File Reference

#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <gdk/gdkx.h>
#include <unistd.h>
#include <liberipc/eripc.h>
#include <liberipc/eripc_support.h>
#include "log.h"
#include "i18n.h"
#include "ipc.h"
#include "main.h"
#include "menu.h"
#include "view.h"
Include dependency graph for erbrowser/src/ipc.c:

Go to the source code of this file.

Defines

#define DBUS_APPL_NAME   PACKAGE
#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_SYSTEM_CONTROL   "com.irexnet.sysd"
#define DBUS_SERVICE_POPUP_MENU   "com.irexnet.popupmenu"

Functions

static void on_menu_item (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_mounted (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_file_open (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_file_close (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
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)
static void on_connection_status (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_prepare_unmount (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_unmounted (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_changed_locale (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
void ipc_set_services (ipc_callback_t connect_cb, ipc_callback_t disconnect_cb, ipc_callback_t locale_cb)
 Setup IPC connection and register API functions.
void ipc_unset_services (void)
 Unregister API functions.
void ipc_sys_startup_complete (void)
 Report "content browser started" to sysd.
gboolean ipc_sys_bg_busy (gboolean on)
 Send message sysSetBgBusy to system daemon to set the busy LED indication.
gboolean ipc_sys_set_busy (gboolean on, const gchar *message)
 Send message sysSetBusy to system daemon to set the busy LED indication.
gboolean ipc_sys_set_busy_nodialog (gboolean on)
gboolean ipc_sys_connect (void)
gboolean ipc_sys_disconnect (void)
gint ipc_sys_start_task (const gchar *cmd_line, const gchar *work_dir, const gchar *label, const gchar *thumbnail_path, gchar **err_message)
 Send message startTask to system control, usually to open a document in the relevant viewer application.
gboolean ipc_menu_add_menu (const char *name, const char *group1, const char *group2, const char *group3)
 Send message addMenu to popup menu.
gboolean ipc_menu_add_group (const char *name, const char *parent, const char *image)
 Send message addGroup to popup menu.
gboolean ipc_menu_add_item (const char *name, const char *parent, const char *image)
 Send message addGroup to popup menu.
gboolean ipc_menu_set_menu_label (const char *name, const char *label)
 Send message setMenuLabel to popup menu.
gboolean ipc_menu_set_group_label (const char *name, const char *label)
 Send message setGroupLabel to popup menu.
gboolean ipc_menu_set_item_label (const char *name, const char *parent, const char *label)
 Send message setItemLabel to popup menu.
gboolean ipc_menu_show_menu (const char *name)
 Send message showMenu to popup menu.
gboolean ipc_remove_menu (const char *name)
 Remove menu from popup menu.
gboolean ipc_menu_set_group_state (const char *name, const char *state)
 Send message setItemState to popup menu.
gboolean ipc_menu_set_item_state (const char *name, const char *parent, const char *state)
 Send message setItemState to popup menu.
const device_caps_tipc_sys_get_device_capabilities (void)
 Query system control for device capabilties.

Variables

static eripc_client_context_teripcClient = NULL
static ipc_callback_t g_connect_cb = NULL
static ipc_callback_t g_disconnect_cb = NULL
static ipc_callback_t g_locale_cb = NULL
static eripc_callback_function_t service_functions []

Define Documentation

#define DBUS_APPL_NAME   PACKAGE

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

Definition at line 61 of file erbrowser/src/ipc.c.

#define DBUS_INTERFACE   "com.irexnet." DBUS_APPL_NAME

Definition at line 64 of file erbrowser/src/ipc.c.

#define DBUS_PATH   "/com/irexnet/" DBUS_APPL_NAME

Definition at line 63 of file erbrowser/src/ipc.c.

#define DBUS_SERVICE   "com.irexnet." DBUS_APPL_NAME

Definition at line 62 of file erbrowser/src/ipc.c.

#define DBUS_SERVICE_POPUP_MENU   "com.irexnet.popupmenu"

Definition at line 70 of file erbrowser/src/ipc.c.

#define DBUS_SERVICE_SYSTEM_CONTROL   "com.irexnet.sysd"

Definition at line 67 of file erbrowser/src/ipc.c.


Function Documentation

gboolean ipc_menu_add_group ( const char *  name,
const char *  parent,
const char *  image 
)

Send message addGroup to popup menu.

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

Name : ipc_menu_add_group

Parameters:
[in] name - name (mnemonic) of menu group
[in] parent - name (mnemonic) of the group this group belongs to, or NULL when this group is at the highest level
[in] image - icon bitmap file
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 270 of file erbrowser/src/ipc.c.

References eripc_menu_add_group().

00273 {
00274     //LOGPRINTF("entry");
00275     return eripc_menu_add_group(eripcClient, name, parent, image);
00276 }

Here is the call graph for this function:

gboolean ipc_menu_add_item ( const char *  name,
const char *  parent,
const char *  image 
)

Send message addGroup to popup menu.

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

Name : ipc_menu_add_item

Parameters:
[in] name - name (mnemonic) of menu item
[in] parent - name (mnemomic) of the menu group this item belongs to
[in] image - icon bitmap file
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 279 of file erbrowser/src/ipc.c.

References eripc_menu_add_item().

00282 {
00283     //LOGPRINTF("entry");
00284     return eripc_menu_add_item(eripcClient, name, parent, image);
00285 }

Here is the call graph for this function:

gboolean ipc_menu_add_menu ( const char *  name,
const char *  group1,
const char *  group2,
const char *  group3 
)

Send message addMenu to popup menu.

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

Name : ipc_menu_add_menu

Parameters:
[in] name - name (mnemonic) of the menu
[in] group1 .. group3 - name (mnemonic) of the menu groups
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 260 of file erbrowser/src/ipc.c.

References eripc_menu_add_menu(), and LOGPRINTF.

00264 {
00265     LOGPRINTF("entry");
00266     return eripc_menu_add_menu(eripcClient, name, group1, group2, group3, "");
00267 }

Here is the call graph for this function:

gboolean ipc_menu_set_group_label ( const char *  name,
const char *  label 
)

Send message setGroupLabel to popup menu.

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

Name : ipc_menu_set_group_label

Parameters:
[in] name - name (mnemonic) of menu group
[in] label - on-screen text at the top of the menu group
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 296 of file erbrowser/src/ipc.c.

References eripc_menu_set_group_label().

00298 {
00299     //LOGPRINTF("entry");
00300     return eripc_menu_set_group_label(eripcClient, name, label);
00301 }

Here is the call graph for this function:

gboolean ipc_menu_set_group_state ( const char *  name,
const char *  state 
)

Send message setItemState to popup menu.

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

Name : ipc_menu_set_group_state

Parameters:
[in] name - name (mnemonic) of menu group to be set
[in] state - new state ("normal", "disabled")
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 327 of file erbrowser/src/ipc.c.

References eripc_menu_set_group_state(), and LOGPRINTF.

00329 {
00330     LOGPRINTF("entry");
00331     return eripc_menu_set_group_state(eripcClient, name, state);
00332 }

Here is the call graph for this function:

gboolean ipc_menu_set_item_label ( const char *  name,
const char *  parent,
const char *  label 
)

Send message setItemLabel to popup menu.

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

Name : ipc_menu_set_item_label

Parameters:
[in] name - name (mnemonic) of menu item
[in] parent - name (mnemomic) of the menu group this item belongs to
[in] label - on-screen text below icon
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 304 of file erbrowser/src/ipc.c.

References eripc_menu_set_item_label().

00307 {
00308     //LOGPRINTF("entry");
00309     return eripc_menu_set_item_label(eripcClient, name, parent, label);
00310 }

Here is the call graph for this function:

gboolean ipc_menu_set_item_state ( const char *  name,
const char *  parent,
const char *  state 
)

Send message setItemState to popup menu.

Set new menu item state.

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

Name : ipc_menu_set_item_state

Parameters:
[in] name - name (mnemonic) of menu item to be set
[in] parent - name (mnemomic) of the menu group this item belongs to
[in] state - new state ("normal", "selected", "disabled")
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 335 of file erbrowser/src/ipc.c.

References eripc_menu_set_item_state().

00338 {
00339     //LOGPRINTF("entry");
00340     return eripc_menu_set_item_state(eripcClient, name, parent, state);
00341 }

Here is the call graph for this function:

gboolean ipc_menu_set_menu_label ( const char *  name,
const char *  label 
)

Send message setMenuLabel to popup menu.

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

Name : ipc_menu_set_menu_label

Parameters:
[in] name - name (mnemonic) of the menu
[in] label - on-screen text at the top of the menu
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 288 of file erbrowser/src/ipc.c.

References eripc_menu_set_menu_label().

00290 {
00291     //LOGPRINTF("entry");
00292     return eripc_menu_set_menu_label(eripcClient, name, label);
00293 }

Here is the call graph for this function:

gboolean ipc_menu_show_menu ( const char *  name  ) 

Send message showMenu to popup menu.

Set menu context.

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

Name : ipc_menu_show_menu

Parameters:
[in] name - name (mnemonic) of menu to be displayed
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 313 of file erbrowser/src/ipc.c.

References eripc_menu_show_menu(), and LOGPRINTF.

00314 {
00315     LOGPRINTF("entry");
00316     return eripc_menu_show_menu(eripcClient, name);
00317 }

Here is the call graph for this function:

gboolean ipc_remove_menu ( const char *  name  ) 

Remove menu from popup menu.

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

Name : ipc_remove_menu

Parameters:
[in] name - name (mnemonic) of menu to be removed
Returns:
--

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

Definition at line 320 of file erbrowser/src/ipc.c.

00321 {
00322     LOGPRINTF("entry");
00323     return eripc_menu_remove_menu(eripcClient, name);
00324 }

void ipc_set_services ( ipc_callback_t  connect_cb,
ipc_callback_t  disconnect_cb,
ipc_callback_t  locale_cb 
)

Setup IPC connection and register API functions.

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

Name : ipc_set_services

Parameters:
-- 
Returns:
--

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

Definition at line 157 of file erbrowser/src/ipc.c.

References DBUS_APPL_NAME, DBUS_INTERFACE, DBUS_PATH, DBUS_SERVICE, eripc_client_context_new(), g_connect_cb, g_disconnect_cb, g_locale_cb, g_mountpoint, and LOGPRINTF.

00158 {
00159     LOGPRINTF("entry");
00160     eripcClient = eripc_client_context_new(
00161                     DBUS_APPL_NAME, 
00162                     "1.0",
00163                     DBUS_SERVICE, 
00164                     DBUS_PATH,
00165                     DBUS_INTERFACE,
00166                     service_functions);
00167 
00168     g_connect_cb    = connect_cb;
00169     g_disconnect_cb = disconnect_cb;
00170     g_locale_cb     = locale_cb;
00171 
00172     // start without mountpoint
00173     g_mountpoint = NULL;
00174 }

Here is the call graph for this function:

gboolean ipc_sys_bg_busy ( gboolean  on  ) 

Send message sysSetBgBusy to system daemon to set the busy LED indication.

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

Name : ipc_sys_set_bg_busy

Parameters:
[in] on - TRUE to set busy state, FALSE to stop busy
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 196 of file erbrowser/src/ipc.c.

References eripc_sysd_reset_bg_busy(), eripc_sysd_set_bg_busy(), and LOGPRINTF.

00197 {
00198     LOGPRINTF("entry [%d]", on);
00199     if (on)
00200         return eripc_sysd_set_bg_busy(eripcClient);
00201     else
00202         return eripc_sysd_reset_bg_busy(eripcClient);
00203 }

Here is the call graph for this function:

gboolean ipc_sys_connect ( void   ) 

Definition at line 226 of file erbrowser/src/ipc.c.

References eripc_sysd_conn_connect(), and LOGPRINTF.

Referenced by main_request_connection().

00227 {
00228     LOGPRINTF("entry");
00229     return eripc_sysd_conn_connect(eripcClient, NULL, NULL);
00230 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_sys_disconnect ( void   ) 

Definition at line 233 of file erbrowser/src/ipc.c.

References eripc_sysd_conn_disconnect(), and LOGPRINTF.

Referenced by main().

00234 {
00235     LOGPRINTF("entry");
00236     return eripc_sysd_conn_disconnect(eripcClient);
00237 }

Here is the call graph for this function:

Here is the caller graph for this function:

const device_caps_t* ipc_sys_get_device_capabilities (  ) 

Query system control for device capabilties.

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

Name : ipc_sys_get_device_capabilities

Parameters:
-- 
Returns:
current device capabilities

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

Definition at line 344 of file erbrowser/src/ipc.c.

References eripc_sysd_get_device_capabilities(), eripc_device_caps_t::has_3g, device_caps_t::has_3g, eripc_device_caps_t::has_bluetooth, device_caps_t::has_bluetooth, eripc_device_caps_t::has_stylus, device_caps_t::has_stylus, eripc_device_caps_t::has_wifi, and device_caps_t::has_wifi.

Referenced by get_viewtype_from_registry().

00345 {
00346     static device_caps_t dev_caps;
00347 
00348     eripc_device_caps_t er_dev_caps;
00349 
00350     eripc_sysd_get_device_capabilities( eripcClient, &er_dev_caps );
00351 
00352     dev_caps.has_stylus = er_dev_caps.has_stylus;
00353     dev_caps.has_wifi = er_dev_caps.has_wifi;
00354     dev_caps.has_bluetooth = er_dev_caps.has_bluetooth;
00355     dev_caps.has_3g = er_dev_caps.has_3g;
00356 
00357     return &dev_caps;
00358 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_sys_set_busy ( gboolean  on,
const gchar *  message 
)

Send message sysSetBusy to system daemon to set the busy LED indication.

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

Name : ipc_sys_set_busy

Parameters:
[in] on - TRUE to set busy indication, FALSE to stop busy
[in] message - Text to show in dialog, or NULL for default message
Returns:
TRUE on success, FALSE otherwise

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

Definition at line 206 of file erbrowser/src/ipc.c.

References eripc_sysd_reset_busy(), eripc_sysd_set_busy(), and LOGPRINTF.

00207 {
00208     LOGPRINTF("entry [%d]", on);
00209     if (on)
00210         return eripc_sysd_set_busy(eripcClient, "delaydialog", message);
00211     else
00212         return eripc_sysd_reset_busy(eripcClient);
00213 }

Here is the call graph for this function:

gboolean ipc_sys_set_busy_nodialog ( gboolean  on  ) 

Definition at line 216 of file erbrowser/src/ipc.c.

References eripc_sysd_reset_busy(), eripc_sysd_set_busy(), and LOGPRINTF.

Referenced by show_busy().

00217 {
00218     LOGPRINTF("entry [%d]", on);
00219     if (on)
00220         return eripc_sysd_set_busy(eripcClient, "nodialog", NULL);
00221     else
00222         return eripc_sysd_reset_busy(eripcClient);
00223 }

Here is the call graph for this function:

Here is the caller graph for this function:

gint ipc_sys_start_task ( const gchar *  cmd_line,
const gchar *  work_dir,
const gchar *  label,
const gchar *  thumbnail_path,
gchar **  err_message 
)

Send message startTask to system control, usually to open a document in the relevant viewer application.

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

Name : ipc_sys_start_task

Parameters:
[in] cmd_line - command-line to launch the task (executable + options)
[in] work_dir - working directory in which to start this task
[in] label - text to show in popup menu
[in] thumbnail_path - the file containing the thumbnail to show in popup menu
[out] err_message - error message text from application
Returns:
error code (0 for success, >0 for failure)

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

Definition at line 240 of file erbrowser/src/ipc.c.

References eripc_sysd_start_task(), and LOGPRINTF.

00245 {
00246     LOGPRINTF("entry");
00247     return eripc_sysd_start_task(eripcClient, 
00248                                  cmd_line, 
00249                                  work_dir, 
00250                                  label, 
00251                                  thumbnail_path, 
00252                                  err_message);
00253 }

Here is the call graph for this function:

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 188 of file erbrowser/src/ipc.c.

References eripc_sysd_startup_complete(), g_main_window, and LOGPRINTF.

00189 {
00190     LOGPRINTF("entry");
00191     const int xid = GDK_WINDOW_XID(g_main_window->window);
00192     eripc_sysd_startup_complete( eripcClient, getpid(), TRUE, xid);
00193 }

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 177 of file erbrowser/src/ipc.c.

References eripc_client_context_free(), and LOGPRINTF.

00178 {
00179     LOGPRINTF("entry");
00180     eripc_client_context_free(eripcClient, service_functions);
00181 }

Here is the call graph for this function:

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

Definition at line 620 of file erbrowser/src/ipc.c.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, g_locale_cb, LOGPRINTF, eripc_arg_t::s, and eripc_arg_t::value.

00623 {
00624     LOGPRINTF("entry");
00625     const eripc_arg_t *arg_array = info->args;
00626 
00627     if (arg_array[0].type == ERIPC_TYPE_STRING)
00628     {
00629         const char *locale = arg_array[0].value.s;
00630         if (locale)
00631         {
00632             const char *old_locale = g_getenv("LANG");
00633             if (!old_locale || (strcmp(old_locale, locale) != 0))
00634             {
00635                 g_setenv("LANG", locale, TRUE);
00636                 setlocale(LC_ALL, "");
00637                 
00638                 g_locale_cb();
00639             }
00640         }
00641     }
00642 }

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

Definition at line 450 of file erbrowser/src/ipc.c.

References eripc_event_info_t::args, eripc_arg_t::b, ERIPC_TYPE_BOOL, ERIPC_TYPE_STRING, g_connect_cb, g_disconnect_cb, LOGPRINTF, eripc_arg_t::s, and eripc_arg_t::value.

00453 {
00454     LOGPRINTF("entry");
00455     const eripc_arg_t *arg_array  = info->args;
00456 
00457     if ((arg_array[0].type == ERIPC_TYPE_BOOL) && 
00458         (arg_array[1].type == ERIPC_TYPE_STRING) && 
00459         (arg_array[2].type == ERIPC_TYPE_STRING) && 
00460         (arg_array[3].type == ERIPC_TYPE_STRING))
00461     {
00462         gboolean    is_connected = arg_array[0].value.b;
00463       //const gchar *medium      = arg_array[1].value.s;
00464       //const gchar *profile     = arg_array[2].value.s;
00465       //const gchar *reason      = arg_array[3].value.s;
00466 
00467         if (is_connected)
00468         {
00469             LOGPRINTF("Network connection established");
00470             g_connect_cb();
00471         }
00472         else
00473         {
00474             LOGPRINTF("Network connection terminated - reason [%s]", arg_array[3].value.s);
00475             g_disconnect_cb();
00476         }
00477     }
00478 }

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

Definition at line 527 of file erbrowser/src/ipc.c.

References eripc_reply_bool(), LOGPRINTF, main_quit(), and eripc_event_info_t::message_id.

00530 {
00531     LOGPRINTF("entry");
00532     
00533     // return result to caller
00534     eripc_reply_bool(context, info->message_id, TRUE);
00535     
00536     main_quit();
00537 }

Here is the call graph for this function:

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

Definition at line 492 of file erbrowser/src/ipc.c.

References eripc_event_info_t::args, eripc_reply_varargs(), ERIPC_TYPE_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, g_main_window, LOGPRINTF, menu_show(), eripc_event_info_t::message_id, eripc_arg_t::s, eripc_arg_t::value, and view_open_uri().

00495 {
00496     LOGPRINTF("entry");
00497     gchar             *error_msg  = NULL;
00498     gint              my_xid      = -1; 
00499 
00500     const eripc_arg_t *arg_array  = info->args;
00501     
00502     if (arg_array[0].type == ERIPC_TYPE_STRING)
00503     {
00504         const char *file = arg_array[0].value.s;
00505         if (file)
00506         {
00507             menu_show();
00508             my_xid = GDK_WINDOW_XID(g_main_window->window);
00509             view_open_uri(file);
00510         }
00511     }
00512     
00513     // return result to caller
00514     eripc_reply_varargs(context, info->message_id, 
00515                         ERIPC_TYPE_INT, my_xid,
00516                         ERIPC_TYPE_STRING, error_msg,
00517                         ERIPC_TYPE_INVALID);
00518     g_free(error_msg);
00519 }

Here is the call graph for this function:

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

Definition at line 373 of file erbrowser/src/ipc.c.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, LOGPRINTF, menu_on_item_activated(), eripc_arg_t::s, and eripc_arg_t::value.

00376 {
00377     LOGPRINTF("entry");
00378     const eripc_arg_t *arg_array = info->args;
00379 
00380     if ((arg_array[0].type == ERIPC_TYPE_STRING) && 
00381         (arg_array[1].type == ERIPC_TYPE_STRING) && 
00382         (arg_array[2].type == ERIPC_TYPE_STRING) && 
00383         (arg_array[3].type == ERIPC_TYPE_STRING))
00384     {
00385         const char        *item      = arg_array[0].value.s;
00386         const char        *group     = arg_array[1].value.s;
00387         const char        *menu      = arg_array[2].value.s;
00388         const char        *state     = arg_array[3].value.s;
00389         
00390         if (item && group && menu && state)
00391         {
00392             menu_on_item_activated( item, group, menu, state );
00393         }
00394     }
00395 }

Here is the call graph for this function:

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

Definition at line 544 of file erbrowser/src/ipc.c.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, g_mountpoint, LOGPRINTF, eripc_arg_t::s, and eripc_arg_t::value.

00547 {
00548     LOGPRINTF("entry");
00549     const eripc_arg_t *arg_array  = info->args;
00550 
00551     if (arg_array[0].type == ERIPC_TYPE_STRING)
00552     {
00553         const char *mountpoint = arg_array[0].value.s;
00554         if (mountpoint)
00555         {
00556             LOGPRINTF("Device mounted: %s", mountpoint);
00557             g_free(g_mountpoint);
00558             g_mountpoint = g_strdup(mountpoint);
00559         }
00560     }
00561 }

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

Definition at line 569 of file erbrowser/src/ipc.c.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, g_mountpoint, LOGPRINTF, main_quit(), eripc_arg_t::s, and eripc_arg_t::value.

00572 {
00573     LOGPRINTF("entry");
00574     const eripc_arg_t *arg_array  = info->args;
00575 
00576     if (arg_array[0].type == ERIPC_TYPE_STRING)
00577     {
00578         const char *mountpoint = arg_array[0].value.s;
00579         if (mountpoint)
00580         {
00581             g_free(g_mountpoint);
00582             g_mountpoint = NULL;
00583             main_quit();
00584         }
00585     }
00586 }

Here is the call graph for this function:

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

Definition at line 595 of file erbrowser/src/ipc.c.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, LOGPRINTF, main_quit(), eripc_arg_t::s, and eripc_arg_t::value.

00598 {
00599     LOGPRINTF("entry");
00600     const eripc_arg_t *arg_array  = info->args;
00601 
00602     if (arg_array[0].type == ERIPC_TYPE_STRING)
00603     {
00604         const char  *mountpoint = arg_array[0].value.s;
00605         if (mountpoint)
00606         {
00607             main_quit();
00608         }
00609     }
00610 }

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 403 of file erbrowser/src/ipc.c.

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

00406 {
00407     LOGPRINTF("entry");
00408     gboolean          result      = FALSE; 
00409     const eripc_arg_t *arg_array  = info->args;
00410 
00411     if (arg_array[0].type == ERIPC_TYPE_INT)
00412     {
00413         menu_show();
00414         result = TRUE;
00415     }
00416 
00417     // return result to caller
00418     eripc_reply_bool(context, info->message_id, result);
00419 }

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 426 of file erbrowser/src/ipc.c.

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

00429 {
00430     LOGPRINTF("entry");
00431     gboolean          result      = FALSE; 
00432     const eripc_arg_t *arg_array  = info->args;
00433 
00434     if (arg_array[0].type == ERIPC_TYPE_INT)
00435     {
00436 #if MACHINE_IS_DR800SG || MACHINE_IS_DR800S || MACHINE_IS_DR800SW
00437         view_deactivated();
00438 #endif        
00439         result = TRUE;
00440     }
00441    
00442     // return result to caller
00443     eripc_reply_bool(context, info->message_id, result);
00444 }

Here is the call graph for this function:


Variable Documentation

Definition at line 77 of file erbrowser/src/ipc.c.

ipc_callback_t g_connect_cb = NULL [static]

Definition at line 79 of file erbrowser/src/ipc.c.

Referenced by ipc_set_services(), and on_connection_status().

Definition at line 80 of file erbrowser/src/ipc.c.

Referenced by ipc_set_services(), and on_connection_status().

ipc_callback_t g_locale_cb = NULL [static]

Definition at line 81 of file erbrowser/src/ipc.c.

Referenced by ipc_set_services(), and on_changed_locale().

Initial value:
 {
    
    { on_menu_item,           "menuItemActivated",      NULL                        , 0},
    { on_mounted,             "sysVolumeMounted",       NULL                        , 0},
    { on_file_open,           "openFile",               NULL                        , 0},
    { on_file_close,          "closeFile",              NULL                        , 0},
    { on_window_activated,    "activatedWindow",        NULL                        , 0},
    { on_window_deactivated,  "deactivatedWindow",      NULL                        , 0},
    { on_connection_status,   "connConnectionStatus",   NULL                        , 0},
    
    { on_mounted,             "sysVolumeMounted",       DBUS_SERVICE_SYSTEM_CONTROL , 0},
    { on_prepare_unmount,     "sysPrepareUnmount",      DBUS_SERVICE_SYSTEM_CONTROL , 0},
    { on_unmounted,           "sysVolumeUnmounted",     DBUS_SERVICE_SYSTEM_CONTROL , 0},
    { on_changed_locale,      "sysChangedLocale",       DBUS_SERVICE_SYSTEM_CONTROL , 0},
    { on_connection_status,   "connConnectionStatus",   DBUS_SERVICE_SYSTEM_CONTROL , 0},
    { NULL, NULL, NULL, 0 }
}

Definition at line 129 of file erbrowser/src/ipc.c.

Generated by  doxygen 1.6.2-20100208