Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

MouseWatcher Class Reference

#include <mouseWatcher.h>

Inheritance diagram for MouseWatcher:

DataNode MouseWatcherGroup PandaNode ReferenceCount TypedWritable Namable BoundedObject ReferenceCount TypedObject List of all members.

Public Member Functions

virtual void output (ostream &out) const
virtual void write (ostream &out, int indent_level=0) const
bool add_group (MouseWatcherGroup *group)
bool remove_group (MouseWatcherGroup *group)
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()

Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Protected Types

typedef pvector< PT(MouseWatcherRegionVRegions )
typedef pvector< PT(MouseWatcherGroupGroups )

Protected Member Functions

void get_over_regions (VRegions &regions, const LPoint2f &pos) const
void set_current_regions (VRegions &regions)
void clear_current_regions ()
void throw_event_pattern (const string &pattern, const MouseWatcherRegion *region, const ButtonHandle &button)
void press (ButtonHandle button)
void release (ButtonHandle button)
void keystroke (int keycode)
void global_keyboard_press (const MouseWatcherParameter &param)
void global_keyboard_release (const MouseWatcherParameter &param)
INLINE void within_region (MouseWatcherRegion *region, const MouseWatcherParameter &param)
INLINE void without_region (MouseWatcherRegion *region, const MouseWatcherParameter &param)
void enter_region (MouseWatcherRegion *region, const MouseWatcherParameter &param)
void exit_region (MouseWatcherRegion *region, const MouseWatcherParameter &param)
 PT (MouseWatcherRegion) _preferred_region
 PT (MouseWatcherRegion) _preferred_button_down_region
 PT (PandaNode) _geometry
virtual void do_transmit_data (const DataNodeTransmit &input, DataNodeTransmit &output)

Static Protected Member Functions

MouseWatcherRegionget_preferred_region (const VRegions &regions)
void intersect_regions (MouseWatcher::VRegions &result, const MouseWatcher::VRegions &regions_a, const MouseWatcher::VRegions &regions_b)
void remove_region_from (MouseWatcher::VRegions &regions, MouseWatcherRegion *region)
void remove_regions_from (MouseWatcher::VRegions &regions, MouseWatcherGroup *group)

Protected Attributes

Groups _groups
bool _has_mouse
int _suppress_flags
LPoint2f _mouse
VRegions _current_regions
bool _button_down
bool _enter_multiple
bool _implicit_click
string _button_down_pattern
string _button_up_pattern
string _enter_pattern
string _leave_pattern
string _within_pattern
string _without_pattern
EventHandler_eh
ModifierButtons _mods

Private Member Functions

 ~MouseWatcher ()
bool remove_region (MouseWatcherRegion *region)
INLINE bool has_mouse () const
INLINE bool is_mouse_open () const
INLINE const LPoint2f & get_mouse () const
INLINE float get_mouse_x () const
INLINE float get_mouse_y () const
INLINE bool is_over_region () const
INLINE bool is_over_region (float x, float y) const
INLINE bool is_over_region (const LPoint2f &pos) const
INLINE MouseWatcherRegionget_over_region () const
INLINE MouseWatcherRegionget_over_region (float x, float y) const
MouseWatcherRegionget_over_region (const LPoint2f &pos) const
INLINE void set_button_down_pattern (const string &pattern)
INLINE const string & get_button_down_pattern () const
INLINE void set_button_up_pattern (const string &pattern)
INLINE const string & get_button_up_pattern () const
INLINE void set_enter_pattern (const string &pattern)
INLINE const string & get_enter_pattern () const
INLINE void set_leave_pattern (const string &pattern)
INLINE const string & get_leave_pattern () const
INLINE void set_within_pattern (const string &pattern)
INLINE const string & get_within_pattern () const
INLINE void set_without_pattern (const string &pattern)
INLINE const string & get_without_pattern () const
INLINE void set_geometry (PandaNode *node)
INLINE bool has_geometry () const
INLINE PandaNodeget_geometry () const
INLINE void clear_geometry ()
INLINE void set_extra_handler (EventHandler *eh)
INLINE EventHandlerget_extra_handler (void) const
INLINE void set_modifier_buttons (const ModifierButtons &mods)
INLINE ModifierButtons get_modifier_buttons () const
 PT (EventStoreVec2) _pixel_xy
 PT (EventStoreVec2) _xy
 PT (ButtonEventList) _button_events

Private Attributes

PUBLISHED __pad0__: MouseWatcher(const string &name = "")
int _pixel_xy_input
int _xy_input
int _button_events_input
int _pixel_xy_output
int _xy_output
int _button_events_output

Static Private Attributes

TypeHandle _type_handle

Member Typedef Documentation

typedef pvector< PT(MouseWatcherGroup) MouseWatcher::Groups) [protected]
 

Definition at line 146 of file mouseWatcher.h.

typedef pvector< PT(MouseWatcherRegion) MouseWatcher::VRegions) [protected]
 

Definition at line 114 of file mouseWatcher.h.

Referenced by do_transmit_data(), get_over_region(), intersect_regions(), and remove_regions_from().


Constructor & Destructor Documentation

MouseWatcher::~MouseWatcher  )  [private]
 

Definition at line 82 of file mouseWatcher.cxx.


Member Function Documentation

bool MouseWatcher::add_group MouseWatcherGroup group  ) 
 

Definition at line 187 of file mouseWatcher.cxx.

References _groups, and PT().

void MouseWatcher::clear_current_regions  )  [protected]
 

Definition at line 421 of file mouseWatcher.cxx.

References _current_regions, _leave_pattern, _mods, _mouse, MouseWatcherRegion::exit(), ButtonHandle::none(), NULL, param, and throw_event_pattern().

Referenced by do_transmit_data().

INLINE void MouseWatcher::clear_geometry  )  [private]
 

void MouseWatcher::do_transmit_data const DataNodeTransmit input,
DataNodeTransmit output
[protected, virtual]
 

Reimplemented from DataNode.

Definition at line 849 of file mouseWatcher.cxx.

References ButtonEvent::_button, _button_events_input, _button_events_output, _has_mouse, ButtonEvent::_keycode, _mods, _mouse, _pixel_xy_input, _pixel_xy_output, _suppress_flags, ButtonEvent::_type, _xy_input, _xy_output, ModifierButtons::add_event(), clear_current_regions(), DCAST_INTO_V, ButtonEventList::get_event(), ButtonEventList::get_num_events(), get_over_regions(), EventStoreValue< Type >::get_value(), input, MouseButton::is_mouse_button(), keystroke(), NULL, p, press(), release(), set_current_regions(), DataNodeTransmit::set_data(), MouseWatcherRegion::SF_any_button, MouseWatcherRegion::SF_mouse_button, MouseWatcherRegion::SF_mouse_position, MouseWatcherRegion::SF_other_button, ButtonEvent::T_down, ButtonEvent::T_keystroke, ButtonEvent::T_resume_down, ButtonEvent::T_up, and VRegions.

void MouseWatcher::enter_region MouseWatcherRegion region,
const MouseWatcherParameter param
[protected]
 

Definition at line 808 of file mouseWatcher.cxx.

References _enter_pattern, MouseWatcherRegion::enter(), ButtonHandle::none(), MouseButton::one(), param, MouseWatcherRegion::press(), MouseWatcherParameter::set_button(), and throw_event_pattern().

Referenced by set_current_regions().

void MouseWatcher::exit_region MouseWatcherRegion region,
const MouseWatcherParameter param
[protected]
 

Definition at line 825 of file mouseWatcher.cxx.

References _leave_pattern, MouseWatcherRegion::exit(), ButtonHandle::none(), MouseButton::one(), param, MouseWatcherRegion::release(), MouseWatcherParameter::set_button(), and throw_event_pattern().

Referenced by set_current_regions().

virtual TypeHandle MouseWatcher::force_init_type void   )  [inline, virtual]
 

Reimplemented from DataNode.

Definition at line 206 of file mouseWatcher.h.

References DataNode::get_class_type(), and DataNode::init_type().

INLINE const string& MouseWatcher::get_button_down_pattern  )  const [private]
 

INLINE const string& MouseWatcher::get_button_up_pattern  )  const [private]
 

TypeHandle MouseWatcher::get_class_type void   )  [inline, static]
 

Reimplemented from DataNode.

Definition at line 195 of file mouseWatcher.h.

INLINE const string& MouseWatcher::get_enter_pattern  )  const [private]
 

INLINE EventHandler* MouseWatcher::get_extra_handler void   )  const [private]
 

INLINE PandaNode* MouseWatcher::get_geometry  )  const [private]
 

INLINE const string& MouseWatcher::get_leave_pattern  )  const [private]
 

INLINE ModifierButtons MouseWatcher::get_modifier_buttons  )  const [private]
 

INLINE const LPoint2f& MouseWatcher::get_mouse  )  const [private]
 

INLINE float MouseWatcher::get_mouse_x  )  const [private]
 

INLINE float MouseWatcher::get_mouse_y  )  const [private]
 

MouseWatcherRegion * MouseWatcher::get_over_region const LPoint2f &  pos  )  const [private]
 

Definition at line 115 of file mouseWatcher.cxx.

References get_over_regions(), get_preferred_region(), and VRegions.

INLINE MouseWatcherRegion* MouseWatcher::get_over_region float  x,
float  y
const [private]
 

INLINE MouseWatcherRegion* MouseWatcher::get_over_region  )  const [private]
 

void MouseWatcher::get_over_regions VRegions regions,
const LPoint2f &  pos
const [protected]
 

Definition at line 244 of file mouseWatcher.cxx.

References _groups, MouseWatcherGroup::_regions, MouseWatcherRegion::get_active(), MouseWatcherRegion::get_frame(), and PandaNode::sort.

Referenced by do_transmit_data(), and get_over_region().

MouseWatcherRegion * MouseWatcher::get_preferred_region const VRegions regions  )  [static, protected]
 

Definition at line 293 of file mouseWatcher.cxx.

References NULL.

Referenced by get_over_region(), and set_current_regions().

virtual TypeHandle MouseWatcher::get_type void   )  const [inline, virtual]
 

Reimplemented from DataNode.

Definition at line 203 of file mouseWatcher.h.

References DataNode::get_class_type().

INLINE const string& MouseWatcher::get_within_pattern  )  const [private]
 

INLINE const string& MouseWatcher::get_without_pattern  )  const [private]
 

void MouseWatcher::global_keyboard_press const MouseWatcherParameter param  )  [protected]
 

Definition at line 746 of file mouseWatcher.cxx.

References _groups, MouseWatcherGroup::_regions, MouseWatcherRegion::get_keyboard(), param, and MouseWatcherRegion::press().

Referenced by press().

void MouseWatcher::global_keyboard_release const MouseWatcherParameter param  )  [protected]
 

Definition at line 777 of file mouseWatcher.cxx.

References _groups, MouseWatcherGroup::_regions, MouseWatcherRegion::get_keyboard(), param, and MouseWatcherRegion::release().

Referenced by release().

INLINE bool MouseWatcher::has_geometry  )  const [private]
 

INLINE bool MouseWatcher::has_mouse  )  const [private]
 

void MouseWatcher::init_type void   )  [inline, static]
 

Reimplemented from DataNode.

Definition at line 198 of file mouseWatcher.h.

References DataNode::get_class_type(), DataNode::init_type(), and register_type().

Referenced by ConfigureFn().

void MouseWatcher::intersect_regions MouseWatcher::VRegions result,
const MouseWatcher::VRegions regions_a,
const MouseWatcher::VRegions regions_b
[static, protected]
 

Definition at line 457 of file mouseWatcher.cxx.

References VRegions.

INLINE bool MouseWatcher::is_mouse_open  )  const [private]
 

INLINE bool MouseWatcher::is_over_region const LPoint2f &  pos  )  const [private]
 

INLINE bool MouseWatcher::is_over_region float  x,
float  y
const [private]
 

INLINE bool MouseWatcher::is_over_region  )  const [private]
 

void MouseWatcher::keystroke int  keycode  )  [protected]
 

Definition at line 701 of file mouseWatcher.cxx.

References _groups, _mods, _mouse, MouseWatcherGroup::_regions, MouseWatcherRegion::get_keyboard(), MouseWatcherRegion::keystroke(), and param.

Referenced by do_transmit_data().

void MouseWatcher::output ostream &  out  )  const [virtual]
 

Reimplemented from PandaNode.

Definition at line 128 of file mouseWatcher.cxx.

References _groups, MouseWatcherGroup::_regions, count, and PandaNode::output().

void MouseWatcher::press ButtonHandle  button  )  [protected]
 

Definition at line 610 of file mouseWatcher.cxx.

References _button_down, _button_down_pattern, _mods, _mouse, _suppress_flags, global_keyboard_press(), MouseButton::is_mouse_button(), NULL, param, MouseWatcherRegion::SF_other_button, and throw_event_pattern().

Referenced by do_transmit_data().

MouseWatcher::PT ButtonEventList   )  [private]
 

MouseWatcher::PT EventStoreVec2   )  [private]
 

MouseWatcher::PT EventStoreVec2   )  [private]
 

MouseWatcher::PT PandaNode   )  [protected]
 

MouseWatcher::PT MouseWatcherRegion   )  [protected]
 

MouseWatcher::PT MouseWatcherRegion   )  [protected]
 

Referenced by add_group(), remove_group(), and remove_region_from().

void MouseWatcher::release ButtonHandle  button  )  [protected]
 

Definition at line 658 of file mouseWatcher.cxx.

References _button_down, _button_up_pattern, _mods, _mouse, global_keyboard_release(), MouseButton::is_mouse_button(), NULL, param, and throw_event_pattern().

Referenced by do_transmit_data().

bool MouseWatcher::remove_group MouseWatcherGroup group  ) 
 

Definition at line 213 of file mouseWatcher.cxx.

References _current_regions, _groups, MouseWatcherGroup::has_region(), NULL, PT(), and remove_regions_from().

bool MouseWatcher::remove_region MouseWatcherRegion region  )  [private]
 

Reimplemented from MouseWatcherGroup.

Definition at line 93 of file mouseWatcher.cxx.

References _current_regions, NULL, MouseWatcherGroup::remove_region(), and remove_region_from().

void MouseWatcher::remove_region_from MouseWatcher::VRegions regions,
MouseWatcherRegion region
[static, protected]
 

Definition at line 497 of file mouseWatcher.cxx.

References PT().

Referenced by remove_region().

void MouseWatcher::remove_regions_from MouseWatcher::VRegions regions,
MouseWatcherGroup group
[static, protected]
 

Definition at line 515 of file mouseWatcher.cxx.

References MouseWatcherGroup::_regions, and VRegions.

Referenced by remove_group().

INLINE void MouseWatcher::set_button_down_pattern const string &  pattern  )  [private]
 

INLINE void MouseWatcher::set_button_up_pattern const string &  pattern  )  [private]
 

void MouseWatcher::set_current_regions VRegions regions  )  [protected]
 

Definition at line 324 of file mouseWatcher.cxx.

References _button_down, _current_regions, _enter_multiple, _mods, _mouse, enter_region(), exit_region(), get_preferred_region(), NULL, param, within_region(), and without_region().

Referenced by do_transmit_data().

INLINE void MouseWatcher::set_enter_pattern const string &  pattern  )  [private]
 

INLINE void MouseWatcher::set_extra_handler EventHandler eh  )  [private]
 

INLINE void MouseWatcher::set_geometry PandaNode node  )  [private]
 

INLINE void MouseWatcher::set_leave_pattern const string &  pattern  )  [private]
 

INLINE void MouseWatcher::set_modifier_buttons const ModifierButtons mods  )  [private]
 

INLINE void MouseWatcher::set_within_pattern const string &  pattern  )  [private]
 

INLINE void MouseWatcher::set_without_pattern const string &  pattern  )  [private]
 

void MouseWatcher::throw_event_pattern const string &  pattern,
const MouseWatcherRegion region,
const ButtonHandle button
[protected]
 

Definition at line 552 of file mouseWatcher.cxx.

References _eh, _mods, ModifierButtons::get_prefix(), ModifierButtons::has_button(), ButtonHandle::none(), NULL, p, ReferenceCount::test_ref_count_integrity(), throw_event(), and throw_event_directly().

Referenced by clear_current_regions(), enter_region(), exit_region(), press(), and release().

INLINE void MouseWatcher::within_region MouseWatcherRegion region,
const MouseWatcherParameter param
[protected]
 

Referenced by set_current_regions().

INLINE void MouseWatcher::without_region MouseWatcherRegion region,
const MouseWatcherParameter param
[protected]
 

Referenced by set_current_regions().

void MouseWatcher::write ostream &  out,
int  indent_level = 0
const [virtual]
 

Reimplemented from PandaNode.

Definition at line 147 of file mouseWatcher.cxx.

References _groups, MouseWatcherGroup::_regions, Namable::get_name(), indent(), and MouseWatcherRegion::write().


Member Data Documentation

PUBLISHED MouseWatcher::__pad0__ [private]
 

Reimplemented from DataNode.

Definition at line 58 of file mouseWatcher.h.

bool MouseWatcher::_button_down [protected]
 

Definition at line 156 of file mouseWatcher.h.

Referenced by press(), release(), and set_current_regions().

string MouseWatcher::_button_down_pattern [protected]
 

Definition at line 161 of file mouseWatcher.h.

Referenced by press().

int MouseWatcher::_button_events_input [private]
 

Definition at line 183 of file mouseWatcher.h.

Referenced by do_transmit_data().

int MouseWatcher::_button_events_output [private]
 

Definition at line 188 of file mouseWatcher.h.

Referenced by do_transmit_data().

string MouseWatcher::_button_up_pattern [protected]
 

Definition at line 162 of file mouseWatcher.h.

Referenced by release().

VRegions MouseWatcher::_current_regions [protected]
 

Definition at line 153 of file mouseWatcher.h.

Referenced by clear_current_regions(), remove_group(), remove_region(), and set_current_regions().

EventHandler* MouseWatcher::_eh [protected]
 

Definition at line 170 of file mouseWatcher.h.

Referenced by throw_event_pattern().

bool MouseWatcher::_enter_multiple [protected]
 

Definition at line 158 of file mouseWatcher.h.

Referenced by set_current_regions().

string MouseWatcher::_enter_pattern [protected]
 

Definition at line 163 of file mouseWatcher.h.

Referenced by enter_region().

Groups MouseWatcher::_groups [protected]
 

Definition at line 147 of file mouseWatcher.h.

Referenced by add_group(), get_over_regions(), global_keyboard_press(), global_keyboard_release(), keystroke(), output(), remove_group(), and write().

bool MouseWatcher::_has_mouse [protected]
 

Definition at line 149 of file mouseWatcher.h.

Referenced by do_transmit_data().

bool MouseWatcher::_implicit_click [protected]
 

Definition at line 159 of file mouseWatcher.h.

string MouseWatcher::_leave_pattern [protected]
 

Definition at line 164 of file mouseWatcher.h.

Referenced by clear_current_regions(), and exit_region().

ModifierButtons MouseWatcher::_mods [protected]
 

Definition at line 172 of file mouseWatcher.h.

Referenced by clear_current_regions(), do_transmit_data(), keystroke(), press(), release(), set_current_regions(), and throw_event_pattern().

LPoint2f MouseWatcher::_mouse [protected]
 

Definition at line 151 of file mouseWatcher.h.

Referenced by clear_current_regions(), do_transmit_data(), keystroke(), press(), release(), and set_current_regions().

int MouseWatcher::_pixel_xy_input [private]
 

Definition at line 181 of file mouseWatcher.h.

Referenced by do_transmit_data().

int MouseWatcher::_pixel_xy_output [private]
 

Definition at line 186 of file mouseWatcher.h.

Referenced by do_transmit_data().

int MouseWatcher::_suppress_flags [protected]
 

Definition at line 150 of file mouseWatcher.h.

Referenced by do_transmit_data(), and press().

TypeHandle MouseWatcher::_type_handle [static, private]
 

Reimplemented from DataNode.

Definition at line 34 of file mouseWatcher.cxx.

string MouseWatcher::_within_pattern [protected]
 

Definition at line 165 of file mouseWatcher.h.

string MouseWatcher::_without_pattern [protected]
 

Definition at line 166 of file mouseWatcher.h.

int MouseWatcher::_xy_input [private]
 

Definition at line 182 of file mouseWatcher.h.

Referenced by do_transmit_data().

int MouseWatcher::_xy_output [private]
 

Definition at line 187 of file mouseWatcher.h.

Referenced by do_transmit_data().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:12:46 2003 for Panda by doxygen1.3