aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gimage.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-02-07 14:07:29 +1000
committerinmarket <andrewh@inmarket.com.au>2014-02-07 14:07:29 +1000
commitbd4827922708efc85c878ebd17ca6a8c88bc75b5 (patch)
treedfd224ab4f0d1157bb5ba5466e636525cdb61f51 /src/gwin/gimage.c
parent695bcbee5b84cd2e152baca91c58bdc2e971b0d1 (diff)
downloaduGFX-bd4827922708efc85c878ebd17ca6a8c88bc75b5.tar.gz
uGFX-bd4827922708efc85c878ebd17ca6a8c88bc75b5.tar.bz2
uGFX-bd4827922708efc85c878ebd17ca6a8c88bc75b5.zip
Update gwin Images to properly use new GFILE based images
Diffstat (limited to 'src/gwin/gimage.c')
-rw-r--r--src/gwin/gimage.c55
1 files changed, 2 insertions, 53 deletions
diff --git a/src/gwin/gimage.c b/src/gwin/gimage.c
index b1f8e078..e4032b96 100644
--- a/src/gwin/gimage.c
+++ b/src/gwin/gimage.c
@@ -139,37 +139,11 @@ GHandle gwinGImageCreate(GDisplay *g, GImageObject *gobj, GWindowInit *pInit) {
return (GHandle)gobj;
}
-bool_t gwinImageOpenMemory(GHandle gh, const void* memory) {
+bool_t gwinImageOpenGFile(GHandle gh, GFILE *f) {
if (gdispImageIsOpen(&widget(gh)->image))
gdispImageClose(&widget(gh)->image);
- if (!gdispImageSetMemoryReader(&widget(gh)->image, memory))
- return FALSE;
-
- if (gdispImageOpen(&widget(gh)->image) != GDISP_IMAGE_ERR_OK)
- return FALSE;
-
- if ((gh->flags & GWIN_FLG_VISIBLE)) {
- // Setting the clip here shouldn't be necessary if the redraw doesn't overdraw
- // but we put it in for safety anyway
- #if GDISP_NEED_CLIP
- gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
- #endif
- _redraw(gh);
- }
-
- return TRUE;
-}
-
-#if defined(WIN32) || GFX_USE_OS_WIN32 || GFX_USE_OS_LINUX || GFX_USE_OS_OSX || defined(__DOXYGEN__)
-bool_t gwinImageOpenFile(GHandle gh, const char* filename) {
- if (gdispImageIsOpen(&widget(gh)->image))
- gdispImageClose(&widget(gh)->image);
-
- if (!gdispImageSetFileReader(&widget(gh)->image, filename))
- return FALSE;
-
- if (gdispImageOpen(&widget(gh)->image) != GDISP_IMAGE_ERR_OK)
+ if ((gdispImageOpenGFile(&widget(gh)->image, f) & GDISP_IMAGE_ERR_UNRECOVERABLE))
return FALSE;
if ((gh->flags & GWIN_FLG_VISIBLE)) {
@@ -183,31 +157,6 @@ bool_t gwinImageOpenFile(GHandle gh, const char* filename) {
return TRUE;
}
-#endif
-
-#if GFX_USE_OS_CHIBIOS || defined(__DOXYGEN__)
-bool_t gwinImageOpenStream(GHandle gh, void *streamPtr) {
- if (gdispImageIsOpen(&widget(gh)->image))
- gdispImageClose(&widget(gh)->image);
-
- if (!gdispImageSetBaseFileStreamReader(&widget(gh)->image, streamPtr))
- return FALSE;
-
- if (gdispImageOpen(&widget(gh)->image) != GDISP_IMAGE_ERR_OK)
- return FALSE;
-
- if ((gh->flags & GWIN_FLG_VISIBLE)) {
- // Setting the clip here shouldn't be necessary if the redraw doesn't overdraw
- // but we put it in for safety anyway
- #if GDISP_NEED_CLIP
- gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
- #endif
- _redraw(gh);
- }
-
- return TRUE;
-}
-#endif
gdispImageError gwinImageCache(GHandle gh) {
return gdispImageCache(&widget(gh)->image);