source: trunk/nv/gui/gui_element.hh @ 270

Last change on this file since 270 was 270, checked in by epyon, 11 years ago
  • nv::handle - generic handle implementation
  • nv::index_store - index store based on handles
  • gui elements fully based on handles instead of pointers
File size: 1.5 KB
Line 
1// Copyright (C) 2012-2013 ChaosForge / Kornel Kisielewicz
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
16#include <nv/common.hh>
17#include <nv/position.hh>
18#include <nv/io_event.hh>
19#include <nv/gui/gui_common.hh>
20
21namespace nv
22{
23        namespace gui
24        {
25
26                class element
27                {
28                public:
29                        /// List type
30                        typedef std::list<handle> list;
31
32
33                        element()
34                                : m_id( "" )
35                                , m_child_count(0)
36                                , m_class("")
37                                , m_enabled( true )
38                                , m_visible( true )
39                                , m_dirty( true )
40                                , m_render_data( nullptr ) {}
41
42                        string    m_id;              ///< id type of the object
43                        handle    m_this;            ///< pointer to parent
44                        handle    m_parent;          ///< pointer to parent
45                        list      m_children;        ///< children objects
46                        size_t    m_child_count;     ///< number of children
47                        string    m_class; ///< Class name.
48                        string    m_text; ///< Displayed label or text.
49                        rectangle m_relative; ///< Position relative to parent.
50                        rectangle m_absolute; ///< Position relative to window/screen.
51                        bool m_enabled; ///< Whether the element accepts events.
52                        bool m_visible; ///< Whether the element is drawn.
53                        bool m_dirty; ///< Whether the element needs updating.
54                        render_data* m_render_data; ///<   -?-
55                };
56
57        } // namespace gui
58
59} // namespace nv
60
61#endif // NV_GUI_ELEMENT_HH
Note: See TracBrowser for help on using the repository browser.