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

otk::AppWidget Class Reference

#include <appwidget.hh>

Inheritance diagram for otk::AppWidget:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 AppWidget (Application *app, Direction direction=Horizontal, Cursor cursor=0, int bevel_width=1)
virtual ~AppWidget ()
virtual void setStyle (RenderStyle *style)
virtual void show (void)
virtual void hide (void)
virtual void clientMessageHandler (const XClientMessageEvent &e)
 Called when a client calls XSendEvent.


Private Attributes

Application_application

Constructor & Destructor Documentation

otk::AppWidget::AppWidget Application   app,
Direction    direction = Horizontal,
Cursor    cursor = 0,
int    bevel_width = 1
 

Definition at line 17 of file appwidget.cc.

References setStyle(), and otk::Widget::window().

00019   : Widget(app, app->getStyle(), direction, cursor, bevel_width),
00020     _application(app)
00021 {
00022   assert(app);
00023 
00024   // set WM Protocols on the window
00025   Atom protocols[2];
00026   protocols[0] = Property::atoms.wm_protocols;
00027   protocols[1] = Property::atoms.wm_delete_window;
00028   XSetWMProtocols(**display, window(), protocols, 2);
00029 
00030   setStyle(_style);
00031 }

otk::AppWidget::~AppWidget   [virtual]
 

Definition at line 33 of file appwidget.cc.

00034 {
00035 }


Member Function Documentation

void otk::AppWidget::clientMessageHandler const XClientMessageEvent &    e [virtual]
 

Called when a client calls XSendEvent.

Some types of client messages are filtered out and sent to more specific event handler functions.

Reimplemented from otk::EventHandler.

Definition at line 58 of file appwidget.cc.

References hide().

00059 {
00060   EventHandler::clientMessageHandler(e);
00061   if (e.message_type == Property::atoms.wm_protocols &&
00062       static_cast<Atom>(e.data.l[0]) == Property::atoms.wm_delete_window)
00063     hide();
00064 }

void otk::AppWidget::hide void    [virtual]
 

Definition at line 51 of file appwidget.cc.

References _application, and otk::Application::_appwidget_count.

Referenced by clientMessageHandler().

00052 {
00053   Widget::hide();
00054 
00055   _application->_appwidget_count--;
00056 }

void otk::AppWidget::setStyle RenderStyle   style [virtual]
 

Reimplemented from otk::Widget.

Definition at line 37 of file appwidget.cc.

References otk::Widget::setTexture(), and otk::RenderStyle::titlebarUnfocusBackground().

Referenced by AppWidget().

00038 {
00039   Widget::setStyle(style);
00040 
00041   setTexture(style->titlebarUnfocusBackground());
00042 }

void otk::AppWidget::show void    [virtual]
 

Definition at line 44 of file appwidget.cc.

References _application, and otk::Application::_appwidget_count.

Referenced by main().

00045 {
00046   Widget::show(true);
00047 
00048   _application->_appwidget_count++;
00049 }


Member Data Documentation

Application* otk::AppWidget::_application [private]
 

Definition at line 27 of file appwidget.hh.

Referenced by hide(), and show().


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