aboutsummaryrefslogtreecommitdiffstats
path: root/include/gwin
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-10-24 18:36:11 +1000
committerinmarket <andrewh@inmarket.com.au>2013-10-24 18:36:11 +1000
commit7a7e223d152b42553f7e6ce0220dd5d736b89c56 (patch)
tree22968b7c8e779a66a2eba431545b5b292fe722cc /include/gwin
parenta28dce97d877160b10a3683fbf8ea578c8405417 (diff)
downloaduGFX-7a7e223d152b42553f7e6ce0220dd5d736b89c56.tar.gz
uGFX-7a7e223d152b42553f7e6ce0220dd5d736b89c56.tar.bz2
uGFX-7a7e223d152b42553f7e6ce0220dd5d736b89c56.zip
Add multiple display support to GWIN.
You can now create windows on multiple displays.
Diffstat (limited to 'include/gwin')
-rw-r--r--include/gwin/button.h4
-rw-r--r--include/gwin/checkbox.h4
-rw-r--r--include/gwin/class_gwin.h6
-rw-r--r--include/gwin/console.h4
-rw-r--r--include/gwin/graph.h4
-rw-r--r--include/gwin/gwin.h5
-rw-r--r--include/gwin/image.h4
-rw-r--r--include/gwin/label.h4
-rw-r--r--include/gwin/list.h4
-rw-r--r--include/gwin/radio.h4
-rw-r--r--include/gwin/slider.h4
11 files changed, 35 insertions, 12 deletions
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.