settings/src/ipc.c File Reference

#include <sys/stat.h>
#include <unistd.h>
#include <gtk/gtk.h>
#include <liberipc/eripc.h>
#include <liberipc/eripc_support.h>
#include "log.h"
#include "i18n.h"
#include "ipc.h"
#include "settings.h"
#include "sd_settings.h"
#include "reset.h"
#include "datetime.h"
Include dependency graph for settings/src/ipc.c:

Go to the source code of this file.

Defines

#define DBUS_APPL_NAME   PACKAGE_NAME
#define DBUS_SERVICE   "com.irexnet."DBUS_APPL_NAME
#define DBUS_PATH   "/com/irexnet/"DBUS_APPL_NAME
#define DBUS_INTERFACE   "com.irexnet."DBUS_APPL_NAME
#define DBUS_SERVICE_SYSD   "com.irexnet.sysd"
#define DBUS_SERVICE_CTB   "com.irexnet.ctb"

Functions

void main_quit ()
static void on_mounted (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_unmounted (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_changed_locale (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_window_activated (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_window_deactivated (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_changed_orientation (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static gboolean ipc_menu_add_menu (const char *name, const char *label, const char *group1, const char *group2, const char *group3, const char *group4)
gboolean ipc_set_services ()
 Setup IPC connection and register API functions.
void ipc_unset_services ()
 Unregister API functions.
void ipc_sys_startup_complete (int xid)
 Report "settings started" to sysd.
gboolean ipc_menu_show_menu (const char *name)
 Send message showMenu to popup menu.
gboolean ipc_remove_menu (const char *name)
 Remove menu from popup menu.
gboolean ipc_menu_popup (const char *state)
 Request popup menu state.
gboolean ipc_sys_busy (gboolean look_busy)
 Send message sysSetBusy to system daemon.
gboolean ipc_set_stylus (const char *state)
 Request popup menu state.
void menu_init ()
 Initialise popup menus for content browser.
gboolean get_device_capabilities (gboolean *has_stylus, gboolean *has_wifi, gboolean *has_bluetooth, gboolean *has_3g)
 Get device capabilities from sysd.
void mount_sd_card ()
 Mount sd card via sysd.
void unmount_sd_card ()
 Unmount sd card via sysd.
gint ipc_sys_open_url (const gchar *url, const gchar *label, const gchar *back_text, gchar **err_message)
 Send message openURL to system control, usually to open a web location in the browser application.
gint ipc_sys_start_task (const gchar *cmd_line, const gchar *work_dir, const gchar *label, const gchar *thumbnail_path, gchar **err_message)
 Send message startTask to system control, usually to open a document in the relevant viewer application.
gboolean ipc_sys_stop_task (const gchar *cmd_line)
 Send message stopTask to system control, usually to close a documen that has previously been open using ipc_sys_start_task().
gboolean ipc_menu_block (void)
gboolean ipc_menu_unblock (void)
gboolean ipc_sys_is_in_portrait_mode (void)
 Query sysd if device in portrait mode.
gboolean ipc_get_battery_state (gint *level, gchar **state, gint *timeleft)
 Get current battery state and level and update statusbar icon.

Variables

static eripc_client_context_teripcClient = NULL
static gboolean g_menu_blocked = FALSE
static eripc_callback_function_t service_functions []

Define Documentation

#define DBUS_APPL_NAME   PACKAGE_NAME

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

Definition at line 58 of file settings/src/ipc.c.

#define DBUS_INTERFACE   "com.irexnet."DBUS_APPL_NAME

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

#define DBUS_PATH   "/com/irexnet/"DBUS_APPL_NAME

Definition at line 60 of file settings/src/ipc.c.

#define DBUS_SERVICE   "com.irexnet."DBUS_APPL_NAME

Definition at line 59 of file settings/src/ipc.c.

#define DBUS_SERVICE_CTB   "com.irexnet.ctb"

Definition at line 65 of file settings/src/ipc.c.

#define DBUS_SERVICE_SYSD   "com.irexnet.sysd"

Definition at line 64 of file settings/src/ipc.c.


Function Documentation

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

Get device capabilities from sysd.

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

Name : get_device_capabilities

Parameters:
has_stylus [Output] Store result of hasing stylus. has_wifi [Output] Store result of hasing wifi. has_bluetooth [Output] Store result of hasing bluetooth. has_3g [Output] Store result of hasing 3g.
Returns:
FALSE if failed to get device capabilities.

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

Definition at line 202 of file settings/src/ipc.c.

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

00206 {
00207     eripc_device_caps_t er_dev_caps;
00208 
00209     eripc_sysd_get_device_capabilities( eripcClient, &er_dev_caps );
00210 
00211     *has_stylus = er_dev_caps.has_stylus;
00212     *has_wifi = er_dev_caps.has_wifi;
00213     *has_bluetooth = er_dev_caps.has_bluetooth;
00214     *has_3g = er_dev_caps.has_3g;
00215 
00216     return TRUE;
00217 }

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 508 of file settings/src/ipc.c.

References eripc_event_info_t::args, eripc_client_context_t::context, DBUS_SERVICE_SYSD, DBUS_SERVICE_SYSTEM_CONTROL, ERIPC_BUS_SESSION, eripc_error_string(), ERIPC_ERROR_SUCCESS, eripc_event_info_free(), eripc_send_varargs_and_wait(), ERIPC_TYPE_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, eripc_arg_t::i, LOGPRINTF, eripc_arg_t::s, and eripc_arg_t::value.

Referenced by handle_status_item(), main(), and on_check_low_battery().

00509 {
00510     eripc_error_t retval;
00511     eripc_event_info_t *info = NULL;
00512     gboolean result = FALSE;
00513     
00514     LOGPRINTF("entry");
00515     
00516     retval = eripc_send_varargs_and_wait(eripcClient->context,
00517                                          &info,
00518                                          ERIPC_BUS_SESSION,
00519                                          DBUS_SERVICE_SYSD,
00520                                          "sysGetBatteryState",
00521                                          ERIPC_TYPE_INVALID);
00522 
00523     if (retval == ERIPC_ERROR_SUCCESS) 
00524     {
00525         const eripc_arg_t *arg_array = info->args;
00526         
00527         if ((arg_array[0].type == ERIPC_TYPE_INT) && 
00528             (arg_array[1].type == ERIPC_TYPE_STRING) &&
00529             (arg_array[2].type == ERIPC_TYPE_INT))
00530         {
00531             *level = arg_array[0].value.i;
00532             *state = g_strdup(arg_array[1].value.s);
00533             if (timeleft != NULL)
00534             {
00535                 *timeleft = arg_array[2].value.i;
00536                 LOGPRINTF("Reply received: battery at %d%% %s, time left: %d", *level, *state, *timeleft);
00537             }
00538             else
00539             {
00540                 LOGPRINTF("Reply received: battery at %d%% %s", *level, *state);
00541             }
00542             
00543             result = TRUE;
00544         }
00545     }
00546     else
00547     {
00548         ERRORPRINTF("Error launching eripc handler: %s", eripc_error_string(retval));
00549     }
00550     
00551     eripc_event_info_free(eripcClient->context, info);
00552     return result;
00553 }

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean ipc_menu_add_menu ( const char *  name,
const char *  label,
const char *  group1,
const char *  group2,
const char *  group3,
const char *  group4 
) [static]

Definition at line 233 of file settings/src/ipc.c.

References eripc_menu_add_menu().

00239 {
00240     return eripc_menu_add_menu(eripcClient, name, group1, group2, group3, group4);
00241 }

Here is the call graph for this function:

gboolean ipc_menu_block ( void   ) 

Definition at line 400 of file settings/src/ipc.c.

References eripc_sysd_set_menu_state(), and g_menu_blocked.

Referenced by fileview_show_search_dialog(), on_format_button_clicked(), on_mount_done(), on_reset_button_clicked(), run_dialog(), and show_error_dialog().

00401 {
00402     if (g_menu_blocked)
00403     {
00404         return FALSE;
00405     }
00406     g_menu_blocked = TRUE;
00407     return eripc_sysd_set_menu_state(eripcClient, "block");
00408 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_menu_popup ( const char *  state  ) 

Request popup menu state.

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

Name : ipc_menu_popup

Parameters:
state [Input] State ("show", "hide", "toggle", "block", "unblock")
Returns:
FALSE if failed to set menu

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

Definition at line 170 of file settings/src/ipc.c.

References eripc_sysd_set_menu_state().

Referenced by on_calibrate_button_clicked().

00171 {
00172     return eripc_sysd_set_menu_state(eripcClient, state);
00173 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_menu_show_menu ( const char *  name  ) 

Send message showMenu to popup menu.

Set menu context.

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

Name : ipc_menu_show_menu

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

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

Definition at line 158 of file settings/src/ipc.c.

References eripc_menu_show_menu().

Referenced by menu_init(), menu_set_current_is_media(), menu_show(), menu_update_view_mode(), and on_window_activated().

00159 {
00160     return eripc_menu_show_menu(eripcClient, name);
00161 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_menu_unblock ( void   ) 

Definition at line 411 of file settings/src/ipc.c.

References eripc_sysd_set_menu_state(), and g_menu_blocked.

Referenced by fileview_show_search_dialog(), main_quit(), on_format_button_clicked(), on_mount_done(), on_reset_button_clicked(), run_dialog(), and show_error_dialog().

00412 {
00413     if (!g_menu_blocked)
00414     {
00415         return FALSE;
00416     }
00417     g_menu_blocked = FALSE;
00418     return eripc_sysd_set_menu_state(eripcClient, "unblock");
00419 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_remove_menu ( const char *  name  ) 

Remove menu from popup menu.

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

Name : ipc_remove_menu

Parameters:
[in] name - name (mnemonic) of menu to be removed
Returns:
--

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

Definition at line 164 of file settings/src/ipc.c.

References eripc_menu_remove_menu(), and LOGPRINTF.

Referenced by main_quit(), and menu_destroy().

00165 {
00166     return eripc_menu_remove_menu(eripcClient, name);
00167 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean 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 132 of file settings/src/ipc.c.

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

00133 {
00134     eripcClient = eripc_client_context_new(
00135                     DBUS_APPL_NAME,
00136                     "1.0",
00137                     DBUS_SERVICE,
00138                     DBUS_PATH,
00139                     DBUS_INTERFACE,
00140                     service_functions);
00141 
00142     return TRUE;
00143 }

Here is the call graph for this function:

gboolean ipc_set_stylus ( const char *  state  ) 

Request popup menu state.

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

Name : ipc_set_stylus

Parameters:
state [Input] State ("enable", "disable", "suspend", "resume", "high", "normal")
Returns:
FALSE if failed to set stylus state

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

Definition at line 185 of file settings/src/ipc.c.

References eripc_menu_set_statusitem_state().

00186 {
00187     g_return_val_if_fail( (state != NULL), FALSE);
00188     return eripc_menu_set_statusitem_state(eripcClient, "statusbar_stylus", state);
00189 }

Here is the call graph for this function:

gboolean ipc_sys_busy ( gboolean  look_busy  ) 

Send message sysSetBusy to system daemon.

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

Name : ipc_sys_busy

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

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

Definition at line 176 of file settings/src/ipc.c.

References eripc_sysd_reset_busy(), and eripc_sysd_set_busy().

Referenced by handle_delete_activated(), on_format_button_clicked(), on_mount_done(), and on_reset_button_clicked().

00177 {
00178     if (look_busy)
00179         return eripc_sysd_set_busy(eripcClient, "delaydialog", NULL);
00180     else
00181         return eripc_sysd_reset_busy(eripcClient);
00182 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_sys_is_in_portrait_mode (  ) 

Query sysd if device in portrait mode.

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

Name : ipc_sys_is_in_portrait_mode

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

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

Definition at line 429 of file settings/src/ipc.c.

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

Referenced by check_orientation(), create_screen_layout(), display_flipbar_portrait(), main(), and update_padding().

00430 {
00431 
00432     gboolean result = TRUE;
00433 
00434     eripc_error_t retval;
00435     eripc_event_info_t* info = NULL;
00436 
00437     LOGPRINTF("entry");
00438 
00439     retval = eripc_send_varargs_and_wait(eripcClient->context,
00440             &info,
00441             ERIPC_BUS_SESSION,
00442             DBUS_SERVICE_SYSD,
00443             "sysGetOrientation",
00444             ERIPC_TYPE_INVALID);
00445 
00446     if (retval != ERIPC_ERROR_SUCCESS)
00447     {
00448         ERRORPRINTF("Error launching eripc handler");
00449     }
00450     else if (info == NULL || info->args == NULL)
00451     {
00452         ERRORPRINTF("sysd returns OK but no reply structure");
00453     }
00454     else
00455     {
00456         const eripc_arg_t *arg_array = info->args;
00457 
00458         if (arg_array[0].type == ERIPC_TYPE_STRING)
00459         {
00460             if ( strcmp("portrait", arg_array[0].value.s) == 0 )
00461             {
00462                 result = TRUE;
00463             }
00464             else
00465             {
00466                 result = FALSE;
00467             }
00468         }
00469         else
00470         {
00471             result = FALSE ;
00472         }
00473     }
00474     eripc_event_info_free(eripcClient->context, info);
00475     return result;
00476 }

Here is the call graph for this function:

Here is the caller graph for this function:

gint ipc_sys_open_url ( const gchar *  url,
const gchar *  label,
const gchar *  back_text,
gchar **  err_message 
)

Send message openURL to system control, usually to open a web location in the browser application.

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

Name : ipc_sys_open_url

Parameters:
[in] url - url to open
[in] label - text to show in popup menu, or NULL
[in] back_text - text in Back bar, or NULL to omit this bar
[out] err_message - error message text from application
Returns:
error code (0 for success, >0 for failure)

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

Definition at line 360 of file settings/src/ipc.c.

References eripc_sysd_open_url(), and LOGPRINTF.

Referenced by activate_shortcut_to_web_location().

00364 {
00365     LOGPRINTF("entry: url [%s] label [%s] back_text [%s]",
00366                       url,     label,     back_text     );
00367     g_assert( url && *url );
00368     return eripc_sysd_open_url( eripcClient, url, label, back_text, err_message );
00369 }

Here is the call graph for this function:

Here is the caller graph for this function:

gint ipc_sys_start_task ( const gchar *  cmd_line,
const gchar *  work_dir,
const gchar *  label,
const gchar *  thumbnail_path,
gchar **  err_message 
)

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

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

Name : ipc_sys_start_task

Parameters:
[in] cmd_line - command-line to launch the task (executable + options)
[in] work_dir - working directory in which to start this task
[in] label - text to show in popup menu
[in] thumbnail_path - the file containing the thumbnail to show in popup menu
[out] err_message - error message text from application
Returns:
error code (0 for success, >0 for failure)

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

Definition at line 373 of file settings/src/ipc.c.

References eripc_sysd_start_task(), and LOGPRINTF.

Referenced by activate_item(), activate_shortcut_to_application(), download_status_changed_cb(), and menu_on_item_activated().

00378 {
00379     LOGPRINTF("entry: cmd_line [%s] work_dir [%s] label [%s] thumbnail_path [%s]",
00380             cmd_line,     work_dir,     label,     thumbnail_path       );
00381     g_assert( cmd_line && *cmd_line );
00382     return eripc_sysd_start_task( eripcClient,
00383             cmd_line,
00384             work_dir,
00385             label,
00386             thumbnail_path,
00387             err_message);
00388 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ipc_sys_startup_complete ( int  xid  ) 

Report "settings started" to sysd.

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

Name : ipc_sys_startup_complete

Parameters:
[in] xid Xwindows id of main window
Returns:
--

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

Definition at line 152 of file settings/src/ipc.c.

References eripc_sysd_startup_complete(), notepad::eripcClient, notepad::g_xid, GCONF_DEFAULT_PEN_SIZE, notepad::gMountpoint, notepad::gPensize, notepad::ipc_gconf_initialize(), notepad::ipc_gconf_read(), and notepad::menu_show().

00153 {
00154     eripc_sysd_startup_complete( eripcClient, getpid(), FALSE, xid);
00155 }

Here is the call graph for this function:

gboolean ipc_sys_stop_task ( const gchar *  cmd_line  ) 

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

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

Name : ipc_sys_stop_task

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

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

Definition at line 392 of file settings/src/ipc.c.

References eripc_sysd_stop_task(), and LOGPRINTF.

Referenced by delete_item().

00393 {
00394     LOGPRINTF("entry: cmd_line [%s]", cmd_line );
00395     g_assert( cmd_line && *cmd_line );
00396     return eripc_sysd_stop_task( eripcClient, cmd_line );
00397 }

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 146 of file settings/src/ipc.c.

References eripc_client_context_free(), and service_functions.

Here is the call graph for this function:

void main_quit (  ) 
void menu_init (  ) 

Initialise popup menus for content browser.

Initialise popup menus for settings application.

Initialise popup menus.

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

Name : menu_init

Parameters:
-- 
Returns:
--

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

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

References BACK_TO_LIBRARY, g_sort_item, GROUP_ACTIONS, GROUP_SORT, GROUP_VIEWS, ipc_menu_add_group(), ipc_menu_add_item(), ipc_menu_add_menu(), ipc_menu_set_item_state(), ipc_menu_show_menu(), ITEM_ACTION_DELETE, ITEM_SORT_AUTHOR, ITEM_SORT_DATE_ADDED, ITEM_SORT_DATE_READ, ITEM_SORT_NAME, ITEM_VIEW_CONTENT, ITEM_VIEW_DETAIL, ITEM_VIEW_ICON, LOGPRINTF, MENU_CONTENT, MENU_CONTENT_DELETE_MODE, MENU_CONTENT_MEDIA, MENU_CONTENT_RECENT_MODE, menu_set_text(), SETTINGS_MENU, STATE_NORMAL, and SYSTEM_TOP.

Referenced by main().

00193 {
00194     LOGPRINTF("entry");
00195     
00196     ipc_menu_add_menu(SETTINGS_MENU, _("Menu"), NULL, NULL, NULL, NULL);
00197 
00198     ipc_menu_show_menu(SETTINGS_MENU);
00199 }

Here is the call graph for this function:

Here is the caller graph for this function:

void mount_sd_card ( void   ) 

Mount sd card via sysd.

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

Name : mount_sd_card

Parameters:
-- 
Returns:
--

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

Definition at line 220 of file settings/src/ipc.c.

References eripc_sysd_mount_sd_card().

Referenced by on_umount_done().

00221 {
00222     eripc_sysd_mount_sd_card(eripcClient, FALSE);
00223 }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 332 of file settings/src/ipc.c.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, LOGPRINTF, eripc_arg_t::s, and eripc_arg_t::value.

00335 {
00336     LOGPRINTF("entry");
00337     const eripc_arg_t *arg_array = info->args;
00338 
00339     if (arg_array[0].type == ERIPC_TYPE_STRING)
00340     {
00341         const char *locale = arg_array[0].value.s;
00342         if (locale)
00343         {
00344             const char *old_locale = g_getenv("LANG");
00345             
00346             if (!old_locale || (strcmp(old_locale, locale) != 0))
00347             {
00348                 LOGPRINTF("Locale has changed to %s", locale);
00349 
00350                 // set locale in environment 
00351                 g_setenv("LANG", locale, TRUE);
00352                 setlocale(LC_ALL, "");
00353             }
00354         }
00355     }
00356 }

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

Definition at line 483 of file settings/src/ipc.c.

References eripc_event_info_t::args, datetime_set_orientation(), ERIPC_TYPE_STRING, LOGPRINTF, eripc_arg_t::s, and eripc_arg_t::value.

00486 {
00487     LOGPRINTF("entry");
00488     const eripc_arg_t *arg_array = info->args;
00489 
00490     if (arg_array[0].type == ERIPC_TYPE_STRING)
00491     {
00492         const char *orientation = arg_array[0].value.s;
00493         if (orientation)
00494         {
00495             //call orientation check callback
00496             if ( 0 == strcasecmp( orientation, "portrait") )
00497             {
00498                 datetime_set_orientation(TRUE);
00499             }
00500             else 
00501             {
00502                 datetime_set_orientation(FALSE);
00503             }
00504         }
00505     }
00506 }

Here is the call graph for this function:

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

Definition at line 249 of file settings/src/ipc.c.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, LOGPRINTF, reset_sdcard_mounted(), eripc_arg_t::s, sd_card_mounted(), SD_CARD_MOUNTPOINT, eripc_arg_t::type, and eripc_arg_t::value.

00252 {
00253     LOGPRINTF("entry");
00254 
00255     g_return_if_fail(info->args);
00256     g_return_if_fail(info->args[0].type == ERIPC_TYPE_STRING);
00257 
00258     const eripc_arg_t *arg_array  = info->args;
00259     const char        *mountpoint = arg_array[0].value.s;
00260 
00261     LOGPRINTF("mountpoint=%s", mountpoint);
00262     if (mountpoint && strcmp(mountpoint, SD_CARD_MOUNTPOINT) == 0)
00263     {
00264         LOGPRINTF("Calling sd_card_mounted(TRUE)\n");
00265         sd_card_mounted(TRUE);
00266         reset_sdcard_mounted(TRUE);
00267     }
00268 }

Here is the call graph for this function:

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

Definition at line 272 of file settings/src/ipc.c.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, LOGPRINTF, reset_sdcard_mounted(), eripc_arg_t::s, sd_card_mounted(), SD_CARD_MOUNTPOINT, eripc_arg_t::type, and eripc_arg_t::value.

00275 {
00276     LOGPRINTF("entry");
00277 
00278     g_return_if_fail(info->args);
00279     g_return_if_fail(info->args[0].type == ERIPC_TYPE_STRING);
00280 
00281     const eripc_arg_t *arg_array  = info->args;
00282     const char        *mountpoint = arg_array[0].value.s;
00283 
00284     LOGPRINTF("mountpoint=%s", mountpoint);
00285     if (mountpoint && strcmp(mountpoint, SD_CARD_MOUNTPOINT) == 0)
00286     {
00287         LOGPRINTF("Calling sd_card_mounted(FALSE)\n");
00288         sd_card_mounted(FALSE);
00289         reset_sdcard_mounted(FALSE);
00290     }
00291 }

Here is the call graph for this function:

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

Definition at line 294 of file settings/src/ipc.c.

References eripc_event_info_t::args, eripc_reply_bool(), ERIPC_TYPE_INT, ipc_menu_show_menu(), LOGPRINTF, eripc_event_info_t::message_id, and SETTINGS_MENU.

00297 {
00298     LOGPRINTF("entry");
00299     gboolean          result      = FALSE; 
00300     const eripc_arg_t *arg_array  = info->args;
00301 
00302     if (arg_array[0].type == ERIPC_TYPE_INT)
00303     {
00304         ipc_menu_show_menu(SETTINGS_MENU);
00305         result = TRUE;
00306     }
00307 
00308     // return result to caller
00309     eripc_reply_bool(context, info->message_id, result);
00310 }

Here is the call graph for this function:

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

Definition at line 312 of file settings/src/ipc.c.

References eripc_event_info_t::args, eripc_reply_bool(), ERIPC_TYPE_INT, LOGPRINTF, main_quit(), and eripc_event_info_t::message_id.

00315 {
00316     LOGPRINTF("entry");
00317     gboolean          result      = FALSE; 
00318     const eripc_arg_t *arg_array  = info->args;
00319 
00320     if (arg_array[0].type == ERIPC_TYPE_INT)
00321     {
00322         // close application when window is set to the background
00323         main_quit();
00324         result = TRUE;
00325     }
00326 
00327     // return result to caller
00328     eripc_reply_bool(context, info->message_id, result);
00329 }

Here is the call graph for this function:

void unmount_sd_card ( void   ) 

Unmount sd card via sysd.

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

Name : unmount_sd_card

Parameters:
-- 
Returns:
--

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

Definition at line 226 of file settings/src/ipc.c.

References eripc_sysd_unmount_sd_card().

Referenced by on_format_sd().

00227 {
00228     eripc_sysd_unmount_sd_card(eripcClient);
00229 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

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

gboolean g_menu_blocked = FALSE [static]

Definition at line 74 of file settings/src/ipc.c.

Referenced by ipc_menu_block(), and ipc_menu_unblock().

Initial value:
 {
    { on_window_activated,  "activatedWindow",     NULL,              0 },
    { on_window_deactivated,"deactivatedWindow",   NULL,              0 },
    { on_mounted,           "sysVolumeMounted",    NULL,              0 },
    { on_mounted,           "sysVolumeMounted",    DBUS_SERVICE_SYSD, 0 },
    { on_unmounted,         "sysVolumeUnmounted",  DBUS_SERVICE_SYSD, 0 },
    { on_changed_locale,    "sysChangedLocale",    DBUS_SERVICE_SYSD, 0 },
    { on_changed_orientation, "sysChangedOrientation",  DBUS_SERVICE_SYSD, 0 },
    { NULL, NULL, NULL, 0 }  
}

Definition at line 116 of file settings/src/ipc.c.

Referenced by ipc_set_services(), and ipc_unset_services().

Generated by  doxygen 1.6.2-20100208