From 25f769ba09bef54e5cccf40bb7ed9d7f3dcca8a1 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 21 Oct 2013 00:28:50 +0200 Subject: doxygen fix --- include/gwin/list.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/gwin') diff --git a/include/gwin/list.h b/include/gwin/list.h index b01dbf3f..fc189658 100644 --- a/include/gwin/list.h +++ b/include/gwin/list.h @@ -205,10 +205,12 @@ bool_t gwinListItemIsSelected(GHandle gh, int item); */ int gwinListGetSelected(GHandle gh); -#if GWIN_NEED_LIST_IMAGES +#if GWIN_NEED_LIST_IMAGES || defined(__DOXYGEN__) /** * @brief Set the image for a list item * + * @pre GWIN_NEED_LIST_IMAGES must be set to true in your gfxconf.h + * * @param[in] gh The widget handle (must be a list handle) * @param[in] item The item ID * @param[in] pimg The image to be displayed or NULL to turn off the image for this list item. -- cgit v1.2.3 From 6cc80926f00ce8d6533298cbb5ea061c1446287b Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Wed, 23 Oct 2013 00:18:03 +0200 Subject: Added gwinListGetSelectedText() --- include/gwin/list.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/gwin') diff --git a/include/gwin/list.h b/include/gwin/list.h index fc189658..05433e87 100644 --- a/include/gwin/list.h +++ b/include/gwin/list.h @@ -205,6 +205,19 @@ bool_t gwinListItemIsSelected(GHandle gh, int item); */ int gwinListGetSelected(GHandle gh); +/** + * @brief Get the text of the selected item + * + * @param[in] gh The widget handle (must be a list handle) + * + * @return The test of the selected list item for a single-select list. + * + * @note It always returns NULL (nothing selected) for a multi-select list. + * + * @api + */ +const char* gwinListGetSelectedText(GHandle gh); + #if GWIN_NEED_LIST_IMAGES || defined(__DOXYGEN__) /** * @brief Set the image for a list item -- cgit v1.2.3 From 8fce1a6fcef51f171d5fd9ed381583507b361210 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Wed, 23 Oct 2013 16:26:34 +0200 Subject: Added gwinListSetScroll --- include/gwin/list.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include/gwin') diff --git a/include/gwin/list.h b/include/gwin/list.h index 05433e87..cba5b137 100644 --- a/include/gwin/list.h +++ b/include/gwin/list.h @@ -56,6 +56,13 @@ typedef struct GListObject { gfxQueueASync list_head; // The list of items } GListObject; +/** + * @brief Enum to change the behaviour of the scroll area + * + * @note This might be used with @p gwinListSetScroll() + */ +typedef enum scroll_t { scrollAlways, scrollAuto } scroll_t; + #ifdef __cplusplus extern "C" { #endif @@ -85,6 +92,18 @@ extern "C" { */ GHandle gwinListCreate(GListObject *widget, GWidgetInit *pInit, bool_t multiselect); +/** + * @brief Change the behaviour of the scroll area + * + * @note Current possible values: @p scrollAlways and @p scrollAuto + * + * @param[in] gh The widget handle (must be a list handle) + * @param[in] flag The behaviour to be set + * + * @api + */ +void gwinListSetScroll(GHandle gh, scroll_t flag); + /** * @brief Add an item to the list * -- cgit v1.2.3 From 03a863f2924d4c89b91b5379f020aaa3f419b7e5 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Wed, 23 Oct 2013 16:28:45 +0200 Subject: docs --- include/gwin/list.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/gwin') diff --git a/include/gwin/list.h b/include/gwin/list.h index cba5b137..b45e7767 100644 --- a/include/gwin/list.h +++ b/include/gwin/list.h @@ -57,7 +57,7 @@ typedef struct GListObject { } GListObject; /** - * @brief Enum to change the behaviour of the scroll area + * @brief Enum to change the behaviour of the scroll bar * * @note This might be used with @p gwinListSetScroll() */ @@ -93,7 +93,7 @@ extern "C" { GHandle gwinListCreate(GListObject *widget, GWidgetInit *pInit, bool_t multiselect); /** - * @brief Change the behaviour of the scroll area + * @brief Change the behaviour of the scroll bar * * @note Current possible values: @p scrollAlways and @p scrollAuto * -- cgit v1.2.3 From 248335c513fe92d1629f2c34c5777ef9b628d09e Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Thu, 24 Oct 2013 04:13:07 +0200 Subject: Added gwinLabelSetBorder() --- include/gwin/label.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'include/gwin') diff --git a/include/gwin/label.h b/include/gwin/label.h index c11b5c72..3156ca71 100644 --- a/include/gwin/label.h +++ b/include/gwin/label.h @@ -39,8 +39,8 @@ extern "C" { #endif /** - * @brief Create a label widget. - * @details A label widget is a simple window which has a static text. + * @brief Create a label widget. + * @details A label widget is a simple window which has a static text. * * @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. @@ -51,6 +51,16 @@ extern "C" { */ GHandle gwinLabelCreate(GLabelObject *widget, GWidgetInit *pInit); +/** + * @brief Border settings for the default rendering routine + * + * @param[in] gh The widget handle (must be a list handle) + * @param[in] border Shall a border be rendered? + * + * @api + */ +void gwinLabelSetBorder(GHandle gh, bool_t border); + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 7a7e223d152b42553f7e6ce0220dd5d736b89c56 Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 24 Oct 2013 18:36:11 +1000 Subject: Add multiple display support to GWIN. You can now create windows on multiple displays. --- include/gwin/button.h | 4 +++- include/gwin/checkbox.h | 4 +++- include/gwin/class_gwin.h | 6 ++++-- include/gwin/console.h | 4 +++- include/gwin/graph.h | 4 +++- include/gwin/gwin.h | 5 ++++- include/gwin/image.h | 4 +++- include/gwin/label.h | 4 +++- include/gwin/list.h | 4 +++- include/gwin/radio.h | 4 +++- include/gwin/slider.h | 4 +++- 11 files changed, 35 insertions(+), 12 deletions(-) (limited to 'include/gwin') diff --git a/include/gwin/button.h b/include/gwin/button.h index 13b135a3..d11764d6 100644 --- a/include/gwin/button.h +++ b/include/gwin/button.h @@ -59,6 +59,7 @@ extern "C" { * @brief Create a button widget. * @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] pInit The initialisation parameters * @@ -74,7 +75,8 @@ extern "C" { * * @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 diff --git a/include/gwin/checkbox.h b/include/gwin/checkbox.h index 29ebe96e..946f7e4a 100644 --- a/include/gwin/checkbox.h +++ b/include/gwin/checkbox.h @@ -52,6 +52,7 @@ typedef struct GCheckboxObject { * @brief Create a checkbox window. * @return NULL if there is no resultant drawing area, otherwise a window handle. * + * @param[in] g The GDisplay to display this window on * @param[in] gb The GCheckboxObject structure to initialise. If this is NULL, the structure is dynamically allocated. * @param[in] pInit The initialization parameters to use * @@ -67,7 +68,8 @@ typedef struct GCheckboxObject { * * @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 diff --git a/include/gwin/class_gwin.h b/include/gwin/class_gwin.h index b3f630e3..62b1752e 100644 --- a/include/gwin/class_gwin.h +++ b/include/gwin/class_gwin.h @@ -150,6 +150,7 @@ extern "C" { /** * @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] pInit The user initialization parameters * @param[in] vmt The virtual method table for the GWIN object @@ -159,12 +160,13 @@ extern "C" { * * @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__) /** * @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] pInit The user initialization parameters * @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 */ - 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 diff --git a/include/gwin/console.h b/include/gwin/console.h index c05c4ad2..ed65581e 100644 --- a/include/gwin/console.h +++ b/include/gwin/console.h @@ -50,6 +50,7 @@ extern "C" { * @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. * + * @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] pInit The initialization parameters to use * @@ -64,7 +65,8 @@ extern "C" { * * @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 /** diff --git a/include/gwin/graph.h b/include/gwin/graph.h index fd99458d..65a64126 100644 --- a/include/gwin/graph.h +++ b/include/gwin/graph.h @@ -90,6 +90,7 @@ extern "C" { * @brief Create a graph window. * @return NULL if there is no resultant drawing area, otherwise a window handle. * + * @param[in] g The GDisplay to display this window on * @param[in] gg The GGraphObject structure to initialise. If this is NULL the structure is dynamically allocated. * @param[in] pInit The initialization parameters to use * @@ -107,7 +108,8 @@ extern "C" { * * @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. diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h index 372ece9c..37a14fa1 100644 --- a/include/gwin/gwin.h +++ b/include/gwin/gwin.h @@ -38,6 +38,7 @@ typedef struct GWindowObject { gfxQueueASyncItem wmq; // @< The next window (for the window manager) #endif 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 width, height; // @< Dimensions of this window color_t color, bgcolor; // @< The current drawing colors @@ -165,6 +166,7 @@ extern "C" { * @brief Create a basic window. * @return NULL if there is no resultant drawing area, otherwise a window handle. * + * @param[in] g The GDisplay to display this window on * @param[in] pgw The window structure to initialize. If this is NULL the structure is dynamically allocated. * @param[in] pInit How to initialise the window * @@ -177,7 +179,8 @@ extern "C" { * * @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. diff --git a/include/gwin/image.h b/include/gwin/image.h index eae196e9..66dd0b94 100644 --- a/include/gwin/image.h +++ b/include/gwin/image.h @@ -47,6 +47,7 @@ extern "C" { * @details Display's a picture. * @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] pInit The initialization parameters to use. * @@ -55,7 +56,8 @@ extern "C" { * * @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 diff --git a/include/gwin/label.h b/include/gwin/label.h index 3156ca71..3fe0f3d7 100644 --- a/include/gwin/label.h +++ b/include/gwin/label.h @@ -42,6 +42,7 @@ extern "C" { * @brief Create a label widget. * @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] pInit The initialisation parameters to use. * @@ -49,7 +50,8 @@ extern "C" { * * @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 diff --git a/include/gwin/list.h b/include/gwin/list.h index b45e7767..4052f53f 100644 --- a/include/gwin/list.h +++ b/include/gwin/list.h @@ -82,6 +82,7 @@ extern "C" { * 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 * + * @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] pInit The initialization parameters to use * @param[in] multiselect If TRUE the list is multi-select instead of single-select. @@ -90,7 +91,8 @@ extern "C" { * * @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 diff --git a/include/gwin/radio.h b/include/gwin/radio.h index e59c526e..3ee2918f 100644 --- a/include/gwin/radio.h +++ b/include/gwin/radio.h @@ -59,6 +59,7 @@ extern "C" { * @brief Create a radio widget. * @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] pInit The initialisation parameters * @param[in] group The group of radio buttons this radio button belongs to. @@ -77,7 +78,8 @@ extern "C" { * * @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) diff --git a/include/gwin/slider.h b/include/gwin/slider.h index b037a621..8f87745c 100644 --- a/include/gwin/slider.h +++ b/include/gwin/slider.h @@ -58,6 +58,7 @@ extern "C" { * @brief Create a slider window. * @return NULL if there is no resultant drawing area, otherwise a window handle. * + * @param[in] g The GDisplay to display this window on * @param[in] gb The GSliderObject structure to initialise. If this is NULL the structure is dynamically allocated. * @param[in] pInit The initialization parameters to use * @@ -77,7 +78,8 @@ extern "C" { * * @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. -- cgit v1.2.3 From 7c3b7270fc1b39bf231654b846bcaeccead4413c Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Sun, 27 Oct 2013 16:39:42 +0100 Subject: moved include headers to correct location --- include/gwin/gwidget.h | 11 +++++++++++ include/gwin/gwin.h | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'include/gwin') diff --git a/include/gwin/gwidget.h b/include/gwin/gwidget.h index b760dd41..493485b3 100644 --- a/include/gwin/gwidget.h +++ b/include/gwin/gwidget.h @@ -279,15 +279,26 @@ bool_t gwinAttachListener(GListener *pl); #if GWIN_NEED_BUTTON || defined(__DOXYGEN__) #include "gwin/button.h" #endif + #if GWIN_NEED_SLIDER || defined(__DOXYGEN__) #include "gwin/slider.h" #endif + #if GWIN_NEED_CHECKBOX || defined(__DOXYGEN__) #include "gwin/checkbox.h" #endif + #if GWIN_NEED_RADIO || defined(__DOXYGEN__) #include "gwin/radio.h" #endif +#if GWIN_NEED_LABEL || defined(__DOXYGEN__) + #include "gwin/label.h" +#endif + +#if GWIN_NEED_LIST || defined(__DOXYGEN__) + #include "gwin/list.h" +#endif + #endif /* _GWIDGET_H */ /** @} */ diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h index 37a14fa1..fa5ba613 100644 --- a/include/gwin/gwin.h +++ b/include/gwin/gwin.h @@ -823,14 +823,6 @@ extern "C" { #include "gwin/image.h" #endif - #if GWIN_NEED_LABEL || defined(__DOXYGEN__) - #include "gwin/label.h" - #endif - - #if GWIN_NEED_LIST || defined(__DOXYGEN__) - #include "gwin/list.h" - #endif - #endif /* GFX_USE_GWIN */ #endif /* _GWIN_H */ -- cgit v1.2.3