14 #ifndef MOUSEWATCHER_H 15 #define MOUSEWATCHER_H 68 INLINE
bool has_mouse()
const;
69 INLINE
bool is_mouse_open()
const;
70 INLINE
const LPoint2 &get_mouse()
const;
71 INLINE PN_stdfloat get_mouse_x()
const;
72 INLINE PN_stdfloat get_mouse_y()
const;
74 INLINE
void set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
75 INLINE
void set_frame(
const LVecBase4 &frame);
76 INLINE
const LVecBase4 &get_frame()
const;
78 INLINE
bool is_over_region()
const;
79 INLINE
bool is_over_region(PN_stdfloat x, PN_stdfloat y)
const;
80 INLINE
bool is_over_region(
const LPoint2 &pos)
const;
88 INLINE
void set_button_down_pattern(
const std::string &pattern);
89 INLINE
const std::string &get_button_down_pattern()
const;
91 INLINE
void set_button_up_pattern(
const std::string &pattern);
92 INLINE
const std::string &get_button_up_pattern()
const;
94 INLINE
void set_button_repeat_pattern(
const std::string &pattern);
95 INLINE
const std::string &get_button_repeat_pattern()
const;
97 INLINE
void set_enter_pattern(
const std::string &pattern);
98 INLINE
const std::string &get_enter_pattern()
const;
100 INLINE
void set_leave_pattern(
const std::string &pattern);
101 INLINE
const std::string &get_leave_pattern()
const;
103 INLINE
void set_within_pattern(
const std::string &pattern);
104 INLINE
const std::string &get_within_pattern()
const;
106 INLINE
void set_without_pattern(
const std::string &pattern);
107 INLINE
const std::string &get_without_pattern()
const;
109 INLINE
void set_geometry(
PandaNode *node);
110 INLINE
bool has_geometry()
const;
112 INLINE
void clear_geometry();
121 INLINE
void clear_display_region();
123 INLINE
bool has_display_region()
const;
128 int get_num_groups()
const;
130 MAKE_SEQ(get_groups, get_num_groups, get_group);
132 INLINE
void set_inactivity_timeout(
double timeout);
133 INLINE
bool has_inactivity_timeout()
const;
134 INLINE
double get_inactivity_timeout()
const;
135 INLINE
void clear_inactivity_timeout();
137 INLINE
void set_inactivity_timeout_event(
const std::string &event);
138 INLINE
const std::string &get_inactivity_timeout_event()
const;
141 INLINE
size_t num_trail_recent()
const;
142 void set_trail_log_duration(
double duration);
144 void clear_trail_node();
145 INLINE
void clear_trail_log();
147 void note_activity();
150 virtual void output(std::ostream &out)
const;
151 virtual void write(std::ostream &out,
int indent_level = 0)
const;
154 void get_over_regions(
Regions ®ions,
const LPoint2 &pos)
const;
157 void set_current_regions(
Regions ®ions);
158 void clear_current_regions();
161 virtual void do_show_regions(
const NodePath &render2d,
162 const std::string &bin_name,
int draw_order);
163 virtual void do_hide_regions();
166 static void intersect_regions(
Regions &only_a,
171 static bool remove_region_from(
Regions ®ions,
173 static bool has_region_in(
const Regions ®ions,
176 void throw_event_pattern(
const std::string &pattern,
183 void keystroke(
int keycode);
184 void candidate(
const std::wstring &candidate,
size_t highlight_start,
185 size_t highlight_end,
size_t cursor_pos);
196 void set_mouse(
const LVecBase2 &xy,
const LVecBase2 &pixel_xy);
200 void discard_excess_trail_log();
201 void update_trail_node();
204 LVecBase2 &f, LVecBase2 &p,
214 int _internal_suppress;
215 int _external_suppress;
217 LPoint2 _mouse_pixel;
223 size_t _num_trail_recent;
224 double _trail_log_duration;
232 bool _enter_multiple;
233 bool _implicit_click;
235 std::string _button_down_pattern;
236 std::string _button_up_pattern;
237 std::string _button_repeat_pattern;
238 std::string _enter_pattern;
239 std::string _leave_pattern;
240 std::string _within_pattern;
241 std::string _without_pattern;
250 bool _has_inactivity_timeout;
251 double _inactivity_timeout;
252 std::string _inactivity_timeout_event;
253 double _last_activity;
255 enum InactivityState {
258 IS_active_to_inactive,
259 IS_inactive_to_active,
261 InactivityState _inactivity_state;
265 std::string _show_regions_bin_name;
266 int _show_regions_draw_order;
278 int _pixel_size_input;
280 int _button_events_input;
281 int _pointer_events_input;
284 int _pixel_xy_output;
285 int _pixel_size_output;
287 int _button_events_output;
298 static void init_type() {
299 DataNode::init_type();
301 DataNode::get_class_type());
304 return get_class_type();
306 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
This TFormer maintains a list of rectangular regions on the screen that are considered special mouse ...
A basic node of the scene graph or data graph.
The fundamental type of node for the data graph.
This represents a collection of MouseWatcherRegions that may be managed as a group.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A class to monitor events from the C++ side of things.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool remove_region(MouseWatcherRegion *region)
Removes the indicated region from the group.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Records a set of pointer events that happened recently.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A handy class object for storing simple values (like integers or strings) passed along with an Event ...
This is our own Panda specialization on the default STL vector.
A dynamic array with an unlimited number of bits.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the class that defines a rectangular region on the screen for the MouseWatcher.
This represents a collection of MouseWatcherRegions that may be managed as a group.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A thread; that is, a lightweight process.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A rectangular subregion within a window for rendering into.
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
A node that holds Geom objects, renderable pieces of geometry.
Encapsulates the data generated from (or sent into) any particular DataNode.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This object supervises the traversal of the data graph and the moving of data from one DataNode to it...