13 #include "../../gfx.h" 15 #if GFX_USE_GWIN && GWIN_NEED_IMAGE 17 #include "gwin_class.h" 19 #define gw ((GImageObject *)gh) 23 #if GWIN_NEED_IMAGE_ANIMATION 30 #if GWIN_NEED_IMAGE_ANIMATION 31 static void ImageTimer(
void *param) {
36 static void ImageRedraw(
GHandle gh) {
39 #if GWIN_NEED_IMAGE_ANIMATION 59 if (gw->image.width < w) {
70 else if (gw->image.width > w) {
71 dx = (gw->image.width - w)/2;
75 if (gw->image.height < h) {
86 else if (gw->image.height > h) {
87 dy = (gw->image.height - h)/2;
96 #if GWIN_NEED_IMAGE_ANIMATION 117 static const gwinVMT imageVMT = {
119 sizeof(GImageObject),
126 if (!(gobj = (GImageObject *)_gwindowCreate(g, &gobj->g, pInit, &imageVMT, 0)))
133 #if GWIN_NEED_IMAGE_ANIMATION 161 return GDISP_IMAGE_ERR_BADFORMAT;
167 #endif // GFX_USE_GWIN && GWIN_NEED_IMAGE delaytime_t gdispImageNext(gdispImage *img)
Prepare for the next frame/page in the image file.
const struct gwinVMT * vmt
The structure to initialise a GWIN.
void gtimerInit(GTimer *pt)
Initialise a timer.
bool_t gdispImageIsOpen(gdispImage *img)
Is an image open.
int16_t coord_t
The type for a coordinate or length on the screen.
void gdispImageClose(gdispImage *img)
Close an image and release any dynamically allocated working storage.
void gtimerStop(GTimer *pt)
Stop a timer (periodic or otherwise)
struct GFILE GFILE
A file pointer.
#define FALSE
Generic 'false' boolean constant.
gdispImageError gdispImageCache(gdispImage *img)
Cache the image.
void gdispGFillArea(GDisplay *g, coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color)
Fill an area with a color.
gdispImageError gwinImageCache(GHandle gh)
Cache the image.
void gwinSetVisible(GHandle gh, bool_t visible)
Sets whether a window is visible or not.
color_t gwinGetDefaultBgColor(void)
Get the default background color for all new GWIN windows.
void gdispImageSetBgColor(gdispImage *img, color_t bgcolor)
Set the background color of the image.
void gtimerStart(GTimer *pt, GTimerFunction fn, void *param, bool_t periodic, delaytime_t millisec)
Set a timer going or alter its properties if it is already going.
GHandle gwinGImageCreate(GDisplay *g, GImageObject *widget, GWindowInit *pInit)
Create an image widget.
gdispImageError gdispGImageDraw(GDisplay *g, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy)
Draw the image.
The Virtual Method Table for a GWIN window.
A window object structure.
bool_t gwinImageOpenGFile(GHandle gh, GFILE *f)
Opens the image using a GFILE.
COLOR_TYPE color_t
The color type definition.
void gdispImageInit(gdispImage *img)
Initialise a gdispImage object.
uint16_t gdispImageError
An image error code.
#define TRUE
Generic 'true' boolean constant.
gdispImageError gdispImageOpenGFile(gdispImage *img, GFILE *f)
Open an image using an open GFILE and get it ready for drawing.