aboutsummaryrefslogtreecommitdiffstats
path: root/include/gwin
diff options
context:
space:
mode:
authorAndrew Hannam <andrewh@inmarket.com.au>2013-04-07 16:02:10 +1000
committerAndrew Hannam <andrewh@inmarket.com.au>2013-04-07 16:02:10 +1000
commit9ee7c284e63fc419f70ffc3c53eb23590767ee08 (patch)
tree57a45c0ca6e5222292bebb8445dffaff5757275b /include/gwin
parent90f5e851467e5ea14b710ada937409e506820d58 (diff)
downloaduGFX-9ee7c284e63fc419f70ffc3c53eb23590767ee08.tar.gz
uGFX-9ee7c284e63fc419f70ffc3c53eb23590767ee08.tar.bz2
uGFX-9ee7c284e63fc419f70ffc3c53eb23590767ee08.zip
Add GINPUT Dial, simplify GWIN input assignment
Added GINPUT Dial support and a driver that uses GADC to read the dial. Added support for Dial inputs to the GWIN slider. Updated the slider demo for Dial Inputs. Simplified the assigning of inputs to GWIN "widgets" button and slider. Updated the demo's to match the new input to button assignment.
Diffstat (limited to 'include/gwin')
-rw-r--r--include/gwin/button.h22
-rw-r--r--include/gwin/slider.h23
2 files changed, 28 insertions, 17 deletions
diff --git a/include/gwin/button.h b/include/gwin/button.h
index 2df540da..3d54afbb 100644
--- a/include/gwin/button.h
+++ b/include/gwin/button.h
@@ -180,30 +180,28 @@ void gwinSetButtonCustom(GHandle gh, GButtonDrawFunction fn, void *param);
*/
#define gwinGetButtonSource(gh) ((GSourceHandle)(gh))
-#if defined(GINPUT_NEED_MOUSE) && GINPUT_NEED_MOUSE
+#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
/**
- * @brief Attach a mouse source
- * @details Attach a mouse source to a given button
+ * @brief Attach a mouse to a button
*
- * @param[in] gh The button handle
- * @param[in] gsh The source handle
+ * @param[in] gh The button handle
+ * @param[in] instance The mouse instance
*
* @api
*/
- bool_t gwinAttachButtonMouseSource(GHandle gh, GSourceHandle gsh);
+ bool_t gwinAttachButtonMouse(GHandle gh, uint16_t instance);
#endif
-#if defined(GINPUT_NEED_TOGGLE) && GINPUT_NEED_TOGGLE
+#if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE
/**
- * @brief Attach a toggle source
- * @details Attach a toggle source to this button
+ * @brief Attach a toggle to a button
*
- * @param[in] gh The button handle
- * @param[in] gsh The source handle
+ * @param[in] gh The button handle
+ * @param[in] instance The toggle instance
*
* @api
*/
- bool_t gwinAttachButtonToggleSource(GHandle gh, GSourceHandle gsh);
+ bool_t gwinAttachButtonToggle(GHandle gh, uint16_t instance);
#endif
/**
diff --git a/include/gwin/slider.h b/include/gwin/slider.h
index 412900a5..1943729f 100644
--- a/include/gwin/slider.h
+++ b/include/gwin/slider.h
@@ -187,17 +187,30 @@ void gwinSetSliderCustom(GHandle gh, GSliderDrawFunction fn, void *param);
*/
#define gwinGetSliderSource(gh) ((GSourceHandle)(gh))
-#if defined(GINPUT_NEED_MOUSE) && GINPUT_NEED_MOUSE
+#if GFX_USE_GINPUT && GINPUT_NEED_MOUSE
/**
* @brief Attach a mouse source
- * @details Attach a mouse source to a slider
+ * @details Attach a mouse to a slider
*
- * @param[in] gh The slider handle
- * @param[in] gsh The source handle
+ * @param[in] gh The slider handle
+ * @param[in] instance The mouse instance
*
* @api
*/
- bool_t gwinAttachSliderMouseSource(GHandle gh, GSourceHandle gsh);
+ bool_t gwinAttachSliderMouse(GHandle gh, uint16_t instance);
+#endif
+
+#if GFX_USE_GINPUT && GINPUT_NEED_DIAL
+ /**
+ * @brief Attach a dial source
+ * @details Attach a dial to a slider
+ *
+ * @param[in] gh The dial handle
+ * @param[in] instance The dial instance
+ *
+ * @api
+ */
+ bool_t gwinAttachSliderDial(GHandle gh, uint16_t instance);
#endif
/**