aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gcontainer.h
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-05-10 01:11:30 +1000
committerinmarket <andrewh@inmarket.com.au>2014-05-10 01:11:30 +1000
commitcb606359cccd09f00f27db93bb99fb06a3b49abd (patch)
tree73ad7fd5a73ff43e3ba074a609cc2385372ee01c /src/gwin/gcontainer.h
parent21aac3d8532c9aa1decab30c00d9f5a37067aa13 (diff)
downloaduGFX-cb606359cccd09f00f27db93bb99fb06a3b49abd.tar.gz
uGFX-cb606359cccd09f00f27db93bb99fb06a3b49abd.tar.bz2
uGFX-cb606359cccd09f00f27db93bb99fb06a3b49abd.zip
Multiple changes to GWIN to support containers.
Diffstat (limited to 'src/gwin/gcontainer.h')
-rw-r--r--src/gwin/gcontainer.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/src/gwin/gcontainer.h b/src/gwin/gcontainer.h
new file mode 100644
index 00000000..61852c7c
--- /dev/null
+++ b/src/gwin/gcontainer.h
@@ -0,0 +1,92 @@
+/*
+ * This file is subject to the terms of the GFX License. If a copy of
+ * the license was not distributed with this file, you can obtain one at:
+ *
+ * http://ugfx.org/license.html
+ */
+
+/**
+ * @file src/gwin/gcontainer.h
+ * @brief GWIN Containers header file.
+ */
+
+#ifndef _GCONTAINER_H
+#define _GCONTAINER_H
+
+/* This file is included within "gwin/gwin.h" */
+
+/**
+ * @defgroup Containers Containers
+ * @ingroup GWIN
+ *
+ * @details A Container is a GWindow that supports child windows. It is also
+ * a widget in its own right and therefore can accept user input directly.
+ *
+ * @pre GFX_USE_GWIN and GWIN_NEED_CONTAINERS must be set to TRUE in your gfxconf.h
+ * @{
+ */
+
+// Forward definition
+struct GContainerObject;
+
+/**
+ * @brief The GWIN Container structure
+ * @note A container is a GWIN widget that can have children.
+ * @note Do not access the members directly. Treat it as a black-box and use the method functions.
+ *
+ * @{
+ */
+typedef GWidgetObject GContainerObject;
+/* @} */
+
+/**
+ * A comment/rant on the above structure:
+ * We would really like the GWidgetObject member to be anonymous. While this is
+ * allowed under the C11, C99, GNU and various other standards which have been
+ * around forever - compiler support often requires special flags e.g
+ * gcc requires the -fms-extensions flag (no wonder the language and compilers have
+ * not really progressed in 30 years). As portability is a key requirement
+ * we unfortunately won't use this useful feature in case we get a compiler that
+ * won't support it even with special flags.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /**
+ * @brief Get the first child window
+ *
+ * @return The first child or NULL if are no children windows
+ *
+ * @param[in] gh The parent container or NULL to get the first top level window
+ *
+ * @api
+ */
+ GHandle gwinGetFirstChild(GHandle gh);
+
+ /**
+ * @brief Get the next child window in the z-order
+ *
+ * @return The next window or NULL if no more children
+ *
+ * @param[in] gh The window to obtain the next sibling of.
+ *
+ * @note This returns the next window under the current parent window.
+ * Unlike @p gwinGetNextWindow() it will only return windows that
+ * have the same parent as the supplied window.
+ *
+ * @api
+ */
+ GHandle gwinGetSibling(GHandle gh);
+#ifdef __cplusplus
+}
+#endif
+
+/* Include extra container types */
+#if GWIN_NEED_FRAME || defined(__DOXYGEN__)
+ #include "src/gwin/frame.h"
+#endif
+
+#endif /* _GCONTAINER_H */
+/** @} */