acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa_osdisplay.h
1
2
3
4class CLASS_DECL_AURA osdisplay_data
5{
6public:
7
8
9 critical_section * m_pcsOsDisplayData;
10 Display * m_pdisplay;
11 Atom m_atomLongType;
12 Atom m_atomLongStyle;
13 Atom m_atomLongStyleEx;
14 Atom m_atomWmState;
15 Atom m_atomNetWmState;
16 Atom m_atomaNetWmState[net_wm_state_count];
17 iptr m_countReference;
18 //array < MESSAGE > m_messsageaInput;
19 //::pointer< ::mutex > m_pmutexInput;
20
21 static osdisplay_dataptra * s_pdataptra;
22 static ::pointer< ::mutex > s_pmutex;
23
24 osdisplay_data();
25 ~osdisplay_data();
26
27 Display * display()
28 {
29 return ::is_null(this) ? nullptr : m_pdisplay;
30 }
31
32 Display * display() const
33 {
34 return ::is_null(this) ? nullptr : m_pdisplay;
35 }
36
37 Atom atom_long_type()
38 {
39 return ::is_null(this) ? 0 : m_atomLongType;
40 }
41
42 Atom atom_long_style()
43 {
44 return ::is_null(this) ? 0 : m_atomLongStyle;
45 }
46
47 Atom atom_long_style_ex()
48 {
49 return ::is_null(this) ? 0 : m_atomLongStyleEx;
50 }
51
52 bool is_null() const
53 {
54 return ::is_null(this);
55 }
56
57 Atom get_window_long_atom(::i32 nIndex);
58
59
60 Atom intern_atom(const ::scoped_string & scopedstrAtomName, bool bCreate);
61
62 Atom intern_atom(e_net_wm_state estate, bool bCreate);
63
64 Atom net_wm_state_atom(bool bCreate);
65
66
67
68
69 inline ::i64 get_ref_count()
70 {
71
72 return m_countReference;
73
74 }
75
76
77 inline ::i64 increment_reference_count()
78 {
79
80#ifdef WINDOWS
81
82 return InterlockedIncrement64(&m_countReference);
83
84#elif defined(RASPBERRYPIOS) && defined(OS32BIT)
85
86 return __sync_add_and_fetch_4(&m_countReference,1);
87
88#else
89
90 return __sync_add_and_fetch(&m_countReference,1);
91
92#endif
93
94 }
95
96
97 inline ::i64 decrement_reference_count()
98 {
99
100#ifdef WINDOWS
101
102 return InterlockedDecrement64(&m_countReference);
103
104#elif defined(RASPBERRYPIOS) && defined(OS32BIT)
105
106 return __sync_sub_and_fetch_4(&m_countReference,1);
107
108#else
109
110 return __sync_sub_and_fetch(&m_countReference,1);
111
112#endif
113
114 }
115
116
117 inline ::i64 release()
118 {
119
120 ::i64 i = decrement_reference_count();
121
122 if(i == 0)
123 {
124
125 osdisplay_erase(m_pdisplay);
126
127 }
128
129 return i;
130
131 }
132
133
134 Window default_root_window();
135
136
137};
138
139
140
141
142typedef osdisplay_data * osdisplay;
143
144
145inline xdisplay::operator Display *()
146{
147
148 return m_pdata->m_pdisplay;
149
150}
151
152inline bool xdisplay::is_null()
153{
154
155 return m_pdata == nullptr;
156
157}
158
159
160inline bool xdisplay::is_set()
161{
162
163 return m_pdata != nullptr;
164
165}
166
167
168
169
170
171class osdisplay_dataptra :
172 public ::raw_array < osdisplay_data * >
173{
174public:
175
176 virtual ~osdisplay_dataptra()
177 {
178
179 erase_all();
180
181 }
182
183 void erase_all()
184 {
185
186 for(auto point : *this)
187 {
188
189 delete i32_point;
190
191 }
192
193 raw_array < osdisplay_data * >::erase_all();
194 }
195
196};
Definition aaa_osdisplay.h:5
Definition aaa_osdisplay.h:173