erbrowser/include/ipc.h File Reference

Go to the source code of this file.

Data Structures

struct  device_caps_t

Functions

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 "application started" to system daemon.
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_bg_busy (gboolean on)
 Send message sysSetBgBusy to system daemon to set the busy LED indication.
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.
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.
const device_caps_tipc_sys_get_device_capabilities (void)
 Query system control for device capabilties.

Variables

G_BEGIN_DECLS typedef void(* ipc_callback_t )(void)

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 242 of file ctb/src/ipc.c.

00245 {
00246     return eripc_menu_add_group(eripcClient, name, parent, image);
00247 }

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 250 of file ctb/src/ipc.c.

00253 {
00254     return eripc_menu_add_item(eripcClient, name, parent, image);
00255 }

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 233 of file ctb/src/ipc.c.

00237 {
00238     return eripc_menu_add_menu(eripcClient, name, group1, group2, group3, "");
00239 }

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 265 of file ctb/src/ipc.c.

00267 {
00268     return eripc_menu_set_group_label(eripcClient, name, label);
00269 }

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 286 of file ctb/src/ipc.c.

00288 {
00289     return eripc_menu_set_group_state(eripcClient, name, state);
00290 }

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 272 of file ctb/src/ipc.c.

00275 {
00276     return eripc_menu_set_item_label(eripcClient, name, parent, label);
00277 }

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

Send message setItemState to popup menu.

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

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 293 of file ctb/src/ipc.c.

00296 {
00297     return eripc_menu_set_item_state(eripcClient, name, parent, state);
00298 }

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 258 of file ctb/src/ipc.c.

00260 {
00261     return eripc_menu_set_menu_label(eripcClient, name, label);
00262 }

gboolean ipc_menu_show_menu ( const char *  name  ) 

Send message showMenu to popup menu.

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

Name : ipc_menu_show_menu

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

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

Definition at line 280 of file ctb/src/ipc.c.

00281 {
00282     return eripc_menu_show_menu(eripcClient, name);
00283 }

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.

Referenced by main_quit(), and menu_destroy().

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

Here is the caller graph for this function:

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(), notepad::eripcClient, and LOGPRINTF.

Referenced by download_error_cb(), download_requested_cb(), download_status_changed_cb(), and notepad::CNotepadDoc::draw_scribble_page().

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:

Here is the caller 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 ( void   ) 

Query system control for device capabilties.

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

Name : ipc_sys_get_device_capabilities

Parameters:
-- 
Returns:
current device capabilities

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

Definition at line 212 of file ctb/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.

00213 {
00214     static device_caps_t dev_caps;
00215 
00216     eripc_device_caps_t er_dev_caps;
00217 
00218     eripc_sysd_get_device_capabilities( eripcClient, &er_dev_caps );
00219 
00220     dev_caps.has_stylus = er_dev_caps.has_stylus;
00221     dev_caps.has_wifi = er_dev_caps.has_wifi;
00222     dev_caps.has_bluetooth = er_dev_caps.has_bluetooth;
00223     dev_caps.has_3g = er_dev_caps.has_3g;
00224 
00225     return &dev_caps;
00226 }

Here is the call 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 174 of file ctb/src/ipc.c.

00179 {
00180     LOGPRINTF("entry: cmd_line [%s] work_dir [%s] label [%s] thumbnail_path [%s]",
00181                        cmd_line,     work_dir,     label,     thumbnail_path       );
00182     g_assert( cmd_line && *cmd_line );
00183     return eripc_sysd_start_task( eripcClient, 
00184                                   cmd_line, 
00185                                   work_dir, 
00186                                   label, 
00187                                   thumbnail_path, 
00188                                   err_message);
00189 }

void ipc_sys_startup_complete ( void   ) 

Report "application started" to system daemon.

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

Name : ipc_sys_startup_complete

Parameters:
-- 
Returns:
--

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

Report "application started" to system daemon.

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

Name : ipc_sys_startup_complete

Parameters:
-- 
Returns:
--

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

Definition at line 168 of file ctb/src/ipc.c.

00169 {
00170     eripc_sysd_startup_complete( eripcClient, getpid(), FALSE, fileview_get_xid());
00171 }

void ipc_unset_services ( void   ) 

Unregister API functions.

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

Name : ipc_unset_services

Parameters:
-- 
Returns:
--

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

Definition at line 108 of file index_ipc.c.


Variable Documentation

G_BEGIN_DECLS typedef void(* ipc_callback_t)(void)

File Name : ipc.h

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

Generated by  doxygen 1.6.2-20100208