Rev | Line | |
---|
[395] | 1 | // Copyright (C) 2012-2015 ChaosForge Ltd
|
---|
[66] | 2 | // http://chaosforge.org/
|
---|
| 3 | //
|
---|
[395] | 4 | // This file is part of Nova libraries.
|
---|
| 5 | // For conditions of distribution and use, see copying.txt file in root folder.
|
---|
[66] | 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 |
|
---|
[395] | 16 | #include <nv/common.hh>
|
---|
[319] | 17 | #include <nv/core/position.hh>
|
---|
| 18 | #include <nv/core/io_event.hh>
|
---|
[368] | 19 | #include <nv/stl/string.hh>
|
---|
[492] | 20 | #include <nv/stl/functional/function.hh>
|
---|
[69] | 21 | #include <nv/gui/gui_common.hh>
|
---|
[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
|
---|
[440] | 32 | // TODO: change to small_vector once implemented!
|
---|
| 33 | typedef vector< handle > child_list;
|
---|
[472] | 34 | shash64 m_id; ///< id type of the object
|
---|
| 35 | handle m_parent; ///< pointer to parent
|
---|
| 36 | flags m_flags;
|
---|
| 37 | child_list m_children; ///< children objects
|
---|
| 38 | size_t m_child_count; ///< number of children
|
---|
| 39 | shash64 m_class; ///< Class name.
|
---|
| 40 | string_buffer m_text; ///< Displayed label or text.
|
---|
| 41 | rectangle m_relative; ///< Position relative to parent.
|
---|
| 42 | rectangle m_absolute; ///< Position relative to window/screen.
|
---|
[492] | 43 | function<void()> m_on_click;
|
---|
[472] | 44 | render_data* m_render_data; ///< -?-
|
---|
[66] | 45 | };
|
---|
| 46 |
|
---|
| 47 | } // namespace gui
|
---|
| 48 |
|
---|
| 49 | } // namespace nv
|
---|
| 50 |
|
---|
| 51 | #endif // NV_GUI_ELEMENT_HH
|
---|
Note: See
TracBrowser
for help on using the repository browser.