ctb/include/ipc.h File Reference

Go to the source code of this file.

Data Structures

struct  device_caps_t

Typedefs

typedef void(* quit_function )()
 Setup IPC connection and register API functions.
typedef void(* locale_function )(const char *)
typedef void(* mount_cb_t )(const char *mountpoint)
typedef void(* unmount_cb_t )()

Functions

void ipc_init (quit_function quit_cb, locale_function set_locale_cb, mount_cb_t mount_cb, unmount_cb_t unmount_cb)
void ipc_sys_startup_complete ()
 Report "content browser started" to sysd.
gint ipc_sys_start_task (const gchar *cmd_line, const gchar *work_dir, const gchar *label, const gchar *thumbnail_path, gchar **err_message)
 Send message startTask to system control, usually to open a document in the relevant viewer application.
gboolean ipc_sys_stop_task (const gchar *cmd_line)
 Send message stopTask to system control, usually to close a documen that has previously been open using ipc_sys_start_task().
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.
const device_caps_tipc_sys_get_device_capabilities ()
 Query system control for device capabilties.
gboolean ipc_menu_add_menu (const char *name, const char *group1, const char *group2, const char *group3)
 Send message addMenu to popup menu.
gboolean ipc_menu_add_group (const char *name, const char *parent, const char *image)
 Send message addGroup to popup menu.
gboolean ipc_menu_add_item (const char *name, const char *parent, const char *image)
 Send message addGroup to popup menu.
gboolean ipc_menu_set_menu_label (const char *name, const char *label)
 Send message setMenuLabel to popup menu.
gboolean ipc_menu_set_group_label (const char *name, const char *label)
 Send message setGroupLabel to popup menu.
gboolean ipc_menu_set_item_label (const char *name, const char *parent, const char *label)
 Send message setItemLabel to popup menu.
gboolean ipc_menu_show_menu (const char *name)
 Send message showMenu to popup menu.
gboolean ipc_menu_set_group_state (const char *name, const char *state)
 Send message setItemState to popup menu.
gboolean ipc_menu_set_item_state (const char *name, const char *parent, const char *state)
 Send message setItemState to popup menu.
gboolean ipc_menu_block ()
gboolean ipc_menu_unblock ()
void ipc_menu_updates_finished ()
void ipc_menu_set_pagecounter (int cur_page, int num_pages, gboolean boundary_check)
gboolean ipc_sys_busy (gboolean look_busy)
 Send message sysSetBusy to system daemon.
gboolean ipc_status_set_stylus (const char *state)
 Send message setStatusItemState(statusbar_stylus) to popup menu.
gboolean ipc_sys_is_in_portrait_mode ()
const gchar * ipc_get_media ()
 Get currently mounted storage media.
void storage_media_mounted (const gchar *mountpoint)
 Report that a storage media has been mounted.

Typedef Documentation

typedef void(* locale_function)(const char *)

Definition at line 84 of file ctb/include/ipc.h.

typedef void(* mount_cb_t)(const char *mountpoint)

Definition at line 85 of file ctb/include/ipc.h.

typedef void(* quit_function)()

Setup IPC connection and register API functions.

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

Name : ipc_init

Parameters:
Callback function for quit and changing locale
Returns:
--

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

Definition at line 83 of file ctb/include/ipc.h.

typedef void(* unmount_cb_t)()

Definition at line 86 of file ctb/include/ipc.h.


Function Documentation

const gchar* ipc_get_media (  ) 

Get currently mounted storage media.

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

Name : ipc_get_media

Returns:
gchar* of mount point of storage media or NULL if not mounted

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

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

References g_storage_media.

Referenced by add_desktop_items(), create_shortcut_item(), filemodel_chdir(), get_last_modified(), is_dir_on_media(), and load_items_in_model().

00584 {
00585     return g_storage_media;
00586 }

Here is the caller graph for this function:

void ipc_init ( quit_function  quit_cb,
locale_function  set_locale_cb,
mount_cb_t  mount_cb,
unmount_cb_t  unmount_cb 
)

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

References DBUS_APPL_NAME, DBUS_INTERFACE, DBUS_PATH, DBUS_SERVICE, eripc_client_context_new(), g_in_portrait, g_mount_cb, g_quit_callback, g_set_locale_callback, g_unmount_cb, and is_in_portrait_orientation().

Referenced by main().

00151 {
00152     g_quit_callback = quit_cb;
00153     g_set_locale_callback = set_locale_cb;
00154     g_mount_cb = mount_cb;
00155     g_unmount_cb = unmount_cb;
00156 
00157     eripcClient = eripc_client_context_new(
00158                     DBUS_APPL_NAME, 
00159                     "1.0",
00160                     DBUS_SERVICE, 
00161                     DBUS_PATH,
00162                     DBUS_INTERFACE,
00163                     service_functions);
00164     g_in_portrait = is_in_portrait_orientation();
00165 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_menu_add_group ( const char *  name,
const char *  parent,
const char *  image 
)

Send message addGroup to popup menu.

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

Name : ipc_menu_add_group

Parameters:
[in] name - name (mnemonic) of menu group
[in] parent - name (mnemonic) of the group this group belongs to, or NULL when this group is at the highest level
[in] image - icon bitmap file
Returns:
TRUE on success, FALSE otherwise

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

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

Referenced by menu_init().

00245 {
00246     return eripc_menu_add_group(eripcClient, name, parent, image);
00247 }

Here is the caller graph for this function:

gboolean ipc_menu_add_item ( const char *  name,
const char *  parent,
const char *  image 
)

Send message addGroup to popup menu.

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

Name : ipc_menu_add_item

Parameters:
[in] name - name (mnemonic) of menu item
[in] parent - name (mnemomic) of the menu group this item belongs to
[in] image - icon bitmap file
Returns:
TRUE on success, FALSE otherwise

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

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

Referenced by menu_init().

00253 {
00254     return eripc_menu_add_item(eripcClient, name, parent, image);
00255 }

Here is the caller graph for this function:

gboolean ipc_menu_add_menu ( const char *  name,
const char *  group1,
const char *  group2,
const char *  group3 
)

Send message addMenu to popup menu.

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

Name : ipc_menu_add_menu

Parameters:
[in] name - name (mnemonic) of the menu
[in] group1 .. group3 - name (mnemonic) of the menu groups
Returns:
TRUE on success, FALSE otherwise

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

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

Referenced by menu_init().

00237 {
00238     return eripc_menu_add_menu(eripcClient, name, group1, group2, group3, "");
00239 }

Here is the caller graph for this function:

gboolean ipc_menu_block (  ) 

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

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

00302 {
00303     return eripc_sysd_set_menu_state(eripcClient, "block");
00304 }

Here is the caller graph for this function:

gboolean ipc_menu_set_group_label ( const char *  name,
const char *  label 
)

Send message setGroupLabel to popup menu.

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

Name : ipc_menu_set_group_label

Parameters:
[in] name - name (mnemonic) of menu group
[in] label - on-screen text at the top of the menu group
Returns:
TRUE on success, FALSE otherwise

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

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

Referenced by menu_set_text().

00267 {
00268     return eripc_menu_set_group_label(eripcClient, name, label);
00269 }

Here is the caller graph for this function:

gboolean ipc_menu_set_group_state ( const char *  name,
const char *  state 
)

Send message setItemState to popup menu.

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

Name : ipc_menu_set_group_state

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

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

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

00288 {
00289     return eripc_menu_set_group_state(eripcClient, name, state);
00290 }

gboolean ipc_menu_set_item_label ( const char *  name,
const char *  parent,
const char *  label 
)

Send message setItemLabel to popup menu.

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

Name : ipc_menu_set_item_label

Parameters:
[in] name - name (mnemonic) of menu item
[in] parent - name (mnemomic) of the menu group this item belongs to
[in] label - on-screen text below icon
Returns:
TRUE on success, FALSE otherwise

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

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

Referenced by menu_set_text(), update_category(), and update_viewmode_text().

00275 {
00276     return eripc_menu_set_item_label(eripcClient, name, parent, label);
00277 }

Here is the caller graph for this function:

gboolean ipc_menu_set_item_state ( const char *  name,
const char *  parent,
const char *  state 
)

Send message setItemState to popup menu.

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

Name : ipc_menu_set_item_state

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

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

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

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

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

Here is the caller graph for this function:

gboolean ipc_menu_set_menu_label ( const char *  name,
const char *  label 
)

Send message setMenuLabel to popup menu.

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

Name : ipc_menu_set_menu_label

Parameters:
[in] name - name (mnemonic) of the menu
[in] label - on-screen text at the top of the menu
Returns:
TRUE on success, FALSE otherwise

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

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

Referenced by menu_set_text().

00260 {
00261     return eripc_menu_set_menu_label(eripcClient, name, label);
00262 }

Here is the caller graph for this function:

void ipc_menu_set_pagecounter ( int  cur_page,
int  num_pages,
gboolean  boundary_check 
)

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

References eripc_menu_set_pagecounter().

Referenced by filemodel_set_viewmode(), filemodel_update_pagecounter(), and update_numpages().

00320 {
00321     eripc_menu_set_pagecounter(eripcClient, cur_page, num_pages, boundary_check);
00322 }

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.

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

Name : ipc_menu_show_menu

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

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

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

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

00281 {
00282     return eripc_menu_show_menu(eripcClient, name);
00283 }

Here is the caller graph for this function:

gboolean ipc_menu_unblock (  ) 

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

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().

00308 {
00309     return eripc_sysd_set_menu_state(eripcClient, "unblock");
00310 }

Here is the caller graph for this function:

void ipc_menu_updates_finished (  ) 

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

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

Referenced by menu_hide(), and menu_on_item_activated().

00314 {
00315     eripc_send_varargs(eripcClient->context, NULL, NULL, ERIPC_BUS_SESSION, DBUS_SERVICE_POPUP_MENU, "updatesFinished", ERIPC_TYPE_INVALID);
00316 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean ipc_status_set_stylus ( const char *  state  ) 

Send message setStatusItemState(statusbar_stylus) to popup menu.

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

Name : ipc_status_set_stylus

Parameters:
[in] state - state string, e.g. 'pointer'
Returns:
TRUE on success, FALSE otherwise

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

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

References eripc_menu_set_statusitem_state().

Referenced by menu_show().

00334 {
00335     g_return_val_if_fail( (state != NULL), FALSE);
00336     return eripc_menu_set_statusitem_state(eripcClient, "statusbar_stylus", state);
00337 }

Here is the call graph for this function:

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

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

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

Here is the caller graph for this function:

const device_caps_t* ipc_sys_get_device_capabilities (  ) 

Query system control for device capabilties.

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

Name : ipc_sys_get_device_capabilities

Parameters:
-- 
Returns:
current device capabilities

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

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

Referenced by get_viewtype_from_registry().

00213 {
00214     static device_caps_t dev_caps;
00215 
00216     eripc_device_caps_t er_dev_caps;
00217 
00218     eripc_sysd_get_device_capabilities( eripcClient, &er_dev_caps );
00219 
00220     dev_caps.has_stylus = er_dev_caps.has_stylus;
00221     dev_caps.has_wifi = er_dev_caps.has_wifi;
00222     dev_caps.has_bluetooth = er_dev_caps.has_bluetooth;
00223     dev_caps.has_3g = er_dev_caps.has_3g;
00224 
00225     return &dev_caps;
00226 }

Here is the caller graph for this function:

gboolean ipc_sys_is_in_portrait_mode (  ) 

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

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

00341 {
00342     return g_in_portrait;
00343 }

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

Referenced by activate_shortcut_to_web_location().

00204 {
00205     LOGPRINTF("entry: url [%s] label [%s] back_text [%s]",
00206                       url,     label,     back_text     );
00207     g_assert( url && *url );
00208     return eripc_sysd_open_url( eripcClient, url, label, back_text, err_message );
00209 }

Here is the caller graph for this function:

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

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

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

Name : ipc_sys_start_task

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

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

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

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

00179 {
00180     LOGPRINTF("entry: cmd_line [%s] work_dir [%s] label [%s] thumbnail_path [%s]",
00181                        cmd_line,     work_dir,     label,     thumbnail_path       );
00182     g_assert( cmd_line && *cmd_line );
00183     return eripc_sysd_start_task( eripcClient, 
00184                                   cmd_line, 
00185                                   work_dir, 
00186                                   label, 
00187                                   thumbnail_path, 
00188                                   err_message);
00189 }

Here is the caller graph for this function:

void ipc_sys_startup_complete (  ) 

Report "content browser started" to sysd.

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

Name : ipc_sys_startup_complete

Parameters:
-- 
Returns:
--

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

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

Referenced by main(), on_startup_complete(), and sys_startup_complete().

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

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

Referenced by delete_item().

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

Here is the caller graph for this function:

void storage_media_mounted ( const gchar *  mountpoint  ) 

Report that a storage media has been mounted.

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

Name : storage_media_mounted

Parameters:
[in] mountpoint - location where this media has been mounted

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

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

References ERRORPRINTF, g_mount_cb, g_storage_media, and LOGPRINTF.

Referenced by main(), and on_mounted().

00590 {
00591     LOGPRINTF("entry: mountpoint [%s]", mountpoint);
00592     g_assert(mountpoint && *mountpoint);
00593 
00594     if (g_storage_media) {
00595         ERRORPRINTF("storage already present %s (new %s)", g_storage_media, mountpoint);
00596     } else {
00597         g_storage_media = g_strdup(mountpoint);
00598         g_mount_cb(mountpoint);
00599     }
00600 }

Here is the caller graph for this function:

Generated by  doxygen 1.6.2-20100208