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

Teddy::PhysicalComponents::WindowManager Class Reference

Window Manager. More...

#include <WindowManager.h>

Inheritance diagram for Teddy::PhysicalComponents::WindowManager:

Inheritance graph
[legend]
Collaboration diagram for Teddy::PhysicalComponents::WindowManager:

Collaboration graph
[legend]
List of all members.

Public Methods

 WindowManager (View *view)
 Constructor. More...

virtual ~WindowManager ()
 Destructor. More...

void inputLoop ()
 Never returning input loop forwarding host system messages to application. More...

void mouseKey (const int button, const int state, const int x, const int y)
 MouseListener interface. More...

void mouseMotion (const int x, const int y, const int dx, const int dy)
void insert (Layer *layer)
 Insert Layer to View. More...

void setFocus (EventListener *focus)
 Set focus. More...

void setHold (bool apply)
bool getHold () const
void showCursor ()
 Show mouse cursor. More...

void hideCursor ()
 Hide mouse cursor. More...

void draw ()
 Draw layers. More...

void update ()
 Update all windows, after view resize etc. More...

View * getView ()
 Return View. More...


Protected Attributes

View * view
 Graphics View. More...

EventListenerfocus
 Currently active Focus Area. More...

Texture * cursor
 Mouse cursor. More...

SDL_Joystick * joystick
 SDL Joystick. More...

list< Layer * > layers
 Drawable Areas. More...

list< Area * > focus_stack
 Focus stack. More...

bool show_cursor
 Show mouse cursor? More...

bool hold
 Hold cursor still. More...

int mouse_b [4]
 Current mouse button states. More...

IntVector2 hold_pos
 Cursor hold coordinates. More...

IntVector2 mouse_pos
 Cursor coordinates (mouse). More...


Detailed Description

Window Manager.

Bug:
Fix mouse cursor position when focus returns to sdl application

WindowManager encapsulates window management such as positioning and depth ordering of windows in customizable way.

Definition at line 61 of file WindowManager.h.


Constructor & Destructor Documentation

Teddy::PhysicalComponents::WindowManager::WindowManager View *    view
 

Constructor.

Definition at line 43 of file WindowManager.cpp.

References cursor, Teddy::SysSupport::dmsg, Teddy::SysSupport::emsg, focus, hold, hold_pos, joystick, Teddy::SysSupport::M_INIT, Teddy::SysSupport::M_WME, mouse_b, mouse_pos, show_cursor, and view.

Teddy::PhysicalComponents::WindowManager::~WindowManager   [virtual]
 

Destructor.

Definition at line 122 of file WindowManager.cpp.

References joystick.


Member Function Documentation

void Teddy::PhysicalComponents::WindowManager::draw  
 

Draw layers.

Definition at line 404 of file WindowManager.cpp.

References C_WHITE, cursor, layers, mouse_pos, show_cursor, and view.

Referenced by Teddy::Graphics::View::display, and Teddy::Graphics::View::displayPs.

bool Teddy::PhysicalComponents::WindowManager::getHold   const
 

Definition at line 460 of file WindowManager.cpp.

References hold.

View * Teddy::PhysicalComponents::WindowManager::getView  
 

Return View.

Definition at line 480 of file WindowManager.cpp.

References view.

void Teddy::PhysicalComponents::WindowManager::hideCursor  
 

Hide mouse cursor.

Definition at line 394 of file WindowManager.cpp.

References show_cursor.

void Teddy::PhysicalComponents::WindowManager::inputLoop  
 

Never returning input loop forwarding host system messages to application.

Definition at line 133 of file WindowManager.cpp.

References Teddy::SysSupport::dmsg, Teddy::PhysicalComponents::EventListener::event, Teddy::SysSupport::fmsg, focus, Teddy::SysSupport::M_WME, mouseKey, mouseMotion, and view.

void Teddy::PhysicalComponents::WindowManager::insert Layer   layer
 

Insert Layer to View.

Definition at line 378 of file WindowManager.cpp.

References layers.

void Teddy::PhysicalComponents::WindowManager::mouseKey const int    button,
const int    state,
const int    x,
const int    y
 

MouseListener interface.

Definition at line 228 of file WindowManager.cpp.

References Teddy::SysSupport::dmsg, Teddy::PhysicalComponents::EventListener::EventListener, focus, hold_pos, layers, Teddy::SysSupport::M_WME, mouse_b, setFocus, and setHold.

Referenced by inputLoop.

void Teddy::PhysicalComponents::WindowManager::mouseMotion const int    x,
const int    y,
const int    dx,
const int    dy
 

Definition at line 317 of file WindowManager.cpp.

References Teddy::SysSupport::dmsg, focus, hold, hold_pos, IntVector2, Teddy::SysSupport::M_WME, mouse_b, and mouse_pos.

Referenced by inputLoop.

void Teddy::PhysicalComponents::WindowManager::setFocus EventListener   focus
 

Set focus.

Definition at line 466 of file WindowManager.cpp.

References focus.

Referenced by mouseKey.

void Teddy::PhysicalComponents::WindowManager::setHold bool    apply
 

Definition at line 437 of file WindowManager.cpp.

References cursor, Teddy::SysSupport::dmsg, hold, hold_pos, Teddy::SysSupport::M_WME, and mouse_pos.

Referenced by mouseKey.

void Teddy::PhysicalComponents::WindowManager::showCursor  
 

Show mouse cursor.

Definition at line 384 of file WindowManager.cpp.

References show_cursor.

void Teddy::PhysicalComponents::WindowManager::update  
 

Update all windows, after view resize etc.

Definition at line 427 of file WindowManager.cpp.

References layers, and view.

Referenced by Teddy::Graphics::View::reshape.


Member Data Documentation

Texture* Teddy::PhysicalComponents::WindowManager::cursor [protected]
 

Mouse cursor.

Definition at line 82 of file WindowManager.h.

Referenced by draw, setHold, and WindowManager.

EventListener* Teddy::PhysicalComponents::WindowManager::focus [protected]
 

Currently active Focus Area.

Definition at line 81 of file WindowManager.h.

Referenced by inputLoop, mouseKey, mouseMotion, setFocus, and WindowManager.

list<Area*> Teddy::PhysicalComponents::WindowManager::focus_stack [protected]
 

Focus stack.

Definition at line 85 of file WindowManager.h.

bool Teddy::PhysicalComponents::WindowManager::hold [protected]
 

Hold cursor still.

Definition at line 87 of file WindowManager.h.

Referenced by getHold, mouseMotion, setHold, and WindowManager.

IntVector2 Teddy::PhysicalComponents::WindowManager::hold_pos [protected]
 

Cursor hold coordinates.

Definition at line 89 of file WindowManager.h.

Referenced by mouseKey, mouseMotion, setHold, and WindowManager.

SDL_Joystick* Teddy::PhysicalComponents::WindowManager::joystick [protected]
 

SDL Joystick.

Definition at line 83 of file WindowManager.h.

Referenced by WindowManager, and ~WindowManager.

list<Layer*> Teddy::PhysicalComponents::WindowManager::layers [protected]
 

Drawable Areas.

Definition at line 84 of file WindowManager.h.

Referenced by draw, insert, mouseKey, and update.

int Teddy::PhysicalComponents::WindowManager::mouse_b[4] [protected]
 

Current mouse button states.

Definition at line 88 of file WindowManager.h.

Referenced by mouseKey, mouseMotion, and WindowManager.

IntVector2 Teddy::PhysicalComponents::WindowManager::mouse_pos [protected]
 

Cursor coordinates (mouse).

Definition at line 90 of file WindowManager.h.

Referenced by draw, mouseMotion, setHold, and WindowManager.

bool Teddy::PhysicalComponents::WindowManager::show_cursor [protected]
 

Show mouse cursor?

Definition at line 86 of file WindowManager.h.

Referenced by draw, hideCursor, showCursor, and WindowManager.

View* Teddy::PhysicalComponents::WindowManager::view [protected]
 

Graphics View.

Definition at line 80 of file WindowManager.h.

Referenced by draw, getView, inputLoop, update, and WindowManager.


The documentation for this class was generated from the following files: