Add multiple display support to GWIN.
You can now create windows on multiple displays.
This commit is contained in:
parent
a28dce97d8
commit
7a7e223d15
23 changed files with 237 additions and 209 deletions
|
@ -59,6 +59,7 @@ extern "C" {
|
||||||
* @brief Create a button widget.
|
* @brief Create a button widget.
|
||||||
* @return NULL if there is no resultant drawing area, otherwise a window handle.
|
* @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] gb The GButtonObject structure to initialise. If this is NULL the structure is dynamically allocated.
|
* @param[in] gb The GButtonObject structure to initialise. If this is NULL the structure is dynamically allocated.
|
||||||
* @param[in] pInit The initialisation parameters
|
* @param[in] pInit The initialisation parameters
|
||||||
*
|
*
|
||||||
|
@ -74,7 +75,8 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GHandle gwinButtonCreate(GButtonObject *gb, const GWidgetInit *pInit);
|
GHandle gwinGButtonCreate(GDisplay *g, GButtonObject *gb, const GWidgetInit *pInit);
|
||||||
|
#define gwinButtonCreate(gb, pInit) gwinGButtonCreate(GDISP, gb, pInit)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Is the button current pressed
|
* @brief Is the button current pressed
|
||||||
|
|
|
@ -52,6 +52,7 @@ typedef struct GCheckboxObject {
|
||||||
* @brief Create a checkbox window.
|
* @brief Create a checkbox window.
|
||||||
* @return NULL if there is no resultant drawing area, otherwise a window handle.
|
* @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] gb The GCheckboxObject structure to initialise. If this is NULL, the structure is dynamically allocated.
|
* @param[in] gb The GCheckboxObject structure to initialise. If this is NULL, the structure is dynamically allocated.
|
||||||
* @param[in] pInit The initialization parameters to use
|
* @param[in] pInit The initialization parameters to use
|
||||||
*
|
*
|
||||||
|
@ -67,7 +68,8 @@ typedef struct GCheckboxObject {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GHandle gwinCheckboxCreate(GCheckboxObject *gb, const GWidgetInit *pInit);
|
GHandle gwinGCheckboxCreate(GDisplay *g, GCheckboxObject *gb, const GWidgetInit *pInit);
|
||||||
|
#define gwinCheckboxCreate(gb, pInit) gwinGCheckboxCreate(GDISP, gb, pInit)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the state of a checkbox
|
* @brief Set the state of a checkbox
|
||||||
|
|
|
@ -150,6 +150,7 @@ extern "C" {
|
||||||
/**
|
/**
|
||||||
* @brief Initialise (and allocate if necessary) the base GWIN object
|
* @brief Initialise (and allocate if necessary) the base GWIN object
|
||||||
*
|
*
|
||||||
|
* @param[in] g The GDisplay to use for this window
|
||||||
* @param[in] pgw The GWindowObject structure. If NULL one is allocated from the heap
|
* @param[in] pgw The GWindowObject structure. If NULL one is allocated from the heap
|
||||||
* @param[in] pInit The user initialization parameters
|
* @param[in] pInit The user initialization parameters
|
||||||
* @param[in] vmt The virtual method table for the GWIN object
|
* @param[in] vmt The virtual method table for the GWIN object
|
||||||
|
@ -159,12 +160,13 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
GHandle _gwindowCreate(GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint16_t flags);
|
GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint16_t flags);
|
||||||
|
|
||||||
#if GWIN_NEED_WIDGET || defined(__DOXYGEN__)
|
#if GWIN_NEED_WIDGET || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* @brief Initialise (and allocate if necessary) the base Widget object
|
* @brief Initialise (and allocate if necessary) the base Widget object
|
||||||
*
|
*
|
||||||
|
* @param[in] g The GDisplay to display this window on
|
||||||
* @param[in] pgw The GWidgetObject structure. If NULL one is allocated from the heap
|
* @param[in] pgw The GWidgetObject structure. If NULL one is allocated from the heap
|
||||||
* @param[in] pInit The user initialization parameters
|
* @param[in] pInit The user initialization parameters
|
||||||
* @param[in] vmt The virtual method table for the Widget object
|
* @param[in] vmt The virtual method table for the Widget object
|
||||||
|
@ -173,7 +175,7 @@ GHandle _gwindowCreate(GWindowObject *pgw, const GWindowInit *pInit, const gwinV
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
GHandle _gwidgetCreate(GWidgetObject *pgw, const GWidgetInit *pInit, const gwidgetVMT *vmt);
|
GHandle _gwidgetCreate(GDisplay *g, GWidgetObject *pgw, const GWidgetInit *pInit, const gwidgetVMT *vmt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Destroy the Widget object
|
* @brief Destroy the Widget object
|
||||||
|
|
|
@ -50,6 +50,7 @@ extern "C" {
|
||||||
* @note Text in a console window supports newlines and will wrap text as required.
|
* @note Text in a console window supports newlines and will wrap text as required.
|
||||||
* @return NULL if there is no resultant drawing area, otherwise a window handle.
|
* @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] gc The GConsoleObject structure to initialise. If this is NULL the structure is dynamically allocated.
|
* @param[in] gc The GConsoleObject structure to initialise. If this is NULL the structure is dynamically allocated.
|
||||||
* @param[in] pInit The initialization parameters to use
|
* @param[in] pInit The initialization parameters to use
|
||||||
*
|
*
|
||||||
|
@ -64,7 +65,8 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GHandle gwinConsoleCreate(GConsoleObject *gc, const GWindowInit *pInit);
|
GHandle gwinGConsoleCreate(GDisplay *g, GConsoleObject *gc, const GWindowInit *pInit);
|
||||||
|
#define gwinConsoleCreate(gc, pInit) gwinGConsoleCreate(GDISP, gc, pInit)
|
||||||
|
|
||||||
#if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM
|
#if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -90,6 +90,7 @@ extern "C" {
|
||||||
* @brief Create a graph window.
|
* @brief Create a graph window.
|
||||||
* @return NULL if there is no resultant drawing area, otherwise a window handle.
|
* @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 GGraphObject structure to initialise. If this is NULL the structure is dynamically allocated.
|
* @param[in] gg The GGraphObject structure to initialise. If this is NULL the structure is dynamically allocated.
|
||||||
* @param[in] pInit The initialization parameters to use
|
* @param[in] pInit The initialization parameters to use
|
||||||
*
|
*
|
||||||
|
@ -107,7 +108,8 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GHandle gwinGraphCreate(GGraphObject *gg, const GWindowInit *pInit);
|
GHandle gwinGGraphCreate(GDisplay *g, GGraphObject *gg, const GWindowInit *pInit);
|
||||||
|
#define gwinGraphCreate(gg, pInit) gwinGGraphCreate(GDISP, gg, pInit)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the style of the graphing operations.
|
* @brief Set the style of the graphing operations.
|
||||||
|
|
|
@ -38,6 +38,7 @@ typedef struct GWindowObject {
|
||||||
gfxQueueASyncItem wmq; // @< The next window (for the window manager)
|
gfxQueueASyncItem wmq; // @< The next window (for the window manager)
|
||||||
#endif
|
#endif
|
||||||
const struct gwinVMT *vmt; // @< The VMT for this GWIN
|
const struct gwinVMT *vmt; // @< The VMT for this GWIN
|
||||||
|
GDisplay * display; // @< The display this window is on.
|
||||||
coord_t x, y; // @< Screen relative position
|
coord_t x, y; // @< Screen relative position
|
||||||
coord_t width, height; // @< Dimensions of this window
|
coord_t width, height; // @< Dimensions of this window
|
||||||
color_t color, bgcolor; // @< The current drawing colors
|
color_t color, bgcolor; // @< The current drawing colors
|
||||||
|
@ -165,6 +166,7 @@ extern "C" {
|
||||||
* @brief Create a basic window.
|
* @brief Create a basic window.
|
||||||
* @return NULL if there is no resultant drawing area, otherwise a window handle.
|
* @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] pgw The window structure to initialize. If this is NULL the structure is dynamically allocated.
|
* @param[in] pgw The window structure to initialize. If this is NULL the structure is dynamically allocated.
|
||||||
* @param[in] pInit How to initialise the window
|
* @param[in] pInit How to initialise the window
|
||||||
*
|
*
|
||||||
|
@ -177,7 +179,8 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GHandle gwinWindowCreate(GWindowObject *pgw, const GWindowInit *pInit);
|
GHandle gwinGWindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit);
|
||||||
|
#define gwinWindowCreate(pgw, pInit) gwinGWindowCreate(GDISP, pgw, pInit);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Destroy a window (of any type). Releases any dynamically allocated memory.
|
* @brief Destroy a window (of any type). Releases any dynamically allocated memory.
|
||||||
|
|
|
@ -47,6 +47,7 @@ extern "C" {
|
||||||
* @details Display's a picture.
|
* @details Display's a picture.
|
||||||
* @return NULL if there is no resultant drawing area, otherwise the widget handle.
|
* @return NULL if there is no resultant drawing area, otherwise the widget handle.
|
||||||
*
|
*
|
||||||
|
* @param[in] g The GDisplay to display this window on
|
||||||
* @param[in] widget The image widget structure to initialise. If this is NULL, the structure is dynamically allocated.
|
* @param[in] widget The image widget structure to initialise. If this is NULL, the structure is dynamically allocated.
|
||||||
* @param[in] pInit The initialization parameters to use.
|
* @param[in] pInit The initialization parameters to use.
|
||||||
*
|
*
|
||||||
|
@ -55,7 +56,8 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GHandle gwinImageCreate(GImageObject *widget, GWindowInit *pInit);
|
GHandle gwinGImageCreate(GDisplay *g, GImageObject *widget, GWindowInit *pInit);
|
||||||
|
#define gwinImageCreate(w, pInit) gwinGImageCreate(GDISP, w, pInit)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets the input routines that support reading the image from memory
|
* @brief Sets the input routines that support reading the image from memory
|
||||||
|
|
|
@ -42,6 +42,7 @@ extern "C" {
|
||||||
* @brief Create a label widget.
|
* @brief Create a label widget.
|
||||||
* @details A label widget is a simple window which has a static text.
|
* @details A label widget is a simple window which has a static text.
|
||||||
*
|
*
|
||||||
|
* @param[in] g The GDisplay to display this window on
|
||||||
* @param[in] widget The label structure to initialise. If this is NULL, the structure is dynamically allocated.
|
* @param[in] widget The label structure to initialise. If this is NULL, the structure is dynamically allocated.
|
||||||
* @param[in] pInit The initialisation parameters to use.
|
* @param[in] pInit The initialisation parameters to use.
|
||||||
*
|
*
|
||||||
|
@ -49,7 +50,8 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GHandle gwinLabelCreate(GLabelObject *widget, GWidgetInit *pInit);
|
GHandle gwinGLabelCreate(GDisplay *g, GLabelObject *widget, GWidgetInit *pInit);
|
||||||
|
#define gwinLabelCreate(w, pInit) gwinGLabelCreate(GDISP, w, pInit)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Border settings for the default rendering routine
|
* @brief Border settings for the default rendering routine
|
||||||
|
|
|
@ -82,6 +82,7 @@ extern "C" {
|
||||||
* one toggle to a role, it will forget the previous toggle. Two roles are supported:
|
* one toggle to a role, it will forget the previous toggle. Two roles are supported:
|
||||||
* Role 0 = toggle for down, role 1 = toggle for up
|
* Role 0 = toggle for down, role 1 = toggle for up
|
||||||
*
|
*
|
||||||
|
* @param[in] g The GDisplay to display this window on
|
||||||
* @param[in] widget The GListObject structure to initialize. If this is NULL, the structure is dynamically allocated.
|
* @param[in] widget The GListObject structure to initialize. If this is NULL, the structure is dynamically allocated.
|
||||||
* @param[in] pInit The initialization parameters to use
|
* @param[in] pInit The initialization parameters to use
|
||||||
* @param[in] multiselect If TRUE the list is multi-select instead of single-select.
|
* @param[in] multiselect If TRUE the list is multi-select instead of single-select.
|
||||||
|
@ -90,7 +91,8 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GHandle gwinListCreate(GListObject *widget, GWidgetInit *pInit, bool_t multiselect);
|
GHandle gwinGListCreate(GDisplay *g, GListObject *widget, GWidgetInit *pInit, bool_t multiselect);
|
||||||
|
#define gwinListCreate(w, pInit, m) gwinGListCreate(GDISP, w, pInit, m)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Change the behaviour of the scroll bar
|
* @brief Change the behaviour of the scroll bar
|
||||||
|
|
|
@ -59,6 +59,7 @@ extern "C" {
|
||||||
* @brief Create a radio widget.
|
* @brief Create a radio widget.
|
||||||
* @return NULL if there is no resultant drawing area, otherwise a window handle.
|
* @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] gb The GRadioObject structure to initialise. If this is NULL the structure is dynamically allocated.
|
* @param[in] gb The GRadioObject structure to initialise. If this is NULL the structure is dynamically allocated.
|
||||||
* @param[in] pInit The initialisation parameters
|
* @param[in] pInit The initialisation parameters
|
||||||
* @param[in] group The group of radio buttons this radio button belongs to.
|
* @param[in] group The group of radio buttons this radio button belongs to.
|
||||||
|
@ -77,7 +78,8 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GHandle gwinRadioCreate(GRadioObject *gb, const GWidgetInit *pInit, uint16_t group);
|
GHandle gwinGRadioCreate(GDisplay *g, GRadioObject *gb, const GWidgetInit *pInit, uint16_t group);
|
||||||
|
#define gwinRadioCreate(w, pInit, gr) gwinGRadioCreate(GDISP, w, pInit, gr)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Press this radio button (and by definition unset any others in the group)
|
* @brief Press this radio button (and by definition unset any others in the group)
|
||||||
|
|
|
@ -58,6 +58,7 @@ extern "C" {
|
||||||
* @brief Create a slider window.
|
* @brief Create a slider window.
|
||||||
* @return NULL if there is no resultant drawing area, otherwise a window handle.
|
* @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] gb The GSliderObject structure to initialise. If this is NULL the structure is dynamically allocated.
|
* @param[in] gb The GSliderObject structure to initialise. If this is NULL the structure is dynamically allocated.
|
||||||
* @param[in] pInit The initialization parameters to use
|
* @param[in] pInit The initialization parameters to use
|
||||||
*
|
*
|
||||||
|
@ -77,7 +78,8 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GHandle gwinSliderCreate(GSliderObject *gb, const GWidgetInit *pInit);
|
GHandle gwinGSliderCreate(GDisplay *g, GSliderObject *gb, const GWidgetInit *pInit);
|
||||||
|
#define gwinSliderCreate(w, pInit) gwinGSliderCreate(GDISP, w, pInit)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Set the slider range.
|
* @brief Set the slider range.
|
||||||
|
|
|
@ -136,8 +136,8 @@ static const gwidgetVMT buttonVMT = {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
GHandle gwinButtonCreate(GButtonObject *gw, const GWidgetInit *pInit) {
|
GHandle gwinGButtonCreate(GDisplay *g, GButtonObject *gw, const GWidgetInit *pInit) {
|
||||||
if (!(gw = (GButtonObject *)_gwidgetCreate(&gw->w, pInit, &buttonVMT)))
|
if (!(gw = (GButtonObject *)_gwidgetCreate(g, &gw->w, pInit, &buttonVMT)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if GINPUT_NEED_TOGGLE
|
#if GINPUT_NEED_TOGGLE
|
||||||
|
@ -171,9 +171,9 @@ void gwinButtonDraw_3D(GWidgetObject *gw, void *param) {
|
||||||
if (gw->g.vmt != (gwinVMT *)&buttonVMT) return;
|
if (gw->g.vmt != (gwinVMT *)&buttonVMT) return;
|
||||||
pcol = getDrawColors(gw);
|
pcol = getDrawColors(gw);
|
||||||
|
|
||||||
gdispFillStringBox(gw->g.x, gw->g.y, gw->g.width-1, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
|
gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width-1, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
|
||||||
gdispDrawLine(gw->g.x+gw->g.width-1, gw->g.y, gw->g.x+gw->g.width-1, gw->g.y+gw->g.height-1, pcol->edge);
|
gdispGDrawLine(gw->g.display, gw->g.x+gw->g.width-1, gw->g.y, gw->g.x+gw->g.width-1, gw->g.y+gw->g.height-1, pcol->edge);
|
||||||
gdispDrawLine(gw->g.x, gw->g.y+gw->g.height-1, gw->g.x+gw->g.width-2, gw->g.y+gw->g.height-1, pcol->edge);
|
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gw->g.height-1, gw->g.x+gw->g.width-2, gw->g.y+gw->g.height-1, pcol->edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GDISP_NEED_ARC
|
#if GDISP_NEED_ARC
|
||||||
|
@ -184,14 +184,14 @@ void gwinButtonDraw_3D(GWidgetObject *gw, void *param) {
|
||||||
if (gw->g.vmt != (gwinVMT *)&buttonVMT) return;
|
if (gw->g.vmt != (gwinVMT *)&buttonVMT) return;
|
||||||
pcol = getDrawColors(gw);
|
pcol = getDrawColors(gw);
|
||||||
|
|
||||||
gdispFillArea(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
||||||
if (gw->g.width >= 2*RND_CNR_SIZE+10) {
|
if (gw->g.width >= 2*RND_CNR_SIZE+10) {
|
||||||
gdispFillRoundedBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, RND_CNR_SIZE-1, pcol->fill);
|
gdispGFillRoundedBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, RND_CNR_SIZE-1, pcol->fill);
|
||||||
gdispDrawStringBox(gw->g.x+1, gw->g.y+RND_CNR_SIZE, gw->g.width-2, gw->g.height-(2*RND_CNR_SIZE), gw->text, gw->g.font, pcol->text, justifyCenter);
|
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+RND_CNR_SIZE, gw->g.width-2, gw->g.height-(2*RND_CNR_SIZE), gw->text, gw->g.font, pcol->text, justifyCenter);
|
||||||
gdispDrawRoundedBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, RND_CNR_SIZE, pcol->edge);
|
gdispGDrawRoundedBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, RND_CNR_SIZE, pcol->edge);
|
||||||
} else {
|
} else {
|
||||||
gdispFillStringBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
|
gdispGFillStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
|
||||||
gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge);
|
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -204,10 +204,10 @@ void gwinButtonDraw_3D(GWidgetObject *gw, void *param) {
|
||||||
if (gw->g.vmt != (gwinVMT *)&buttonVMT) return;
|
if (gw->g.vmt != (gwinVMT *)&buttonVMT) return;
|
||||||
pcol = getDrawColors(gw);
|
pcol = getDrawColors(gw);
|
||||||
|
|
||||||
gdispFillArea(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
||||||
gdispFillEllipse(gw->g.x+1, gw->g.y+1, gw->g.width/2-1, gw->g.height/2-1, pcol->fill);
|
gdispGFillEllipse(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width/2-1, gw->g.height/2-1, pcol->fill);
|
||||||
gdispDrawStringBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
||||||
gdispDrawEllipse(gw->g.x, gw->g.y, gw->g.width/2, gw->g.height/2, pcol->edge);
|
gdispGDrawEllipse(gw->g.display, gw->g.x, gw->g.y, gw->g.width/2, gw->g.height/2, pcol->edge);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -228,10 +228,10 @@ void gwinButtonDraw_3D(GWidgetObject *gw, void *param) {
|
||||||
arw[5].x = (gw->g.width - gw->g.width/ARROWBODY_DIVIDER)/2; arw[5].y = gw->g.height/ARROWHEAD_DIVIDER;
|
arw[5].x = (gw->g.width - gw->g.width/ARROWBODY_DIVIDER)/2; arw[5].y = gw->g.height/ARROWHEAD_DIVIDER;
|
||||||
arw[6].x = 0; arw[6].y = gw->g.height/ARROWHEAD_DIVIDER;
|
arw[6].x = 0; arw[6].y = gw->g.height/ARROWHEAD_DIVIDER;
|
||||||
|
|
||||||
gdispFillArea(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
||||||
gdispFillConvexPoly(gw->g.x, gw->g.y, arw, 7, pcol->fill);
|
gdispGFillConvexPoly(gw->g.display, gw->g.x, gw->g.y, arw, 7, pcol->fill);
|
||||||
gdispDrawPoly(gw->g.x, gw->g.y, arw, 7, pcol->edge);
|
gdispGDrawPoly(gw->g.display, gw->g.x, gw->g.y, arw, 7, pcol->edge);
|
||||||
gdispDrawStringBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinButtonDraw_ArrowDown(GWidgetObject *gw, void *param) {
|
void gwinButtonDraw_ArrowDown(GWidgetObject *gw, void *param) {
|
||||||
|
@ -250,10 +250,10 @@ void gwinButtonDraw_3D(GWidgetObject *gw, void *param) {
|
||||||
arw[5].x = (gw->g.width - gw->g.width/ARROWBODY_DIVIDER)/2; arw[5].y = gw->g.height-1-gw->g.height/ARROWHEAD_DIVIDER;
|
arw[5].x = (gw->g.width - gw->g.width/ARROWBODY_DIVIDER)/2; arw[5].y = gw->g.height-1-gw->g.height/ARROWHEAD_DIVIDER;
|
||||||
arw[6].x = 0; arw[6].y = gw->g.height-1-gw->g.height/ARROWHEAD_DIVIDER;
|
arw[6].x = 0; arw[6].y = gw->g.height-1-gw->g.height/ARROWHEAD_DIVIDER;
|
||||||
|
|
||||||
gdispFillArea(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
||||||
gdispFillConvexPoly(gw->g.x, gw->g.y, arw, 7, pcol->fill);
|
gdispGFillConvexPoly(gw->g.display, gw->g.x, gw->g.y, arw, 7, pcol->fill);
|
||||||
gdispDrawPoly(gw->g.x, gw->g.y, arw, 7, pcol->edge);
|
gdispGDrawPoly(gw->g.display, gw->g.x, gw->g.y, arw, 7, pcol->edge);
|
||||||
gdispDrawStringBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinButtonDraw_ArrowLeft(GWidgetObject *gw, void *param) {
|
void gwinButtonDraw_ArrowLeft(GWidgetObject *gw, void *param) {
|
||||||
|
@ -272,10 +272,10 @@ void gwinButtonDraw_3D(GWidgetObject *gw, void *param) {
|
||||||
arw[5].x = gw->g.width/ARROWHEAD_DIVIDER; arw[5].y = (gw->g.height + gw->g.height/ARROWBODY_DIVIDER)/2;
|
arw[5].x = gw->g.width/ARROWHEAD_DIVIDER; arw[5].y = (gw->g.height + gw->g.height/ARROWBODY_DIVIDER)/2;
|
||||||
arw[6].x = gw->g.width/ARROWHEAD_DIVIDER; arw[6].y = gw->g.height-1;
|
arw[6].x = gw->g.width/ARROWHEAD_DIVIDER; arw[6].y = gw->g.height-1;
|
||||||
|
|
||||||
gdispFillArea(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
||||||
gdispFillConvexPoly(gw->g.x, gw->g.y, arw, 7, pcol->fill);
|
gdispGFillConvexPoly(gw->g.display, gw->g.x, gw->g.y, arw, 7, pcol->fill);
|
||||||
gdispDrawPoly(gw->g.x, gw->g.y, arw, 7, pcol->edge);
|
gdispGDrawPoly(gw->g.display, gw->g.x, gw->g.y, arw, 7, pcol->edge);
|
||||||
gdispDrawStringBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinButtonDraw_ArrowRight(GWidgetObject *gw, void *param) {
|
void gwinButtonDraw_ArrowRight(GWidgetObject *gw, void *param) {
|
||||||
|
@ -294,10 +294,10 @@ void gwinButtonDraw_3D(GWidgetObject *gw, void *param) {
|
||||||
arw[5].x = gw->g.width-1-gw->g.width/ARROWHEAD_DIVIDER; arw[5].y = (gw->g.height + gw->g.height/ARROWBODY_DIVIDER)/2;
|
arw[5].x = gw->g.width-1-gw->g.width/ARROWHEAD_DIVIDER; arw[5].y = (gw->g.height + gw->g.height/ARROWBODY_DIVIDER)/2;
|
||||||
arw[6].x = gw->g.width-1-gw->g.width/ARROWHEAD_DIVIDER; arw[6].y = gw->g.height-1;
|
arw[6].x = gw->g.width-1-gw->g.width/ARROWHEAD_DIVIDER; arw[6].y = gw->g.height-1;
|
||||||
|
|
||||||
gdispFillArea(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background);
|
||||||
gdispFillConvexPoly(gw->g.x, gw->g.y, arw, 7, pcol->fill);
|
gdispGFillConvexPoly(gw->g.display, gw->g.x, gw->g.y, arw, 7, pcol->fill);
|
||||||
gdispDrawPoly(gw->g.x, gw->g.y, arw, 7, pcol->edge);
|
gdispGDrawPoly(gw->g.display, gw->g.x, gw->g.y, arw, 7, pcol->edge);
|
||||||
gdispDrawStringBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -317,8 +317,8 @@ void gwinButtonDraw_3D(GWidgetObject *gw, void *param) {
|
||||||
sy = 0;
|
sy = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gdispImageDraw((gdispImage *)param, gw->g.x, gw->g.y, gw->g.width, gw->g.height, 0, sy);
|
gdispGImageDraw(gw->g.display, (gdispImage *)param, gw->g.x, gw->g.y, gw->g.width, gw->g.height, 0, sy);
|
||||||
gdispDrawStringBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -108,8 +108,8 @@ static const gwidgetVMT checkboxVMT = {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
GHandle gwinCheckboxCreate(GCheckboxObject *gb, const GWidgetInit *pInit) {
|
GHandle gwinGCheckboxCreate(GDisplay *g, GCheckboxObject *gb, const GWidgetInit *pInit) {
|
||||||
if (!(gb = (GCheckboxObject *)_gwidgetCreate(&gb->w, pInit, &checkboxVMT)))
|
if (!(gb = (GCheckboxObject *)_gwidgetCreate(g, &gb->w, pInit, &checkboxVMT)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if GINPUT_NEED_TOGGLE
|
#if GINPUT_NEED_TOGGLE
|
||||||
|
@ -161,14 +161,14 @@ void gwinCheckboxDraw_CheckOnLeft(GWidgetObject *gw, void *param) {
|
||||||
pcol = getDrawColors(gw);
|
pcol = getDrawColors(gw);
|
||||||
|
|
||||||
ld = gw->g.width < gw->g.height ? gw->g.width : gw->g.height;
|
ld = gw->g.width < gw->g.height ? gw->g.width : gw->g.height;
|
||||||
gdispFillArea(gw->g.x+1, gw->g.y+1, ld, ld-2, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x+1, gw->g.y+1, ld, ld-2, gw->pstyle->background);
|
||||||
gdispDrawBox(gw->g.x, gw->g.y, ld, ld, pcol->edge);
|
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, ld, ld, pcol->edge);
|
||||||
|
|
||||||
df = ld < 4 ? 1 : 2;
|
df = ld < 4 ? 1 : 2;
|
||||||
if (gw->g.flags & GCHECKBOX_FLG_CHECKED)
|
if (gw->g.flags & GCHECKBOX_FLG_CHECKED)
|
||||||
gdispFillArea(gw->g.x+df, gw->g.y+df, ld-2*df, ld-2*df, pcol->fill);
|
gdispGFillArea(gw->g.display, gw->g.x+df, gw->g.y+df, ld-2*df, ld-2*df, pcol->fill);
|
||||||
|
|
||||||
gdispFillStringBox(gw->g.x+ld+1, gw->g.y, gw->g.width-ld-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyLeft);
|
gdispGFillStringBox(gw->g.display, gw->g.x+ld+1, gw->g.y, gw->g.width-ld-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyLeft);
|
||||||
#undef gcw
|
#undef gcw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,14 +183,14 @@ void gwinCheckboxDraw_CheckOnRight(GWidgetObject *gw, void *param) {
|
||||||
|
|
||||||
ld = gw->g.width < gw->g.height ? gw->g.width : gw->g.height;
|
ld = gw->g.width < gw->g.height ? gw->g.width : gw->g.height;
|
||||||
ep = gw->g.width-ld-1;
|
ep = gw->g.width-ld-1;
|
||||||
gdispFillArea(gw->g.x+ep-1, gw->g.y+1, ld, ld-2, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x+ep-1, gw->g.y+1, ld, ld-2, gw->pstyle->background);
|
||||||
gdispDrawBox(gw->g.x+ep, gw->g.y, ld, ld, pcol->edge);
|
gdispGDrawBox(gw->g.display, gw->g.x+ep, gw->g.y, ld, ld, pcol->edge);
|
||||||
|
|
||||||
df = ld < 4 ? 1 : 2;
|
df = ld < 4 ? 1 : 2;
|
||||||
if (gw->g.flags & GCHECKBOX_FLG_CHECKED)
|
if (gw->g.flags & GCHECKBOX_FLG_CHECKED)
|
||||||
gdispFillArea(gw->g.x+ep+df, gw->g.y+df, ld-2*df, ld-2*df, pcol->fill);
|
gdispGFillArea(gw->g.display, gw->g.x+ep+df, gw->g.y+df, ld-2*df, ld-2*df, pcol->fill);
|
||||||
|
|
||||||
gdispFillStringBox(gw->g.x, gw->g.y, ep-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyRight);
|
gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, ep-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyRight);
|
||||||
#undef gcw
|
#undef gcw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,8 @@ static const gwinVMT consoleVMT = {
|
||||||
AfterClear, // The after-clear routine
|
AfterClear, // The after-clear routine
|
||||||
};
|
};
|
||||||
|
|
||||||
GHandle gwinConsoleCreate(GConsoleObject *gc, const GWindowInit *pInit) {
|
GHandle gwinGConsoleCreate(GDisplay *g, GConsoleObject *gc, const GWindowInit *pInit) {
|
||||||
if (!(gc = (GConsoleObject *)_gwindowCreate(&gc->g, pInit, &consoleVMT, 0)))
|
if (!(gc = (GConsoleObject *)_gwindowCreate(g, &gc->g, pInit, &consoleVMT, 0)))
|
||||||
return 0;
|
return 0;
|
||||||
#if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM
|
#if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM
|
||||||
gc->stream.vmt = &GWindowConsoleVMT;
|
gc->stream.vmt = &GWindowConsoleVMT;
|
||||||
|
@ -97,7 +97,7 @@ void gwinPutChar(GHandle gh, char c) {
|
||||||
fp = gdispGetFontMetric(gh->font, fontCharPadding);
|
fp = gdispGetFontMetric(gh->font, fontCharPadding);
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
|
@ -116,13 +116,13 @@ void gwinPutChar(GHandle gh, char c) {
|
||||||
if (gcw->cy + fy > gh->height) {
|
if (gcw->cy + fy > gh->height) {
|
||||||
#if GDISP_NEED_SCROLL
|
#if GDISP_NEED_SCROLL
|
||||||
/* scroll the console */
|
/* scroll the console */
|
||||||
gdispVerticalScroll(gh->x, gh->y, gh->width, gh->height, fy, gh->bgcolor);
|
gdispGVerticalScroll(gh->display, gh->x, gh->y, gh->width, gh->height, fy, gh->bgcolor);
|
||||||
/* reset the cursor to the start of the last line */
|
/* reset the cursor to the start of the last line */
|
||||||
gcw->cx = 0;
|
gcw->cx = 0;
|
||||||
gcw->cy = (((coord_t)(gh->height/fy))-1)*fy;
|
gcw->cy = (((coord_t)(gh->height/fy))-1)*fy;
|
||||||
#else
|
#else
|
||||||
/* clear the console */
|
/* clear the console */
|
||||||
gdispFillArea(gh->x, gh->y, gh->width, gh->height, gh->bgcolor);
|
gdispGFillArea(gh->display, gh->x, gh->y, gh->width, gh->height, gh->bgcolor);
|
||||||
/* reset the cursor to the top of the window */
|
/* reset the cursor to the top of the window */
|
||||||
gcw->cx = 0;
|
gcw->cx = 0;
|
||||||
gcw->cy = 0;
|
gcw->cy = 0;
|
||||||
|
@ -132,12 +132,12 @@ void gwinPutChar(GHandle gh, char c) {
|
||||||
#if GWIN_CONSOLE_USE_CLEAR_LINES
|
#if GWIN_CONSOLE_USE_CLEAR_LINES
|
||||||
/* clear to the end of the line */
|
/* clear to the end of the line */
|
||||||
if (gcw->cx == 0)
|
if (gcw->cx == 0)
|
||||||
gdispFillArea(gh->x, gh->y + gcw->cy, gh->width, fy, gh->bgcolor);
|
gdispGFillArea(gh->display, gh->x, gh->y + gcw->cy, gh->width, fy, gh->bgcolor);
|
||||||
#endif
|
#endif
|
||||||
#if GWIN_CONSOLE_USE_FILLED_CHARS
|
#if GWIN_CONSOLE_USE_FILLED_CHARS
|
||||||
gdispFillChar(gh->x + gcw->cx, gh->y + gcw->cy, c, gh->font, gh->color, gh->bgcolor);
|
gdispGFillChar(gh->display, gh->x + gcw->cx, gh->y + gcw->cy, c, gh->font, gh->color, gh->bgcolor);
|
||||||
#else
|
#else
|
||||||
gdispDrawChar(gh->x + gcw->cx, gh->y + gcw->cy, c, gh->font, gh->color);
|
gdispGDrawChar(gh->display, gh->x + gcw->cx, gh->y + gcw->cy, c, gh->font, gh->color);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* update cursor */
|
/* update cursor */
|
||||||
|
|
|
@ -51,7 +51,7 @@ static void _redraw(GHandle gh) {
|
||||||
|
|
||||||
// If the image isn't open just clear the area
|
// If the image isn't open just clear the area
|
||||||
if (!gdispImageIsOpen(&widget(gh)->image)) {
|
if (!gdispImageIsOpen(&widget(gh)->image)) {
|
||||||
gdispFillArea(x, y, w, h, bg);
|
gdispGFillArea(gh->display, x, y, w, h, bg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,8 +61,8 @@ static void _redraw(GHandle gh) {
|
||||||
dx = (gh->width-w)/2;
|
dx = (gh->width-w)/2;
|
||||||
x += dx;
|
x += dx;
|
||||||
if (dx)
|
if (dx)
|
||||||
gdispFillArea(gh->x, y, dx, h, bg);
|
gdispGFillArea(gh->display, gh->x, y, dx, h, bg);
|
||||||
gdispFillArea(x+w, y, gh->width-dx-w, h, bg);
|
gdispGFillArea(gh->display, x+w, y, gh->width-dx-w, h, bg);
|
||||||
dx = 0;
|
dx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,8 +77,8 @@ static void _redraw(GHandle gh) {
|
||||||
dy = (gh->height-h)/2;
|
dy = (gh->height-h)/2;
|
||||||
y += dy;
|
y += dy;
|
||||||
if (dy)
|
if (dy)
|
||||||
gdispFillArea(x, gh->y, w, dy, bg);
|
gdispGFillArea(gh->display, x, gh->y, w, dy, bg);
|
||||||
gdispFillArea(x, y+h, w, gh->height-dy-h, bg);
|
gdispGFillArea(gh->display, x, y+h, w, gh->height-dy-h, bg);
|
||||||
dy = 0;
|
dy = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ static void _redraw(GHandle gh) {
|
||||||
gdispImageSetBgColor(&widget(gh)->image, bg);
|
gdispImageSetBgColor(&widget(gh)->image, bg);
|
||||||
|
|
||||||
// Display the image
|
// Display the image
|
||||||
gdispImageDraw(&widget(gh)->image, x, y, w, h, dx, dy);
|
gdispGImageDraw(gh->display, &widget(gh)->image, x, y, w, h, dx, dy);
|
||||||
|
|
||||||
#if GWIN_NEED_IMAGE_ANIMATION
|
#if GWIN_NEED_IMAGE_ANIMATION
|
||||||
// read the delay for the next frame
|
// read the delay for the next frame
|
||||||
|
@ -122,8 +122,8 @@ static const gwinVMT imageVMT = {
|
||||||
0, // The after-clear routine
|
0, // The after-clear routine
|
||||||
};
|
};
|
||||||
|
|
||||||
GHandle gwinImageCreate(GImageObject *gobj, GWindowInit *pInit) {
|
GHandle gwinGImageCreate(GDisplay *g, GImageObject *gobj, GWindowInit *pInit) {
|
||||||
if (!(gobj = (GImageObject *)_gwindowCreate(&gobj->g, pInit, &imageVMT, 0)))
|
if (!(gobj = (GImageObject *)_gwindowCreate(g, &gobj->g, pInit, &imageVMT, 0)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Ensure the gdispImageIsOpen() gives valid results
|
// Ensure the gdispImageIsOpen() gives valid results
|
||||||
|
@ -153,7 +153,7 @@ bool_t gwinImageOpenMemory(GHandle gh, const void* memory) {
|
||||||
// Setting the clip here shouldn't be necessary if the redraw doesn't overdraw
|
// Setting the clip here shouldn't be necessary if the redraw doesn't overdraw
|
||||||
// but we put it in for safety anyway
|
// but we put it in for safety anyway
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
_redraw(gh);
|
_redraw(gh);
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ bool_t gwinImageOpenFile(GHandle gh, const char* filename) {
|
||||||
// Setting the clip here shouldn't be necessary if the redraw doesn't overdraw
|
// Setting the clip here shouldn't be necessary if the redraw doesn't overdraw
|
||||||
// but we put it in for safety anyway
|
// but we put it in for safety anyway
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
_redraw(gh);
|
_redraw(gh);
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ bool_t gwinImageOpenStream(GHandle gh, void *streamPtr) {
|
||||||
// Setting the clip here shouldn't be necessary if the redraw doesn't overdraw
|
// Setting the clip here shouldn't be necessary if the redraw doesn't overdraw
|
||||||
// but we put it in for safety anyway
|
// but we put it in for safety anyway
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
_redraw(gh);
|
_redraw(gh);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,22 +46,22 @@ static void pointto(GGraphObject *gg, coord_t x, coord_t y, const GGraphPointSty
|
||||||
y = gg->g.y + gg->g.height - 1 - gg->yorigin - y;
|
y = gg->g.y + gg->g.height - 1 - gg->yorigin - y;
|
||||||
|
|
||||||
if (style->size <= 1) {
|
if (style->size <= 1) {
|
||||||
gdispDrawPixel(x, y, style->color);
|
gdispGDrawPixel(gg->g.display, x, y, style->color);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(style->type) {
|
switch(style->type) {
|
||||||
case GGRAPH_POINT_SQUARE:
|
case GGRAPH_POINT_SQUARE:
|
||||||
gdispDrawBox(x-style->size, y-style->size, 2*style->size, 2*style->size, style->color);
|
gdispGDrawBox(gg->g.display, x-style->size, y-style->size, 2*style->size, 2*style->size, style->color);
|
||||||
break;
|
break;
|
||||||
#if GDISP_NEED_CIRCLE
|
#if GDISP_NEED_CIRCLE
|
||||||
case GGRAPH_POINT_CIRCLE:
|
case GGRAPH_POINT_CIRCLE:
|
||||||
gdispDrawCircle(x, y, style->size, style->color);
|
gdispGDrawCircle(gg->g.display, x, y, style->size, style->color);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case GGRAPH_POINT_DOT:
|
case GGRAPH_POINT_DOT:
|
||||||
default:
|
default:
|
||||||
gdispDrawPixel(x, y, style->color);
|
gdispGDrawPixel(gg->g.display, x, y, style->color);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ static void lineto(GGraphObject *gg, coord_t x0, coord_t y0, coord_t x1, coord_t
|
||||||
|
|
||||||
if (style->size <= 0) {
|
if (style->size <= 0) {
|
||||||
// Use the driver to draw a solid line
|
// Use the driver to draw a solid line
|
||||||
gdispDrawLine(x0, y0, x1, y1, style->color);
|
gdispGDrawLine(gg->g.display, x0, y0, x1, y1, style->color);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ static void lineto(GGraphObject *gg, coord_t x0, coord_t y0, coord_t x1, coord_t
|
||||||
case GGRAPH_LINE_SOLID:
|
case GGRAPH_LINE_SOLID:
|
||||||
default:
|
default:
|
||||||
// Use the driver to draw a solid line
|
// Use the driver to draw a solid line
|
||||||
gdispDrawLine(x0, y0, x1, y1, style->color);
|
gdispGDrawLine(gg->g.display, x0, y0, x1, y1, style->color);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ static void lineto(GGraphObject *gg, coord_t x0, coord_t y0, coord_t x1, coord_t
|
||||||
if (run++ >= 0) {
|
if (run++ >= 0) {
|
||||||
if (run >= run_on)
|
if (run >= run_on)
|
||||||
run = run_off;
|
run = run_off;
|
||||||
gdispDrawPixel(x0, y0, style->color);
|
gdispGDrawPixel(gg->g.display, x0, y0, style->color);
|
||||||
}
|
}
|
||||||
if (P < 0) {
|
if (P < 0) {
|
||||||
P += dy;
|
P += dy;
|
||||||
|
@ -151,7 +151,7 @@ static void lineto(GGraphObject *gg, coord_t x0, coord_t y0, coord_t x1, coord_t
|
||||||
if (run++ >= 0) {
|
if (run++ >= 0) {
|
||||||
if (run >= run_on)
|
if (run >= run_on)
|
||||||
run = run_off;
|
run = run_off;
|
||||||
gdispDrawPixel(x0, y0, style->color);
|
gdispGDrawPixel(gg->g.display, x0, y0, style->color);
|
||||||
}
|
}
|
||||||
if (P < 0) {
|
if (P < 0) {
|
||||||
P += dx;
|
P += dx;
|
||||||
|
@ -165,8 +165,8 @@ static void lineto(GGraphObject *gg, coord_t x0, coord_t y0, coord_t x1, coord_t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GHandle gwinGraphCreate(GGraphObject *gg, const GWindowInit *pInit) {
|
GHandle gwinGGraphCreate(GDisplay *g, GGraphObject *gg, const GWindowInit *pInit) {
|
||||||
if (!(gg = (GGraphObject *)_gwindowCreate(&gg->g, pInit, &graphVMT, 0)))
|
if (!(gg = (GGraphObject *)_gwindowCreate(g, &gg->g, pInit, &graphVMT, 0)))
|
||||||
return 0;
|
return 0;
|
||||||
gg->xorigin = gg->yorigin = 0;
|
gg->xorigin = gg->yorigin = 0;
|
||||||
gg->lastx = gg->lasty = 0;
|
gg->lastx = gg->lasty = 0;
|
||||||
|
|
|
@ -102,6 +102,10 @@ static void gwidgetEvent(void *param, GEvent *pe) {
|
||||||
// Cycle through all windows
|
// Cycle through all windows
|
||||||
for(qi = gfxQueueASyncPeek(&_GWINList); qi; qi = gfxQueueASyncNext(qi)) {
|
for(qi = gfxQueueASyncPeek(&_GWINList); qi; qi = gfxQueueASyncNext(qi)) {
|
||||||
|
|
||||||
|
// check if the widget matches this display
|
||||||
|
if (gh->display != pme->display)
|
||||||
|
continue;
|
||||||
|
|
||||||
// check if it a widget that is enabled and visible
|
// check if it a widget that is enabled and visible
|
||||||
if ((gh->flags & (GWIN_FLG_WIDGET|GWIN_FLG_ENABLED|GWIN_FLG_VISIBLE)) != (GWIN_FLG_WIDGET|GWIN_FLG_ENABLED|GWIN_FLG_VISIBLE))
|
if ((gh->flags & (GWIN_FLG_WIDGET|GWIN_FLG_ENABLED|GWIN_FLG_VISIBLE)) != (GWIN_FLG_WIDGET|GWIN_FLG_ENABLED|GWIN_FLG_VISIBLE))
|
||||||
continue;
|
continue;
|
||||||
|
@ -225,8 +229,8 @@ void _gwidgetInit(void) {
|
||||||
geventRegisterCallback(&gl, gwidgetEvent, 0);
|
geventRegisterCallback(&gl, gwidgetEvent, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
GHandle _gwidgetCreate(GWidgetObject *pgw, const GWidgetInit *pInit, const gwidgetVMT *vmt) {
|
GHandle _gwidgetCreate(GDisplay *g, GWidgetObject *pgw, const GWidgetInit *pInit, const gwidgetVMT *vmt) {
|
||||||
if (!(pgw = (GWidgetObject *)_gwindowCreate(&pgw->g, &pInit->g, &vmt->g, GWIN_FLG_WIDGET|GWIN_FLG_ENABLED)))
|
if (!(pgw = (GWidgetObject *)_gwindowCreate(g, &pgw->g, &pInit->g, &vmt->g, GWIN_FLG_WIDGET|GWIN_FLG_ENABLED)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pgw->text = pInit->text ? pInit->text : "";
|
pgw->text = pInit->text ? pInit->text : "";
|
||||||
|
@ -281,7 +285,7 @@ void _gwidgetRedraw(GHandle gh) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gw->fnDraw(gw, gw->fnParam);
|
gw->fnDraw(gw, gw->fnParam);
|
||||||
|
|
|
@ -90,7 +90,7 @@ void _gwinInit(void) {
|
||||||
|
|
||||||
// Internal routine for use by GWIN components only
|
// Internal routine for use by GWIN components only
|
||||||
// Initialise a window creating it dynamically if required.
|
// Initialise a window creating it dynamically if required.
|
||||||
GHandle _gwindowCreate(GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint16_t flags) {
|
GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit, const gwinVMT *vmt, uint16_t flags) {
|
||||||
// Allocate the structure if necessary
|
// Allocate the structure if necessary
|
||||||
if (!pgw) {
|
if (!pgw) {
|
||||||
if (!(pgw = (GWindowObject *)gfxAlloc(vmt->size)))
|
if (!(pgw = (GWindowObject *)gfxAlloc(vmt->size)))
|
||||||
|
@ -100,6 +100,7 @@ GHandle _gwindowCreate(GWindowObject *pgw, const GWindowInit *pInit, const gwinV
|
||||||
pgw->flags = flags;
|
pgw->flags = flags;
|
||||||
|
|
||||||
// Initialise all basic fields
|
// Initialise all basic fields
|
||||||
|
pgw->display = g;
|
||||||
pgw->vmt = vmt;
|
pgw->vmt = vmt;
|
||||||
pgw->color = defaultFgColor;
|
pgw->color = defaultFgColor;
|
||||||
pgw->bgcolor = defaultBgColor;
|
pgw->bgcolor = defaultBgColor;
|
||||||
|
@ -154,8 +155,8 @@ color_t gwinGetDefaultBgColor(void) {
|
||||||
* The GWindow Routines
|
* The GWindow Routines
|
||||||
*-----------------------------------------------*/
|
*-----------------------------------------------*/
|
||||||
|
|
||||||
GHandle gwinWindowCreate(GWindowObject *pgw, const GWindowInit *pInit) {
|
GHandle gwinGWindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit) {
|
||||||
if (!(pgw = _gwindowCreate(pgw, pInit, &basegwinVMT, 0)))
|
if (!(pgw = _gwindowCreate(g, pgw, pInit, &basegwinVMT, 0)))
|
||||||
return 0;
|
return 0;
|
||||||
gwinSetVisible(pgw, pInit->show);
|
gwinSetVisible(pgw, pInit->show);
|
||||||
return pgw;
|
return pgw;
|
||||||
|
@ -213,7 +214,7 @@ void gwinSetEnabled(GHandle gh, bool_t enabled) {
|
||||||
gh->flags |= GWIN_FLG_ENABLED;
|
gh->flags |= GWIN_FLG_ENABLED;
|
||||||
if ((gh->flags & GWIN_FLG_VISIBLE) && gh->vmt->Redraw) {
|
if ((gh->flags & GWIN_FLG_VISIBLE) && gh->vmt->Redraw) {
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gh->vmt->Redraw(gh);
|
gh->vmt->Redraw(gh);
|
||||||
}
|
}
|
||||||
|
@ -223,7 +224,7 @@ void gwinSetEnabled(GHandle gh, bool_t enabled) {
|
||||||
gh->flags &= ~GWIN_FLG_ENABLED;
|
gh->flags &= ~GWIN_FLG_ENABLED;
|
||||||
if ((gh->flags & GWIN_FLG_VISIBLE) && gh->vmt->Redraw) {
|
if ((gh->flags & GWIN_FLG_VISIBLE) && gh->vmt->Redraw) {
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gh->vmt->Redraw(gh);
|
gh->vmt->Redraw(gh);
|
||||||
}
|
}
|
||||||
|
@ -271,9 +272,9 @@ void gwinClear(GHandle gh) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispFillArea(gh->x, gh->y, gh->width, gh->height, gh->bgcolor);
|
gdispGFillArea(gh->display, gh->x, gh->y, gh->width, gh->height, gh->bgcolor);
|
||||||
if (gh->vmt->AfterClear)
|
if (gh->vmt->AfterClear)
|
||||||
gh->vmt->AfterClear(gh);
|
gh->vmt->AfterClear(gh);
|
||||||
}
|
}
|
||||||
|
@ -283,9 +284,9 @@ void gwinDrawPixel(GHandle gh, coord_t x, coord_t y) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispDrawPixel(gh->x+x, gh->y+y, gh->color);
|
gdispGDrawPixel(gh->display, gh->x+x, gh->y+y, gh->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinDrawLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1) {
|
void gwinDrawLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1) {
|
||||||
|
@ -293,9 +294,9 @@ void gwinDrawLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispDrawLine(gh->x+x0, gh->y+y0, gh->x+x1, gh->y+y1, gh->color);
|
gdispGDrawLine(gh->display, gh->x+x0, gh->y+y0, gh->x+x1, gh->y+y1, gh->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinDrawBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
void gwinDrawBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||||
|
@ -303,9 +304,9 @@ void gwinDrawBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispDrawBox(gh->x+x, gh->y+y, cx, cy, gh->color);
|
gdispGDrawBox(gh->display, gh->x+x, gh->y+y, cx, cy, gh->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinFillArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
void gwinFillArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||||
|
@ -313,9 +314,9 @@ void gwinFillArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispFillArea(gh->x+x, gh->y+y, cx, cy, gh->color);
|
gdispGFillArea(gh->display, gh->x+x, gh->y+y, cx, cy, gh->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) {
|
void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) {
|
||||||
|
@ -323,9 +324,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispBlitAreaEx(gh->x+x, gh->y+y, cx, cy, srcx, srcy, srccx, buffer);
|
gdispGBlitArea(gh->display, gh->x+x, gh->y+y, cx, cy, srcx, srcy, srccx, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GDISP_NEED_CIRCLE
|
#if GDISP_NEED_CIRCLE
|
||||||
|
@ -334,9 +335,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispDrawCircle(gh->x+x, gh->y+y, radius, gh->color);
|
gdispGDrawCircle(gh->display, gh->x+x, gh->y+y, radius, gh->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinFillCircle(GHandle gh, coord_t x, coord_t y, coord_t radius) {
|
void gwinFillCircle(GHandle gh, coord_t x, coord_t y, coord_t radius) {
|
||||||
|
@ -344,9 +345,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispFillCircle(gh->x+x, gh->y+y, radius, gh->color);
|
gdispGFillCircle(gh->display, gh->x+x, gh->y+y, radius, gh->color);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -356,9 +357,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispDrawEllipse(gh->x+x, gh->y+y, a, b, gh->color);
|
gdispGDrawEllipse(gh->display, gh->x+x, gh->y+y, a, b, gh->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinFillEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b) {
|
void gwinFillEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b) {
|
||||||
|
@ -366,9 +367,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispFillEllipse(gh->x+x, gh->y+y, a, b, gh->color);
|
gdispGFillEllipse(gh->display, gh->x+x, gh->y+y, a, b, gh->color);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -378,9 +379,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispDrawArc(gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
|
gdispGDrawArc(gh->display, gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinFillArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle) {
|
void gwinFillArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle) {
|
||||||
|
@ -388,9 +389,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispFillArc(gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
|
gdispGFillArc(gh->display, gh->x+x, gh->y+y, radius, startangle, endangle, gh->color);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -400,9 +401,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return defaultBgColor;
|
return defaultBgColor;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
return gdispGetPixelColor(gh->x+x, gh->y+y);
|
return gdispGGetPixelColor(gh->display, gh->x+x, gh->y+y);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -412,9 +413,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispDrawChar(gh->x+x, gh->y+y, c, gh->font, gh->color);
|
gdispGDrawChar(gh->display, gh->x+x, gh->y+y, c, gh->font, gh->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinFillChar(GHandle gh, coord_t x, coord_t y, char c) {
|
void gwinFillChar(GHandle gh, coord_t x, coord_t y, char c) {
|
||||||
|
@ -422,9 +423,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispFillChar(gh->x+x, gh->y+y, c, gh->font, gh->color, gh->bgcolor);
|
gdispGFillChar(gh->display, gh->x+x, gh->y+y, c, gh->font, gh->color, gh->bgcolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinDrawString(GHandle gh, coord_t x, coord_t y, const char *str) {
|
void gwinDrawString(GHandle gh, coord_t x, coord_t y, const char *str) {
|
||||||
|
@ -432,9 +433,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispDrawString(gh->x+x, gh->y+y, str, gh->font, gh->color);
|
gdispGDrawString(gh->display, gh->x+x, gh->y+y, str, gh->font, gh->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinFillString(GHandle gh, coord_t x, coord_t y, const char *str) {
|
void gwinFillString(GHandle gh, coord_t x, coord_t y, const char *str) {
|
||||||
|
@ -442,9 +443,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispFillString(gh->x+x, gh->y+y, str, gh->font, gh->color, gh->bgcolor);
|
gdispGFillString(gh->display, gh->x+x, gh->y+y, str, gh->font, gh->color, gh->bgcolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinDrawStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify) {
|
void gwinDrawStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify) {
|
||||||
|
@ -452,9 +453,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispDrawStringBox(gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, justify);
|
gdispGDrawStringBox(gh->display, gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, justify);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinFillStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify) {
|
void gwinFillStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify) {
|
||||||
|
@ -462,9 +463,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispFillStringBox(gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, gh->bgcolor, justify);
|
gdispGFillStringBox(gh->display, gh->x+x, gh->y+y, cx, cy, str, gh->font, gh->color, gh->bgcolor, justify);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -474,9 +475,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispDrawPoly(tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
|
gdispGDrawPoly(gh->display, tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinFillConvexPoly(GHandle gh, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt) {
|
void gwinFillConvexPoly(GHandle gh, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt) {
|
||||||
|
@ -484,9 +485,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gdispFillConvexPoly(tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
|
gdispGFillConvexPoly(gh->display, tx+gh->x, ty+gh->y, pntarray, cnt, gh->color);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -496,9 +497,9 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
|
||||||
return GDISP_IMAGE_ERR_OK;
|
return GDISP_IMAGE_ERR_OK;
|
||||||
|
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
return gdispImageDraw(img, gh->x+x, gh->y+y, cx, cy, sx, sy);
|
return gdispGImageDraw(gh->display, img, gh->x+x, gh->y+y, cx, cy, sx, sy);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ static void WM_Delete(GHandle gh) {
|
||||||
// Make the window invisible and clear the area underneath
|
// Make the window invisible and clear the area underneath
|
||||||
if ((gh->flags & GWIN_FLG_VISIBLE)) {
|
if ((gh->flags & GWIN_FLG_VISIBLE)) {
|
||||||
gh->flags &= ~GWIN_FLG_VISIBLE;
|
gh->flags &= ~GWIN_FLG_VISIBLE;
|
||||||
gdispFillArea(gh->x, gh->y, gh->width, gh->height, gwinGetDefaultBgColor());
|
gdispGFillArea(gh->display, gh->x, gh->y, gh->width, gh->height, gwinGetDefaultBgColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove it from the queue
|
// Remove it from the queue
|
||||||
|
@ -128,16 +128,16 @@ static void WM_Delete(GHandle gh) {
|
||||||
|
|
||||||
static void WM_Visible(GHandle gh) {
|
static void WM_Visible(GHandle gh) {
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
if ((gh->flags & GWIN_FLG_VISIBLE)) {
|
if ((gh->flags & GWIN_FLG_VISIBLE)) {
|
||||||
if (gh->vmt->Redraw)
|
if (gh->vmt->Redraw)
|
||||||
gh->vmt->Redraw(gh);
|
gh->vmt->Redraw(gh);
|
||||||
else
|
else
|
||||||
gdispFillArea(gh->x, gh->y, gh->width, gh->height, gh->bgcolor);
|
gdispGFillArea(gh->display, gh->x, gh->y, gh->width, gh->height, gh->bgcolor);
|
||||||
// A real window manager would also redraw the borders here
|
// A real window manager would also redraw the borders here
|
||||||
} else
|
} else
|
||||||
gdispFillArea(gh->x, gh->y, gh->width, gh->height, gwinGetDefaultBgColor());
|
gdispGFillArea(gh->display, gh->x, gh->y, gh->width, gh->height, gwinGetDefaultBgColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WM_Redim(GHandle gh, coord_t x, coord_t y, coord_t w, coord_t h) {
|
static void WM_Redim(GHandle gh, coord_t x, coord_t y, coord_t w, coord_t h) {
|
||||||
|
@ -145,12 +145,12 @@ static void WM_Redim(GHandle gh, coord_t x, coord_t y, coord_t w, coord_t h) {
|
||||||
// If it won't fit on the screen move it around until it does.
|
// If it won't fit on the screen move it around until it does.
|
||||||
if (x < 0) { w += x; x = 0; }
|
if (x < 0) { w += x; x = 0; }
|
||||||
if (y < 0) { h += y; y = 0; }
|
if (y < 0) { h += y; y = 0; }
|
||||||
if (x > gdispGetWidth()-MIN_WIN_WIDTH) x = gdispGetWidth()-MIN_WIN_WIDTH;
|
if (x > gdispGGetWidth(gh->display)-MIN_WIN_WIDTH) x = gdispGGetWidth(gh->display)-MIN_WIN_WIDTH;
|
||||||
if (y > gdispGetHeight()-MIN_WIN_HEIGHT) y = gdispGetHeight()-MIN_WIN_HEIGHT;
|
if (y > gdispGGetHeight(gh->display)-MIN_WIN_HEIGHT) y = gdispGGetHeight(gh->display)-MIN_WIN_HEIGHT;
|
||||||
if (w < MIN_WIN_WIDTH) { w = MIN_WIN_WIDTH; }
|
if (w < MIN_WIN_WIDTH) { w = MIN_WIN_WIDTH; }
|
||||||
if (h < MIN_WIN_HEIGHT) { h = MIN_WIN_HEIGHT; }
|
if (h < MIN_WIN_HEIGHT) { h = MIN_WIN_HEIGHT; }
|
||||||
if (x+w > gdispGetWidth()) w = gdispGetWidth() - x;
|
if (x+w > gdispGGetWidth(gh->display)) w = gdispGGetWidth(gh->display) - x;
|
||||||
if (y+h > gdispGetHeight()) h = gdispGetHeight() - y;
|
if (y+h > gdispGGetHeight(gh->display)) h = gdispGGetHeight(gh->display) - y;
|
||||||
|
|
||||||
// If there has been no resize just exit
|
// If there has been no resize just exit
|
||||||
if (gh->x == x && gh->y == y && gh->width == w && gh->height == h)
|
if (gh->x == x && gh->y == y && gh->width == w && gh->height == h)
|
||||||
|
@ -158,7 +158,7 @@ static void WM_Redim(GHandle gh, coord_t x, coord_t y, coord_t w, coord_t h) {
|
||||||
|
|
||||||
// Clear the old area
|
// Clear the old area
|
||||||
if ((gh->flags & GWIN_FLG_VISIBLE))
|
if ((gh->flags & GWIN_FLG_VISIBLE))
|
||||||
gdispFillArea(gh->x, gh->y, gh->width, gh->height, gwinGetDefaultBgColor());
|
gdispGFillArea(gh->display, gh->x, gh->y, gh->width, gh->height, gwinGetDefaultBgColor());
|
||||||
|
|
||||||
// Set the new size
|
// Set the new size
|
||||||
gh->x = x; gh->y = y;
|
gh->x = x; gh->y = y;
|
||||||
|
@ -168,7 +168,7 @@ static void WM_Redim(GHandle gh, coord_t x, coord_t y, coord_t w, coord_t h) {
|
||||||
if ((gh->flags & GWIN_FLG_VISIBLE)) {
|
if ((gh->flags & GWIN_FLG_VISIBLE)) {
|
||||||
if (gh->vmt->Redraw) {
|
if (gh->vmt->Redraw) {
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gh->vmt->Redraw(gh);
|
gh->vmt->Redraw(gh);
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ static void WM_Raise(GHandle gh) {
|
||||||
if ((gh->flags & GWIN_FLG_VISIBLE)) {
|
if ((gh->flags & GWIN_FLG_VISIBLE)) {
|
||||||
if (gh->vmt->Redraw) {
|
if (gh->vmt->Redraw) {
|
||||||
#if GDISP_NEED_CLIP
|
#if GDISP_NEED_CLIP
|
||||||
gdispSetClip(gh->x, gh->y, gh->width, gh->height);
|
gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height);
|
||||||
#endif
|
#endif
|
||||||
gh->vmt->Redraw(gh);
|
gh->vmt->Redraw(gh);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,8 +48,8 @@ static void gwinLabelDefaultDraw(GWidgetObject *gw, void *param) {
|
||||||
coord_t w, h;
|
coord_t w, h;
|
||||||
(void) param;
|
(void) param;
|
||||||
|
|
||||||
w = (gw->g.flags & GLABEL_FLG_WAUTO) ? getwidth(gw->text, gw->g.font, gdispGetWidth() - gw->g.x) : gw->g.width;
|
w = (gw->g.flags & GLABEL_FLG_WAUTO) ? getwidth(gw->text, gw->g.font, gdispGGetWidth(gw->g.display) - gw->g.x) : gw->g.width;
|
||||||
h = (gw->g.flags & GLABEL_FLG_HAUTO) ? getheight(gw->text, gw->g.font, gdispGetWidth() - gw->g.x) : gw->g.height;
|
h = (gw->g.flags & GLABEL_FLG_HAUTO) ? getheight(gw->text, gw->g.font, gdispGGetWidth(gw->g.display) - gw->g.x) : gw->g.height;
|
||||||
|
|
||||||
if (gw->g.width != w || gw->g.height != h) {
|
if (gw->g.width != w || gw->g.height != h) {
|
||||||
gwinResize(&gw->g, w, h);
|
gwinResize(&gw->g, w, h);
|
||||||
|
@ -58,13 +58,13 @@ static void gwinLabelDefaultDraw(GWidgetObject *gw, void *param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// render the text
|
// render the text
|
||||||
gdispFillStringBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->text, gw->g.font,
|
gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->text, gw->g.font,
|
||||||
(gw->g.flags & GWIN_FLG_ENABLED) ? gw->pstyle->enabled.text : gw->pstyle->disabled.text, gw->pstyle->background,
|
(gw->g.flags & GWIN_FLG_ENABLED) ? gw->pstyle->enabled.text : gw->pstyle->disabled.text, gw->pstyle->background,
|
||||||
justifyLeft);
|
justifyLeft);
|
||||||
|
|
||||||
// render the border (if any)
|
// render the border (if any)
|
||||||
if (gw->g.flags & GLABEL_FLG_BORDER)
|
if (gw->g.flags & GLABEL_FLG_BORDER)
|
||||||
gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, (gw->g.flags & GWIN_FLG_ENABLED) ? gw->pstyle->enabled.edge : gw->pstyle->disabled.edge);
|
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, (gw->g.flags & GWIN_FLG_ENABLED) ? gw->pstyle->enabled.edge : gw->pstyle->disabled.edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const gwidgetVMT labelVMT = {
|
static const gwidgetVMT labelVMT = {
|
||||||
|
@ -102,23 +102,23 @@ static const gwidgetVMT labelVMT = {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
GHandle gwinLabelCreate(GLabelObject *widget, GWidgetInit *pInit) {
|
GHandle gwinGLabelCreate(GDisplay *g, GLabelObject *widget, GWidgetInit *pInit) {
|
||||||
uint16_t flags = 0;
|
uint16_t flags = 0;
|
||||||
|
|
||||||
// auto assign width
|
// auto assign width
|
||||||
if (pInit->g.width <= 0) {
|
if (pInit->g.width <= 0) {
|
||||||
|
|
||||||
flags |= GLABEL_FLG_WAUTO;
|
flags |= GLABEL_FLG_WAUTO;
|
||||||
pInit->g.width = getwidth(pInit->text, gwinGetDefaultFont(), gdispGetWidth() - pInit->g.x);
|
pInit->g.width = getwidth(pInit->text, gwinGetDefaultFont(), gdispGGetWidth(g) - pInit->g.x);
|
||||||
}
|
}
|
||||||
|
|
||||||
// auto assign height
|
// auto assign height
|
||||||
if (pInit->g.height <= 0) {
|
if (pInit->g.height <= 0) {
|
||||||
flags |= GLABEL_FLG_HAUTO;
|
flags |= GLABEL_FLG_HAUTO;
|
||||||
pInit->g.height = getheight(pInit->text, gwinGetDefaultFont(), gdispGetWidth() - pInit->g.x);
|
pInit->g.height = getheight(pInit->text, gwinGetDefaultFont(), gdispGGetWidth(g) - pInit->g.x);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(widget = (GLabelObject *)_gwidgetCreate(&widget->w, pInit, &labelVMT)))
|
if (!(widget = (GLabelObject *)_gwidgetCreate(g, &widget->w, pInit, &labelVMT)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// no borders by default
|
// no borders by default
|
||||||
|
|
|
@ -96,15 +96,15 @@ static void gwinListDefaultDraw(GWidgetObject* gw, void* param) {
|
||||||
// the scroll area
|
// the scroll area
|
||||||
if ((gw2obj->cnt > (gw->g.height-2) / iheight) || (gw->g.flags & GLIST_FLG_SCROLLALWAYS)) {
|
if ((gw2obj->cnt > (gw->g.height-2) / iheight) || (gw->g.flags & GLIST_FLG_SCROLLALWAYS)) {
|
||||||
iwidth = gw->g.width - (SCROLLWIDTH+3);
|
iwidth = gw->g.width - (SCROLLWIDTH+3);
|
||||||
gdispFillArea(gw->g.x+iwidth+2, gw->g.y+1, SCROLLWIDTH, gw->g.height-2, gdispBlendColor(ps->fill, gw->pstyle->background, 128));
|
gdispGFillArea(gw->g.display, gw->g.x+iwidth+2, gw->g.y+1, SCROLLWIDTH, gw->g.height-2, gdispBlendColor(ps->fill, gw->pstyle->background, 128));
|
||||||
gdispDrawLine(gw->g.x+iwidth+1, gw->g.y+1, gw->g.x+iwidth+1, gw->g.y+gw->g.height-2, ps->edge);
|
gdispGDrawLine(gw->g.display, gw->g.x+iwidth+1, gw->g.y+1, gw->g.x+iwidth+1, gw->g.y+gw->g.height-2, ps->edge);
|
||||||
#if GDISP_NEED_CONVEX_POLYGON
|
#if GDISP_NEED_CONVEX_POLYGON
|
||||||
gdispFillConvexPoly(gw->g.x+iwidth+((SCROLLWIDTH-ARROW)/2+2), gw->g.y+(ARROW/2+1), upArrow, 3, ps->fill);
|
gdispGFillConvexPoly(gw->g.display, gw->g.x+iwidth+((SCROLLWIDTH-ARROW)/2+2), gw->g.y+(ARROW/2+1), upArrow, 3, ps->fill);
|
||||||
gdispFillConvexPoly(gw->g.x+iwidth+((SCROLLWIDTH-ARROW)/2+2), gw->g.y+gw->g.height-(ARROW+ARROW/2+1), downArrow, 3, ps->fill);
|
gdispGFillConvexPoly(gw->g.display, gw->g.x+iwidth+((SCROLLWIDTH-ARROW)/2+2), gw->g.y+gw->g.height-(ARROW+ARROW/2+1), downArrow, 3, ps->fill);
|
||||||
#else
|
#else
|
||||||
#warning "GWIN: Lists display better when GDISP_NEED_CONVEX_POLGON is turned on"
|
#warning "GWIN: Lists display better when GDISP_NEED_CONVEX_POLGON is turned on"
|
||||||
gdispFillArea(gw->g.x+iwidth+((SCROLLWIDTH-ARROW)/2+2), gw->g.y+(ARROW/2+1), ARROW, ARROW, ps->fill);
|
gdispGFillArea(gw->g.display, gw->g.x+iwidth+((SCROLLWIDTH-ARROW)/2+2), gw->g.y+(ARROW/2+1), ARROW, ARROW, ps->fill);
|
||||||
gdispFillArea(gw->g.x+iwidth+((SCROLLWIDTH-ARROW)/2+2), gw->g.y+gw->g.height-(ARROW+ARROW/2+1), ARROW, ARROW, ps->fill);
|
gdispGFillArea(gw->g.display, gw->g.x+iwidth+((SCROLLWIDTH-ARROW)/2+2), gw->g.y+gw->g.height-(ARROW+ARROW/2+1), ARROW, ARROW, ps->fill);
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
iwidth = gw->g.width - 2;
|
iwidth = gw->g.width - 2;
|
||||||
|
@ -126,7 +126,7 @@ static void gwinListDefaultDraw(GWidgetObject* gw, void* param) {
|
||||||
#if GWIN_NEED_LIST_IMAGES
|
#if GWIN_NEED_LIST_IMAGES
|
||||||
if ((gw->g.flags & GLIST_FLG_HASIMAGES)) {
|
if ((gw->g.flags & GLIST_FLG_HASIMAGES)) {
|
||||||
// Clear the image area
|
// Clear the image area
|
||||||
gdispFillArea(gw->g.x+1, gw->g.y+y, x-1, iheight, fill);
|
gdispGFillArea(gw->g.display, gw->g.x+1, gw->g.y+y, x-1, iheight, fill);
|
||||||
if (qi2li->pimg && gdispImageIsOpen(qi2li->pimg)) {
|
if (qi2li->pimg && gdispImageIsOpen(qi2li->pimg)) {
|
||||||
// Calculate which image
|
// Calculate which image
|
||||||
sy = (qi2li->flags & GLIST_FLG_SELECTED) ? 0 : (iheight-TEXTGAP);
|
sy = (qi2li->flags & GLIST_FLG_SELECTED) ? 0 : (iheight-TEXTGAP);
|
||||||
|
@ -136,19 +136,19 @@ static void gwinListDefaultDraw(GWidgetObject* gw, void* param) {
|
||||||
sy -= iheight-TEXTGAP;
|
sy -= iheight-TEXTGAP;
|
||||||
// Draw the image
|
// Draw the image
|
||||||
gdispImageSetBgColor(qi2li->pimg, fill);
|
gdispImageSetBgColor(qi2li->pimg, fill);
|
||||||
gdispImageDraw(qi2li->pimg, gw->g.x+1, gw->g.y+y, iheight-TEXTGAP, iheight-TEXTGAP, 0, sy);
|
gdispGImageDraw(gw->g.display, qi2li->pimg, gw->g.x+1, gw->g.y+y, iheight-TEXTGAP, iheight-TEXTGAP, 0, sy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
gdispFillStringBox(gw->g.x+x, gw->g.y+y, iwidth, iheight, qi2li->text, gw->g.font, ps->text, fill, justifyLeft);
|
gdispGFillStringBox(gw->g.display, gw->g.x+x, gw->g.y+y, iwidth, iheight, qi2li->text, gw->g.font, ps->text, fill, justifyLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill any remaining item space
|
// Fill any remaining item space
|
||||||
if (y < gw->g.height-1)
|
if (y < gw->g.height-1)
|
||||||
gdispFillArea(gw->g.x+1, gw->g.y+y, iwidth, gw->g.height-1-y, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x+1, gw->g.y+y, iwidth, gw->g.height-1-y, gw->pstyle->background);
|
||||||
|
|
||||||
// the list frame
|
// the list frame
|
||||||
gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, ps->edge);
|
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, ps->edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if GINPUT_NEED_MOUSE
|
#if GINPUT_NEED_MOUSE
|
||||||
|
@ -318,8 +318,8 @@ static const gwidgetVMT listVMT = {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
GHandle gwinListCreate(GListObject* gobj, GWidgetInit* pInit, bool_t multiselect) {
|
GHandle gwinGListCreate(GDisplay *g, GListObject* gobj, GWidgetInit* pInit, bool_t multiselect) {
|
||||||
if (!(gobj = (GListObject *)_gwidgetCreate(&gobj->w, pInit, &listVMT)))
|
if (!(gobj = (GListObject *)_gwidgetCreate(g, &gobj->w, pInit, &listVMT)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// initialize the item queue
|
// initialize the item queue
|
||||||
|
|
|
@ -108,8 +108,8 @@ static const gwidgetVMT radioVMT = {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
GHandle gwinRadioCreate(GRadioObject *gw, const GWidgetInit *pInit, uint16_t group) {
|
GHandle gwinGRadioCreate(GDisplay *g, GRadioObject *gw, const GWidgetInit *pInit, uint16_t group) {
|
||||||
if (!(gw = (GRadioObject *)_gwidgetCreate(&gw->w, pInit, &radioVMT)))
|
if (!(gw = (GRadioObject *)_gwidgetCreate(g, &gw->w, pInit, &radioVMT)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if GINPUT_NEED_TOGGLE
|
#if GINPUT_NEED_TOGGLE
|
||||||
|
@ -177,21 +177,21 @@ void gwinRadioDraw_Radio(GWidgetObject *gw, void *param) {
|
||||||
|
|
||||||
#if GDISP_NEED_CIRCLE
|
#if GDISP_NEED_CIRCLE
|
||||||
df = (ld-1)/2;
|
df = (ld-1)/2;
|
||||||
gdispFillArea(gw->g.x, gw->g.y, ld, ld, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, ld, ld, gw->pstyle->background);
|
||||||
gdispDrawCircle(gw->g.x+df, gw->g.y+df, df, pcol->edge);
|
gdispGDrawCircle(gw->g.display, gw->g.x+df, gw->g.y+df, df, pcol->edge);
|
||||||
|
|
||||||
if (gw->g.flags & GRADIO_FLG_PRESSED)
|
if (gw->g.flags & GRADIO_FLG_PRESSED)
|
||||||
gdispFillCircle(gw->g.x+df, gw->g.y+df, df <= 2 ? 1 : (df-2), pcol->fill);
|
gdispGFillCircle(gw->g.display, gw->g.x+df, gw->g.y+df, df <= 2 ? 1 : (df-2), pcol->fill);
|
||||||
#else
|
#else
|
||||||
gdispFillArea(gw->g.x+1, gw->g.y+1, ld, ld-2, gw->pstyle->background);
|
gdispGFillArea(gw->g.display, gw->g.x+1, gw->g.y+1, ld, ld-2, gw->pstyle->background);
|
||||||
gdispDrawBox(gw->g.x, gw->g.y, ld, ld, pcol->edge);
|
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, ld, ld, pcol->edge);
|
||||||
|
|
||||||
df = ld < 4 ? 1 : 2;
|
df = ld < 4 ? 1 : 2;
|
||||||
if (gw->g.flags & GRADIO_FLG_PRESSED)
|
if (gw->g.flags & GRADIO_FLG_PRESSED)
|
||||||
gdispFillArea(gw->g.x+df, gw->g.y+df, ld-2*df, ld-2*df, pcol->fill);
|
gdispGFillArea(gw->g.display, gw->g.x+df, gw->g.y+df, ld-2*df, ld-2*df, pcol->fill);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gdispFillStringBox(gw->g.x+ld+1, gw->g.y, gw->g.width-ld-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyLeft);
|
gdispGFillStringBox(gw->g.display, gw->g.x+ld+1, gw->g.y, gw->g.width-ld-1, gw->g.height, gw->text, gw->g.font, pcol->text, gw->pstyle->background, justifyLeft);
|
||||||
#undef gcw
|
#undef gcw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,9 +202,9 @@ void gwinRadioDraw_Button(GWidgetObject *gw, void *param) {
|
||||||
if (gw->g.vmt != (gwinVMT *)&radioVMT) return;
|
if (gw->g.vmt != (gwinVMT *)&radioVMT) return;
|
||||||
pcol = getDrawColors(gw);
|
pcol = getDrawColors(gw);
|
||||||
|
|
||||||
gdispFillStringBox(gw->g.x, gw->g.y, gw->g.width-1, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
|
gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width-1, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
|
||||||
gdispDrawLine(gw->g.x+gw->g.width-1, gw->g.y, gw->g.x+gw->g.width-1, gw->g.y+gw->g.height-1, pcol->edge);
|
gdispGDrawLine(gw->g.display, gw->g.x+gw->g.width-1, gw->g.y, gw->g.x+gw->g.width-1, gw->g.y+gw->g.height-1, pcol->edge);
|
||||||
gdispDrawLine(gw->g.x, gw->g.y+gw->g.height-1, gw->g.x+gw->g.width-2, gw->g.y+gw->g.height-1, pcol->edge);
|
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gw->g.height-1, gw->g.x+gw->g.width-2, gw->g.y+gw->g.height-1, pcol->edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gwinRadioDraw_Tab(GWidgetObject *gw, void *param) {
|
void gwinRadioDraw_Tab(GWidgetObject *gw, void *param) {
|
||||||
|
@ -215,12 +215,12 @@ void gwinRadioDraw_Tab(GWidgetObject *gw, void *param) {
|
||||||
pcol = getDrawColors(gw);
|
pcol = getDrawColors(gw);
|
||||||
|
|
||||||
if ((gw->g.flags & GRADIO_FLG_PRESSED)) {
|
if ((gw->g.flags & GRADIO_FLG_PRESSED)) {
|
||||||
gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge);
|
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge);
|
||||||
gdispFillStringBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
|
gdispGFillStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
|
||||||
} else {
|
} else {
|
||||||
gdispFillStringBox(gw->g.x, gw->g.y, gw->g.width-1, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
|
gdispGFillStringBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width-1, gw->g.height-1, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter);
|
||||||
gdispDrawLine(gw->g.x+gw->g.width-1, gw->g.y, gw->g.x+gw->g.width-1, gw->g.y+gw->g.height-1, pcol->edge);
|
gdispGDrawLine(gw->g.display, gw->g.x+gw->g.width-1, gw->g.y, gw->g.x+gw->g.width-1, gw->g.y+gw->g.height-1, pcol->edge);
|
||||||
gdispDrawLine(gw->g.x, gw->g.y+gw->g.height-1, gw->g.x+gw->g.width-2, gw->g.y+gw->g.height-1, pcol->edge);
|
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gw->g.height-1, gw->g.x+gw->g.width-2, gw->g.y+gw->g.height-1, pcol->edge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -223,8 +223,8 @@ static const gwidgetVMT sliderVMT = {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
GHandle gwinSliderCreate(GSliderObject *gs, const GWidgetInit *pInit) {
|
GHandle gwinGSliderCreate(GDisplay *g, GSliderObject *gs, const GWidgetInit *pInit) {
|
||||||
if (!(gs = (GSliderObject *)_gwidgetCreate(&gs->w, pInit, &sliderVMT)))
|
if (!(gs = (GSliderObject *)_gwidgetCreate(g, &gs->w, pInit, &sliderVMT)))
|
||||||
return 0;
|
return 0;
|
||||||
#if GINPUT_NEED_TOGGLE
|
#if GINPUT_NEED_TOGGLE
|
||||||
gs->t_dn = GWIDGET_NO_INSTANCE;
|
gs->t_dn = GWIDGET_NO_INSTANCE;
|
||||||
|
@ -294,30 +294,30 @@ void gwinSliderDraw_Std(GWidgetObject *gw, void *param) {
|
||||||
|
|
||||||
if (gw->g.width < gw->g.height) { // Vertical slider
|
if (gw->g.width < gw->g.height) { // Vertical slider
|
||||||
if (gsw->dpos != gw->g.height-1)
|
if (gsw->dpos != gw->g.height-1)
|
||||||
gdispFillArea(gw->g.x, gw->g.y+gsw->dpos, gw->g.width, gw->g.height - gsw->dpos, pcol->progress); // Active Area
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y+gsw->dpos, gw->g.width, gw->g.height - gsw->dpos, pcol->progress); // Active Area
|
||||||
if (gsw->dpos != 0)
|
if (gsw->dpos != 0)
|
||||||
gdispFillArea(gw->g.x, gw->g.y, gw->g.width, gsw->dpos, gw->pstyle->enabled.progress); // Inactive area
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gsw->dpos, gw->pstyle->enabled.progress); // Inactive area
|
||||||
gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); // Edge
|
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); // Edge
|
||||||
gdispDrawLine(gw->g.x, gw->g.y+gsw->dpos, gw->g.x+gw->g.width-1, gw->g.y+gsw->dpos, pcol->edge); // Thumb
|
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gsw->dpos, gw->g.x+gw->g.width-1, gw->g.y+gsw->dpos, pcol->edge); // Thumb
|
||||||
if (gsw->dpos >= 2)
|
if (gsw->dpos >= 2)
|
||||||
gdispDrawLine(gw->g.x, gw->g.y+gsw->dpos-2, gw->g.x+gw->g.width-1, gw->g.y+gsw->dpos-2, pcol->edge); // Thumb
|
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gsw->dpos-2, gw->g.x+gw->g.width-1, gw->g.y+gsw->dpos-2, pcol->edge); // Thumb
|
||||||
if (gsw->dpos <= gw->g.height-2)
|
if (gsw->dpos <= gw->g.height-2)
|
||||||
gdispDrawLine(gw->g.x, gw->g.y+gsw->dpos+2, gw->g.x+gw->g.width-1, gw->g.y+gsw->dpos+2, pcol->edge); // Thumb
|
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gsw->dpos+2, gw->g.x+gw->g.width-1, gw->g.y+gsw->dpos+2, pcol->edge); // Thumb
|
||||||
|
|
||||||
// Horizontal slider
|
// Horizontal slider
|
||||||
} else {
|
} else {
|
||||||
if (gsw->dpos != gw->g.width-1)
|
if (gsw->dpos != gw->g.width-1)
|
||||||
gdispFillArea(gw->g.x+gsw->dpos, gw->g.y, gw->g.width-gsw->dpos, gw->g.height, gw->pstyle->enabled.progress); // Inactive area
|
gdispGFillArea(gw->g.display, gw->g.x+gsw->dpos, gw->g.y, gw->g.width-gsw->dpos, gw->g.height, gw->pstyle->enabled.progress); // Inactive area
|
||||||
if (gsw->dpos != 0)
|
if (gsw->dpos != 0)
|
||||||
gdispFillArea(gw->g.x, gw->g.y, gsw->dpos, gw->g.height, pcol->progress); // Active Area
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gsw->dpos, gw->g.height, pcol->progress); // Active Area
|
||||||
gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); // Edge
|
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); // Edge
|
||||||
gdispDrawLine(gw->g.x+gsw->dpos, gw->g.y, gw->g.x+gsw->dpos, gw->g.y+gw->g.height-1, pcol->edge); // Thumb
|
gdispGDrawLine(gw->g.display, gw->g.x+gsw->dpos, gw->g.y, gw->g.x+gsw->dpos, gw->g.y+gw->g.height-1, pcol->edge); // Thumb
|
||||||
if (gsw->dpos >= 2)
|
if (gsw->dpos >= 2)
|
||||||
gdispDrawLine(gw->g.x+gsw->dpos-2, gw->g.y, gw->g.x+gsw->dpos-2, gw->g.y+gw->g.height-1, pcol->edge); // Thumb
|
gdispGDrawLine(gw->g.display, gw->g.x+gsw->dpos-2, gw->g.y, gw->g.x+gsw->dpos-2, gw->g.y+gw->g.height-1, pcol->edge); // Thumb
|
||||||
if (gsw->dpos <= gw->g.width-2)
|
if (gsw->dpos <= gw->g.width-2)
|
||||||
gdispDrawLine(gw->g.x+gsw->dpos+2, gw->g.y, gw->g.x+gsw->dpos+2, gw->g.y+gw->g.height-1, pcol->edge); // Thumb
|
gdispGDrawLine(gw->g.display, gw->g.x+gsw->dpos+2, gw->g.y, gw->g.x+gsw->dpos+2, gw->g.y+gw->g.height-1, pcol->edge); // Thumb
|
||||||
}
|
}
|
||||||
gdispDrawStringBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
||||||
|
|
||||||
#undef gsw
|
#undef gsw
|
||||||
}
|
}
|
||||||
|
@ -338,7 +338,7 @@ void gwinSliderDraw_Image(GWidgetObject *gw, void *param) {
|
||||||
|
|
||||||
if (gw->g.width < gw->g.height) { // Vertical slider
|
if (gw->g.width < gw->g.height) { // Vertical slider
|
||||||
if (gsw->dpos != 0) // The unfilled area
|
if (gsw->dpos != 0) // The unfilled area
|
||||||
gdispFillArea(gw->g.x, gw->g.y, gw->g.width, gsw->dpos, gw->pstyle->enabled.progress); // Inactive area
|
gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gsw->dpos, gw->pstyle->enabled.progress); // Inactive area
|
||||||
if (gsw->dpos != gw->g.height-1) { // The filled area
|
if (gsw->dpos != gw->g.height-1) { // The filled area
|
||||||
for(z=gw->g.height, v=gi->height; z > gsw->dpos;) {
|
for(z=gw->g.height, v=gi->height; z > gsw->dpos;) {
|
||||||
z -= v;
|
z -= v;
|
||||||
|
@ -346,27 +346,27 @@ void gwinSliderDraw_Image(GWidgetObject *gw, void *param) {
|
||||||
v -= gsw->dpos - z;
|
v -= gsw->dpos - z;
|
||||||
z = gsw->dpos;
|
z = gsw->dpos;
|
||||||
}
|
}
|
||||||
gdispImageDraw(gi, gw->g.x, gw->g.y+z, gw->g.width, v, 0, gi->height-v);
|
gdispGImageDraw(gw->g.display, gi, gw->g.x, gw->g.y+z, gw->g.width, v, 0, gi->height-v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); // Edge
|
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); // Edge
|
||||||
gdispDrawLine(gw->g.x, gw->g.y+gsw->dpos, gw->g.x+gw->g.width-1, gw->g.y+gsw->dpos, pcol->edge); // Thumb
|
gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+gsw->dpos, gw->g.x+gw->g.width-1, gw->g.y+gsw->dpos, pcol->edge); // Thumb
|
||||||
|
|
||||||
// Horizontal slider
|
// Horizontal slider
|
||||||
} else {
|
} else {
|
||||||
if (gsw->dpos != gw->g.width-1) // The unfilled area
|
if (gsw->dpos != gw->g.width-1) // The unfilled area
|
||||||
gdispFillArea(gw->g.x+gsw->dpos, gw->g.y, gw->g.width-gsw->dpos, gw->g.height, gw->pstyle->enabled.progress); // Inactive area
|
gdispGFillArea(gw->g.display, gw->g.x+gsw->dpos, gw->g.y, gw->g.width-gsw->dpos, gw->g.height, gw->pstyle->enabled.progress); // Inactive area
|
||||||
if (gsw->dpos != 0) { // The filled area
|
if (gsw->dpos != 0) { // The filled area
|
||||||
for(z=0, v=gi->width; z < gsw->dpos; z += v) {
|
for(z=0, v=gi->width; z < gsw->dpos; z += v) {
|
||||||
if (z+v > gsw->dpos)
|
if (z+v > gsw->dpos)
|
||||||
v -= z+v - gsw->dpos;
|
v -= z+v - gsw->dpos;
|
||||||
gdispImageDraw(gi, gw->g.x+z, gw->g.y, v, gw->g.height, 0, 0);
|
gdispGImageDraw(gw->g.display, gi, gw->g.x+z, gw->g.y, v, gw->g.height, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gdispDrawBox(gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); // Edge
|
gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); // Edge
|
||||||
gdispDrawLine(gw->g.x+gsw->dpos, gw->g.y, gw->g.x+gsw->dpos, gw->g.y+gw->g.height-1, pcol->edge); // Thumb
|
gdispGDrawLine(gw->g.display, gw->g.x+gsw->dpos, gw->g.y, gw->g.x+gsw->dpos, gw->g.y+gw->g.height-1, pcol->edge); // Thumb
|
||||||
}
|
}
|
||||||
gdispDrawStringBox(gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter);
|
||||||
|
|
||||||
#undef gsw
|
#undef gsw
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue