aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-07-07 19:40:37 +1000
committerinmarket <andrewh@inmarket.com.au>2013-07-07 19:40:37 +1000
commit3957505ab119b21c7b0f4e72f56030c97711988a (patch)
tree5a059012d5fa0d07a93fcb70e72518bdaca1d4c5 /include
parentde28112a7d6db829142ad113c93eb8ad071b0d65 (diff)
downloaduGFX-3957505ab119b21c7b0f4e72f56030c97711988a.tar.gz
uGFX-3957505ab119b21c7b0f4e72f56030c97711988a.tar.bz2
uGFX-3957505ab119b21c7b0f4e72f56030c97711988a.zip
GWIN renaming, tidy up, color styles
Diffstat (limited to 'include')
-rw-r--r--include/gwin/button.h40
-rw-r--r--include/gwin/checkbox.h30
-rw-r--r--include/gwin/class_gwin.h5
-rw-r--r--include/gwin/console.h10
-rw-r--r--include/gwin/graph.h4
-rw-r--r--include/gwin/gwidget.h124
-rw-r--r--include/gwin/gwin.h83
-rw-r--r--include/gwin/image.h16
-rw-r--r--include/gwin/label.h6
-rw-r--r--include/gwin/radio.h41
-rw-r--r--include/gwin/slider.h36
11 files changed, 204 insertions, 191 deletions
diff --git a/include/gwin/button.h b/include/gwin/button.h
index afe6d0cc..a78a0a71 100644
--- a/include/gwin/button.h
+++ b/include/gwin/button.h
@@ -41,26 +41,14 @@ typedef struct GEventGWinButton {
} GEventGWinButton;
/**
- * @brief Button colors
- */
-typedef struct GButtonColors {
- color_t color_edge;
- color_t color_fill;
- color_t color_txt;
-} GButtonColors;
-
-/**
* @brief The button widget structure
* @note Do not use the members directly - treat it as a black-box.
*/
-typedef struct GButtonObject_t {
+typedef struct GButtonObject {
GWidgetObject w;
#if GINPUT_NEED_TOGGLE
- uint16_t toggle;
+ uint16_t toggle;
#endif
- GButtonColors c_up;
- GButtonColors c_dn;
- GButtonColors c_dis;
} GButtonObject;
#ifdef __cplusplus
@@ -86,26 +74,7 @@ extern "C" {
*
* @api
*/
-GHandle gwinCreateButton(GButtonObject *gb, const GWidgetInit *pInit);
-
-/**
- * @brief Set the colors of a button.
- *
- * @param[in] gh The window handle (must be a button widget)
- * @param[in] pUp The colors for the button when in the up state.
- * @param[in] pDown The colors for the button when in the down state.
- * @param[in] pDisabled The colors for the button when it is disabled.
- *
- * @note The button is not automatically redrawn. Call gwinButtonDraw() after changing the button style
- * @note The button style is copied into the internal button structure - there is no need to
- * maintain static style structures (they can be temporary structures on the stack).
- * @note The pUp, pDown and pDisabled parameters can be NULL. If they are then the existing color styles
- * are not changed for that button state.
- * @note Some custom drawn buttons will ignore he specified colors
- *
- * @api
- */
-void gwinSetButtonColors(GHandle gh, const GButtonColors *pUp, const GButtonColors *pDown, const GButtonColors *pDisabled);
+GHandle gwinButtonCreate(GButtonObject *gb, const GWidgetInit *pInit);
/**
* @brief Is the button current pressed
@@ -115,7 +84,7 @@ void gwinSetButtonColors(GHandle gh, const GButtonColors *pUp, const GButtonColo
*
* @api
*/
-bool_t gwinIsButtonPressed(GHandle gh);
+bool_t gwinButtonIsPressed(GHandle gh);
/**
* @brief Some custom button drawing routines
@@ -141,7 +110,6 @@ bool_t gwinIsButtonPressed(GHandle gh);
* @{
*/
void gwinButtonDraw_3D(GWidgetObject *gw, void *param); // @< A standard 3D button
-void gwinButtonDraw_Box(GWidgetObject *gw, void *param); // @< A very simple box style button
#if GDISP_NEED_ARC || defined(__DOXYGEN__)
void gwinButtonDraw_Rounded(GWidgetObject *gw, void *param); // @< A rounded rectangle button
#endif
diff --git a/include/gwin/checkbox.h b/include/gwin/checkbox.h
index 679a5d9c..fcd0549d 100644
--- a/include/gwin/checkbox.h
+++ b/include/gwin/checkbox.h
@@ -34,26 +34,18 @@
/* Type definitions */
/*===========================================================================*/
-typedef struct GEventGWinCheckbox_t {
+typedef struct GEventGWinCheckbox {
GEventType type; // The type of this event (GEVENT_GWIN_CHECKBOX)
GHandle checkbox; // The checkbox that has been depressed (actually triggered on release)
bool_t isChecked; // Is the checkbox currently checked or unchecked?
} GEventGWinCheckbox;
-typedef struct GCheckboxColors {
- color_t color_border;
- color_t color_checked;
- color_t color_bg;
- color_t color_txt;
-} GCheckboxColors;
-
/* A Checkbox window */
-typedef struct GCheckboxObject_t {
+typedef struct GCheckboxObject {
GWidgetObject w;
#if GINPUT_NEED_TOGGLE
uint16_t toggle;
#endif
- GCheckboxColors c;
} GCheckboxObject;
/**
@@ -75,27 +67,27 @@ typedef struct GCheckboxObject_t {
*
* @api
*/
-GHandle gwinCreateCheckbox(GCheckboxObject *gb, const GWidgetInit *pInit);
+GHandle gwinCheckboxCreate(GCheckboxObject *gb, const GWidgetInit *pInit);
/**
- * @brief Get the state of a checkbox
- * @return TRUE if the checkbox is currently checked
+ * @brief Set the state of a checkbox
*
- * @param[in] gh The window handle (must be a checkbox window)
+ * @param[in] gh The window handle (must be a checkbox window)
+ * @param[in] isChecked TRUE to set the check, FALSE to uncheck.
*
* @api
*/
-bool_t gwinIsCheckboxChecked(GHandle gh);
+void gwinCheckboxCheck(GHandle gh, bool_t isChecked);
/**
- * @brief Set the colors used to draw the checkbox
+ * @brief Get the state of a checkbox
+ * @return TRUE if the checkbox is currently checked
*
- * @param[in] gh The window handle (must be a checkbox window)
- * @param[in] pColors The colors to use
+ * @param[in] gh The window handle (must be a checkbox window)
*
* @api
*/
-void gwinCheckboxSetColors(GHandle gh, GCheckboxColors *pColors);
+bool_t gwinCheckboxIsChecked(GHandle gh);
/**
* @brief Some custom checkbox drawing routines
diff --git a/include/gwin/class_gwin.h b/include/gwin/class_gwin.h
index 1a4de5b9..3be496b1 100644
--- a/include/gwin/class_gwin.h
+++ b/include/gwin/class_gwin.h
@@ -136,6 +136,11 @@ typedef struct gwinVMT {
* @brief The list of all windows in the system
*/
extern gfxQueueASync _GWINList;
+
+ /**
+ * @brief The current window manager
+ */
+ extern GWindowManager * _GWINwm;
#endif
#ifdef __cplusplus
diff --git a/include/gwin/console.h b/include/gwin/console.h
index a3b3697c..b32c3628 100644
--- a/include/gwin/console.h
+++ b/include/gwin/console.h
@@ -27,7 +27,7 @@
/* This file is included within "gwin/gwin.h" */
// A console window. Supports wrapped text writing and a cursor.
-typedef struct GConsoleObject_t {
+typedef struct GConsoleObject {
GWindowObject g;
coord_t cx, cy; // Cursor position
@@ -46,8 +46,8 @@ extern "C" {
/**
* @brief Create a console window.
- * @details A console window allows text to be written using chprintf() (and the console functions defined here).
- * @brief Text in a console window supports newlines and will wrap text as required.
+ * @details A console window allows text to be written.
+ * @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] gc The GConsoleObject structure to initialise. If this is NULL the structure is dynamically allocated.
@@ -64,7 +64,7 @@ extern "C" {
*
* @api
*/
-GHandle gwinCreateConsole(GConsoleObject *gc, const GWindowInit *pInit);
+GHandle gwinConsoleCreate(GConsoleObject *gc, const GWindowInit *pInit);
#if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM
/**
@@ -77,7 +77,7 @@ GHandle gwinCreateConsole(GConsoleObject *gc, const GWindowInit *pInit);
*
* @api
*/
- BaseSequentialStream *gwinGetConsoleStream(GHandle gh);
+ BaseSequentialStream *gwinConsoleGetStream(GHandle gh);
#endif
/**
diff --git a/include/gwin/graph.h b/include/gwin/graph.h
index b5fc1405..8bc33edf 100644
--- a/include/gwin/graph.h
+++ b/include/gwin/graph.h
@@ -71,7 +71,7 @@ typedef struct GGraphStyle_t {
} GGraphStyle;
// A graph window
-typedef struct GGraphObject_t {
+typedef struct GGraphObject {
GWindowObject g;
GGraphStyle style;
coord_t xorigin, yorigin;
@@ -107,7 +107,7 @@ extern "C" {
*
* @api
*/
-GHandle gwinCreateGraph(GGraphObject *gg, const GWindowInit *pInit);
+GHandle gwinGraphCreate(GGraphObject *gg, const GWindowInit *pInit);
/**
* @brief Set the style of the graphing operations.
diff --git a/include/gwin/gwidget.h b/include/gwin/gwidget.h
index ffd8e26f..222a3af5 100644
--- a/include/gwin/gwidget.h
+++ b/include/gwin/gwidget.h
@@ -31,28 +31,50 @@
struct GWidgetObject;
/**
- * @brief Defines a custom drawing function for a widget
+ * @brief The GColorSet structure
+ * @{
*/
-typedef void (*CustomWidgetDrawFunction)(struct GWidgetObject *gw, void *param);
+typedef struct GColorSet {
+ color_t text; // @< The text color
+ color_t edge; // @< The edge color
+ color_t fill; // @< The fill color
+ color_t progress; // @< The color of progress bars
+} GColorSet;
+/* @} */
/**
- * @brief The GWIN Widget structure
- * @note A widget is a GWIN window that accepts user input.
- * It also has a number of other properties such as its ability
- * to redraw itself (a widget maintains drawing state).
- * @note Do not access the members directly. Treat it as a black-box and use the method functions.
- *
+ * @brief The GWidgetStyle structure
+ * @details A GWidgetStyle is a set of colors that together form a "style".
+ * These colors should not be confused with the GWindow foreground
+ * and background colors which are used for drawing operations.
* @{
*/
-typedef struct GWidgetObject {
- GWindowObject g; // @< This is still a GWIN
- const char * txt; // @< The widget text
- CustomWidgetDrawFunction fnDraw; // @< The current draw function
- void * fnParam; // @< A parameter for the current draw function
-} GWidgetObject;
+typedef struct GWidgetStyle {
+ color_t background; // @< The window background color
+ GColorSet enabled; // @< The colors when enabled
+ GColorSet disabled; // @< The colors when disabled
+ GColorSet pressed; // @< The colors when pressed
+} GWidgetStyle;
/* @} */
/**
+ * @brief We define a couple of GWidgetStyle's that you can use in your
+ * application. The Black style is the default style if you don't
+ * specify one.
+ * @note BlackWidgetStyle means that it is designed for a Black background.
+ * Similarly WhiteWidgetStyle is designed for a White background.
+ * @{
+ */
+extern const GWidgetStyle BlackWidgetStyle;
+extern const GWidgetStyle WhiteWidgetStyle;
+/* @} */
+
+/**
+ * @brief Defines a custom drawing function for a widget
+ */
+typedef void (*CustomWidgetDrawFunction)(struct GWidgetObject *gw, void *param);
+
+/**
* @brief The structure to initialise a widget.
*
* @note Some widgets may have extra parameters.
@@ -63,12 +85,33 @@ typedef struct GWidgetObject {
* @{
*/
typedef struct GWidgetInit {
- GWindowInit g; // @< The GWIN initializer
- const char * text; // @< The initial text
+ GWindowInit g; // @< The GWIN initializer
+ const char * text; // @< The initial text
+ CustomWidgetDrawFunction customDraw; // @< A custom draw function - use NULL for the standard
+ void * customParam; // @< A parameter for the custom draw function (default = NULL)
+ const GWidgetStyle * customStyle; // @< A custom style to use - use NULL for the default style
} GWidgetInit;
/* @} */
/**
+ * @brief The GWIN Widget structure
+ * @note A widget is a GWIN window that accepts user input.
+ * It also has a number of other properties such as its ability
+ * to redraw itself (a widget maintains drawing state).
+ * @note Do not access the members directly. Treat it as a black-box and use the method functions.
+ *
+ * @{
+ */
+typedef struct GWidgetObject {
+ GWindowObject g; // @< This is still a GWIN
+ const char * text; // @< The widget text
+ CustomWidgetDrawFunction fnDraw; // @< The current draw function
+ void * fnParam; // @< A parameter for the current draw function
+ const GWidgetStyle * pstyle; // @< The current widget style colors
+} GWidgetObject;
+/* @} */
+
+/**
* A comment/rant on the above structure:
* We would really like the GWindowObject member to be anonymous. While this is
* allowed under the C11, C99, GNU and various other standards which have been
@@ -84,10 +127,31 @@ extern "C" {
#endif
/**
+ * @brief Set the default style for widgets created hereafter.
+ *
+ * @param[in] pstyle The default style. Passing NULL uses the system compiled style.
+ * @param[in] updateAll If TRUE then all existing widgets that are using the current default style
+ * will be updated to use this new style. Widgets that have custom styles different
+ * from the default style will not be updated.
+ *
+ * @note The style must be allocated statically (not on the stack) as only the pointer is stored.
+ *
+ * @api
+ */
+void gwinSetDefaultStyle(const GWidgetStyle *pstyle, bool_t updateAll);
+
+/**
+ * @brief Get the current default style.
+ *
+ * @api
+ */
+const GWidgetStyle *gwinGetDefaultStyle(void);
+
+/**
* @brief Set the text of a widget.
*
* @param[in] gh The widget handle
- * @param[in] txt The text to set. This must be a constant string unless useAlloc is set.
+ * @param[in] text The text to set. This must be a constant string unless useAlloc is set.
* @param[in] useAlloc If TRUE the string specified will be copied into dynamically allocated memory.
*
* @note The widget is automatically redrawn
@@ -95,7 +159,7 @@ extern "C" {
*
* @api
*/
-void gwinSetText(GHandle gh, const char *txt, bool_t useAlloc);
+void gwinSetText(GHandle gh, const char *text, bool_t useAlloc);
/**
* @brief Get the text of a widget.
@@ -108,6 +172,30 @@ void gwinSetText(GHandle gh, const char *txt, bool_t useAlloc);
const char *gwinGetText(GHandle gh);
/**
+ * @brief Set the style of a widget.
+ *
+ * @param[in] gh The widget handle
+ * @param[in] pstyle The style to set. This must be a static structure (not allocated on a transient stack).
+ * Use NULL to reset to the default style.
+ *
+ * @note The widget is automatically redrawn
+ * @note Non-widgets will ignore this call.
+ *
+ * @api
+ */
+void gwinSetStyle(GHandle gh, const GWidgetStyle *pstyle);
+
+/**
+ * @brief Get the style of a widget.
+ * @return The widget style or NULL if it isn't a widget
+ *
+ * @param[in] gh The widget handle
+ *
+ * @api
+ */
+const GWidgetStyle *gwinGetStyle(GHandle gh);
+
+/**
* @brief Set the routine to perform a custom widget drawing.
*
* @param[in] gh The widget handle
diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h
index 4d0deaf0..37c2a4e8 100644
--- a/include/gwin/gwin.h
+++ b/include/gwin/gwin.h
@@ -174,7 +174,7 @@ extern "C" {
*
* @api
*/
- GHandle gwinCreateWindow(GWindowObject *pgw, const GWindowInit *pInit);
+ GHandle gwinWindowCreate(GWindowObject *pgw, const GWindowInit *pInit);
/**
* @brief Destroy a window (of any type). Releases any dynamically allocated memory.
@@ -357,46 +357,63 @@ extern "C" {
void gwinResize(GHandle gh, coord_t width, coord_t height);
/**
- * @brief Minimize, Maximize or Restore a window
+ * @brief Redraw a window
*
* @param[in] gh The window
- * @param[in] minmax The new minimized/maximized state
*
- * @note The final window state may not be the requested state. Window Managers
- * do not need to implement changing the minmax state. If there is no
- * window manager this call is ignored.
- * @note The window is redrawn if it is changed. See the comments in @p gwinSetVisible()
- * with regard to what can be redrawn and what can't.
- * @note It is up to the window manager to determine what happens with any screen area
- * uncovered by resizing the window.
- * @note When a window is minimised it may be asked to draw the window or the window
- * manager may draw the minimised window.
+ * @note This is normally never required as windows and widgets will redraw as required.
+ * Note that some windows are incapable of redrawing themselves as they don't save
+ * their drawing state.
*
* @api
*/
- void gwinSetMinMax(GHandle gh, GWindowMinMax minmax);
+ void gwinRedraw(GHandle gh);
- /**
- * @brief Get the Minimized/Maximized state of a window
- *
- * @param[in] gh The window
- *
- * @api
- */
- GWindowMinMax gwinGetMinMax(GHandle gh);
+ #if GWIN_NEED_WINDOWMANAGER
+ /**
+ * @brief Minimize, Maximize or Restore a window
+ * @pre GWIN_NEED_WINDOWMANAGER must be TRUE
+ *
+ * @param[in] gh The window
+ * @param[in] minmax The new minimized/maximized state
+ *
+ * @note The final window state may not be the requested state. Window Managers
+ * do not need to implement changing the minmax state. If there is no
+ * window manager this call is ignored.
+ * @note The window is redrawn if it is changed. See the comments in @p gwinSetVisible()
+ * with regard to what can be redrawn and what can't.
+ * @note It is up to the window manager to determine what happens with any screen area
+ * uncovered by resizing the window.
+ * @note When a window is minimised it may be asked to draw the window or the window
+ * manager may draw the minimised window.
+ *
+ * @api
+ */
+ void gwinSetMinMax(GHandle gh, GWindowMinMax minmax);
- /**
- * @brief Raise a window to the top of the z-order
- *
- * @param[in] gh The window
- *
- * @note The window z-order is only supported by some window managers. If there is no
- * window manager this call simple tries to redraw the window. See the comments
- * in @p gwinSetVisible() with regard to what can be redrawn and what can't.
- *
- * @api
- */
- void gwinRaise(GHandle gh);
+ /**
+ * @brief Get the Minimized/Maximized state of a window
+ * @pre GWIN_NEED_WINDOWMANAGER must be TRUE
+ *
+ * @param[in] gh The window
+ *
+ * @api
+ */
+ GWindowMinMax gwinGetMinMax(GHandle gh);
+
+ /**
+ * @brief Raise a window to the top of the z-order
+ * @pre GWIN_NEED_WINDOWMANAGER must be TRUE
+ *
+ * @param[in] gh The window
+ *
+ * @note The window z-order is only supported by some window managers. See the comments
+ * in @p gwinSetVisible() with regard to what can be redrawn and what can't.
+ *
+ * @api
+ */
+ void gwinRaise(GHandle gh);
+ #endif
#if GDISP_NEED_TEXT || defined(__DOXYGEN__)
/**
diff --git a/include/gwin/image.h b/include/gwin/image.h
index d32e9a0c..7eb2d969 100644
--- a/include/gwin/image.h
+++ b/include/gwin/image.h
@@ -30,10 +30,10 @@
// This file is included within "gwin/gwin.h"
// An image window
-typedef struct GImageWidget_t {
+typedef struct GImageObject {
GWindowObject g;
gdispImage image;
-} GImageWidget;
+} GImageObject;
#ifdef __cplusplus
extern "C" {
@@ -41,7 +41,7 @@ extern "C" {
/**
* @brief Create an image widget.
- * @details A console widget allows to display a picture.
+ * @details Display's a picture.
* @return NULL if there is no resultant drawing area, otherwise the widget handle.
*
* @param[in] widget The image widget structure to initialise. If this is NULL, the structure is dynamically allocated.
@@ -52,10 +52,10 @@ extern "C" {
*
* @api
*/
-GHandle gwinImageCreate(GImageWidget *widget, GWindowInit *pInit);
+GHandle gwinImageCreate(GImageObject *widget, GWindowInit *pInit);
/**
- * @brief Sets the sets the io fields in the image structure to routines that support reading from an image stored
+ * @brief Sets the input routines that support reading the image from memory
* in RAM or flash.
* @return TRUE if the IO open function succeeds
*
@@ -68,8 +68,7 @@ bool_t gwinImageOpenMemory(GHandle gh, const void* memory);
#if defined(WIN32) || GFX_USE_OS_WIN32 || GFX_USE_OS_POSIX || defined(__DOXYGEN__)
/**
- * @brief Sets the sets the io fields in the image structure to routines that support reading from an image stored
- * in a simulators native file system.
+ * @brief Sets the input routines that support reading the image from a file
* @return TRUE if the IO open function succeeds
*
* @param[in] gh The widget (must be an image widget)
@@ -82,8 +81,7 @@ bool_t gwinImageOpenMemory(GHandle gh, const void* memory);
#if GFX_USE_OS_CHIBIOS || defined(__DOXYGEN__)
/**
- * @brief Sets the sets the io fields in the image structure to routines that support reading from an image stored
- * on a BaseFileStream (eg. an SD-Card).
+ * @brief Sets the input routines that support reading the image from a BaseFileStream (eg. an SD-Card).
* @return TRUE if the IO open function succeeds
*
* @param[in] gh The widget (must be an image widget)
diff --git a/include/gwin/label.h b/include/gwin/label.h
index d387345d..4362b035 100644
--- a/include/gwin/label.h
+++ b/include/gwin/label.h
@@ -30,9 +30,9 @@
// This file is included within "gwin/gwin.h"
// An label window
-typedef struct GLabelWidget_t {
+typedef struct GLabelObject {
GWidgetObject w;
-} GLabelWidget;
+} GLabelObject;
#ifdef __cplusplus
extern "C" {
@@ -49,7 +49,7 @@ extern "C" {
*
* @api
*/
-GHandle gwinLabelCreate(GLabelWidget *widget, GWidgetInit *pInit);
+GHandle gwinLabelCreate(GLabelObject *widget, GWidgetInit *pInit);
#ifdef __cplusplus
}
diff --git a/include/gwin/radio.h b/include/gwin/radio.h
index 8d4e32a7..1e0a2dd6 100644
--- a/include/gwin/radio.h
+++ b/include/gwin/radio.h
@@ -40,27 +40,15 @@ typedef struct GEventGWinRadio {
} GEventGWinRadio;
/**
- * @brief Button colors
- */
-typedef struct GRadioColors {
- color_t color_edge;
- color_t color_fill;
- color_t color_txt;
-} GRadioColors;
-
-/**
* @brief The radio button widget structure
* @note Do not use the members directly - treat it as a black-box.
*/
-typedef struct GRadioObject_t {
+typedef struct GRadioObject {
GWidgetObject w;
#if GINPUT_NEED_TOGGLE
uint16_t toggle;
#endif
uint16_t group;
- GRadioColors c_up;
- GRadioColors c_dn;
- GRadioColors c_dis;
} GRadioObject;
#ifdef __cplusplus
@@ -89,26 +77,7 @@ extern "C" {
*
* @api
*/
-GHandle gwinCreateRadio(GRadioObject *gb, const GWidgetInit *pInit, uint16_t group);
-
-/**
- * @brief Set the colors of a button.
- *
- * @param[in] gh The window handle (must be a radio widget)
- * @param[in] pUp The colors for the button when in the up state.
- * @param[in] pDown The colors for the button when in the down state.
- * @param[in] pDisabled The colors for the button when it is disabled.
- *
- * @note The button is not automatically redrawn. Call gwinButtonDraw() after changing the button style
- * @note The button style is copied into the internal button structure - there is no need to
- * maintain static style structures (they can be temporary structures on the stack).
- * @note The pUp, pDown and pDisabled parameters can be NULL. If they are then the existing color styles
- * are not changed for that button state.
- * @note Some custom drawn buttons will ignore he specified colors
- *
- * @api
- */
-void gwinSetRadioColors(GHandle gh, const GRadioColors *pUp, const GRadioColors *pDown, const GRadioColors *pDisabled);
+GHandle gwinRadioCreate(GRadioObject *gb, const GWidgetInit *pInit, uint16_t group);
/**
* @brief Press this radio button (and by definition unset any others in the group)
@@ -117,7 +86,7 @@ void gwinSetRadioColors(GHandle gh, const GRadioColors *pUp, const GRadioColors
*
* @api
*/
-void gwinPressRadio(GHandle gh);
+void gwinRadioPress(GHandle gh);
/**
* @brief Is the radio button currently pressed
@@ -127,7 +96,7 @@ void gwinPressRadio(GHandle gh);
*
* @api
*/
-bool_t gwinIsRadioPressed(GHandle gh);
+bool_t gwinRadioIsPressed(GHandle gh);
/**
* @brief Find the currently pressed radio button in the specified group
@@ -137,7 +106,7 @@ bool_t gwinIsRadioPressed(GHandle gh);
*
* @api
*/
-GHandle gwinActiveRadio(uint16_t group);
+GHandle gwinRadioGetActive(uint16_t group);
/**
* @brief Some custom radio button drawing routines
diff --git a/include/gwin/slider.h b/include/gwin/slider.h
index a8cf7ecf..f4ab8750 100644
--- a/include/gwin/slider.h
+++ b/include/gwin/slider.h
@@ -26,7 +26,7 @@
#define GEVENT_GWIN_SLIDER (GEVENT_GWIN_FIRST+1)
-typedef struct GEventGWinSlider_t {
+typedef struct GEventGWinSlider {
GEventType type; // The type of this event (GEVENT_GWIN_BUTTON)
GHandle slider; // The slider that is returning results
int position;
@@ -34,16 +34,8 @@ typedef struct GEventGWinSlider_t {
// There are currently no GEventGWinSlider listening flags - use 0
-typedef struct GSliderColors {
- color_t color_edge;
- color_t color_thumb;
- color_t color_active;
- color_t color_inactive;
- color_t color_txt;
-} GSliderColors;
-
// A slider window
-typedef struct GSliderObject_t {
+typedef struct GSliderObject {
GWidgetObject w;
#if GINPUT_NEED_TOGGLE
uint16_t t_dn;
@@ -56,7 +48,6 @@ typedef struct GSliderObject_t {
int min;
int max;
int pos;
- GSliderColors c;
} GSliderObject;
#ifdef __cplusplus
@@ -86,7 +77,7 @@ extern "C" {
*
* @api
*/
-GHandle gwinCreateSlider(GSliderObject *gb, const GWidgetInit *pInit);
+GHandle gwinSliderCreate(GSliderObject *gb, const GWidgetInit *pInit);
/**
* @brief Set the slider range.
@@ -99,7 +90,7 @@ GHandle gwinCreateSlider(GSliderObject *gb, const GWidgetInit *pInit);
*
* @api
*/
-void gwinSetSliderRange(GHandle gh, int min, int max);
+void gwinSliderSetRange(GHandle gh, int min, int max);
/**
* @brief Set the slider position.
@@ -112,22 +103,7 @@ void gwinSetSliderRange(GHandle gh, int min, int max);
*
* @api
*/
-void gwinSetSliderPosition(GHandle gh, int pos);
-
-/**
- * @brief Set the style of a slider.
- * @details The slider style is defined by its colours.
- *
- * @param[in] gh The window handle (must be a slider window)
- * @param[in] pStyle The styling for the slider.
- *
- * @note The slider is not automatically redrawn. Call gwinSliderDraw() after changing the slider style
- * @note The slider style is copied into the internal slider structure - there is no need to
- * maintain a static style structure.
- *
- * @api
- */
-void gwinSetSliderColors(GHandle gh, const GSliderColors *pStyle);
+void gwinSliderSetPosition(GHandle gh, int pos);
/**
* @brief Get the current slider position.
@@ -140,7 +116,7 @@ void gwinSetSliderColors(GHandle gh, const GSliderColors *pStyle);
*
* @api
*/
-#define gwinGetSliderPosition(gh) (((GSliderObject *)(gh))->pos)
+#define gwinSliderGetPosition(gh) (((GSliderObject *)(gh))->pos)
/**
* @brief Some custom slider drawing routines