diff --git a/demos/modules/gdisp/gdisp_basics/gfxconf.h b/demos/modules/gdisp/basics/gfxconf.h similarity index 79% rename from demos/modules/gdisp/gdisp_basics/gfxconf.h rename to demos/modules/gdisp/basics/gfxconf.h index 8adc7c8d..ff365590 100644 --- a/demos/modules/gdisp/gdisp_basics/gfxconf.h +++ b/demos/modules/gdisp/basics/gfxconf.h @@ -31,9 +31,10 @@ #define _GFXCONF_H /* The operating system to use - one of these must be defined */ -//#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_POSIX FALSE +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE @@ -41,15 +42,6 @@ /* Features for the GDISP sub-system. */ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT FALSE -#define GDISP_NEED_CIRCLE FALSE -#define GDISP_NEED_ELLIPSE FALSE -#define GDISP_NEED_ARC FALSE -#define GDISP_NEED_SCROLL FALSE -#define GDISP_NEED_PIXELREAD FALSE -#define GDISP_NEED_CONTROL FALSE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gdisp/gdisp_basics/main.c b/demos/modules/gdisp/basics/main.c similarity index 94% rename from demos/modules/gdisp/gdisp_basics/main.c rename to demos/modules/gdisp/basics/main.c index f875028b..48d4a652 100644 --- a/demos/modules/gdisp/gdisp_basics/main.c +++ b/demos/modules/gdisp/basics/main.c @@ -33,7 +33,7 @@ int main(void) { coord_t width, height; coord_t i, j; - /* Initialize and clear the display */ + // Initialize and clear the display gfxInit(); // Get the screen size @@ -46,7 +46,7 @@ int main(void) { gdispDrawLine(5, 30, width-50, height-40, Red); for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20) - gdispDrawPixel (i, j, White); + gdispDrawPixel(i, j, White); while(TRUE) { gfxSleepMilliseconds(500); diff --git a/demos/modules/gdisp/gdisp_circles/gfxconf.h b/demos/modules/gdisp/circles/gfxconf.h similarity index 82% rename from demos/modules/gdisp/gdisp_circles/gfxconf.h rename to demos/modules/gdisp/circles/gfxconf.h index 8858cf02..cb698fce 100644 --- a/demos/modules/gdisp/gdisp_circles/gfxconf.h +++ b/demos/modules/gdisp/circles/gfxconf.h @@ -31,29 +31,25 @@ #define _GFXCONF_H /* The operating system to use - one of these must be defined */ -//#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_POSIX FALSE +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE +#define GFX_USE_GMISC TRUE -/* Features for the GDISP sub-system. */ +/* Features for the GDISP subsystem. */ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT FALSE #define GDISP_NEED_CIRCLE TRUE #define GDISP_NEED_ELLIPSE TRUE #define GDISP_NEED_ARC TRUE -#define GDISP_NEED_SCROLL FALSE -#define GDISP_NEED_PIXELREAD FALSE -#define GDISP_NEED_CONTROL FALSE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE -#define GFX_USE_GMISC TRUE +/* Features for the GMISC subsystem */ #define GMISC_NEED_FIXEDTRIG TRUE #define GMISC_NEED_FASTTRIG TRUE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gdisp/gdisp_circles/main.c b/demos/modules/gdisp/circles/main.c similarity index 95% rename from demos/modules/gdisp/gdisp_circles/main.c rename to demos/modules/gdisp/circles/main.c index b8b90478..9253439d 100644 --- a/demos/modules/gdisp/gdisp_circles/main.c +++ b/demos/modules/gdisp/circles/main.c @@ -32,7 +32,7 @@ int main(void) { coord_t width, height; - /* Initialize and clear the display */ + // Initialize and clear the display gfxInit(); // Get the screen size diff --git a/demos/modules/gdisp/gdisp_fonts/font_Apple12.h b/demos/modules/gdisp/fonts/font_Apple12.h similarity index 100% rename from demos/modules/gdisp/gdisp_fonts/font_Apple12.h rename to demos/modules/gdisp/fonts/font_Apple12.h diff --git a/demos/modules/gdisp/gdisp_fonts/font_FreePixel10.h b/demos/modules/gdisp/fonts/font_FreePixel10.h similarity index 100% rename from demos/modules/gdisp/gdisp_fonts/font_FreePixel10.h rename to demos/modules/gdisp/fonts/font_FreePixel10.h diff --git a/demos/modules/gdisp/gdisp_fonts/font_GeosansLight11.h b/demos/modules/gdisp/fonts/font_GeosansLight11.h similarity index 100% rename from demos/modules/gdisp/gdisp_fonts/font_GeosansLight11.h rename to demos/modules/gdisp/fonts/font_GeosansLight11.h diff --git a/demos/modules/gdisp/gdisp_fonts/font_GeosansLight11_aa.h b/demos/modules/gdisp/fonts/font_GeosansLight11_aa.h similarity index 100% rename from demos/modules/gdisp/gdisp_fonts/font_GeosansLight11_aa.h rename to demos/modules/gdisp/fonts/font_GeosansLight11_aa.h diff --git a/demos/modules/gdisp/gdisp_fonts/font_babyblue11_aa.h b/demos/modules/gdisp/fonts/font_babyblue11_aa.h similarity index 100% rename from demos/modules/gdisp/gdisp_fonts/font_babyblue11_aa.h rename to demos/modules/gdisp/fonts/font_babyblue11_aa.h diff --git a/demos/modules/gdisp/gdisp_fonts/font_hellovetica11.h b/demos/modules/gdisp/fonts/font_hellovetica11.h similarity index 100% rename from demos/modules/gdisp/gdisp_fonts/font_hellovetica11.h rename to demos/modules/gdisp/fonts/font_hellovetica11.h diff --git a/demos/modules/gdisp/gdisp_fonts/font_hellovetica11_aa.h b/demos/modules/gdisp/fonts/font_hellovetica11_aa.h similarity index 100% rename from demos/modules/gdisp/gdisp_fonts/font_hellovetica11_aa.h rename to demos/modules/gdisp/fonts/font_hellovetica11_aa.h diff --git a/demos/modules/gdisp/gdisp_fonts/font_pf_ronda_seven11_aa.h b/demos/modules/gdisp/fonts/font_pf_ronda_seven11_aa.h similarity index 100% rename from demos/modules/gdisp/gdisp_fonts/font_pf_ronda_seven11_aa.h rename to demos/modules/gdisp/fonts/font_pf_ronda_seven11_aa.h diff --git a/demos/modules/gdisp/gdisp_fonts/gfxconf.h b/demos/modules/gdisp/fonts/gfxconf.h similarity index 95% rename from demos/modules/gdisp/gdisp_fonts/gfxconf.h rename to demos/modules/gdisp/fonts/gfxconf.h index a0bba31c..ffb3a7e7 100644 --- a/demos/modules/gdisp/gdisp_fonts/gfxconf.h +++ b/demos/modules/gdisp/fonts/gfxconf.h @@ -31,9 +31,10 @@ #define _GFXCONF_H /* The operating system to use - one of these must be defined */ -//#define GFX_USE_OS_CHIBIOS FALSE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_POSIX FALSE +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE @@ -73,6 +74,5 @@ #define GDISP_INCLUDE_FONT_UI2 TRUE #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE -#define GDISP_INCLUDE_USER_FONTS TRUE - #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gdisp/gdisp_fonts/main.c b/demos/modules/gdisp/fonts/main.c similarity index 98% rename from demos/modules/gdisp/gdisp_fonts/main.c rename to demos/modules/gdisp/fonts/main.c index e9cdf003..0384b737 100644 --- a/demos/modules/gdisp/gdisp_fonts/main.c +++ b/demos/modules/gdisp/fonts/main.c @@ -36,7 +36,7 @@ int main(void) { const char *line1, *line2; char buf[8]; - /* Initialize and clear the display */ + // Initialize and clear the display gfxInit(); // Get the screen size diff --git a/demos/modules/gdisp/gdisp_fonts/userfonts.h b/demos/modules/gdisp/fonts/userfonts.h similarity index 100% rename from demos/modules/gdisp/gdisp_fonts/userfonts.h rename to demos/modules/gdisp/fonts/userfonts.h diff --git a/demos/modules/gdisp/fonts_cyrillic/gfxconf.h b/demos/modules/gdisp/fonts_cyrillic/gfxconf.h new file mode 100644 index 00000000..713c89b4 --- /dev/null +++ b/demos/modules/gdisp/fonts_cyrillic/gfxconf.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu + * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _GFXCONF_H +#define _GFXCONF_H + +/* The operating system to use - one of these must be defined */ +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE + +/* GFX subsystems to turn on */ +#define GFX_USE_GDISP TRUE + +/* Features for the GDISP subsystem */ +#define GDISP_NEED_VALIDATION TRUE +#define GDISP_NEED_CLIP TRUE +#define GDISP_NEED_TEXT TRUE +#define GDISP_NEED_CIRCLE TRUE +#define GDISP_NEED_ELLIPSE TRUE +#define GDISP_NEED_ANTIALIAS TRUE +#define GDISP_NEED_UTF8 TRUE +#define GDISP_NEED_TEXT_KERNING TRUE + +/* GDISP - fonts to include */ +#define GDISP_INCLUDE_USER_FONTS TRUE + +#endif /* _GFXCONF_H */ + diff --git a/demos/modules/gdisp/fonts_cyrillic/main.c b/demos/modules/gdisp/fonts_cyrillic/main.c new file mode 100644 index 00000000..bd504722 --- /dev/null +++ b/demos/modules/gdisp/fonts_cyrillic/main.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu + * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "gfx.h" + +int main(void) { + font_t font1; + + // Initialize uGFX and the underlying system + gfxInit(); + + // Get the fonts we want to use + font1 = gdispOpenFont("Archangelsk Regular 12"); + + // Demonstrate our other fonts + gdispDrawString(10, 10, "привет мир", font1, Yellow); + + // Wait forever + while(TRUE) { + gfxSleepMilliseconds(500); + } +} + diff --git a/demos/modules/gdisp/gdisp_fonts_cyrillic/userfonts.h b/demos/modules/gdisp/fonts_cyrillic/userfonts.h similarity index 100% rename from demos/modules/gdisp/gdisp_fonts_cyrillic/userfonts.h rename to demos/modules/gdisp/fonts_cyrillic/userfonts.h diff --git a/demos/modules/gdisp/gdisp_fonts_cyrillic/gfxconf.h b/demos/modules/gdisp/gdisp_fonts_cyrillic/gfxconf.h deleted file mode 100644 index a282a5f8..00000000 --- a/demos/modules/gdisp/gdisp_fonts_cyrillic/gfxconf.h +++ /dev/null @@ -1,169 +0,0 @@ -/** - * This file has a different license to the rest of the GFX system. - * You can copy, modify and distribute this file as you see fit. - * You do not need to publish your source modifications to this file. - * The only thing you are not permitted to do is to relicense it - * under a different license. - */ - -/** - * Copy this file into your project directory and rename it as gfxconf.h - * Edit your copy to turn on the GFX features you want to use. - */ - -#ifndef _GFXCONF_H -#define _GFXCONF_H - -/* The operating system to use - one of these must be defined */ -//#define GFX_USE_OS_CHIBIOS FALSE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_LINUX FALSE -//#define GFX_USE_OS_OSX FALSE - -/* GFX subsystems to turn on */ -#define GFX_USE_GDISP TRUE -#define GFX_USE_TDISP FALSE -#define GFX_USE_GWIN FALSE -#define GFX_USE_GEVENT FALSE -#define GFX_USE_GTIMER FALSE -#define GFX_USE_GQUEUE FALSE -#define GFX_USE_GINPUT FALSE -#define GFX_USE_GADC FALSE -#define GFX_USE_GAUDIN FALSE -#define GFX_USE_GAUDOUT FALSE -#define GFX_USE_GMISC FALSE - -/* Features for the GDISP subsystem */ -#define GDISP_NEED_VALIDATION TRUE -#define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT TRUE -#define GDISP_NEED_CIRCLE TRUE -#define GDISP_NEED_ELLIPSE TRUE -#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_IMAGE FALSE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE -#define GDISP_NEED_ANTIALIAS TRUE -#define GDISP_NEED_UTF8 TRUE -#define GDISP_NEED_TEXT_KERNING TRUE - -/* GDISP - fonts to include */ -#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_FONT_UI1 FALSE -#define GDISP_INCLUDE_FONT_UI2 FALSE -#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE -#define GDISP_INCLUDE_USER_FONTS TRUE - -/* GDISP image decoders */ -#define GDISP_NEED_IMAGE_NATIVE FALSE -#define GDISP_NEED_IMAGE_GIF FALSE -#define GDISP_NEED_IMAGE_BMP FALSE -#define GDISP_NEED_IMAGE_JPG FALSE -#define GDISP_NEED_IMAGE_PNG FALSE -#define GDISP_NEED_IMAGE_ACCOUNTING FALSE - -/* Optional image support that can be turned off */ -/* - #define GDISP_NEED_IMAGE_BMP_1 TRUE - #define GDISP_NEED_IMAGE_BMP_4 TRUE - #define GDISP_NEED_IMAGE_BMP_4_RLE TRUE - #define GDISP_NEED_IMAGE_BMP_8 TRUE - #define GDISP_NEED_IMAGE_BMP_8_RLE TRUE - #define GDISP_NEED_IMAGE_BMP_16 TRUE - #define GDISP_NEED_IMAGE_BMP_24 TRUE - #define GDISP_NEED_IMAGE_BMP_32 TRUE -*/ - -/* Features for the TDISP subsystem. */ -#define TDISP_NEED_MULTITHREAD FALSE - -/* Features for the GWIN subsystem. */ -#define GWIN_NEED_WINDOWMANAGER FALSE -#define GWIN_NEED_CONSOLE FALSE -#define GWIN_NEED_GRAPH FALSE -#define GWIN_NEED_WIDGET FALSE -#define GWIN_NEED_BUTTON FALSE -#define GWIN_NEED_SLIDER FALSE -#define GWIN_NEED_CHECKBOX FALSE -#define GWIN_NEED_IMAGE FALSE -#define GWIN_NEED_RADIO FALSE -#define GWIN_NEED_LIST FALSE - -/* Features for the GEVENT subsystem. */ -#define GEVENT_ASSERT_NO_RESOURCE FALSE - -/* Features for the GTIMER subsystem. */ -/* NONE */ - -/* Features for the GQUEUE subsystem. */ -#define GQUEUE_NEED_ASYNC FALSE -#define GQUEUE_NEED_GSYNC FALSE -#define GQUEUE_NEED_FSYNC FALSE - -/* Features for the GINPUT subsystem. */ -#define GINPUT_NEED_MOUSE FALSE -#define GINPUT_NEED_KEYBOARD FALSE -#define GINPUT_NEED_TOGGLE FALSE -#define GINPUT_NEED_DIAL FALSE - -/* Features for the GADC subsystem. */ -/* NONE */ - -/* Features for the GAUDIN subsystem. */ -/* NONE */ - -/* Features for the GAUDOUT subsystem. */ -/* NONE */ - -/* Features for the GMISC subsystem. */ -#define GMISC_NEED_ARRAYOPS FALSE -#define GMISC_NEED_FASTTRIG FALSE -#define GMISC_NEED_FIXEDTRIG FALSE - -/* Optional Parameters for various subsystems */ -/* - #define GDISP_NEED_UTF8 FALSE - #define GDISP_NEED_TEXT_KERNING FALSE - #define GDISP_NEED_ANTIALIAS FALSE - #define GEVENT_MAXIMUM_SIZE 32 - #define GEVENT_MAX_SOURCE_LISTENERS 32 - #define GTIMER_THREAD_WORKAREA_SIZE 512 - #define GADC_MAX_LOWSPEED_DEVICES 4 - #define GWIN_BUTTON_LAZY_RELEASE FALSE - #define GWIN_CONSOLE_USE_BASESTREAM FALSE - #define GWIN_CONSOLE_USE_FLOAT FALSE - #define GWIN_NEED_IMAGE_ANIMATION FALSE -*/ - -/* Optional Low Level Driver Definitions */ -/* - #define GDISP_USE_CUSTOM_BOARD FALSE - #define GDISP_SCREEN_WIDTH 320 - #define GDISP_SCREEN_HEIGHT 240 - #define GDISP_USE_FSMC - #define GDISP_USE_GPIO - #define TDISP_COLUMNS 16 - #define TDISP_ROWS 2 -*/ - -#endif /* _GFXCONF_H */ diff --git a/demos/modules/gdisp/gdisp_fonts_cyrillic/main.c b/demos/modules/gdisp/gdisp_fonts_cyrillic/main.c deleted file mode 100644 index dd39a5d5..00000000 --- a/demos/modules/gdisp/gdisp_fonts_cyrillic/main.c +++ /dev/null @@ -1,20 +0,0 @@ -#include "gfx.h" - -int main(void) { - font_t font1; - - // Initialize uGFX and the underlying system - gfxInit(); - - // Get the fonts we want to use - font1 = gdispOpenFont("Archangelsk Regular 12"); - - // Demonstrate our other fonts - gdispDrawString(10, 10, "привет мир", font1, Yellow); - - // Wait forever - while(TRUE) { - gfxSleepMilliseconds(500); - } -} - diff --git a/demos/modules/gdisp/gdisp_images/results_650x493.png b/demos/modules/gdisp/gdisp_images/results_650x493.png deleted file mode 100644 index 66dcd6e3..00000000 Binary files a/demos/modules/gdisp/gdisp_images/results_650x493.png and /dev/null differ diff --git a/demos/modules/gdisp/gdisp_text/gfxconf.h b/demos/modules/gdisp/gdisp_text/gfxconf.h deleted file mode 100644 index 76127ef9..00000000 --- a/demos/modules/gdisp/gdisp_text/gfxconf.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu - * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _GFXCONF_H -#define _GFXCONF_H - -/* The operating system to use - one of these must be defined */ -//#define GFX_USE_OS_CHIBIOS FALSE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_POSIX FALSE - -/* GFX sub-systems to turn on */ -#define GFX_USE_GDISP TRUE - -/* Features for the GDISP sub-system. */ -#define GDISP_NEED_VALIDATION TRUE -#define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT TRUE -#define GDISP_NEED_CIRCLE FALSE -#define GDISP_NEED_ELLIPSE FALSE -#define GDISP_NEED_ARC FALSE -#define GDISP_NEED_SCROLL FALSE -#define GDISP_NEED_PIXELREAD FALSE -#define GDISP_NEED_CONTROL FALSE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE - -/* GDISP - fonts to include */ -#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_FONT_UI1 FALSE -#define GDISP_INCLUDE_FONT_UI2 TRUE -#define GDISP_INCLUDE_FONT_LARGENUMBERS TRUE - -#endif /* _GFXCONF_H */ diff --git a/demos/modules/gdisp/gdisp_text/main.c b/demos/modules/gdisp/gdisp_text/main.c deleted file mode 100644 index 7ea3405e..00000000 --- a/demos/modules/gdisp/gdisp_text/main.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu - * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "gfx.h" - -int main(void) { - coord_t width; - font_t font1, font2, font3, font4; - const char *msg; - - /* Initialize and clear the display */ - gfxInit(); - - // Get the screen size - width = gdispGetWidth(); - - // Get the fonts we want to use - font1 = gdispOpenFont("UI2"); - font2 = gdispOpenFont("UI2 Double"); - font3 = gdispOpenFont("UI2 Narrow"); - font4 = gdispOpenFont("LargeNumbers"); - - // Display large numbers on the right (measuring the string) - msg = "123456"; - gdispDrawString(width-gdispGetStringWidth(msg, font4)-3, 3, msg, font4, Green); - - // Display the font name under it. - msg = gdispGetFontName(font4); - gdispDrawString(width-gdispGetStringWidth(msg, font1)-3, 20, msg, font1, Green); - - // Demonstrate our other fonts - gdispDrawString(10, 10, "Writing with Font 'UI2'", font1, Yellow); - gdispFillString(10, 35, "Writing with Font 'UI2 Double'", font2, Red, White); - gdispDrawStringBox(0, 50, width, 40, "Writing with Font 'UI2 Narrow'", font3, Red, justifyCenter); - gdispFillStringBox(0, 90, width, 40, "Filled Centered", font3, Pink, Gray, justifyCenter); - - // Clean up the fonts - gdispCloseFont(font1); - gdispCloseFont(font2); - gdispCloseFont(font3); - gdispCloseFont(font4); - - // Wait forever - while(TRUE) { - gfxSleepMilliseconds(500); - } -} - diff --git a/demos/modules/gdisp/gdisp_images/gfxconf.h b/demos/modules/gdisp/images/gfxconf.h similarity index 75% rename from demos/modules/gdisp/gdisp_images/gfxconf.h rename to demos/modules/gdisp/images/gfxconf.h index 9e37988c..694bad28 100644 --- a/demos/modules/gdisp/gdisp_images/gfxconf.h +++ b/demos/modules/gdisp/images/gfxconf.h @@ -31,9 +31,10 @@ #define _GFXCONF_H /* The operating system to use - one of these must be defined */ -//#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_POSIX FALSE +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE @@ -41,25 +42,7 @@ /* Features for the GDISP sub-system. */ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT FALSE -#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_IMAGE TRUE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE - -/* Builtin Fonts */ -#define GDISP_INCLUDE_FONT_SMALL FALSE -#define GDISP_INCLUDE_FONT_LARGER FALSE -#define GDISP_INCLUDE_FONT_UI1 FALSE -#define GDISP_INCLUDE_FONT_UI2 FALSE -#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE /* GDISP image decoders */ #define GDISP_NEED_IMAGE_NATIVE FALSE @@ -69,3 +52,4 @@ #define GDISP_NEED_IMAGE_PNG FALSE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gdisp/gdisp_images/main.c b/demos/modules/gdisp/images/main.c similarity index 97% rename from demos/modules/gdisp/gdisp_images/main.c rename to demos/modules/gdisp/images/main.c index c581f942..b87f663c 100644 --- a/demos/modules/gdisp/gdisp_images/main.c +++ b/demos/modules/gdisp/images/main.c @@ -44,7 +44,8 @@ static gdispImage myImage; int main(void) { coord_t swidth, sheight; - gfxInit(); // Initialize the display + // Initialize uGFX and the underlying system + gfxInit(); // Get the display dimensions swidth = gdispGetWidth(); @@ -67,3 +68,4 @@ int main(void) { return 0; } + diff --git a/demos/modules/gdisp/gdisp_images/test-pal8.bmp b/demos/modules/gdisp/images/test-pal8.bmp similarity index 100% rename from demos/modules/gdisp/gdisp_images/test-pal8.bmp rename to demos/modules/gdisp/images/test-pal8.bmp diff --git a/demos/modules/gdisp/gdisp_images/test-pal8.h b/demos/modules/gdisp/images/test-pal8.h similarity index 100% rename from demos/modules/gdisp/gdisp_images/test-pal8.h rename to demos/modules/gdisp/images/test-pal8.h diff --git a/demos/modules/gdisp/gdisp_images_animated/gfxconf.h b/demos/modules/gdisp/images_animated/gfxconf.h similarity index 74% rename from demos/modules/gdisp/gdisp_images_animated/gfxconf.h rename to demos/modules/gdisp/images_animated/gfxconf.h index ab91a9e7..e0158441 100644 --- a/demos/modules/gdisp/gdisp_images_animated/gfxconf.h +++ b/demos/modules/gdisp/images_animated/gfxconf.h @@ -31,9 +31,10 @@ #define _GFXCONF_H /* The operating system to use - one of these must be defined */ -//#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_POSIX FALSE +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE @@ -41,25 +42,7 @@ /* Features for the GDISP sub-system. */ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT FALSE -#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_IMAGE TRUE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE - -/* Builtin Fonts */ -#define GDISP_INCLUDE_FONT_SMALL FALSE -#define GDISP_INCLUDE_FONT_LARGER FALSE -#define GDISP_INCLUDE_FONT_UI1 FALSE -#define GDISP_INCLUDE_FONT_UI2 FALSE -#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE /* GDISP image decoders */ #define GDISP_NEED_IMAGE_NATIVE FALSE @@ -67,6 +50,6 @@ #define GDISP_NEED_IMAGE_BMP FALSE #define GDISP_NEED_IMAGE_JPG FALSE #define GDISP_NEED_IMAGE_PNG FALSE -#define GDISP_NEED_IMAGE_ACCOUNTING FALSE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gdisp/gdisp_images_animated/main.c b/demos/modules/gdisp/images_animated/main.c similarity index 99% rename from demos/modules/gdisp/gdisp_images_animated/main.c rename to demos/modules/gdisp/images_animated/main.c index 58558185..9b2b5d2c 100644 --- a/demos/modules/gdisp/gdisp_images_animated/main.c +++ b/demos/modules/gdisp/images_animated/main.c @@ -115,3 +115,4 @@ int main(void) { return 0; } + diff --git a/demos/modules/gdisp/gdisp_images_animated/testanim.gif b/demos/modules/gdisp/images_animated/testanim.gif similarity index 100% rename from demos/modules/gdisp/gdisp_images_animated/testanim.gif rename to demos/modules/gdisp/images_animated/testanim.gif diff --git a/demos/modules/gdisp/gdisp_images_animated/testanim.h b/demos/modules/gdisp/images_animated/testanim.h similarity index 100% rename from demos/modules/gdisp/gdisp_images_animated/testanim.h rename to demos/modules/gdisp/images_animated/testanim.h diff --git a/demos/modules/gwin/basic/gfxconf.h b/demos/modules/gwin/basic/gfxconf.h index 3ef9c784..1e6784fd 100644 --- a/demos/modules/gwin/basic/gfxconf.h +++ b/demos/modules/gwin/basic/gfxconf.h @@ -31,9 +31,10 @@ #define _GFXCONF_H /* The operating system to use - one of these must be defined */ -#define GFX_USE_OS_CHIBIOS TRUE +#define GFX_USE_OS_CHIBIOS FALSE #define GFX_USE_OS_WIN32 FALSE -#define GFX_USE_OS_POSIX FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE @@ -42,15 +43,10 @@ /* Features for the GDISP sub-system. */ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT FALSE #define GDISP_NEED_CIRCLE TRUE -#define GDISP_NEED_ELLIPSE FALSE -#define GDISP_NEED_ARC FALSE -#define GDISP_NEED_SCROLL FALSE -#define GDISP_NEED_PIXELREAD FALSE -#define GDISP_NEED_CONTROL FALSE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE + +/* Features for the GWIN subsystem. */ +#define GWIN_NEED_WINDOWMANAGER TRUE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gwin/basic/main.c b/demos/modules/gwin/basic/main.c index c46e6969..eee22f29 100644 --- a/demos/modules/gwin/basic/main.c +++ b/demos/modules/gwin/basic/main.c @@ -37,7 +37,7 @@ int main(void) { /* Initialize and clear the display */ gfxInit(); - gdispClear(Lime); + gdispClear(White); /* Create two windows */ { @@ -60,7 +60,7 @@ int main(void) { gwinClear(GW2); gwinDrawLine(GW1, 5, 30, 150, 110); - for(i=5, j=0; i < 200 && j < 150; i+=3, j+=i/20) + for(i = 5, j = 0; i < 200 && j < 150; i += 3, j += i/20) gwinDrawPixel(GW1, i, j); /* diff --git a/demos/modules/gwin/button/gfxconf.h b/demos/modules/gwin/button/gfxconf.h index 256ba2ed..6d0aa41d 100644 --- a/demos/modules/gwin/button/gfxconf.h +++ b/demos/modules/gwin/button/gfxconf.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,62 +30,35 @@ #ifndef _GFXCONF_H #define _GFXCONF_H -#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_WIN32 TRUE -//#define GFX_USE_OS_POSIX TRUE +/* The operating system to use - one of these must be defined */ +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE #define GFX_USE_GWIN TRUE +#define GFX_USE_GINPUT TRUE #define GFX_USE_GEVENT TRUE #define GFX_USE_GTIMER TRUE -#define GFX_USE_GINPUT TRUE /* Features for the GDISP sub-system. */ -#define GDISP_NEED_VALIDATION TRUE -#define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT TRUE -#define GDISP_NEED_CIRCLE TRUE -#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_IMAGE TRUE -#define GDISP_NEED_MULTITHREAD TRUE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE +#define GDISP_NEED_VALIDATION TRUE +#define GDISP_NEED_CLIP TRUE +#define GDISP_NEED_CIRCLE TRUE +#define GDISP_NEED_TEXT TRUE -/* Builtin Fonts */ -#define GDISP_INCLUDE_FONT_SMALL FALSE -#define GDISP_INCLUDE_FONT_LARGER FALSE -#define GDISP_INCLUDE_FONT_UI1 FALSE -#define GDISP_INCLUDE_FONT_UI2 TRUE -#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE +/* GDISP fonts to include */ +#define GDISP_INCLUDE_FONT_UI2 TRUE -/* GDISP image decoders */ -#define GDISP_NEED_IMAGE_NATIVE FALSE -#define GDISP_NEED_IMAGE_GIF FALSE -#define GDISP_NEED_IMAGE_BMP FALSE -#define GDISP_NEED_IMAGE_JPG FALSE -#define GDISP_NEED_IMAGE_PNG FALSE - -/* Features for the GWIN sub-system. */ +/* Features for the GWIN subsystem. */ #define GWIN_NEED_WINDOWMANAGER TRUE -#define GWIN_NEED_CONSOLE FALSE -#define GWIN_NEED_GRAPH FALSE #define GWIN_NEED_WIDGET TRUE #define GWIN_NEED_BUTTON TRUE -#define GWIN_NEED_SLIDER FALSE -#define GWIN_NEED_CHECKBOX FALSE -#define GWIN_NEED_LABEL FALSE -#define GWIN_NEED_IMAGE FALSE -#define GWIN_NEED_RADIO FALSE -/* Features for the GINPUT sub-system. */ +/* Features for the GINPUT subsystem. */ #define GINPUT_NEED_MOUSE TRUE -#define GINPUT_NEED_TOGGLE FALSE -#define GINPUT_NEED_DIAL FALSE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gwin/button/main.c b/demos/modules/gwin/button/main.c index 1ed2ac43..f210d84c 100644 --- a/demos/modules/gwin/button/main.c +++ b/demos/modules/gwin/button/main.c @@ -1,3 +1,32 @@ +/* + * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu + * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "gfx.h" static GListener gl; diff --git a/demos/modules/gwin/checkbox/gfxconf.h b/demos/modules/gwin/checkbox/gfxconf.h index 0864b6f9..9bcda6be 100644 --- a/demos/modules/gwin/checkbox/gfxconf.h +++ b/demos/modules/gwin/checkbox/gfxconf.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,62 +30,35 @@ #ifndef _GFXCONF_H #define _GFXCONF_H -#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_WIN32 TRUE -//#define GFX_USE_OS_POSIX TRUE +/* The operating system to use - one of these must be defined */ +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE #define GFX_USE_GWIN TRUE +#define GFX_USE_GINPUT TRUE #define GFX_USE_GEVENT TRUE #define GFX_USE_GTIMER TRUE -#define GFX_USE_GINPUT TRUE /* Features for the GDISP sub-system. */ -#define GDISP_NEED_VALIDATION TRUE -#define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT TRUE -#define GDISP_NEED_CIRCLE TRUE -#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_IMAGE TRUE -#define GDISP_NEED_MULTITHREAD TRUE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE +#define GDISP_NEED_VALIDATION TRUE +#define GDISP_NEED_CLIP TRUE +#define GDISP_NEED_CIRCLE TRUE +#define GDISP_NEED_TEXT TRUE -/* Builtin Fonts */ -#define GDISP_INCLUDE_FONT_SMALL FALSE -#define GDISP_INCLUDE_FONT_LARGER FALSE -#define GDISP_INCLUDE_FONT_UI1 FALSE -#define GDISP_INCLUDE_FONT_UI2 TRUE -#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE +/* GDISP fonts to include */ +#define GDISP_INCLUDE_FONT_UI2 TRUE -/* GDISP image decoders */ -#define GDISP_NEED_IMAGE_NATIVE FALSE -#define GDISP_NEED_IMAGE_GIF FALSE -#define GDISP_NEED_IMAGE_BMP FALSE -#define GDISP_NEED_IMAGE_JPG FALSE -#define GDISP_NEED_IMAGE_PNG FALSE - -/* Features for the GWIN sub-system. */ +/* Features for the GWIN subsystem. */ #define GWIN_NEED_WINDOWMANAGER TRUE -#define GWIN_NEED_CONSOLE FALSE -#define GWIN_NEED_GRAPH FALSE #define GWIN_NEED_WIDGET TRUE -#define GWIN_NEED_BUTTON FALSE -#define GWIN_NEED_SLIDER FALSE #define GWIN_NEED_CHECKBOX TRUE -#define GWIN_NEED_LABEL FALSE -#define GWIN_NEED_IMAGE FALSE -#define GWIN_NEED_RADIO FALSE -/* Features for the GINPUT sub-system. */ +/* Features for the GINPUT subsystem. */ #define GINPUT_NEED_MOUSE TRUE -#define GINPUT_NEED_TOGGLE FALSE -#define GINPUT_NEED_DIAL FALSE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gwin/checkbox/main.c b/demos/modules/gwin/checkbox/main.c index c6094323..23d3cb17 100644 --- a/demos/modules/gwin/checkbox/main.c +++ b/demos/modules/gwin/checkbox/main.c @@ -1,3 +1,32 @@ +/* + * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu + * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "gfx.h" static GListener gl; diff --git a/demos/modules/gwin/console/gfxconf.h b/demos/modules/gwin/console/gfxconf.h index 90dbc7cb..c1307302 100644 --- a/demos/modules/gwin/console/gfxconf.h +++ b/demos/modules/gwin/console/gfxconf.h @@ -31,9 +31,10 @@ #define _GFXCONF_H /* The operating system to use - one of these must be defined */ -//#define GFX_USE_OS_CHIBIOS FALSE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_POSIX FALSE +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE @@ -43,24 +44,14 @@ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE #define GDISP_NEED_TEXT TRUE -#define GDISP_NEED_CIRCLE FALSE -#define GDISP_NEED_ELLIPSE FALSE -#define GDISP_NEED_ARC FALSE -#define GDISP_NEED_SCROLL FALSE -#define GDISP_NEED_PIXELREAD FALSE -#define GDISP_NEED_CONTROL FALSE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE -/* Builtin Fonts */ -#define GDISP_INCLUDE_FONT_SMALL FALSE -#define GDISP_INCLUDE_FONT_LARGER FALSE -#define GDISP_INCLUDE_FONT_UI1 FALSE -#define GDISP_INCLUDE_FONT_UI2 TRUE -#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE +/* GDISP fonts to include */ +#define GDISP_INCLUDE_FONT_UI2 TRUE +#define GDISP_INCLUDE_FONT_DEJAVUSANS12 TRUE -/* Features for the GWIN sub-system. */ +/* Features for the GWIN subsystem. */ +#define GWIN_NEED_WINDOWMANAGER TRUE #define GWIN_NEED_CONSOLE TRUE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gwin/console/main.c b/demos/modules/gwin/console/main.c index 2175ce04..0efd1c99 100644 --- a/demos/modules/gwin/console/main.c +++ b/demos/modules/gwin/console/main.c @@ -41,7 +41,7 @@ int main(void) { /* Set some fonts */ font1 = gdispOpenFont("UI2"); - font2 = gdispOpenFont("UI2 Double"); + font2 = gdispOpenFont("DejaVu Sans 12"); gwinSetDefaultFont(font1); /* create the three console windows */ @@ -75,7 +75,7 @@ int main(void) { /* Output some data on the first console */ for(i = 0; i < 10; i++) { - gwinPrintf(GW1, "Hello ChibiOS/GFX!\r\n"); + gwinPrintf(GW1, "Hello uGFX!\r\n"); } /* Output some data on the second console */ diff --git a/demos/modules/gwin/graph/gfxconf.h b/demos/modules/gwin/graph/gfxconf.h index 51c5bdc4..e829605a 100644 --- a/demos/modules/gwin/graph/gfxconf.h +++ b/demos/modules/gwin/graph/gfxconf.h @@ -31,33 +31,22 @@ #define _GFXCONF_H /* The operating system to use - one of these must be defined */ -//#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_POSIX FALSE +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE #define GFX_USE_GWIN TRUE -#define GFX_USE_GMISC TRUE /* Features for the GDISP sub-system. */ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT FALSE -#define GDISP_NEED_CIRCLE TRUE -#define GDISP_NEED_ELLIPSE FALSE -#define GDISP_NEED_ARC FALSE -#define GDISP_NEED_SCROLL FALSE -#define GDISP_NEED_PIXELREAD FALSE -#define GDISP_NEED_CONTROL FALSE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE -/* Features for the GWIN sub-system. */ +/* Features for the GWIN subsystem. */ +#define GWIN_NEED_WINDOWMANAGER TRUE #define GWIN_NEED_GRAPH TRUE -/* Turn on fast trig */ -#define GMISC_NEED_FASTTRIG TRUE - #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gwin/graph/main.c b/demos/modules/gwin/graph/main.c index c5b7b352..4dd67ae8 100644 --- a/demos/modules/gwin/graph/main.c +++ b/demos/modules/gwin/graph/main.c @@ -100,3 +100,4 @@ int main(void) { } } + diff --git a/demos/modules/gwin/list/gfxconf.h b/demos/modules/gwin/list/gfxconf.h index cf5f8690..19d395c0 100644 --- a/demos/modules/gwin/list/gfxconf.h +++ b/demos/modules/gwin/list/gfxconf.h @@ -1,150 +1,64 @@ -/** - * This file has a different license to the rest of the GFX system. - * You can copy, modify and distribute this file as you see fit. - * You do not need to publish your source modifications to this file. - * The only thing you are not permitted to do is to relicense it - * under a different license. - */ - -/** - * Copy this file into your project directory and rename it as gfxconf.h - * Edit your copy to turn on the GFX features you want to use. +/* + * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu + * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _GFXCONF_H #define _GFXCONF_H /* The operating system to use - one of these must be defined */ -//#define GFX_USE_OS_CHIBIOS FALSE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_LINUX TRUE -//#define GFX_USE_OS_OSX FALSE +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE -/* GFX subsystems to turn on */ +/* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE -#define GFX_USE_TDISP FALSE #define GFX_USE_GWIN TRUE +#define GFX_USE_GINPUT TRUE #define GFX_USE_GEVENT TRUE #define GFX_USE_GTIMER TRUE -#define GFX_USE_GQUEUE TRUE -#define GFX_USE_GINPUT TRUE -#define GFX_USE_GADC FALSE -#define GFX_USE_GAUDIN FALSE -#define GFX_USE_GAUDOUT FALSE -#define GFX_USE_GMISC FALSE -/* Features for the GDISP subsystem */ +/* Features for the GDISP sub-system. */ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE #define GDISP_NEED_TEXT TRUE -#define GDISP_NEED_CIRCLE TRUE -#define GDISP_NEED_ELLIPSE TRUE -#define GDISP_NEED_ARC FALSE #define GDISP_NEED_CONVEX_POLYGON TRUE -#define GDISP_NEED_SCROLL FALSE -#define GDISP_NEED_PIXELREAD FALSE -#define GDISP_NEED_CONTROL FALSE -#define GDISP_NEED_QUERY FALSE -#define GDISP_NEED_IMAGE FALSE -#define GDISP_NEED_MULTITHREAD FALSE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE -/* GDISP - builtin fonts */ -#define GDISP_INCLUDE_FONT_SMALL FALSE -#define GDISP_INCLUDE_FONT_LARGER FALSE -#define GDISP_INCLUDE_FONT_UI1 FALSE -#define GDISP_INCLUDE_FONT_UI2 TRUE -#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE - -/* GDISP image decoders */ -#define GDISP_NEED_IMAGE_NATIVE FALSE -#define GDISP_NEED_IMAGE_GIF FALSE -#define GDISP_NEED_IMAGE_BMP FALSE -#define GDISP_NEED_IMAGE_JPG FALSE -#define GDISP_NEED_IMAGE_PNG FALSE -#define GDISP_NEED_IMAGE_ACCOUNTING FALSE - -/* Optional image support that can be turned off */ -/* - #define GDISP_NEED_IMAGE_BMP_1 TRUE - #define GDISP_NEED_IMAGE_BMP_4 TRUE - #define GDISP_NEED_IMAGE_BMP_4_RLE TRUE - #define GDISP_NEED_IMAGE_BMP_8 TRUE - #define GDISP_NEED_IMAGE_BMP_8_RLE TRUE - #define GDISP_NEED_IMAGE_BMP_16 TRUE - #define GDISP_NEED_IMAGE_BMP_24 TRUE - #define GDISP_NEED_IMAGE_BMP_32 TRUE -*/ - -/* Features for the TDISP subsystem. */ -#define TDISP_NEED_MULTITHREAD FALSE +/* GDISP fonts to include */ +#define GDISP_INCLUDE_FONT_UI2 TRUE /* Features for the GWIN subsystem. */ #define GWIN_NEED_WINDOWMANAGER TRUE -#define GWIN_NEED_CONSOLE FALSE -#define GWIN_NEED_GRAPH FALSE #define GWIN_NEED_WIDGET TRUE -#define GWIN_NEED_BUTTON FALSE -#define GWIN_NEED_SLIDER FALSE -#define GWIN_NEED_CHECKBOX FALSE -#define GWIN_NEED_IMAGE FALSE -#define GWIN_NEED_RADIO FALSE #define GWIN_NEED_LIST TRUE -/* Features for the GEVENT subsystem. */ -#define GEVENT_ASSERT_NO_RESOURCE FALSE - -/* Features for the GTIMER subsystem. */ -/* NONE */ - -/* Features for the GQUEUE subsystem. */ -#define GQUEUE_NEED_ASYNC TRUE -#define GQUEUE_NEED_GSYNC FALSE -#define GQUEUE_NEED_FSYNC FALSE - /* Features for the GINPUT subsystem. */ #define GINPUT_NEED_MOUSE TRUE -#define GINPUT_NEED_KEYBOARD FALSE -#define GINPUT_NEED_TOGGLE FALSE -#define GINPUT_NEED_DIAL FALSE - -/* Features for the GADC subsystem. */ -/* NONE */ - -/* Features for the GAUDIN subsystem. */ -/* NONE */ - -/* Features for the GAUDOUT subsystem. */ -/* NONE */ - -/* Features for the GMISC subsystem. */ -#define GMISC_NEED_ARRAYOPS FALSE -#define GMISC_NEED_FASTTRIG FALSE -#define GMISC_NEED_FIXEDTRIG FALSE - -/* Optional Parameters for various subsystems */ -/* - #define GDISP_MAX_FONT_HEIGHT 16 - #define GEVENT_MAXIMUM_SIZE 32 - #define GEVENT_MAX_SOURCE_LISTENERS 32 - #define GTIMER_THREAD_WORKAREA_SIZE 512 - #define GADC_MAX_LOWSPEED_DEVICES 4 - #define GWIN_BUTTON_LAZY_RELEASE FALSE - #define GWIN_CONSOLE_USE_BASESTREAM FALSE - #define GWIN_CONSOLE_USE_FLOAT FALSE - #define GWIN_NEED_IMAGE_ANIMATION FALSE -*/ - -/* Optional Low Level Driver Definitions */ -/* - #define GDISP_USE_CUSTOM_BOARD FALSE - #define GDISP_SCREEN_WIDTH 320 - #define GDISP_SCREEN_HEIGHT 240 - #define GDISP_USE_FSMC - #define GDISP_USE_GPIO - #define TDISP_COLUMNS 16 - #define TDISP_ROWS 2 -*/ #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gwin/list/main.c b/demos/modules/gwin/list/main.c index 21afa544..e99c2448 100644 --- a/demos/modules/gwin/list/main.c +++ b/demos/modules/gwin/list/main.c @@ -1,3 +1,32 @@ +/* + * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu + * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "gfx.h" static GListener gl; @@ -32,7 +61,7 @@ int main(void) { // Set the widget defaults gwinSetDefaultFont(gdispOpenFont("UI2")); gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE); - gdispClear(Red); + gdispClear(White); // Attach the mouse input gwinAttachMouse(0); diff --git a/demos/modules/gwin/radio/gfxconf.h b/demos/modules/gwin/radio/gfxconf.h index 4bb82816..0e41b7ae 100644 --- a/demos/modules/gwin/radio/gfxconf.h +++ b/demos/modules/gwin/radio/gfxconf.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,62 +30,35 @@ #ifndef _GFXCONF_H #define _GFXCONF_H -#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_WIN32 TRUE -//#define GFX_USE_OS_POSIX TRUE +/* The operating system to use - one of these must be defined */ +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE #define GFX_USE_GWIN TRUE +#define GFX_USE_GINPUT TRUE #define GFX_USE_GEVENT TRUE #define GFX_USE_GTIMER TRUE -#define GFX_USE_GINPUT TRUE /* Features for the GDISP sub-system. */ -#define GDISP_NEED_VALIDATION TRUE -#define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT TRUE -#define GDISP_NEED_CIRCLE TRUE -#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_IMAGE TRUE -#define GDISP_NEED_MULTITHREAD TRUE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE +#define GDISP_NEED_VALIDATION TRUE +#define GDISP_NEED_CLIP TRUE +#define GDISP_NEED_CIRCLE TRUE +#define GDISP_NEED_TEXT TRUE -/* Builtin Fonts */ -#define GDISP_INCLUDE_FONT_SMALL FALSE -#define GDISP_INCLUDE_FONT_LARGER FALSE -#define GDISP_INCLUDE_FONT_UI1 FALSE -#define GDISP_INCLUDE_FONT_UI2 TRUE -#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE +/* GDISP fonts to include */ +#define GDISP_INCLUDE_FONT_UI2 TRUE -/* GDISP image decoders */ -#define GDISP_NEED_IMAGE_NATIVE FALSE -#define GDISP_NEED_IMAGE_GIF FALSE -#define GDISP_NEED_IMAGE_BMP FALSE -#define GDISP_NEED_IMAGE_JPG FALSE -#define GDISP_NEED_IMAGE_PNG FALSE - -/* Features for the GWIN sub-system. */ +/* Features for the GWIN subsystem. */ #define GWIN_NEED_WINDOWMANAGER TRUE -#define GWIN_NEED_CONSOLE FALSE -#define GWIN_NEED_GRAPH FALSE #define GWIN_NEED_WIDGET TRUE -#define GWIN_NEED_BUTTON FALSE -#define GWIN_NEED_SLIDER FALSE -#define GWIN_NEED_CHECKBOX FALSE -#define GWIN_NEED_LABEL FALSE -#define GWIN_NEED_IMAGE FALSE #define GWIN_NEED_RADIO TRUE -/* Features for the GINPUT sub-system. */ +/* Features for the GINPUT subsystem. */ #define GINPUT_NEED_MOUSE TRUE -#define GINPUT_NEED_TOGGLE FALSE -#define GINPUT_NEED_DIAL FALSE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gwin/radio/main.c b/demos/modules/gwin/radio/main.c index c64b2068..b7504535 100644 --- a/demos/modules/gwin/radio/main.c +++ b/demos/modules/gwin/radio/main.c @@ -1,3 +1,32 @@ +/* + * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu + * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "gfx.h" #define GROUP1 0 // this will be the first radio button group diff --git a/demos/modules/gwin/slider/gfxconf.h b/demos/modules/gwin/slider/gfxconf.h index af5eeaa8..5442c508 100644 --- a/demos/modules/gwin/slider/gfxconf.h +++ b/demos/modules/gwin/slider/gfxconf.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,62 +30,35 @@ #ifndef _GFXCONF_H #define _GFXCONF_H -#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_WIN32 TRUE -//#define GFX_USE_OS_POSIX TRUE +/* The operating system to use - one of these must be defined */ +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE #define GFX_USE_GWIN TRUE +#define GFX_USE_GINPUT TRUE #define GFX_USE_GEVENT TRUE #define GFX_USE_GTIMER TRUE -#define GFX_USE_GINPUT TRUE /* Features for the GDISP sub-system. */ -#define GDISP_NEED_VALIDATION TRUE -#define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT TRUE -#define GDISP_NEED_CIRCLE TRUE -#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_IMAGE TRUE -#define GDISP_NEED_MULTITHREAD TRUE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE +#define GDISP_NEED_VALIDATION TRUE +#define GDISP_NEED_CLIP TRUE +#define GDISP_NEED_CIRCLE TRUE +#define GDISP_NEED_TEXT TRUE -/* Builtin Fonts */ -#define GDISP_INCLUDE_FONT_SMALL FALSE -#define GDISP_INCLUDE_FONT_LARGER FALSE -#define GDISP_INCLUDE_FONT_UI1 FALSE -#define GDISP_INCLUDE_FONT_UI2 TRUE -#define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE +/* GDISP fonts to include */ +#define GDISP_INCLUDE_FONT_UI2 TRUE -/* GDISP image decoders */ -#define GDISP_NEED_IMAGE_NATIVE FALSE -#define GDISP_NEED_IMAGE_GIF FALSE -#define GDISP_NEED_IMAGE_BMP FALSE -#define GDISP_NEED_IMAGE_JPG FALSE -#define GDISP_NEED_IMAGE_PNG FALSE - -/* Features for the GWIN sub-system. */ +/* Features for the GWIN subsystem. */ #define GWIN_NEED_WINDOWMANAGER TRUE -#define GWIN_NEED_CONSOLE FALSE -#define GWIN_NEED_GRAPH FALSE #define GWIN_NEED_WIDGET TRUE -#define GWIN_NEED_BUTTON FALSE #define GWIN_NEED_SLIDER TRUE -#define GWIN_NEED_CHECKBOX FALSE -#define GWIN_NEED_LABEL FALSE -#define GWIN_NEED_IMAGE FALSE -#define GWIN_NEED_RADIO FALSE -/* Features for the GINPUT sub-system. */ +/* Features for the GINPUT subsystem. */ #define GINPUT_NEED_MOUSE TRUE -#define GINPUT_NEED_TOGGLE FALSE -#define GINPUT_NEED_DIAL FALSE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gwin/slider/main.c b/demos/modules/gwin/slider/main.c index 4532ba01..ed936f12 100644 --- a/demos/modules/gwin/slider/main.c +++ b/demos/modules/gwin/slider/main.c @@ -1,3 +1,32 @@ +/* + * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu + * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "gfx.h" static GListener gl; diff --git a/demos/modules/gwin/widgets/gfxconf.h b/demos/modules/gwin/widgets/gfxconf.h index 0bf8443a..ed6be366 100644 --- a/demos/modules/gwin/widgets/gfxconf.h +++ b/demos/modules/gwin/widgets/gfxconf.h @@ -1,6 +1,7 @@ /* * Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu * Copyright (c) 2012, 2013, Andrew Hannam aka inmarket + * * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,62 +30,52 @@ #ifndef _GFXCONF_H #define _GFXCONF_H -//#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_WIN32 TRUE -//#define GFX_USE_OS_POSIX TRUE +/* The operating system to use - one of these must be defined */ +#define GFX_USE_OS_CHIBIOS FALSE +#define GFX_USE_OS_WIN32 FALSE +#define GFX_USE_OS_LINUX FALSE +#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE #define GFX_USE_GWIN TRUE +#define GFX_USE_GINPUT TRUE #define GFX_USE_GEVENT TRUE #define GFX_USE_GTIMER TRUE -#define GFX_USE_GINPUT TRUE /* Features for the GDISP sub-system. */ -#define GDISP_NEED_VALIDATION TRUE -#define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_TEXT TRUE -#define GDISP_NEED_CIRCLE TRUE -#define GDISP_NEED_ELLIPSE FALSE -#define GDISP_NEED_ARC FALSE -#define GDISP_NEED_CONVEX_POLYGON TRUE -#define GDISP_NEED_SCROLL TRUE -#define GDISP_NEED_PIXELREAD FALSE -#define GDISP_NEED_CONTROL FALSE -#define GDISP_NEED_IMAGE TRUE -#define GDISP_NEED_MULTITHREAD TRUE -#define GDISP_NEED_ASYNC FALSE -#define GDISP_NEED_MSGAPI FALSE +#define GDISP_NEED_VALIDATION TRUE +#define GDISP_NEED_CLIP TRUE +#define GDISP_NEED_CIRCLE TRUE +#define GDISP_NEED_TEXT TRUE +#define GDISP_NEED_SCROLL TRUE +#define GDISP_NEED_IMAGE TRUE -/* Builtin Fonts */ -#define GDISP_INCLUDE_FONT_UI2 TRUE -#define GDISP_NEED_ANTIALIAS FALSE +/* GDISP fonts to include */ +#define GDISP_INCLUDE_FONT_UI2 TRUE /* GDISP image decoders */ -#define GDISP_NEED_IMAGE_NATIVE FALSE #define GDISP_NEED_IMAGE_GIF TRUE -#define GDISP_NEED_IMAGE_BMP FALSE -#define GDISP_NEED_IMAGE_JPG FALSE -#define GDISP_NEED_IMAGE_PNG FALSE +#define GDISP_NEED_IMAGE_BMP TRUE -/* Features for the GWIN sub-system. */ +/* Features for the GWIN subsystem. */ #define GWIN_NEED_WINDOWMANAGER TRUE #define GWIN_NEED_CONSOLE TRUE #define GWIN_NEED_GRAPH TRUE #define GWIN_NEED_WIDGET TRUE +#define GWIN_NEED_LABEL TRUE #define GWIN_NEED_BUTTON TRUE #define GWIN_NEED_SLIDER TRUE #define GWIN_NEED_CHECKBOX TRUE -#define GWIN_NEED_LABEL TRUE #define GWIN_NEED_IMAGE TRUE #define GWIN_NEED_RADIO TRUE #define GWIN_NEED_LIST TRUE -#define GWIN_NEED_IMAGE_ANIMATION TRUE -#define GWIN_NEED_LIST_IMAGES TRUE -/* Features for the GINPUT sub-system. */ +/* Features for the GINPUT subsystem. */ #define GINPUT_NEED_MOUSE TRUE -#define GINPUT_NEED_TOGGLE FALSE -#define GINPUT_NEED_DIAL FALSE + +/* Optional parameters for various subsystems */ +#define GWIN_NEED_LIST_IMAGES TRUE #endif /* _GFXCONF_H */ + diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c index dde955f3..2b14d79e 100644 --- a/demos/modules/gwin/widgets/main.c +++ b/demos/modules/gwin/widgets/main.c @@ -382,3 +382,4 @@ int main(void) { } return 0; } +