diff options
Diffstat (limited to 'src/gwin')
-rw-r--r-- | src/gwin/gwin_button.c (renamed from src/gwin/button.c) | 30 | ||||
-rw-r--r-- | src/gwin/gwin_button.h (renamed from src/gwin/button.h) | 14 | ||||
-rw-r--r-- | src/gwin/gwin_checkbox.c (renamed from src/gwin/checkbox.c) | 6 | ||||
-rw-r--r-- | src/gwin/gwin_checkbox.h (renamed from src/gwin/checkbox.h) | 10 | ||||
-rw-r--r-- | src/gwin/gwin_class.h (renamed from src/gwin/class_gwin.h) | 18 | ||||
-rw-r--r-- | src/gwin/gwin_console.c (renamed from src/gwin/console.c) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_console.h (renamed from src/gwin/console.h) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_container.c (renamed from src/gwin/gcontainer.c) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_container.h (renamed from src/gwin/gcontainer.h) | 6 | ||||
-rw-r--r-- | src/gwin/gwin_frame.c (renamed from src/gwin/frame.c) | 9 | ||||
-rw-r--r-- | src/gwin/gwin_frame.h (renamed from src/gwin/frame.h) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_gl3d.c | 171 | ||||
-rw-r--r-- | src/gwin/gwin_gl3d.h | 70 | ||||
-rw-r--r-- | src/gwin/gwin_graph.c (renamed from src/gwin/graph.c) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_graph.h (renamed from src/gwin/graph.h) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_gwin.c (renamed from src/gwin/gwin.c) | 74 | ||||
-rw-r--r-- | src/gwin/gwin_image.c (renamed from src/gwin/gimage.c) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_image.h (renamed from src/gwin/gimage.h) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_label.c (renamed from src/gwin/label.c) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_label.h (renamed from src/gwin/label.h) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_list.c (renamed from src/gwin/list.c) | 6 | ||||
-rw-r--r-- | src/gwin/gwin_list.h (renamed from src/gwin/list.h) | 10 | ||||
-rw-r--r-- | src/gwin/gwin_progressbar.c (renamed from src/gwin/progressbar.c) | 4 | ||||
-rw-r--r-- | src/gwin/gwin_progressbar.h (renamed from src/gwin/progressbar.h) | 3 | ||||
-rw-r--r-- | src/gwin/gwin_radio.c (renamed from src/gwin/radio.c) | 6 | ||||
-rw-r--r-- | src/gwin/gwin_radio.h (renamed from src/gwin/radio.h) | 10 | ||||
-rw-r--r-- | src/gwin/gwin_slider.c (renamed from src/gwin/slider.c) | 6 | ||||
-rw-r--r-- | src/gwin/gwin_slider.h (renamed from src/gwin/slider.h) | 10 | ||||
-rw-r--r-- | src/gwin/gwin_widget.c (renamed from src/gwin/gwidget.c) | 25 | ||||
-rw-r--r-- | src/gwin/gwin_widget.h (renamed from src/gwin/gwidget.h) | 48 | ||||
-rw-r--r-- | src/gwin/gwin_wm.c (renamed from src/gwin/gwm.c) | 9 | ||||
-rw-r--r-- | src/gwin/sys_defs.h | 15 | ||||
-rw-r--r-- | src/gwin/sys_make.mk | 34 | ||||
-rw-r--r-- | src/gwin/sys_options.h | 7 |
34 files changed, 472 insertions, 169 deletions
diff --git a/src/gwin/button.c b/src/gwin/gwin_button.c index fc1cb976..35627cfb 100644 --- a/src/gwin/button.c +++ b/src/gwin/gwin_button.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/button.c + * @file src/gwin/gwin_button.c * @brief GWIN sub-system button code */ @@ -14,7 +14,7 @@ #if GFX_USE_GWIN && GWIN_NEED_BUTTON -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" // Parameters for various shapes #define RND_CNR_SIZE 5 // Rounded corner size for rounded buttons @@ -26,28 +26,6 @@ // Our pressed state #define GBUTTON_FLG_PRESSED (GWIN_FIRST_CONTROL_FLAG<<0) -// Send the button event -static void SendButtonEvent(GWidgetObject *gw) { - GSourceListener * psl; - GEvent * pe; - #define pbe ((GEventGWinButton *)pe) - - // Trigger a GWIN Button Event - psl = 0; - while ((psl = geventGetSourceListener(GWIDGET_SOURCE, psl))) { - if (!(pe = geventGetEventBuffer(psl))) - continue; - pbe->type = GEVENT_GWIN_BUTTON; - pbe->button = (GHandle)gw; - #if GWIN_WIDGET_TAGS - pbe->tag = gw->tag; - #endif - geventSendEvent(psl); - } - - #undef pbe -} - #if GINPUT_NEED_MOUSE // A mouse down has occurred over the button static void MouseDown(GWidgetObject *gw, coord_t x, coord_t y) { @@ -68,7 +46,7 @@ static void SendButtonEvent(GWidgetObject *gw) { return; #endif - SendButtonEvent(gw); + _gwinSendEvent(&gw->g, GEVENT_GWIN_BUTTON); } #endif @@ -86,7 +64,7 @@ static void SendButtonEvent(GWidgetObject *gw) { gw->g.flags |= GBUTTON_FLG_PRESSED; _gwinUpdate((GHandle)gw); // Trigger the event on button down (different than for mouse/touch) - SendButtonEvent(gw); + _gwinSendEvent(&gw->g, GEVENT_GWIN_BUTTON); } static void ToggleAssign(GWidgetObject *gw, uint16_t role, uint16_t instance) { diff --git a/src/gwin/button.h b/src/gwin/gwin_button.h index 077b50f4..282ed828 100644 --- a/src/gwin/button.h +++ b/src/gwin/gwin_button.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/button.h + * @file src/gwin/gwin_button.h * @brief GWIN Graphic window subsystem header file. * * @defgroup Button Button @@ -24,24 +24,18 @@ #ifndef _GWIN_BUTTON_H #define _GWIN_BUTTON_H -/* This file is included within "gwin/gwidget.h" */ +/* This file is included within "src/gwin/gwin_widget.h" */ /** * @brief The Event Type for a Button Event */ -#define GEVENT_GWIN_BUTTON (GEVENT_GWIN_FIRST+0) +#define GEVENT_GWIN_BUTTON (GEVENT_GWIN_CTRL_FIRST+0) /** * @brief A Button Event * @note There are currently no GEventGWinButton listening flags - use 0 as the flags to @p gwinAttachListener() */ -typedef struct GEventGWinButton { - GEventType type; // The type of this event (GEVENT_GWIN_BUTTON) - GHandle button; // The button that has been depressed (actually triggered on release) - #if GWIN_WIDGET_TAGS - WidgetTag tag; // The button tag - #endif -} GEventGWinButton; +typedef GEventGWin GEventGWinButton; /** * @brief The button widget structure diff --git a/src/gwin/checkbox.c b/src/gwin/gwin_checkbox.c index 7914ee82..dec085c3 100644 --- a/src/gwin/checkbox.c +++ b/src/gwin/gwin_checkbox.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/checkbox.c + * @file src/gwin/gwin_checkbox.c * @brief GWIN sub-system button code */ @@ -14,7 +14,7 @@ #if (GFX_USE_GWIN && GWIN_NEED_CHECKBOX) || defined(__DOXYGEN__) -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" // Our checked state #define GCHECKBOX_FLG_CHECKED (GWIN_FIRST_CONTROL_FLAG<<0) @@ -31,7 +31,7 @@ static void SendCheckboxEvent(GWidgetObject *gw) { if (!(pe = geventGetEventBuffer(psl))) continue; pce->type = GEVENT_GWIN_CHECKBOX; - pce->checkbox = &gw->g; + pce->gwin = &gw->g; pce->isChecked = (gw->g.flags & GCHECKBOX_FLG_CHECKED) ? TRUE : FALSE; #if GWIN_WIDGET_TAGS pce->tag = gw->tag; diff --git a/src/gwin/checkbox.h b/src/gwin/gwin_checkbox.h index ebd35a0b..3a67d487 100644 --- a/src/gwin/checkbox.h +++ b/src/gwin/gwin_checkbox.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/checkbox.h + * @file src/gwin/gwin_checkbox.h * @brief GWIN Graphic window subsystem header file. * * @defgroup Checkbox Checkbox @@ -22,13 +22,13 @@ #ifndef _GWIN_CHECKBOX_H #define _GWIN_CHECKBOX_H -/* This file is included within "gwin/gwidget.h" */ +/* This file is included within "src/gwin/gwin_widget.h" */ /*===========================================================================*/ /* Driver constants. */ /*===========================================================================*/ -#define GEVENT_GWIN_CHECKBOX (GEVENT_GWIN_FIRST+2) +#define GEVENT_GWIN_CHECKBOX (GEVENT_GWIN_CTRL_FIRST+2) /*===========================================================================*/ /* Type definitions */ @@ -36,11 +36,11 @@ typedef struct GEventGWinCheckbox { GEventType type; // The type of this event (GEVENT_GWIN_CHECKBOX) - GHandle checkbox; // The checkbox that has been depressed (actually triggered on release) - bool_t isChecked; // Is the checkbox currently checked or unchecked? + GHandle gwin; // The checkbox that has been depressed (actually triggered on release) #if GWIN_WIDGET_TAGS WidgetTag tag; // The checkbox tag #endif + bool_t isChecked; // Is the checkbox currently checked or unchecked? } GEventGWinCheckbox; /* A Checkbox window */ diff --git a/src/gwin/class_gwin.h b/src/gwin/gwin_class.h index 488f3d68..4dde3624 100644 --- a/src/gwin/class_gwin.h +++ b/src/gwin/gwin_class.h @@ -6,7 +6,7 @@ */ /* - * @file src/gwin/class_gwin.h + * @file src/gwin/gwin_class.h * @brief GWIN Graphic window subsystem header file. * * @defgroup Internal Internal @@ -14,7 +14,7 @@ * * @note These definitions are normally not used by an application program. They are useful * only if you want to create your own custom GWIN window or widget. - * @note To access these definitions you must include "gwin/class_gwin.h" in your source file. + * @note To access these definitions you must include "src/gwin/gwin_class.h" in your source file. * * @{ */ @@ -243,7 +243,7 @@ bool_t _gwinDrawStart(GHandle gh); void _gwinDrawEnd(GHandle gh); /** - * @brief Flush any pending redraws in the system. + * @brief Destroy a window. * * @param[in] gh The window * @param[in] how Do we wait for the lock? @@ -301,6 +301,18 @@ bool_t _gwinWMAdd(GHandle gh, const GWindowInit *pInit); * @notapi */ void _gwidgetRedraw(GHandle gh); + + /** + * @brief Send a standard GWIN event. + * + * @param[in] gh The window + * @param[in] type The event type + * + * @note No consideration is given to recording EVENT LOST statuses. + * + * @notapi + */ + void _gwinSendEvent(GHandle gh, GEventType type); #endif #if GWIN_NEED_CONTAINERS || defined(__DOXYGEN__) diff --git a/src/gwin/console.c b/src/gwin/gwin_console.c index 0380fd61..4c17034d 100644 --- a/src/gwin/console.c +++ b/src/gwin/gwin_console.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/console.c + * @file src/gwin/gwin_console.c * @brief GWIN sub-system console code. */ @@ -16,7 +16,7 @@ #include <string.h> -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" #define GWIN_CONSOLE_USE_CLEAR_LINES TRUE // Clear each line before using it #define GWIN_CONSOLE_USE_FILLED_CHARS FALSE // Use filled characters instead of drawn characters diff --git a/src/gwin/console.h b/src/gwin/gwin_console.h index 2a8f4a0a..77e623eb 100644 --- a/src/gwin/console.h +++ b/src/gwin/gwin_console.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/console.h + * @file src/gwin/gwin_console.h * @brief GWIN Graphic window subsystem header file. * * @defgroup Console Console @@ -24,7 +24,7 @@ #ifndef _GWIN_CONSOLE_H #define _GWIN_CONSOLE_H -/* This file is included within "gwin/gwin.h" */ +/* This file is included within "src/gwin/sys_defs.h" */ // A console window. Supports wrapped text writing and a cursor. typedef struct GConsoleObject { diff --git a/src/gwin/gcontainer.c b/src/gwin/gwin_container.c index 97b5fabb..3145ae56 100644 --- a/src/gwin/gcontainer.c +++ b/src/gwin/gwin_container.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/gcontainer.c + * @file src/gwin/gwin_container.c * @brief GWIN sub-system container code */ @@ -14,7 +14,7 @@ #if GFX_USE_GWIN && GWIN_NEED_CONTAINERS -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" void _gcontainerInit(void) { diff --git a/src/gwin/gcontainer.h b/src/gwin/gwin_container.h index 98707ede..ff1c1ce9 100644 --- a/src/gwin/gcontainer.h +++ b/src/gwin/gwin_container.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/gcontainer.h + * @file src/gwin/gwin_container.h * * @defgroup Container Container * @ingroup Containers @@ -21,7 +21,7 @@ #ifndef _GCONTAINER_H #define _GCONTAINER_H -/* This file is included within "gwin/gwin.h" */ +/* This file is included within "src/gwin/sys_defs.h" */ // Forward definition struct GContainerObject; @@ -154,7 +154,7 @@ extern "C" { /* Include extra container types */ #if GWIN_NEED_FRAME || defined(__DOXYGEN__) - #include "src/gwin/frame.h" + #include "gwin_frame.h" #endif #endif /* _GCONTAINER_H */ diff --git a/src/gwin/frame.c b/src/gwin/gwin_frame.c index ec0bf632..63df3be2 100644 --- a/src/gwin/frame.c +++ b/src/gwin/gwin_frame.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/frame.c + * @file src/gwin/gwin_frame.c * @brief GWIN sub-system frame code. */ @@ -14,7 +14,7 @@ #if GFX_USE_GWIN && GWIN_NEED_FRAME -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" /* Some position values */ #define BUTTON_X 18 // Button Width @@ -95,6 +95,7 @@ static void forceFrameRedraw(GWidgetObject *gw) { // Close is released - destroy the window gw->g.flags &= ~(GWIN_FRAME_CLOSE_PRESSED|GWIN_FRAME_MAX_PRESSED|GWIN_FRAME_MIN_PRESSED); forceFrameRedraw(gw); + _gwinSendEvent(&gw->g, GEVENT_GWIN_CLOSE); gwinDestroy(&gw->g); return; } @@ -304,10 +305,10 @@ void gwinFrameDraw_Std(GWidgetObject *gw, void *param) { // Draw the client area by tiling the image mx = gw->g.x+gw->g.width - BORDER_R; my = gw->g.y+gw->g.height - BORDER_B; - for(y = gw->g.y+BORDER_T, ih=gi->height; y < my; y += ih) { + for(y = gw->g.y+BORDER_T, ih = gi->height; y < my; y += ih) { if (ih > my - y) ih = my - y; - for(x = gw->g.x+BORDER_L; iw=gi->width; x < mx; x += iw) { + for(x = gw->g.x+BORDER_L; iw = gi->width; x < mx; x += iw) { if (iw > mx - x) iw = mx - x; gdispGImageDraw(gw->g.display, gi, x, y, ih, iw, 0, 0); diff --git a/src/gwin/frame.h b/src/gwin/gwin_frame.h index 58e1fbc9..f71a88a5 100644 --- a/src/gwin/frame.h +++ b/src/gwin/gwin_frame.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/frame.h + * @file src/gwin/gwin_frame.h * @brief GWIN Graphic window subsystem header file. * * @defgroup Frame Frame @@ -23,6 +23,8 @@ #ifndef _GWIN_FRAME_H #define _GWIN_FRAME_H +/* This file is included from src/gwin/gwin_container.h */ + /** * @brief Flags for gwinFrameCreate() * @{ diff --git a/src/gwin/gwin_gl3d.c b/src/gwin/gwin_gl3d.c new file mode 100644 index 00000000..6e16479e --- /dev/null +++ b/src/gwin/gwin_gl3d.c @@ -0,0 +1,171 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +/** + * @file src/gwin/gwin_gl3d.c + * @brief GWIN sub-system button code + */ + +#include "gfx.h" + +#if GFX_USE_GWIN && GWIN_NEED_GL3D + +#if GDISP_PIXELFORMAT != GDISP_PIXELFORMAT_RGB565 + #error "GWIN: GL3D only support GDISP_PIXELFORMAT_RGB565 color format (TinyGL limitation)" +#endif + +#include "gwin_class.h" + +#include "3rdparty/tinygl-0.4-ugfx/src/zgl.h" + +// Forward definitions +static void gl3dDestroy(GWindowObject *gh); +static void gl3dRedraw(GWindowObject *gh); +static int gl3dResizeGLViewport(GLContext *c, int *xsize_ptr, int *ysize_ptr); + +static const gwinVMT gl3dVMT = { + "GL3D", // The classname + sizeof(GGL3DObject), // The object size + gl3dDestroy, // The destroy routine + gl3dRedraw, // The redraw routine + 0, // The after-clear routine +}; + +static bool_t haveGLwindow = FALSE; + +GHandle gwinGGL3DCreate(GDisplay *g, GGL3DObject *gl, const GWindowInit *pInit) { + ZBuffer * zb; + GLContext * glcxt; + + // Only one GL3D window allowed at a time (TinyGL limitation) + if (haveGLwindow) + return 0; + + if (!(gl = (GGL3DObject *)_gwindowCreate(g, &gl->g, pInit, &gl3dVMT, 0))) + return 0; + + // Must be a multiple of 4 bytes + gl->g.width &= ~3; + gl->g.height &= ~3; + + zb = ZB_open(gl->g.width, gl->g.height, ZB_MODE_5R6G5B, 0, NULL, NULL, NULL); + if (!zb) { + if ((gl->g.flags & GWIN_FLG_DYNAMIC)) + gfxFree(gl); + return 0; + } + + /* initialisation of the TinyGL interpreter */ + glInit(zb); + gl->glcxt = glcxt = gl_get_context(); + glcxt->opaque = gl; + glcxt->gl_resize_viewport = gl3dResizeGLViewport; + + /* set the viewport : we force a call to the viewport resize routine */ + glcxt->viewport.xsize=-1; + glcxt->viewport.ysize=-1; + + glViewport(0, 0, gl->g.width, gl->g.height); + + haveGLwindow = TRUE; + gwinSetVisible((GHandle)gl, pInit->show); + return (GHandle)gl; +} + +static void gl3dDestroy(GWindowObject *gh) { + (void) gh; + glClose(); + haveGLwindow = FALSE; +} + +static void gl3dRedraw(GWindowObject *gh) { + ZBuffer * zb; + + zb = ((GGL3DObject *)gh)->glcxt->zb; + gdispGBlitArea(gh->display, gh->x, gh->y, zb->xsize, zb->ysize, 0, 0, zb->linesize/sizeof(color_t), (const pixel_t *)zb->pbuf); +} + +static int gl3dResizeGLViewport(GLContext *c, int *xsize_ptr, int *ysize_ptr) { + int cx, cy; + + cx = *xsize_ptr; + cy = *ysize_ptr; + + // We ensure that cx and cy are multiples of 4 for the zbuffer. TODO: find a better solution + cx &= ~3; + cy &= ~3; + + if (cx <= 0 || cy <= 0) + return -1; + + *xsize_ptr = cx; + *ysize_ptr = cy; + + // Resize the GWIN??? + + // Resize the Z buffer + ZB_resize(c->zb, NULL, cx, cy); + return 0; +} + +/** + * TinyGL support routines + */ + +#include <string.h> + +#define NO_CLIBRARY + +void tgl_warning(const char *format, ...) { (void)format; } +void tgl_trace(const char *format, ...) { (void)format; } +void tgl_fixme(const char *format, ...) { (void)format; } +void gl_fatal_error(char *format, ...) { gfxHalt(format); } +void gl_assert(int test) { if (!test) gfxHalt("TinyGL Assert"); } + +void gl_free(void *p) { gfxFree(p); } +void *gl_malloc(int size) { return gfxAlloc(size); } + +void *gl_zalloc(int size) { + void *p; + + p = gfxAlloc(size); + if (p) + memset(p, 0, size); + return p; +} + + +/** + * Pre-load TinyGL headers + */ + +/** + * TinyGL wrapper code + */ + +#include "3rdparty/tinygl-0.4-ugfx/src/api.c" +#include "3rdparty/tinygl-0.4-ugfx/src/list.c" +#include "3rdparty/tinygl-0.4-ugfx/src/vertex.c" +#include "3rdparty/tinygl-0.4-ugfx/src/init.c" +#include "3rdparty/tinygl-0.4-ugfx/src/matrix.c" +#include "3rdparty/tinygl-0.4-ugfx/src/texture.c" +#include "3rdparty/tinygl-0.4-ugfx/src/misc.c" +#include "3rdparty/tinygl-0.4-ugfx/src/clear.c" +#include "3rdparty/tinygl-0.4-ugfx/src/light.c" +#include "3rdparty/tinygl-0.4-ugfx/src/clip.c" +#include "3rdparty/tinygl-0.4-ugfx/src/select.c" +#include "3rdparty/tinygl-0.4-ugfx/src/get.c" +#include "3rdparty/tinygl-0.4-ugfx/src/zbuffer.c" +#include "3rdparty/tinygl-0.4-ugfx/src/zline.c" +#include "3rdparty/tinygl-0.4-ugfx/src/zdither.c" +#include "3rdparty/tinygl-0.4-ugfx/src/ztriangle.c" +#include "3rdparty/tinygl-0.4-ugfx/src/zmath.c" +#include "3rdparty/tinygl-0.4-ugfx/src/image_util.c" +#include "3rdparty/tinygl-0.4-ugfx/src/arrays.c" +#include "3rdparty/tinygl-0.4-ugfx/src/specbuf.c" + +#endif /* GFX_USE_GWIN && GWIN_NEED_GL3D */ diff --git a/src/gwin/gwin_gl3d.h b/src/gwin/gwin_gl3d.h new file mode 100644 index 00000000..644f45bf --- /dev/null +++ b/src/gwin/gwin_gl3d.h @@ -0,0 +1,70 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +/** + * @file src/gwin/gwin_gl3d.h + * @brief GWIN 3D module header file + * + * @defgroup 3D 3D + * @ingroup Windows + * + * @details 3D GWIN window based on OpenGL (or more exactly Tiny GL) + * @pre GFX_USE_GWIN must be set to TRUE in your gfxconf.h + * @pre GWIN_NEED_GL3D must be set to TRUE in your gfxconf.h + * + * @{ + */ + +#ifndef _GWIN_GL3D_H +#define _GWIN_GL3D_H + +/* This file is included within "src/gwin/sys_defs.h" */ + + +// A gl3d window +typedef struct GGL3DObject { + GWindowObject g; + struct GLContext * glcxt; + } GGL3DObject; + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Create a gl3d window. + * @return NULL if there is no resultant drawing area, otherwise a window handle. + * + * @param[in] g The GDisplay to display this window on + * @param[in] gg The GGL3DObject structure to initialise. If this is NULL the structure is dynamically allocated. + * @param[in] pInit The initialization parameters to use + * + * @note The drawing color and the background color get set to the current defaults. If you haven't called + * @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are White and Black respectively. + * @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there + * is no default font and text drawing operations will no nothing. + * @note The dimensions and position may be changed to fit on the real screen. + * + * @api + */ +GHandle gwinGGL3DCreate(GDisplay *g, GGL3DObject *gg, const GWindowInit *pInit); +#define gwinGL3DCreate(gg, pInit) gwinGGL3DCreate(GDISP, gg, pInit) + +/* Include the gl interface */ +#include "3rdparty/tinygl-0.4-ugfx/include/GL/gl.h" + +#ifdef __cplusplus +} +#endif + +#endif /* _GWIN_GL3D_H */ +/** @} */ + diff --git a/src/gwin/graph.c b/src/gwin/gwin_graph.c index 4fcfad37..8a450a9f 100644 --- a/src/gwin/graph.c +++ b/src/gwin/gwin_graph.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/graph.c + * @file src/gwin/gwin_graph.c * @brief GWIN sub-system button code */ @@ -14,7 +14,7 @@ #if GFX_USE_GWIN && GWIN_NEED_GRAPH -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" #define GGRAPH_FLG_CONNECTPOINTS (GWIN_FIRST_CONTROL_FLAG<<0) #define GGRAPH_ARROW_SIZE 5 diff --git a/src/gwin/graph.h b/src/gwin/gwin_graph.h index be51f66c..eea80679 100644 --- a/src/gwin/graph.h +++ b/src/gwin/gwin_graph.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/graph.h + * @file src/gwin/gwin_graph.h * @brief GWIN GRAPH module header file * * @defgroup Graph Graph @@ -22,7 +22,7 @@ #ifndef _GWIN_GRAPH_H #define _GWIN_GRAPH_H -/* This file is included within "gwin/gwin.h" */ +/* This file is included within "src/gwin/sys_defs.h" */ typedef enum GGraphPointType_e { GGRAPH_POINT_NONE, GGRAPH_POINT_DOT, GGRAPH_POINT_SQUARE, GGRAPH_POINT_CIRCLE diff --git a/src/gwin/gwin.c b/src/gwin/gwin_gwin.c index 9b0fb03a..a4cef125 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin_gwin.c @@ -5,11 +5,16 @@ * http://ugfx.org/license.html */ +/** + * @file src/gwin/gwin_gwin.c + * @brief GWIN sub-system code + */ + #include "gfx.h" #if GFX_USE_GWIN -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" /*----------------------------------------------- * Data @@ -101,6 +106,40 @@ GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit return (GHandle)pgw; } +// Internal routine for use by GWIN components only +void _gwinDestroy(GHandle gh, GRedrawMethod how) { + if (!gh) + return; + + // Make the window invisible + gwinSetVisible(gh, FALSE); + + // Make sure it is flushed first - must be REDRAW_WAIT or REDRAW_INSESSION + _gwinFlushRedraws(how); + + #if GWIN_NEED_CONTAINERS + // Notify the parent it is about to be deleted + if (gh->parent && ((gcontainerVMT *)gh->parent->vmt)->NotifyDelete) + ((gcontainerVMT *)gh->parent->vmt)->NotifyDelete(gh->parent, gh); + #endif + + // Remove from the window manager + #if GWIN_NEED_WINDOWMANAGER + _GWINwm->vmt->Delete(gh); + #endif + + // Class destroy routine + if (gh->vmt->Destroy) + gh->vmt->Destroy(gh); + + // Clean up the structure + if (gh->flags & GWIN_FLG_DYNAMIC) { + gh->flags = 0; // To be sure, to be sure + gfxFree((void *)gh); + } else + gh->flags = 0; // To be sure, to be sure +} + /*----------------------------------------------- * Routines that affect all windows *-----------------------------------------------*/ @@ -152,39 +191,6 @@ GHandle gwinGWindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pI return pgw; } -void _gwinDestroy(GHandle gh, GRedrawMethod how) { - if (!gh) - return; - - // Make the window invisible - gwinSetVisible(gh, FALSE); - - // Make sure it is flushed first - must be REDRAW_WAIT or REDRAW_INSESSION - _gwinFlushRedraws(how); - - #if GWIN_NEED_CONTAINERS - // Notify the parent it is about to be deleted - if (gh->parent && ((gcontainerVMT *)gh->parent->vmt)->NotifyDelete) - ((gcontainerVMT *)gh->parent->vmt)->NotifyDelete(gh->parent, gh); - #endif - - // Remove from the window manager - #if GWIN_NEED_WINDOWMANAGER - _GWINwm->vmt->Delete(gh); - #endif - - // Class destroy routine - if (gh->vmt->Destroy) - gh->vmt->Destroy(gh); - - // Clean up the structure - if (gh->flags & GWIN_FLG_DYNAMIC) { - gh->flags = 0; // To be sure, to be sure - gfxFree((void *)gh); - } else - gh->flags = 0; // To be sure, to be sure -} - void gwinDestroy(GHandle gh) { _gwinDestroy(gh, REDRAW_WAIT); } diff --git a/src/gwin/gimage.c b/src/gwin/gwin_image.c index d5ca2c38..370d7bdd 100644 --- a/src/gwin/gimage.c +++ b/src/gwin/gwin_image.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/gimage.c + * @file src/gwin/gwin_image.c * @brief GWIN sub-system image code */ @@ -14,7 +14,7 @@ #if GFX_USE_GWIN && GWIN_NEED_IMAGE -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" #define widget(gh) ((GImageObject *)gh) diff --git a/src/gwin/gimage.h b/src/gwin/gwin_image.h index 0052f024..2e0a3218 100644 --- a/src/gwin/gimage.h +++ b/src/gwin/gwin_image.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/gimage.h + * @file src/gwin/gwin_image.h * @brief GWIN image widget header file. * * @defgroup ImageBox ImageBox @@ -27,7 +27,7 @@ #ifndef _GWIN_IMAGE_H #define _GWIN_IMAGE_H -// This file is included within "gwin/gwin.h" +// This file is included within "src/gwin/sys_defs.h" // An image window typedef struct GImageObject { diff --git a/src/gwin/label.c b/src/gwin/gwin_label.c index 4faba95c..3be9d0a9 100644 --- a/src/gwin/label.c +++ b/src/gwin/gwin_label.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/label.c + * @file src/gwin/gwin_label.c * @brief GWIN label widget header file */ @@ -14,7 +14,7 @@ #if GFX_USE_GWIN && GWIN_NEED_LABEL -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" // macros to assist in data type conversions #define gh2obj ((GLabelObject *)gh) diff --git a/src/gwin/label.h b/src/gwin/gwin_label.h index e0b32240..b5c45589 100644 --- a/src/gwin/label.h +++ b/src/gwin/gwin_label.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/label.h + * @file src/gwin/gwin_label.h * @brief GWIN label widget header file * * @defgroup Label Label @@ -27,7 +27,7 @@ #ifndef _GWIN_LABEL_H #define _GWIN_LABEL_H -// This file is included within "gwin/gwin.h" +// This file is included within "src/gwin/gwin_widget.h" // An label window typedef struct GLabelObject { diff --git a/src/gwin/list.c b/src/gwin/gwin_list.c index 98ec2ed5..265053e1 100644 --- a/src/gwin/list.c +++ b/src/gwin/gwin_list.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/list.c + * @file src/gwin/gwin_list.c * @brief GWIN list widget header file */ @@ -14,7 +14,7 @@ #if GFX_USE_GWIN && GWIN_NEED_LIST -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" #include <string.h> #include <stdlib.h> @@ -64,7 +64,7 @@ static void sendListEvent(GWidgetObject *gw, int item) { continue; ple->type = GEVENT_GWIN_LIST; - ple->list = (GHandle)gw; + ple->gwin = (GHandle)gw; ple->item = item; #if GWIN_WIDGET_TAGS ple->tag = gw->tag; diff --git a/src/gwin/list.h b/src/gwin/gwin_list.h index 1eae3c19..a55d4cb8 100644 --- a/src/gwin/list.h +++ b/src/gwin/gwin_list.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/list.h + * @file src/gwin/gwin_list.h * @brief GWIN list widget header file * * @defgroup List List @@ -26,23 +26,23 @@ #ifndef _GWIN_LIST_H #define _GWIN_LIST_H -// This file is included within "gwin/gwin.h" +// This file is included within "src/gwin/gwin_widget.h" /** * @brief The event type for a list event */ -#define GEVENT_GWIN_LIST (GEVENT_GWIN_FIRST+4) +#define GEVENT_GWIN_LIST (GEVENT_GWIN_CTRL_FIRST+4) /** * @brief A list event */ typedef struct GEventGWinList { GEventType type; // The type of this event (GEVENT_GWIN_LIST) - GHandle list; // The list - int item; // The item that has been selected (or unselected in a multi-select listbox) + GHandle gwin; // The list #if GWIN_WIDGET_TAGS WidgetTag tag; // The list tag #endif + int item; // The item that has been selected (or unselected in a multi-select listbox) } GEventGWinList; // A list window diff --git a/src/gwin/progressbar.c b/src/gwin/gwin_progressbar.c index 90be6e43..ef28e8dc 100644 --- a/src/gwin/progressbar.c +++ b/src/gwin/gwin_progressbar.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/progressbar.c + * @file src/gwin/gwin_progressbar.c * @brief GWIN sub-system progressbar code */ @@ -14,7 +14,7 @@ #if (GFX_USE_GWIN && GWIN_NEED_PROGRESSBAR) || defined(__DOXYGEN__) -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" // Reset the display position back to the value predicted by the saved progressbar position static void ResetDisplayPos(GProgressbarObject *gsw) { diff --git a/src/gwin/progressbar.h b/src/gwin/gwin_progressbar.h index 4dadf904..49c11a98 100644 --- a/src/gwin/progressbar.h +++ b/src/gwin/gwin_progressbar.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/progressbar.h + * @file src/gwin/gwin_progressbar.h * @brief GWIN Graphic window subsystem header file. * * @defgroup Progressbar Progressbar @@ -22,6 +22,7 @@ #ifndef _GWIN_PROGRESSBAR_H #define _GWIN_PROGRESSBAR_H +/* This file is included within src/gwin/gwin_widget.h */ // A progressbar window typedef struct GProgressbarObject { GWidgetObject w; diff --git a/src/gwin/radio.c b/src/gwin/gwin_radio.c index 557061e4..0bafa7cc 100644 --- a/src/gwin/radio.c +++ b/src/gwin/gwin_radio.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/radio.c + * @file src/gwin/gwin_radio.c * @brief GWIN sub-system radio button code */ @@ -14,7 +14,7 @@ #if GFX_USE_GWIN && GWIN_NEED_RADIO -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" #define GRADIO_TAB_CNR 8 // Diagonal corner on active tab #define GRADIO_TOP_FADE 50 // (GRADIO_TOP_FADE/255)% fade to white for top of tab/button @@ -36,7 +36,7 @@ static void SendRadioEvent(GWidgetObject *gw) { if (!(pe = geventGetEventBuffer(psl))) continue; pbe->type = GEVENT_GWIN_RADIO; - pbe->radio = (GHandle)gw; + pbe->gwin = (GHandle)gw; pbe->group = ((GRadioObject *)gw)->group; #if GWIN_WIDGET_TAGS pbe->tag = gw->tag; diff --git a/src/gwin/radio.h b/src/gwin/gwin_radio.h index eb7ee719..d5c9c21a 100644 --- a/src/gwin/radio.h +++ b/src/gwin/gwin_radio.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/radio.h + * @file src/gwin/gwin_radio.h * @brief GWIN Graphic window subsystem header file. * * @defgroup RadioButton RadioButton @@ -22,12 +22,12 @@ #ifndef _GWIN_RADIO_H #define _GWIN_RADIO_H -/* This file is included within "gwin/gwidget.h" */ +/* This file is included within "src/gwin/gwin_widget.h" */ /** * @brief The Event Type for a Radio Event */ -#define GEVENT_GWIN_RADIO (GEVENT_GWIN_FIRST+3) +#define GEVENT_GWIN_RADIO (GEVENT_GWIN_CTRL_FIRST+3) /** * @brief A Button Event @@ -35,11 +35,11 @@ */ typedef struct GEventGWinRadio { GEventType type; // The type of this event (GEVENT_GWIN_RADIO) - GHandle radio; // The radio button that has been depressed - uint16_t group; // The group for this radio button + GHandle gwin; // The radio button that has been depressed #if GWIN_WIDGET_TAGS WidgetTag tag; // The radio tag #endif + uint16_t group; // The group for this radio button } GEventGWinRadio; /** diff --git a/src/gwin/slider.c b/src/gwin/gwin_slider.c index 7ce7b83f..f1230d5a 100644 --- a/src/gwin/slider.c +++ b/src/gwin/gwin_slider.c @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/slider.c + * @file src/gwin/gwin_slider.c * @brief GWIN sub-system slider code */ @@ -14,7 +14,7 @@ #if (GFX_USE_GWIN && GWIN_NEED_SLIDER) || defined(__DOXYGEN__) -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" #ifndef GWIN_SLIDER_DEAD_BAND #define GWIN_SLIDER_DEAD_BAND 5 @@ -36,7 +36,7 @@ static void SendSliderEvent(GWidgetObject *gw) { if (!(pe = geventGetEventBuffer(psl))) continue; pse->type = GEVENT_GWIN_SLIDER; - pse->slider = (GHandle)gw; + pse->gwin = (GHandle)gw; pse->position = ((GSliderObject *)gw)->pos; #if GWIN_WIDGET_TAGS pse->tag = gw->tag; diff --git a/src/gwin/slider.h b/src/gwin/gwin_slider.h index 32161d62..b88d6dfd 100644 --- a/src/gwin/slider.h +++ b/src/gwin/gwin_slider.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/slider.h + * @file src/gwin/gwin_slider.h * @brief GWIN Graphic window subsystem header file. * * @defgroup Slider Slider @@ -22,17 +22,17 @@ #ifndef _GWIN_SLIDER_H #define _GWIN_SLIDER_H -/* This file is included within "gwin/gwidget.h" */ +/* This file is included within "src/gwin/gwin_widget.h" */ -#define GEVENT_GWIN_SLIDER (GEVENT_GWIN_FIRST+1) +#define GEVENT_GWIN_SLIDER (GEVENT_GWIN_CTRL_FIRST+1) typedef struct GEventGWinSlider { GEventType type; // The type of this event (GEVENT_GWIN_BUTTON) - GHandle slider; // The slider that is returning results - int position; + GHandle gwin; // The slider that is returning results #if GWIN_WIDGET_TAGS WidgetTag tag; // The slider tag #endif + int position; } GEventGWinSlider; // There are currently no GEventGWinSlider listening flags - use 0 diff --git a/src/gwin/gwidget.c b/src/gwin/gwin_widget.c index c9fff50e..f85e6f20 100644 --- a/src/gwin/gwidget.c +++ b/src/gwin/gwin_widget.c @@ -5,13 +5,18 @@ * http://ugfx.org/license.html */ +/** + * @file src/gwin/gwin_widget.c + * @brief GWIN sub-system widget code + */ + #include "gfx.h" #if GFX_USE_GWIN && GWIN_NEED_WIDGET #include <string.h> -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" /* Our listener for events for widgets */ static GListener gl; @@ -302,6 +307,24 @@ void _gwidgetRedraw(GHandle gh) { gw->fnDraw(gw, gw->fnParam); } +void _gwinSendEvent(GHandle gh, GEventType type) { + GSourceListener * psl; + GEventGWin * pge; + + // Trigger a GWIN Event + psl = 0; + while ((psl = geventGetSourceListener(GWIDGET_SOURCE, psl))) { + if (!(pge = (GEventGWin *)geventGetEventBuffer(psl))) + continue; + pge->type = type; + pge->gwin = gh; + #if GWIN_WIDGET_TAGS + pge->tag = (gh->flags & GWIN_FLG_WIDGET) ? ((GWidgetObject *)gh)->tag : 0; + #endif + geventSendEvent(psl); + } +} + void gwinWidgetClearInit(GWidgetInit *pwi) { char *p; unsigned len; diff --git a/src/gwin/gwidget.h b/src/gwin/gwin_widget.h index bd1ea4c8..81c76263 100644 --- a/src/gwin/gwidget.h +++ b/src/gwin/gwin_widget.h @@ -6,7 +6,7 @@ */ /** - * @file src/gwin/gwidget.h + * @file src/gwin/gwin_widget.h * @brief GWIN Widgets header file. * * @defgroup Widget Widget @@ -23,7 +23,7 @@ #ifndef _GWIDGET_H #define _GWIDGET_H -/* This file is included within "gwin/gwin.h" */ +/* This file is included within "src/gwin/sys_defs.h" */ // Forward definition struct GWidgetObject; @@ -135,6 +135,36 @@ typedef struct GWidgetObject { * won't support it even with special flags. */ +/** + * @brief A Generic GWIN Event + * @note All gwin windows when sending events will either use this structure or a + * structure that is 100% compatible except that it may also have extra fields. + * @note There are currently no GEventGWin listening flags - use 0 as the flags to @p gwinAttachListener() + * + * @{ + */ +typedef struct GEventGWin { + GEventType type; // The type of this event + GHandle gwin; // The gwin window handle + #if GWIN_NEED_WIDGET && GWIN_WIDGET_TAGS + WidgetTag tag; // The tag (if applicable) + #endif +} GEventGWin; +/** @} */ + +/** + * @brief The list of predefined GWIN events. + * @note The definition of an event type does not mean it is always sent. For example, + * close events are sent by Frame windows but by little else. They are normally + * only sent if there is a specific reason that the event should be sent. + * @{ + */ +#define GEVENT_GWIN_OPEN (GEVENT_GWIN_FIRST+0x00) +#define GEVENT_GWIN_CLOSE (GEVENT_GWIN_FIRST+0x01) +#define GEVENT_GWIN_RESIZE (GEVENT_GWIN_FIRST+0x02) +#define GEVENT_GWIN_CTRL_FIRST (GEVENT_GWIN_FIRST+0x40) +/** @} */ + #ifdef __cplusplus extern "C" { #endif @@ -330,31 +360,31 @@ bool_t gwinAttachListener(GListener *pl); /* Include extra widget types */ #if GWIN_NEED_BUTTON || defined(__DOXYGEN__) - #include "src/gwin/button.h" + #include "gwin_button.h" #endif #if GWIN_NEED_SLIDER || defined(__DOXYGEN__) - #include "src/gwin/slider.h" + #include "gwin_slider.h" #endif #if GWIN_NEED_CHECKBOX || defined(__DOXYGEN__) - #include "src/gwin/checkbox.h" + #include "gwin_checkbox.h" #endif #if GWIN_NEED_RADIO || defined(__DOXYGEN__) - #include "src/gwin/radio.h" + #include "gwin_radio.h" #endif #if GWIN_NEED_LABEL || defined(__DOXYGEN__) - #include "src/gwin/label.h" + #include "gwin_label.h" #endif #if GWIN_NEED_LIST || defined(__DOXYGEN__) - #include "src/gwin/list.h" + #include "gwin_list.h" #endif #if GWIN_NEED_PROGRESSBAR || defined(__DOXYGEN__) - #include "src/gwin/progressbar.h" + #include "gwin_progressbar.h" #endif #endif /* _GWIDGET_H */ diff --git a/src/gwin/gwm.c b/src/gwin/gwin_wm.c index ba7a132a..92d68c7b 100644 --- a/src/gwin/gwm.c +++ b/src/gwin/gwin_wm.c @@ -5,6 +5,11 @@ * http://ugfx.org/license.html */ +/** + * @file src/gwin/gwin_wm.c + * @brief GWIN sub-system window manager code + */ + #include "gfx.h" #if GFX_USE_GWIN && !GWIN_NEED_WINDOWMANAGER @@ -13,7 +18,7 @@ */ - #include "src/gwin/class_gwin.h" + #include "gwin_class.h" // Needed if there is no window manager #define MIN_WIN_WIDTH 1 @@ -147,7 +152,7 @@ #if GFX_USE_GWIN && GWIN_NEED_WINDOWMANAGER -#include "src/gwin/class_gwin.h" +#include "gwin_class.h" /*----------------------------------------------- * Data diff --git a/src/gwin/sys_defs.h b/src/gwin/sys_defs.h index 4b103d11..5e08f7a2 100644 --- a/src/gwin/sys_defs.h +++ b/src/gwin/sys_defs.h @@ -950,25 +950,26 @@ extern "C" { /* Include widgets */ #if GWIN_NEED_WIDGET || defined(__DOXYGEN__) - #include "src/gwin/gwidget.h" + #include "gwin_widget.h" #endif /* Include containers */ #if GWIN_NEED_CONTAINERS || defined(__DOXYGEN__) - #include "src/gwin/gcontainer.h" + #include "gwin_container.h" #endif /* Include vanilla window objects */ #if GWIN_NEED_CONSOLE || defined(__DOXYGEN__) - #include "src/gwin/console.h" + #include "gwin_console.h" #endif - #if GWIN_NEED_GRAPH || defined(__DOXYGEN__) - #include "src/gwin/graph.h" + #include "gwin_graph.h" #endif - #if GWIN_NEED_IMAGE || defined(__DOXYGEN__) - #include "src/gwin/gimage.h" + #include "gwin_image.h" + #endif + #if GWIN_NEED_GL3D || defined(__DOXYGEN__) + #include "gwin_gl3d.h" #endif #endif /* GFX_USE_GWIN */ diff --git a/src/gwin/sys_make.mk b/src/gwin/sys_make.mk index 95a2ba84..81277a4e 100644 --- a/src/gwin/sys_make.mk +++ b/src/gwin/sys_make.mk @@ -1,16 +1,18 @@ -GFXSRC += $(GFXLIB)/src/gwin/gwin.c \ - $(GFXLIB)/src/gwin/gwidget.c \ - $(GFXLIB)/src/gwin/gwm.c \ - $(GFXLIB)/src/gwin/console.c \ - $(GFXLIB)/src/gwin/graph.c \ - $(GFXLIB)/src/gwin/button.c \ - $(GFXLIB)/src/gwin/slider.c \ - $(GFXLIB)/src/gwin/checkbox.c \ - $(GFXLIB)/src/gwin/gimage.c \ - $(GFXLIB)/src/gwin/label.c \ - $(GFXLIB)/src/gwin/radio.c \ - $(GFXLIB)/src/gwin/list.c \ - $(GFXLIB)/src/gwin/progressbar.c \ - $(GFXLIB)/src/gwin/gcontainer.c \ - $(GFXLIB)/src/gwin/frame.c \ - +GFXSRC += $(GFXLIB)/src/gwin/gwin_gwin.c \ + $(GFXLIB)/src/gwin/gwin_widget.c \ + $(GFXLIB)/src/gwin/gwin_wm.c \ + $(GFXLIB)/src/gwin/gwin_console.c \ + $(GFXLIB)/src/gwin/gwin_graph.c \ + $(GFXLIB)/src/gwin/gwin_button.c \ + $(GFXLIB)/src/gwin/gwin_slider.c \ + $(GFXLIB)/src/gwin/gwin_checkbox.c \ + $(GFXLIB)/src/gwin/gwin_image.c \ + $(GFXLIB)/src/gwin/gwin_label.c \ + $(GFXLIB)/src/gwin/gwin_radio.c \ + $(GFXLIB)/src/gwin/gwin_list.c \ + $(GFXLIB)/src/gwin/gwin_progressbar.c \ + $(GFXLIB)/src/gwin/gwin_container.c \ + $(GFXLIB)/src/gwin/gwin_frame.c \ + $(GFXLIB)/src/gwin/gwin_gl3d.c \ + +GFXINC += $(GFXLIB)/3rdparty/tinygl-0.4-ugfx/include diff --git a/src/gwin/sys_options.h b/src/gwin/sys_options.h index d5240556..199cad5b 100644 --- a/src/gwin/sys_options.h +++ b/src/gwin/sys_options.h @@ -73,6 +73,13 @@ #define GWIN_NEED_GRAPH FALSE #endif /** + * @brief Should gl3d functions be included. + * @details Defaults to FALSE + */ + #ifndef GWIN_NEED_GL3D + #define GWIN_NEED_GL3D FALSE + #endif + /** * @brief Should button functions be included. * @details Defaults to FALSE */ |