Fix for initialization of scalos preferences library. Library is now loaded only...
[AROS-Contrib.git] / Games / lbreakout2 / client / menu.h
blobe3637118710663c37bc3d31f2b8988ca37bb156a
1 /***************************************************************************
2 menu.h - description
3 -------------------
4 begin : Thu Sep 20 2001
5 copyright : (C) 2001 by Michael Speck
6 email : kulkanie@gmx.net
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #ifndef __MENU_H
19 #define __MENU_H
22 ====================================================================
23 Menu
24 ====================================================================
26 enum { MENU_LAYOUT_CENTERED = 0 };
27 typedef struct _Menu {
28 char *name; /* name of menu -- duplicated */
29 int layout;
30 int x, y, w, h; /* layout */
31 List *items; /* list of menu items */
32 Item *cur_item; /* currently highlighted item */
33 struct _Menu *parent; /* parent menu */
34 StkFont *font, *hfont, *cfont; /* if not set the default fonts are used */
35 } Menu;
38 ====================================================================
39 Create menu and center it in x,y,w,h by menu_adjust() later.
40 ====================================================================
42 Menu *menu_create( char *name, int layout, int x, int y, int w, int h, int border, int add_to_list );
44 ====================================================================
45 Delete menu and all submenus starting with root menu
46 ====================================================================
48 void menu_delete( void *menu );
50 ====================================================================
51 Add item to menu. Add item::menu to children list if
52 ITEM_LINK.
53 ====================================================================
55 void menu_add( Menu *menu, Item *item );
57 ====================================================================
58 Adjust position and size of all entries according to layout.
59 ====================================================================
61 void menu_adjust( Menu *menu );
63 ====================================================================
64 Select menu: clear current item and set extern variable cur_menu
65 ====================================================================
67 void menu_select( Menu *menu );
69 ====================================================================
70 Show/hide all items
71 ====================================================================
73 void menu_hide( Menu *menu );
74 void menu_show( Menu *menu );
76 ====================================================================
77 modify items according to event (if any) and return action id.
78 ====================================================================
80 int menu_handle_event( Menu *menu, SDL_Event *event );
82 ====================================================================
83 Update alpha of items
84 ====================================================================
86 void menu_update( Menu *menu, int ms );
88 ====================================================================
89 Select/unselect item: update menu::cur_item und item::highlight
90 ====================================================================
92 void menu_unselect_cur_item( Menu *menu );
93 void menu_select_item( Menu *menu, Item *item );
95 ====================================================================
96 Go one valid menu item up or down.
97 ====================================================================
99 void menu_up( Menu *menu );
100 void menu_down( Menu *menu );
102 ====================================================================
103 Set fonts of menu and items.
104 ====================================================================
106 void menu_set_fonts(
107 Menu *menu, StkFont *cfont, StkFont *font, StkFont *hfont );
109 ====================================================================
110 Set background of menu and items.
111 ====================================================================
113 void menu_set_bkgnd( Menu *menu, SDL_Surface *bkgnd );
115 #endif