added some inline functions to ease flag handling in object trees.
This commit is contained in:
@@ -20,28 +20,82 @@
|
|||||||
<header type="sys" loc="pre">aqdiagram/aqdg_api.h</header>
|
<header type="sys" loc="pre">aqdiagram/aqdg_api.h</header>
|
||||||
</headers>
|
</headers>
|
||||||
|
|
||||||
|
<inlines>
|
||||||
|
|
||||||
|
<inline loc="end" access="public">
|
||||||
|
<content>
|
||||||
|
$(api) void $(struct_prefix)_ModifyBranchFlagsUp($(struct_type) *object, uint32_t newFlags, uint32_t mask);
|
||||||
|
</content>
|
||||||
|
</inline>
|
||||||
|
|
||||||
|
<inline loc="code">
|
||||||
|
<content>
|
||||||
|
void $(struct_prefix)_ModifyBranchFlagsUp($(struct_type) *object, uint32_t newFlags, uint32_t mask) \n
|
||||||
|
{ \n
|
||||||
|
while(object) { \n
|
||||||
|
uint32_t flags; \n
|
||||||
|
\n
|
||||||
|
flags=object->flags; \n
|
||||||
|
flags=((flags^newFlags)&(mask))^flags; \n
|
||||||
|
object->flags=flags; \n
|
||||||
|
object=$(struct_prefix)_Tree2_GetParent(object); \n
|
||||||
|
} \n
|
||||||
|
} \n
|
||||||
|
</content>
|
||||||
|
</inline>
|
||||||
|
|
||||||
|
|
||||||
|
<inline loc="end" access="public">
|
||||||
|
<content>
|
||||||
|
$(api) void $(struct_prefix)_ModifyBranchFlagsDown($(struct_type) *object, uint32_t newFlags, uint32_t mask);
|
||||||
|
</content>
|
||||||
|
</inline>
|
||||||
|
|
||||||
|
<inline loc="code">
|
||||||
|
<content>
|
||||||
|
void $(struct_prefix)_ModifyBranchFlagsDown($(struct_type) *object, uint32_t newFlags, uint32_t mask) \n
|
||||||
|
{ \n
|
||||||
|
uint32_t flags; \n
|
||||||
|
\n
|
||||||
|
flags=object->flags; \n
|
||||||
|
flags=((flags^newFlags)&(mask))^flags; \n
|
||||||
|
object->flags=flags; \n
|
||||||
|
\n
|
||||||
|
object=$(struct_prefix)_Tree2_GetFirstChild(object); \n
|
||||||
|
while(object) { \n
|
||||||
|
$(struct_prefix)_ModifyBranchFlagsDown(object, newFlags, mask); \n
|
||||||
|
object=$(struct_prefix)_Tree2_GetNext(object); \n
|
||||||
|
} \n
|
||||||
|
} \n
|
||||||
|
</content>
|
||||||
|
</inline>
|
||||||
|
|
||||||
|
|
||||||
|
</inlines>
|
||||||
|
|
||||||
</lang>
|
</lang>
|
||||||
|
|
||||||
<defines>
|
<defines>
|
||||||
|
|
||||||
<define id="AQDG_OBJECT_FLAGS" prefix="AQDG_OBJECT_FLAGS_">
|
<define id="AQDG_OBJECT_FLAGS" prefix="AQDG_OBJECT_FLAGS_">
|
||||||
<item name="HIDDEN" value="0x00000001" />
|
<item name="HIDDEN" value="0x00000001" />
|
||||||
<item name="LAYOUTCHANGED" value="0x00000002" />
|
<item name="LAYOUT" value="0x00000002" />
|
||||||
|
<item name="DRAW" value="0x00000004" />
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
<define id="AQDG_OBJECT_OPTIONS" prefix="AQDG_OBJECT_OPTIONS_">
|
<define id="AQDG_OBJECT_OPTIONS" prefix="AQDG_OBJECT_OPTIONS_">
|
||||||
<item name="FIXEDX" value="0x00000001" />
|
<item name="FIXEDX" value="0x00010000" />
|
||||||
<item name="FIXEDY" value="0x00000002" />
|
<item name="FIXEDY" value="0x00020000" />
|
||||||
<item name="FIXEDWIDTH" value="0x00000004" />
|
<item name="FIXEDWIDTH" value="0x00040000" />
|
||||||
<item name="FIXEDHEIGHT" value="0x00000008" />
|
<item name="FIXEDHEIGHT" value="0x00080000" />
|
||||||
<item name="STRETCHX" value="0x00000010" />
|
<item name="STRETCHX" value="0x00100000" />
|
||||||
<item name="STRETCHY" value="0x00000020" />
|
<item name="STRETCHY" value="0x00200000" />
|
||||||
<item name="EQUALWIDTH" value="0x00000040" />
|
<item name="EQUALWIDTH" value="0x00400000" />
|
||||||
<item name="EQUALHEIGHT" value="0x00000080" />
|
<item name="EQUALHEIGHT" value="0x00800000" />
|
||||||
<item name="HALIGNRIGHT" value="0x00000100" />
|
<item name="HALIGNRIGHT" value="0x01000000" />
|
||||||
<item name="HALIGNCENTER" value="0x00000200" />
|
<item name="HALIGNCENTER" value="0x02000000" />
|
||||||
<item name="VALIGNBOTTOM" value="0x00000400" />
|
<item name="VALIGNBOTTOM" value="0x04000000" />
|
||||||
<item name="VALIGNCENTER" value="0x00000800" />
|
<item name="VALIGNCENTER" value="0x08000000" />
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
</defines>
|
</defines>
|
||||||
|
|||||||
Reference in New Issue
Block a user