#include <stdio.h>
#include <unistd.h>
#include "log.h"
#include "i18n.h"
#include "ipc.h"
#include "main.h"
#include "menu.h"
Go to the source code of this file.
Functions | |
void | menu_init (void) |
Initialise popup menus for content browser. | |
void | menu_destroy (void) |
Remove the popup menus. | |
void | menu_show (void) |
Set the context menu to show in the popup menu. | |
void | menu_set_text (void) |
Initialise text items in popup menus for content browser. | |
void | menu_on_item_activated (const gchar *item, const gchar *group, const gchar *menu, const gchar *state) |
Handle a menu button that has been pressed by the user. | |
Variables | |
static const char * | MENU_MAIN = "helloworld_settings_menu" |
void menu_destroy | ( | void | ) |
Remove the popup menus.
---------------------------------------------------------------------------
Name : menu_destroy
-- |
--------------------------------------------------------------------------
Definition at line 96 of file hello-world/settings/menu.c.
References ipc_remove_menu(), LOGPRINTF, and MENU_MAIN.
00097 { 00098 LOGPRINTF("entry"); 00099 00100 // remove the main menu 00101 ipc_remove_menu( MENU_MAIN ); 00102 }
void menu_init | ( | ) |
Initialise popup menus for content browser.
Initialise popup menus for settings application.
Initialise popup menus.
---------------------------------------------------------------------------
Name : menu_init
-- |
--------------------------------------------------------------------------
Definition at line 75 of file hello-world/settings/menu.c.
References ipc_menu_add_menu(), LOGPRINTF, MENU_MAIN, menu_show(), and WARNPRINTF.
00076 { 00077 static gboolean firsttime = TRUE; 00078 00079 LOGPRINTF("entry"); 00080 00081 // execute only once 00082 if ( !firsttime ) 00083 { 00084 WARNPRINTF("function called twice"); 00085 return; 00086 } 00087 firsttime = FALSE; 00088 00089 // show an empty menu 00090 ipc_menu_add_menu( MENU_MAIN, NULL, NULL, NULL ); 00091 menu_show(); 00092 }
void menu_on_item_activated | ( | const gchar * | item, | |
const gchar * | group, | |||
const gchar * | menu, | |||
const gchar * | state | |||
) |
Handle a menu button that has been pressed by the user.
---------------------------------------------------------------------------
Name : menu_on_item_activated
[in] | item | - item name of the activated item |
[in] | group | - name of the parent group of the activated item |
[in] | menu | - name of the current menu |
[in] | state | - state of the item when activated |
--------------------------------------------------------------------------
Definition at line 126 of file hello-world/settings/menu.c.
References ERRORPRINTF, LOGPRINTF, and WARNPRINTF.
00130 { 00131 gboolean ok = TRUE; 00132 00133 LOGPRINTF("entry: item [%s] group [%s]", item, group); 00134 00135 // TODO: implement your menu handling here, if required 00136 WARNPRINTF("unexpected menu group [%s]", group); 00137 ok = FALSE; 00138 00139 if (!ok) 00140 { 00141 ERRORPRINTF( "Unhandled menu items: menu [%s] group [%s] item [%s] state [%s]", 00142 menu, group, item, state ); 00143 } 00144 }
void menu_set_text | ( | ) |
Initialise text items in popup menus for content browser.
Initiliase text items in popup menu(s).
---------------------------------------------------------------------------
Name : menu_set_text
-- |
--------------------------------------------------------------------------
Definition at line 115 of file hello-world/settings/menu.c.
References LOGPRINTF.
00116 { 00117 LOGPRINTF("entry"); 00118 }
void menu_show | ( | ) |
Set the context menu to show in the popup menu.
Display the proper popup menu for the current context.
---------------------------------------------------------------------------
Name : menu_show
-- |
--------------------------------------------------------------------------
Definition at line 106 of file hello-world/settings/menu.c.
References ipc_menu_show_menu(), LOGPRINTF, and MENU_MAIN.
00107 { 00108 LOGPRINTF("entry"); 00109 00110 // show the main menu 00111 ipc_menu_show_menu( MENU_MAIN ); 00112 }
const char* MENU_MAIN = "helloworld_settings_menu" [static] |
Copyright (C) 2009 iRex Technologies B.V. All rights reserved.
Definition at line 55 of file hello-world/settings/menu.c.
Referenced by menu_destroy(), menu_init(), and menu_show().