Main Page   Class Hierarchy   Compound List   File List   Compound Members  

gfxWindowObserver.h

00001 //////////////////////////////////////////////////////////////////////
00002 // Copyright (c) 2001-2002 David Pritchard <drpritch@alumni.uwaterloo.ca>
00003 // 
00004 // This program is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public License
00006 // as published by the Free Software Foundation; either
00007 // version 2 of the License, or (at your option) any later
00008 // version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU Lesser General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU Lesser General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019 #ifndef freecloth_gfx_gfxWindowObserver_h
00020 #define freecloth_gfx_gfxWindowObserver_h
00021 
00022 #ifndef freecloth_gfx_package_h
00023 #include <freecloth/gfx/package.h>
00024 #endif
00025 
00026 #ifndef freecloth_gfx_gfxWindow_h
00027 #include <freecloth/gfx/gfxWindow.h>
00028 #endif
00029 
00030 ////////////////////////////////////////////////////////////////////////////////
00031 // FORWARD DECLARATIONS
00032 
00033 ////////////////////////////////////////////////////////////////////////////////
00034 /*!
00035  * \class GfxWindowObserver freecloth/gfx/gfxWindowObserver.h
00036  * \brief Interface for classes that are interested in events coming from
00037  * a window.
00038  *
00039  * \pattern Observer
00040  */
00041 class GfxWindowObserver {
00042 
00043 public:
00044 
00045     //----- member functions -----
00046 
00047     virtual ~GfxWindowObserver();
00048 
00049     virtual void idleReceived();
00050 
00051     //! These two are only sent to actual observers, not static observers.
00052     //! An observer may only be removed during one of these two methods, our
00053     //! outside a *received call.
00054     virtual void destroyed( GfxWindow& );
00055     virtual void closeReceived( GfxWindow& );
00056 
00057     virtual void displayReceived( GfxWindow& );
00058     virtual void keyPressed(
00059         GfxWindow&,
00060         GfxWindow::KeyID,
00061         GfxWindow::ModBitfield
00062     );
00063     virtual void keyDownReceived(
00064         GfxWindow&,
00065         GfxWindow::KeyID,
00066         GfxWindow::ModBitfield
00067     );
00068     virtual void keyUpReceived(
00069         GfxWindow&,
00070         GfxWindow::KeyID,
00071         GfxWindow::ModBitfield
00072     );
00073     virtual void mouseDownReceived(
00074         GfxWindow&,
00075         UInt32 x,
00076         UInt32 y,
00077         GfxWindow::ButtonID
00078     );
00079     virtual void mouseUpReceived(
00080         GfxWindow&,
00081         UInt32 x,
00082         UInt32 y,
00083         GfxWindow::ButtonID
00084     );
00085     virtual void mouseMoveReceived(
00086         GfxWindow&,
00087         UInt32 x,
00088         UInt32 y
00089     );
00090     virtual void windowResized(
00091         GfxWindow&,
00092         UInt32 viewportX, UInt32 viewportY,
00093         UInt32 viewportWidth, UInt32 viewportHeight
00094     );
00095 
00096     //! GLUI user interface event.
00097     // FIXME: need a better way of defining events (e.g. double-dispatch),
00098     // so that GfxWindow and GfxGLWindowGLUI events don't need to be mixed up.
00099     virtual void uiReceived(
00100         GfxWindow&, UInt32 uid
00101     );
00102 
00103 };
00104 #endif

Generated on Wed Apr 23 15:58:52 2003 for Freecloth by doxygen1.3-rc3