hello-world/include/ipc.h File Reference

#include <liberipc/eripc.h>
Include dependency graph for hello-world/include/ipc.h:

Go to the source code of this file.

Functions

G_BEGIN_DECLS void ipc_set_services (void)
 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 sysd.
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_sys_stop_task (const gchar *cmd_line)
 Send message stopTask to system control, usually to close a documen that has previously been open using ipc_sys_start_task().
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_busy (gboolean look_busy)
 Send message sysSetBusy to system daemon.
gboolean ipc_sys_is_pageturn_inverted ()
 Query sysd if pageturning is inverted.
gboolean ipc_sys_is_in_portrait_mode ()
 Query sysd if device in portrait mode.

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.

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

G_BEGIN_DECLS void ipc_set_services ( void   ) 

Setup IPC connection and register API functions.

File Name : ipc.h

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

Name : ipc_set_services

Parameters:
-- 
Returns:
--

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

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 95 of file index_ipc.c.

00096 {
00097     eripcClient = eripc_client_context_new(
00098                     DBUS_APPL_NAME, 
00099                     "1.0",
00100                     DBUS_SERVICE, 
00101                     DBUS_PATH,
00102                     DBUS_INTERFACE,
00103                     service_functions);
00104 }

gboolean ipc_sys_busy ( gboolean  look_busy  ) 

Send message sysSetBusy to system daemon.

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

Name : ipc_sys_busy

Parameters:
[in] look_busy - TRUE to show, FALSE to remove the busy indication
Returns:
TRUE on success, FALSE otherwise

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

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

00326 {
00327     if (look_busy)
00328         return eripc_sysd_set_busy(eripcClient, "delaydialog", NULL);
00329     else
00330         return eripc_sysd_reset_busy(eripcClient);
00331 }

gboolean ipc_sys_is_in_portrait_mode (  ) 

Query sysd if device in portrait mode.

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

Name : ipc_sys_is_in_portrait_mode

Returns:
TRUE if in portrait mode, FALSE otherwise (landscape)

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

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

00341 {
00342     return g_in_portrait;
00343 }

gboolean ipc_sys_is_pageturn_inverted (  ) 

Query sysd if pageturning is inverted.

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

Name : ipc_sys_is_pageturn_inverted

Returns:
TRUE if inverted, FALSE otherwise

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

Definition at line 763 of file hello-world/src/ipc.c.

References eripc_event_info_t::args, eripc_arg_t::b, eripc_client_context_t::context, DBUS_SERVICE_SYSTEM_CONTROL, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_event_info_free(), eripc_send_varargs_and_wait(), ERIPC_TYPE_BOOL, ERIPC_TYPE_INVALID, notepad::eripcClient, ERRORPRINTF, and LOGPRINTF.

Referenced by display_flipbar_portrait(), main(), and notepad::on_changed_orientation().

00764 {
00765     gboolean result = FALSE;
00766 
00767     eripc_error_t retval;
00768     eripc_event_info_t* info = NULL;
00769 
00770     LOGPRINTF("entry");
00771 
00772     retval = eripc_send_varargs_and_wait(eripcClient->context,
00773             &info,
00774             ERIPC_BUS_SESSION,
00775             DBUS_SERVICE_SYSTEM_CONTROL,
00776             "sysGetPageturnInverted",
00777             ERIPC_TYPE_INVALID);
00778 
00779     if (retval != ERIPC_ERROR_SUCCESS)
00780     {
00781         ERRORPRINTF("Error launching eripc handler");
00782     }
00783     else if (info == NULL || info->args == NULL)
00784     {
00785         ERRORPRINTF("sysd returns OK but no reply structure");
00786     }
00787     else
00788     {
00789         const eripc_arg_t *arg_array = info->args;
00790 
00791         if (arg_array[0].type == ERIPC_TYPE_BOOL)
00792         {
00793             result = (gboolean) arg_array[0].value.b;
00794         }
00795         else 
00796         {
00797             result = FALSE ;
00798         }
00799     }
00800 
00801     eripc_event_info_free(eripcClient->context, info);
00802     return result; 
00803 }

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 sysd.

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

Name : ipc_sys_startup_complete

Parameters:
-- 
Returns:
--

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

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

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

gboolean ipc_sys_stop_task ( const gchar *  cmd_line  ) 

Send message stopTask to system control, usually to close a documen that has previously been open using ipc_sys_start_task().

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

Name : ipc_sys_stop_task

Parameters:
[in] cmd_line - command-line passed to ipc_sys_start_task() when launching the task
Returns:
TRUE on success, FALSE otherwise

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

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

00193 {
00194     LOGPRINTF("entry: cmd_line [%s]", cmd_line );
00195     g_assert( cmd_line && *cmd_line );
00196     return eripc_sysd_stop_task( eripcClient, cmd_line );
00197 }

void ipc_unset_services ( void   ) 

Unregister API functions.

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

Name : ipc_unset_services

Parameters:
-- 
Returns:
--

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

Definition at line 108 of file index_ipc.c.

Generated by  doxygen 1.6.2-20100208