18 #include "pandabase.h" 20 #include "pgMouseWatcherRegion.h" 21 #include "pgFrameStyle.h" 22 #include "pgItemNotify.h" 24 #include "pandaNode.h" 27 #include "pointerTo.h" 31 #include "lightReMutex.h" 32 #include "lightReMutexHolder.h" 35 #include "audioSound.h" 60 PGItem(
const string &name);
63 INLINE
void set_name(
const string &name);
69 virtual void transform_changed();
70 virtual void draw_mask_changed();
75 virtual void compute_internal_bounds(CPT(
BoundingVolume) &internal_bounds,
76 int &internal_vertices,
78 Thread *current_thread)
const;
87 bool activate_region(
const LMatrix4 &transform,
int sort,
96 virtual void focus_in();
97 virtual void focus_out();
110 INLINE
bool has_notify()
const;
114 INLINE
void set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
115 INLINE
void set_frame(
const LVecBase4 &frame);
116 INLINE
const LVecBase4 &get_frame()
const;
117 INLINE
bool has_frame()
const;
118 INLINE
void clear_frame();
121 INLINE
int get_state()
const;
123 virtual void set_active(
bool active);
124 INLINE
bool get_active()
const;
126 virtual void set_focus(
bool focus);
127 INLINE
bool get_focus()
const;
129 void set_background_focus(
bool focus);
130 INLINE
bool get_background_focus()
const;
132 INLINE
void set_suppress_flags(
int suppress_flags);
133 INLINE
int get_suppress_flags()
const;
135 int get_num_state_defs()
const;
136 void clear_state_def(
int state);
137 bool has_state_def(
int state)
const;
139 MAKE_SEQ(get_state_defs, get_num_state_defs, get_state_def);
143 void set_frame_style(
int state,
const PGFrameStyle &style);
145 INLINE
const string &get_id()
const;
146 INLINE
void set_id(
const string &
id);
148 INLINE
static string get_enter_prefix();
149 INLINE
static string get_exit_prefix();
150 INLINE
static string get_within_prefix();
151 INLINE
static string get_without_prefix();
152 INLINE
static string get_focus_in_prefix();
153 INLINE
static string get_focus_out_prefix();
154 INLINE
static string get_press_prefix();
155 INLINE
static string get_repeat_prefix();
156 INLINE
static string get_release_prefix();
157 INLINE
static string get_keystroke_prefix();
159 INLINE
string get_enter_event()
const;
160 INLINE
string get_exit_event()
const;
161 INLINE
string get_within_event()
const;
162 INLINE
string get_without_event()
const;
163 INLINE
string get_focus_in_event()
const;
164 INLINE
string get_focus_out_event()
const;
165 INLINE
string get_press_event(
const ButtonHandle &button)
const;
166 INLINE
string get_repeat_event(
const ButtonHandle &button)
const;
167 INLINE
string get_release_event(
const ButtonHandle &button)
const;
168 INLINE
string get_keystroke_event()
const;
170 INLINE
LMatrix4 get_frame_inv_xform()
const;
173 void set_sound(
const string &event,
AudioSound *sound);
174 void clear_sound(
const string &event);
175 AudioSound *get_sound(
const string &event)
const;
176 bool has_sound(
const string &event)
const;
180 INLINE
static void set_text_node(
TextNode *node);
182 INLINE
static PGItem *get_focus_item();
185 void play_sound(
const string &event);
188 void reduce_region(
LVecBase4 &frame, PN_stdfloat px, PN_stdfloat py)
const;
192 virtual void frame_changed();
195 void slot_state_def(
int state);
196 void update_frame(
int state);
197 void mark_frames_stale();
199 INLINE
static PN_stdfloat compute_area(
const LVecBase4 &frame);
200 INLINE
static void compare_largest(
const LVecBase4 *&largest,
201 PN_stdfloat &largest_area,
205 bool clip_frame(ClipPoints &source_points,
const LPlane &plane)
const;
219 F_background_focus = 0x04,
236 StateDefs _state_defs;
244 static PGItem *_focus_item;
247 static BackgroundFocus _background_focus;
253 static void init_type() {
254 PandaNode::init_type();
255 register_type(_type_handle,
"PGItem",
256 PandaNode::get_class_type());
259 return get_class_type();
261 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
The "top" node of the new Panda GUI system.
A basic node of the scene graph or data graph.
This is our own Panda specialization on the default STL map.
This is the base class for all the various kinds of gui widget objects.
A lightweight reentrant mutex.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This functions similarly to a LightAttrib.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
virtual void r_prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state, GeomTransformer &transformer, Thread *current_thread)
The recursive implementation of prepare_scene().
This is our own Panda specialization on the default STL vector.
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
virtual void xform(const LMatrix4 &mat)
Transforms the contents of this PandaNode by the indicated matrix, if it means anything to do so...
This is a 4-by-4 transform matrix.
void set_state(const RenderState *state, Thread *current_thread=Thread::get_current_thread())
Sets the complete RenderState that will be applied to all nodes at this level and below...
This is a specialization on MouseWatcherRegion, to add a bit more fields that are relevant to the PG ...
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
This is the base class for all three-component vectors and points.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
A thread; that is, a lightweight process.
The primary interface to this module.
This restricts rendering to within a rectangular region of the scene, without otherwise affecting the...
Objects that inherit from this class can receive specialized messages when PGItems change in certain ...
This is a two-component point in space.
TypeHandle is the identifier used to differentiate C++ class types.
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...