summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkTheme.h
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-12-02 04:32:22 (GMT)
committerjenglish <jenglish@flightlab.com>2007-12-02 04:32:22 (GMT)
commitb9257b2ca5a2c1098db948daf8a8b050caa0e96c (patch)
treedcc1e3b870946ba7a2888ef66bd97ad71aa71aa3 /generic/ttk/ttkTheme.h
parent547f91bd5d798f6eb0d2993c410a0e4c6d31b8dd (diff)
downloadtk-b9257b2ca5a2c1098db948daf8a8b050caa0e96c.zip
tk-b9257b2ca5a2c1098db948daf8a8b050caa0e96c.tar.gz
tk-b9257b2ca5a2c1098db948daf8a8b050caa0e96c.tar.bz2
Improved macrology for statically-initialized layout template tables.
Diffstat (limited to 'generic/ttk/ttkTheme.h')
-rw-r--r--generic/ttk/ttkTheme.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h
index adca259..a0be12e 100644
--- a/generic/ttk/ttkTheme.h
+++ b/generic/ttk/ttkTheme.h
@@ -1,4 +1,4 @@
-/* $Id: ttkTheme.h,v 1.11 2007/10/25 07:08:26 jenglish Exp $
+/* $Id: ttkTheme.h,v 1.12 2007/12/02 04:32:23 jenglish Exp $
* Copyright (c) 2003 Joe English. Freely redistributable.
*
* Declarations for Tk theme engine.
@@ -181,8 +181,9 @@ typedef unsigned int Ttk_PositionSpec; /* See below */
/*
* Extra bits for layout specifications
*/
-#define TTK_CHILDREN (0x1000)/* for LayoutSpecs -- children follow */
-#define TTK_LAYOUT_END (0x2000)/* for LayoutSpecs -- end of child list */
+#define _TTK_CHILDREN (0x1000)/* for LayoutSpecs -- children follow */
+#define _TTK_LAYOUT_END (0x2000)/* for LayoutSpecs -- end of child list */
+#define _TTK_LAYOUT (0x4000)/* for LayoutSpec tables -- define layout */
#define _TTK_MASK_STICK (0x0F) /* See Ttk_UnparseLayout() */
#define _TTK_MASK_PACK (0xF0) /* See Ttk_UnparseLayout(), packStrings */
@@ -285,17 +286,28 @@ typedef struct {
unsigned opcode;
} TTKLayoutInstruction, *Ttk_LayoutSpec;
-#define TTK_BEGIN_LAYOUT(name) static TTKLayoutInstruction name[] = {
+#define TTK_BEGIN_LAYOUT_TABLE(name) \
+ static TTKLayoutInstruction name[] = {
+#define TTK_LAYOUT(name, content) \
+ { name, _TTK_CHILDREN|_TTK_LAYOUT }, \
+ content \
+ { 0, _TTK_LAYOUT_END },
#define TTK_GROUP(name, flags, children) \
- { name, flags | TTK_CHILDREN }, \
+ { name, flags | _TTK_CHILDREN }, \
children \
- { 0, TTK_LAYOUT_END },
+ { 0, _TTK_LAYOUT_END },
#define TTK_NODE(name, flags) { name, flags },
-#define TTK_END_LAYOUT { 0, TTK_LAYOUT_END } };
+#define TTK_END_LAYOUT_TABLE { 0, _TTK_LAYOUT | _TTK_LAYOUT_END } };
+
+#define TTK_BEGIN_LAYOUT(name) static TTKLayoutInstruction name[] = {
+#define TTK_END_LAYOUT { 0, _TTK_LAYOUT_END } };
TTKAPI void Ttk_RegisterLayout(
Ttk_Theme theme, const char *className, Ttk_LayoutSpec layoutSpec);
+TTKAPI void Ttk_RegisterLayouts(
+ Ttk_Theme theme, Ttk_LayoutSpec layoutTable);
+
/*------------------------------------------------------------------------
* +++ Layout instances.
*/