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

panda/src/tform/mouseWatcherParameter.h

Go to the documentation of this file.
00001 // Filename: mouseWatcherParameter.h
00002 // Created by:  drose (06Jul01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef MOUSEWATCHERPARAMETER_H
00020 #define MOUSEWATCHERPARAMETER_H
00021 
00022 #include "pandabase.h"
00023 
00024 #include "buttonHandle.h"
00025 #include "modifierButtons.h"
00026 #include "luse.h"
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //       Class : MouseWatcherParameter
00030 // Description : This is sent along as a parameter to most events
00031 //               generated for a region to indicate the mouse and
00032 //               button state for the event.
00033 ////////////////////////////////////////////////////////////////////
00034 class EXPCL_PANDA MouseWatcherParameter {
00035 public:
00036   INLINE MouseWatcherParameter();
00037   INLINE MouseWatcherParameter(const MouseWatcherParameter &other);
00038   INLINE void operator = (const MouseWatcherParameter &other);
00039   INLINE ~MouseWatcherParameter();
00040 
00041   INLINE void set_button(const ButtonHandle &button);
00042   INLINE void set_keycode(int keycode);
00043   INLINE void set_modifier_buttons(const ModifierButtons &mods);
00044   INLINE void set_mouse(const LPoint2f &mouse);
00045   INLINE void set_outside(bool flag);
00046 
00047 PUBLISHED:
00048   INLINE bool has_button() const;
00049   INLINE ButtonHandle get_button() const;
00050 
00051   INLINE bool has_keycode() const;
00052   INLINE int get_keycode() const;
00053 
00054   INLINE const ModifierButtons &get_modifier_buttons() const;
00055 
00056   INLINE bool has_mouse() const;
00057   INLINE const LPoint2f &get_mouse() const;
00058 
00059   INLINE bool is_outside() const;
00060 
00061   void output(ostream &out) const;
00062 
00063 public:
00064   ButtonHandle _button;
00065   short _keycode;
00066   ModifierButtons _mods;
00067   LPoint2f _mouse;
00068 
00069   enum Flags {
00070     F_has_button  = 0x001,
00071     F_has_mouse   = 0x002,
00072     F_is_outside  = 0x004,
00073     F_has_keycode = 0x008,
00074   };
00075   int _flags;
00076 };
00077 
00078 INLINE ostream &operator << (ostream &out, const MouseWatcherParameter &parm);
00079 
00080 #include "mouseWatcherParameter.I"
00081 
00082 #endif

Generated on Fri May 2 00:44:29 2003 for Panda by doxygen1.3