QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskAspect.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_ASPECT_H
7#define QSK_ASPECT_H
8
9#include "QskGlobal.h"
10
11#include <qmetaobject.h>
12#include <qnamespace.h>
13
14class QSK_EXPORT QskAspect
15{
16 Q_GADGET
17
18 public:
19
20 enum Type : quint8
21 {
22 NoType = 0,
23
24 Metric = 1,
25 Color = 2,
26 };
27 Q_ENUM( Type )
28
29 static constexpr uint typeCount = 3;
30
31 enum Section : quint8
32 {
33 Body = 0,
34
35 Header,
36 Footer,
37
38 Card,
39
40 Floating
41 };
42 Q_ENUM( Section )
43
44 static constexpr uint FirstUserSection = Section::Floating + 1;
45 static constexpr uint LastSection = ( 1 << 4 ) - 1;
46
47 enum Primitive : quint8
48 {
49 NoPrimitive = 0,
50
52 Direction,
54 Option,
55
58
59 Symbol,
60
64
68
72
76
77 Graduation
78 };
79 Q_ENUM( Primitive )
80
81 enum Variation : quint8
82 {
83 NoVariation = 0,
84
85 Vertical = Qt::Vertical,
86 Horizontal = Qt::Horizontal,
87
88 Lower = 1,
89 Upper = 2,
90
91 Top = 1,
92 Left = 2,
93 Right = 3,
94 Bottom = 4,
95
96 Tiny = 1,
97 Small = 2,
98 Large = 3,
99 Huge = 4
100 };
101 Q_ENUM( Variation )
102
103 enum Subcontrol : quint16
104 {
105 NoSubcontrol = 0,
106 LastSubcontrol = ( 1 << 12 ) - 1
107 };
108
109 Q_ENUM( Subcontrol )
110
111 enum State : quint16
112 {
113 NoState = 0,
114
115 FirstSystemState = 1 << 0,
116 FirstUserState = 1 << 5,
117 LastUserState = 1 << 11,
118 LastSystemState = 1 << 15,
119
120 AllStates = 0xFFFF
121 };
122
123 Q_ENUM( State )
124 Q_DECLARE_FLAGS( States, State )
125
126 constexpr QskAspect() noexcept;
127
128 constexpr QskAspect( Subcontrol ) noexcept;
129 constexpr QskAspect( Section ) noexcept;
130 constexpr QskAspect( Type ) noexcept;
131 constexpr QskAspect( Variation ) noexcept;
132
133 constexpr QskAspect( const QskAspect& ) noexcept = default;
134 constexpr QskAspect( QskAspect&& ) noexcept = default;
135
136 QskAspect& operator=( const QskAspect& ) noexcept = default;
137
138 bool operator==( const QskAspect& ) const noexcept;
139 bool operator!=( const QskAspect& ) const noexcept;
140
141 bool operator<( const QskAspect& ) const noexcept;
142
143 constexpr QskAspect operator|( Subcontrol ) const noexcept;
144 constexpr QskAspect operator|( Section ) const noexcept;
145 constexpr QskAspect operator|( Type ) const noexcept;
146 constexpr QskAspect operator|( Primitive ) const noexcept;
147 constexpr QskAspect operator|( Variation ) const noexcept;
148
149 constexpr QskAspect operator|( State ) const noexcept;
150 QskAspect& operator|=( State ) noexcept;
151
152 constexpr QskAspect operator&( State ) const noexcept;
153 QskAspect& operator&=( State ) noexcept;
154
155 constexpr QskAspect operator|( States ) const noexcept;
156 QskAspect& operator|=( States ) noexcept;
157
158 constexpr QskAspect operator&( States ) const noexcept;
159 QskAspect& operator&=( States ) noexcept;
160
161 constexpr QskAspect stateless() const noexcept;
162 constexpr QskAspect trunk() const noexcept;
163
164 constexpr quint64 value() const noexcept;
165
166 constexpr bool isAnimator() const noexcept;
167 void setAnimator( bool on ) noexcept;
168
169 constexpr Subcontrol subControl() const noexcept;
170 void setSubcontrol( Subcontrol ) noexcept;
171 constexpr bool hasSubcontrol() const noexcept;
172 void clearSubcontrol() noexcept;
173
174 constexpr Section section() const noexcept;
175 void setSection( Section ) noexcept;
176
177 constexpr Type type() const noexcept;
178 void setType( Type ) noexcept;
179
180 constexpr bool isMetric() const noexcept;
181 constexpr bool isColor() const noexcept;
182
183 constexpr Variation variation() const noexcept;
184 void setVariation( Variation ) noexcept;
185
186 constexpr States states() const noexcept;
187 constexpr bool hasStates() const noexcept;
188
189 State topState() const noexcept;
190 void clearState( State ) noexcept;
191
192 void setStates( States ) noexcept;
193 void addStates( States ) noexcept;
194 void clearStates( States = AllStates ) noexcept;
195
196 constexpr Primitive primitive() const noexcept;
197 void setPrimitive( Type, Primitive primitive ) noexcept;
198 void clearPrimitive() noexcept;
199
200 constexpr Primitive colorPrimitive() const noexcept;
201 constexpr Primitive metricPrimitive() const noexcept;
202
203 const char* toPrintable() const;
204
205 static State registerState( const QMetaObject*, State, const char* );
206 static Subcontrol nextSubcontrol( const QMetaObject*, const char* );
207
208 static QByteArray subControlName( Subcontrol );
209 static QVector< QByteArray > subControlNames( const QMetaObject* = nullptr );
210 static QVector< Subcontrol > subControls( const QMetaObject* );
211
212 static quint8 primitiveCount();
213 static void reservePrimitives( quint8 count );
214
215 private:
216 constexpr QskAspect( Subcontrol, Section, Type, Variation ) noexcept;
217
218 constexpr QskAspect( uint subControl, uint section, uint type, bool isAnimator,
219 uint primitive, uint variation, uint states ) noexcept;
220
221 struct Bits
222 {
223 uint subControl : 12;
224 uint section : 4;
225
226 uint type : 3;
227 uint isAnimator : 1;
228
229 uint primitive : 5;
230 uint variation : 3;
231 uint reserved1 : 4;
232
233 uint states : 16;
234
235 uint reserved2 : 16;
236 };
237
238 union
239 {
240 Bits m_bits;
241 quint64 m_value;
242 };
243};
244
245Q_DECLARE_TYPEINFO( QskAspect, Q_MOVABLE_TYPE );
246Q_DECLARE_OPERATORS_FOR_FLAGS( QskAspect::States )
247
248constexpr inline QskAspect::State operator<<( QskAspect::State a, const int b ) noexcept
249{
250 using underlying = typename std::underlying_type< QskAspect::State >::type;
251 return static_cast< QskAspect::State >( static_cast< underlying >( a ) << b );
252}
253
254constexpr inline QskAspect::State operator>>( QskAspect::State a, const int b ) noexcept
255{
256 using underlying = typename std::underlying_type< QskAspect::State >::type;
257 return static_cast< QskAspect::State >( static_cast< underlying >( a ) >> b );
258}
259
260inline constexpr QskAspect::QskAspect() noexcept
261 : QskAspect( NoSubcontrol, Body, NoType, NoVariation )
262{
263}
264
265inline constexpr QskAspect::QskAspect( Subcontrol subControl ) noexcept
266 : QskAspect( subControl, Body, NoType, NoVariation )
267{
268}
269
270inline constexpr QskAspect::QskAspect( Section section ) noexcept
271 : QskAspect( NoSubcontrol, section, NoType, NoVariation )
272{
273}
274
275inline constexpr QskAspect::QskAspect( Type type ) noexcept
276 : QskAspect( NoSubcontrol, Body, type, NoVariation )
277{
278}
279
280inline constexpr QskAspect::QskAspect( Variation variation ) noexcept
281 : QskAspect( NoSubcontrol, Body, NoType, variation )
282{
283}
284
285inline constexpr QskAspect::QskAspect(
286 Subcontrol subControl, Section section, Type type, Variation variation ) noexcept
287 : QskAspect( subControl, section, type, false, 0, variation, NoState )
288{
289}
290
291inline constexpr QskAspect::QskAspect( uint subControl, uint section, uint type,
292 bool isAnimator, uint primitive, uint variation, uint states ) noexcept
293 : m_bits { subControl, section, type, isAnimator, primitive, variation, 0, states, 0 }
294{
295}
296
297inline bool QskAspect::operator==( const QskAspect& other ) const noexcept
298{
299 return m_value == other.m_value;
300}
301
302inline bool QskAspect::operator!=( const QskAspect& other ) const noexcept
303{
304 return m_value != other.m_value;
305}
306
307inline bool QskAspect::operator<( const QskAspect& other ) const noexcept
308{
309 return m_value < other.m_value;
310}
311
312inline constexpr QskAspect QskAspect::operator|( Subcontrol subControl ) const noexcept
313{
314 return QskAspect( subControl, m_bits.section, m_bits.type,
315 m_bits.isAnimator, m_bits.primitive, m_bits.variation, m_bits.states );
316}
317
318inline constexpr QskAspect QskAspect::operator|( Section section ) const noexcept
319{
320 return QskAspect( m_bits.subControl, section, m_bits.type,
321 m_bits.isAnimator, m_bits.primitive, m_bits.variation, m_bits.states );
322}
323
324inline constexpr QskAspect QskAspect::operator|( Type type ) const noexcept
325{
326 return QskAspect( m_bits.subControl, m_bits.section, type,
327 m_bits.isAnimator, m_bits.primitive, m_bits.variation, m_bits.states );
328}
329
330inline constexpr QskAspect QskAspect::operator|( Primitive primitive ) const noexcept
331{
332 return QskAspect( m_bits.subControl, m_bits.section, m_bits.type,
333 m_bits.isAnimator, primitive, m_bits.variation, m_bits.states );
334}
335
336inline constexpr QskAspect QskAspect::operator|( Variation variation ) const noexcept
337{
338 return QskAspect( m_bits.subControl, m_bits.section, m_bits.type,
339 m_bits.isAnimator, m_bits.primitive, variation, m_bits.states );
340}
341
342inline constexpr QskAspect QskAspect::operator|( State state ) const noexcept
343{
344 return QskAspect( m_bits.subControl, m_bits.section, m_bits.type,
345 m_bits.isAnimator, m_bits.primitive, m_bits.variation, m_bits.states | state );
346}
347
348inline QskAspect& QskAspect::operator|=( State state ) noexcept
349{
350 m_bits.states |= state;
351 return *this;
352}
353
354inline constexpr QskAspect QskAspect::operator&( State state ) const noexcept
355{
356 return QskAspect( m_bits.subControl, m_bits.section, m_bits.type, m_bits.isAnimator,
357 m_bits.primitive, m_bits.variation, m_bits.states & state );
358}
359
360inline QskAspect& QskAspect::operator&=( State state ) noexcept
361{
362 m_bits.states &= state;
363 return *this;
364}
365
366inline constexpr QskAspect QskAspect::operator|( States states ) const noexcept
367{
368 return QskAspect( m_bits.subControl, m_bits.section, m_bits.type, m_bits.isAnimator,
369 m_bits.primitive, m_bits.variation, m_bits.states | states );
370}
371
372inline QskAspect& QskAspect::operator|=( States states ) noexcept
373{
374 m_bits.states |= states;
375 return *this;
376}
377
378inline constexpr QskAspect QskAspect::operator&( States states ) const noexcept
379{
380 return QskAspect( m_bits.subControl, m_bits.section, m_bits.type,
381 m_bits.isAnimator, m_bits.primitive, m_bits.variation, m_bits.states & states );
382}
383
384inline QskAspect& QskAspect::operator&=( States states ) noexcept
385{
386 m_bits.states &= states;
387 return *this;
388}
389
390inline constexpr QskAspect QskAspect::stateless() const noexcept
391{
392 return QskAspect( m_bits.subControl, m_bits.section, m_bits.type,
393 m_bits.isAnimator, m_bits.primitive, m_bits.variation, 0 );
394}
395
396inline constexpr QskAspect QskAspect::trunk() const noexcept
397{
398 return QskAspect( m_bits.subControl, 0, m_bits.type,
399 m_bits.isAnimator, m_bits.primitive, 0, 0 );
400}
401
402inline constexpr quint64 QskAspect::value() const noexcept
403{
404 return m_value;
405}
406
407inline constexpr bool QskAspect::isAnimator() const noexcept
408{
409 return m_bits.isAnimator;
410}
411
412inline void QskAspect::setAnimator( bool on ) noexcept
413{
414 m_bits.isAnimator = on;
415}
416
417inline constexpr QskAspect::Subcontrol QskAspect::subControl() const noexcept
418{
419 return static_cast< Subcontrol >( m_bits.subControl );
420}
421
422inline void QskAspect::setSubcontrol( Subcontrol subControl ) noexcept
423{
424 m_bits.subControl = subControl;
425}
426
427inline constexpr bool QskAspect::hasSubcontrol() const noexcept
428{
429 return m_bits.subControl != 0;
430}
431
432inline void QskAspect::clearSubcontrol() noexcept
433{
434 m_bits.subControl = 0;
435}
436
437inline constexpr QskAspect::Section QskAspect::section() const noexcept
438{
439 return static_cast< Section >( m_bits.section );
440}
441
442inline void QskAspect::setSection( Section section ) noexcept
443{
444 m_bits.section = section;
445}
446
447inline constexpr QskAspect::Type QskAspect::type() const noexcept
448{
449 return static_cast< Type >( m_bits.type );
450}
451
452inline void QskAspect::setType( Type type ) noexcept
453{
454 m_bits.type = type;
455}
456
457inline constexpr bool QskAspect::isMetric() const noexcept
458{
459 return type() == Metric;
460}
461
462inline constexpr bool QskAspect::isColor() const noexcept
463{
464 return type() == Color;
465}
466
467inline constexpr QskAspect::States QskAspect::states() const noexcept
468{
469 return static_cast< States >( m_bits.states );
470}
471
472inline void QskAspect::setStates( States states ) noexcept
473{
474 m_bits.states = states;
475}
476
477inline void QskAspect::addStates( States states ) noexcept
478{
479 m_bits.states |= states;
480}
481
482inline constexpr bool QskAspect::hasStates() const noexcept
483{
484 return m_bits.states;
485}
486
487inline void QskAspect::clearState( State state ) noexcept
488{
489 m_bits.states &= ~state;
490}
491
492inline void QskAspect::clearStates( States states ) noexcept
493{
494 m_bits.states &= ~states;
495}
496
497inline constexpr QskAspect::Primitive QskAspect::primitive() const noexcept
498{
499 return static_cast< QskAspect::Primitive >( m_bits.primitive );
500}
501
502inline void QskAspect::setPrimitive( Type type, QskAspect::Primitive primitive ) noexcept
503{
504 m_bits.type = type;
505 m_bits.primitive = primitive;
506}
507
508inline constexpr QskAspect::Primitive QskAspect::colorPrimitive() const noexcept
509{
510 return ( m_bits.type == Color )
511 ? static_cast< Primitive >( m_bits.primitive ) : NoPrimitive;
512}
513
514inline constexpr QskAspect::Primitive QskAspect::metricPrimitive() const noexcept
515{
516 return ( m_bits.type == Metric )
517 ? static_cast< Primitive >( m_bits.primitive ) : NoPrimitive;
518}
519
520inline void QskAspect::clearPrimitive() noexcept
521{
522 m_bits.primitive = NoPrimitive;
523}
524
525inline constexpr QskAspect::Variation QskAspect::variation() const noexcept
526{
527 return static_cast< Variation >( m_bits.variation );
528}
529
530inline void QskAspect::setVariation( Variation variation ) noexcept
531{
532 m_bits.variation = variation;
533}
534
535inline constexpr QskAspect operator|(
536 QskAspect::State state, const QskAspect& aspect ) noexcept
537{
538 return aspect | state;
539}
540
541inline constexpr QskAspect operator|(
542 QskAspect::States states, const QskAspect& aspect ) noexcept
543{
544 return aspect | states;
545}
546
547inline constexpr QskAspect operator|(
548 QskAspect::Subcontrol subControl, const QskAspect& aspect ) noexcept
549{
550 return aspect | subControl;
551}
552
553inline constexpr QskAspect operator|(
554 QskAspect::Section section, const QskAspect& aspect ) noexcept
555{
556 return aspect | section;
557}
558
559inline constexpr QskAspect operator|(
560 QskAspect::Type type, const QskAspect& aspect ) noexcept
561{
562 return aspect | type;
563}
564
565inline constexpr QskAspect operator|(
566 QskAspect::Variation variation, const QskAspect& aspect ) noexcept
567{
568 return aspect | variation;
569}
570
571inline constexpr QskAspect operator|(
572 QskAspect::Subcontrol subControl, QskAspect::Section section ) noexcept
573{
574 return QskAspect( subControl ) | section;
575}
576
577inline constexpr QskAspect operator|(
578 QskAspect::Section section, QskAspect::Subcontrol subControl ) noexcept
579{
580 return subControl | section;
581}
582
583inline constexpr QskAspect operator|(
584 QskAspect::Subcontrol subControl, QskAspect::Type type ) noexcept
585{
586 return QskAspect( subControl ) | type;
587}
588
589inline constexpr QskAspect operator|(
590 QskAspect::Type type, QskAspect::Subcontrol subControl ) noexcept
591{
592 return subControl | type;
593}
594
595inline constexpr QskAspect operator|(
596 QskAspect::Subcontrol subControl, QskAspect::State state ) noexcept
597{
598 return QskAspect( subControl ) | state;
599}
600
601inline constexpr QskAspect operator|(
602 QskAspect::Subcontrol subControl, QskAspect::States states ) noexcept
603{
604 return QskAspect( subControl ) | states;
605}
606
607inline constexpr QskAspect operator|(
608 QskAspect::Type type, QskAspect::Variation variation ) noexcept
609{
610 return QskAspect( type ) | variation;
611}
612
613inline constexpr QskAspect operator|(
614 QskAspect::Variation variation, QskAspect::Type type ) noexcept
615{
616 return type | variation;
617}
618
619inline constexpr QskAspect operator|(
620 QskAspect::State state, QskAspect::Subcontrol subControl ) noexcept
621{
622 return subControl | state;
623}
624
625inline constexpr QskAspect operator|(
626 QskAspect::States states, QskAspect::Subcontrol subControl ) noexcept
627{
628 return subControl | states;
629}
630
631inline constexpr QskAspect operator|(
632 QskAspect::Subcontrol subControl, QskAspect::Primitive primitive ) noexcept
633{
634 return QskAspect( subControl ) | primitive;
635}
636
637inline constexpr QskAspect operator|(
638 QskAspect::Primitive primitive, QskAspect::Subcontrol subControl ) noexcept
639{
640 return subControl | primitive;
641}
642
643inline constexpr QskAspect operator|(
644 QskAspect::Subcontrol subControl, QskAspect::Variation variation ) noexcept
645{
646 return QskAspect( subControl ) | variation;
647}
648
649inline constexpr QskAspect operator|(
650 QskAspect::Variation variation, QskAspect::Subcontrol subControl ) noexcept
651{
652 return subControl | variation;
653}
654
655namespace std
656{
657 template< > struct hash< QskAspect >
658 {
659 constexpr size_t operator()( const QskAspect& aspect ) const noexcept
660 {
661 return aspect.value();
662 }
663 };
664}
665
666inline QskHashValue qHash( const QskAspect aspect, QskHashValue seed = 0 ) noexcept
667{
668 return qHash( aspect.value(), seed );
669}
670
671#ifndef QT_NO_DEBUG_STREAM
672
673class QDebug;
674
675QSK_EXPORT QDebug operator<<( QDebug, QskAspect );
676QSK_EXPORT QDebug operator<<( QDebug, QskAspect::Type );
677QSK_EXPORT QDebug operator<<( QDebug, QskAspect::Subcontrol );
678QSK_EXPORT QDebug operator<<( QDebug, QskAspect::Primitive );
679QSK_EXPORT QDebug operator<<( QDebug, QskAspect::Variation );
680QSK_EXPORT QDebug operator<<( QDebug, QskAspect::States );
681
682QSK_EXPORT void qskDebugStates( QDebug, const QMetaObject*, QskAspect::States );
683QSK_EXPORT void qskDebugAspect( QDebug, const QMetaObject*, QskAspect );
684
685#endif
686
687#define QSK_SUBCONTROL( type, name ) \
688 const QskAspect::Subcontrol type::name = \
689 QskAspect::nextSubcontrol( &type::staticMetaObject, #type "::" #name );
690
691#define QSK_STATE( type, name, value ) \
692 static_assert( \
693 ( ( value ) >= QskAspect::FirstUserState ) && ( ( value ) <= QskAspect::LastUserState ), \
694 "Invalid state" \
695 ); \
696 const QskAspect::State type::name = \
697 QskAspect::registerState( &type::staticMetaObject, value, #type "::" #name );
698
699#define QSK_SYSTEM_STATE( type, name, value ) \
700 static_assert( \
701 ( ( value ) >= QskAspect::FirstSystemState && ( value ) < QskAspect::FirstUserState ) || \
702 ( ( value ) > QskAspect::LastUserState && ( value ) <= QskAspect::LastSystemState ), \
703 "Invalid system state" \
704 ); \
705 const QskAspect::State type::name = \
706 QskAspect::registerState( &type::staticMetaObject, value, #type "::" #name );
707
708#if !defined( _MSC_VER )
709
710#define QSK_SUBCONTROLS( ... ) static const QskAspect::Subcontrol __VA_ARGS__;
711#define QSK_STATES( ... ) static const QskAspect::State __VA_ARGS__;
712
713#else
714
715/*
716 Working around a MSVC bug: when static member are defined in one statement
717 only the first one is exported. Unfortuately the code below is also not
718 compliant with ISO C++11 and gcc -pedantic f.e. would fail.
719 */
720
721#define _QSK_EXPAND(x) x
722
723#define _QSK_EVAL_0( m, x, ... ) m(x)
724#define _QSK_EVAL_1( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_0( m, __VA_ARGS__ ) )
725#define _QSK_EVAL_2( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_1( m, __VA_ARGS__ ) )
726#define _QSK_EVAL_3( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_2( m, __VA_ARGS__ ) )
727#define _QSK_EVAL_4( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_3( m, __VA_ARGS__ ) )
728#define _QSK_EVAL_5( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_4( m, __VA_ARGS__ ) )
729#define _QSK_EVAL_6( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_5( m, __VA_ARGS__ ) )
730#define _QSK_EVAL_7( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_6( m, __VA_ARGS__ ) )
731#define _QSK_EVAL_8( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_7( m, __VA_ARGS__ ) )
732#define _QSK_EVAL_9( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_8( m, __VA_ARGS__ ) )
733#define _QSK_EVAL_A( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_9( m, __VA_ARGS__ ) )
734#define _QSK_EVAL_B( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_A( m, __VA_ARGS__ ) )
735#define _QSK_EVAL_C( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_B( m, __VA_ARGS__ ) )
736#define _QSK_EVAL_D( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_C( m, __VA_ARGS__ ) )
737#define _QSK_EVAL_E( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_D( m, __VA_ARGS__ ) )
738#define _QSK_EVAL_F( m, x, ... ) m(x) _QSK_EXPAND( _QSK_EVAL_E( m, __VA_ARGS__ ) )
739
740#define _QSK_EVAL_NARG( ... ) _QSK_EVAL_NARG_( __VA_ARGS__, _QSK_EVAL_RSEQ_N() )
741#define _QSK_EVAL_NARG_( ... ) _QSK_EXPAND( _QSK_EVAL_ARG_N( __VA_ARGS__ ) )
742
743#define _QSK_EVAL_ARG_N( _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, A, B, C, D, E, F, N, ... ) N
744#define _QSK_EVAL_RSEQ_N() F, E, D, C, B, A, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
745
746#define _QSK_CAT(x,y) x ## y
747#define _QSK_EVAL_( N, m, ... ) _QSK_EXPAND( _QSK_CAT( _QSK_EVAL_, N )( m, __VA_ARGS__ ) )
748#define _QSK_EVAL( m, ... ) _QSK_EVAL_( _QSK_EVAL_NARG( __VA_ARGS__ ), m, __VA_ARGS__ )
749
750#define _QSK_SUBCONTROLS_HELPER( name ) static const QskAspect::Subcontrol name;
751#define QSK_SUBCONTROLS( ... ) _QSK_EVAL( _QSK_SUBCONTROLS_HELPER, __VA_ARGS__ )
752
753#define _QSK_STATES_HELPER( name ) static const QskAspect::State name;
754#define QSK_STATES( ... ) _QSK_EVAL( _QSK_STATES_HELPER, __VA_ARGS__ )
755
756#endif
757
758#endif
Lookup key for a QskSkinHintTable.
Definition QskAspect.h:15
constexpr QskAspect operator|(Subcontrol) const noexcept
Definition QskAspect.h:312
void clearStates(States=AllStates) noexcept
Definition QskAspect.h:492
constexpr bool hasStates() const noexcept
Definition QskAspect.h:482
constexpr bool isAnimator() const noexcept
Definition QskAspect.h:407
void setStates(States) noexcept
Definition QskAspect.h:472
bool operator<(const QskAspect &) const noexcept
Definition QskAspect.h:307
Variation
Some sort of variation.
Definition QskAspect.h:82
constexpr bool isMetric() const noexcept
Definition QskAspect.h:457
constexpr quint64 value() const noexcept
Definition QskAspect.h:402
void addStates(States) noexcept
Definition QskAspect.h:477
constexpr QskAspect trunk() const noexcept
Definition QskAspect.h:396
void setType(Type) noexcept
Definition QskAspect.h:452
constexpr bool isColor() const noexcept
Definition QskAspect.h:462
constexpr Primitive colorPrimitive() const noexcept
Definition QskAspect.h:508
constexpr Primitive primitive() const noexcept
Definition QskAspect.h:497
constexpr Subcontrol subControl() const noexcept
Definition QskAspect.h:417
constexpr Variation variation() const noexcept
Definition QskAspect.h:525
constexpr Type type() const noexcept
Definition QskAspect.h:447
void setAnimator(bool on) noexcept
Definition QskAspect.h:412
constexpr States states() const noexcept
Definition QskAspect.h:467
Primitive
Represents a specific element or attribute.
Definition QskAspect.h:48
@ GraphicRole
Definition QskAspect.h:56
@ NoPrimitive
Definition QskAspect.h:49
bool operator!=(const QskAspect &) const noexcept
Definition QskAspect.h:302
constexpr QskAspect() noexcept
Definition QskAspect.h:260
void setPrimitive(Type, Primitive primitive) noexcept
Definition QskAspect.h:502
void setVariation(Variation) noexcept
Definition QskAspect.h:530
Type
Represents the type of the Aspect.
Definition QskAspect.h:21
Subcontrol
For use within the rendering or lay-outing of a specific QskSkinnable.
Definition QskAspect.h:104
bool operator==(const QskAspect &) const noexcept
Definition QskAspect.h:297
void clearPrimitive() noexcept
Definition QskAspect.h:520
void clearState(State) noexcept
Definition QskAspect.h:487
constexpr QskAspect stateless() const noexcept
Definition QskAspect.h:390
constexpr Primitive metricPrimitive() const noexcept
Definition QskAspect.h:514