From 44c33872116ab2e2b96f9d919f926c4a9179d796 Mon Sep 17 00:00:00 2001 From: asterix Date: Thu, 20 May 2010 16:49:39 +0000 Subject: [PATCH] Update demo. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3758 38d2e660-2303-0410-9eaa-f027e97ec537 --- examples/demo/cfg/cfg_gfx.h | 39 +++++++++------------ examples/demo/cfg/cfg_menu.h | 67 ++++++++++++++++++++++++++++++++++++ examples/demo/demo.c | 18 +++++----- 3 files changed, 93 insertions(+), 31 deletions(-) create mode 100644 examples/demo/cfg/cfg_menu.h diff --git a/examples/demo/cfg/cfg_gfx.h b/examples/demo/cfg/cfg_gfx.h index 096c427d..59dde04c 100644 --- a/examples/demo/cfg/cfg_gfx.h +++ b/examples/demo/cfg/cfg_gfx.h @@ -32,43 +32,36 @@ * * \brief Configuration file for GFX module. * - * \version $Id$ - * * \author Daniele Basile */ #ifndef CFG_GFX_H #define CFG_GFX_H -/// Enable line clipping algorithm. +/** + * Enable line clipping algorithm. + * $WIZ$ type = "boolean" + */ #define CONFIG_GFX_CLIPPING 1 -/// Enable text rendering in bitmaps. +/** + * Enable text rendering in bitmaps. + * $WIZ$ type = "boolean" + */ #define CONFIG_GFX_TEXT 1 -/// Enable virtual coordinate system. +/** + * Enable virtual coordinate system. + * $WIZ$ type = "boolean" + */ #define CONFIG_GFX_VCOORDS 1 -/// Select bitmap pixel format. -#define CONFIG_BITMAP_FMT BITMAP_FMT_PLANAR_V_LSB - /** - * \name Type for the chart dataset - * \{ + * Select bitmap pixel format. + * $WIZ$ type = "enum" + * $WIZ$ value_list = "bitmap_format" */ -#define CONFIG_CHART_TYPE_X uint8_t -#define CONFIG_CHART_TYPE_Y uint8_t -/*\}*/ - - -/// Enable button bar behind menus -#define CONFIG_MENU_MENUBAR 0 -#define CONFIG_LEVELEDIT_TIMEOUT 0 -#define CONFIG_MENU_TIMEOUT 0 - -/// Enable smooth scrolling in menus -#define CONFIG_MENU_SMOOTH 0 - +#define CONFIG_BITMAP_FMT BITMAP_FMT_PLANAR_V_LSB #endif /* CFG_GFX_H */ diff --git a/examples/demo/cfg/cfg_menu.h b/examples/demo/cfg/cfg_menu.h new file mode 100644 index 00000000..bbfa1e76 --- /dev/null +++ b/examples/demo/cfg/cfg_menu.h @@ -0,0 +1,67 @@ +/** + * \file + * + * + * \brief Configuration file for Menu module. + * + * \author Daniele Basile + */ + +#ifndef CFG_MENU_H +#define CFG_MENU_H + +/** + * Enable button bar behind menus + * $WIZ$ type = "boolean" + */ +#define CONFIG_MENU_MENUBAR 0 + +/** + * Level Edit Timeout + * $WIZ$ type = "boolean" + */ +#define CONFIG_LEVELEDIT_TIMEOUT 0 + +/** + * Menu timeout + * $WIZ$ type = "boolean" + */ +#define CONFIG_MENU_TIMEOUT 0 + +/** + * Enable smooth scrolling in menus + * $WIZ$ type = "boolean" + */ +#define CONFIG_MENU_SMOOTH 1 + + +#endif /* CFG_MENU_H */ + diff --git a/examples/demo/demo.c b/examples/demo/demo.c index 2b3c2414..e77eab90 100644 --- a/examples/demo/demo.c +++ b/examples/demo/demo.c @@ -46,8 +46,8 @@ #include #include -#include #include +#include #include #include @@ -57,12 +57,15 @@ #include #include +/** Default LCD bitmap */ +static Bitmap lcd_bitmap; + /** * Refresh the GUI. */ void schedule(void) { - lcd_blitBitmap(&lcd_bitmap); + lcd_gfx_qt_blitBitmap(&lcd_bitmap); emul_idle(); } @@ -186,7 +189,6 @@ void win_demo(Bitmap *bm) if (y >= bm->height) ydir = -1; if (y <= -50) ydir = +1; - /* Large window animation */ bm = large_win.bitmap; gfx_bitmapClear(bm); for (i = 0; i < bm->height / 2; i += 2) @@ -244,7 +246,7 @@ static struct MenuItem settings_items[] = { (const_iptr_t)"Power Saving", MIF_TOGGLE, (MenuHook)0, (iptr_t)0 }, { (const_iptr_t)0, 0, NULL, (iptr_t)0 } }; -static struct Menu settings_menu = { settings_items, "Settings Menu", MF_STICKY | MF_SAVESEL, &lcd_bitmap, 0 }; +static struct Menu settings_menu = { settings_items, "Settings Menu", MF_STICKY | MF_SAVESEL, &lcd_bitmap, 0, lcd_gfx_qt_blitBitmap }; /* MX SUBMENU */ @@ -258,7 +260,7 @@ static struct MenuItem mx_items[] = { (const_iptr_t)0, 0, NULL, (iptr_t)0 } }; -static struct Menu mx_menu = { mx_items, (const_iptr_t)0, MF_STICKY | MF_SAVESEL, &lcd_bitmap, 0 }; +static struct Menu mx_menu = { mx_items, (const_iptr_t)0, MF_STICKY | MF_SAVESEL, &lcd_bitmap, 0, lcd_gfx_qt_blitBitmap }; /* DISPLAY SUBMENU */ @@ -271,7 +273,7 @@ static struct MenuItem display_items[] = { (const_iptr_t)"Icon Theme", 0, (MenuHook)0, (iptr_t)0 }, { (const_iptr_t)0, 0, NULL, (iptr_t)0 } }; -static struct Menu display_menu = { display_items, "Display Menu", MF_SAVESEL, &lcd_bitmap, 0 }; +static struct Menu display_menu = { display_items, "Display Menu", MF_SAVESEL, &lcd_bitmap, 0, lcd_gfx_qt_blitBitmap }; /* MAIN MENU */ @@ -288,7 +290,7 @@ static struct MenuItem main_items[] = { (const_iptr_t)"Settings", 0, (MenuHook)menu_handle, (iptr_t)&settings_menu }, { (const_iptr_t)0, 0, NULL, (iptr_t)0 } }; -static struct Menu main_menu = { main_items, "Main Menu", MF_STICKY, &lcd_bitmap, 0 }; +static struct Menu main_menu = { main_items, "Main Menu", MF_STICKY, &lcd_bitmap, 0, lcd_gfx_qt_blitBitmap }; #if CONFIG_KERN_HEAP #define monitor_stack NULL @@ -303,7 +305,7 @@ int main(int argc, char *argv[]) timer_init(); buz_init(); kbd_init(); - lcd_init(); + lcd_gfx_qt_init(&lcd_bitmap); proc_init(); monitor_start(KERN_MINSTACKSIZE, monitor_stack); -- 2.25.1