libGumball 0.0.1
C23-Based, libGimbal-powered UI Library
Loading...
Searching...
No Matches
gumball_root.h
Go to the documentation of this file.
1#ifndef GUM_ROOT_H
2#define GUM_ROOT_H
3
4// View this file's documentation online: https://libgumball.psyops.studio/gumball__root_8h.html
5
6/*! \file
7 * \ref GUM_Root "GUM_Root data structure and hierarchy graph"
8 * \ingroup elements
9 *
10 * GUM_Root is the element responsible for holding all other elements in the scene.
11 * It also internally holds the draw queue, which is a list of all drawable elements in the scene,
12 * sorted by z-index.
13 *
14 * \todo
15 * - Make the draw queue private.
16*/
17
18#include <gimbal/gimbal_meta.h>
19#include <gimbal/core/gimbal_module.h>
20#include <gimbal/gimbal_containers.h>
21
22/*! \name Type System
23 * \brief Type UUID and cast operators
24 * @{
25*/
26#define GUM_ROOT_TYPE (GBL_TYPEID (GUM_Root)) //!< Returns the GUM_Root Type UUID
27#define GUM_ROOT(self) (GBL_CAST (GUM_Root, self)) //!< Casts an instance of a compatible element to a GUM_Root
28#define GUM_ROOT_CLASS(klass) (GBL_CLASS_CAST (GUM_Root, klass)) //!< Casts an class of a compatible element to a GUM_Root
29#define GUM_ROOT_CLASSOF(self) (GBL_CLASSOF (GUM_Root, self)) //!< Casts an instance of a compatible element to a GUM_Root
30//! @}
31
32#define GBL_SELF_TYPE GUM_Root
33
34GBL_DECLS_BEGIN
35GBL_FORWARD_DECLARE_STRUCT(GUM_Root);
36
37/*!
38 * \struct GUM_RootClass
39 * \extends GblModuleClass
40 * \brief GUM_Root structure
41 *
42 * GUM_RootClass derives from GblModuleClass,
43 * adding nothing new.
44*/
45GBL_CLASS_DERIVE_EMPTY(GUM_Root, GblModule)
46
47/*!
48 * \class GUM_Root
49 * \extends GblModule
50 * \brief Root element
51*/
52GBL_INSTANCE_DERIVE_EMPTY(GUM_Root, GblModule)
53
54#define GUM_Root_create() GBL_NEW(GUM_Root) //!< Returns a new GUM_Root. \note Currently there is no support for having multiple roots at once.
55//! \cond
56GblType GUM_Root_type(void);
57
58void GUM_drawQueue_init(void);
59void GUM_drawQueue_push(GblObject *pObj);
60void GUM_drawQueue_remove(GblObject *pObj);
61void GUM_drawQueue_sort(void);
62GblArrayList *GUM_drawQueue_get(void);
63//!\endcond
64
65GBL_DECLS_END
66#undef GBL_SELF_TYPE
67
68#endif // GUM_ROOT_H