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

otk::Application Class Reference

#include <application.hh>

Inheritance diagram for otk::Application:

Inheritance graph
[legend]
Collaboration diagram for otk::Application:

Collaboration graph
[legend]
List of all members.

Public Methods

 Application (int argc, char **argv)
virtual ~Application ()
virtual void run (void)
void setDockable (bool dockable)
bool isDockable (void) const
RenderStylegetStyle (void) const

Private Methods

void loadStyle (void)

Private Attributes

Display _display
RenderStyle_style
bool _dockable
int _appwidget_count

Friends

class AppWidget

Constructor & Destructor Documentation

otk::Application::Application int    argc,
char **    argv
 

Definition at line 24 of file application.cc.

References _style, and loadStyle().

00025   : EventDispatcher(),
00026     _display(),
00027     _dockable(false),
00028     _appwidget_count(0)
00029 {
00030   (void)argc;
00031   (void)argv;
00032 
00033   Timer::initialize();
00034   RenderColor::initialize();
00035   Property::initialize();
00036   _style = new RenderStyle(DefaultScreen(*_display), ""); // XXX: get a path!
00037 
00038   loadStyle();
00039 }

otk::Application::~Application   [virtual]
 

Definition at line 41 of file application.cc.

References _style.

00042 {
00043   delete _style;
00044   RenderColor::destroy();
00045   Timer::destroy();
00046 }


Member Function Documentation

RenderStyle* otk::Application::getStyle void    const [inline]
 

Definition at line 26 of file application.hh.

References _style.

Referenced by main().

00026 { return _style; }

bool otk::Application::isDockable void    const [inline]
 

Definition at line 24 of file application.hh.

References _dockable.

00024 { return _dockable; }

void otk::Application::loadStyle void    [private]
 

Definition at line 48 of file application.cc.

Referenced by Application().

00049 {
00050   // XXX: find the style name as a property
00051   std::string style = "/usr/local/share/openbox/styles/artwiz";
00052   //_style->load(style);
00053 }

void otk::Application::run void    [virtual]
 

Definition at line 55 of file application.cc.

References _appwidget_count, and otk::EventDispatcher::dispatchEvents().

Referenced by main().

00056 {
00057   if (_appwidget_count <= 0) {
00058     std::cerr << "ERROR: No main widgets exist. You must create and show() " <<
00059       "an AppWidget for the Application before calling " <<
00060       "Application::run().\n";
00061     ::exit(1);
00062   }
00063 
00064   while (_appwidget_count > 0) {
00065     dispatchEvents();
00066     if (_appwidget_count <= 0)
00067       break;
00068     Timer::dispatchTimers(); // fire pending events
00069   }
00070 }

void otk::Application::setDockable bool    dockable [inline]
 

Definition at line 23 of file application.hh.

References _dockable.

00023 { _dockable = dockable; }


Friends And Related Function Documentation

friend class AppWidget [friend]
 

Definition at line 38 of file application.hh.


Member Data Documentation

int otk::Application::_appwidget_count [private]
 

Definition at line 36 of file application.hh.

Referenced by otk::AppWidget::hide(), run(), and otk::AppWidget::show().

Display otk::Application::_display [private]
 

Definition at line 32 of file application.hh.

bool otk::Application::_dockable [private]
 

Definition at line 34 of file application.hh.

Referenced by isDockable(), and setDockable().

RenderStyle* otk::Application::_style [private]
 

Definition at line 33 of file application.hh.

Referenced by Application(), getStyle(), and ~Application().


The documentation for this class was generated from the following files:
Generated on Tue Feb 4 23:00:22 2003 for Openbox by doxygen1.3-rc2