popupmenu/src/ipc.c File Reference

#include "config.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <libergtk/ergtk.h>
#include <liberipc/eripc.h>
#include <liberipc/eripc_support.h>
#include "log.h"
#include "dialog.h"
#include "ipc.h"
#include "i18n.h"
#include "menustore.h"
#include "popup.h"
#include "statusbar.h"
Include dependency graph for popupmenu/src/ipc.c:

Go to the source code of this file.

Defines

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

Functions

static void add_group_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void add_item_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void add_menu_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void add_task_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void remove_group_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void remove_item_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void remove_menu_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void remove_task_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void rename_task_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_task_to_top_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_group_state_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_group_label_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_item_state_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_item_label_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_popup_show_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void show_menu_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_busy_show_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_splash_show_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_message_show_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_statusitem_state_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void set_statusitem_show_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void update_page_counter_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void confirm_usbconnect_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void confirm_install_drz_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void confirm_install_update_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void updates_finished_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_battery_state (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_usb_state (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_changed_locale (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_changed_orientation (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void cb_sys_signal_strength (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void testing_list_menu_items_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void testing_route_menu_item_cb (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
void ipc_set_services (void)
 Setup IPC connection and register API functions.
void ipc_unset_services (void)
 Unregister API functions.
void ipc_send_task_activated (int xid)
void ipc_send_item_activated (const char *iname, const char *pname, const char *mname, const char *state, const char *service)
 Send menuItemActivated to service.
gboolean ipc_sys_start_task (const gchar *cmd_line, const gchar *work_dir, const gchar *label, const gchar *thumbnail_path)
 Send message startTask to system control, usually to open a document in the relevant viewer application.
void ipc_sys_standby ()
void ipc_send_request_popup (const char *state)
void ipc_send_status_item_activated (const char *iname, const char *state, const char *service)
 Send statusItemActivated to service.
void ipc_send_startup_complete (void)
 Send startupComplete.
gboolean ipc_get_battery_state (gint *level, gchar **state, gint *timeleft)
 Get current battery state and level and update statusbar icon.
gchar * ipc_get_orientation (void)
void ipc_set_orientation (const gchar *orientation)
void ipc_send_page_change (const gchar *dir)
gboolean ipc_get_device_capabilities (gboolean *has_stylus, gboolean *has_wifi, gboolean *has_bluetooth, gboolean *has_3g)
void ipc_send_reply (eripc_context_t *context, const char *message_id, gboolean result)
 Return a IPC reply message.
void ipc_set_enabled (gboolean enabled)
gboolean ipc_is_enabled (void)

Variables

static eripc_client_context_teripcClient = NULL
static eripc_callback_function_t service_functions []
static gboolean g_enabled = TRUE

Define Documentation

#define CHECK_ARG_INT (  ) 
#define CHECK_ARG_STRING (  ) 

Function Documentation

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

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

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

00555 {
00556     const eripc_arg_t *arg_array = info->args;
00557     LOGPRINTF("entry");
00558     
00559     CHECK_ARG_STRING(0);
00560     CHECK_ARG_STRING(1);
00561     CHECK_ARG_STRING(2);
00562     CHECK_ARG_STRING(3);
00563     
00564     gboolean result = menustore_add_group(arg_array[0].value.s, 
00565                                      arg_array[1].value.s, 
00566                                      arg_array[2].value.s, 
00567                                      arg_array[3].value.s);
00568     ipc_send_reply(context, info->message_id, result);
00569 }

Here is the call graph for this function:

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

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

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

00573 {
00574     const eripc_arg_t *arg_array = info->args;
00575     LOGPRINTF("entry");
00576 
00577     CHECK_ARG_STRING(0);
00578     CHECK_ARG_STRING(1);
00579     CHECK_ARG_STRING(2);
00580     CHECK_ARG_STRING(3);
00581     gboolean result = menustore_add_item(arg_array[0].value.s, 
00582                                     arg_array[1].value.s, 
00583                                     arg_array[2].value.s, 
00584                                     arg_array[3].value.s);
00585     ipc_send_reply(context, info->message_id, result);
00586 }

Here is the call graph for this function:

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

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

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

00590 {
00591     const eripc_arg_t *arg_array = info->args;
00592     LOGPRINTF("entry");
00593     
00594     CHECK_ARG_STRING(0);
00595     CHECK_ARG_STRING(1);
00596     CHECK_ARG_STRING(2);
00597     CHECK_ARG_STRING(3);
00598     CHECK_ARG_STRING(4);
00599     CHECK_ARG_STRING(5);
00600     CHECK_ARG_STRING(6);
00601     gboolean result = menustore_add_menu(arg_array[0].value.s, 
00602                                     arg_array[1].value.s, 
00603                                     arg_array[2].value.s, 
00604                                     arg_array[3].value.s, 
00605                                     arg_array[4].value.s, 
00606                                     arg_array[5].value.s, 
00607                                     arg_array[6].value.s);
00608     ipc_send_reply(context, info->message_id, result);
00609 }

Here is the call graph for this function:

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

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

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

00613 {
00614     const eripc_arg_t *arg_array = info->args;
00615     LOGPRINTF("entry");
00616 
00617     CHECK_ARG_INT(0);
00618     CHECK_ARG_STRING(1);
00619 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00620     int xid = arg_array[0].value.i;
00621     const char* label =  arg_array[1].value.s;
00622     taskbar_add_task(xid, label);
00623 #endif
00624     ipc_send_reply(context, info->message_id, TRUE);
00625 }

Here is the call graph for this function:

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

Definition at line 1110 of file popupmenu/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, statusbar_update_battery_state(), and eripc_arg_t::value.

01111 {
01112     const eripc_arg_t *arg_array = info->args;
01113     LOGPRINTF("entry");
01114 
01115     CHECK_ARG_INT(0);
01116     CHECK_ARG_STRING(1);
01117     gint  level  = arg_array[0].value.i;
01118     gchar *state = arg_array[1].value.s;
01119 
01120     LOGPRINTF("Battery level %d, state %s", level, state);
01121 
01122     statusbar_update_battery_state(level, state);
01123     ipc_send_reply(context, info->message_id, FALSE);
01124 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, LOGPRINTF, menustore_set_text(), eripc_arg_t::s, statusbar_set_text(), and eripc_arg_t::value.

01165 {
01166     const eripc_arg_t *arg_array = info->args;
01167     LOGPRINTF("entry");
01168 
01169     CHECK_ARG_STRING(0);
01170 
01171     const char *locale = arg_array[0].value.s;
01172     const char *old_locale = g_getenv("LANG");
01173     if (!old_locale || (strcmp(old_locale, locale) != 0))
01174     {
01175         LOGPRINTF("Locale has changed to %s", locale);
01176 
01177         // set locale in environment 
01178         g_setenv("LANG", locale, TRUE);
01179         setlocale(LC_ALL, "");
01180 
01181         // update texts
01182         menustore_set_text();
01183         statusbar_set_text();
01184 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
01185         taskbar_update_locale();
01186 #endif
01187     }
01188 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, dialog_rotated(), LOGPRINTF, eripc_arg_t::s, and eripc_arg_t::value.

01192 {
01193     const eripc_arg_t *arg_array = info->args;
01194     LOGPRINTF("entry");
01195 
01196     CHECK_ARG_STRING(0);
01197 
01198     const char* orientation = arg_array[0].value.s;
01199     if (orientation)
01200     {
01201         dialog_rotated(orientation);
01202     }
01203 }

Here is the call graph for this function:

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

Definition at line 1127 of file popupmenu/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, statusbar_update_signal_strength(), and eripc_arg_t::value.

01128 {
01129     const eripc_arg_t *arg_array = info->args;
01130     LOGPRINTF("entry");
01131 
01132     CHECK_ARG_INT(0);
01133     CHECK_ARG_STRING(1);
01134     gint  strength  = arg_array[0].value.i;
01135     gchar *medium = arg_array[1].value.s;
01136 
01137     LOGPRINTF("Signal strength on %s is %d", medium, strength);
01138 
01139     statusbar_update_signal_strength(medium, strength);
01140     ipc_send_reply(context, info->message_id, FALSE);
01141 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, LOGPRINTF, popup_set_popup_block(), eripc_arg_t::s, and eripc_arg_t::value.

01145 {
01146     const eripc_arg_t *arg_array = info->args;
01147     LOGPRINTF("entry");
01148 
01149     CHECK_ARG_STRING(0);
01150     gchar *state = arg_array[0].value.s;
01151     LOGPRINTF("USB state %s", state);
01152 
01153     if (g_ascii_strcasecmp(state, "mounted") == 0) 
01154     {
01155         popup_set_popup_block(TRUE);
01156     }
01157     else
01158     {
01159         popup_set_popup_block(FALSE);
01160     }
01161 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, dialog_message_confirm(), dialog_message_confirm_close(), ERIPC_TYPE_STRING, ERRORPRINTF, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, and eripc_arg_t::s.

01029 {
01030     const eripc_arg_t *arg_array = info->args;
01031     static gboolean result = FALSE;
01032     
01033     LOGPRINTF("entry");
01034     
01035     if ( (arg_array[0].type == ERIPC_TYPE_STRING) && (arg_array[0].value.s != NULL) )
01036     {
01037         if (g_ascii_strcasecmp(arg_array[0].value.s, "show") == 0) 
01038         {
01039             gchar *message = g_strconcat(_("New installable file(s) found.\n\n"),
01040                                          _("Do you wish to install now?"),
01041                                         NULL);
01042             
01043             result = dialog_message_confirm(NULL, message, context, info->message_id, _("Cancel"), _("Install"));
01044             g_free(message);
01045         }
01046         else if (g_ascii_strcasecmp(arg_array[0].value.s, "hide") == 0)
01047         {
01048             dialog_message_confirm_close();
01049             result = TRUE;
01050         }
01051         else
01052         {
01053             ERRORPRINTF("state unknown: %s", arg_array[0].value.s);
01054         }        
01055     }
01056 
01057     // delay user response unless an error has occurred but return an error immediately
01058     //
01059     if (result == FALSE)
01060     {
01061         ipc_send_reply(context, info->message_id, FALSE);
01062     }
01063 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, dialog_message_confirm(), dialog_message_confirm_close(), ERRORPRINTF, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, and eripc_arg_t::s.

01067 {
01068     const eripc_arg_t *arg_array = info->args;
01069     LOGPRINTF("entry");
01070 
01071     CHECK_ARG_STRING(0);
01072     static gboolean result = FALSE;
01073     if (g_ascii_strcasecmp(arg_array[0].value.s, "show") == 0) 
01074     {
01075         gchar *message = g_strconcat(_("A new firmware update has been found. To install it, the device must be restarted.\n\n"),
01076                                      _("Do you wish to restart the device now?"),
01077                                     NULL);
01078         
01079         result = dialog_message_confirm(NULL, message, context, info->message_id, _("Cancel"), _("Restart"));
01080         g_free(message);
01081     }
01082     else if (g_ascii_strcasecmp(arg_array[0].value.s, "hide") == 0)
01083     {
01084         dialog_message_confirm_close();
01085         result = TRUE;
01086     }
01087     else
01088     {
01089         ERRORPRINTF("state unknown: %s", arg_array[0].value.s);
01090     }        
01091 
01092     // delay user response unless an error has occurred but return an error immediately
01093     //
01094     if (result == FALSE)
01095     {
01096         ipc_send_reply(context, info->message_id, FALSE);
01097     }
01098 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, dialog_message_confirm(), dialog_message_confirm_close(), ERRORPRINTF, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, and eripc_arg_t::s.

00992 {
00993     const eripc_arg_t *arg_array = info->args;
00994     LOGPRINTF("entry");
00995 
00996     CHECK_ARG_STRING(0);
00997     static gboolean result = FALSE;
00998     if (g_ascii_strcasecmp(arg_array[0].value.s, "show") == 0) 
00999     {
01000         gchar *message = g_strconcat(_("Now Charging...\n"
01001                                        "\n"
01002                                        "Are you connecting to a computer in order to manage your device?\n"
01003                                        "(All open files and applications will be saved and closed when "
01004                                        "connecting).\n"),
01005                                     NULL);
01006         
01007         result = dialog_message_confirm(NULL, message, context, info->message_id, _("Cancel"), _("Connect"));
01008         g_free(message);
01009     }
01010     else if (g_ascii_strcasecmp(arg_array[0].value.s, "hide") == 0)
01011     {
01012         dialog_message_confirm_close();
01013         result = TRUE;
01014     }
01015     else
01016     {
01017         ERRORPRINTF("state unknown: %s", arg_array[0].value.s);
01018     }        
01019 
01020     // delay user response unless an error has occurred but return an error immediately
01021     if (result == FALSE)
01022     {
01023         ipc_send_reply(context, info->message_id, FALSE);
01024     }
01025 }

Here is the call graph for this function:

gboolean ipc_get_battery_state ( gint *  level,
gchar **  state,
gint *  timeleft 
)

Get current battery state and level and update statusbar icon.

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

Name : ipc_get_battery_state

Parameters:
[out] level Current battery level
[out] state Current charging state, string must be freed
[out] timeleft Minutes to empty (discharing) of -1 (charging)
Returns:
TRUE on success, FALSE otherwise

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

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

00370 {
00371     eripc_error_t retval;
00372     eripc_event_info_t *info = NULL;
00373     gboolean result = FALSE;
00374     
00375     LOGPRINTF("entry");
00376     
00377     retval = eripc_send_varargs_and_wait(eripcClient->context,
00378                                          &info,
00379                                          ERIPC_BUS_SESSION,
00380                                          DBUS_SERVICE_SYSTEM_CONTROL,
00381                                          "sysGetBatteryState",
00382                                          ERIPC_TYPE_INVALID);
00383 
00384     if (retval == ERIPC_ERROR_SUCCESS) 
00385     {
00386         const eripc_arg_t *arg_array = info->args;
00387         
00388         if ((arg_array[0].type == ERIPC_TYPE_INT) && 
00389             (arg_array[1].type == ERIPC_TYPE_STRING) &&
00390             (arg_array[2].type == ERIPC_TYPE_INT))
00391         {
00392             *level = arg_array[0].value.i;
00393             *state = g_strdup(arg_array[1].value.s);
00394             if (timeleft != NULL)
00395             {
00396                 *timeleft = arg_array[2].value.i;
00397                 LOGPRINTF("Reply received: battery at %d%% %s, time left: %d", *level, *state, *timeleft);
00398             }
00399             else
00400             {
00401                 LOGPRINTF("Reply received: battery at %d%% %s", *level, *state);
00402             }
00403             
00404             result = TRUE;
00405         }
00406     }
00407     else
00408     {
00409         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00410     }
00411     
00412     eripc_event_info_free(eripcClient->context, info);
00413     return result;
00414 }

gboolean ipc_get_device_capabilities ( gboolean *  has_stylus,
gboolean *  has_wifi,
gboolean *  has_bluetooth,
gboolean *  has_3g 
)

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

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

Referenced by add_system_status_items(), and main().

00495 {
00496     eripc_device_caps_t er_dev_caps;
00497     
00498     eripc_error_t result = eripc_sysd_get_device_capabilities(eripcClient, &er_dev_caps);
00499 
00500     if (result != ERIPC_ERROR_SUCCESS) 
00501     {
00502         return FALSE;
00503     }
00504     
00505     if (has_stylus)
00506     {
00507         *has_stylus = er_dev_caps.has_stylus;
00508     }
00509     
00510     if (has_wifi)
00511     {
00512         *has_wifi = er_dev_caps.has_wifi;
00513     }
00514     
00515     if (has_bluetooth)
00516     {
00517         *has_bluetooth = er_dev_caps.has_bluetooth;
00518     }
00519         
00520     if (has_3g)
00521     {
00522         *has_3g = er_dev_caps.has_3g;
00523     }
00524         
00525     return TRUE;    
00526 }

Here is the call graph for this function:

Here is the caller graph for this function:

gchar* ipc_get_orientation ( void   ) 

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

References eripc_event_info_t::args, eripc_client_context_t::context, DBUS_SERVICE_SYSTEM_CONTROL, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_event_info_free(), eripc_send_varargs_and_wait(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, LOGPRINTF, and eripc_arg_t::s.

Referenced by dialog_create().

00418 {
00419     eripc_error_t retval;
00420     eripc_event_info_t *info = NULL;
00421     gchar *result = NULL;
00422     
00423     LOGPRINTF("entry");
00424     
00425     retval = eripc_send_varargs_and_wait(eripcClient->context,
00426                                          &info,
00427                                          ERIPC_BUS_SESSION,
00428                                          DBUS_SERVICE_SYSTEM_CONTROL,
00429                                          "sysGetOrientation",
00430                                          ERIPC_TYPE_INVALID);
00431 
00432     if (retval == ERIPC_ERROR_SUCCESS) 
00433     {
00434         const eripc_arg_t *arg_array = info->args;
00435         if (arg_array[0].type == ERIPC_TYPE_STRING)
00436         {
00437             result = g_strdup(arg_array[0].value.s);
00438         }
00439     }
00440     
00441     eripc_event_info_free(eripcClient->context, info);
00442     return result;
00443 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_is_enabled ( void   ) 

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

References g_enabled.

Referenced by on_leftbutton_press(), on_popup_button_press(), on_rightbutton_press(), and status_pressed_event().

01276 {
01277     return g_enabled;
01278 }

Here is the caller graph for this function:

void ipc_send_item_activated ( const char *  iname,
const char *  pname,
const char *  mname,
const char *  state,
const char *  service 
)

Send menuItemActivated to service.

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

Name : ipc_send_item_activated

Parameters:
iname Item name
pname Parent group name
mname Current menu name
state Current state of the menu item
service IPC service name
Returns:
--

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

Definition at line 219 of file popupmenu/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 handle_status_item(), and on_item_activate().

00220 {
00221     LOGPRINTF("Send menuItemActivated message to %s: %s, %s %s, state %s", 
00222               service, iname, pname, mname, state);
00223     
00224     eripc_error_t result = eripc_send_varargs(eripcClient->context, 
00225                                 NULL,
00226                                 NULL,
00227                                 ERIPC_BUS_SESSION,
00228                                 service,
00229                                 "menuItemActivated",
00230                                 ERIPC_TYPE_STRING, iname,
00231                                 ERIPC_TYPE_STRING, pname,
00232                                 ERIPC_TYPE_STRING, mname,
00233                                 ERIPC_TYPE_STRING, state,
00234                                 ERIPC_TYPE_INVALID);
00235     
00236     if (result != ERIPC_ERROR_SUCCESS) 
00237     {
00238         ERRORPRINTF("Error launching the eripc handler (%s)", eripc_error_string(result));
00239     }
00240 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_page_change ( const gchar *  dir  ) 

Definition at line 466 of file popupmenu/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, menustore_get_current_service(), and service.

Referenced by on_leftbutton_press(), and on_rightbutton_press().

00467 {
00468     LOGPRINTF("entry");
00469     
00470     const gchar *service = menustore_get_current_service();
00471     if (service && (service[0]!='\0'))
00472     {
00473         eripc_error_t result = eripc_send_varargs(eripcClient->context,
00474                                                 NULL,
00475                                                 NULL,
00476                                                 ERIPC_BUS_SESSION,
00477                                                 service,
00478                                                 "pageChange",
00479                                                 ERIPC_TYPE_STRING, dir,
00480                                                 ERIPC_TYPE_INVALID);
00481 
00482         if (result != ERIPC_ERROR_SUCCESS) 
00483         {
00484             ERRORPRINTF("Error launching the eripc handler (%s)", eripc_error_string(result));
00485         }
00486     }
00487     else
00488     {
00489         LOGPRINTF("Current IPC service unknown");
00490     }
00491 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Return a IPC reply message.

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

Name : ipc_send_reply

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

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

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

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

void ipc_send_request_popup ( const char *  state  ) 

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

References eripc_sysd_set_menu_state(), and LOGPRINTF.

Referenced by dialog_message_confirm(), dialog_message_confirm_destroy(), dialog_message_info(), dialog_message_info_destroy(), dialog_splash_remove(), on_popup_button_press(), and show_splash().

00331 {
00332     LOGPRINTF("entry state [%s]", state);
00333     eripc_sysd_set_menu_state(eripcClient, state);
00334 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_startup_complete ( void   ) 

Send startupComplete.

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

Name : ipc_send_startup_complete

Parameters:
-- 
Returns:
--

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

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

References eripc_sysd_startup_complete(), and LOGPRINTF.

Referenced by on_startup_complete().

00363 {
00364     LOGPRINTF("entry");
00365     eripc_sysd_startup_complete(eripcClient, getpid(), FALSE, 0);
00366 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_status_item_activated ( const char *  iname,
const char *  state,
const char *  service 
)

Send statusItemActivated to service.

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

Name : ipc_send_status_item_activated

Parameters:
iname Status item name
state Current state of the menu item
service IPC service name
Returns:
--

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

Definition at line 337 of file popupmenu/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 handle_status_item().

00338 {
00339     eripc_error_t result;
00340 
00341     LOGPRINTF("entry");
00342     
00343     result = eripc_send_varargs(eripcClient->context, 
00344                                 NULL,
00345                                 NULL,
00346                                 ERIPC_BUS_SESSION,
00347                                 service,
00348                                 "statusItemActivated",
00349                                 ERIPC_TYPE_STRING, iname,
00350                                 ERIPC_TYPE_STRING, state,
00351                                 ERIPC_TYPE_INVALID);
00352     
00353     LOGPRINTF("Sent statusItemActivated message to %s: %s, state %s", service, iname, state);
00354     
00355     if (result != ERIPC_ERROR_SUCCESS) 
00356     {
00357         ERRORPRINTF("Error launching the eripc handler (%s)", eripc_error_string(result));
00358     }
00359 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_send_task_activated ( int  xid  ) 

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

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

00208 {
00209     eripc_error_t result = eripc_send_int(eripcClient->context, NULL, NULL,
00210             ERIPC_BUS_SESSION, DBUS_SERVICE_SYSTEM_CONTROL,
00211             "activateTask", xid);
00212     if (result != ERIPC_ERROR_SUCCESS) 
00213     {
00214         ERRORPRINTF("Error launching the eripc handler (%s)", eripc_error_string(result));
00215     }
00216 }

Here is the call graph for this function:

void ipc_set_enabled ( gboolean  enabled  ) 

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

References g_enabled.

Referenced by popup_set_popup_show().

01267 {
01268     g_enabled = enabled;
01269 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
01270     taskbar_enable(enabled);
01271 #endif
01272 }

Here is the caller graph for this function:

void ipc_set_orientation ( const gchar *  orientation  ) 

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

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

Referenced by dialog_splash_remove(), and show_splash().

00447 {
00448     LOGPRINTF("entry");
00449     
00450     eripc_error_t result = eripc_send_varargs(eripcClient->context,
00451                                             NULL,
00452                                             NULL,
00453                                             ERIPC_BUS_SESSION,
00454                                             DBUS_SERVICE_SYSTEM_CONTROL,
00455                                             "sysRotate",
00456                                             ERIPC_TYPE_STRING, orientation,
00457                                             ERIPC_TYPE_INVALID);
00458 
00459     if (result != ERIPC_ERROR_SUCCESS) 
00460     {
00461         ERRORPRINTF("Error launching the eripc handler (%s)", eripc_error_string(result));
00462     }
00463 }

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 186 of file popupmenu/src/ipc.c.

References eripc_client_context_t::context, DBUS_APPL_NAME, DBUS_INTERFACE, DBUS_PATH, DBUS_SERVICE, eripc_client_context_new(), and eripc_set_timeout().

00187 {
00188     eripcClient = eripc_client_context_new(
00189                     DBUS_APPL_NAME,
00190                     "1.0",
00191                     DBUS_SERVICE,
00192                     DBUS_PATH,
00193                     DBUS_INTERFACE,
00194                     service_functions);    
00195     
00196     // allow two seconds for responses of synchronous (blocking) calls
00197     eripc_set_timeout(eripcClient->context, 2000);
00198 }

Here is the call graph for this function:

void ipc_sys_standby ( void   ) 

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

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

Referenced by on_menu_key_press().

00318 {
00319     LOGPRINTF("entry");
00320     eripc_send_varargs(eripcClient->context,
00321                        NULL,
00322                        NULL,
00323                        ERIPC_BUS_SESSION,
00324                        DBUS_SERVICE_SYSTEM_CONTROL,
00325                        "sysStandby", 
00326                        ERIPC_TYPE_INVALID);
00327 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_sys_start_task ( const gchar *  cmd_line,
const gchar *  work_dir,
const gchar *  label,
const gchar *  thumbnail_path 
)

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

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

Name : ipc_sys_start_task

Parameters:
[in] cmd_line - command-line to launch the task (executable + options)
[in] work_dir - working directory in which to start this task
[in] label - text to show in popup menu
[in] thumbnail_path - the file containing the thumbnail to show in popup menu
Returns:
TRUE on success, FALSE otherwise

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

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

References eripc_event_info_t::args, eripc_client_context_t::context, DBUS_SERVICE_SYSTEM_CONTROL, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_get_timeout(), eripc_send_varargs_and_wait(), eripc_set_timeout(), ERIPC_TYPE_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, eripc_arg_t::i, LOGPRINTF, eripc_arg_t::value, and WARNPRINTF.

00248 {
00249     gboolean            ok = TRUE;    // return value
00250     eripc_error_t       result;
00251     eripc_event_info_t  *reply = NULL;
00252     const eripc_arg_t   *arg_array = NULL;
00253     int                 old_timeout = 0;
00254     gboolean            timeout_set = FALSE;
00255     
00256     WARNPRINTF("entry: cmd_line [%s] work_dir [%s] label [%s] thumbnail_path [%s]",
00257                        cmd_line,     work_dir,     label,     thumbnail_path       );
00258     g_assert( eripcClient->context );
00259     g_assert( cmd_line && *cmd_line );
00260     
00261     // set ipc timeout to "long"
00262     eripc_error_t eripc_get_timeout (eripc_context_t *context, int *timeout);
00263     result = eripc_get_timeout(eripcClient->context, &old_timeout);
00264     if (result == ERIPC_ERROR_SUCCESS)
00265     {
00266         result = eripc_set_timeout(eripcClient->context, 60*1000);
00267         if (result == ERIPC_ERROR_SUCCESS)
00268         {
00269             timeout_set = TRUE;
00270         }
00271     }
00272     
00273     result = eripc_send_varargs_and_wait( eripcClient->context,
00274                                           &reply,                // reply structure
00275                                           ERIPC_BUS_SESSION,
00276                                           DBUS_SERVICE_SYSTEM_CONTROL,
00277                                           "startTask",
00278                                           ERIPC_TYPE_STRING, cmd_line,
00279                                           ERIPC_TYPE_STRING, work_dir,
00280                                           ERIPC_TYPE_STRING, label,
00281                                           ERIPC_TYPE_STRING, thumbnail_path,
00282                                           ERIPC_TYPE_INVALID );
00283     
00284     if (result != ERIPC_ERROR_SUCCESS) 
00285     {
00286         ERRORPRINTF("eripc_send_varargs_and_wait returns [%d]", result);
00287     }
00288     else if (reply == NULL || reply->args == NULL)
00289     {
00290         ERRORPRINTF("sysd returns OK but no reply structure");
00291     }
00292     else
00293     {
00294         // parse the reply strcuture
00295         arg_array = reply->args;
00296         if (arg_array[0].type == ERIPC_TYPE_INT)
00297         {
00298             ok = arg_array[0].value.i;
00299         }
00300         else
00301         {
00302             ERRORPRINTF("unexpected argument: type [%d]", arg_array[0].type);
00303         }
00304     }    
00305     
00306     // restore ipc timeout
00307     if (timeout_set)
00308     {
00309         eripc_set_timeout(eripcClient->context, old_timeout);
00310     }
00311   
00312     LOGPRINTF("leave: ok [%d]", ok);
00313     return ok;
00314 }

Here is the call graph for this function:

void ipc_unset_services ( void   ) 

Unregister API functions.

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

Name : ipc_unset_services

Parameters:
-- 
Returns:
--

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

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

References eripc_client_context_free().

Here is the call graph for this function:

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

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

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

00629 {
00630     const eripc_arg_t *arg_array = info->args;
00631     LOGPRINTF("entry");
00632 
00633     CHECK_ARG_STRING(0);
00634     gboolean result = menustore_remove_group(arg_array[0].value.s);
00635     ipc_send_reply(context, info->message_id, result);
00636 }

Here is the call graph for this function:

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

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

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

00640 {
00641     const eripc_arg_t *arg_array = info->args;
00642     LOGPRINTF("entry");
00643     
00644     CHECK_ARG_STRING(0);
00645     CHECK_ARG_STRING(1);
00646     gboolean result = menustore_remove_item(arg_array[0].value.s,
00647                                      arg_array[1].value.s);
00648     ipc_send_reply(context, info->message_id, result);
00649 }

Here is the call graph for this function:

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

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

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

00653 {
00654     const eripc_arg_t *arg_array = info->args;
00655     LOGPRINTF("entry");
00656     
00657     CHECK_ARG_STRING(0);
00658     gboolean result = menustore_remove_menu(arg_array[0].value.s);
00659     ipc_send_reply(context, info->message_id, result);
00660 }

Here is the call graph for this function:

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

Definition at line 663 of file popupmenu/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 eripc_arg_t::value.

00664 {
00665     const eripc_arg_t *arg_array = info->args;
00666     LOGPRINTF("entry");
00667     
00668     CHECK_ARG_INT(0);   // xid
00669 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00670     int xid = arg_array[0].value.i;
00671     taskbar_remove_task(xid);
00672 #endif
00673     ipc_send_reply(context, info->message_id, TRUE);
00674 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_INT, CHECK_ARG_STRING, eripc_arg_t::i, LOGPRINTF, eripc_arg_t::s, and eripc_arg_t::value.

00678 {
00679     const eripc_arg_t *arg_array = info->args;
00680     LOGPRINTF("entry");
00681 
00682     CHECK_ARG_INT(0);       // xid
00683     CHECK_ARG_STRING(1);    // label
00684 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00685     taskbar_rename_task(arg_array[0].value.i, arg_array[1].value.s);
00686 #endif
00687 }

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, dialog_wait_close(), dialog_wait_show(), ERIPC_TYPE_STRING, ERRORPRINTF, ipc_send_reply(), LOGPRINTF, eripc_event_info_t::message_id, popup_get_popup_block(), popup_set_popup_block(), popup_set_popup_show(), eripc_arg_t::s, and eripc_arg_t::value.

00772 {
00773     const eripc_arg_t *arg_array = info->args;
00774     gboolean retval = FALSE;
00775     static gboolean should_unblock = FALSE;
00776     LOGPRINTF("entry");
00777     
00778     CHECK_ARG_STRING(0);
00779     if (g_ascii_strcasecmp(arg_array[0].value.s, "show") == 0) 
00780     {
00781         gchar *busy_msg = _("Please wait...");
00782 
00783         if ((arg_array[1].type == ERIPC_TYPE_STRING) 
00784          && (arg_array[1].value.s != NULL) 
00785          && (arg_array[1].value.s[0] != '\0'))
00786         {
00787             busy_msg = arg_array[1].value.s;
00788         }
00789 
00790         if (!popup_get_popup_block())
00791         {
00792             popup_set_popup_block(TRUE);
00793             should_unblock = TRUE;
00794         }
00795         popup_set_popup_show("hide");
00796         dialog_wait_show(busy_msg);
00797         retval = TRUE;
00798     }
00799     else if (g_ascii_strcasecmp(arg_array[0].value.s, "hide") == 0)
00800     {
00801         dialog_wait_close();
00802         if (should_unblock)
00803         {
00804             popup_set_popup_block(FALSE);
00805             should_unblock = FALSE;
00806         }
00807         retval = TRUE;
00808     }
00809     else
00810     {
00811         ERRORPRINTF("state unknown: %s", arg_array[0].value.s);
00812     }        
00813     ipc_send_reply(context, info->message_id, retval);
00814 }

Here is the call graph for this function:

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

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

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

00718 {
00719     const eripc_arg_t *arg_array = info->args;
00720     LOGPRINTF("entry");
00721 
00722     CHECK_ARG_STRING(0);
00723     CHECK_ARG_STRING(1);
00724     gboolean result = menustore_set_group_label(arg_array[0].value.s, 
00725                                            arg_array[1].value.s);
00726     ipc_send_reply(context, info->message_id, result);
00727 }

Here is the call graph for this function:

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

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

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

00705 {
00706     const eripc_arg_t *arg_array = info->args;
00707     LOGPRINTF("entry");
00708 
00709     CHECK_ARG_STRING(0);
00710     CHECK_ARG_STRING(1);
00711     gboolean result = menustore_set_group_state(arg_array[0].value.s, 
00712                                            arg_array[1].value.s);
00713     ipc_send_reply(context, info->message_id, result);
00714 }

Here is the call graph for this function:

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

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

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

00746 {
00747     const eripc_arg_t *arg_array = info->args;
00748     LOGPRINTF("entry");
00749 
00750     CHECK_ARG_STRING(0);
00751     CHECK_ARG_STRING(1);
00752     CHECK_ARG_STRING(2);
00753     gboolean result = menustore_set_item_label(arg_array[0].value.s, 
00754                                           arg_array[1].value.s,
00755                                           arg_array[2].value.s);
00756     ipc_send_reply(context, info->message_id, result);
00757 }

Here is the call graph for this function:

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

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

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

00731 {
00732     const eripc_arg_t *arg_array = info->args;
00733     LOGPRINTF("entry");
00734 
00735     CHECK_ARG_STRING(0);
00736     CHECK_ARG_STRING(1);
00737     CHECK_ARG_STRING(2);
00738     gboolean result = menustore_set_item_state(arg_array[0].value.s, 
00739                                           arg_array[1].value.s,
00740                                           arg_array[2].value.s);
00741     ipc_send_reply(context, info->message_id, result);
00742 }

Here is the call graph for this function:

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

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

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

00838 {
00839     const eripc_arg_t *arg_array = info->args;
00840     LOGPRINTF("entry");
00841 
00842     CHECK_ARG_STRING(0);
00843     gchar *prompt = arg_array[0].value.s;
00844     GtkWidget *retval = NULL;
00845     if (g_ascii_strcasecmp(prompt, "udserror") == 0)
00846     {
00847         retval = dialog_message_info(GTK_MESSAGE_ERROR, NULL, _("An unexpected error has occurred; your documents must be closed."),
00848                                      context, info->message_id);
00849     }
00850     else if (g_ascii_strcasecmp(prompt, "indexerror") == 0)
00851     {
00852         retval = dialog_message_info(GTK_MESSAGE_ERROR, NULL, _("Thumbnails for one or more documents could not be generated; thumbnail generation has been aborted."),
00853                                      context, info->message_id);
00854     }
00855     else if (g_ascii_strcasecmp(prompt, "browsererror") == 0)
00856     {
00857         retval = dialog_message_info(GTK_MESSAGE_ERROR, NULL, _("An unexpected error has occurred; the web browser has been closed."),
00858                                      context, info->message_id);
00859     }
00860     else if (g_ascii_strcasecmp(prompt, "sdfullwarn") == 0)
00861     {
00862         retval = dialog_message_info(GTK_MESSAGE_WARNING, NULL, _("The SD card is almost full. You might want to delete files to free space."),
00863                                      context, info->message_id);
00864     }
00865     else if (g_ascii_strcasecmp(prompt, "flightmode") == 0)
00866     {
00867         retval = dialog_message_info(GTK_MESSAGE_WARNING, NULL, 
00868         _("Airplane mode is on and the device will not connect to networks.\n"
00869           "Turn airplane mode off by tapping on the icon at the bottom of the screen."),
00870                                      context, info->message_id);
00871     }
00872     else if (g_ascii_strcasecmp(prompt, "3glowconnect") == 0)
00873     {
00874         retval = dialog_message_info(GTK_MESSAGE_WARNING, NULL, 
00875         _("There is not sufficient battery power to access the network.\n"
00876           "Connect to a power source to charge."),
00877                                      context, info->message_id);
00878     }
00879     else if (g_ascii_strcasecmp(prompt, "3glowwarning") == 0)
00880     {
00881         retval = dialog_message_info(GTK_MESSAGE_WARNING, NULL, 
00882         _("The battery power is running low.\n"
00883           "Connect to a power source to continue using the network."),
00884                                      context, info->message_id);
00885     }
00886     else if (g_ascii_strcasecmp(prompt, "3glowdisconnected") == 0)
00887     {
00888         retval = dialog_message_info(GTK_MESSAGE_WARNING, NULL, 
00889         _("There is no longer sufficient battery power to continue using the network.\n"
00890           "The device is disconnected from the network."),
00891                                      context, info->message_id);
00892     }
00893     else if (g_ascii_strncasecmp(prompt, "3gcooloff_", strlen("3gcooloff_")) == 0)
00894     {
00895         retval = dialog_message_info(GTK_MESSAGE_WARNING, NULL, 
00896         _("Unable to connect to the network.\n"
00897           "Please try again in a couple of minutes."),
00898                                      context, info->message_id);
00899     }
00900     else if (g_ascii_strcasecmp(prompt, "3gsarlimit") == 0)
00901     {
00902         retval = dialog_message_info(GTK_MESSAGE_WARNING, NULL, 
00903         _("The network connection has been lost.\n"
00904           "Please try again in a couple of minutes."),
00905                                      context, info->message_id);
00906     }
00907     else if (g_ascii_strcasecmp(prompt, "hide") == 0)
00908     {
00909         dialog_message_info_close();
00910         ipc_send_reply(context, info->message_id, TRUE);
00911         return;
00912     }
00913     else
00914     {
00915         WARNPRINTF("unknown dialog request: %s", prompt);
00916     }
00917 
00918     // delay user response unless an error has occurred but return an error immediately
00919     if (retval == NULL)
00920     {
00921         ipc_send_reply(context, info->message_id, TRUE);
00922     }
00923 }

Here is the call graph for this function:

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

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

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

00761 {
00762     const eripc_arg_t *arg_array = info->args;
00763     LOGPRINTF("entry");
00764 
00765     CHECK_ARG_STRING(0);
00766     gboolean result = popup_set_popup_show(arg_array[0].value.s);
00767     ipc_send_reply(context, info->message_id, result);
00768 }

Here is the call graph for this function:

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

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

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

00818 {
00819     const eripc_arg_t *arg_array = info->args;
00820     LOGPRINTF("entry");
00821     gboolean retval = FALSE;
00822     
00823     CHECK_ARG_STRING(0);
00824     if (strcmp(arg_array[0].value.s,"hide") == 0)
00825     {
00826         dialog_splash_remove();
00827     }
00828     else
00829     {
00830         retval = dialog_splash_show(arg_array[0].value.s);
00831     }
00832 
00833     ipc_send_reply(context, info->message_id, retval);
00834 }

Here is the call graph for this function:

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

Definition at line 954 of file popupmenu/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, statusbar_item_show(), and eripc_arg_t::value.

00955 {
00956     const eripc_arg_t *arg_array = info->args;
00957     LOGPRINTF("entry");
00958 
00959     CHECK_ARG_STRING(0);
00960     CHECK_ARG_STRING(1);
00961     gboolean result = statusbar_item_show(arg_array[0].value.s, arg_array[1].value.s);
00962     ipc_send_reply(context, info->message_id, result);
00963 }

Here is the call graph for this function:

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

Definition at line 941 of file popupmenu/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, statusbar_item_set_state(), and eripc_arg_t::value.

00942 {
00943     const eripc_arg_t *arg_array = info->args;
00944     LOGPRINTF("entry");
00945 
00946     CHECK_ARG_STRING(0);
00947     CHECK_ARG_STRING(1);
00948     gboolean result = statusbar_item_set_state(arg_array[0].value.s,
00949                                           arg_array[1].value.s);
00950     ipc_send_reply(context, info->message_id, result);
00951 }

Here is the call graph for this function:

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

Definition at line 690 of file popupmenu/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 eripc_arg_t::value.

00691 {
00692     const eripc_arg_t *arg_array = info->args;
00693     LOGPRINTF("entry");
00694     
00695     CHECK_ARG_INT(0);
00696 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00697     int xid = arg_array[0].value.i;
00698     taskbar_select_task(xid);
00699 #endif
00700     ipc_send_reply(context, info->message_id, TRUE);
00701 }

Here is the call graph for this function:

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

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

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

00927 {
00928     const eripc_arg_t *arg_array = info->args;
00929     LOGPRINTF("entry");
00930 
00931     CHECK_ARG_STRING(0);
00932     menustore_set_current_menu(arg_array[0].value.s);
00933 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00934     statusbar_update_toolbar();
00935 #endif
00936     statusbar_hide_pagecounter();
00937     ipc_send_reply(context, info->message_id, TRUE);
00938 }

Here is the call graph for this function:

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

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

References eripc_reply_string(), eripc_event_info_t::message_id, testing_menustore_print(), and testing_taskbar_print().

01241 {
01242     const char* list = "no debug";
01243 #if (LOGGING_ON)
01244     testing_taskbar_print();
01245 #endif
01246 #if (TESTING_ON)
01247     list = testing_menustore_print();
01248 #endif
01249     eripc_reply_string(context, info->message_id, list);
01250 }

Here is the call graph for this function:

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

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

References eripc_event_info_t::args, CHECK_ARG_STRING, eripc_reply_string(), eripc_event_info_t::message_id, eripc_arg_t::s, testing_menustore_get_route(), and eripc_arg_t::value.

01254 {
01255     const char* route = "no debug";
01256 #if (TESTING_ON)
01257     const eripc_arg_t *arg_array = info->args;
01258     CHECK_ARG_STRING(0);
01259     CHECK_ARG_STRING(1);
01260     route = testing_menustore_get_route(arg_array[0].value.s, arg_array[1].value.s);
01261 #endif
01262     eripc_reply_string(context, info->message_id, route);
01263 }

Here is the call graph for this function:

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

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

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

00967 {
00968     const eripc_arg_t *arg_array = info->args;
00969     LOGPRINTF("entry");
00970 
00971     CHECK_ARG_INT(0);
00972     CHECK_ARG_INT(1);
00973 
00974     gint cur_page  = arg_array[0].value.i;
00975     gint num_pages = arg_array[1].value.i;
00976 
00977     // Boundary check is disabled temporary for reflowable documents, meanings
00978     // that the navigation arrows are not disabled on the first and last page,
00979     // because previous or next screens can still be available.
00980     gboolean boundary_check = TRUE;
00981     if (arg_array[2].type == ERIPC_TYPE_BOOL)
00982     {
00983         boundary_check = arg_array[2].value.b;
00984     }
00985 
00986     statusbar_update_pagecounter(cur_page, num_pages, boundary_check);
00987     ipc_send_reply(context, info->message_id, TRUE);
00988 }

Here is the call graph for this function:

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

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

References ipc_send_reply(), and eripc_event_info_t::message_id.

01102 {
01103 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
01104     statusbar_update_toolbar();
01105 #endif
01106     ipc_send_reply(context, info->message_id, TRUE);
01107 }

Here is the call graph for this function:


Variable Documentation

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

gboolean g_enabled = TRUE [static]

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

Referenced by ipc_is_enabled(), and ipc_set_enabled().

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

Generated by  doxygen 1.6.2-20100208