diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-07-01 17:47:35 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-07-01 17:47:35 +1000 |
commit | 4afd5ec74429232e4db96001ed89757b0ba55ee7 (patch) | |
tree | 5889174cdcadbf39655a178509073952f68462d8 /src | |
parent | de27a6c2db6f5fb97b3a5d07395a629c879abfbc (diff) | |
parent | df5f701a11ea5603f1f0b44f0e6bd96084b6d09d (diff) | |
download | uGFX-4afd5ec74429232e4db96001ed89757b0ba55ee7.tar.gz uGFX-4afd5ec74429232e4db96001ed89757b0ba55ee7.tar.bz2 uGFX-4afd5ec74429232e4db96001ed89757b0ba55ee7.zip |
Merge branch 'GWIN' into image
Diffstat (limited to 'src')
-rw-r--r-- | src/gdisp/image.c | 8 | ||||
-rw-r--r-- | src/gwin/button.c | 2 | ||||
-rw-r--r-- | src/gwin/checkbox.c | 2 | ||||
-rw-r--r-- | src/gwin/console.c | 2 | ||||
-rw-r--r-- | src/gwin/graph.c | 2 | ||||
-rw-r--r-- | src/gwin/gwidget.c | 2 | ||||
-rw-r--r-- | src/gwin/gwin.c | 6 | ||||
-rw-r--r-- | src/gwin/slider.c | 2 |
8 files changed, 17 insertions, 9 deletions
diff --git a/src/gdisp/image.c b/src/gdisp/image.c index fec05147..efeb6ad1 100644 --- a/src/gdisp/image.c +++ b/src/gdisp/image.c @@ -184,6 +184,14 @@ void gdispImageClose(gdispImage *img) { img->fns->close(img); else img->io.fns->close(&img->io); + img->type = GDISP_IMAGE_TYPE_UNKNOWN; + img->flags = 0; + img->fns = 0; + img->priv = 0; +} + +bool_t gdispImageIsOpen(gdispImage *img) { + return img->type != GDISP_IMAGE_TYPE_UNKNOWN && img->fns != 0; } void gdispImageSetBgColor(gdispImage *img, color_t bgcolor) { diff --git a/src/gwin/button.c b/src/gwin/button.c index 4f823aa6..303d1078 100644 --- a/src/gwin/button.c +++ b/src/gwin/button.c @@ -151,7 +151,7 @@ static uint16_t ToggleGet(GWidgetObject *gw, uint16_t role) { return ((GButtonObject *)gw)->toggle; } -GHandle gwinCreateButton(GButtonObject *gw, GWidgetInit *pInit) { +GHandle gwinCreateButton(GButtonObject *gw, const GWidgetInit *pInit) { if (!(gw = (GButtonObject *)_gwidgetCreate(&gw->w, pInit, &buttonVMT))) return 0; diff --git a/src/gwin/checkbox.c b/src/gwin/checkbox.c index b4628ae0..62f4c55b 100644 --- a/src/gwin/checkbox.c +++ b/src/gwin/checkbox.c @@ -113,7 +113,7 @@ static uint16_t ToggleGet(GWidgetObject *gw, uint16_t role) { return ((GCheckboxObject *)gw)->toggle; } -GHandle gwinCreateCheckbox(GCheckboxObject *gb, GWidgetInit *pInit) { +GHandle gwinCreateCheckbox(GCheckboxObject *gb, const GWidgetInit *pInit) { if (!(gb = (GCheckboxObject *)_gwidgetCreate(&gb->w, pInit, &checkboxVMT))) return 0; diff --git a/src/gwin/console.c b/src/gwin/console.c index 39e534b4..105cc79d 100644 --- a/src/gwin/console.c +++ b/src/gwin/console.c @@ -66,7 +66,7 @@ static const gwinVMT consoleVMT = { AfterClear, // The after-clear routine }; -GHandle gwinCreateConsole(GConsoleObject *gc, GWindowInit *pInit) { +GHandle gwinCreateConsole(GConsoleObject *gc, const GWindowInit *pInit) { if (!(gc = (GConsoleObject *)_gwindowCreate(&gc->g, pInit, &consoleVMT, 0))) return 0; #if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM diff --git a/src/gwin/graph.c b/src/gwin/graph.c index 81ce1b5f..049f52e0 100644 --- a/src/gwin/graph.c +++ b/src/gwin/graph.c @@ -165,7 +165,7 @@ static void lineto(GGraphObject *gg, coord_t x0, coord_t y0, coord_t x1, coord_t } } -GHandle gwinCreateGraph(GGraphObject *gg, GWindowInit *pInit) { +GHandle gwinCreateGraph(GGraphObject *gg, const GWindowInit *pInit) { if (!(gg = (GGraphObject *)_gwindowCreate(&gg->g, pInit, &graphVMT, 0))) return 0; gg->xorigin = gg->yorigin = 0; diff --git a/src/gwin/gwidget.c b/src/gwin/gwidget.c index 2825bf4c..a2b82f1d 100644 --- a/src/gwin/gwidget.c +++ b/src/gwin/gwidget.c @@ -165,7 +165,7 @@ void _gwidgetInit(void) { geventRegisterCallback(&gl, gwidgetEvent, 0); } -GHandle _gwidgetCreate(GWidgetObject *pgw, GWidgetInit *pInit, const gwidgetVMT *vmt) { +GHandle _gwidgetCreate(GWidgetObject *pgw, const GWidgetInit *pInit, const gwidgetVMT *vmt) { if (!(pgw = (GWidgetObject *)_gwindowCreate(&pgw->g, &pInit->g, &vmt->g, GWIN_FLG_WIDGET|GWIN_FLG_ENABLED))) return 0; diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 110d35cc..c1122b3f 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -52,7 +52,7 @@ static color_t defaultBgColor = Black; } else gwinClear(gh); } - static void _gwm_redim(GHandle gh, GWindowInit *pInit) { + static void _gwm_redim(GHandle gh, const GWindowInit *pInit) { gh->x = pInit->x; gh->y = pInit->y; gh->width = pInit->width; gh->height = pInit->height; if (gh->x < 0) { gh->width += gh->x; gh->x = 0; } @@ -85,7 +85,7 @@ void _gwinInit(void) { // Internal routine for use by GWIN components only // Initialise a window creating it dynamically if required. -GHandle _gwindowCreate(GWindowObject *pgw, GWindowInit *pInit, const gwinVMT *vmt, uint16_t flags) { +GHandle _gwindowCreate(GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint16_t flags) { // Allocate the structure if necessary if (!pgw) { if (!(pgw = (GWindowObject *)gfxAlloc(vmt->size))) @@ -149,7 +149,7 @@ void gwinSetDefaultBgColor(color_t bgclr) { * The GWindow Routines *-----------------------------------------------*/ -GHandle gwinCreateWindow(GWindowObject *pgw, GWindowInit *pInit) { +GHandle gwinCreateWindow(GWindowObject *pgw, const GWindowInit *pInit) { if (!(pgw = _gwindowCreate(pgw, pInit, &basegwinVMT, 0))) return 0; gwinSetVisible(pgw, pInit->show); diff --git a/src/gwin/slider.c b/src/gwin/slider.c index 08dd6ca7..2dfa3a7c 100644 --- a/src/gwin/slider.c +++ b/src/gwin/slider.c @@ -233,7 +233,7 @@ static uint16_t DialGet(GWidgetObject *gw, uint16_t role) { return ((GSliderObject *)gw)->dial; } -GHandle gwinCreateSlider(GSliderObject *gs, GWidgetInit *pInit) { +GHandle gwinCreateSlider(GSliderObject *gs, const GWidgetInit *pInit) { if (!(gs = (GSliderObject *)_gwidgetCreate(&gs->w, pInit, &sliderVMT))) return 0; gs->t_dn = (uint16_t) -1; |