diff options
-rw-r--r-- | apps/gui/yesno.c | 50 | ||||
-rw-r--r-- | apps/gui/yesno.h | 54 |
2 files changed, 65 insertions, 39 deletions
diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c index d05ea6654a..1ef61249b6 100644 --- a/apps/gui/yesno.c +++ b/apps/gui/yesno.c @@ -1,3 +1,22 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id $ + * + * Copyright (C) 2005 by Kevin Ferrare + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + #include "yesno.h" #include "system.h" #include "kernel.h" @@ -5,7 +24,14 @@ #include "lang.h" #include "action.h" -void gui_yesno_init(struct gui_yesno * yn, +/* + * Initializes the yesno asker + * - yn : the yesno structure + * - main_message : the question the user has to answer + * - yes_message : message displayed if answer is 'yes' + * - no_message : message displayed if answer is 'no' + */ +static void gui_yesno_init(struct gui_yesno * yn, struct text_message * main_message, struct text_message * yes_message, struct text_message * no_message) @@ -16,13 +42,22 @@ void gui_yesno_init(struct gui_yesno * yn, yn->display=0; } -void gui_yesno_set_display(struct gui_yesno * yn, +/* + * Attach the yesno to a screen + * - yn : the yesno structure + * - display : the screen to attach + */ +static void gui_yesno_set_display(struct gui_yesno * yn, struct screen * display) { yn->display=display; } -void gui_yesno_draw(struct gui_yesno * yn) +/* + * Draws the yesno + * - yn : the yesno structure + */ +static void gui_yesno_draw(struct gui_yesno * yn) { struct screen * display=yn->display; int nb_lines, line_shift=0; @@ -45,7 +80,14 @@ void gui_yesno_draw(struct gui_yesno * yn) gui_textarea_update(display); } -bool gui_yesno_draw_result(struct gui_yesno * yn, enum yesno_res result) +/* + * Draws the yesno result + * - yn : the yesno structure + * - result : the result tha must be displayed : + * YESNO_NO if no + * YESNO_YES if yes + */ +static bool gui_yesno_draw_result(struct gui_yesno * yn, enum yesno_res result) { struct text_message * message=yn->result_message[result]; if(message==NULL) diff --git a/apps/gui/yesno.h b/apps/gui/yesno.h index 7b60cab132..67456cf69b 100644 --- a/apps/gui/yesno.h +++ b/apps/gui/yesno.h @@ -1,3 +1,22 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id $ + * + * Copyright (C) 2005 by Kevin Ferrare + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + #ifndef _GUI_YESNO_H_ #define _GUI_YESNO_H_ @@ -20,41 +39,6 @@ struct gui_yesno }; /* - * Initializes the yesno asker - * - yn : the yesno structure - * - main_message : the question the user has to answer - * - yes_message : message displayed if answer is 'yes' - * - no_message : message displayed if answer is 'no' - */ -extern void gui_yesno_init(struct gui_yesno * yn, - struct text_message * main_message, - struct text_message * yes_message, - struct text_message * no_message); - -/* - * Attach the yesno to a screen - * - yn : the yesno structure - * - display : the screen to attach - */ -extern void gui_yesno_set_display(struct gui_yesno * yn, - struct screen * display); - -/* - * Draws the yesno - * - yn : the yesno structure - */ -extern void gui_yesno_draw(struct gui_yesno * yn); - -/* - * Draws the yesno result - * - yn : the yesno structure - * - result : the result tha must be displayed : - * YESNO_NO if no - * YESNO_YES if yes - */ -extern bool gui_yesno_draw_result(struct gui_yesno * yn, enum yesno_res result); - -/* * Runs the yesno asker : * it will display the 'main_message' question, and wait for user keypress * PLAY means yes, other keys means no |