HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
STY_StylerMatch.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: STY_StylerMatch.h (STY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __STY_StylerMatch__
12 #define __STY_StylerMatch__
13 
14 #include "STY_API.h"
15 #include "STY_Types.h"
16 #include "STY_Target.h"
17 #include "STY_TargetMatchClosure.h"
18 #include <UT/UT_NonCopyable.h>
19 #include <UT/UT_IntrusivePtr.h>
20 
21 class STY_Style;
22 
23 /// Active entry referencing an underlying style sheet entry,
24 /// however with new target and with closure data constructed
25 /// from matching previous target components.
27  public UT_NonCopyable,
28  public UT_IntrusiveRefCounter<STY_StylerMatch>
29 {
30 public:
31  /// Constructor.
32  STY_StylerMatch(const STY_Style *style,
33  const STY_TargetHandle &target,
34  const STY_TargetMatchClosureHandle &closure,
35  bool owns_style_entry = false);
36  ~STY_StylerMatch();
37 
38  /// @{ Accessors.
39  const STY_Style *getStyle() const
40  { return myStyle; }
41  const STY_TargetHandle &getTarget() const
42  { return myTarget; }
44  { return myClosure; }
45  /// @}
46 
47  /// Returns true if this is a full match, meaning all child subjects
48  /// will match because there are no additional targeting conditions.
49  bool isFullMatch() const;
50 
51 private:
52  /// An underlying original style entry from the original style sheet.
53  const STY_Style *myStyle;
54 
55  /// A new target associated with the entry.
56  /// This is the target that the next subject needs to match.
57  /// If NULL, the original target has been fully matched already.
58  STY_TargetHandle myTarget;
59 
60  /// Closure containing information and data from previous matches
61  /// of the original target components (sub-targets).
63 
64  /// Tracks whether this object owns its myStyle pointer.
65  bool myOwnStyle;
66 };
67 
68 #endif
69 
const STY_Style * getStyle() const
Accessors.
const STY_TargetMatchClosureHandle & getClosure() const
Accessors.
Represents a style sheet entry that contains a target and overrides.
Definition: STY_Style.h:28
#define STY_API
Definition: STY_API.h:10
A reference counter base class for use with UT_IntrusivePtr.
GLenum target
Definition: glcorearb.h:1667
const STY_TargetHandle & getTarget() const
Accessors.