[319] | 1 | // Copyright (C) 2012-2014 ChaosForge Ltd
|
---|
[66] | 2 | // http://chaosforge.org/
|
---|
| 3 | //
|
---|
| 4 | // This file is part of NV Libraries.
|
---|
| 5 | // For conditions of distribution and use, see copyright notice in nv.hh
|
---|
| 6 |
|
---|
| 7 | /**
|
---|
| 8 | * @file gui_element.hh
|
---|
| 9 | * @author Kornel Kisielewicz
|
---|
| 10 | * @brief GUI Element
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef NV_GUI_ELEMENT_HH
|
---|
| 14 | #define NV_GUI_ELEMENT_HH
|
---|
| 15 |
|
---|
[319] | 16 | #include <nv/core/common.hh>
|
---|
| 17 | #include <nv/core/position.hh>
|
---|
| 18 | #include <nv/core/io_event.hh>
|
---|
| 19 | #include <nv/core/string.hh>
|
---|
[69] | 20 | #include <nv/gui/gui_common.hh>
|
---|
[319] | 21 | #include <list>
|
---|
[66] | 22 |
|
---|
| 23 | namespace nv
|
---|
| 24 | {
|
---|
| 25 | namespace gui
|
---|
| 26 | {
|
---|
[269] | 27 |
|
---|
[268] | 28 | class element
|
---|
[66] | 29 | {
|
---|
[269] | 30 | public:
|
---|
[268] | 31 | /// List type
|
---|
[269] | 32 | typedef std::list<handle> list;
|
---|
[110] | 33 |
|
---|
[268] | 34 |
|
---|
[269] | 35 | element()
|
---|
[268] | 36 | : m_id( "" )
|
---|
| 37 | , m_child_count(0)
|
---|
| 38 | , m_class("")
|
---|
| 39 | , m_enabled( true )
|
---|
| 40 | , m_visible( true )
|
---|
| 41 | , m_dirty( true )
|
---|
| 42 | , m_render_data( nullptr ) {}
|
---|
[110] | 43 |
|
---|
[268] | 44 | string m_id; ///< id type of the object
|
---|
[269] | 45 | handle m_parent; ///< pointer to parent
|
---|
[268] | 46 | list m_children; ///< children objects
|
---|
| 47 | size_t m_child_count; ///< number of children
|
---|
[110] | 48 | string m_class; ///< Class name.
|
---|
| 49 | string m_text; ///< Displayed label or text.
|
---|
| 50 | rectangle m_relative; ///< Position relative to parent.
|
---|
| 51 | rectangle m_absolute; ///< Position relative to window/screen.
|
---|
| 52 | bool m_enabled; ///< Whether the element accepts events.
|
---|
| 53 | bool m_visible; ///< Whether the element is drawn.
|
---|
| 54 | bool m_dirty; ///< Whether the element needs updating.
|
---|
| 55 | render_data* m_render_data; ///< -?-
|
---|
[66] | 56 | };
|
---|
| 57 |
|
---|
| 58 | } // namespace gui
|
---|
| 59 |
|
---|
| 60 | } // namespace nv
|
---|
| 61 |
|
---|
| 62 | #endif // NV_GUI_ELEMENT_HH
|
---|