From e586459a24c3c5bd383ef0045911dd155c47ef7f Mon Sep 17 00:00:00 2001 From: inmarket Date: Wed, 17 Sep 2014 08:41:34 +1000 Subject: Clean up demo gfxconf.h files that incorrectly specify every option. --- demos/modules/gwin/imagebox/gfxconf.h | 155 +------------------------------ demos/modules/gwin/label/gfxconf.h | 170 +--------------------------------- 2 files changed, 4 insertions(+), 321 deletions(-) (limited to 'demos') diff --git a/demos/modules/gwin/imagebox/gfxconf.h b/demos/modules/gwin/imagebox/gfxconf.h index 4db8be39..d068141a 100644 --- a/demos/modules/gwin/imagebox/gfxconf.h +++ b/demos/modules/gwin/imagebox/gfxconf.h @@ -30,93 +30,20 @@ /////////////////////////////////////////////////////////////////////////// #define GFX_USE_GDISP TRUE -#define GDISP_NEED_AUTOFLUSH FALSE -#define GDISP_NEED_TIMERFLUSH FALSE +//#define GDISP_NEED_AUTOFLUSH FALSE +//#define GDISP_NEED_TIMERFLUSH FALSE #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_CIRCLE FALSE -#define GDISP_NEED_ELLIPSE FALSE -#define GDISP_NEED_ARC FALSE -#define GDISP_NEED_CONVEX_POLYGON FALSE -#define GDISP_NEED_SCROLL FALSE -#define GDISP_NEED_PIXELREAD FALSE -#define GDISP_NEED_CONTROL FALSE -#define GDISP_NEED_QUERY FALSE #define GDISP_NEED_MULTITHREAD TRUE -#define GDISP_NEED_STREAMING FALSE #define GDISP_NEED_TEXT TRUE - #define GDISP_NEED_ANTIALIAS FALSE - #define GDISP_NEED_UTF8 FALSE - #define GDISP_NEED_TEXT_KERNING FALSE - #define GDISP_INCLUDE_FONT_UI1 FALSE #define GDISP_INCLUDE_FONT_UI2 TRUE - #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS10 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS12 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS16 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS24 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS32 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12 FALSE - #define GDISP_INCLUDE_FONT_FIXED_10X20 FALSE - #define GDISP_INCLUDE_FONT_FIXED_7X14 FALSE - #define GDISP_INCLUDE_FONT_FIXED_5X8 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA FALSE - #define GDISP_INCLUDE_USER_FONTS FALSE #define GDISP_NEED_IMAGE TRUE - #define GDISP_NEED_IMAGE_NATIVE FALSE #define GDISP_NEED_IMAGE_GIF TRUE #define GDISP_NEED_IMAGE_BMP TRUE - #define GDISP_NEED_IMAGE_BMP_1 FALSE - #define GDISP_NEED_IMAGE_BMP_4 FALSE - #define GDISP_NEED_IMAGE_BMP_4_RLE FALSE - #define GDISP_NEED_IMAGE_BMP_8 FALSE - #define GDISP_NEED_IMAGE_BMP_8_RLE FALSE - #define GDISP_NEED_IMAGE_BMP_16 FALSE #define GDISP_NEED_IMAGE_BMP_24 TRUE - #define GDISP_NEED_IMAGE_BMP_32 FALSE - #define GDISP_NEED_IMAGE_JPG FALSE - #define GDISP_NEED_IMAGE_PNG FALSE - #define GDISP_NEED_IMAGE_ACCOUNTING FALSE - -#define GDISP_NEED_STARTUP_LOGO TRUE #define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE -#define GDISP_LINEBUF_SIZE 128 - -#define GDISP_TOTAL_DISPLAYS 1 - #if GDISP_TOTAL_DISPLAYS > 1 - #define GDISP_HARDWARE_STREAM_WRITE FALSE - #define GDISP_HARDWARE_STREAM_READ FALSE - #define GDISP_HARDWARE_STREAM_POS FALSE - #define GDISP_HARDWARE_DRAWPIXEL FALSE - #define GDISP_HARDWARE_CLEARS FALSE - #define GDISP_HARDWARE_FILLS FALSE - #define GDISP_HARDWARE_BITFILLS FALSE - #define GDISP_HARDWARE_SCROLL FALSE - #define GDISP_HARDWARE_PIXELREAD FALSE - #define GDISP_HARDWARE_CONTROL FALSE - #define GDISP_HARDWARE_QUERY FALSE - #define GDISP_HARDWARE_CLIP FALSE - #endif - -#define GDISP_TOTAL_CONTROLLERS 1 - #if GDISP_TOTAL_CONTROLLERS > 1 - #define GDISP_CONTROLLER_LIST GDISPVMT_Win32, GDISPVMT_Win32 - #define GDISP_CONTROLLER_DISPLAYS 1, 1 - #define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888 - #endif - -#define GDISP_USE_GFXNET FALSE - #define GDISP_GFXNET_PORT 13001 - #define GDISP_GFXNET_CUSTOM_LWIP_STARTUP FALSE - #define GDISP_DONT_WAIT_FOR_NET_DISPLAY FALSE - #define GDISP_GFXNET_UNSAFE_SOCKETS FALSE - /////////////////////////////////////////////////////////////////////////// // GWIN // @@ -125,27 +52,9 @@ #define GWIN_NEED_WINDOWMANAGER TRUE -#define GWIN_NEED_CONSOLE FALSE - #define GWIN_CONSOLE_USE_HISTORY FALSE - #define GWIN_CONSOLE_HISTORY_AVERAGING FALSE - #define GWIN_CONSOLE_HISTORY_ATCREATE FALSE - #define GWIN_CONSOLE_ESCSEQ FALSE - #define GWIN_CONSOLE_USE_BASESTREAM FALSE - #define GWIN_CONSOLE_USE_FLOAT FALSE -#define GWIN_NEED_GRAPH FALSE - #define GWIN_NEED_WIDGET TRUE - #define GWIN_NEED_LABEL FALSE - #define GWIN_NEED_BUTTON FALSE - #define GWIN_BUTTON_LAZY_RELEASE FALSE - #define GWIN_NEED_SLIDER FALSE - #define GWIN_NEED_CHECKBOX FALSE #define GWIN_NEED_IMAGE TRUE #define GWIN_NEED_IMAGE_ANIMATION TRUE - #define GWIN_NEED_RADIO FALSE - #define GWIN_NEED_LIST FALSE - #define GWIN_NEED_LIST_IMAGES FALSE - #define GWIN_NEED_PROGRESSBAR FALSE /////////////////////////////////////////////////////////////////////////// @@ -153,29 +62,16 @@ /////////////////////////////////////////////////////////////////////////// #define GFX_USE_GEVENT TRUE -#define GEVENT_ASSERT_NO_RESOURCE FALSE -#define GEVENT_MAXIMUM_SIZE 32 -#define GEVENT_MAX_SOURCE_LISTENERS 32 - - /////////////////////////////////////////////////////////////////////////// // GTIMER // /////////////////////////////////////////////////////////////////////////// #define GFX_USE_GTIMER TRUE -#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY -#define GTIMER_THREAD_WORKAREA_SIZE 2048 - - /////////////////////////////////////////////////////////////////////////// // GQUEUE // /////////////////////////////////////////////////////////////////////////// #define GFX_USE_GQUEUE TRUE - #define GQUEUE_NEED_ASYNC TRUE -#define GQUEUE_NEED_GSYNC FALSE -#define GQUEUE_NEED_FSYNC FALSE -#define GQUEUE_NEED_BUFFERS FALSE /////////////////////////////////////////////////////////////////////////// // GINPUT // @@ -183,59 +79,12 @@ #define GFX_USE_GINPUT TRUE #define GINPUT_NEED_MOUSE TRUE -#define GINPUT_NEED_KEYBOARD FALSE -#define GINPUT_NEED_TOGGLE FALSE -#define GINPUT_NEED_DIAL FALSE - /////////////////////////////////////////////////////////////////////////// // GFILE // /////////////////////////////////////////////////////////////////////////// #define GFX_USE_GFILE TRUE -#define GFILE_NEED_PRINTG FALSE -#define GFILE_NEED_SCANG FALSE -#define GFILE_NEED_STRINGS FALSE -#define GFILE_NEED_STDIO FALSE - #define GFILE_ALLOW_FLOATS FALSE - #define GFILE_ALLOW_DEVICESPECIFIC FALSE - #define GFILE_MAX_GFILES 3 - -#define GFILE_NEED_MEMFS FALSE #define GFILE_NEED_ROMFS TRUE -#define GFILE_NEED_RAMFS FALSE -#define GFILE_NEED_FATFS FALSE -#define GFILE_NEED_NATIVEFS FALSE -#define GFILE_NEED_CHBIOSFS FALSE - - -/////////////////////////////////////////////////////////////////////////// -// GADC // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GADC FALSE - -#define GADC_MAX_LOWSPEED_DEVICES 4 - - -/////////////////////////////////////////////////////////////////////////// -// GAUDIO // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GAUDIO FALSE - #define GAUDIO_NEED_PLAY FALSE - #define GAUDIO_NEED_RECORD FALSE - - -/////////////////////////////////////////////////////////////////////////// -// GMISC // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GMISC FALSE - -#define GMISC_NEED_ARRAYOPS FALSE -#define GMISC_NEED_FASTTRIG FALSE -#define GMISC_NEED_FIXEDTRIG FALSE -#define GMISC_NEED_INVSQRT FALSE - #define GMISC_INVSQRT_MIXED_ENDIAN FALSE - #define GMISC_INVSQRT_REAL_SLOW FALSE - #endif /* _GFXCONF_H */ diff --git a/demos/modules/gwin/label/gfxconf.h b/demos/modules/gwin/label/gfxconf.h index 59ba809e..568ea4fe 100644 --- a/demos/modules/gwin/label/gfxconf.h +++ b/demos/modules/gwin/label/gfxconf.h @@ -24,98 +24,20 @@ //#define GFX_USE_OS_LINUX TRUE //#define GFX_USE_OS_OSX TRUE - /////////////////////////////////////////////////////////////////////////// // GDISP // /////////////////////////////////////////////////////////////////////////// #define GFX_USE_GDISP TRUE -#define GDISP_NEED_AUTOFLUSH FALSE -#define GDISP_NEED_TIMERFLUSH FALSE +//#define GDISP_NEED_AUTOFLUSH FALSE +//#define GDISP_NEED_TIMERFLUSH FALSE #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_CIRCLE FALSE -#define GDISP_NEED_ELLIPSE FALSE -#define GDISP_NEED_ARC FALSE -#define GDISP_NEED_CONVEX_POLYGON FALSE -#define GDISP_NEED_SCROLL FALSE -#define GDISP_NEED_PIXELREAD FALSE -#define GDISP_NEED_CONTROL FALSE -#define GDISP_NEED_QUERY FALSE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_STREAMING FALSE #define GDISP_NEED_TEXT TRUE #define GDISP_NEED_ANTIALIAS TRUE #define GDISP_NEED_UTF8 TRUE #define GDISP_NEED_TEXT_KERNING TRUE - #define GDISP_INCLUDE_FONT_UI1 FALSE - #define GDISP_INCLUDE_FONT_UI2 FALSE - #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS10 FALSE #define GDISP_INCLUDE_FONT_DEJAVUSANS12 TRUE - #define GDISP_INCLUDE_FONT_DEJAVUSANS16 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS24 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS32 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12 FALSE - #define GDISP_INCLUDE_FONT_FIXED_10X20 FALSE - #define GDISP_INCLUDE_FONT_FIXED_7X14 FALSE - #define GDISP_INCLUDE_FONT_FIXED_5X8 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA FALSE - #define GDISP_INCLUDE_USER_FONTS FALSE - -#define GDISP_NEED_IMAGE FALSE - #define GDISP_NEED_IMAGE_NATIVE FALSE - #define GDISP_NEED_IMAGE_GIF FALSE - #define GDISP_NEED_IMAGE_BMP FALSE - #define GDISP_NEED_IMAGE_BMP_1 FALSE - #define GDISP_NEED_IMAGE_BMP_4 FALSE - #define GDISP_NEED_IMAGE_BMP_4_RLE FALSE - #define GDISP_NEED_IMAGE_BMP_8 FALSE - #define GDISP_NEED_IMAGE_BMP_8_RLE FALSE - #define GDISP_NEED_IMAGE_BMP_16 FALSE - #define GDISP_NEED_IMAGE_BMP_24 FALSE - #define GDISP_NEED_IMAGE_BMP_32 FALSE - #define GDISP_NEED_IMAGE_JPG FALSE - #define GDISP_NEED_IMAGE_PNG FALSE - #define GDISP_NEED_IMAGE_ACCOUNTING FALSE - -#define GDISP_NEED_STARTUP_LOGO FALSE - -#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE -#define GDISP_LINEBUF_SIZE 128 - -#define GDISP_TOTAL_DISPLAYS 1 - #if GDISP_TOTAL_DISPLAYS > 1 - #define GDISP_HARDWARE_STREAM_WRITE FALSE - #define GDISP_HARDWARE_STREAM_READ FALSE - #define GDISP_HARDWARE_STREAM_POS FALSE - #define GDISP_HARDWARE_DRAWPIXEL FALSE - #define GDISP_HARDWARE_CLEARS FALSE - #define GDISP_HARDWARE_FILLS FALSE - #define GDISP_HARDWARE_BITFILLS FALSE - #define GDISP_HARDWARE_SCROLL FALSE - #define GDISP_HARDWARE_PIXELREAD FALSE - #define GDISP_HARDWARE_CONTROL FALSE - #define GDISP_HARDWARE_QUERY FALSE - #define GDISP_HARDWARE_CLIP FALSE - #endif - -#define GDISP_TOTAL_CONTROLLERS 1 - #if GDISP_TOTAL_CONTROLLERS > 1 - #define GDISP_CONTROLLER_LIST GDISPVMT_Win32, GDISPVMT_Win32 - #define GDISP_CONTROLLER_DISPLAYS 1, 1 - #define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888 - #endif - -#define GDISP_USE_GFXNET FALSE - #define GDISP_GFXNET_PORT 13001 - #define GDISP_GFXNET_CUSTOM_LWIP_STARTUP FALSE - #define GDISP_DONT_WAIT_FOR_NET_DISPLAY FALSE - #define GDISP_GFXNET_UNSAFE_SOCKETS FALSE /////////////////////////////////////////////////////////////////////////// @@ -125,59 +47,25 @@ #define GWIN_NEED_WINDOWMANAGER TRUE -#define GWIN_NEED_CONSOLE FALSE - #define GWIN_CONSOLE_USE_HISTORY FALSE - #define GWIN_CONSOLE_HISTORY_AVERAGING FALSE - #define GWIN_CONSOLE_HISTORY_ATCREATE FALSE - #define GWIN_CONSOLE_ESCSEQ FALSE - #define GWIN_CONSOLE_USE_BASESTREAM FALSE - #define GWIN_CONSOLE_USE_FLOAT FALSE -#define GWIN_NEED_GRAPH FALSE -#define GWIN_NEED_WIDGET FALSE - #define GWIN_NEED_HIERARCHY FALSE #define GWIN_NEED_LABEL TRUE #define GWIN_LABEL_ATTRIBUTE TRUE - #define GWIN_NEED_BUTTON FALSE - #define GWIN_BUTTON_LAZY_RELEASE FALSE - #define GWIN_NEED_SLIDER FALSE - #define GWIN_NEED_CHECKBOX FALSE - #define GWIN_NEED_IMAGE FALSE - #define GWIN_NEED_IMAGE_ANIMATION FALSE - #define GWIN_NEED_RADIO FALSE - #define GWIN_NEED_LIST FALSE - #define GWIN_NEED_LIST_IMAGES FALSE - #define GWIN_NEED_PROGRESSBAR FALSE - #define GWIN_NEED_FRAME FALSE - /////////////////////////////////////////////////////////////////////////// // GEVENT // /////////////////////////////////////////////////////////////////////////// #define GFX_USE_GEVENT TRUE -#define GEVENT_ASSERT_NO_RESOURCE FALSE -#define GEVENT_MAXIMUM_SIZE 32 -#define GEVENT_MAX_SOURCE_LISTENERS 32 - - /////////////////////////////////////////////////////////////////////////// // GTIMER // /////////////////////////////////////////////////////////////////////////// #define GFX_USE_GTIMER TRUE -#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY -#define GTIMER_THREAD_WORKAREA_SIZE 2048 - - /////////////////////////////////////////////////////////////////////////// // GQUEUE // /////////////////////////////////////////////////////////////////////////// #define GFX_USE_GQUEUE TRUE #define GQUEUE_NEED_ASYNC TRUE -#define GQUEUE_NEED_GSYNC FALSE -#define GQUEUE_NEED_FSYNC FALSE -#define GQUEUE_NEED_BUFFERS FALSE /////////////////////////////////////////////////////////////////////////// // GINPUT // @@ -185,59 +73,5 @@ #define GFX_USE_GINPUT TRUE #define GINPUT_NEED_MOUSE TRUE -#define GINPUT_NEED_KEYBOARD FALSE -#define GINPUT_NEED_TOGGLE FALSE -#define GINPUT_NEED_DIAL FALSE - - -/////////////////////////////////////////////////////////////////////////// -// GFILE // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GFILE FALSE - -#define GFILE_NEED_PRINTG FALSE -#define GFILE_NEED_SCANG FALSE -#define GFILE_NEED_STRINGS FALSE -#define GFILE_NEED_STDIO FALSE - #define GFILE_ALLOW_FLOATS FALSE - #define GFILE_ALLOW_DEVICESPECIFIC FALSE - #define GFILE_MAX_GFILES 3 - -#define GFILE_NEED_MEMFS FALSE -#define GFILE_NEED_ROMFS FALSE -#define GFILE_NEED_RAMFS FALSE -#define GFILE_NEED_FATFS FALSE -#define GFILE_NEED_NATIVEFS FALSE -#define GFILE_NEED_CHBIOSFS FALSE - - -/////////////////////////////////////////////////////////////////////////// -// GADC // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GADC FALSE - -#define GADC_MAX_LOWSPEED_DEVICES 4 - - -/////////////////////////////////////////////////////////////////////////// -// GAUDIO // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GAUDIO FALSE - #define GAUDIO_NEED_PLAY FALSE - #define GAUDIO_NEED_RECORD FALSE - - -/////////////////////////////////////////////////////////////////////////// -// GMISC // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GMISC FALSE - -#define GMISC_NEED_ARRAYOPS FALSE -#define GMISC_NEED_FASTTRIG FALSE -#define GMISC_NEED_FIXEDTRIG FALSE -#define GMISC_NEED_INVSQRT FALSE - #define GMISC_INVSQRT_MIXED_ENDIAN FALSE - #define GMISC_INVSQRT_REAL_SLOW FALSE - #endif /* _GFXCONF_H */ -- cgit v1.2.3 From ffa03cb57042e9460f6193e5a284a3760b1b348f Mon Sep 17 00:00:00 2001 From: inmarket Date: Wed, 17 Sep 2014 08:43:11 +1000 Subject: SImplify the options for multiple displays. This will also be more compatible with newmouse infrastructure --- demos/modules/gdisp/multiple_displays/gfxconf.h | 28 ++++++++++++++----------- demos/modules/gdisp/multiple_displays/main.c | 10 +++++---- 2 files changed, 22 insertions(+), 16 deletions(-) (limited to 'demos') diff --git a/demos/modules/gdisp/multiple_displays/gfxconf.h b/demos/modules/gdisp/multiple_displays/gfxconf.h index 60467f93..959f1d0b 100644 --- a/demos/modules/gdisp/multiple_displays/gfxconf.h +++ b/demos/modules/gdisp/multiple_displays/gfxconf.h @@ -46,16 +46,20 @@ #define GDISP_INCLUDE_FONT_UI2 TRUE -#define GDISP_TOTAL_DISPLAYS 2 - -/* Uncomment the following lines if you want to use multiple displays on - * different controllers. +/* You must either define GDISP_TOTAL_DISPLAYS or GDISP_DRIVER_LIST for multiple displays. + * You cannot define both! + * + * Defining GDISP_TOTAL_DISPLAYS will create multiple instances of the one default driver. + * Defining GDISP_DRIVER_LIST allows you to specify multiple different drivers. * - * Change the definitions to suit your hardware. - * Currently all controllers must use the same pixel format. + * Extra Notes for GDISP_DRIVER_LIST: + *----------------------------------- * - * Remember that GDISP_TOTAL_DISPLAYS above must match the **Total** - * number of displays in your system across all controllers. + * The same controller can appear more than once in the list. + * + * You must specify a GDISP_PIXELFORMAT that the application will work in. This + * is translated into each drivers internal pixel format by the driver. You the + * pixel format that is most common accross your drivers (for efficiency). * * Optionally, you can also specify hardware characteristics that are common to * all your controllers. This significantly improves code and speed efficiency @@ -72,9 +76,9 @@ * #define GDISP_HARDWARE_DRAWPIXEL TRUE * #define GDISP_HARDWARE_FILLS TRUE */ -//#define GDISP_TOTAL_CONTROLLERS 2 -//#define GDISP_CONTROLLER_LIST GDISPVMT_Win32, GDISPVMT_Win32 -//#define GDISP_CONTROLLER_DISPLAYS 1, 1 -//#define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888 +#define GDISP_TOTAL_DISPLAYS 2 + +//#define GDISP_DRIVER_LIST GDISPVMT_Win32, GDISPVMT_Win32 +//#define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888 #endif /* _GFXCONF_H */ diff --git a/demos/modules/gdisp/multiple_displays/main.c b/demos/modules/gdisp/multiple_displays/main.c index 4e8a5a08..c4c37bed 100644 --- a/demos/modules/gdisp/multiple_displays/main.c +++ b/demos/modules/gdisp/multiple_displays/main.c @@ -46,7 +46,7 @@ #if USE_METHOD_1 int main(void) { coord_t width, height; - coord_t display, i, j; + coord_t display, i, j, cnt; font_t f; GDisplay *g; char buf[16]; @@ -58,7 +58,8 @@ f = gdispOpenFont("*"); /* Cycle through each display */ - for(display = 0; display < GDISP_TOTAL_DISPLAYS; display++) { + cnt = gdispGetDisplayCount(); + for(display = 0; display < cnt; display++) { // Get the specified display g = gdispGetDisplay(display); @@ -84,7 +85,7 @@ #else int main(void) { coord_t width, height; - coord_t display, i, j; + coord_t display, i, j, cnt; font_t f; char buf[16]; @@ -95,7 +96,8 @@ f = gdispOpenFont("*"); /* Cycle through each display */ - for(display = 0; display < GDISP_TOTAL_DISPLAYS; display++) { + cnt = gdispGetDisplayCount(); + for(display = 0; display < cnt; display++) { // Set the default display to the specified display gdispSetDisplay(gdispGetDisplay(display)); -- cgit v1.2.3 From e7bc175ca0fb1b1d2bd6a80d36696efa6dc0d171 Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 26 Sep 2014 16:30:53 +1000 Subject: Demos updated to remove now deprecated function gwinAttachMouse --- demos/modules/gwin/button/main.c | 5 +---- demos/modules/gwin/checkbox/main.c | 7 ++----- demos/modules/gwin/container/main.c | 5 +---- demos/modules/gwin/container_nested/main.c | 11 ++++------- demos/modules/gwin/frame/main.c | 7 ++----- demos/modules/gwin/label/main.c | 3 --- demos/modules/gwin/list/main.c | 3 --- demos/modules/gwin/radio/main.c | 3 --- demos/modules/gwin/slider/main.c | 3 --- demos/modules/gwin/widgets/main.c | 5 ----- 10 files changed, 10 insertions(+), 42 deletions(-) (limited to 'demos') diff --git a/demos/modules/gwin/button/main.c b/demos/modules/gwin/button/main.c index 15e8e5a7..1d8aa2e6 100644 --- a/demos/modules/gwin/button/main.c +++ b/demos/modules/gwin/button/main.c @@ -39,7 +39,7 @@ static void createWidgets(void) { gwinWidgetClearInit(&wi); wi.g.show = TRUE; - // Apply the button parameters + // Apply the button parameters wi.g.width = 100; wi.g.height = 30; wi.g.y = 10; @@ -67,9 +67,6 @@ int main(void) { gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gdispClear(White); - // Attach the mouse input - gwinAttachMouse(0); - // create the widget createWidgets(); diff --git a/demos/modules/gwin/checkbox/main.c b/demos/modules/gwin/checkbox/main.c index 28122bee..22963e40 100644 --- a/demos/modules/gwin/checkbox/main.c +++ b/demos/modules/gwin/checkbox/main.c @@ -39,14 +39,14 @@ static void createWidgets(void) { gwinWidgetClearInit(&wi); wi.g.show = TRUE; - // Apply the checkbox parameters + // Apply the checkbox parameters wi.g.width = 100; // includes text wi.g.height = 20; wi.g.y = 10; wi.g.x = 10; wi.text = "Checkbox"; - // Create the actual checkbox + // Create the actual checkbox ghCheckbox1 = gwinCheckboxCreate(0, &wi); } @@ -61,9 +61,6 @@ int main(void) { gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gdispClear(White); - // Attach the mouse input - gwinAttachMouse(0); - // create the widget createWidgets(); diff --git a/demos/modules/gwin/container/main.c b/demos/modules/gwin/container/main.c index 4e73b0c4..75e3f78b 100644 --- a/demos/modules/gwin/container/main.c +++ b/demos/modules/gwin/container/main.c @@ -19,7 +19,7 @@ static void createWidgets(void) { ghContainer = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); wi.g.show = TRUE; - // Apply the button parameters + // Apply the button parameters wi.g.width = 120; wi.g.height = 30; wi.g.y = 10; @@ -37,9 +37,6 @@ int main(void) { // Initialize the display gfxInit(); - // Attach the mouse input - gwinAttachMouse(0); - // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); diff --git a/demos/modules/gwin/container_nested/main.c b/demos/modules/gwin/container_nested/main.c index 2d90f76b..5cd5e793 100644 --- a/demos/modules/gwin/container_nested/main.c +++ b/demos/modules/gwin/container_nested/main.c @@ -40,7 +40,7 @@ static void createWidgets(void) { wi.text = "Container 3"; ghContainer3 = gwinContainerCreate(0, &wi, GWIN_CONTAINER_BORDER); - // Button 1 + // Button 1 wi.g.width = 80; wi.g.height = 20; wi.g.y = 10; @@ -49,7 +49,7 @@ static void createWidgets(void) { wi.g.parent = ghContainer2; ghButton1 = gwinButtonCreate(0, &wi); - // Button 2 + // Button 2 wi.g.width = 80; wi.g.height = 20; wi.g.y = 40; @@ -58,7 +58,7 @@ static void createWidgets(void) { wi.g.parent = ghContainer2; ghButton2 = gwinButtonCreate(0, &wi); - // Button 3 + // Button 3 wi.g.width = 80; wi.g.height = 20; wi.g.y = 10; @@ -67,7 +67,7 @@ static void createWidgets(void) { wi.g.parent = ghContainer3; ghButton3 = gwinButtonCreate(0, &wi); - // Button 4 + // Button 4 wi.g.width = 80; wi.g.height = 20; wi.g.y = 40; @@ -115,9 +115,6 @@ int main(void) { // Initialize the display gfxInit(); - // Attach the mouse input - gwinAttachMouse(0); - // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); diff --git a/demos/modules/gwin/frame/main.c b/demos/modules/gwin/frame/main.c index fe956925..a97525ab 100644 --- a/demos/modules/gwin/frame/main.c +++ b/demos/modules/gwin/frame/main.c @@ -33,7 +33,7 @@ static void _createWidgets(void) { wi.text = "Surprise!"; gwinLabelCreate(0, &wi); - // Apply the frame parameters + // Apply the frame parameters wi.g.width = 300; wi.g.height = 200; wi.g.y = 10; @@ -107,7 +107,7 @@ static void _createWidgets(void) { wi.g.x = 10; wi.g.y = 90; ghWindow1 = gwinWindowCreate(0, &wi.g); - + _updateColor(); } @@ -117,9 +117,6 @@ int main(void) { // Initialize the display gfxInit(); - // Attach the mouse input - gwinAttachMouse(0); - // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("*")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); diff --git a/demos/modules/gwin/label/main.c b/demos/modules/gwin/label/main.c index aab9cd76..425436ea 100644 --- a/demos/modules/gwin/label/main.c +++ b/demos/modules/gwin/label/main.c @@ -63,9 +63,6 @@ int main(void) { gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gdispClear(White); - // Attach the mouse input - gwinAttachMouse(0); - // create the widget createWidgets(); diff --git a/demos/modules/gwin/list/main.c b/demos/modules/gwin/list/main.c index ed5b6905..0102f276 100644 --- a/demos/modules/gwin/list/main.c +++ b/demos/modules/gwin/list/main.c @@ -79,9 +79,6 @@ int main(void) { gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gdispClear(White); - // Attach the mouse input - gwinAttachMouse(0); - // create the widget createWidgets(); diff --git a/demos/modules/gwin/radio/main.c b/demos/modules/gwin/radio/main.c index 7455c770..59b86983 100644 --- a/demos/modules/gwin/radio/main.c +++ b/demos/modules/gwin/radio/main.c @@ -83,9 +83,6 @@ int main(void) { gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gdispClear(White); - // Attach the mouse input - gwinAttachMouse(0); - // create the widget createWidgets(); diff --git a/demos/modules/gwin/slider/main.c b/demos/modules/gwin/slider/main.c index ddcd90df..bf0aacfc 100644 --- a/demos/modules/gwin/slider/main.c +++ b/demos/modules/gwin/slider/main.c @@ -59,9 +59,6 @@ int main(void) { gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); gdispClear(White); - // Attach the mouse input - gwinAttachMouse(0); - // create the widget createWidgets(); diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c index 3239ab4c..d2f6882b 100644 --- a/demos/modules/gwin/widgets/main.c +++ b/demos/modules/gwin/widgets/main.c @@ -418,11 +418,6 @@ int main(void) { // Initialize the display gfxInit(); - // Connect the mouse - #if GINPUT_NEED_MOUSE - gwinAttachMouse(0); - #endif - // Set the widget defaults font = gdispOpenFont("*"); // Get the first defined font. gwinSetDefaultFont(font); -- cgit v1.2.3 From 08292eb7d0a0f71e222ae5e4f3fd0a7619bf29c6 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Tue, 28 Oct 2014 00:10:19 +0100 Subject: Simplifying gdisp/arcsectors demo to only use the GDISP module --- demos/modules/gdisp/arcsectors/gfxconf.h | 4 ---- demos/modules/gdisp/arcsectors/main.c | 26 ++++++-------------------- 2 files changed, 6 insertions(+), 24 deletions(-) (limited to 'demos') diff --git a/demos/modules/gdisp/arcsectors/gfxconf.h b/demos/modules/gdisp/arcsectors/gfxconf.h index 49470b2f..df6d85c0 100644 --- a/demos/modules/gdisp/arcsectors/gfxconf.h +++ b/demos/modules/gdisp/arcsectors/gfxconf.h @@ -38,15 +38,11 @@ /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE -#define GFX_USE_GINPUT TRUE -#define GFX_USE_GEVENT TRUE -#define GFX_USE_GTIMER TRUE /* Features for the GDISP subsystem. */ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_ARCSECTORS TRUE -#define GINPUT_NEED_MOUSE TRUE #endif /* _GFXCONF_H */ diff --git a/demos/modules/gdisp/arcsectors/main.c b/demos/modules/gdisp/arcsectors/main.c index 9d282207..9908523f 100644 --- a/demos/modules/gdisp/arcsectors/main.c +++ b/demos/modules/gdisp/arcsectors/main.c @@ -29,12 +29,9 @@ #include "gfx.h" -GListener gl; - int main(void) { coord_t width, height, r1, r2, cx, cy; uint8_t sectors; - GEventMouse *pme; // Initialize and clear the display gfxInit(); @@ -42,35 +39,24 @@ int main(void) { // Get the screen size width = gdispGetWidth(); height = gdispGetHeight(); + + // Initialize some variables r1 = width > height ? height/3 : width/3; r2 = r1*3/4; cx = width/2; cy = height/2; sectors = 1; - // We want to listen for mouse button events - geventListenerInit(&gl); - geventAttachSource(&gl, ginputGetMouse(0), GLISTEN_MOUSEMETA); - while(1) { // Draw the arc sectors gdispClear(White); gdispDrawArcSectors(cx, cy, r1, sectors, Blue); gdispFillArcSectors(cx, cy, r2, sectors, Red); - // Get an Event - pme = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE); + // Increase the sectors counter + sectors++; - // Change our sectors based on the event. - switch(pme->type) { - case GEVENT_MOUSE: - case GEVENT_TOUCH: - if (pme->buttons & GMETA_MOUSE_CLICK) - sectors++; - else if (pme->buttons & GMETA_MOUSE_CXTCLICK) - sectors--; - break; - } + // Waste some time + gfxSleepMilliseconds(250); } } - -- cgit v1.2.3