Linus Nielsen Feltzing | 7da9477 | 2005-10-28 00:00:00 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
Kevin Ferrare | a3ed62b | 2005-10-30 01:24:35 +0000 | [diff] [blame] | 10 | * Copyright (C) 2005 by Kevin Ferrare |
Linus Nielsen Feltzing | 7da9477 | 2005-10-28 00:00:00 +0000 | [diff] [blame] | 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * 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 Feltzing | 7da9477 | 2005-10-28 00:00:00 +0000 | [diff] [blame] | 16 | * |
| 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 Gordon | 43f0770 | 2008-05-29 09:14:32 +0000 | [diff] [blame] | 26 | #include "screen_access.h" |
Linus Nielsen Feltzing | 7da9477 | 2005-10-28 00:00:00 +0000 | [diff] [blame] | 27 | |
Jonathan Gordon | 43f0770 | 2008-05-29 09:14:32 +0000 | [diff] [blame] | 28 | |
Peter D'Hoye | f76122f | 2008-05-29 20:32:39 +0000 | [diff] [blame] | 29 | #ifdef HAVE_BUTTONBAR |
Linus Nielsen Feltzing | 7da9477 | 2005-10-28 00:00:00 +0000 | [diff] [blame] | 30 | #define BUTTONBAR_HEIGHT 8 |
| 31 | #define BUTTONBAR_MAX_BUTTONS 3 |
| 32 | #define BUTTONBAR_CAPTION_LENGTH 8 |
Jonathan Gordon | 43f0770 | 2008-05-29 09:14:32 +0000 | [diff] [blame] | 33 | |
Linus Nielsen Feltzing | 7da9477 | 2005-10-28 00:00:00 +0000 | [diff] [blame] | 34 | |
| 35 | struct 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 | */ |
| 45 | extern 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 | */ |
| 52 | extern 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 | */ |
| 60 | extern 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 | */ |
| 69 | extern void gui_buttonbar_unset(struct gui_buttonbar * buttonbar); |
| 70 | |
| 71 | /* |
| 72 | * Draw the buttonbar on it's attached screen |
| 73 | * - buttonbar : the buttonbar |
| 74 | */ |
| 75 | extern 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 | */ |
| 81 | extern bool gui_buttonbar_isset(struct gui_buttonbar * buttonbar); |
Jonathan Gordon | 43f0770 | 2008-05-29 09:14:32 +0000 | [diff] [blame] | 82 | #else |
| 83 | #define BUTTONBAR_HEIGHT 0 |
| 84 | #endif |
Linus Nielsen Feltzing | 7da9477 | 2005-10-28 00:00:00 +0000 | [diff] [blame] | 85 | #endif /* _GUI_BUTTONBAR_H_ */ |