blob: 884e3132bfb2e8660ee20696a24e694bd5e529dd [file] [log] [blame]
Linus Nielsen Feltzing7da94772005-10-28 00:00:00 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
Kevin Ferrarea3ed62b2005-10-30 01:24:35 +000010 * Copyright (C) 2005 by Kevin Ferrare
Linus Nielsen Feltzing7da94772005-10-28 00:00:00 +000011 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
Linus Nielsen Feltzing7da94772005-10-28 00:00:00 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _GUI_BUTTONBAR_H_
23#define _GUI_BUTTONBAR_H_
24#include "config.h"
25#include "button.h"
Jonathan Gordon43f07702008-05-29 09:14:32 +000026#include "screen_access.h"
Linus Nielsen Feltzing7da94772005-10-28 00:00:00 +000027
Jonathan Gordon43f07702008-05-29 09:14:32 +000028
Peter D'Hoyef76122f2008-05-29 20:32:39 +000029#ifdef HAVE_BUTTONBAR
Linus Nielsen Feltzing7da94772005-10-28 00:00:00 +000030#define BUTTONBAR_HEIGHT 8
31#define BUTTONBAR_MAX_BUTTONS 3
32#define BUTTONBAR_CAPTION_LENGTH 8
Jonathan Gordon43f07702008-05-29 09:14:32 +000033
Linus Nielsen Feltzing7da94772005-10-28 00:00:00 +000034
35struct gui_buttonbar
36{
37 char caption[BUTTONBAR_MAX_BUTTONS][BUTTONBAR_CAPTION_LENGTH];
38 struct screen * display;
39};
40
41/*
42 * Initializes the buttonbar
43 * - buttonbar : the buttonbar
44 */
45extern void gui_buttonbar_init(struct gui_buttonbar * buttonbar);
46
47/*
48 * Attach the buttonbar to a screen
49 * - buttonbar : the buttonbar
50 * - display : the display to attach the buttonbar
51 */
52extern void gui_buttonbar_set_display(struct gui_buttonbar * buttonbar,
53 struct screen * display);
54
55/*
56 * Set the caption of the items of the buttonbar
57 * - buttonbar : the buttonbar
58 * - caption1,2,3 : the first, second and thirds items of the bar
59 */
60extern void gui_buttonbar_set(struct gui_buttonbar * buttonbar,
61 const char *caption1,
62 const char *caption2,
63 const char *caption3);
64
65/*
66 * Disable the buttonbar
67 * - buttonbar : the buttonbar
68 */
69extern void gui_buttonbar_unset(struct gui_buttonbar * buttonbar);
70
71/*
72 * Draw the buttonbar on it's attached screen
73 * - buttonbar : the buttonbar
74 */
75extern void gui_buttonbar_draw(struct gui_buttonbar * buttonbar);
76
77/*
78 * Returns true if the buttonbar has something to display, false otherwise
79 * - buttonbar : the buttonbar
80 */
81extern bool gui_buttonbar_isset(struct gui_buttonbar * buttonbar);
Jonathan Gordon43f07702008-05-29 09:14:32 +000082#else
83#define BUTTONBAR_HEIGHT 0
84#endif
Linus Nielsen Feltzing7da94772005-10-28 00:00:00 +000085#endif /* _GUI_BUTTONBAR_H_ */