#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <gdk/gdkx.h>
#include <sys/types.h>
#include <unistd.h>
#include <liberipc/eripc.h>
#include "log.h"
#include "i18n.h"
#include "ipc.h"
#include "main.h"
#include "menu.h"
Go to the source code of this file.
Data Structures | |
struct | functionEntry |
Defines | |
#define | DBUS_APPL_NAME "helloworld" "settings" |
#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_SYSTEM_CONTROL "com.irexnet.sysd" |
#define | DBUS_SERVICE_POPUP_MENU "com.irexnet.popupmenu" |
Functions | |
static void | on_menu_item (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_prepare_standby (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_changed_orientation (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_sys_startup_complete (void) |
Report "content browser started" to sysd. | |
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_remove_menu (const char *name) |
Remove menu from 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. | |
Variables | |
static eripc_context_t * | eripcContext = NULL |
static functionEntry | service_functions [] |
#define DBUS_APPL_NAME "helloworld" "settings" |
Definition at line 71 of file hello-world/settings/ipc.c.
#define DBUS_INTERFACE "com.irexnet." DBUS_APPL_NAME |
Definition at line 74 of file hello-world/settings/ipc.c.
#define DBUS_PATH "/com/irexnet/" DBUS_APPL_NAME |
Definition at line 73 of file hello-world/settings/ipc.c.
#define DBUS_SERVICE "com.irexnet." DBUS_APPL_NAME |
Definition at line 72 of file hello-world/settings/ipc.c.
#define DBUS_SERVICE_POPUP_MENU "com.irexnet.popupmenu" |
Definition at line 80 of file hello-world/settings/ipc.c.
#define DBUS_SERVICE_SYSTEM_CONTROL "com.irexnet.sysd" |
Definition at line 77 of file hello-world/settings/ipc.c.
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
[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 |
--------------------------------------------------------------------------
Definition at line 293 of file hello-world/settings/ipc.c.
References DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.
00296 { 00297 gboolean ok = TRUE; // return value 00298 eripc_error_t result; 00299 00300 LOGPRINTF( "entry: name [%s] parent [%s] image [%s]", 00301 name, parent, image ); 00302 g_assert( eripcContext ); 00303 00304 result = eripc_send_varargs( eripcContext, 00305 NULL, // reply handler 00306 NULL, // user data 00307 ERIPC_BUS_SESSION, 00308 DBUS_SERVICE_POPUP_MENU, 00309 "addGroup", 00310 ERIPC_TYPE_STRING, name, 00311 ERIPC_TYPE_STRING, parent, 00312 ERIPC_TYPE_STRING, "", 00313 ERIPC_TYPE_STRING, image, 00314 ERIPC_TYPE_INVALID ); 00315 00316 if (result != ERIPC_ERROR_SUCCESS) 00317 { 00318 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00319 ok = FALSE; 00320 } 00321 00322 return ok; 00323 }
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
[in] | name | - name (mnemonic) of menu item |
[in] | parent | - name (mnemomic) of the menu group this item belongs to |
[in] | image | - icon bitmap file |
--------------------------------------------------------------------------
Definition at line 327 of file hello-world/settings/ipc.c.
References DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.
00330 { 00331 gboolean ok = TRUE; // return value 00332 eripc_error_t result; 00333 00334 LOGPRINTF( "entry: name [%s] parent [%s] image [%s]", 00335 name, parent, image ); 00336 g_assert( eripcContext ); 00337 00338 result = eripc_send_varargs( eripcContext, 00339 NULL, // reply handler 00340 NULL, // user data 00341 ERIPC_BUS_SESSION, 00342 DBUS_SERVICE_POPUP_MENU, 00343 "addItem", 00344 ERIPC_TYPE_STRING, name, 00345 ERIPC_TYPE_STRING, parent, 00346 ERIPC_TYPE_STRING, "", 00347 ERIPC_TYPE_STRING, image, 00348 ERIPC_TYPE_INVALID); 00349 00350 if (result != ERIPC_ERROR_SUCCESS) 00351 { 00352 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00353 ok = FALSE; 00354 } 00355 00356 return ok; 00357 }
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
[in] | name | - name (mnemonic) of the menu |
[in] | group1 | .. group3 - name (mnemonic) of the menu groups |
--------------------------------------------------------------------------
Definition at line 255 of file hello-world/settings/ipc.c.
References DBUS_SERVICE, DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.
00259 { 00260 gboolean ok = TRUE; // return value 00261 eripc_error_t result; 00262 00263 LOGPRINTF( "entry: name [%s] groups [%s] [%s] [%s]", 00264 name, group1, group2, group3 ); 00265 g_assert( eripcContext ); 00266 00267 result = eripc_send_varargs( eripcContext, 00268 NULL, // reply handler 00269 NULL, // user data 00270 ERIPC_BUS_SESSION, 00271 DBUS_SERVICE_POPUP_MENU, 00272 "addMenu", 00273 ERIPC_TYPE_STRING, name, 00274 ERIPC_TYPE_STRING, "", 00275 ERIPC_TYPE_STRING, DBUS_SERVICE, 00276 ERIPC_TYPE_STRING, group1, 00277 ERIPC_TYPE_STRING, group2, 00278 ERIPC_TYPE_STRING, group3, 00279 ERIPC_TYPE_STRING, "", 00280 ERIPC_TYPE_INVALID ); 00281 00282 if (result != ERIPC_ERROR_SUCCESS) 00283 { 00284 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00285 ok = FALSE; 00286 } 00287 00288 return ok; 00289 }
gboolean ipc_menu_set_group_label | ( | const char * | name, | |
const char * | label | |||
) |
Send message setGroupLabel to popup menu.
---------------------------------------------------------------------------
Name : ipc_menu_set_group_label
[in] | name | - name (mnemonic) of menu group |
[in] | label | - on-screen text at the top of the menu group |
--------------------------------------------------------------------------
Definition at line 391 of file hello-world/settings/ipc.c.
References DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.
00393 { 00394 gboolean ok = TRUE; // return value 00395 eripc_error_t result; 00396 00397 LOGPRINTF( "entry: name [%s] label [%s]", name, label ); 00398 g_assert( eripcContext ); 00399 00400 result = eripc_send_varargs( eripcContext, 00401 NULL, // reply handler 00402 NULL, // user data 00403 ERIPC_BUS_SESSION, 00404 DBUS_SERVICE_POPUP_MENU, 00405 "setGroupLabel", 00406 ERIPC_TYPE_STRING, name, 00407 ERIPC_TYPE_STRING, label, 00408 ERIPC_TYPE_INVALID ); 00409 00410 if (result != ERIPC_ERROR_SUCCESS) 00411 { 00412 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00413 ok = FALSE; 00414 } 00415 00416 return ok; 00417 }
gboolean ipc_menu_set_group_state | ( | const char * | name, | |
const char * | state | |||
) |
Send message setItemState to popup menu.
---------------------------------------------------------------------------
Name : ipc_menu_set_group_state
[in] | name | - name (mnemonic) of menu group to be set |
[in] | state | - new state ("normal", "disabled") |
--------------------------------------------------------------------------
Definition at line 509 of file hello-world/settings/ipc.c.
References DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.
00511 { 00512 gboolean ok = TRUE; // return value 00513 eripc_error_t result; 00514 00515 LOGPRINTF( "entry: name [%s] state [%s]", name, state ); 00516 g_assert( eripcContext ); 00517 00518 result = eripc_send_varargs( eripcContext, 00519 NULL, // reply handler 00520 NULL, // user data 00521 ERIPC_BUS_SESSION, 00522 DBUS_SERVICE_POPUP_MENU, 00523 "setGroupState", 00524 ERIPC_TYPE_STRING, name, 00525 ERIPC_TYPE_STRING, state, 00526 ERIPC_TYPE_INVALID ); 00527 00528 if (result != ERIPC_ERROR_SUCCESS) 00529 { 00530 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00531 ok = FALSE; 00532 } 00533 00534 return ok; 00535 }
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
[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 |
--------------------------------------------------------------------------
Definition at line 421 of file hello-world/settings/ipc.c.
References DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.
00424 { 00425 gboolean ok = TRUE; // return value 00426 eripc_error_t result; 00427 00428 LOGPRINTF( "entry: name [%s] parent [%s] label [%s]", name, parent, label ); 00429 g_assert( eripcContext ); 00430 00431 result = eripc_send_varargs( eripcContext, 00432 NULL, // reply handler 00433 NULL, // user data 00434 ERIPC_BUS_SESSION, 00435 DBUS_SERVICE_POPUP_MENU, 00436 "setItemLabel", 00437 ERIPC_TYPE_STRING, name, 00438 ERIPC_TYPE_STRING, parent, 00439 ERIPC_TYPE_STRING, label, 00440 ERIPC_TYPE_INVALID ); 00441 00442 if (result != ERIPC_ERROR_SUCCESS) 00443 { 00444 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00445 ok = FALSE; 00446 } 00447 00448 return ok; 00449 }
gboolean ipc_menu_set_item_state | ( | const char * | name, | |
const char * | parent, | |||
const char * | state | |||
) |
Send message setItemState to popup menu.
Set new menu item state.
---------------------------------------------------------------------------
Name : ipc_menu_set_item_state
[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") |
--------------------------------------------------------------------------
Definition at line 539 of file hello-world/settings/ipc.c.
References DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.
00542 { 00543 gboolean ok = TRUE; // return value 00544 eripc_error_t result; 00545 00546 LOGPRINTF( "entry: name [%s] parent [%s] state [%s]", name, parent, state ); 00547 g_assert( eripcContext ); 00548 00549 result = eripc_send_varargs( eripcContext, 00550 NULL, // reply handler 00551 NULL, // user data 00552 ERIPC_BUS_SESSION, 00553 DBUS_SERVICE_POPUP_MENU, 00554 "setItemState", 00555 ERIPC_TYPE_STRING, name, 00556 ERIPC_TYPE_STRING, parent, 00557 ERIPC_TYPE_STRING, state, 00558 ERIPC_TYPE_INVALID ); 00559 00560 if (result != ERIPC_ERROR_SUCCESS) 00561 { 00562 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00563 ok = FALSE; 00564 } 00565 00566 return ok; 00567 }
gboolean ipc_menu_set_menu_label | ( | const char * | name, | |
const char * | label | |||
) |
Send message setMenuLabel to popup menu.
---------------------------------------------------------------------------
Name : ipc_menu_set_menu_label
[in] | name | - name (mnemonic) of the menu |
[in] | label | - on-screen text at the top of the menu |
--------------------------------------------------------------------------
Definition at line 361 of file hello-world/settings/ipc.c.
References DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.
00363 { 00364 gboolean ok = TRUE; // return value 00365 eripc_error_t result; 00366 00367 LOGPRINTF( "entry: name [%s] label [%s]", name, label ); 00368 g_assert( eripcContext ); 00369 00370 result = eripc_send_varargs( eripcContext, 00371 NULL, // reply handler 00372 NULL, // user data 00373 ERIPC_BUS_SESSION, 00374 DBUS_SERVICE_POPUP_MENU, 00375 "setMenuLabel", 00376 ERIPC_TYPE_STRING, name, 00377 ERIPC_TYPE_STRING, label, 00378 ERIPC_TYPE_INVALID ); 00379 00380 if (result != ERIPC_ERROR_SUCCESS) 00381 { 00382 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00383 ok = FALSE; 00384 } 00385 00386 return ok; 00387 }
gboolean ipc_menu_show_menu | ( | const char * | name | ) |
Send message showMenu to popup menu.
Set menu context.
---------------------------------------------------------------------------
Name : ipc_menu_show_menu
[in] | name | - name (mnemonic) of menu to be displayed |
--------------------------------------------------------------------------
Definition at line 453 of file hello-world/settings/ipc.c.
References DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.
00454 { 00455 gboolean ok = TRUE; // return value 00456 eripc_error_t result; 00457 00458 LOGPRINTF( "entry: name [%s]", name ); 00459 g_assert( eripcContext ); 00460 00461 result = eripc_send_varargs( eripcContext, 00462 NULL, // reply handler 00463 NULL, // user data 00464 ERIPC_BUS_SESSION, 00465 DBUS_SERVICE_POPUP_MENU, 00466 "showMenu", 00467 ERIPC_TYPE_STRING, name, 00468 ERIPC_TYPE_INVALID ); 00469 00470 if (result != ERIPC_ERROR_SUCCESS) 00471 { 00472 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00473 ok = FALSE; 00474 } 00475 00476 return ok; 00477 }
gboolean ipc_remove_menu | ( | const char * | name | ) |
Remove menu from popup menu.
---------------------------------------------------------------------------
Name : ipc_remove_menu
[in] | name | - name (mnemonic) of menu to be removed |
--------------------------------------------------------------------------
Definition at line 481 of file hello-world/settings/ipc.c.
References DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, and LOGPRINTF.
00482 { 00483 gboolean ok = TRUE; // return value 00484 eripc_error_t result; 00485 00486 LOGPRINTF( "entry: name [%s]", name ); 00487 g_assert( eripcContext ); 00488 00489 result = eripc_send_varargs( eripcContext, 00490 NULL, // reply handler 00491 NULL, // user data 00492 ERIPC_BUS_SESSION, 00493 DBUS_SERVICE_POPUP_MENU, 00494 "removeMenu", 00495 ERIPC_TYPE_STRING, name, 00496 ERIPC_TYPE_INVALID ); 00497 00498 if (result != ERIPC_ERROR_SUCCESS) 00499 { 00500 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00501 ok = FALSE; 00502 } 00503 00504 return ok; 00505 }
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
None |
--------------------------------------------------------------------------
Definition at line 143 of file hello-world/settings/ipc.c.
References DBUS_APPL_NAME, DBUS_INTERFACE, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_init(), eripc_set_message_handler(), eripc_set_signal_handler(), ERRORPRINTF, handler, functionEntry::handler, handler_id, interface, and LOGPRINTF.
00144 { 00145 gint i; 00146 eripc_error_t retval; 00147 00148 LOGPRINTF("entry"); 00149 g_assert(eripcContext == NULL); 00150 00151 // initialise IPC context 00152 eripcContext = eripc_init(DBUS_APPL_NAME, "1.0", NULL); 00153 if (eripcContext == NULL) 00154 { 00155 ERRORPRINTF("Failed to initialize eripc context\n"); 00156 exit(1); 00157 } 00158 00159 // register message/signal handlers 00160 for (i = 0 ; service_functions[i].handler != NULL ; i++) 00161 { 00162 if (service_functions[i].interface) 00163 { 00164 // install signal handler 00165 retval = eripc_set_signal_handler( eripcContext, 00166 service_functions[i].handler, 00167 NULL, 00168 ERIPC_BUS_SESSION, 00169 service_functions[i].interface, 00170 service_functions[i].message_name, 00171 &(service_functions[i].handler_id) ); 00172 if (retval != ERIPC_ERROR_SUCCESS) 00173 { 00174 ERRORPRINTF( "eripc_set_signal_handler [%s] returns [%d]", 00175 service_functions[i].message_name, 00176 retval ); 00177 } 00178 } 00179 else 00180 { 00181 // install message handler 00182 retval = eripc_set_message_handler( eripcContext, 00183 service_functions[i].handler, 00184 NULL, 00185 ERIPC_BUS_SESSION, 00186 DBUS_INTERFACE, 00187 service_functions[i].message_name, 00188 &(service_functions[i].handler_id) ); 00189 00190 if (retval != ERIPC_ERROR_SUCCESS) 00191 { 00192 ERRORPRINTF( "eripc_set_message_handler [%s] returns [%d]", 00193 service_functions[i].message_name, 00194 retval ); 00195 } 00196 } 00197 } 00198 }
void ipc_sys_startup_complete | ( | ) |
Report "content browser started" to sysd.
Report "application started" to sysd.
Report "settings started" to sysd.
Report "application started" to system daemon.
---------------------------------------------------------------------------
Name : ipc_sys_startup_complete
-- |
--------------------------------------------------------------------------
Definition at line 218 of file hello-world/settings/ipc.c.
References DBUS_APPL_NAME, DBUS_PATH, DBUS_SERVICE, DBUS_SERVICE_SYSTEM_CONTROL, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_signal_varargs(), ERIPC_TYPE_BOOL, ERIPC_TYPE_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, ERRORPRINTF, g_main_window, and LOGPRINTF.
00219 { 00220 eripc_error_t result; 00221 00222 // parameters for ipc message 00223 const int my_pid = getpid(); 00224 const int my_xid = GDK_WINDOW_XID(g_main_window->window); 00225 const gboolean is_multidoc = FALSE; 00226 00227 LOGPRINTF("entry"); 00228 g_assert( eripcContext ); 00229 00230 // broadcast signal over session bus 00231 result = eripc_send_signal_varargs( eripcContext, 00232 ERIPC_BUS_SESSION, 00233 DBUS_PATH, 00234 DBUS_SERVICE_SYSTEM_CONTROL, 00235 "startupComplete", 00236 ERIPC_TYPE_STRING, DBUS_APPL_NAME, 00237 ERIPC_TYPE_INT, my_pid, 00238 ERIPC_TYPE_BOOL, is_multidoc, 00239 ERIPC_TYPE_STRING, DBUS_SERVICE, 00240 ERIPC_TYPE_INT, my_xid, 00241 ERIPC_TYPE_INVALID ); 00242 00243 if (result != ERIPC_ERROR_SUCCESS) 00244 { 00245 ERRORPRINTF("eripc_send_varargs returns [%d]", result); 00246 } 00247 }
void ipc_unset_services | ( | void | ) |
Unregister API functions.
---------------------------------------------------------------------------
Name : ipc_unset_services
-- |
--------------------------------------------------------------------------
Definition at line 202 of file hello-world/settings/ipc.c.
References eripc_unset_handler(), handler_id, and functionEntry::handler_id.
00203 { 00204 gint i; 00205 00206 for (i = 0 ; service_functions[i].handler_id != 0 ; i++) 00207 { 00208 eripc_unset_handler(eripcContext, service_functions[i].handler_id); 00209 } 00210 }
static void on_changed_locale | ( | eripc_context_t * | context, | |
const eripc_event_info_t * | info, | |||
void * | user_data | |||
) | [static] |
Definition at line 680 of file hello-world/settings/ipc.c.
References eripc_event_info_t::args, ERIPC_TYPE_STRING, LOGPRINTF, main_set_locale(), eripc_arg_t::s, and eripc_arg_t::value.
00683 { 00684 LOGPRINTF("entry"); 00685 const eripc_arg_t *arg_array = info->args; 00686 00687 if (arg_array[0].type == ERIPC_TYPE_STRING) 00688 { 00689 const char *locale = arg_array[0].value.s; 00690 if (locale) 00691 { 00692 const char *old_locale = g_getenv("LANG"); 00693 if (!old_locale || (strcmp(old_locale, locale) != 0)) 00694 { 00695 main_set_locale(locale); 00696 } 00697 } 00698 } 00699 }
static void on_changed_orientation | ( | eripc_context_t * | context, | |
const eripc_event_info_t * | info, | |||
void * | user_data | |||
) | [static] |
Definition at line 707 of file hello-world/settings/ipc.c.
References eripc_event_info_t::args, ERIPC_TYPE_STRING, LOGPRINTF, eripc_arg_t::s, and eripc_arg_t::value.
00710 { 00711 LOGPRINTF("entry"); 00712 const eripc_arg_t *arg_array = info->args; 00713 00714 if (arg_array[0].type == ERIPC_TYPE_STRING) 00715 { 00716 const char *orientation = arg_array[0].value.s; 00717 if (orientation) 00718 { 00719 // TODO: Replace implementation 00720 } 00721 } 00722 }
static void on_menu_item | ( | eripc_context_t * | context, | |
const eripc_event_info_t * | info, | |||
void * | user_data | |||
) | [static] |
Definition at line 582 of file hello-world/settings/ipc.c.
References eripc_event_info_t::args, ERIPC_TYPE_STRING, LOGPRINTF, menu_on_item_activated(), eripc_arg_t::s, and eripc_arg_t::value.
00585 { 00586 LOGPRINTF("entry"); 00587 const eripc_arg_t *arg_array = info->args; 00588 00589 if ((arg_array[0].type == ERIPC_TYPE_STRING) && 00590 (arg_array[1].type == ERIPC_TYPE_STRING) && 00591 (arg_array[2].type == ERIPC_TYPE_STRING) && 00592 (arg_array[3].type == ERIPC_TYPE_STRING)) 00593 { 00594 const char *item = arg_array[0].value.s; 00595 const char *group = arg_array[1].value.s; 00596 const char *menu = arg_array[2].value.s; 00597 const char *state = arg_array[3].value.s; 00598 00599 if (item && group && menu && state) 00600 { 00601 menu_on_item_activated( item, group, menu, state ); 00602 } 00603 } 00604 }
static void on_prepare_standby | ( | eripc_context_t * | context, | |
const eripc_event_info_t * | info, | |||
void * | user_data | |||
) | [static] |
Definition at line 663 of file hello-world/settings/ipc.c.
References LOGPRINTF.
00666 { 00667 LOGPRINTF("entry"); 00668 00669 // TODO: Add implementation here 00670 }
static void on_window_activated | ( | eripc_context_t * | context, | |
const eripc_event_info_t * | info, | |||
void * | user_data | |||
) | [static] |
Definition at line 612 of file hello-world/settings/ipc.c.
References eripc_event_info_t::args, eripc_reply_bool(), ERIPC_TYPE_INT, LOGPRINTF, menu_show(), and eripc_event_info_t::message_id.
00615 { 00616 LOGPRINTF("entry"); 00617 gboolean result = FALSE; 00618 const eripc_arg_t *arg_array = info->args; 00619 00620 if (arg_array[0].type == ERIPC_TYPE_INT) 00621 { 00622 // TODO: Replace implementation 00623 00624 menu_show(); 00625 00626 result = TRUE; 00627 } 00628 00629 // return result to caller 00630 eripc_reply_bool(context, info->message_id, result); 00631 }
static void on_window_deactivated | ( | eripc_context_t * | context, | |
const eripc_event_info_t * | info, | |||
void * | user_data | |||
) | [static] |
Definition at line 638 of file hello-world/settings/ipc.c.
References eripc_event_info_t::args, eripc_reply_bool(), ERIPC_TYPE_INT, LOGPRINTF, and eripc_event_info_t::message_id.
00641 { 00642 LOGPRINTF("entry"); 00643 gboolean result = FALSE; 00644 const eripc_arg_t *arg_array = info->args; 00645 00646 if (arg_array[0].type == ERIPC_TYPE_INT) 00647 { 00648 // TODO: Replace implementation 00649 00650 result = TRUE; 00651 } 00652 00653 // return result to caller 00654 eripc_reply_bool(context, info->message_id, result); 00655 }
eripc_context_t* eripcContext = NULL [static] |
Definition at line 87 of file hello-world/settings/ipc.c.
functionEntry service_functions[] [static] |
{ { on_menu_item, "menuItemActivated", NULL }, { on_window_activated, "activatedWindow", NULL }, { on_window_deactivated, "deactivatedWindow", NULL }, { on_prepare_standby, "sysPrepareStandby", DBUS_SERVICE_SYSTEM_CONTROL }, { on_changed_locale, "sysChangedLocale", DBUS_SERVICE_SYSTEM_CONTROL }, { on_changed_orientation, "sysChangedOrientation", DBUS_SERVICE_SYSTEM_CONTROL }, { NULL } }
Definition at line 119 of file hello-world/settings/ipc.c.