Main Page   Class Hierarchy   Compound List   File List   Compound Members  

GfxWindow Class Reference

Interface for window creation and messages. More...

#include <freecloth/gfx/gfxWindow.h>

Inheritance diagram for GfxWindow:

Inheritance graph
[legend]
Collaboration diagram for GfxWindow:

Collaboration graph
[legend]
List of all members.

Public Types

typedef UInt32 ModBitfield
enum  KeyID {
  KB_NONE = 0, KB_BACKSPACE = 0x08, KB_TAB = '\t', KB_RETURN = '\n',
  KB_ENTER = KB_RETURN, KB_ESCAPE = 0x1B, KB_SPACE = ' ', KB_LEFT,
  KB_RIGHT, KB_UP, KB_DOWN, KB_0 = '0',
  KB_1 = '1', KB_2 = '2', KB_3 = '3', KB_4 = '4',
  KB_5 = '5', KB_6 = '6', KB_7 = '7', KB_8 = '8',
  KB_9 = '9', KB_A = 'A', KB_B = 'B', KB_C = 'C',
  KB_D = 'D', KB_E = 'E', KB_F = 'F', KB_G = 'G',
  KB_H = 'H', KB_I = 'I', KB_J = 'J', KB_K = 'K',
  KB_L = 'L', KB_M = 'M', KB_N = 'N', KB_O = 'O',
  KB_P = 'P', KB_Q = 'Q', KB_R = 'R', KB_S = 'S',
  KB_T = 'T', KB_U = 'U', KB_V = 'V', KB_W = 'W',
  KB_X = 'X', KB_Y = 'Y', KB_Z = 'Z'
}
 Key definitions.

enum  { KBM_ALT = 0x01, KBM_CONTROL = 0x02, KBM_SHIFT = 0x04 }
 Modifiers, combined in a bitfield.

enum  ButtonID { MBN_NONE = 0, MBN_LEFT, MBN_RIGHT, MBN_MIDDLE }

Public Member Functions

 GfxWindow ()
 Constructor.

virtual ~GfxWindow ()
 Destructor.

virtual UInt32 getWidth () const=0
virtual UInt32 getHeight () const=0
Float getAspectRatio () const
virtual void close ()=0
virtual void addObserver (GfxWindowObserver &)
virtual void removeObserver (GfxWindowObserver &)

Static Public Member Functions

void addStaticObserver (GfxWindowObserver &)
void removeStaticObserver (GfxWindowObserver &)

Protected Member Functions

void closeReceived ()
 Just prior to closing the window. Not sent to static observers.

void displayReceived ()
 Redraw requested...

void idleReceived ()
void keyPressed (KeyID, ModBitfield)
void keyDownReceived (KeyID, ModBitfield)
void keyUpReceived (KeyID, ModBitfield)
void mouseDownReceived (UInt32 x, UInt32 y, ButtonID)
void mouseUpReceived (UInt32 x, UInt32 y, ButtonID)
void mouseMoveReceived (UInt32 x, UInt32 y)
void windowResized (UInt32 x, UInt32 y, UInt32 width, UInt32 height)
void uiReceived (UInt32 uid)

Private Types

typedef std::list< GfxWindowObserver * > ObserverList

Private Member Functions

ObserverIterator allObserversBegin ()
ObserverIterator allObserversEnd ()
 GfxWindow (GfxWindow const &)
 Prohibited.

GfxWindow & operator= (GfxWindow const &)
 Prohibited.


Private Attributes

ObserverList _observers

Static Private Attributes

ObserverList _staticObservers

Friends

class ObserverIterator

Detailed Description

Interface for window creation and messages.

Definition at line 45 of file gfxWindow.h.


Member Typedef Documentation

typedef UInt32 GfxWindow::ModBitfield
 

Modifier bitfield. (Not the same as the enum since it can contain arbitrary combinations of the above enum entries.)

Definition at line 101 of file gfxWindow.h.


Member Enumeration Documentation

enum GfxWindow::ButtonID
 

Mouse button ids Sadly, MB_ prefix conflicts with Win32 constants

Definition at line 92 of file gfxWindow.h.


Member Function Documentation

void GfxWindow::addObserver GfxWindowObserver   [virtual]
 

Add an observer. The observer must live longer than window.

Definition at line 172 of file gfxWindow.cpp.

void GfxWindow::addStaticObserver GfxWindowObserver   [static]
 

Add a static observer. The observer must live longer than window.

Definition at line 158 of file gfxWindow.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Apr 23 15:58:59 2003 for Freecloth by doxygen1.3-rc3