Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

wftk::Application Class Reference

Toplevel application class. More...

#include <application.h>

List of all members.

Public Types

typedef std::map< std::string,
Debug::Mask
DebugMap

Public Member Functions

 Application (int &argc, char **&argv, const DebugMap &other_flags=DebugMap(), Uint32 update=50)
 Constructor.
 ~Application ()
 Default destructor.
int exec ()
 run mainloop
virtual void quit (int exitcode=0)
 Halt execution and close window.
SigC::Slot0< void > quitSlot (int exitcode=0)
 Return a slot which binds in the appropriate exit code.
void abort ()
 Halt execution and close window, bypassing quit handler.
bool running ()
 true during normal application processing
bool keepAlive ()
 handle all events
void waitFor (bool &var, bool wait_val=true)
 runs until var == wait_val
void waitFor (SigC::Slot0< bool > func, bool wait_val=true)
 runs until func returns wait_val
void handleEvent (bool can_block=false)
 handle the next event in the queue
void setIdleTime (Uint32 n)
 Set mainloop delay time.
void pushEvent (Event *event)
 Takes an Event which it deletes after handling.

Static Public Member Functions

Applicationinstance ()
 If Application::instance() is non-null, SDL is guaranteed to have been initialized.

Public Attributes

SigC::Signal0< void > update
 emitted after events are handled, but before drawing
SigC::Signal0< void > draw
 signal to tell RootWindow to draw, nothing else should connect to this
SigC::Signal0< void > destroyed
 emitted in destructor before SDL shutdown


Detailed Description

Toplevel application class.

Extend this class to create your application.


Member Function Documentation

Application* wftk::Application::instance  )  [inline, static]
 

If Application::instance() is non-null, SDL is guaranteed to have been initialized.

You still have to check particular subsystems with SDL_WasInit().

void wftk::Application::setIdleTime Uint32  n  )  [inline]
 

Set mainloop delay time.

Parameters:
n delay time in milliseconds
Set the maximum time to spend before querying SDL for events.


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

Generated Tue Oct 26 19:02:12 2004.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.