sysd/include/ipc.h File Reference

#include <liberipc/eripc.h>
#include "system.h"
#include <liberipc/eripc_support.h>
Include dependency graph for sysd/include/ipc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#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_CTB   "com.irexnet.ctb"
#define DBUS_SERVICE_MENU   "com.irexnet.popupmenu"
#define DBUS_SERVICE_CONN_WIFI   "com.irexnet.connwifi"
#define DBUS_SERVICE_CONN_BLUE   "com.irexnet.connblue"
#define DBUS_SERVICE_CONN_3G   "com.irexnet.conn3g"

Functions

void ipc_set_services (void)
 Setup IPC connection and register API functions.
void ipc_unset_services (void)
 Unregister API functions.
void ipc_send_battery_state (gint battery_level, enum state_charge, gint time_left)
 Send the sysBatteryState signal.
void ipc_send_prepare_standby (void)
 Send the sysPrepareStandby signal.
void ipc_send_prepare_unmount (const char *mount_point)
 Send the sysPrepareUnmount signal.
void ipc_menu_set_item_state (const char *iname, const char *pname, const char *state)
 Set new menu item state.
void ipc_menu_set_statusitem_state (const char *name, const char *state)
 Set new status item state.
void ipc_send_volume_mounted (const char *mount_point)
 Emit sysVolumeMounted signal.
void ipc_send_volume_unmounted (const char *mount_point)
 Emit sysVolumeUnmounted signal.
void ipc_send_changed_locale (const char *locale)
 Emit sysChangedLocale signal.
void ipc_send_demo_mode (gboolean demo_mode)
 Emit sysChangeDemoMode signal.
void ipc_send_changed_pageturn_inverted (gboolean is_inverted)
 Emit sysChangedPageturnInverted signal.
void ipc_ctb_goto (const char *location)
 Set new location for Content Browser.
gboolean ipc_send_open (const char *ipc_interface, const char *document, void *callback_handler, void *callback_data)
 Open new file by application.
gboolean ipc_send_close (const char *ipc_interface, const char *document, void *callback_handler, void *callback_data)
 Close file by application.
void ipc_send_reply (eripc_context_t *context, const char *message_id, gboolean result)
 Return a IPC reply message.
void ipc_send_reply_task_start (eripc_context_t *context, const char *message_id, gint err_code, gchar *err_msg)
 Return a IPC reply message to startTask call.
void ipc_menu_add_task (gint xid, const char *label)
 Add a task item.
void ipc_menu_set_first_task (int xid)
 Set task item to front or list.
void ipc_menu_remove_task (int xid)
 Remove a task item.
void ipc_menu_rename_task (int xid, const char *label)
void ipc_show_busy (gboolean show_mode, const gchar *message)
 Show a busy/wait prompt.
void ipc_show_splash (const char *type)
 Show a predefined splash screen.
void ipc_show_message (const char *type, const void *reply_handler, const void *user_data)
 Show a predefined message dialog.
void ipc_confirm_usbconnect (gboolean show_mode)
 Ask user to confirm to connect over USB.
void ipc_confirm_install_drz (gboolean show_mode)
 Ask user to confirm to restart and install drz file(s).
void ipc_confirm_install_update (gboolean show_mode)
 Ask user to confirm to restart and install firmware update.
void ipc_send_usb_state (const char *state)
 Send the sysUsbState signal.
void ipc_send_volume_mounted_to (const char *service, const char *mount_point)
 Send the volumeMounted method call to an application.
void ipc_refresh_ctb ()
void ipc_menu_show (const char *menu)
void ipc_show_popup (const char *state)
void ipc_send_changed_orientation (guint orientation)
gboolean ipc_connect (const char *ipc_service, const char *medium, const char *profile)
gboolean ipc_disconnect (const char *ipc_service)
gboolean ipc_send_conn_status (const char *ipc_service, gboolean is_connected, const char *medium, const char *profile, const char *reason)
gboolean ipc_broadcast_conn_status (gboolean is_connected, const char *medium, const char *profile, const char *reason)
gboolean ipc_add_profile (const char *medium)
gboolean ipc_edit_profile (const char *medium, const char *profile)
void ipc_send_window_activated (const char *ipc_interface, gint window)
void ipc_send_window_deactivated (const char *ipc_interface, gint window)

Variables

eripc_client_context_teripcClient

Define Documentation

#define DBUS_APPL_NAME   PACKAGE_NAME

File Name : ipc.h

Description: The dbus-based eripc functions Copyright (C) 2008 iRex Technologies B.V. All rights reserved. System Control IPC DBUS interface description

Methods incoming ================ Name: sysGetBatteryState Get the battery level and charge state Args: (none) Returns: 1) level integer, current battery level in percent 2) state string, charge state: "low", "charging", "discharging", "full"

Name: sysGetOrientation Get the display orientation Args: (none) Returns: string, state: "portrait","landscape_clockwise","landscape_anticlockwise"

Name: sysGetPageturnInverted Get the pageturn mode (inverted or normal) Args: (none) Returns: boolean, TRUE if page turning is inverted, FALSE of page turning is normal

Name: sysGetCardMountPoint get mountpoint of SDCard Args: (none) Returns: string , mountpoint (eg /media/mmcblk0p1) if mounted, NULL if not.

Name: sysGetDeviceCapabilities Get the device's capabilities Args: (none) Returns: 1) has_stylus boolean, TRUE if device has stylus, FALSE otherwise 2) has_wifi boolean, TRUE if device has wifi, FALSE otherwise 3) has_bluetooth boolean, TRUE if device has bluetooth, FALSE otherwise

Name: sysSetBusy Set busy indication Args: 1) state string, mode "nodialog", "delaydialog", "directdialog" 2) message string, message text or NULL for default text Returns: boolean, TRUE on success, FALSE otherwise

Name: sysResetBusy Reset busy indication Args: (none) Returns: boolean, TRUE on success, FALSE otherwise

Name: sysSetBgBusy Set background busy Args: (none) Returns: boolean, TRUE on success, FALSE otherwise

Name: sysResetBgBusy Reset background busy indication Args: (none) Returns: boolean, TRUE on success, FALSE otherwise

Name: sysBeep Set system beep tone Args: 1) duration_ms integer, length of tone in ms (use intervals of 10ms) 2) tone string, tone pitch: "high", "low" Returns: boolean, TRUE on success, FALSE otherwise

Name: sysRotate Set orientation of display Args: 1) mode string, new mode: "portrait", "landscape", "toggle" Returns: boolean, TRUE on success, FALSE otherwise

Name: sysLockSensors Set locking of sensors Args: 1) mode string, new mode: "lock", "unlock", "toggle" Returns: boolean, TRUE on success, FALSE otherwise

Name: sysGetStylus Get stylus mode Args: none Returns: boolean, TRUE of enabled, FALSE otherwise

Name: sysSetStylus Set stylus mode Args: 1) mode string, new mode: "enable", "disable", "suspend", "resume", "high", "normal" Returns: boolean, TRUE on success, FALSE otherwise

Name: sysCardMount Mount volume(s) on SD card Args: none Returns: boolean, TRUE on success, FALSE otherwise Action: Success means the command was executed and unmount has been started. When a volume is mounted this is reported through the broadcasted sysVolumeMounted signal

Name: sysCardUnmount Unmount volume(s) on SD card Args: none Returns: boolean, TRUE on success, FALSE otherwise Action: Success means the command was executed and unmount has been started. When a volume is unmounted this is reported through the broadcasted sysVolumeUnmounted signal

Name: sysShutdown Graciously shut down the device Args: none Returns: boolean, TRUE on success, FALSE otherwise Action: Success means the command was executed and shutdown has been initiated.

Name: startTask Start a task Args: 1) command_line string, full path to application with arguments 2) working_dir string, current working directory 3) label string, text label shown under icon in popup menu 4) image string, full path to icon shown in popup menu (png, 60x60 pixels) Returns: 1) error_code integer, (1) error starting application (2) timeout waiting for application window (3) application exited before creating a window (4) application returned an error (errr_msg follows) 2) error_msg string, error message text from application or NULL Example: dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.startTask string:"uds /usr/share/icons/file.png" string:"/usr/bin" string:"Document1" string:open dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.startTask string:"uds /media/mmcblk0p1/Library/test.txt" string:"/usr/bin" string:"Document1" string:open dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.startTask string:"firstboot" string:"/usr/bin" string:"firstboot" string:open

Name: stopTask Stop a running task Args: 1) command_line string, full path to application with arguments Returns: boolean, TRUE on success, FALSE otherwise

Name: activateTask Activate a running task Args: 1) command_line string, full path to application with arguments Returns: boolean, TRUE on success, FALSE otherwise

Name: menuRequestPopup Set the popupmenu state when possible Args: 1) state string, new state: "show", "hide", "toggle", "block", "unblock" Returns: boolean, TRUE on success, FALSE otherwise

Name: openUrl Open URL in the web browser Args: 1) url string, URL 2) label string, text label shown under icon in popup menu, or NULL to derive from URL 3) application string, application name shown in "Back" bar of browser, or NULL to omit this bar Returns: 1) error_code integer, (1) error starting browser application (2) timeout waiting for browser window (3) browser exited before creating a window (4) browser returned an error (errr_msg follows) (5) device does not have networking capabilities so browser is not started 2) error_msg string, error message text from application or NULL Example: dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.openUrl string:"http://www.irextechnologies.com" dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.openUrl string:"http://www.irextechnologies.com" string:"iRex homepage" string:"Home" dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.openUrl string:"file:///media/mmcblk0p1/test.html" string:"Test page"

Name: openedWindow Notify that a window was opened Args: 1) application string, base name of the application 2) document string, full path of the document 3) label string, text label shown under icon in popup menu 4) image string, full path to icon shown in popup menu (png, 60x60 pixels) 5) ipc_service string, IPC service name of the application 6) pid integer, process id 7) window integer, window ID (XID) Returns: boolean, TRUE on success, FALSE otherwise When: Send when a window was opened which is to be added to the Task Manager of Popupmenu. Don't use this call when a window is opened in response to "openFile". Example: dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.openedWindow string:"uds" string:"/media/mmcblk0p1/eBooks/bla.pdf" string:"bla" string:open string:com.irexnet.uds int32:2455 int32:12345

Name: closedWindow Notify that a window was closed Args: 1) window integer, window ID (XID) Returns: boolean, TRUE on success, FALSE otherwise When: Send when a window was closed which is listed in the Task Manager of Popupmenu. Don't use this call when a window is closed in response to "closeFile".

Name: connConnect Request a network connection Args: 1) ipc_service string, IPC service name of the application 2) medium string, connection medium or NULL for automatic selection 3) profile string, gconf path of network profile to use or NULL for automatic selection Returns: boolean, TRUE on success, FALSE otherwise Example: dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.connConnect string:"com.irexnet.erbrowser" string:"wifi" string:""

Name: connDisconnect Release the network connection Args: 1) ipc_service string, IPC service name of the application Returns: boolean, TRUE on success, FALSE otherwise Example: dbus-send --print-reply --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.connDisconnect string:"com.irexnet.erbrowser"

Name: connConnectionStatus Set the connection status Args: 1) is_connected boolean, TRUE if connection is online, FALSE otherwise 2) medium string, connection medium in use 3) profile string, gconf path of network profile in use Returns: boolean, TRUE on success, FALSE otherwise

Name: connConnectionStatusRequest Ask the connection status Args: none Returns: boolean, TRUE on success, FALSE otherwise

Signal incoming ===============

Name: startupComplete Indicate that an application has finished startup Args: 1) name string, name of application (eg "settings" or "ctb") 2) pid integer, process id 3) is_multidoc boolean, TRUE if application can open/close documents over IPC, FALSE otherwise 4) ipc_service string, IPC service name (eg "/com/irexnet/ctb"), or NULL when no IPC services are implemented 5) xid integer, window id; set to 0 when the application should not be shown in the Task Manager

Method calls outgoing =====================

Name: openFile Open a file in a window Args: 1) file string, path to file Returns: 1) integer, X window on success, -1 on failure 2) string, custom error message or NULL for none When: Sent when a file, document or url is to be closed but the application (callee) Action: Application (callee) should create and realise, or reuse an existing window for the given file and return the X window id in the method reply. The X window can be obtained using GDK_WINDOW_XID(widget->window). When the file is already opened by the callee, it may just return its X window id. This call implies that the window is activated (set to the foreground) so callee should also set its context for the given window and set the Popupmenu menu context. System Daemon adds a task to Task Manager of Popupmenu, or replaces the task when an existing window is returned.

Name: activatedWindow Notify that a window was activated Args: 1) window integer, X window of the file Returns: boolean, TRUE on success, FALSE on failure When: Sent after a window was activated (set to the foreground) Action: Application (callee) should set its context for the given window and set the Popupmenu menu context.

Name: deactivatedWindow Notify that a window was deactivated Args: 1) window integer, X window of the file Returns: boolean, TRUE on success, FALSE on failure When: Sent after a window was deactivated (set to the background) Action: Application (callee) may adapt its context and free resources.

Name: closeFile Close a file Args: 1) file string, path to file Returns: boolean, TRUE on success, FALSE on failure When: Sent when a file, document or url is to be closed by the application (callee) Action: Application (callee) should close the file and may destroy its window and free other resources. System Daemon removes the task from the Task Manager of Popupmenu.

Signals outgoing ================

Name: sysBatteryState Args: 1) level integer, charge level in percent 2) state string, state: "low", "charging", "discharging", "full" When: Sent on state change and when battery level changed n% (default: 5%) Action: Applications may use this information to inform the user.

Name: sysPrepareStandby Args: (none) When: Sent just before the system enters standby mode Action: Applications must commit changes (flush) of all its open files. Failing to handle this signal may result in unsaved data or currupt files.

Name: sysPrepareUnmount Args: 1) mount_point string, mount point of volume When: Sent just before unmounting the volume Action: Applications must close all its open files on the given volume. Failing to handle this signal may result in unsaved data or currupt files. Example: dbus-send --type=signal --dest=com.irexnet.sysd /com/irexnet/sysd com.irexnet.sysd.sysPrepareUnmount string:/media/mmcblk0p1

Name: sysVolumeMounted Args: 1) mount_point string, mount point of volume When: Sent just after a volume is mounted Action: Applications may use this to add/open the new volume.

Name: sysVolumeUnmounted Args: 1) mount_point string, mount point of volume When: Sent just after unmounting the volume Action: Typically an application should have responded to a prior sysPrepareUnmount signal, but when a device with volumes was removed unexpectedly it may need to act on this signal.

Name: sysChangedLocale Args: 1) locale string, locale code (ll_CC) When: Sent when the system's locale has changed Action: Applications should load language dependent screen texts and probably set new labels for its menu items; to activate a new locale application should call: g_setenv("LANG", new_locale, TRUE); setlocale(LC_ALL, "");

Name: sysChangedPageturnInverted Args: 1) is_inverted boolean When: Sent when the system's pageturnmode has changed Action: Applications (UDS) should invert the page turning. If is_inverted == TRUE, turn pages as in book

Name: sysChangedOrientation Args: 1) state string, state: "portrait", "landscape_clockwise", "landscape_anticlockwise" When: Sent when the display's orientation has changed Action: Applications may need to adapt its screen size, coordinates and/or origin.

Name: sysUsbState Args: 1) state string, state: "disconnected", "unmounted", "mounted" When: Sent on state change of USB connection to computer Action: Applications may use this information to control end user info.

Definition at line 331 of file sysd/include/ipc.h.

#define DBUS_INTERFACE   "com.irexnet." DBUS_APPL_NAME

Definition at line 335 of file sysd/include/ipc.h.

#define DBUS_PATH   "/com/irexnet/" DBUS_APPL_NAME

Definition at line 334 of file sysd/include/ipc.h.

#define DBUS_SERVICE   "com.irexnet." DBUS_APPL_NAME

Definition at line 333 of file sysd/include/ipc.h.

#define DBUS_SERVICE_CONN_3G   "com.irexnet.conn3g"

Definition at line 341 of file sysd/include/ipc.h.

Referenced by medium_service().

#define DBUS_SERVICE_CONN_BLUE   "com.irexnet.connblue"

Definition at line 340 of file sysd/include/ipc.h.

Referenced by medium_service().

#define DBUS_SERVICE_CONN_WIFI   "com.irexnet.connwifi"

Definition at line 339 of file sysd/include/ipc.h.

Referenced by medium_service().

#define DBUS_SERVICE_CTB   "com.irexnet.ctb"

Definition at line 337 of file sysd/include/ipc.h.

#define DBUS_SERVICE_MENU   "com.irexnet.popupmenu"

Function Documentation

gboolean ipc_add_profile ( const char *  medium  ) 

Definition at line 872 of file sysd/src/ipc.c.

References eripc_client_context_t::context, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, LOGPRINTF, and medium_service().

00873 {
00874     LOGPRINTF("entry");
00875 
00876     eripc_error_t retval;
00877         
00878     g_return_val_if_fail(medium != NULL, FALSE);
00879     
00880     retval = eripc_send_varargs(eripcClient->context,
00881                                NULL,            // no reply handler
00882                                NULL,            // no reply data
00883                                ERIPC_BUS_SESSION,
00884                                medium_service(medium),
00885                                "connAddProfile",
00886                                ERIPC_TYPE_STRING, medium,
00887                                ERIPC_TYPE_INVALID);
00888     
00889     if (retval != ERIPC_ERROR_SUCCESS) 
00890     {
00891         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00892         return FALSE;
00893     }
00894     
00895     return TRUE;
00896 }

Here is the call graph for this function:

gboolean ipc_broadcast_conn_status ( gboolean  is_connected,
const char *  medium,
const char *  profile,
const char *  reason 
)

Definition at line 830 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_BOOL, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, and LOGPRINTF.

Referenced by enter_connected_state(), and enter_off_state().

00834 {
00835     LOGPRINTF("connected=%d", is_connected);
00836 
00837     // NOTE: status is broadcasted when it was changed
00838     eripc_send_signal_varargs(eripcClient->context, 
00839                               ERIPC_BUS_SESSION,
00840                               DBUS_PATH,
00841                               DBUS_INTERFACE,
00842                               "connConnectionStatus",
00843                               ERIPC_TYPE_BOOL,   is_connected,
00844                               ERIPC_TYPE_STRING, medium,
00845                               ERIPC_TYPE_STRING, profile,
00846                               ERIPC_TYPE_STRING, reason,
00847                               ERIPC_TYPE_INVALID);
00848     
00849     return TRUE;
00850 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_confirm_install_drz ( gboolean  show_mode  ) 

Ask user to confirm to restart and install drz file(s).

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

Name : ipc_confirm_install_drz

Parameters:
show_mode TRUE to show the prompt, FALSE to remove it
Returns:
TRUE when user confirmed restart, FALSE otherwise

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

Definition at line 671 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string(), ERRORPRINTF, LOGPRINTF, and on_confirm_install_drz().

Referenced by check_and_install_drz().

00672 {
00673     LOGPRINTF("entry");
00674     eripc_error_t retval;
00675     
00676     retval = eripc_send_string(eripcClient->context,
00677                                 &on_confirm_install_drz,
00678                                 NULL,
00679                                 ERIPC_BUS_SESSION,
00680                                 DBUS_SERVICE_MENU,
00681                                 "confirmInstallDrz",
00682                                 show_mode ? "show" : "hide");
00683 
00684     if (retval != ERIPC_ERROR_SUCCESS) 
00685     {
00686         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00687     }
00688     
00689     return;
00690 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_confirm_install_update ( gboolean  show_mode  ) 

Ask user to confirm to restart and install firmware update.

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

Name : ipc_confirm_install_update

Parameters:
show_mode TRUE to show the prompt, FALSE to remove it
Returns:
TRUE when user confirmed restart, FALSE otherwise

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

Definition at line 693 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string(), ERRORPRINTF, LOGPRINTF, and on_confirm_install_update().

Referenced by sys_check_and_install_firmware().

00694 {
00695     LOGPRINTF("entry");
00696     eripc_error_t retval;
00697     
00698     retval = eripc_send_string(eripcClient->context,
00699                                 &on_confirm_install_update,
00700                                 NULL,
00701                                 ERIPC_BUS_SESSION,
00702                                 DBUS_SERVICE_MENU,
00703                                 "confirmInstallUpdate",
00704                                 show_mode ? "show" : "hide");
00705 
00706     if (retval != ERIPC_ERROR_SUCCESS) 
00707     {
00708         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00709     }
00710 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_confirm_usbconnect ( gboolean  show_mode  ) 

Ask user to confirm to connect over USB.

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

Name : ipc_confirm_usbconnect

Parameters:
show_mode TRUE to show the prompt, FALSE to remove it
Returns:
TRUE when user confirmed connection, FALSE otherwise

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

Definition at line 651 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string(), ERRORPRINTF, LOGPRINTF, and on_confirm_usbconnect().

Referenced by usb_set_state().

00652 {
00653     LOGPRINTF("entry");
00654     eripc_error_t retval;
00655     
00656     retval = eripc_send_string(eripcClient->context,
00657                                 show_mode ? &on_confirm_usbconnect : NULL,
00658                                 NULL,
00659                                 ERIPC_BUS_SESSION,
00660                                 DBUS_SERVICE_MENU,
00661                                 "confirmUsbConnect",
00662                                 show_mode ? "show" : "hide");
00663 
00664     if (retval != ERIPC_ERROR_SUCCESS) 
00665     {
00666         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00667     }
00668 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_connect ( const char *  ipc_service,
const char *  medium,
const char *  profile 
)

Definition at line 736 of file sysd/src/ipc.c.

References eripc_client_context_t::context, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.

Referenced by conn_connect(), and enter_disconnected_state().

00737 {
00738     LOGPRINTF("entry");
00739 
00740     eripc_error_t retval;
00741         
00742     g_return_val_if_fail(medium != NULL, FALSE);
00743     // profile may be NULL
00744     
00745     // NOTE: this call slightly differs from eripc_sysd_conn_connect()
00746     //       in that it uses the IPC SERVICE of the connection manager as
00747     //       destination for the message 
00748     retval = eripc_send_varargs(eripcClient->context,
00749                                NULL,            // no reply handler
00750                                NULL,            // no reply data
00751                                ERIPC_BUS_SESSION,
00752                                ipc_service,
00753                                "connConnect",
00754                                ERIPC_TYPE_STRING, ipc_service,
00755                                ERIPC_TYPE_STRING, medium,
00756                                ERIPC_TYPE_STRING, profile,
00757                                ERIPC_TYPE_INVALID);
00758     
00759     if (retval != ERIPC_ERROR_SUCCESS) 
00760     {
00761         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00762         return FALSE;
00763     }
00764     
00765     return TRUE;
00766 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_ctb_goto ( const char *  location  ) 

Set new location for Content Browser.

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

Name : ipc_ctb_goto

Parameters:
location New location to show ("desktop"|"library")
Returns:
--

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

Definition at line 713 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_CTB, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string(), ERRORPRINTF, and LOGPRINTF.

Referenced by cb_menu_item_activated().

00714 {
00715     LOGPRINTF("entry");
00716     
00717     eripc_error_t retval;
00718         
00719     g_return_if_fail(location != NULL);
00720     
00721     retval = eripc_send_string(eripcClient->context,
00722                                NULL, // reply handler
00723                                NULL, // reply data
00724                                ERIPC_BUS_SESSION,
00725                                DBUS_SERVICE_CTB,
00726                                "gotoLocation",
00727                                location);
00728 
00729     if (retval != ERIPC_ERROR_SUCCESS) 
00730     {
00731         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00732     }
00733 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_disconnect ( const char *  ipc_service  ) 

Definition at line 769 of file sysd/src/ipc.c.

References eripc_client_context_t::context, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.

Referenced by conn_disconnect(), conn_enable_flightmode(), conn_enable_lowbatt(), conn_stop(), and enter_connected_state().

00770 {
00771     LOGPRINTF("entry");
00772 
00773     eripc_error_t retval;
00774         
00775     // NOTE: this call slightly differs from eripc_sysd_conn_connect()
00776     //       in that it uses the IPC SERVICE of the connection manager as
00777     //       destination for the message 
00778     retval = eripc_send_varargs(eripcClient->context,
00779                                NULL,            // no reply handler
00780                                NULL,            // no reply data
00781                                ERIPC_BUS_SESSION,
00782                                ipc_service,
00783                                "connDisconnect",
00784                                ERIPC_TYPE_STRING, ipc_service,
00785                                ERIPC_TYPE_INVALID);
00786     
00787     if (retval != ERIPC_ERROR_SUCCESS) 
00788     {
00789         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00790         return FALSE;
00791     }
00792     
00793     return TRUE;
00794 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_edit_profile ( const char *  medium,
const char *  profile 
)

Definition at line 899 of file sysd/src/ipc.c.

References eripc_client_context_t::context, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, LOGPRINTF, and medium_service().

00900 {
00901     LOGPRINTF("entry");
00902 
00903     eripc_error_t retval;
00904         
00905     g_return_val_if_fail(medium  != NULL, FALSE);
00906     g_return_val_if_fail(profile != NULL, FALSE);
00907     
00908     retval = eripc_send_varargs(eripcClient->context,
00909                                NULL,            // no reply handler
00910                                NULL,            // no reply data
00911                                ERIPC_BUS_SESSION,
00912                                medium_service(medium),
00913                                "connEditProfile",
00914                                ERIPC_TYPE_STRING, medium,
00915                                ERIPC_TYPE_STRING, profile,
00916                                ERIPC_TYPE_INVALID);
00917     
00918     if (retval != ERIPC_ERROR_SUCCESS) 
00919     {
00920         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00921         return FALSE;
00922     }
00923     
00924     return TRUE;
00925 }

Here is the call graph for this function:

void ipc_menu_add_task ( gint  xid,
const char *  label 
)

Add a task item.

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

Name : ipc_menu_add_task

Parameters:
xid window id
label Label text for menu
Returns:
--

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

Definition at line 477 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.

Referenced by on_window_open_callback(), and task_startup_completed().

00478 {
00479     LOGPRINTF("entry, xid=%d  label='%s'", xid, label);
00480     g_return_if_fail(label != NULL);
00481 
00482     eripc_error_t retval = eripc_send_varargs(eripcClient->context,
00483                                 NULL,
00484                                 NULL,
00485                                 ERIPC_BUS_SESSION,
00486                                 DBUS_SERVICE_MENU,
00487                                 "addTask",
00488                                 ERIPC_TYPE_INT, xid,
00489                                 ERIPC_TYPE_STRING, label,
00490                                 ERIPC_TYPE_STRING, DBUS_INTERFACE,
00491                                 ERIPC_TYPE_INVALID);
00492     
00493     if (retval != ERIPC_ERROR_SUCCESS) 
00494     {
00495         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00496     } 
00497 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_menu_remove_task ( int  xid  ) 

Remove a task item.

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

Name : ipc_menu_remove_task

Parameters:
application Application of task
document Document of task
Returns:
--

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

Definition at line 519 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_int(), ERRORPRINTF, and LOGPRINTF.

Referenced by tasklist_remove_pid(), and tasklist_remove_window().

00520 {
00521     LOGPRINTF("entry, xid=%d", xid);
00522 
00523     eripc_error_t retval = eripc_send_int(eripcClient->context,
00524                                NULL,
00525                                NULL,
00526                                ERIPC_BUS_SESSION,
00527                                DBUS_SERVICE_MENU,
00528                                "removeTask", xid);
00529     if (retval != ERIPC_ERROR_SUCCESS) 
00530     {
00531         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00532     } 
00533 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_menu_rename_task ( int  xid,
const char *  label 
)

Definition at line 536 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.

Referenced by task_rename().

00537 {
00538     LOGPRINTF("entry, xid=%d  label=%s", xid, label);
00539 
00540     eripc_error_t retval = eripc_send_varargs(eripcClient->context,
00541                                NULL,
00542                                NULL,
00543                                ERIPC_BUS_SESSION,
00544                                DBUS_SERVICE_MENU,
00545                                "renameTask",
00546                                ERIPC_TYPE_INT, xid,
00547                                ERIPC_TYPE_STRING, label,
00548                                ERIPC_TYPE_INVALID);
00549     if (retval != ERIPC_ERROR_SUCCESS) 
00550     {
00551         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00552     } 
00553 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_menu_set_first_task ( int  xid  ) 

Set task item to front or list.

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

Name : ipc_menu_set_first_task

Parameters:
xid 
Returns:
--

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

Definition at line 500 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_int(), ERRORPRINTF, and LOGPRINTF.

Referenced by tasklist_set_first().

00501 {
00502     LOGPRINTF("xid=%d", xid);
00503 
00504     eripc_error_t retval = eripc_send_int(eripcClient->context,
00505                                 NULL,
00506                                 NULL,
00507                                 ERIPC_BUS_SESSION,
00508                                 DBUS_SERVICE_MENU,
00509                                 "setTaskToTop",
00510                                 xid);
00511 
00512     if (retval != ERIPC_ERROR_SUCCESS) 
00513     {
00514         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00515     } 
00516 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_menu_set_item_state ( const char *  iname,
const char *  pname,
const char *  state 
)

Set new menu item state.

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

Name : ipc_menu_set_item_state

Parameters:
iname Item name
pname Parent group name
state State name
Returns:
--

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

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

References DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_menu_set_item_state(), eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.

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

Here is the call graph for this function:

void ipc_menu_set_statusitem_state ( const char *  name,
const char *  state 
)

Set new status item state.

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

Name : ipc_menu_set_statusitem_state

Parameters:
name Item name
state State name
Returns:
--

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

Definition at line 471 of file sysd/src/ipc.c.

References eripc_menu_set_statusitem_state().

Referenced by conn_update_statusbar(), force_statusbar_state(), and sys_set_sensor_lock().

00472 {
00473     eripc_menu_set_statusitem_state(eripcClient, name, state);
00474 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_menu_show ( const char *  menu  ) 

Definition at line 556 of file sysd/src/ipc.c.

References eripc_menu_show_menu().

00557 {
00558     eripc_menu_show_menu(eripcClient, menu);
00559 }

Here is the call graph for this function:

void ipc_refresh_ctb (  ) 

Definition at line 338 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_CTB, ERIPC_BUS_SESSION, eripc_send_varargs(), and ERIPC_TYPE_INVALID.

Referenced by on_process_exit().

00339 {
00340     eripc_send_varargs(eripcClient->context,
00341                       NULL,
00342                       NULL,
00343                       ERIPC_BUS_SESSION,
00344                       DBUS_SERVICE_CTB,
00345                       "filesystemChanged", ERIPC_TYPE_INVALID);
00346 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_battery_state ( gint  battery_level,
enum  state_charge,
gint  time_left 
)

Send the sysBatteryState signal.

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

Name : ipc_send_battery_state

Parameters:
battery_level Battery capacity remaining percentage
state_charge Battery charge mode
time_left Minutes to empty (discharging) or -1 (charging)
Returns:
--

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

Definition at line 224 of file sysd/src/ipc.c.

References charge_text, eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, and LOGPRINTF.

Referenced by update_battery_info().

00225 {
00226     LOGPRINTF("entry");
00227     
00228     // broadcast signal over session bus
00229     //
00230     eripc_send_signal_varargs(eripcClient->context, 
00231                               ERIPC_BUS_SESSION,
00232                               DBUS_PATH,
00233                               DBUS_INTERFACE,
00234                               "sysBatteryState",
00235                               ERIPC_TYPE_INT, battery_level,
00236                               ERIPC_TYPE_STRING, charge_text[charge_state],
00237                               ERIPC_TYPE_INT, time_left,
00238                               ERIPC_TYPE_INVALID);
00239     
00240     LOGPRINTF("Sent signal sysBatteryState: %d, %s", battery_level, charge_text[charge_state]);
00241 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_changed_locale ( const char *  locale  ) 

Emit sysChangedLocale signal.

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

Name : ipc_send_changed_locale

Parameters:
locale Locale string in form ll_CC
Returns:
--

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

Definition at line 367 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, and LOGPRINTF.

Referenced by post_process_startup(), and set_locale().

00368 {
00369     LOGPRINTF("entry");
00370     
00371     // broadcast signal over session bus
00372     //
00373     eripc_send_signal_varargs(eripcClient->context, 
00374                               ERIPC_BUS_SESSION,
00375                               DBUS_PATH,
00376                               DBUS_INTERFACE,
00377                               "sysChangedLocale",
00378                               ERIPC_TYPE_STRING, locale,
00379                               ERIPC_TYPE_INVALID);
00380     
00381     LOGPRINTF("Sent signal sysChangedLocale %s", locale);
00382 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_changed_orientation ( guint  orientation  ) 

Definition at line 421 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, LOGPRINTF, and orientation_text.

Referenced by on_rotated().

00422 {
00423     LOGPRINTF("entry");
00424 
00425     if (orientation >= sizeof(orientation_text))
00426     {
00427         ERRORPRINTF("Orientation %d unknown, signal not sent.", orientation);
00428         return;
00429     }
00430     
00431     // broadcast signal over session bus
00432     //
00433     eripc_send_signal_varargs(eripcClient->context, 
00434                               ERIPC_BUS_SESSION,
00435                               DBUS_PATH,
00436                               DBUS_INTERFACE,
00437                               "sysChangedOrientation",
00438                               ERIPC_TYPE_STRING, orientation_text[orientation],
00439                               ERIPC_TYPE_INVALID);
00440     
00441     LOGPRINTF("Sent signal sysChangedOrientation %s", orientation_text[orientation]);
00442 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_changed_pageturn_inverted ( gboolean  is_inverted  ) 

Emit sysChangedPageturnInverted signal.

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

Name : ipc_send_changed_pageturn_inverted

Parameters:
boolean is_inverted
Returns:
--

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

Definition at line 403 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_BOOL, ERIPC_TYPE_INVALID, and LOGPRINTF.

Referenced by sys_set_pageturn_inverted().

00404 {
00405     LOGPRINTF("entry");
00406 
00407     // broadcast signal over session bus
00408     //
00409     eripc_send_signal_varargs(eripcClient->context, 
00410                               ERIPC_BUS_SESSION,
00411                               DBUS_PATH,
00412                               DBUS_INTERFACE,
00413                               "sysChangedPageturnInverted",
00414                               ERIPC_TYPE_BOOL, is_inverted,
00415                               ERIPC_TYPE_INVALID);
00416     
00417     LOGPRINTF("Sent signal sysChangedPageturnInverted %d", (gint)is_inverted);
00418 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_send_close ( const char *  ipc_interface,
const char *  document,
void *  callback_handler,
void *  callback_data 
)

Close file by application.

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

Name : ipc_send_close

Parameters:
ipc_interface IPC service name to send message to
document Full path to file
callback_handler Function to receive reply
callback_data Data to pass to callback_handler
Returns:
TRUE if successfully closed by application, FALSE otherwise

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

Definition at line 958 of file sysd/src/ipc.c.

References eripc_client_context_t::context, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string(), ERRORPRINTF, and LOGPRINTF.

Referenced by child_window_close().

00962 {
00963     LOGPRINTF("entry");
00964     
00965     eripc_error_t retval;
00966         
00967     g_return_val_if_fail(ipc_interface != NULL, FALSE);
00968     g_return_val_if_fail(document != NULL, FALSE);
00969     
00970     retval = eripc_send_string(eripcClient->context,
00971                                callback_handler,
00972                                callback_data,
00973                                ERIPC_BUS_SESSION,
00974                                ipc_interface,
00975                                "closeFile",
00976                                document);
00977 
00978     if (retval != ERIPC_ERROR_SUCCESS) 
00979     {
00980         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00981         return FALSE;
00982     }
00983     
00984     return TRUE;
00985 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_send_conn_status ( const char *  ipc_service,
gboolean  is_connected,
const char *  medium,
const char *  profile,
const char *  reason 
)

Definition at line 797 of file sysd/src/ipc.c.

References eripc_client_context_t::context, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_BOOL, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.

Referenced by conn_connect(), conn_disconnect(), conn_status_request(), on_flightmode_dialog_return(), and on_lowbatt_dialog_return().

00802 {
00803     LOGPRINTF("entry");
00804 
00805     eripc_error_t retval;
00806         
00807     // NOTE: status is send to a specific service when there was no change is in state (already connected/disconnected)
00808     retval = eripc_send_varargs(eripcClient->context,
00809                                NULL,            // no reply handler
00810                                NULL,            // no reply data
00811                                ERIPC_BUS_SESSION,
00812                                ipc_service,
00813                                "connConnectionStatus",
00814                                ERIPC_TYPE_BOOL,   is_connected,
00815                                ERIPC_TYPE_STRING, medium,
00816                                ERIPC_TYPE_STRING, profile,
00817                                ERIPC_TYPE_STRING, reason,
00818                                ERIPC_TYPE_INVALID);
00819     
00820     if (retval != ERIPC_ERROR_SUCCESS) 
00821     {
00822         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00823         return FALSE;
00824     }
00825     
00826     return TRUE;
00827 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_demo_mode ( gboolean  demo_mode  ) 

Emit sysChangeDemoMode signal.

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

Name : ipc_send_demo_mode

Parameters:
demo_mode to enable/disable demo_mode
Returns:
--

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

Definition at line 385 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_BOOL, ERIPC_TYPE_INVALID, and LOGPRINTF.

Referenced by start_demo_mode(), and stop_demo_mode().

00386 {
00387     LOGPRINTF("entry");
00388 
00389     // broadcast signal over session bus
00390     //
00391     eripc_send_signal_varargs(eripcClient->context,
00392                               ERIPC_BUS_SESSION,
00393                               DBUS_PATH,
00394                               DBUS_INTERFACE,
00395                               "sysChangeDemoMode",
00396                               ERIPC_TYPE_BOOL, demo_mode,
00397                               ERIPC_TYPE_INVALID);
00398 
00399     LOGPRINTF("Sent signal sysChangeDemoMode %d", demo_mode);
00400 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_send_open ( const char *  ipc_interface,
const char *  document,
void *  callback_handler,
void *  callback_data 
)

Open new file by application.

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

Name : ipc_send_open

Parameters:
ipc_interface IPC service name to send message to
document Full path to file
callback_handler Function to receive reply
callback_data Data to pass to callback_handler
Returns:
TRUE if successfully opened by application, FALSE otherwise

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

Definition at line 928 of file sysd/src/ipc.c.

References eripc_client_context_t::context, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string(), ERRORPRINTF, and LOGPRINTF.

Referenced by child_window_open().

00932 {
00933     LOGPRINTF("entry");
00934     
00935     eripc_error_t retval;
00936         
00937     g_return_val_if_fail(ipc_interface != NULL, FALSE);
00938     g_return_val_if_fail(document != NULL, FALSE);
00939     
00940     retval = eripc_send_string(eripcClient->context,
00941                                callback_handler,
00942                                callback_data,
00943                                ERIPC_BUS_SESSION,
00944                                ipc_interface,
00945                                "openFile",
00946                                document);
00947 
00948     if (retval != ERIPC_ERROR_SUCCESS) 
00949     {
00950         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00951         return FALSE;
00952     }
00953     
00954     return TRUE;
00955 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_prepare_standby ( void   ) 

Send the sysPrepareStandby signal.

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

Name : ipc_send_prepare_standby

Parameters:
-- 
Returns:
--

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

Definition at line 244 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_INVALID, and LOGPRINTF.

00245 {
00246     LOGPRINTF("entry");
00247     
00248     // broadcast signal over session bus
00249     //
00250     eripc_send_signal_varargs(eripcClient->context, 
00251                               ERIPC_BUS_SESSION,
00252                               DBUS_PATH,
00253                               DBUS_INTERFACE,
00254                               "sysPrepareStandby",
00255                               ERIPC_TYPE_INVALID);
00256     
00257     LOGPRINTF("Sent signal sysPrepareStandby");
00258 }

Here is the call graph for this function:

void ipc_send_prepare_unmount ( const char *  mount_point  ) 

Send the sysPrepareUnmount signal.

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

Name : ipc_send_prepare_unmount

Parameters:
mount_point Mount point
Returns:
--

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

Definition at line 261 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, and LOGPRINTF.

Referenced by report_unmounting_volumes().

00262 {
00263     LOGPRINTF("entry");
00264 
00265     // broadcast signal over session bus
00266     //
00267     eripc_send_signal_varargs(eripcClient->context, 
00268                               ERIPC_BUS_SESSION,
00269                               DBUS_PATH,
00270                               DBUS_INTERFACE,
00271                               "sysPrepareUnmount",
00272                               ERIPC_TYPE_STRING, mount_point,
00273                               ERIPC_TYPE_INVALID);
00274     
00275     LOGPRINTF("Sent signal sysPrepareUnmount %s", mount_point);
00276 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_reply ( eripc_context_t context,
const char *  message_id,
gboolean  result 
)

Return a IPC reply message.

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

Name : ipc_send_reply

Parameters:
context ERIPC context to use for reply
message_id ERIPC message id to use for reply
result Boolean return value
Returns:
--

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

Definition at line 529 of file popupmenu/src/ipc.c.

References eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_reply_bool(), ERRORPRINTF, and LOGPRINTF.

00530 {
00531     LOGPRINTF("entry, reply %d", result);
00532     
00533     if (message_id)
00534     {
00535         LOGPRINTF("Sending reply %s to: %s, context %p", (result == TRUE ? "TRUE":"FALSE"), message_id, context);
00536 
00537         eripc_error_t retval = eripc_reply_bool(context, message_id, result);
00538         if (retval != ERIPC_ERROR_SUCCESS) 
00539         {
00540             ERRORPRINTF("Error sending reply to message: %s", eripc_error_string(retval));
00541         }
00542     }
00543     else
00544     {
00545         LOGPRINTF("Result is %s but no reply was requested", (result == TRUE ? "TRUE":"FALSE"));
00546     }
00547 }

Here is the call graph for this function:

void ipc_send_reply_task_start ( eripc_context_t context,
const char *  message_id,
gint  err_code,
gchar *  err_msg 
)

Return a IPC reply message to startTask call.

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

Name : ipc_send_reply_task_start

Parameters:
context ERIPC context to use for reply
message_id ERIPC message id to use for reply
err_code Integer, return code (0 for success, >0 for error)
err_msg String, custom error message or NULL for none
Returns:
--

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

Definition at line 1011 of file sysd/src/ipc.c.

References eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_reply_varargs(), ERIPC_TYPE_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.

Referenced by cb_open_url(), cb_task_start(), on_check_child_window(), on_child_new_timeout(), on_window_open_callback(), and task_start().

01012 {
01013     LOGPRINTF("entry");
01014     
01015 
01016     g_return_if_fail(context != NULL);
01017 
01018     if (message_id)
01019     {
01020         LOGPRINTF("Sending reply %d to: %s, context %p", err_code, message_id, context);
01021 
01022         eripc_error_t retval = eripc_reply_varargs(context, message_id, 
01023                                      ERIPC_TYPE_INT, err_code,
01024                                      ERIPC_TYPE_STRING, err_msg,
01025                                      ERIPC_TYPE_INVALID);
01026         if (retval != ERIPC_ERROR_SUCCESS) 
01027         {
01028             ERRORPRINTF("Error sending reply to message: %s", eripc_error_string(retval));
01029         }
01030     }
01031     else
01032     {
01033         LOGPRINTF("Sending reply %d but no reply was requested", err_code);
01034     }
01035 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_usb_state ( const char *  state  ) 

Send the sysUsbState signal.

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

Name : ipc_send_usb_state

Parameters:
state State ("disconnected", "unmounted", "mounted")
Returns:
--

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

Definition at line 349 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, and LOGPRINTF.

Referenced by usb_set_state().

00350 {
00351     LOGPRINTF("state = '%s'", state);
00352     
00353     // broadcast signal over session bus
00354     //
00355     eripc_send_signal_varargs(eripcClient->context, 
00356                               ERIPC_BUS_SESSION,
00357                               DBUS_PATH,
00358                               DBUS_INTERFACE,
00359                               "sysUsbState",
00360                               ERIPC_TYPE_STRING, state,
00361                               ERIPC_TYPE_INVALID);
00362     
00363     LOGPRINTF("Sent signal sysUsbState %s", state);
00364 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_volume_mounted ( const char *  mount_point  ) 

Emit sysVolumeMounted signal.

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

Name : ipc_send_volume_mounted

Parameters:
mount_point Mount point
Returns:
--

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

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

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, and LOGPRINTF.

Referenced by on_phase_1_complete(), sys_set_card(), and volume_is_mounted().

00280 {
00281     LOGPRINTF("entry");
00282     
00283     // broadcast signal over session bus
00284     //
00285     eripc_send_signal_varargs(eripcClient->context, 
00286                               ERIPC_BUS_SESSION,
00287                               DBUS_PATH,
00288                               DBUS_INTERFACE,
00289                               "sysVolumeMounted",
00290                               ERIPC_TYPE_STRING, mount_point,
00291                               ERIPC_TYPE_INVALID);
00292     
00293     LOGPRINTF("Sent signal sysVolumeMounted %s", mount_point);
00294 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_volume_mounted_to ( const char *  service,
const char *  mount_point 
)

Send the volumeMounted method call to an application.

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

Name : ipc_send_volume_mounted_to

Parameters:
service IPC service
mount_point Mount point
Returns:
--

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

Definition at line 297 of file sysd/src/ipc.c.

References eripc_client_context_t::context, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string(), ERRORPRINTF, and LOGPRINTF.

Referenced by post_process_startup().

00298 {
00299     eripc_error_t retval;
00300 
00301     LOGPRINTF("entry");
00302     
00303     retval = eripc_send_string(eripcClient->context, 
00304                                NULL,
00305                                NULL,
00306                                ERIPC_BUS_SESSION,
00307                                service,
00308                                "sysVolumeMounted",
00309                                mount_point);
00310     
00311     if (retval != ERIPC_ERROR_SUCCESS) 
00312     {
00313         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00314         return;
00315     }
00316 
00317     LOGPRINTF("Sent sysVolumeMounted %s to %s", mount_point, service);
00318 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_volume_unmounted ( const char *  mount_point  ) 

Emit sysVolumeUnmounted signal.

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

Name : ipc_send_volume_unmounted

Parameters:
mount_point Mount point
Returns:
--

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

Definition at line 321 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_INTERFACE, DBUS_PATH, ERIPC_BUS_SESSION, eripc_send_signal_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, and LOGPRINTF.

Referenced by hal_device_property_modified(), and hal_device_removed().

00322 {
00323     LOGPRINTF("entry");
00324     
00325     // broadcast signal over session bus
00326     //
00327     eripc_send_signal_varargs(eripcClient->context, 
00328                               ERIPC_BUS_SESSION,
00329                               DBUS_PATH,
00330                               DBUS_INTERFACE,
00331                               "sysVolumeUnmounted",
00332                               ERIPC_TYPE_STRING, mount_point,
00333                               ERIPC_TYPE_INVALID);
00334     
00335     LOGPRINTF("Sent signal sysVolumeUnmounted %s", mount_point);
00336 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_window_activated ( const char *  ipc_interface,
gint  window 
)

Definition at line 2090 of file sysd/src/ipc.c.

References eripc_client_context_t::context, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_int(), ERRORPRINTF, and LOGPRINTF.

Referenced by parse_wm_messages().

02091 {
02092     LOGPRINTF("entry");
02093 
02094     eripc_error_t retval;
02095     retval = eripc_send_int(eripcClient->context,
02096                             NULL,
02097                             NULL,
02098                             ERIPC_BUS_SESSION,
02099                             ipc_interface,
02100                             "activatedWindow",
02101                             window);
02102 
02103     if (retval != ERIPC_ERROR_SUCCESS)
02104     {
02105         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
02106     }
02107 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_window_deactivated ( const char *  ipc_interface,
gint  window 
)

Definition at line 2070 of file sysd/src/ipc.c.

References eripc_client_context_t::context, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_int(), ERRORPRINTF, and LOGPRINTF.

Referenced by parse_wm_messages().

02071 {
02072     LOGPRINTF("entry");
02073 
02074     eripc_error_t retval;
02075     retval = eripc_send_int(eripcClient->context,
02076                             NULL,
02077                             NULL,
02078                             ERIPC_BUS_SESSION,
02079                             ipc_interface,
02080                             "deactivatedWindow",
02081                             window);
02082 
02083     if (retval != ERIPC_ERROR_SUCCESS)
02084     {
02085         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
02086     }
02087 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_set_services ( void   ) 

Setup IPC connection and register API functions.

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

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.

References eripc_client_context_t::context, DBUS_APPL_NAME, DBUS_INTERFACE, DBUS_PATH, DBUS_SERVICE, ERIPC_BUS_SESSION, eripc_client_context_new(), ERIPC_ERROR_SUCCESS, eripc_init(), eripc_set_message_handler(), eripc_set_signal_handler(), eripc_set_timeout(), notepad::eripcClient, erkeyb_client_init(), ERRORPRINTF, handler, functionEntry::handler, handler_id, interface, LOGPRINTF, name, path, service, notepad::service_functions, and service_functions.

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 }

Here is the call graph for this function:

void ipc_show_busy ( gboolean  show_mode,
const gchar *  message 
)

Show a busy/wait prompt.

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

Name : ipc_show_busy

Parameters:
show_mode TRUE to show the prompt, FALSE to remove it
message Busy message to show in dialog, or NULL for default text
Returns:
--

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

Definition at line 582 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.

Referenced by show_dialog().

00583 {
00584     LOGPRINTF("entry");
00585     eripc_error_t retval;
00586 
00587     retval = eripc_send_varargs(eripcClient->context,
00588                                 NULL,
00589                                 NULL,
00590                                 ERIPC_BUS_SESSION,
00591                                 DBUS_SERVICE_MENU,
00592                                "setBusyShow",
00593                                 ERIPC_TYPE_STRING, show_mode ? "show" : "hide",
00594                                 ERIPC_TYPE_STRING, message,
00595                                 ERIPC_TYPE_INVALID);
00596 
00597     if (retval != ERIPC_ERROR_SUCCESS) 
00598     {
00599         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00600     }
00601 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_show_message ( const char *  type,
const void *  reply_handler,
const void *  user_data 
)

Show a predefined message dialog.

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

Name : ipc_show_message

Parameters:
type Message to show ("safelyremove")
reply_handler Handler called when a reply is returned
user_data Data to pass to the reply handler
Returns:
--

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

Definition at line 629 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string(), ERRORPRINTF, and LOGPRINTF.

Referenced by check_disk_free(), conn_check_battery(), conn_connect(), conn_enable_lowbatt(), enter_off_state(), and on_process_exit().

00630 {
00631     LOGPRINTF("entry");
00632     eripc_error_t retval;
00633     
00634     g_return_if_fail(type != NULL);
00635 
00636     retval = eripc_send_string(eripcClient->context,
00637                                (eripc_handler_t *) reply_handler,
00638                                user_data,
00639                                ERIPC_BUS_SESSION,
00640                                DBUS_SERVICE_MENU,
00641                                "setMessageShow",
00642                                type);
00643 
00644     if (retval != ERIPC_ERROR_SUCCESS) 
00645     {
00646         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00647     }
00648 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_show_popup ( const char *  state  ) 

Definition at line 562 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string(), ERRORPRINTF, and LOGPRINTF.

Referenced by sys_request_popup().

00563 {
00564     LOGPRINTF("entry");
00565     
00566     eripc_error_t retval;
00567     retval = eripc_send_string(eripcClient->context,
00568                                NULL,
00569                                NULL,
00570                                ERIPC_BUS_SESSION,
00571                                DBUS_SERVICE_MENU,
00572                                "setPopupShow",
00573                                state);
00574 
00575     if (retval != ERIPC_ERROR_SUCCESS) 
00576     {
00577         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00578     }
00579 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_show_splash ( const char *  type  ) 

Show a predefined splash screen.

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

Name : ipc_show_splash

Parameters:
type Splash to show ("usbconnect" or "shutdown") or "hide" to remove
Returns:
--

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

Definition at line 604 of file sysd/src/ipc.c.

References eripc_client_context_t::context, DBUS_SERVICE_MENU, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_send_string(), ERRORPRINTF, LOGPRINTF, and sys_reset_idle_time().

Referenced by do_unmount(), on_card_indexed(), on_eject_continue(), sys_set_card(), sys_starting_finished(), update_battery_info(), usb_set_state(), and volume_is_mounted().

00605 {
00606     LOGPRINTF("entry [%s]", type);
00607     eripc_error_t retval;
00608     
00609     g_return_if_fail(type != NULL);
00610 
00611     // it may take a little while for the splash to show up
00612     // so make sure we don't suspend early
00613     sys_reset_idle_time();
00614     
00615     retval = eripc_send_string(eripcClient->context,
00616                                NULL,
00617                                NULL,
00618                                ERIPC_BUS_SESSION,
00619                                DBUS_SERVICE_MENU,
00620                                "setSplashShow", type);
00621     
00622     if (retval != ERIPC_ERROR_SUCCESS) 
00623     {
00624         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00625     }
00626 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_unset_services ( void   ) 

Unregister API functions.

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

Name : ipc_unset_services

Parameters:
-- 
Returns:
--

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

Definition at line 108 of file index_ipc.c.

References eripc_client_context_free(), eripc_unset_handler(), notepad::eripcClient, erkeyb_client_term(), handler_id, functionEntry::handler_id, notepad::ipc_gconf_finalize(), LOGPRINTF, notepad::service_functions, and service_functions.

Here is the call graph for this function:


Variable Documentation

Definition at line 97 of file sysd/src/ipc.c.

Generated by  doxygen 1.6.2-20100208