sysd/src/ipc.c File Reference

#include "config.h"
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <liberipc/eripc.h>
#include <liberipc/eripc_support.h>
#include <liberkeyb/erkeyb-client.h>
#include "log.h"
#include "busy.h"
#include "ipc.h"
#include "connections.h"
#include "hal.h"
#include "process.h"
#include "system.h"
#include "tasks.h"
#include "wacom.h"
#include "xwindow.h"
Include dependency graph for sysd/src/ipc.c:

Go to the source code of this file.

Defines

#define CHECK_ARG_STRING(x)
#define CHECK_ARG_INT(x)
#define CHECK_ARG_BOOL(x)

Functions

static void cb_sys_get_battery_state (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_get_orientation (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_get_pageturn_inverted (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_get_card_mountpoint (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_get_device_capabilities (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_set_busy_led (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_set_bg_busy (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_reset_bg_busy (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_set_fg_busy (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_reset_fg_busy (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_beep (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_rotate (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_lock_sensors (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_set_stylus (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_get_stylus (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_card_mount (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_card_unmount (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_shutdown (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_standby (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_set_keyboard (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_task_start (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_task_activate (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_task_stop (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_task_rename (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_menu_request_popup (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_menu_item_activated (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_status_item_activated (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_startup_complete (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_open_url (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_opened_window (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_closed_window (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_confirm_usbconnect (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_confirm_install_drz (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_confirm_install_update (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_conn_connect (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_conn_disconnect (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_conn_status (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_conn_status_request (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_conn_signal (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_conn_add_profile (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_conn_edit_profile (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void testing_list_tasks (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static const gchar * medium_service (const char *medium)
static gint sender_from_service (const char *service)
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 charge_state, gint time_left)
 Send the sysBatteryState signal.
void ipc_send_prepare_standby ()
 Send the sysPrepareStandby signal.
void ipc_send_prepare_unmount (const char *mount_point)
 Send the sysPrepareUnmount signal.
void ipc_send_volume_mounted (const char *mount_point)
 Emit sysVolumeMounted signal.
void ipc_send_volume_mounted_to (const char *service, const char *mount_point)
 Send the volumeMounted method call to an application.
void ipc_send_volume_unmounted (const char *mount_point)
 Emit sysVolumeUnmounted signal.
void ipc_refresh_ctb ()
void ipc_send_usb_state (const char *state)
 Send the sysUsbState 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_send_changed_orientation (guint orientation)
static void ipc_send_window_show (const char *ipc_interface, gint window)
void ipc_menu_set_item_state (const char *iname, const char *pname, const char *state)
 Send message setItemState to popup menu.
void ipc_menu_set_statusitem_state (const char *name, const char *state)
 Set new status item state.
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_menu_show (const char *menu)
void ipc_show_popup (const char *state)
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_ctb_goto (const char *location)
 Set new location for Content Browser.
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_broadcast_conn_signal (const char *medium, const int signal)
gboolean ipc_add_profile (const char *medium)
gboolean ipc_edit_profile (const char *medium, const char *profile)
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_send_window_deactivated (const char *ipc_interface, gint window)
void ipc_send_window_activated (const char *ipc_interface, gint window)

Variables

static const char * charge_text [] = { "", "low", "charging", "discharging", "full" }
static const char * orientation_text [] = { "portrait", "landscape_clockwise", "landscape_anticlockwise" }
static const gchar * browser_path = "/usr/bin/erbrowser"
static const gchar * browser_options = "-n"
static const gchar * ade_fulfill_path = "/usr/bin/adobe-fulfill"
static const gchar * downloadmgr_path = "/usr/bin/downloadmgr"
eripc_client_context_teripcClient = NULL
static eripc_callback_function_t service_functions []

Define Documentation

#define CHECK_ARG_BOOL (  ) 
Value:
if (arg_array[x].type != ERIPC_TYPE_BOOL) { \
        ERRORPRINTF("arg %d is not a boolean", x); \
        return; \
    }

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

Referenced by cb_conn_status(), and cb_startup_complete().

#define CHECK_ARG_INT (  ) 
Value:
if (arg_array[x].type != ERIPC_TYPE_INT) { \
        ERRORPRINTF("arg %d is not an integer", x); \
        return; \
    }

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

#define CHECK_ARG_STRING (  ) 
Value:
if (arg_array[x].type != ERIPC_TYPE_STRING || arg_array[x].value.s == NULL) { \
        ERRORPRINTF("arg %d is not a string", x); \
        return; \
    }

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

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


Function Documentation

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

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

References eripc_event_info_t::args, CHECK_ARG_INT, eripc_arg_t::i, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, and task_cleanup_window().

01821 {
01822     LOGPRINTF("entry");
01823     const eripc_arg_t *arg_array = info->args;
01824 
01825     gboolean result = FALSE;
01826 
01827     CHECK_ARG_INT(0);
01828     if (arg_array[0].value.i > 0)
01829     {
01830         result = task_cleanup_window(arg_array[0].value.i);
01831     }
01832 
01833     ipc_send_reply(context, info->message_id, result);
01834 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, conn_add_profile(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, and eripc_arg_t::s.

01923 {
01924     LOGPRINTF("entry");
01925     const eripc_arg_t *arg_array = info->args;
01926 
01927     CHECK_ARG_STRING(0); 
01928     gboolean result = conn_add_profile(arg_array[0].value.s);
01929     ipc_send_reply(context, info->message_id, result);
01930 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, conn_connect(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, service, eripc_arg_t::value, and WARNPRINTF.

01838 {
01839     LOGPRINTF("entry");
01840     const eripc_arg_t *arg_array = info->args;
01841     
01842     CHECK_ARG_STRING(0);    // ipc service
01843     CHECK_ARG_STRING(1);    // medium
01844     CHECK_ARG_STRING(2);    // profile
01845 
01846     gchar *service = arg_array[0].value.s;
01847     gchar *medium  = arg_array[1].value.s;
01848     gchar *profile = arg_array[2].value.s;
01849     
01850     LOGPRINTF("MACHINE_NAME [" MACHINE_NAME "] medium [%s]", medium);
01851     if (!medium || (medium[0]==0))
01852     {
01853 #if MACHINE_IS_DR1000SW
01854         medium = "wifi";
01855 #elif MACHINE_IS_DR800SG
01856         medium = "3g";
01857 #else
01858         WARNPRINTF("no connectivity for MACHINE_NAME [" MACHINE_NAME "]");
01859         ipc_send_reply(context, info->message_id, FALSE);
01860         return;
01861 #endif
01862     }    
01863 
01864     gboolean result = conn_connect(service, medium, profile);
01865     ipc_send_reply(context, info->message_id, result);
01866 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, conn_disconnect(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, and eripc_arg_t::s.

01870 {
01871     LOGPRINTF("entry");
01872     const eripc_arg_t *arg_array = info->args;
01873 
01874     CHECK_ARG_STRING(0);
01875     gboolean result = conn_disconnect(arg_array[0].value.s);
01876     ipc_send_reply(context, info->message_id, result);
01877 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, conn_edit_profile(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, and eripc_arg_t::value.

01934 {
01935     LOGPRINTF("entry");
01936     const eripc_arg_t *arg_array = info->args;
01937 
01938     CHECK_ARG_STRING(0);    // connection medium
01939     CHECK_ARG_STRING(1);    // network profile
01940     gboolean result = conn_edit_profile(arg_array[0].value.s, arg_array[1].value.s);
01941     ipc_send_reply(context, info->message_id, result);
01942 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_INT, CHECK_ARG_STRING, eripc_arg_t::i, ipc_broadcast_conn_signal(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, and eripc_arg_t::value.

01910 {
01911     LOGPRINTF("entry");
01912     const eripc_arg_t *arg_array = info->args;
01913 
01914     CHECK_ARG_INT(0);       // strength
01915     CHECK_ARG_STRING(1);    // medium
01916 
01917     ipc_broadcast_conn_signal(arg_array[1].value.s, arg_array[0].value.i);
01918     ipc_send_reply(context, info->message_id, TRUE);
01919 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, eripc_arg_t::b, CHECK_ARG_BOOL, CHECK_ARG_STRING, conn_set_status(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, and eripc_arg_t::value.

01881 {
01882     LOGPRINTF("entry");
01883     const eripc_arg_t *arg_array = info->args;
01884 
01885     CHECK_ARG_BOOL(0);      // is_connected
01886     CHECK_ARG_STRING(1);    // medium
01887     CHECK_ARG_STRING(2);    // profile
01888     CHECK_ARG_STRING(2);    // reason (disconnect only)
01889 
01890     gboolean result = conn_set_status( arg_array[0].value.b,
01891                               arg_array[1].value.s,
01892                               arg_array[2].value.s,
01893                               arg_array[3].value.s );
01894     ipc_send_reply(context, info->message_id, result);
01895 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, conn_status_request(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, and eripc_arg_t::s.

01899 {
01900     LOGPRINTF("entry");
01901     const eripc_arg_t *arg_array = info->args;
01902 
01903     CHECK_ARG_STRING(0);
01904     gboolean result = conn_status_request(arg_array[0].value.s);
01905     ipc_send_reply(context, info->message_id, result);
01906 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, ipc_ctb_goto(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, process_activate(), eripc_arg_t::s, sys_eject_card(), sys_set_orientation(), sys_set_sensor_lock(), sys_standby(), task_activate(), eripc_arg_t::value, and WARNPRINTF.

01657 {
01658     LOGPRINTF("entry");
01659     const eripc_arg_t *arg_array = info->args;
01660 
01661     CHECK_ARG_STRING(0);
01662     CHECK_ARG_STRING(1);
01663     CHECK_ARG_STRING(2);
01664     CHECK_ARG_STRING(3);
01665     const char *item  = arg_array[0].value.s;
01666     const char *group = arg_array[1].value.s;
01667     //const char *menu  = arg_array[2].value.s;
01668     const char *state = arg_array[3].value.s;
01669 
01670     gboolean result = FALSE;
01671     if (g_ascii_strcasecmp(group, "general") == 0)
01672     {
01673         if (g_ascii_strcasecmp(item, "desktop") == 0)
01674         {
01675             LOGPRINTF("gotoLocation desktop");
01676             ipc_ctb_goto("desktop");
01677             process_activate("ctb");
01678             result = TRUE;
01679         }
01680         else if (g_ascii_strcasecmp(item, "rotate_screen") == 0)
01681         {
01682             LOGPRINTF("rotate_screen");
01683             result = sys_set_orientation("toggle");
01684         }
01685         else if (g_ascii_strcasecmp(item, "lock") == 0)
01686         {
01687             LOGPRINTF("lock");
01688             if (g_ascii_strcasecmp(state, "normal") == 0)
01689             {
01690                 result = sys_set_sensor_lock("lock");
01691             }
01692             else if (g_ascii_strcasecmp(state, "selected") == 0)
01693             {
01694                 result = sys_set_sensor_lock("unlock");
01695             }
01696         }
01697         else if (g_ascii_strcasecmp(item, "eject_card") == 0)
01698         {
01699             LOGPRINTF("eject_card");
01700             sys_eject_card(FALSE);
01701             result = TRUE;
01702         }
01703         else if (g_ascii_strcasecmp(item, "shutdown") == 0)
01704         {
01705             LOGPRINTF("shutdown");
01706             sys_standby();
01707             result = TRUE;
01708         }
01709         else
01710         {
01711             WARNPRINTF("Unknown general item: %s", item);
01712         }
01713     }
01714     else if (g_ascii_strcasecmp(group, "tasks") == 0)
01715     {
01716         LOGPRINTF("tasks");
01717         
01718         if (g_ascii_strcasecmp(item, "back_to_library") == 0)
01719         {
01720             process_activate("ctb");
01721             result = TRUE;
01722         }
01723         else 
01724         {
01725             // activate task and return result immediately
01726             result = task_activate(item);
01727         }
01728     }
01729 
01730     ipc_send_reply(context, info->message_id, result);
01731 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, and sys_request_popup().

01645 {
01646     LOGPRINTF("entry");
01647     const eripc_arg_t *arg_array = info->args;
01648 
01649     CHECK_ARG_STRING(0);
01650     gboolean result = sys_request_popup(arg_array[0].value.s);
01651     ipc_send_reply(context, info->message_id, result);
01652 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, browser_options, browser_path, ERIPC_TYPE_STRING, ipc_send_reply_task_start(), LOGPRINTF, eripc_event_info_t::message_id, name, eripc_arg_t::s, sys_has_network(), task_start(), and eripc_arg_t::value.

01549 {
01550     LOGPRINTF("entry");
01551     const eripc_arg_t *arg_array = info->args;
01552 
01553     if (!sys_has_network())
01554     {
01555         LOGPRINTF("Device does not have networking capabilities, browser not started");
01556         ipc_send_reply_task_start(context, info->message_id, 5, NULL);
01557         return;
01558     }
01559 
01560     // [0] url          string, URL to open
01561     // [1] name         string, text label shown under icon in popup menu
01562     // [2] application  string, application name shown in "Back" bar of browser, or NULL to omit this bar
01563     
01564     gboolean result = FALSE;
01565     if ( (arg_array[0].type == ERIPC_TYPE_STRING) && (arg_array[0].value.s != NULL) )
01566     {
01567         const gchar *url = arg_array[0].value.s;
01568         gchar *name = NULL;
01569         gchar *command_line = NULL;
01570 
01571         if (arg_array[1].type == ERIPC_TYPE_STRING)
01572         {
01573             name = arg_array[1].value.s;
01574         }
01575         
01576         if ( (arg_array[2].type == ERIPC_TYPE_STRING) && (arg_array[2].value.s != NULL) )
01577         {
01578             // use embedded flag to pass application name in "Back" bar
01579             command_line = g_strdup_printf("%s %s -e \"%s\" \"%s\"", browser_path, browser_options, arg_array[2].value.s, url);
01580         }
01581         else
01582         {
01583             command_line = g_strdup_printf("%s %s \"%s\"", browser_path, browser_options, url);
01584         }
01585         
01586         if ((name == NULL) || (name[0] == '\0'))
01587         {
01588             // no name given, use URL without protocol
01589             const gchar *seperator = "://";
01590             name = strstr(url, "://");
01591             if (name)
01592             {
01593                 name += strlen(seperator);
01594             }
01595             else
01596             {
01597                 name = (gchar *)url;
01598             }
01599         }
01600 
01601         // TODO: get thumbnail icon to popupmenu folder
01602         result = task_start(command_line, 
01603                             NULL, 
01604                             name,
01605                             "/usr/share/ctb/icon-html-small.png",
01606                             context,
01607                             info->message_id);
01608         
01609         g_free(command_line);
01610     }
01611 
01612     // send failure to start task back to caller immediately
01613     // otherwise result is returned asynchronously
01614     if (result == FALSE)
01615     {
01616         ipc_send_reply_task_start(context, info->message_id, 1, NULL);
01617     }
01618 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_INT, CHECK_ARG_STRING, eripc_arg_t::i, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, task_add(), and eripc_arg_t::value.

01622 {
01623     LOGPRINTF("entry");
01624     const eripc_arg_t *arg_array = info->args;
01625 
01626     CHECK_ARG_STRING(0);    // application   string, name of the application
01627     CHECK_ARG_STRING(1);    // document      string, document (should be unqiue)
01628     CHECK_ARG_STRING(2);    // label         string, text label shown under icon in popup menu
01629     CHECK_ARG_STRING(3);    // image         string, full path to icon shown in popup menu (png, 60x60 pixels)
01630     CHECK_ARG_STRING(4);    // service       string, IPC service name of the application
01631     CHECK_ARG_INT(5);       // pid           integer, process id
01632     CHECK_ARG_INT(6);       // window        integer, window ID (XID)
01633     gboolean result = task_add(arg_array[0].value.s, 
01634                           arg_array[1].value.s, 
01635                           arg_array[2].value.s,
01636                           arg_array[3].value.s,
01637                           arg_array[4].value.s,
01638                           arg_array[5].value.i,
01639                           arg_array[6].value.i);
01640     ipc_send_reply(context, info->message_id, result);
01641 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, eripc_arg_t::b, busy_set_pid(), CHECK_ARG_BOOL, CHECK_ARG_INT, CHECK_ARG_STRING, ERIPC_TYPE_INT, eripc_arg_t::i, LOGPRINTF, process_startup_complete(), eripc_arg_t::s, sender_from_service(), eripc_event_info_t::service, and eripc_arg_t::value.

01792 {
01793     LOGPRINTF("entry");
01794     const eripc_arg_t *arg_array = info->args;
01795 
01796     CHECK_ARG_STRING(0);    // name           string, name of application
01797     CHECK_ARG_INT(1);       // pid            integer, process id
01798     CHECK_ARG_BOOL(2);      // is_multidoc    boolean, application can open/close documents over IPC
01799     CHECK_ARG_STRING(3);    // ipc_service    string, IPC service name (may be NULL when is_multidoc is false)
01800                             // xid            integer, window id
01801     gint xid = 0;
01802     if (arg_array[4].type == ERIPC_TYPE_INT)
01803     {
01804         xid =  arg_array[4].value.i;
01805     }
01806     LOGPRINTF("name [%s] pid [%d] is_multidoc [%d] ipc_service [%s], window [%d]",
01807                 arg_array[0].value.s,
01808                 arg_array[1].value.i,
01809                 arg_array[2].value.b,
01810                 arg_array[3].value.s,
01811                 xid);
01812 
01813     // save sender's pid
01814     busy_set_pid(sender_from_service(info->service), arg_array[1].value.i);
01815     process_startup_complete(arg_array[0].value.s, arg_array[1].value.i, arg_array[2].value.b, arg_array[3].value.s, xid);
01816     // don't return reply for signals
01817 }

Here is the call graph for this function:

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

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

References ade_fulfill_path, eripc_event_info_t::args, CHECK_ARG_STRING, conn_on_statusitem_activated(), downloadmgr_path, ipc_send_window_show(), LOGPRINTF, name, eripc_arg_t::s, task_activate(), task_start(), eripc_arg_t::value, and WARNPRINTF.

01735 {
01736     LOGPRINTF("entry");
01737     const eripc_arg_t *arg_array = info->args;
01738 
01739     CHECK_ARG_STRING(0);    // name of activated status item
01740     CHECK_ARG_STRING(1);    // state of activated status item
01741 
01742     const gchar *name = arg_array[0].value.s;
01743     // const gchar *status = arg_array[1].value.s;
01744     LOGPRINTF("name [%s] status [%s]", name, arg_array[1].value.s);
01745     
01746     if (strcmp(name, "statusbar_downloadmgr") == 0)
01747     {
01748         LOGPRINTF("downloadmgr clicked, try to activate Adobe fulfillment");
01749         
01750         // When adobe-fulfill is running, activate it
01751         // Otherwise, start downloadmgr or activate it when it is running
01752         if (task_activate(ade_fulfill_path))
01753         {
01754             LOGPRINTF("ADE fulfillment activated");
01755         }
01756         else
01757         {
01758             LOGPRINTF("ADE fulfillment is not activated, try to activate downloadmgr");
01759             
01760             if (task_activate(downloadmgr_path))
01761             {
01762                 // special call to unhide dowloadmgr window
01763                 ipc_send_window_show("com.irexnet.downloadmgr", 0);
01764                 
01765                 LOGPRINTF("downloadmgr activated");
01766             }
01767             else 
01768             {
01769                 if (task_start(downloadmgr_path, NULL, "DownloadMgr", NULL, NULL, NULL))
01770                 {
01771                     LOGPRINTF("downloadmgr started");
01772                 }
01773                 else
01774                 {
01775                     WARNPRINTF("failed to start downloadmgr");
01776                 }
01777             }
01778         }
01779     }
01780     else if (   strcmp(name, "statusbar_wifi"     ) == 0
01781              || strcmp(name, "statusbar_bluetooth") == 0
01782              || strcmp(name, "statusbar_3g"       ) == 0 )
01783     {
01784         conn_on_statusitem_activated();
01785     }
01786     
01787     // don't return reply for signals
01788 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_INT, CHECK_ARG_STRING, eripc_arg_t::i, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, sys_set_beeper(), and eripc_arg_t::value.

01295 {
01296     LOGPRINTF("entry");
01297     const eripc_arg_t *arg_array = info->args;
01298 
01299     CHECK_ARG_INT(0);
01300     CHECK_ARG_STRING(1);
01301     gboolean result = sys_set_beeper(arg_array[0].value.i, arg_array[1].value.s);
01302     ipc_send_reply(context, info->message_id, result);
01303 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, eripc_arg_t::b, ERIPC_TYPE_BOOL, hal_remount_all_volumes(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, sys_set_enable_index_splash(), and eripc_arg_t::value.

01393 {
01394     LOGPRINTF("entry");
01395    
01396     const eripc_arg_t *arg_array = NULL;
01397     
01398     gboolean enable_splash = FALSE;
01399     arg_array = info->args;
01400 
01401     g_return_if_fail(arg_array[0].type == ERIPC_TYPE_BOOL);   // is_connected
01402     enable_splash = arg_array[0].value.b ; 
01403 
01404     if ( enable_splash )
01405     {
01406         sys_set_enable_index_splash(TRUE);
01407     }
01408     else 
01409     {
01410         sys_set_enable_index_splash(FALSE);
01411     }
01412 
01413     hal_remount_all_volumes(NULL, NULL);
01414 
01415     // send message result back to caller
01416     ipc_send_reply(context, info->message_id, TRUE);
01417 }

Here is the call graph for this function:

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

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

References ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, and sys_eject_card().

01421 {
01422     LOGPRINTF("entry");
01423     
01424     // eject silently
01425     sys_eject_card(TRUE);
01426 
01427     ipc_send_reply(context, info->message_id, TRUE);
01428 }

Here is the call graph for this function:

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

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

References charge_state, charge_text, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_reply_varargs(), ERIPC_TYPE_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, LOGPRINTF, eripc_event_info_t::message_id, and sys_get_battery().

01043 {
01044     LOGPRINTF("entry");
01045     
01046     gboolean result = FALSE;
01047 
01048     if (info->message_id)
01049     {
01050         enum state_charge charge_state = 0;
01051         gint battery_level = 0;
01052         gint time_left = 0;
01053         
01054         sys_get_battery(&battery_level, &charge_state, &time_left);
01055 
01056         LOGPRINTF("Sending battery %d, state %s to, time left %d: %s, context %p", 
01057                   battery_level, 
01058                   charge_text[charge_state], 
01059                   time_left, 
01060                   info->message_id, 
01061                   context);
01062 
01063         result = eripc_reply_varargs(context, info->message_id, 
01064                                       ERIPC_TYPE_INT, battery_level,
01065                                       ERIPC_TYPE_STRING, charge_text[charge_state], 
01066                                       ERIPC_TYPE_INT, -1,
01067                                       ERIPC_TYPE_INVALID);
01068 
01069         if (result != ERIPC_ERROR_SUCCESS) 
01070         {
01071             ERRORPRINTF("Error sending reply to message: %s", eripc_error_string(result));
01072         }
01073     }
01074 }

Here is the call graph for this function:

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

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

References eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_reply_string(), ERRORPRINTF, LOGPRINTF, eripc_event_info_t::message_id, MOUNTPOINT_CARD, STATE_CARD_MOUNTED, and sys_get_card().

01132 {
01133     LOGPRINTF("entry");
01134     
01135     if (info->message_id)
01136     {
01137         const char* mountpoint = NULL;
01138         if (sys_get_card() == STATE_CARD_MOUNTED) mountpoint = MOUNTPOINT_CARD;
01139 
01140         LOGPRINTF("Sending card mountpoint '%s'", mountpoint ? mountpoint : "NULL");
01141 
01142         gboolean result = eripc_reply_string(context, info->message_id, mountpoint);
01143         if (result != ERIPC_ERROR_SUCCESS) 
01144         {
01145             ERRORPRINTF("Error sending reply to message: %s", eripc_error_string(result));
01146         }
01147     }
01148 }

Here is the call graph for this function:

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

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

References eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_reply_varargs(), ERIPC_TYPE_BOOL, ERIPC_TYPE_INVALID, ERRORPRINTF, LOGPRINTF, eripc_event_info_t::message_id, and sys_get_device_capabilities().

01152 {
01153     LOGPRINTF("entry");
01154     
01155     gboolean result = FALSE;
01156 
01157     if (info->message_id)
01158     {
01159         gboolean has_stylus     = FALSE;
01160         gboolean has_wifi       = FALSE;
01161         gboolean has_bluetooth  = FALSE;
01162         gboolean has_3g         = FALSE;
01163         
01164         sys_get_device_capabilities(&has_stylus, &has_wifi, &has_bluetooth, &has_3g);
01165 
01166         LOGPRINTF("Sending device capabilities: stylus %d, wifi %d, bluetooth %d, 3g %d", 
01167                   has_stylus, has_wifi, has_bluetooth, has_3g);
01168 
01169         result = eripc_reply_varargs(context, info->message_id, 
01170                                       ERIPC_TYPE_BOOL, has_stylus,
01171                                       ERIPC_TYPE_BOOL, has_wifi,
01172                                       ERIPC_TYPE_BOOL, has_bluetooth,
01173                                       ERIPC_TYPE_BOOL, has_3g,
01174                                       ERIPC_TYPE_INVALID);
01175 
01176         if (result != ERIPC_ERROR_SUCCESS) 
01177         {
01178             ERRORPRINTF("Error sending reply to message: %s", eripc_error_string(result));
01179         }
01180     }
01181 }

Here is the call graph for this function:

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

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

References eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_reply_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, LOGPRINTF, eripc_event_info_t::message_id, orientation_text, and sys_get_orientation().

01078 {
01079     LOGPRINTF("entry");
01080     
01081     gboolean result = FALSE;
01082 
01083     if (info->message_id)
01084     {
01085         guint orientation = sys_get_orientation();
01086         
01087         if (orientation >= sizeof(orientation_text))
01088         {
01089             ERRORPRINTF("Orientation %d unknown, signal not sent.", orientation);
01090             return;
01091         }
01092 
01093         LOGPRINTF("Sending orientation %s", orientation_text[orientation]);
01094 
01095         result = eripc_reply_varargs(context, info->message_id, 
01096                                       ERIPC_TYPE_STRING, orientation_text[orientation], 
01097                                       ERIPC_TYPE_INVALID);
01098 
01099         if (result != ERIPC_ERROR_SUCCESS) 
01100         {
01101             ERRORPRINTF("Error sending reply to message: %s", eripc_error_string(result));
01102         }
01103     }
01104 }

Here is the call graph for this function:

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

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

References eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_reply_varargs(), ERIPC_TYPE_BOOL, ERIPC_TYPE_INVALID, ERRORPRINTF, LOGPRINTF, eripc_event_info_t::message_id, and sys_get_pageturn_inverted().

01108 {
01109     LOGPRINTF("entry");
01110     
01111     gboolean result = FALSE;
01112 
01113     if (info->message_id)
01114     {
01115         gboolean  is_inverted = sys_get_pageturn_inverted();
01116         
01117         LOGPRINTF("Sending pageturn_inverted %d", (gint) is_inverted);
01118 
01119         result = eripc_reply_varargs(context, info->message_id, 
01120                                       ERIPC_TYPE_BOOL, is_inverted, 
01121                                       ERIPC_TYPE_INVALID);
01122 
01123         if (result != ERIPC_ERROR_SUCCESS) 
01124         {
01125             ERRORPRINTF("Error sending reply to message: %s", eripc_error_string(result));
01126         }
01127     }
01128 }

Here is the call graph for this function:

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

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

References eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_reply_varargs(), ERIPC_TYPE_BOOL, ERIPC_TYPE_INVALID, ERRORPRINTF, LOGPRINTF, eripc_event_info_t::message_id, and wacom_is_enabled().

01371 {
01372     LOGPRINTF("entry");
01373     
01374     gboolean result = FALSE;
01375 
01376     if (info->message_id)
01377     {
01378         gboolean stylus_enabled = wacom_is_enabled();
01379 
01380         result = eripc_reply_varargs(context, info->message_id, 
01381                                      ERIPC_TYPE_BOOL, stylus_enabled,
01382                                      ERIPC_TYPE_INVALID);
01383 
01384         if (result != ERIPC_ERROR_SUCCESS) 
01385         {
01386             ERRORPRINTF("Error sending reply to message: %s", eripc_error_string(result));
01387         }
01388     }
01389 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, and sys_set_sensor_lock().

01318 {
01319     LOGPRINTF("entry");
01320     const eripc_arg_t *arg_array = info->args;
01321 
01322     CHECK_ARG_STRING(0);
01323     gboolean result = sys_set_sensor_lock(arg_array[0].value.s);
01324     ipc_send_reply(context, info->message_id, result);
01325 }

Here is the call graph for this function:

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

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

References busy_remove_background(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, sender, sender_from_service(), and eripc_event_info_t::service.

01281 {
01282     LOGPRINTF("entry");
01283     
01284     gboolean result = FALSE;
01285     gint sender = sender_from_service(info->service);
01286 
01287     result = busy_remove_background(sender);
01288 
01289     // send message result back to caller
01290     ipc_send_reply(context, info->message_id, result);
01291 }

Here is the call graph for this function:

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

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

References busy_remove_foreground(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, sender, sender_from_service(), and eripc_event_info_t::service.

01252 {
01253     LOGPRINTF("entry");
01254     
01255     gboolean result = FALSE;
01256     gint sender = sender_from_service(info->service);
01257 
01258     result = busy_remove_foreground(sender);
01259 
01260     // send message result back to caller
01261     ipc_send_reply(context, info->message_id, result);
01262 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, and sys_set_orientation().

01307 {
01308     LOGPRINTF("entry");
01309     const eripc_arg_t *arg_array = info->args;
01310 
01311     CHECK_ARG_STRING(0);
01312     gboolean result = sys_set_orientation(arg_array[0].value.s);
01313     ipc_send_reply(context, info->message_id, result);
01314 }

Here is the call graph for this function:

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

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

References busy_add_background(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, sender, sender_from_service(), and eripc_event_info_t::service.

01267 {
01268     LOGPRINTF("entry");
01269     
01270     gboolean result = FALSE;
01271     gint sender = sender_from_service(info->service);
01272 
01273     result = busy_add_background(sender);
01274 
01275     // send message result back to caller
01276     ipc_send_reply(context, info->message_id, result);
01277 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, busy_add_foreground(), BUSY_DIALOG_NONE, busy_remove_foreground(), CHECK_ARG_STRING, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, sender, sender_from_service(), eripc_event_info_t::service, eripc_arg_t::value, and WARNPRINTF.

01189 {
01190     LOGPRINTF("entry");
01191     const eripc_arg_t *arg_array = info->args;
01192 
01193     CHECK_ARG_STRING(0);
01194     gchar *busy_mode = arg_array[0].value.s;
01195     gint sender = sender_from_service(info->service);
01196 
01197     gboolean result = FALSE;
01198     if (g_ascii_strcasecmp(busy_mode, "on") == 0)
01199     {
01200         result = busy_add_foreground(sender, BUSY_DIALOG_NONE, NULL);
01201     }
01202     else if (g_ascii_strcasecmp(busy_mode, "off") == 0)
01203     {
01204         result = busy_remove_foreground(sender);
01205     }
01206     else
01207     {
01208         WARNPRINTF("Unknown busy mode: %s", busy_mode);
01209     }
01210 
01211     ipc_send_reply(context, info->message_id, result);
01212 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, busy_add_foreground(), BUSY_DIALOG_DELAYED, BUSY_DIALOG_DIRECT, BUSY_DIALOG_NONE, CHECK_ARG_STRING, ERIPC_TYPE_STRING, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, sender, sender_from_service(), eripc_event_info_t::service, eripc_arg_t::value, and WARNPRINTF.

01216 {
01217     LOGPRINTF("entry");
01218     const eripc_arg_t *arg_array = info->args;
01219 
01220     CHECK_ARG_STRING(0);
01221     gint sender = sender_from_service(info->service);
01222     gchar *busy_mode = arg_array[0].value.s;
01223     gchar *busy_msg  = NULL;
01224     if ((arg_array[1].type == ERIPC_TYPE_STRING) && (arg_array[1].value.s != NULL))
01225     {
01226         busy_msg = arg_array[1].value.s;
01227     }
01228     
01229     gboolean result = FALSE;
01230     if (g_ascii_strcasecmp(busy_mode, "nodialog") == 0)
01231     {
01232         result = busy_add_foreground(sender, BUSY_DIALOG_NONE, NULL);
01233     }
01234     else if (g_ascii_strcasecmp(busy_mode, "delaydialog") == 0)
01235     {
01236         result = busy_add_foreground(sender, BUSY_DIALOG_DELAYED, busy_msg);
01237     }
01238     else if (g_ascii_strcasecmp(busy_mode, "directdialog") == 0)
01239     {
01240         result = busy_add_foreground(sender, BUSY_DIALOG_DIRECT, busy_msg);
01241     }
01242     else
01243     {
01244         WARNPRINTF("Unknown busy mode: %s", busy_mode);
01245     }
01246 
01247     ipc_send_reply(context, info->message_id, result);
01248 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, erkeyb_client_hide(), erkeyb_client_show(), ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, eripc_arg_t::value, and WARNPRINTF.

01454 {
01455     LOGPRINTF("entry");
01456     const eripc_arg_t *arg_array = info->args;
01457 
01458     CHECK_ARG_STRING(0);
01459     char *keyboard_mode = arg_array[0].value.s;
01460     
01461     gboolean result = TRUE;
01462     if (g_ascii_strcasecmp(keyboard_mode, "show") == 0)
01463     {
01464         erkeyb_client_show();
01465     }
01466     else if (g_ascii_strcasecmp(keyboard_mode, "hide") == 0)
01467     {
01468         erkeyb_client_hide();
01469     }
01470     else
01471     {
01472         WARNPRINTF("Unknown keyboard mode: %s", keyboard_mode);
01473         result = FALSE;
01474     }
01475 
01476     // send message result back to caller
01477     ipc_send_reply(context, info->message_id, result);
01478 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, eripc_arg_t::value, wacom_disable(), wacom_enable(), wacom_resume(), wacom_scan_high(), wacom_scan_normal(), wacom_suspend(), and WARNPRINTF.

01329 {
01330     LOGPRINTF("entry");
01331     const eripc_arg_t *arg_array = info->args;
01332 
01333     CHECK_ARG_STRING(0);
01334     char *stylus_mode = arg_array[0].value.s;
01335     gboolean result = TRUE;
01336     if (g_ascii_strcasecmp(stylus_mode, "enable") == 0)
01337     {
01338         wacom_enable();
01339     }
01340     else if (g_ascii_strcasecmp(stylus_mode, "disable") == 0)
01341     {
01342         wacom_disable();
01343     }
01344     else if (g_ascii_strcasecmp(stylus_mode, "suspend") == 0)
01345     {
01346         wacom_suspend();
01347     }
01348     else if (g_ascii_strcasecmp(stylus_mode, "resume") == 0)
01349     {
01350         wacom_resume();
01351     }
01352     else if (g_ascii_strcasecmp(stylus_mode, "high") == 0)
01353     {
01354         wacom_scan_high();
01355     }
01356     else if (g_ascii_strcasecmp(stylus_mode, "normal") == 0)
01357     {
01358         wacom_scan_normal();
01359     }
01360     else
01361     {
01362         WARNPRINTF("Unknown stylus mode: %s", stylus_mode);
01363         result = FALSE;
01364     }
01365 
01366     ipc_send_reply(context, info->message_id, result);
01367 }

Here is the call graph for this function:

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

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

References ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, and sys_standby().

01443 {
01444     LOGPRINTF("entry");
01445     
01446     // send message result back to caller immediately
01447     ipc_send_reply(context, info->message_id, TRUE);
01448 
01449     sys_standby();
01450 }

Here is the call graph for this function:

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

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

References ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, and sys_standby().

01432 {
01433     LOGPRINTF("entry");
01434 
01435     // send message result back to caller immediately
01436     ipc_send_reply(context, info->message_id, TRUE);
01437     
01438     sys_standby();
01439 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_INT, eripc_arg_t::i, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, task_activate_by_xid(), and eripc_arg_t::value.

01537 {
01538     LOGPRINTF("entry");
01539     const eripc_arg_t *arg_array = info->args;
01540 
01541     CHECK_ARG_INT(0);
01542     int xid = arg_array[0].value.i;
01543     task_activate_by_xid(xid);
01544     ipc_send_reply(context, info->message_id, TRUE);
01545 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_INT, CHECK_ARG_STRING, eripc_arg_t::i, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, task_rename(), and eripc_arg_t::value.

01524 {
01525     LOGPRINTF("entry");
01526     const eripc_arg_t *arg_array = info->args;
01527 
01528     CHECK_ARG_INT(0);       // xid of task
01529     CHECK_ARG_STRING(1);    // new document name
01530     CHECK_ARG_STRING(2);    // new label
01531     gboolean result = task_rename(arg_array[0].value.i, arg_array[1].value.s, arg_array[2].value.s);
01532     ipc_send_reply(context, info->message_id, result);
01533 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, ipc_send_reply_task_start(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, task_start(), and eripc_arg_t::value.

01482 {
01483     LOGPRINTF("entry");
01484     const eripc_arg_t *arg_array = info->args;
01485 
01486     CHECK_ARG_STRING(0);    // command_line  string, full path to application with arguments
01487     CHECK_ARG_STRING(1);    // working_dir   string, current working directory, or NULL to inherit from sysd
01488     CHECK_ARG_STRING(2);    // label         string, text label shown under icon in popup menu
01489     CHECK_ARG_STRING(3);    // image         string, full path to icon shown in popup menu
01490     gboolean result = task_start(arg_array[0].value.s, 
01491                             arg_array[1].value.s, 
01492                             arg_array[2].value.s,
01493                             arg_array[3].value.s,
01494                             context,
01495                             info->message_id);
01496     // send failure to start task back to caller immediately
01497     // otherwise result is returned asynchronously
01498     if (result == FALSE)
01499     {
01500         ipc_send_reply_task_start(context, info->message_id, 1, NULL);
01501     }
01502 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, eripc_arg_t::s, and task_stop().

01506 {
01507     LOGPRINTF("entry");
01508     const eripc_arg_t *arg_array = info->args;
01509 
01510     CHECK_ARG_STRING(0);    // cmdline, full path to application with arguments
01511     gboolean result = task_stop(arg_array[0].value.s, 
01512                            context,
01513                            info->message_id);
01514     // send failure to start task back to caller immediately
01515     // otherwise result is returned asynchronously
01516     if (result == FALSE)
01517     {
01518         ipc_send_reply(context, info->message_id, FALSE);
01519     }
01520 }

Here is the call graph for this function:

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_signal ( const char *  medium,
const int  signal 
)

Definition at line 853 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_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, and LOGPRINTF.

Referenced by cb_conn_signal().

00855 {
00856     LOGPRINTF("%s signal: %d", medium, signal);
00857 
00858     // NOTE: signal is broadcasted when it was changed
00859     eripc_send_signal_varargs(eripcClient->context, 
00860                               ERIPC_BUS_SESSION,
00861                               DBUS_PATH,
00862                               DBUS_INTERFACE,
00863                               "sysSignalStrength",
00864                               ERIPC_TYPE_INT,    signal,
00865                               ERIPC_TYPE_STRING, medium,
00866                               ERIPC_TYPE_INVALID);
00867     
00868     return TRUE;
00869 }

Here is the call graph for this function:

Here is the caller 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 *  name,
const char *  parent,
const char *  state 
)

Send message setItemState to popup menu.

Set new menu item state.

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

Name : ipc_menu_set_item_state

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

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

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

References eripc_menu_set_item_state().

Referenced by conf_disabled_sensor_lock(), menu_init(), menu_select_sort_order(), menu_select_view_type(), menu_set_current_is_media(), menu_set_full_screen(), menu_set_zoom_level(), sys_set_sensor_lock(), and update_viewmode_text().

00466 {
00467     eripc_menu_set_item_state(eripcClient, iname, pname, state);
00468 }

Here is the call graph for this function:

Here is the caller 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 988 of file sysd/src/ipc.c.

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

Referenced by add_group_cb(), add_item_cb(), add_menu_cb(), add_task_cb(), cb_closed_window(), cb_conn_add_profile(), cb_conn_connect(), cb_conn_disconnect(), cb_conn_edit_profile(), cb_conn_signal(), cb_conn_status(), cb_conn_status_request(), cb_menu_item_activated(), cb_menu_request_popup(), cb_opened_window(), cb_sys_battery_state(), cb_sys_beep(), cb_sys_card_mount(), cb_sys_card_unmount(), cb_sys_lock_sensors(), cb_sys_reset_bg_busy(), cb_sys_reset_fg_busy(), cb_sys_rotate(), cb_sys_set_bg_busy(), cb_sys_set_busy_led(), cb_sys_set_fg_busy(), cb_sys_set_keyboard(), cb_sys_set_stylus(), cb_sys_shutdown(), cb_sys_signal_strength(), cb_sys_standby(), cb_task_activate(), cb_task_rename(), cb_task_stop(), confirm_install_drz_cb(), confirm_install_update_cb(), confirm_usbconnect_cb(), on_dialog_close(), on_dialog_response(), on_window_close_callback(), remove_group_cb(), remove_item_cb(), remove_menu_cb(), remove_task_cb(), set_busy_show_cb(), set_group_label_cb(), set_group_state_cb(), set_item_label_cb(), set_item_state_cb(), set_message_show_cb(), set_popup_show_cb(), set_splash_show_cb(), set_statusitem_show_cb(), set_statusitem_state_cb(), set_task_to_top_cb(), show_menu_cb(), task_stop(), update_page_counter_cb(), and updates_finished_cb().

00989 {
00990     LOGPRINTF("entry");
00991     
00992     g_return_if_fail(context != NULL);
00993 
00994     if (message_id)
00995     {
00996         LOGPRINTF("Sending reply %s to: %s, context %p", (result == TRUE ? "TRUE":"FALSE"), message_id, context);
00997 
00998         eripc_error_t retval = eripc_reply_bool(context, message_id, result);
00999         if (retval != ERIPC_ERROR_SUCCESS) 
01000         {
01001             ERRORPRINTF("Error sending reply to message: %s", eripc_error_string(retval));
01002         }
01003     }
01004     else
01005     {
01006         LOGPRINTF("Result is %s but no reply was requested", (result == TRUE ? "TRUE":"FALSE"));
01007     }
01008 }

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:

static void ipc_send_window_show ( const char *  ipc_interface,
gint  window 
) [static]

Definition at line 445 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 cb_status_item_activated().

00446 {
00447     LOGPRINTF("entry");
00448     
00449     eripc_error_t retval;
00450     retval = eripc_send_int(eripcClient->context,
00451                             NULL,
00452                             NULL,
00453                             ERIPC_BUS_SESSION,
00454                             ipc_interface,
00455                             "showWindow",
00456                             window);
00457 
00458     if (retval != ERIPC_ERROR_SUCCESS) 
00459     {
00460         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00461     }
00462 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_set_services (  ) 

Setup IPC connection and register API functions.

File Name : index_ipc.h

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

Name : ipc_set_services

Parameters:
None 
Returns:
--

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

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

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

00204 {
00205     eripcClient = eripc_client_context_new(
00206                     DBUS_APPL_NAME,
00207                     "1.0",
00208                     DBUS_SERVICE,
00209                     DBUS_PATH,
00210                     DBUS_INTERFACE,
00211                     service_functions);
00212     
00213     erkeyb_client_init();
00214 }

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 217 of file sysd/src/ipc.c.

References eripc_client_context_free(), and erkeyb_client_term().

Here is the call graph for this function:

static const gchar * medium_service ( const char *  medium  )  [static]

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

References DBUS_SERVICE_CONN_3G, DBUS_SERVICE_CONN_BLUE, and DBUS_SERVICE_CONN_WIFI.

Referenced by ipc_add_profile(), and ipc_edit_profile().

02038 {
02039     if (medium)
02040     {
02041         if (strcmp(medium, "wifi") == 0)
02042         {
02043             return DBUS_SERVICE_CONN_WIFI;
02044         }
02045         else if (strcmp(medium, "bluetooth") == 0)
02046         {
02047             return DBUS_SERVICE_CONN_BLUE;
02048         }
02049         else if (strcmp(medium, "3g") == 0)
02050         {
02051             return DBUS_SERVICE_CONN_3G;
02052         }
02053     }
02054     return NULL;
02055 }

Here is the caller graph for this function:

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

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

References eripc_event_info_t::args, eripc_arg_t::b, ERIPC_EVENT_REPLY, ERIPC_TYPE_BOOL, eripc_event_info_t::event_type, LOGPRINTF, sys_install_drz(), and WARNPRINTF.

Referenced by ipc_confirm_install_drz().

02001 {
02002     LOGPRINTF("entry");
02003     
02004     const eripc_arg_t *arg_array = info->args;
02005     
02006     if (info->event_type != ERIPC_EVENT_REPLY)
02007     {
02008         WARNPRINTF("invalid event: %d", info->event_type);
02009     }
02010     else if ((arg_array == NULL) || (arg_array[0].type != ERIPC_TYPE_BOOL))
02011     {
02012         WARNPRINTF("invalid arguments in reply");
02013     }
02014     else if (arg_array[0].value.b == TRUE)
02015     {
02016         LOGPRINTF("User confirmed to install drz");
02017         sys_install_drz();
02018     }
02019 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

References eripc_event_info_t::args, eripc_arg_t::b, ERIPC_EVENT_REPLY, ERIPC_TYPE_BOOL, eripc_event_info_t::event_type, LOGPRINTF, sys_restart(), and WARNPRINTF.

Referenced by ipc_confirm_install_update().

01976 {
01977     LOGPRINTF("entry");
01978     const eripc_arg_t *arg_array = info->args;
01979 
01980     if (info->event_type != ERIPC_EVENT_REPLY)
01981     {
01982         WARNPRINTF("invalid event: %d", info->event_type);
01983     }
01984     else if ((arg_array == NULL) || (arg_array[0].type != ERIPC_TYPE_BOOL))
01985     {
01986         WARNPRINTF("invalid arguments in reply");
01987     }
01988     else if (arg_array[0].value.b == TRUE)
01989     {
01990         LOGPRINTF("User confirmed restart to install firmware update");
01991 
01992         // handle shutdown and cold restart to trigger install procedure
01993         sys_restart();
01994     }
01995 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

References eripc_event_info_t::args, eripc_arg_t::b, ERIPC_EVENT_REPLY, ERIPC_TYPE_BOOL, eripc_event_info_t::event_type, LOGPRINTF, sys_usb_connect(), sys_usb_no_connect(), and WARNPRINTF.

Referenced by ipc_confirm_usbconnect().

01948 {
01949     LOGPRINTF("entry");
01950     const eripc_arg_t *arg_array = info->args;
01951 
01952     if (info->event_type != ERIPC_EVENT_REPLY)
01953     {
01954         WARNPRINTF("invalid event: %d", info->event_type);
01955     }
01956     else if ((arg_array == NULL) || (arg_array[0].type != ERIPC_TYPE_BOOL))
01957     {
01958         WARNPRINTF("invalid arguments in reply");
01959     }
01960     else if (arg_array[0].value.b == TRUE)
01961     {
01962         LOGPRINTF("User confirmed connect");
01963         // handle connect
01964         sys_usb_connect();
01965     }
01966     else
01967     {
01968         sys_usb_no_connect();
01969     }
01970 }

Here is the call graph for this function:

Here is the caller graph for this function:

static gint sender_from_service ( const char *  service  )  [static]

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

References sender.

Referenced by cb_startup_complete(), cb_sys_reset_bg_busy(), cb_sys_reset_fg_busy(), cb_sys_set_bg_busy(), cb_sys_set_busy_led(), and cb_sys_set_fg_busy().

02059 {
02060     gint sender = 0;
02061     gchar *dot = strchr(service, '.');
02062     if (dot) 
02063     {
02064        sender = atoi(dot + 1);
02065     }
02066     return sender;
02067 }

Here is the caller graph for this function:

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

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

References eripc_reply_string(), eripc_event_info_t::message_id, print_process_list(), print_task_list(), print_window_list(), and testing_task_get_list().

02025 {
02026 #if (TESTING_ON)
02027     print_window_list();
02028     print_process_list();
02029     print_task_list();
02030 #endif
02031     char* list = testing_task_get_list();
02032     eripc_reply_string(context, info->message_id, list);
02033     g_free(list);
02034 }

Here is the call graph for this function:


Variable Documentation

const gchar* ade_fulfill_path = "/usr/bin/adobe-fulfill" [static]

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

Referenced by cb_status_item_activated().

const gchar* browser_options = "-n" [static]

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

Referenced by cb_open_url().

const gchar* browser_path = "/usr/bin/erbrowser" [static]

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

Referenced by cb_open_url().

const char* charge_text[] = { "", "low", "charging", "discharging", "full" } [static]

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

Referenced by cb_sys_get_battery_state(), and ipc_send_battery_state().

const gchar* downloadmgr_path = "/usr/bin/downloadmgr" [static]

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

Referenced by cb_status_item_activated().

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

const char* orientation_text[] = { "portrait", "landscape_clockwise", "landscape_anticlockwise" } [static]

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

Referenced by cb_sys_get_orientation(), and ipc_send_changed_orientation().

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

Generated by  doxygen 1.6.2-20100208