updated GDISP and GWIN demos
This commit is contained in:
parent
4b76efce1d
commit
36c55722dd
@ -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 */
|
||||
|
@ -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);
|
@ -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 */
|
||||
|
@ -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
|
@ -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 */
|
||||
|
@ -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
|
56
demos/modules/gdisp/fonts_cyrillic/gfxconf.h
Normal file
56
demos/modules/gdisp/fonts_cyrillic/gfxconf.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 <organization> 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 <COPYRIGHT HOLDER> 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 */
|
||||
|
49
demos/modules/gdisp/fonts_cyrillic/main.c
Normal file
49
demos/modules/gdisp/fonts_cyrillic/main.c
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 <organization> 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 <COPYRIGHT HOLDER> 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);
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 32 KiB |
@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 <organization> 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 <COPYRIGHT HOLDER> 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 */
|
@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 <organization> 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 <COPYRIGHT HOLDER> 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);
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
@ -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 */
|
||||
|
@ -115,3 +115,4 @@ int main(void) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
@ -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 */
|
||||
|
||||
|
@ -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);
|
||||
|
||||
/*
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 */
|
||||
|
||||
|
@ -1,3 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 <organization> 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 <COPYRIGHT HOLDER> 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;
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 */
|
||||
|
||||
|
@ -1,3 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 <organization> 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 <COPYRIGHT HOLDER> 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;
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -100,3 +100,4 @@ int main(void) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -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 <joel@unormal.org>
|
||||
* 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 <organization> 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 <COPYRIGHT HOLDER> 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 */
|
||||
|
||||
|
@ -1,3 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 <organization> 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 <COPYRIGHT HOLDER> 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);
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 */
|
||||
|
||||
|
@ -1,3 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 <organization> 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 <COPYRIGHT HOLDER> 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
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 */
|
||||
|
||||
|
@ -1,3 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 <organization> 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 <COPYRIGHT HOLDER> 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;
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2013, Joel Bodenmann aka Tectu <joel@unormal.org>
|
||||
* 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 */
|
||||
|
||||
|
@ -382,3 +382,4 @@ int main(void) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user