2008-11-30 22:31:20 +00:00
|
|
|
/** \file server/menuscreens.h
|
|
|
|
|
* Creates all menuscreens, menus and handles the keypresses for the
|
|
|
|
|
* menuscreens.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* This file is part of LCDd, the lcdproc server.
|
2002-04-26 00:00:31 +00:00
|
|
|
*
|
2008-11-30 22:31:20 +00:00
|
|
|
* This file is released under the GNU General Public License.
|
|
|
|
|
* Refer to the COPYING file distributed with this package.
|
2002-04-26 00:00:31 +00:00
|
|
|
*
|
2011-01-05 23:34:37 +00:00
|
|
|
* Copyright (c) 1999, William Ferrell, Selene Scriven
|
2003-02-27 21:20:20 +00:00
|
|
|
* 2003, Joris Robijn
|
2002-04-26 00:00:31 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef MENUSCREENS_H
|
|
|
|
|
#define MENUSCREENS_H
|
|
|
|
|
|
|
|
|
|
#include "menu.h"
|
2002-05-26 19:21:23 +00:00
|
|
|
#include "screen.h"
|
2002-04-26 00:00:31 +00:00
|
|
|
|
2007-04-02 21:29:53 +00:00
|
|
|
extern Screen *menuscreen;
|
|
|
|
|
extern Menu *main_menu;
|
2002-05-26 19:21:23 +00:00
|
|
|
|
2007-04-02 21:29:53 +00:00
|
|
|
int menuscreens_init(void);
|
2002-08-04 20:58:51 +00:00
|
|
|
|
2007-04-02 21:29:53 +00:00
|
|
|
int menuscreens_shutdown(void);
|
2002-05-26 19:21:23 +00:00
|
|
|
|
2005-05-20 09:44:30 +00:00
|
|
|
/** This function indicates to the input part whether this key was the
|
2002-05-26 19:21:23 +00:00
|
|
|
* reserved menu key.
|
|
|
|
|
*/
|
2007-04-02 21:29:53 +00:00
|
|
|
bool is_menu_key(const char *key);
|
2002-05-26 19:21:23 +00:00
|
|
|
|
2005-05-20 09:44:30 +00:00
|
|
|
/** Meant for other parts of the program to inform the menuscreen that the
|
2002-07-09 22:56:05 +00:00
|
|
|
* item is about to be removed.
|
|
|
|
|
*/
|
2007-04-02 21:29:53 +00:00
|
|
|
void menuscreen_inform_item_destruction(MenuItem *item);
|
2002-07-09 22:56:05 +00:00
|
|
|
|
2005-05-20 09:44:30 +00:00
|
|
|
/** Meant for other parts of the program to inform the menuscreen that some
|
2002-07-09 22:56:05 +00:00
|
|
|
* properties of the item have been modified.
|
|
|
|
|
*/
|
2007-04-02 21:29:53 +00:00
|
|
|
void menuscreen_inform_item_modified(MenuItem *item);
|
2002-07-09 22:56:05 +00:00
|
|
|
|
2005-05-20 09:44:30 +00:00
|
|
|
/** This handler handles the keypresses for the menu.
|
2002-05-26 19:21:23 +00:00
|
|
|
*/
|
2007-04-02 21:29:53 +00:00
|
|
|
void menuscreen_key_handler(const char *key);
|
2002-04-26 00:00:31 +00:00
|
|
|
|
2005-05-20 09:44:30 +00:00
|
|
|
/** Adds a menu for the given screen */
|
2007-04-02 21:29:53 +00:00
|
|
|
void menuscreen_add_screen(Screen *s);
|
2002-04-29 23:27:24 +00:00
|
|
|
|
2005-05-20 09:44:30 +00:00
|
|
|
/** Removes the menu of the given screen */
|
2007-04-02 21:29:53 +00:00
|
|
|
void menuscreen_remove_screen(Screen *s);
|
2003-02-27 21:20:20 +00:00
|
|
|
|
2005-05-20 09:44:30 +00:00
|
|
|
/** switches to menu. */
|
2007-04-02 21:29:53 +00:00
|
|
|
int menuscreen_goto(Menu *menu);
|
2002-06-28 23:35:55 +00:00
|
|
|
|
2005-05-20 09:44:30 +00:00
|
|
|
/** sets custom_main_menu. */
|
2007-04-02 21:29:53 +00:00
|
|
|
int menuscreen_set_main(Menu *menu);
|
2005-05-20 09:44:30 +00:00
|
|
|
|
2002-06-28 23:35:55 +00:00
|
|
|
#endif
|