Photon microGUI widgets library 0.6.0
Graphic.h
1#ifndef PHWIDGETS_GRAPHIC_H
2#define PHWIDGETS_GRAPHIC_H
3
4#include <photon/PtGraphic.h>
5
6#include "./Basic.h"
7
8
9namespace PhWidgets
10{
17
34 class Graphic:
35 public Basic
36 {
37 public:
38
40 struct ThisArgs
41 {
43 struct ArgLong
44 {
46
56 {
57 dash_scale = Pt_ARG_DASH_SCALE,
58 line_width = Pt_ARG_LINE_WIDTH
59 };
60 };
61
63 struct ArgColor
64 {
66
76 {
77 inside_color = Pt_ARG_INSIDE_COLOR
78 };
79 };
80
83 {
85
95 {
96 inside_fill_pattern = Pt_ARG_INSIDE_FILL_PATTERN,
97 inside_trans_pattern = Pt_ARG_INSIDE_TRANS_PATTERN
98 };
99 };
100
103 {
105
115 {
116 line_cap = Pt_ARG_LINE_CAP,
117 line_join = Pt_ARG_LINE_JOIN
118 };
119 };
120
122 struct ArgPoint
123 {
125
135 {
136 origin = Pt_ARG_ORIGIN
138 };
139 };
140
143 {
145
155 {
156 points = Pt_ARG_POINTS
158 };
159 };
160
162 struct ArgChar
163 {
165
175 {
176 graphic_flags = Pt_ARG_GRAPHIC_FLAGS
177 };
178 };
179
180 };
181
184 {
186 struct Callback
187 {
189
198 {
199 rescale = Pt_CB_RESCALE
202 };
203 };
204 };
205
208 {
210
218 {
226 FloatPos = Pt_FLOAT_POS,
227
234 FloatOrigin = Pt_FLOAT_ORIGIN
235 };
236 };
237
239 struct ArgLong:
240 public ArgumentsEx<Basic::ArgLong>,
241 public ThisArgs::ArgLong
242 {
244 };
245
247 struct ArgColor:
248 public ArgumentsEx<Basic::ArgColor>,
249 public ThisArgs::ArgColor
250 {
252 };
253
256 public ArgumentsEx<Basic::ArgPattern>,
258 {
260 };
261
264 public ArgumentsEx<Basic::ArgUnsignedShort>,
266 {
268 };
269
271 struct ArgPoint:
272 public ArgumentsEx<Basic::ArgPoint>,
273 public ThisArgs::ArgPoint
274 {
276 };
277
281 { };
282
284 struct ArgChar:
285 public ArgumentsEx<Basic::ArgChar>,
286 public ThisArgs::ArgChar
287 { };
288
290 struct Callback:
291 public ArgumentsEx<Basic::Callback>,
293 {
295 };
296
298 struct Arguments:
299 public ArgLong,
300 public ArgColor,
301 public ArgPattern,
302 public ArgUnsignedShort,
303 public ArgPoint,
304 public ArgPointArray,
305 public Basic::Arguments
306 { };
307
309 struct Callbacks:
310 public Callback,
311 public Basic::Callbacks
312 { };
313
314 protected:
315 typedef ResourceFrom<Basic::WidgetResourcesSingleton>::
316 Define::Scalar<ThisArgs::ArgLong::eArgLong, long>::
317 Define::Color<ThisArgs::ArgColor::eArgColor>::
318 Define::Struct<ThisArgs::ArgPattern::eArgPattern, PgPattern_t>::
319 Define::Scalar<ThisArgs::ArgUnsignedShort::eArgUnsignedShort, unsigned short>::
320 Define::Struct<ThisArgs::ArgPoint::eArgPoint, PhPoint_t>::
321 Define::Array<ThisArgs::ArgPointArray::eArgPointArray, PhPoint_t>::
322 Define::Flag<ThisArgs::ArgChar::eArgChar, char>::
323
324 Define::Link<ThisCallbacks::Callback::eCallback, PtCallback_t*>::
325
326 resource_type WidgetResourcesSingleton;
327
328 virtual void check();
329
330 public:
332
336 explicit Graphic(int abn);
337
339
343 explicit Graphic(PtWidget_t *wdg);
344
346
350 Graphic(const Graphic &other);
351
353
357 Graphic &operator=(const Graphic &other);
358
360
364 WidgetResourcesSingleton resource;
365
368
369
371
373
376 };
377} // namespace PhWidgets
378
379
380#endif // PHWIDGETS_GRAPHIC_H
A superclass of basic resources for most widgets.
Definition: Basic.h:41
Common resources for graphical widgets.
Definition: Graphic.h:36
Graphic(int abn)
(constructor)
Graphic & operator=(const Graphic &other)
Assigns value in Graphic.
Graphic(PtWidget_t *wdg)
(constructor)
Graphic(const Graphic &other)
(copy constructor)
WidgetResourcesSingleton resource
Resources of the Graphic.
Definition: Graphic.h:364
An event, which raise a notification to registered subscribers (event handlers) that something of int...
Definition: Widget.h:132
The main namespace for all widgets.
Definition: Basic.h:11
Contains resource IDs for Basic arguments.
Definition: Basic.h:47
Contains resource IDs for Basic callbacks.
Definition: Basic.h:217
Contains resource IDs for arguments of type char.
Definition: Graphic.h:287
Contains resource IDs for arguments of type PgColor_t.
Definition: Graphic.h:250
Contains resource IDs for arguments of type long.
Definition: Graphic.h:242
Contains resource IDs for arguments of type PgPattern_t.
Definition: Graphic.h:258
Contains resource IDs for arguments of PhPoint_t array.
Definition: Graphic.h:281
Contains resource IDs for arguments of type PhPoint_t.
Definition: Graphic.h:274
Contains resource IDs for arguments of type unsigned short.
Definition: Graphic.h:266
Contains resource IDs for all Graphic arguments.
Definition: Graphic.h:306
Contains resource IDs for callbacks of type PtCallback_t.
Definition: Graphic.h:293
Contains resource IDs for all Graphic callbacks.
Definition: Graphic.h:312
Contains resource IDs for Graphic arguments of type char.
Definition: Graphic.h:163
eArgChar
Resource IDs for Graphic arguments of type char.
Definition: Graphic.h:175
@ graphic_flags
Graphics flags. See Graphic::Flags::eGraphicFlags for possible values.
Definition: Graphic.h:176
Contains resource IDs for Graphic arguments of type PgColor_t.
Definition: Graphic.h:64
eArgColor
Resource IDs for Graphic arguments of type PgColor_t.
Definition: Graphic.h:76
@ inside_color
The color of the inside of the graphic.
Definition: Graphic.h:77
Contains resource IDs for Graphic arguments of type long.
Definition: Graphic.h:44
eArgLong
Resource IDs for Graphic arguments of type long.
Definition: Graphic.h:56
@ dash_scale
A scaling factor that's applied to each of the bits in the dash list to determine the number of pixel...
Definition: Graphic.h:57
@ line_width
The line width for any graphically based widget.
Definition: Graphic.h:58
Contains resource IDs for Graphic arguments of type PgPattern_t.
Definition: Graphic.h:83
eArgPattern
Resource IDs for Graphic arguments of type PgPattern_t.
Definition: Graphic.h:95
@ inside_trans_pattern
The transparency pattern for the inside of the graphic. You can use this resource for “ghosting” widg...
Definition: Graphic.h:97
@ inside_fill_pattern
The background pattern of the inside of the graphic.
Definition: Graphic.h:96
Contains resource IDs for Graphic arguments of PhPoint_t array.
Definition: Graphic.h:143
eArgPointArray
Resource IDs for Graphic arguments of PhPoint_t array.
Definition: Graphic.h:155
Contains resource IDs for Graphic arguments of type PhPoint_t.
Definition: Graphic.h:123
eArgPoint
Resource IDs for Graphic arguments of type PhPoint_t.
Definition: Graphic.h:135
@ origin
Definition: Graphic.h:136
Contains resource IDs for Graphic arguments of type unsigned short.
Definition: Graphic.h:103
eArgUnsignedShort
Resource IDs for Graphic arguments of type unsigned short.
Definition: Graphic.h:115
@ line_join
Defines how thick lines are connected.
Definition: Graphic.h:117
@ line_cap
Defines how the ends of thick lines are drawn.
Definition: Graphic.h:116
Contains resource IDs for Graphic arguments.
Definition: Graphic.h:41
Contains resource IDs for Graphic callbacks of type PtCallback_t.
Definition: Graphic.h:187
eCallback
Resource IDs for Graphic arguments of type PtCallback_t.
Definition: Graphic.h:198
Contains resource IDs for Graphic callbacks.
Definition: Graphic.h:184
Contains flags for Graphic resources.
Definition: Graphic.h:208
eGraphicFlags
Graphics flags for Graphic resource Graphic::Arguments::graphic_flags.
Definition: Graphic.h:218
@ FloatPos
Definition: Graphic.h:226
@ FloatOrigin
Definition: Graphic.h:234