removing all prefixes completed

This commit is contained in:
Dana Jansens 2003-01-11 19:42:43 +00:00
parent f1b9e2168d
commit 77ab46d1e3
25 changed files with 2216 additions and 2483 deletions

View file

@ -17,9 +17,9 @@
namespace ob {
const int OBActions::BUTTONS;
const int Actions::BUTTONS;
OBActions::OBActions()
Actions::Actions()
: _button(0)
{
for (int i=0; i<BUTTONS; ++i)
@ -27,14 +27,14 @@ OBActions::OBActions()
}
OBActions::~OBActions()
Actions::~Actions()
{
for (int i=0; i<BUTTONS; ++i)
delete _posqueue[i];
}
void OBActions::insertPress(const XButtonEvent &e)
void Actions::insertPress(const XButtonEvent &e)
{
ButtonPressAction *a = _posqueue[BUTTONS - 1];
// rm'd the last one, shift them all down one
@ -45,11 +45,11 @@ void OBActions::insertPress(const XButtonEvent &e)
a->button = e.button;
a->pos.setPoint(e.x_root, e.y_root);
OBClient *c = Openbox::instance->findClient(e.window);
Client *c = Openbox::instance->findClient(e.window);
if (c) a->clientarea = c->area();
}
void OBActions::removePress(const XButtonEvent &e)
void Actions::removePress(const XButtonEvent &e)
{
int i;
ButtonPressAction *a = 0;
@ -66,13 +66,13 @@ void OBActions::removePress(const XButtonEvent &e)
_posqueue[BUTTONS-1]->button = 0;
}
void OBActions::buttonPressHandler(const XButtonEvent &e)
void Actions::buttonPressHandler(const XButtonEvent &e)
{
OtkEventHandler::buttonPressHandler(e);
otk::EventHandler::buttonPressHandler(e);
insertPress(e);
// run the PRESS python hook
OBWidget *w = dynamic_cast<OBWidget*>
WidgetBase *w = dynamic_cast<WidgetBase*>
(Openbox::instance->findHandler(e.window));
assert(w); // everything should be a widget
@ -80,11 +80,11 @@ void OBActions::buttonPressHandler(const XButtonEvent &e)
unsigned int state = e.state & (ControlMask | ShiftMask | Mod1Mask |
Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask);
int screen;
OBClient *c = Openbox::instance->findClient(e.window);
Client *c = Openbox::instance->findClient(e.window);
if (c)
screen = c->screen();
else
screen = otk::OBDisplay::findScreen(e.root)->screen();
screen = otk::Display::findScreen(e.root)->screen();
MouseData data(screen, c, e.time, state, e.button, w->mcontext(),
MousePress);
Openbox::instance->bindings()->fireButton(&data);
@ -106,12 +106,12 @@ void OBActions::buttonPressHandler(const XButtonEvent &e)
}
void OBActions::buttonReleaseHandler(const XButtonEvent &e)
void Actions::buttonReleaseHandler(const XButtonEvent &e)
{
OtkEventHandler::buttonReleaseHandler(e);
otk::EventHandler::buttonReleaseHandler(e);
removePress(e);
OBWidget *w = dynamic_cast<OBWidget*>
WidgetBase *w = dynamic_cast<WidgetBase*>
(Openbox::instance->findHandler(e.window));
assert(w); // everything should be a widget
@ -122,7 +122,7 @@ void OBActions::buttonReleaseHandler(const XButtonEvent &e)
// find the area of the window
XWindowAttributes attr;
if (!XGetWindowAttributes(otk::OBDisplay::display, e.window, &attr)) return;
if (!XGetWindowAttributes(otk::Display::display, e.window, &attr)) return;
// if not on the window any more, it isnt a CLICK
if (!(e.same_screen && e.x >= 0 && e.y >= 0 &&
@ -134,11 +134,11 @@ void OBActions::buttonReleaseHandler(const XButtonEvent &e)
unsigned int state = e.state & (ControlMask | ShiftMask | Mod1Mask |
Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask);
int screen;
OBClient *c = Openbox::instance->findClient(e.window);
Client *c = Openbox::instance->findClient(e.window);
if (c)
screen = c->screen();
else
screen = otk::OBDisplay::findScreen(e.root)->screen();
screen = otk::Display::findScreen(e.root)->screen();
MouseData data(screen, c, e.time, state, e.button, w->mcontext(),
MouseClick);
Openbox::instance->bindings()->fireButton(&data);
@ -169,54 +169,54 @@ void OBActions::buttonReleaseHandler(const XButtonEvent &e)
}
void OBActions::enterHandler(const XCrossingEvent &e)
void Actions::enterHandler(const XCrossingEvent &e)
{
OtkEventHandler::enterHandler(e);
otk::EventHandler::enterHandler(e);
// run the ENTER python hook
int screen;
OBClient *c = Openbox::instance->findClient(e.window);
Client *c = Openbox::instance->findClient(e.window);
if (c)
screen = c->screen();
else
screen = otk::OBDisplay::findScreen(e.root)->screen();
screen = otk::Display::findScreen(e.root)->screen();
EventData data(screen, c, EventEnterWindow, e.state);
Openbox::instance->bindings()->fireEvent(&data);
}
void OBActions::leaveHandler(const XCrossingEvent &e)
void Actions::leaveHandler(const XCrossingEvent &e)
{
OtkEventHandler::leaveHandler(e);
otk::EventHandler::leaveHandler(e);
// run the LEAVE python hook
int screen;
OBClient *c = Openbox::instance->findClient(e.window);
Client *c = Openbox::instance->findClient(e.window);
if (c)
screen = c->screen();
else
screen = otk::OBDisplay::findScreen(e.root)->screen();
screen = otk::Display::findScreen(e.root)->screen();
EventData data(screen, c, EventLeaveWindow, e.state);
Openbox::instance->bindings()->fireEvent(&data);
}
void OBActions::keyPressHandler(const XKeyEvent &e)
void Actions::keyPressHandler(const XKeyEvent &e)
{
OtkEventHandler::keyPressHandler(e);
otk::EventHandler::keyPressHandler(e);
// kill off the Button1Mask etc, only want the modifiers
unsigned int state = e.state & (ControlMask | ShiftMask | Mod1Mask |
Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask);
Openbox::instance->bindings()->
fireKey(otk::OBDisplay::findScreen(e.root)->screen(),
fireKey(otk::Display::findScreen(e.root)->screen(),
state, e.keycode, e.time);
}
void OBActions::motionHandler(const XMotionEvent &e)
void Actions::motionHandler(const XMotionEvent &e)
{
OtkEventHandler::motionHandler(e);
otk::EventHandler::motionHandler(e);
if (!e.same_screen) return; // this just gets stupid
@ -224,9 +224,9 @@ void OBActions::motionHandler(const XMotionEvent &e)
// compress changes to a window into a single change
XEvent ce;
while (XCheckTypedEvent(otk::OBDisplay::display, e.type, &ce)) {
while (XCheckTypedEvent(otk::Display::display, e.type, &ce)) {
if (ce.xmotion.window != e.window) {
XPutBackEvent(otk::OBDisplay::display, &ce);
XPutBackEvent(otk::Display::display, &ce);
break;
} else {
x_root = e.x_root;
@ -234,7 +234,7 @@ void OBActions::motionHandler(const XMotionEvent &e)
}
}
OBWidget *w = dynamic_cast<OBWidget*>
WidgetBase *w = dynamic_cast<WidgetBase*>
(Openbox::instance->findHandler(e.window));
assert(w); // everything should be a widget
@ -244,46 +244,46 @@ void OBActions::motionHandler(const XMotionEvent &e)
Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask);
unsigned int button = _posqueue[0]->button;
int screen;
OBClient *c = Openbox::instance->findClient(e.window);
Client *c = Openbox::instance->findClient(e.window);
if (c)
screen = c->screen();
else
screen = otk::OBDisplay::findScreen(e.root)->screen();
screen = otk::Display::findScreen(e.root)->screen();
MouseData data(screen, c, e.time, state, button, w->mcontext(), MouseMotion,
x_root, y_root, _posqueue[0]->pos, _posqueue[0]->clientarea);
Openbox::instance->bindings()->fireButton(&data);
}
void OBActions::mapRequestHandler(const XMapRequestEvent &e)
void Actions::mapRequestHandler(const XMapRequestEvent &e)
{
OtkEventHandler::mapRequestHandler(e);
// do this in OBScreen::manageWindow
otk::EventHandler::mapRequestHandler(e);
// do this in Screen::manageWindow
}
void OBActions::unmapHandler(const XUnmapEvent &e)
void Actions::unmapHandler(const XUnmapEvent &e)
{
OtkEventHandler::unmapHandler(e);
// do this in OBScreen::unmanageWindow
otk::EventHandler::unmapHandler(e);
// do this in Screen::unmanageWindow
}
void OBActions::destroyHandler(const XDestroyWindowEvent &e)
void Actions::destroyHandler(const XDestroyWindowEvent &e)
{
OtkEventHandler::destroyHandler(e);
// do this in OBScreen::unmanageWindow
otk::EventHandler::destroyHandler(e);
// do this in Screen::unmanageWindow
}
#ifdef XKB
void OBActions::xkbHandler(const XkbEvent &e)
void Actions::xkbHandler(const XkbEvent &e)
{
Window w;
int screen;
OtkEventHandler::xkbHandler(e);
otk::EventHandler::xkbHandler(e);
switch (((XkbAnyEvent*)&e)->xkb_type) {
case XkbBellNotify:
w = ((XkbBellNotifyEvent*)&e)->window;
OBClient *c = Openbox::instance->findClient(w);
Client *c = Openbox::instance->findClient(w);
if (c)
screen = c->screen();
else

View file

@ -25,7 +25,7 @@ namespace ob {
When these actions are fired, hooks to the guile engine are fired so that
guile code is run.
*/
class OBActions : public otk::OtkEventHandler {
class Actions : public otk::EventHandler {
public:
#ifndef SWIG // get rid of a swig warning
struct ButtonReleaseAction {
@ -61,10 +61,10 @@ private:
void removePress(const XButtonEvent &e);
public:
//! Constructs an OBActions object
OBActions();
//! Destroys the OBActions object
virtual ~OBActions();
//! Constructs an Actions object
Actions();
//! Destroys the Actions object
virtual ~Actions();
virtual void buttonPressHandler(const XButtonEvent &e);
virtual void buttonReleaseHandler(const XButtonEvent &e);

View file

@ -8,20 +8,20 @@
namespace ob {
OBBackgroundWidget::OBBackgroundWidget(otk::OtkWidget *parent,
OBWidget::WidgetType type)
: otk::OtkWidget(parent),
OBWidget(type)
BackgroundWidget::BackgroundWidget(otk::Widget *parent,
WidgetBase::WidgetType type)
: otk::Widget(parent),
WidgetBase(type)
{
}
OBBackgroundWidget::~OBBackgroundWidget()
BackgroundWidget::~BackgroundWidget()
{
}
void OBBackgroundWidget::setTextures()
void BackgroundWidget::setTextures()
{
switch (type()) {
case Type_Titlebar:
@ -48,9 +48,9 @@ void OBBackgroundWidget::setTextures()
}
void OBBackgroundWidget::setStyle(otk::Style *style)
void BackgroundWidget::setStyle(otk::Style *style)
{
OtkWidget::setStyle(style);
Widget::setStyle(style);
setTextures();
switch (type()) {
case Type_Titlebar:
@ -65,23 +65,23 @@ void OBBackgroundWidget::setStyle(otk::Style *style)
}
void OBBackgroundWidget::focus()
void BackgroundWidget::focus()
{
otk::OtkWidget::focus();
otk::Widget::focus();
setTextures();
}
void OBBackgroundWidget::unfocus()
void BackgroundWidget::unfocus()
{
otk::OtkWidget::unfocus();
otk::Widget::unfocus();
setTextures();
}
void OBBackgroundWidget::adjust()
void BackgroundWidget::adjust()
{
// nothing to adjust here. its done in OBFrame::adjustSize
// nothing to adjust here. its done in Frame::adjustSize
}
}

View file

@ -1,20 +1,20 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifndef __obbackgroundwidget_hh
#define __obbackgroundwidget_hh
#ifndef __backgroundwidget_hh
#define __backgroundwidget_hh
#include "otk/widget.hh"
#include "widgetbase.hh"
namespace ob {
class OBBackgroundWidget : public otk::OtkWidget, public OBWidget
class BackgroundWidget : public otk::Widget, public WidgetBase
{
private:
void setTextures();
public:
OBBackgroundWidget(otk::OtkWidget *parent, OBWidget::WidgetType type);
virtual ~OBBackgroundWidget();
BackgroundWidget(otk::Widget *parent, WidgetBase::WidgetType type);
virtual ~BackgroundWidget();
virtual void setStyle(otk::Style *style);
@ -26,4 +26,4 @@ public:
}
#endif // __obbackgroundwidget_hh
#endif // __backgroundwidget_hh

View file

@ -68,7 +68,7 @@ static bool modvalue(const std::string &mod, unsigned int *val)
return true;
}
bool OBBindings::translate(const std::string &str, Binding &b,bool askey) const
bool Bindings::translate(const std::string &str, Binding &b,bool askey) const
{
// parse out the base key name
std::string::size_type keybegin = str.find_last_of('-');
@ -98,7 +98,7 @@ bool OBBindings::translate(const std::string &str, Binding &b,bool askey) const
printf(_("Invalid Key name in key binding: %s\n"), key.c_str());
return false;
}
if (!(b.key = XKeysymToKeycode(otk::OBDisplay::display, sym)))
if (!(b.key = XKeysymToKeycode(otk::Display::display, sym)))
printf(_("No valid keycode for Key in key binding: %s\n"), key.c_str());
return b.key != 0;
} else {
@ -115,7 +115,7 @@ static void destroytree(KeyBindingTree *tree)
}
}
KeyBindingTree *OBBindings::buildtree(const StringVect &keylist,
KeyBindingTree *Bindings::buildtree(const StringVect &keylist,
PyObject *callback) const
{
if (keylist.empty()) return 0; // nothing in the list.. return 0
@ -142,11 +142,11 @@ KeyBindingTree *OBBindings::buildtree(const StringVect &keylist,
}
OBBindings::OBBindings()
Bindings::Bindings()
: _curpos(&_keytree),
_resetkey(0,0),
_timer(Openbox::instance->timerManager(),
(otk::OBTimeoutHandler)resetChains, this)
(otk::TimeoutHandler)resetChains, this)
{
_timer.setTimeout(5000); // chains reset after 5 seconds
@ -154,7 +154,7 @@ OBBindings::OBBindings()
}
OBBindings::~OBBindings()
Bindings::~Bindings()
{
grabKeys(false);
removeAllKeys();
@ -163,7 +163,7 @@ OBBindings::~OBBindings()
}
void OBBindings::assimilate(KeyBindingTree *node)
void Bindings::assimilate(KeyBindingTree *node)
{
KeyBindingTree *a, *b, *tmp, *last;
@ -195,7 +195,7 @@ void OBBindings::assimilate(KeyBindingTree *node)
}
KeyBindingTree *OBBindings::find(KeyBindingTree *search,
KeyBindingTree *Bindings::find(KeyBindingTree *search,
bool *conflict) const {
*conflict = false;
KeyBindingTree *a, *b;
@ -222,7 +222,7 @@ KeyBindingTree *OBBindings::find(KeyBindingTree *search,
}
bool OBBindings::addKey(const StringVect &keylist, PyObject *callback)
bool Bindings::addKey(const StringVect &keylist, PyObject *callback)
{
KeyBindingTree *tree, *t;
bool conflict;
@ -244,14 +244,14 @@ bool OBBindings::addKey(const StringVect &keylist, PyObject *callback)
destroytree(tree);
} else {
// grab the server here to make sure no key pressed go missed
otk::OBDisplay::grab();
otk::Display::grab();
grabKeys(false);
// assimilate this built tree into the main tree
assimilate(tree); // assimilation destroys/uses the tree
grabKeys(true);
otk::OBDisplay::ungrab();
otk::Display::ungrab();
}
Py_INCREF(callback);
@ -260,7 +260,7 @@ bool OBBindings::addKey(const StringVect &keylist, PyObject *callback)
}
bool OBBindings::removeKey(const StringVect &keylist, PyObject *callback)
bool Bindings::removeKey(const StringVect &keylist, PyObject *callback)
{
assert(false); // XXX: function not implemented yet
@ -277,7 +277,7 @@ bool OBBindings::removeKey(const StringVect &keylist, PyObject *callback)
callback);
if (it != t->callbacks.end()) {
// grab the server here to make sure no key pressed go missed
otk::OBDisplay::grab();
otk::Display::grab();
grabKeys(false);
_curpos = &_keytree;
@ -286,7 +286,7 @@ bool OBBindings::removeKey(const StringVect &keylist, PyObject *callback)
Py_XDECREF(*it);
grabKeys(true);
otk::OBDisplay::ungrab();
otk::Display::ungrab();
return true;
}
@ -295,17 +295,17 @@ bool OBBindings::removeKey(const StringVect &keylist, PyObject *callback)
}
void OBBindings::setResetKey(const std::string &key)
void Bindings::setResetKey(const std::string &key)
{
Binding b(0, 0);
if (translate(key, b)) {
// grab the server here to make sure no key pressed go missed
otk::OBDisplay::grab();
otk::Display::grab();
grabKeys(false);
_resetkey.key = b.key;
_resetkey.modifiers = b.modifiers;
grabKeys(true);
otk::OBDisplay::ungrab();
otk::Display::ungrab();
}
}
@ -328,7 +328,7 @@ static void remove_branch(KeyBindingTree *first)
}
void OBBindings::removeAllKeys()
void Bindings::removeAllKeys()
{
grabKeys(false);
if (_keytree.first_child) {
@ -339,37 +339,37 @@ void OBBindings::removeAllKeys()
}
void OBBindings::grabKeys(bool grab)
void Bindings::grabKeys(bool grab)
{
for (int i = 0; i < Openbox::instance->screenCount(); ++i) {
Window root = otk::OBDisplay::screenInfo(i)->rootWindow();
Window root = otk::Display::screenInfo(i)->rootWindow();
KeyBindingTree *p = _curpos->first_child;
while (p) {
if (grab) {
otk::OBDisplay::grabKey(p->binding.key, p->binding.modifiers,
otk::Display::grabKey(p->binding.key, p->binding.modifiers,
root, false, GrabModeAsync, GrabModeAsync,
false);
}
else
otk::OBDisplay::ungrabKey(p->binding.key, p->binding.modifiers,
otk::Display::ungrabKey(p->binding.key, p->binding.modifiers,
root);
p = p->next_sibling;
}
if (_resetkey.key)
if (grab)
otk::OBDisplay::grabKey(_resetkey.key, _resetkey.modifiers,
otk::Display::grabKey(_resetkey.key, _resetkey.modifiers,
root, false, GrabModeAsync, GrabModeAsync,
false);
else
otk::OBDisplay::ungrabKey(_resetkey.key, _resetkey.modifiers,
otk::Display::ungrabKey(_resetkey.key, _resetkey.modifiers,
root);
}
}
void OBBindings::fireKey(int screen, unsigned int modifiers, unsigned int key,
void Bindings::fireKey(int screen, unsigned int modifiers, unsigned int key,
Time time)
{
if (key == _resetkey.key && modifiers == _resetkey.modifiers) {
@ -381,13 +381,13 @@ void OBBindings::fireKey(int screen, unsigned int modifiers, unsigned int key,
if (p->chain) {
_timer.start(); // start/restart the timer
// grab the server here to make sure no key pressed go missed
otk::OBDisplay::grab();
otk::Display::grab();
grabKeys(false);
_curpos = p;
grabKeys(true);
otk::OBDisplay::ungrab();
otk::Display::ungrab();
} else {
OBClient *c = Openbox::instance->focusedClient();
Client *c = Openbox::instance->focusedClient();
KeyData data(screen, c, time, modifiers, key);
CallbackList::iterator it, end = p->callbacks.end();
for (it = p->callbacks.begin(); it != end; ++it)
@ -401,19 +401,19 @@ void OBBindings::fireKey(int screen, unsigned int modifiers, unsigned int key,
}
}
void OBBindings::resetChains(OBBindings *self)
void Bindings::resetChains(Bindings *self)
{
self->_timer.stop();
// grab the server here to make sure no key pressed go missed
otk::OBDisplay::grab();
otk::Display::grab();
self->grabKeys(false);
self->_curpos = &self->_keytree;
self->grabKeys(true);
otk::OBDisplay::ungrab();
otk::Display::ungrab();
}
bool OBBindings::addButton(const std::string &but, MouseContext context,
bool Bindings::addButton(const std::string &but, MouseContext context,
MouseAction action, PyObject *callback)
{
assert(context >= 0 && context < NUM_MOUSE_CONTEXT);
@ -441,8 +441,8 @@ bool OBBindings::addButton(const std::string &but, MouseContext context,
_buttons[context].push_back(bind);
// grab the button on all clients
for (int sn = 0; sn < Openbox::instance->screenCount(); ++sn) {
OBScreen *s = Openbox::instance->screen(sn);
OBClient::List::iterator c_it, c_end = s->clients.end();
Screen *s = Openbox::instance->screen(sn);
Client::List::iterator c_it, c_end = s->clients.end();
for (c_it = s->clients.begin(); c_it != c_end; ++c_it) {
grabButton(true, bind->binding, context, *c_it);
}
@ -454,7 +454,7 @@ bool OBBindings::addButton(const std::string &but, MouseContext context,
return true;
}
void OBBindings::removeAllButtons()
void Bindings::removeAllButtons()
{
for (int i = 0; i < NUM_MOUSE_CONTEXT; ++i) {
ButtonBindingList::iterator it, end = _buttons[i].end();
@ -467,8 +467,8 @@ void OBBindings::removeAllButtons()
}
// ungrab the button on all clients
for (int sn = 0; sn < Openbox::instance->screenCount(); ++sn) {
OBScreen *s = Openbox::instance->screen(sn);
OBClient::List::iterator c_it, c_end = s->clients.end();
Screen *s = Openbox::instance->screen(sn);
Client::List::iterator c_it, c_end = s->clients.end();
for (c_it = s->clients.begin(); c_it != c_end; ++c_it) {
grabButton(false, (*it)->binding, (MouseContext)i, *c_it);
}
@ -477,8 +477,8 @@ void OBBindings::removeAllButtons()
}
}
void OBBindings::grabButton(bool grab, const Binding &b, MouseContext context,
OBClient *client)
void Bindings::grabButton(bool grab, const Binding &b, MouseContext context,
Client *client)
{
Window win;
int mode = GrabModeAsync;
@ -500,13 +500,13 @@ void OBBindings::grabButton(bool grab, const Binding &b, MouseContext context,
return;
}
if (grab)
otk::OBDisplay::grabButton(b.key, b.modifiers, win, false, mask, mode,
otk::Display::grabButton(b.key, b.modifiers, win, false, mask, mode,
GrabModeAsync, None, None, false);
else
otk::OBDisplay::ungrabButton(b.key, b.modifiers, win);
otk::Display::ungrabButton(b.key, b.modifiers, win);
}
void OBBindings::grabButtons(bool grab, OBClient *client)
void Bindings::grabButtons(bool grab, Client *client)
{
for (int i = 0; i < NUM_MOUSE_CONTEXT; ++i) {
ButtonBindingList::iterator it, end = _buttons[i].end();
@ -515,11 +515,11 @@ void OBBindings::grabButtons(bool grab, OBClient *client)
}
}
void OBBindings::fireButton(MouseData *data)
void Bindings::fireButton(MouseData *data)
{
if (data->context == MC_Window) {
// Replay the event, so it goes to the client, and ungrab the device.
XAllowEvents(otk::OBDisplay::display, ReplayPointer, data->time);
XAllowEvents(otk::Display::display, ReplayPointer, data->time);
}
ButtonBindingList::iterator it, end = _buttons[data->context].end();
@ -534,14 +534,14 @@ void OBBindings::fireButton(MouseData *data)
}
bool OBBindings::addEvent(EventAction action, PyObject *callback)
bool Bindings::addEvent(EventAction action, PyObject *callback)
{
if (action < 0 || action >= NUM_EVENTS) {
return false;
}
#ifdef XKB
if (action == EventBell && _eventlist[action].empty())
XkbSelectEvents(otk::OBDisplay::display, XkbUseCoreKbd,
XkbSelectEvents(otk::Display::display, XkbUseCoreKbd,
XkbBellNotifyMask, XkbBellNotifyMask);
#endif // XKB
_eventlist[action].push_back(callback);
@ -549,7 +549,7 @@ bool OBBindings::addEvent(EventAction action, PyObject *callback)
return true;
}
bool OBBindings::removeEvent(EventAction action, PyObject *callback)
bool Bindings::removeEvent(EventAction action, PyObject *callback)
{
if (action < 0 || action >= NUM_EVENTS) {
return false;
@ -563,7 +563,7 @@ bool OBBindings::removeEvent(EventAction action, PyObject *callback)
_eventlist[action].erase(it);
#ifdef XKB
if (action == EventBell && _eventlist[action].empty())
XkbSelectEvents(otk::OBDisplay::display, XkbUseCoreKbd,
XkbSelectEvents(otk::Display::display, XkbUseCoreKbd,
XkbBellNotifyMask, 0);
#endif // XKB
return true;
@ -571,7 +571,7 @@ bool OBBindings::removeEvent(EventAction action, PyObject *callback)
return false;
}
void OBBindings::removeAllEvents()
void Bindings::removeAllEvents()
{
for (int i = 0; i < NUM_EVENTS; ++i) {
while (!_eventlist[i].empty()) {
@ -581,7 +581,7 @@ void OBBindings::removeAllEvents()
}
}
void OBBindings::fireEvent(EventData *data)
void Bindings::fireEvent(EventData *data)
{
CallbackList::iterator c_it, c_end = _eventlist[data->action].end();
for (c_it = _eventlist[data->action].begin(); c_it != c_end; ++c_it)

View file

@ -20,7 +20,7 @@ extern "C" {
namespace ob {
class OBClient;
class Client;
typedef std::list<PyObject *> CallbackList;
@ -55,7 +55,7 @@ typedef struct ButtonBinding {
ButtonBinding() : binding(0, 0) {}
};
class OBBindings {
class Bindings {
public:
//! A list of strings
typedef std::vector<std::string> StringVect;
@ -67,28 +67,28 @@ private:
Binding _resetkey; // the key which resets the key chain status
otk::OBTimer _timer;
otk::Timer _timer;
KeyBindingTree *find(KeyBindingTree *search, bool *conflict) const;
KeyBindingTree *buildtree(const StringVect &keylist,
PyObject *callback) const;
void assimilate(KeyBindingTree *node);
static void resetChains(OBBindings *self); // the timer's timeout function
static void resetChains(Bindings *self); // the timer's timeout function
typedef std::list <ButtonBinding*> ButtonBindingList;
ButtonBindingList _buttons[NUM_MOUSE_CONTEXT];
void grabButton(bool grab, const Binding &b, MouseContext context,
OBClient *client);
Client *client);
CallbackList _eventlist[NUM_EVENTS];
public:
//! Initializes an OBBindings object
OBBindings();
//! Destroys the OBBindings object
virtual ~OBBindings();
//! Initializes an Bindings object
Bindings();
//! Destroys the Bindings object
virtual ~Bindings();
//! Translates a binding string into the actual Binding
bool translate(const std::string &str, Binding &b, bool askey = true) const;
@ -120,7 +120,7 @@ public:
bool addButton(const std::string &but, MouseContext context,
MouseAction action, PyObject *callback);
void grabButtons(bool grab, OBClient *client);
void grabButtons(bool grab, Client *client);
//! Removes all button bindings
void removeAllButtons();

View file

@ -9,22 +9,22 @@
namespace ob {
OBButtonWidget::OBButtonWidget(otk::OtkWidget *parent,
OBWidget::WidgetType type)
: otk::OtkWidget(parent),
OBWidget(type),
ButtonWidget::ButtonWidget(otk::Widget *parent,
WidgetBase::WidgetType type)
: otk::Widget(parent),
WidgetBase(type),
_pressed(false),
_button(0)
{
}
OBButtonWidget::~OBButtonWidget()
ButtonWidget::~ButtonWidget()
{
}
void OBButtonWidget::setTextures()
void ButtonWidget::setTextures()
{
switch (type()) {
case Type_LeftGrip:
@ -56,9 +56,9 @@ void OBButtonWidget::setTextures()
}
void OBButtonWidget::setStyle(otk::Style *style)
void ButtonWidget::setStyle(otk::Style *style)
{
otk::OtkWidget::setStyle(style);
otk::Widget::setStyle(style);
setTextures();
switch (type()) {
@ -77,13 +77,13 @@ void OBButtonWidget::setStyle(otk::Style *style)
}
void OBButtonWidget::update()
void ButtonWidget::update()
{
otk::PixmapMask *pm;
int width;
bool draw = _dirty;
otk::OtkWidget::update();
otk::Widget::update();
if (draw) {
switch (type()) {
@ -110,49 +110,49 @@ void OBButtonWidget::update()
width = _rect.width();
otk::BPen pen(_focused ? *_style->getButtonPicFocus() :
*_style->getButtonPicUnfocus());
otk::Pen pen(_focused ? *_style->getButtonPicFocus() :
*_style->getButtonPicUnfocus());
// set the clip region
XSetClipMask(otk::OBDisplay::display, pen.gc(), pm->mask);
XSetClipOrigin(otk::OBDisplay::display, pen.gc(),
XSetClipMask(otk::Display::display, pen.gc(), pm->mask);
XSetClipOrigin(otk::Display::display, pen.gc(),
(width - pm->w)/2, (width - pm->h)/2);
// fill in the clipped region
XFillRectangle(otk::OBDisplay::display, _window, pen.gc(),
XFillRectangle(otk::Display::display, _window, pen.gc(),
(width - pm->w)/2, (width - pm->h)/2,
(width + pm->w)/2, (width + pm->h)/2);
// unset the clip region
XSetClipMask(otk::OBDisplay::display, pen.gc(), None);
XSetClipOrigin(otk::OBDisplay::display, pen.gc(), 0, 0);
XSetClipMask(otk::Display::display, pen.gc(), None);
XSetClipOrigin(otk::Display::display, pen.gc(), 0, 0);
}
}
void OBButtonWidget::adjust()
void ButtonWidget::adjust()
{
// nothing to adjust. no children.
}
void OBButtonWidget::focus()
void ButtonWidget::focus()
{
otk::OtkWidget::focus();
otk::Widget::focus();
setTextures();
}
void OBButtonWidget::unfocus()
void ButtonWidget::unfocus()
{
otk::OtkWidget::unfocus();
otk::Widget::unfocus();
setTextures();
}
void OBButtonWidget::buttonPressHandler(const XButtonEvent &e)
void ButtonWidget::buttonPressHandler(const XButtonEvent &e)
{
OtkWidget::buttonPressHandler(e);
otk::Widget::buttonPressHandler(e);
if (_button) return;
_button = e.button;
_pressed = true;
@ -161,9 +161,9 @@ void OBButtonWidget::buttonPressHandler(const XButtonEvent &e)
}
void OBButtonWidget::buttonReleaseHandler(const XButtonEvent &e)
void ButtonWidget::buttonReleaseHandler(const XButtonEvent &e)
{
OtkWidget::buttonPressHandler(e);
otk::Widget::buttonPressHandler(e);
if (e.button != _button) return;
_button = 0;
_pressed = false;

View file

@ -1,13 +1,13 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifndef __obbuttonwidget_hh
#define __obbuttonwidget_hh
#ifndef __buttonwidget_hh
#define __buttonwidget_hh
#include "widgetbase.hh"
#include "otk/widget.hh"
namespace ob {
class OBButtonWidget : public otk::OtkWidget, public OBWidget
class ButtonWidget : public otk::Widget, public WidgetBase
{
private:
void setTextures();
@ -15,8 +15,8 @@ private:
unsigned int _button;
public:
OBButtonWidget(otk::OtkWidget *parent, OBWidget::WidgetType type);
virtual ~OBButtonWidget();
ButtonWidget(otk::Widget *parent, WidgetBase::WidgetType type);
virtual ~ButtonWidget();
virtual void setStyle(otk::Style *style);
@ -33,4 +33,4 @@ public:
}
#endif // __obbuttonwidget_hh
#endif // __buttonwidget_hh

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@
#define __client_hh
/*! @file client.hh
@brief The OBClient class maintains the state of a client window by handling
@brief The Client class maintains the state of a client window by handling
property changes on the window and some client messages
*/
@ -26,7 +26,7 @@ extern "C" {
namespace ob {
class OBFrame;
class Frame;
//! The MWM Hints as retrieved from the window property
/*!
@ -34,36 +34,36 @@ class OBFrame;
structure contains 5. We only use the first 3, so that is all gets defined.
*/
struct MwmHints {
unsigned long flags; //!< A bitmask of OBClient::MwmFlags values
unsigned long functions; //!< A bitmask of OBClient::MwmFunctions values
unsigned long decorations;//!< A bitmask of OBClient::MwmDecorations values
//! The number of elements in the OBClient::MwmHints struct
unsigned long flags; //!< A bitmask of Client::MwmFlags values
unsigned long functions; //!< A bitmask of Client::MwmFunctions values
unsigned long decorations;//!< A bitmask of Client::MwmDecorations values
//! The number of elements in the Client::MwmHints struct
static const unsigned int elements = 3;
};
//! Maintains the state of a client window.
/*!
OBClient maintains the state of a client window. The state consists of the
Client maintains the state of a client window. The state consists of the
hints that the application sets on the window, such as the title, or window
gravity.
<p>
OBClient also manages client messages for the client window. When the
Client also manages client messages for the client window. When the
application (or any application) requests something to be changed for the
client, it will call the ActionHandler (for client messages) or update the
class' member variables and call whatever is nessary to complete the
change (such as causing a redraw of the titlebar after the title is changed).
*/
class OBClient : public otk::OtkEventHandler, public OBWidget {
class Client : public otk::EventHandler, public WidgetBase {
public:
//! The frame window which decorates around the client window
/*!
NOTE: This should NEVER be used inside the client class's constructor!
*/
OBFrame *frame;
Frame *frame;
//! Holds a list of OBClients
typedef std::list<OBClient*> List;
//! Holds a list of Clients
typedef std::list<Client*> List;
//! The possible stacking layers a client window can be a part of
enum StackLayer {
@ -126,7 +126,7 @@ public:
Func_Maximize = 1 << 3, //!< Allow to be maximized
Func_Close = 1 << 4 //!< Allow to be closed
};
//! Holds a bitmask of OBClient::Function values
//! Holds a bitmask of Client::Function values
typedef unsigned char FunctionFlags;
//! The decorations the client window wants to be displayed on it
@ -138,7 +138,7 @@ public:
Decor_Sticky = 1 << 5, //!< Display a sticky button
Decor_Close = 1 << 6 //!< Display a close button
};
//! Holds a bitmask of OBClient::Decoration values
//! Holds a bitmask of Client::Decoration values
typedef unsigned char DecorationFlags;
//! Possible actions that can be made with the _NET_WM_STATE client message
@ -173,10 +173,10 @@ private:
Window _group;
//! The client which this client is a transient (child) for
OBClient *_transient_for;
Client *_transient_for;
//! The clients which are transients (children) of this client
OBClient::List _transients;
Client::List _transients;
//! The desktop on which the window resides (0xffffffff for all desktops)
long _desktop;
@ -296,38 +296,38 @@ private:
StackLayer _layer;
//! A bitmask of values in the OBClient::Decoration enum
//! A bitmask of values in the Client::Decoration enum
/*!
The values in the variable are the decorations that the client wants to be
displayed around it.
*/
DecorationFlags _decorations;
//! A bitmask of values in the OBClient::Function enum
//! A bitmask of values in the Client::Function enum
/*!
The values in the variable specify the ways in which the user is allowed to
modify this window.
*/
FunctionFlags _functions;
//! Retrieves the desktop hint's value and sets OBClient::_desktop
//! Retrieves the desktop hint's value and sets Client::_desktop
void getDesktop();
//! Retrieves the window's type and sets OBClient::_type
//! Retrieves the window's type and sets Client::_type
void getType();
//! Gets the MWM Hints and adjusts OBClient::_functions and
//! OBClient::_decorations
//! Gets the MWM Hints and adjusts Client::_functions and
//! Client::_decorations
void getMwmHints();
//! Gets the position and size of the window and sets OBClient::_area
//! Gets the position and size of the window and sets Client::_area
void getArea();
//! Gets the net_state hint and sets the boolean flags for any states set in
//! the hint
void getState();
//! Determines if the window uses the Shape extension and sets
//! OBClient::_shaped
//! Client::_shaped
void getShaped();
//! Set up what decor should be shown on the window and what functions should
//! be allowed (OBClient::_decorations and OBClient::_functions).
//! be allowed (Client::_decorations and Client::_functions).
/*!
This also updates the NET_WM_ALLOWED_ACTIONS hint.
*/
@ -377,23 +377,23 @@ private:
public:
#ifndef SWIG
//! Constructs a new OBClient object around a specified window id
//! Constructs a new Client object around a specified window id
/*!
BB @param window The window id that the OBClient class should handle
BB @param window The window id that the Client class should handle
@param screen The screen on which the window resides
*/
OBClient(int screen, Window window);
//! Destroys the OBClient object
virtual ~OBClient();
Client(int screen, Window window);
//! Destroys the Client object
virtual ~Client();
#endif
//! Returns the screen on which the clien resides
inline int screen() const { return _screen; }
//! Returns the window id that the OBClient object is handling
//! Returns the window id that the Client object is handling
inline Window window() const { return _window; }
//! Returns the type of the window, one of the OBClient::WindowType values
//! Returns the type of the window, one of the Client::WindowType values
inline WindowType type() const { return _type; }
//! Returns if the window should be treated as a normal window.
/*!
@ -454,7 +454,7 @@ BB @param window The window id that the OBClient class should handle
inline FunctionFlags funtions() const { return _functions; }
//! Return the client this window is transient for
inline OBClient *transientFor() const { return _transient_for; }
inline Client *transientFor() const { return _transient_for; }
//! Returns if the window is modal
/*!

View file

@ -21,29 +21,29 @@ extern "C" {
namespace ob {
const long OBFrame::event_mask;
const long Frame::event_mask;
OBFrame::OBFrame(OBClient *client, otk::Style *style)
: otk::OtkWidget(Openbox::instance, style, Horizontal, 0, 1, true),
OBWidget(Type_Frame),
Frame::Frame(Client *client, otk::Style *style)
: otk::Widget(Openbox::instance, style, Horizontal, 0, 1, true),
WidgetBase(WidgetBase::Type_Frame),
_client(client),
_screen(otk::OBDisplay::screenInfo(client->screen())),
_plate(this, OBWidget::Type_Plate),
_titlebar(this, OBWidget::Type_Titlebar),
_button_close(&_titlebar, OBWidget::Type_CloseButton),
_button_iconify(&_titlebar, OBWidget::Type_IconifyButton),
_button_max(&_titlebar, OBWidget::Type_MaximizeButton),
_button_stick(&_titlebar, OBWidget::Type_StickyButton),
_label(&_titlebar, OBWidget::Type_Label),
_handle(this, OBWidget::Type_Handle),
_grip_left(&_handle, OBWidget::Type_LeftGrip),
_grip_right(&_handle, OBWidget::Type_RightGrip),
_screen(otk::Display::screenInfo(client->screen())),
_plate(this, WidgetBase::Type_Plate),
_titlebar(this, WidgetBase::Type_Titlebar),
_button_close(&_titlebar, WidgetBase::Type_CloseButton),
_button_iconify(&_titlebar, WidgetBase::Type_IconifyButton),
_button_max(&_titlebar, WidgetBase::Type_MaximizeButton),
_button_stick(&_titlebar, WidgetBase::Type_StickyButton),
_label(&_titlebar, WidgetBase::Type_Label),
_handle(this, WidgetBase::Type_Handle),
_grip_left(&_handle, WidgetBase::Type_LeftGrip),
_grip_right(&_handle, WidgetBase::Type_RightGrip),
_decorations(client->decorations())
{
assert(client);
assert(style);
XSelectInput(otk::OBDisplay::display, _window, OBFrame::event_mask);
XSelectInput(otk::Display::display, _window, Frame::event_mask);
_grip_left.setCursor(Openbox::instance->cursors().ll_angle);
_grip_right.setCursor(Openbox::instance->cursors().lr_angle);
@ -53,29 +53,29 @@ OBFrame::OBFrame(OBClient *client, otk::Style *style)
_style = 0;
setStyle(style);
otk::OtkWidget::unfocus(); // stuff starts out appearing focused in otk
otk::Widget::unfocus(); // stuff starts out appearing focused in otk
_plate.show(); // the other stuff is shown based on decor settings
}
OBFrame::~OBFrame()
Frame::~Frame()
{
}
void OBFrame::setTitle(const std::string &text)
void Frame::setTitle(const std::string &text)
{
_label.setText(text);
_label.update();
}
void OBFrame::setStyle(otk::Style *style)
void Frame::setStyle(otk::Style *style)
{
assert(style);
otk::OtkWidget::setStyle(style);
otk::Widget::setStyle(style);
// if a style was previously set, then 'replace' is true, cause we're
// replacing a style
@ -98,27 +98,27 @@ void OBFrame::setStyle(otk::Style *style)
}
void OBFrame::focus()
void Frame::focus()
{
otk::OtkWidget::focus();
otk::Widget::focus();
update();
}
void OBFrame::unfocus()
void Frame::unfocus()
{
otk::OtkWidget::unfocus();
otk::Widget::unfocus();
update();
}
void OBFrame::adjust()
void Frame::adjust()
{
// the party all happens in adjustSize
}
void OBFrame::adjustSize()
void Frame::adjustSize()
{
// XXX: only if not overridden or something!!! MORE LOGIC HERE!!
_decorations = _client->decorations();
@ -131,7 +131,7 @@ void OBFrame::adjustSize()
int butsize=0; // width and height of the titlebar buttons
const int bevel = _style->getBevelWidth();
if (_decorations & OBClient::Decor_Border) {
if (_decorations & Client::Decor_Border) {
bwidth = _style->getBorderWidth();
cbwidth = _style->getFrameWidth();
} else
@ -148,7 +148,7 @@ void OBFrame::adjustSize()
_grip_right.setBorderWidth(bwidth);
_handle.setBorderWidth(bwidth);
if (_decorations & OBClient::Decor_Titlebar) {
if (_decorations & Client::Decor_Titlebar) {
// set the titlebar size
_titlebar.setGeometry(-bwidth,
-bwidth,
@ -160,13 +160,13 @@ void OBFrame::adjustSize()
_label.setGeometry(0, bevel, width, _style->getFont()->height());
// set the buttons sizes
butsize = _label.height() - 2;
if (_decorations & OBClient::Decor_Iconify)
if (_decorations & Client::Decor_Iconify)
_button_iconify.setGeometry(0, bevel + 1, butsize, butsize);
if (_decorations & OBClient::Decor_Maximize)
if (_decorations & Client::Decor_Maximize)
_button_max.setGeometry(0, bevel + 1, butsize, butsize);
if (_decorations & OBClient::Decor_Sticky)
if (_decorations & Client::Decor_Sticky)
_button_stick.setGeometry(0, bevel + 1, butsize, butsize);
if (_decorations & OBClient::Decor_Close)
if (_decorations & Client::Decor_Close)
_button_close.setGeometry(0, bevel + 1, butsize, butsize);
// separation between titlebar elements
@ -185,7 +185,7 @@ void OBFrame::adjustSize()
switch (layout[i]) {
case 'i':
case 'I':
if (!tit_i && (_decorations & OBClient::Decor_Iconify)) {
if (!tit_i && (_decorations & Client::Decor_Iconify)) {
tit_i = true;
continue;
}
@ -199,21 +199,21 @@ void OBFrame::adjustSize()
break;
case 'm':
case 'M':
if (!tit_m && (_decorations & OBClient::Decor_Maximize)) {
if (!tit_m && (_decorations & Client::Decor_Maximize)) {
tit_m = true;
continue;
}
break;
case 's':
case 'S':
if (!tit_s && (_decorations & OBClient::Decor_Sticky)) {
if (!tit_s && (_decorations & Client::Decor_Sticky)) {
tit_s = true;
continue;
}
break;
case 'c':
case 'C':
if (!tit_c && (_decorations & OBClient::Decor_Close)) {
if (!tit_c && (_decorations & Client::Decor_Close)) {
tit_c = true;
continue;
}
@ -272,7 +272,7 @@ void OBFrame::adjustSize()
}
}
if (_decorations & OBClient::Decor_Handle) {
if (_decorations & Client::Decor_Handle) {
_handle.setGeometry(-bwidth,
_innersize.top + _client->area().height() + cbwidth,
width, _style->getHandleWidth());
@ -306,7 +306,7 @@ void OBFrame::adjustSize()
_client->area().width(), _client->area().height());
// map/unmap all the windows
if (_decorations & OBClient::Decor_Titlebar) {
if (_decorations & Client::Decor_Titlebar) {
_label.show();
if (tit_i)
_button_iconify.show();
@ -329,7 +329,7 @@ void OBFrame::adjustSize()
_titlebar.hide(true);
}
if (_decorations & OBClient::Decor_Handle)
if (_decorations & Client::Decor_Handle)
_handle.show(true);
else
_handle.hide(true);
@ -345,7 +345,7 @@ void OBFrame::adjustSize()
}
void OBFrame::adjustPosition()
void Frame::adjustPosition()
{
int x, y;
clientGravity(x, y);
@ -353,21 +353,21 @@ void OBFrame::adjustPosition()
}
void OBFrame::adjustShape()
void Frame::adjustShape()
{
#ifdef SHAPE
int bwidth = (_decorations & OBClient::Decor_Border) ?
int bwidth = (_decorations & Client::Decor_Border) ?
_style->getBorderWidth() : 0;
if (!_client->shaped()) {
// clear the shape on the frame window
XShapeCombineMask(otk::OBDisplay::display, _window, ShapeBounding,
XShapeCombineMask(otk::Display::display, _window, ShapeBounding,
_innersize.left,
_innersize.top,
None, ShapeSet);
} else {
// make the frame's shape match the clients
XShapeCombineShape(otk::OBDisplay::display, _window, ShapeBounding,
XShapeCombineShape(otk::Display::display, _window, ShapeBounding,
_innersize.left,
_innersize.top,
_client->window(), ShapeBounding, ShapeSet);
@ -375,7 +375,7 @@ void OBFrame::adjustShape()
int num = 0;
XRectangle xrect[2];
if (_decorations & OBClient::Decor_Titlebar) {
if (_decorations & Client::Decor_Titlebar) {
xrect[0].x = _titlebar.rect().x();
xrect[0].y = _titlebar.rect().y();
xrect[0].width = _titlebar.width() + bwidth * 2; // XXX: this is useless once the widget handles borders!
@ -383,7 +383,7 @@ void OBFrame::adjustShape()
++num;
}
if (_decorations & OBClient::Decor_Handle) {
if (_decorations & Client::Decor_Handle) {
xrect[1].x = _handle.rect().x();
xrect[1].y = _handle.rect().y();
xrect[1].width = _handle.width() + bwidth * 2; // XXX: this is useless once the widget handles borders!
@ -391,7 +391,7 @@ void OBFrame::adjustShape()
++num;
}
XShapeCombineRectangles(otk::OBDisplay::display, window(),
XShapeCombineRectangles(otk::Display::display, window(),
ShapeBounding, 0, 0, xrect, num,
ShapeUnion, Unsorted);
}
@ -399,10 +399,10 @@ void OBFrame::adjustShape()
}
void OBFrame::grabClient()
void Frame::grabClient()
{
// reparent the client to the frame
XReparentWindow(otk::OBDisplay::display, _client->window(),
XReparentWindow(otk::Display::display, _client->window(),
_plate.window(), 0, 0);
/*
When reparenting the client window, it is usually not mapped yet, since
@ -416,38 +416,38 @@ void OBFrame::grabClient()
_client->ignore_unmaps += 2;
// select the event mask on the client's parent (to receive config req's)
XSelectInput(otk::OBDisplay::display, _plate.window(),
XSelectInput(otk::Display::display, _plate.window(),
SubstructureRedirectMask);
// map the client so it maps when the frame does
XMapWindow(otk::OBDisplay::display, _client->window());
XMapWindow(otk::Display::display, _client->window());
adjustSize();
adjustPosition();
}
void OBFrame::releaseClient()
void Frame::releaseClient()
{
XEvent ev;
// check if the app has already reparented its window away
if (XCheckTypedWindowEvent(otk::OBDisplay::display, _client->window(),
if (XCheckTypedWindowEvent(otk::Display::display, _client->window(),
ReparentNotify, &ev)) {
XPutBackEvent(otk::OBDisplay::display, &ev);
XPutBackEvent(otk::Display::display, &ev);
// re-map the window since the unmanaging process unmaps it
XMapWindow(otk::OBDisplay::display, _client->window());
XMapWindow(otk::Display::display, _client->window());
} else {
// according to the ICCCM - if the client doesn't reparent itself, then we
// will reparent the window to root for them
XReparentWindow(otk::OBDisplay::display, _client->window(),
XReparentWindow(otk::Display::display, _client->window(),
_screen->rootWindow(),
_client->area().x(), _client->area().y());
}
}
void OBFrame::clientGravity(int &x, int &y)
void Frame::clientGravity(int &x, int &y)
{
x = _client->area().x();
y = _client->area().y();
@ -506,7 +506,7 @@ void OBFrame::clientGravity(int &x, int &y)
}
void OBFrame::frameGravity(int &x, int &y)
void Frame::frameGravity(int &x, int &y)
{
x = rect().x();
y = rect().y();

View file

@ -23,20 +23,20 @@ extern "C" {
namespace ob {
//! Holds and decorates a frame around an OBClient (client window)
//! Holds and decorates a frame around an Client (client window)
/*!
The frame is responsible for calling XSelectInput on the client window's new
parent with the SubstructureRedirectMask so that structure events for the
client are sent to the window manager.
*/
class OBFrame : public otk::OtkWidget, public OBWidget {
class Frame : public otk::Widget, public WidgetBase {
public:
//! The event mask to grab on frame windows
static const long event_mask = EnterWindowMask | LeaveWindowMask;
private:
OBClient *_client;
Client *_client;
const otk::ScreenInfo *_screen;
//! The style to use for size and display the decorations
@ -49,33 +49,33 @@ private:
otk::Strut _innersize;
// decoration windows
OBBackgroundWidget _plate; // sits entirely under the client window
OBBackgroundWidget _titlebar;
OBButtonWidget _button_close;
OBButtonWidget _button_iconify;
OBButtonWidget _button_max;
OBButtonWidget _button_stick;
OBLabelWidget _label;
OBBackgroundWidget _handle;
OBButtonWidget _grip_left;
OBButtonWidget _grip_right;
BackgroundWidget _plate; // sits entirely under the client window
BackgroundWidget _titlebar;
ButtonWidget _button_close;
ButtonWidget _button_iconify;
ButtonWidget _button_max;
ButtonWidget _button_stick;
LabelWidget _label;
BackgroundWidget _handle;
ButtonWidget _grip_left;
ButtonWidget _grip_right;
//! The decorations to display on the window.
/*!
This is by default the same value as in the OBClient::decorations, but it
This is by default the same value as in the Client::decorations, but it
is duplicated here so that it can be overridden per-window by the user.
*/
OBClient::DecorationFlags _decorations;
Client::DecorationFlags _decorations;
public:
//! Constructs an OBFrame object, and reparents the client to itself
//! Constructs an Frame object, and reparents the client to itself
/*!
@param client The client window which will be decorated by the new OBFrame
@param client The client window which will be decorated by the new Frame
@param style The style to use to decorate the frame
*/
OBFrame(OBClient *client, otk::Style *style);
//! Destroys the OBFrame object
virtual ~OBFrame();
Frame(Client *client, otk::Style *style);
//! Destroys the Frame object
virtual ~Frame();
//! Set the style to decorate the frame with
virtual void setStyle(otk::Style *style);

View file

@ -1,4 +1,5 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifdef HAVE_CONFIG_H
# include "../config.h"
@ -10,30 +11,30 @@
namespace ob {
OBLabelWidget::OBLabelWidget(otk::OtkWidget *parent, OBWidget::WidgetType type)
: otk::OtkWidget(parent),
OBWidget(type)
LabelWidget::LabelWidget(otk::Widget *parent, WidgetBase::WidgetType type)
: otk::Widget(parent),
WidgetBase(type)
{
const otk::ScreenInfo *info = otk::OBDisplay::screenInfo(_screen);
_xftdraw = XftDrawCreate(otk::OBDisplay::display, _window, info->visual(),
const otk::ScreenInfo *info = otk::Display::screenInfo(_screen);
_xftdraw = XftDrawCreate(otk::Display::display, _window, info->visual(),
info->colormap());
}
OBLabelWidget::~OBLabelWidget()
LabelWidget::~LabelWidget()
{
XftDrawDestroy(_xftdraw);
}
void OBLabelWidget::setText(const std::string &text)
void LabelWidget::setText(const std::string &text)
{
_text = text;
_dirty = true;
}
void OBLabelWidget::setTextures()
void LabelWidget::setTextures()
{
if (_focused) {
setTexture(_style->getLabelFocus());
@ -45,9 +46,9 @@ void OBLabelWidget::setTextures()
}
void OBLabelWidget::setStyle(otk::Style *style)
void LabelWidget::setStyle(otk::Style *style)
{
OtkWidget::setStyle(style);
otk::Widget::setStyle(style);
setTextures();
_font = style->getFont();
assert(_font);
@ -56,25 +57,25 @@ void OBLabelWidget::setStyle(otk::Style *style)
}
void OBLabelWidget::focus()
void LabelWidget::focus()
{
otk::OtkWidget::focus();
otk::Widget::focus();
setTextures();
}
void OBLabelWidget::unfocus()
void LabelWidget::unfocus()
{
otk::OtkWidget::unfocus();
otk::Widget::unfocus();
setTextures();
}
void OBLabelWidget::update()
void LabelWidget::update()
{
bool draw = _dirty;
OtkWidget::update();
otk::Widget::update();
if (draw) {
std::string t = _text;
@ -111,7 +112,7 @@ void OBLabelWidget::update()
}
void OBLabelWidget::adjust()
void LabelWidget::adjust()
{
// nothing to adjust. no children.
}

View file

@ -9,12 +9,12 @@
namespace ob {
class OBLabelWidget : public otk::OtkWidget, public OBWidget
class LabelWidget : public otk::Widget, public WidgetBase
{
private:
void setTextures();
const otk::BFont *_font;
otk::BColor *_text_color;
const otk::Font *_font;
otk::Color *_text_color;
int _sidemargin;
otk::Style::TextJustify _justify;
std::string _text;
@ -22,8 +22,8 @@ private:
XftDraw *_xftdraw;
public:
OBLabelWidget(otk::OtkWidget *parent, OBWidget::WidgetType type);
virtual ~OBLabelWidget();
LabelWidget(otk::Widget *parent, WidgetBase::WidgetType type);
virtual ~LabelWidget();
virtual void setStyle(otk::Style *style);

View file

@ -1,4 +1,4 @@
// -*- mode: C++; indent-tabs-mode: nil; -*-
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
/*! @file main.cc
@brief Main entry point for the application
@ -16,9 +16,6 @@ extern "C" {
#include "gettext.h"
}
#include <string>
using std::string;
#include "openbox.hh"
int main(int argc, char **argv) {

View file

@ -79,8 +79,8 @@ void Openbox::signalHandler(int signal)
Openbox::Openbox(int argc, char **argv)
: otk::OtkEventDispatcher(),
otk::OtkEventHandler()
: otk::EventDispatcher(),
otk::EventHandler()
{
struct sigaction action;
@ -100,10 +100,10 @@ Openbox::Openbox(int argc, char **argv)
parseCommandLine(argc, argv);
// open the X display (and gets some info about it, and its screens)
otk::OBDisplay::initialize(_displayreq);
assert(otk::OBDisplay::display);
otk::Display::initialize(_displayreq);
assert(otk::Display::display);
XSynchronize(otk::OBDisplay::display, _sync);
XSynchronize(otk::Display::display, _sync);
// set up the signal handler
action.sa_handler = Openbox::signalHandler;
@ -117,19 +117,19 @@ Openbox::Openbox(int argc, char **argv)
sigaction(SIGINT, &action, (struct sigaction *) 0);
sigaction(SIGHUP, &action, (struct sigaction *) 0);
_property = new otk::OBProperty();
_actions = new OBActions();
_bindings = new OBBindings();
_property = new otk::Property();
_actions = new Actions();
_bindings = new Bindings();
setMasterHandler(_actions); // set as the master event handler
// create the mouse cursors we'll use
_cursors.session = XCreateFontCursor(otk::OBDisplay::display, XC_left_ptr);
_cursors.move = XCreateFontCursor(otk::OBDisplay::display, XC_fleur);
_cursors.ll_angle = XCreateFontCursor(otk::OBDisplay::display, XC_ll_angle);
_cursors.lr_angle = XCreateFontCursor(otk::OBDisplay::display, XC_lr_angle);
_cursors.ul_angle = XCreateFontCursor(otk::OBDisplay::display, XC_ul_angle);
_cursors.ur_angle = XCreateFontCursor(otk::OBDisplay::display, XC_ur_angle);
_cursors.session = XCreateFontCursor(otk::Display::display, XC_left_ptr);
_cursors.move = XCreateFontCursor(otk::Display::display, XC_fleur);
_cursors.ll_angle = XCreateFontCursor(otk::Display::display, XC_ll_angle);
_cursors.lr_angle = XCreateFontCursor(otk::Display::display, XC_lr_angle);
_cursors.ul_angle = XCreateFontCursor(otk::Display::display, XC_ul_angle);
_cursors.ur_angle = XCreateFontCursor(otk::Display::display, XC_ur_angle);
// initialize scripting
python_init(argv[0]);
@ -143,11 +143,11 @@ Openbox::Openbox(int argc, char **argv)
python_exec(SCRIPTDIR"/defaults.py"); // system default bahaviors
// initialize all the screens
OBScreen *screen;
int i = _single ? DefaultScreen(otk::OBDisplay::display) : 0;
int max = _single ? i + 1 : ScreenCount(otk::OBDisplay::display);
Screen *screen;
int i = _single ? DefaultScreen(otk::Display::display) : 0;
int max = _single ? i + 1 : ScreenCount(otk::Display::display);
for (; i < max; ++i) {
screen = new OBScreen(i);
screen = new Screen(i);
if (screen->managed())
_screens.push_back(screen);
else
@ -189,19 +189,19 @@ Openbox::~Openbox()
python_destroy();
XSetInputFocus(otk::OBDisplay::display, PointerRoot, RevertToNone,
XSetInputFocus(otk::Display::display, PointerRoot, RevertToNone,
CurrentTime);
XSync(otk::OBDisplay::display, false);
XSync(otk::Display::display, false);
// this tends to block.. i honestly am not sure why. causing an x error in
// the shutdown process unblocks it. blackbox simply did a ::exit(0), so
// all im gunna do is the same.
//otk::OBDisplay::destroy();
//otk::Display::destroy();
if (_restart) {
if (!_restart_prog.empty()) {
const std::string &dstr =
otk::OBDisplay::screenInfo(first_screen)->displayString();
otk::Display::screenInfo(first_screen)->displayString();
otk::putenv(const_cast<char *>(dstr.c_str()));
execlp(_restart_prog.c_str(), _restart_prog.c_str(), NULL);
perror(_restart_prog.c_str());
@ -321,13 +321,13 @@ void Openbox::eventLoop()
{
while (!_shutdown) {
_timermanager.fire(!_sync); // wait if not in sync mode
dispatchEvents(); // from OtkEventDispatcher
XFlush(otk::OBDisplay::display); // flush here before we go wait for timers
dispatchEvents(); // from otk::EventDispatcher
XFlush(otk::Display::display); // flush here before we go wait for timers
}
}
void Openbox::addClient(Window window, OBClient *client)
void Openbox::addClient(Window window, Client *client)
{
_clients[window] = client;
}
@ -339,7 +339,7 @@ void Openbox::removeClient(Window window)
}
OBClient *Openbox::findClient(Window window)
Client *Openbox::findClient(Window window)
{
/*
NOTE: we dont use _clients[] to find the value because that will insert
@ -350,27 +350,27 @@ OBClient *Openbox::findClient(Window window)
if (it != _clients.end())
return it->second;
else
return (OBClient*) 0;
return (Client*) 0;
}
void Openbox::setFocusedClient(OBClient *c)
void Openbox::setFocusedClient(Client *c)
{
_focused_client = c;
if (c) {
_focused_screen = _screens[c->screen()];
} else {
assert(_focused_screen);
XSetInputFocus(otk::OBDisplay::display, _focused_screen->focuswindow(),
XSetInputFocus(otk::Display::display, _focused_screen->focuswindow(),
RevertToNone, CurrentTime);
}
// set the NET_ACTIVE_WINDOW hint for all screens
ScreenList::iterator it, end = _screens.end();
for (it = _screens.begin(); it != end; ++it) {
int num = (*it)->number();
Window root = otk::OBDisplay::screenInfo(num)->rootWindow();
_property->set(root, otk::OBProperty::net_active_window,
otk::OBProperty::Atom_Window,
Window root = otk::Display::screenInfo(num)->rootWindow();
_property->set(root, otk::Property::net_active_window,
otk::Property::Atom_Window,
(c && _focused_screen == *it) ? c->window() : None);
}
@ -381,9 +381,9 @@ void Openbox::setFocusedClient(OBClient *c)
void Openbox::execute(int screen, const std::string &bin)
{
if (screen >= ScreenCount(otk::OBDisplay::display))
if (screen >= ScreenCount(otk::Display::display))
screen = 0;
otk::bexec(bin, otk::OBDisplay::screenInfo(screen)->displayString());
otk::bexec(bin, otk::Display::screenInfo(screen)->displayString());
}
}

View file

@ -23,10 +23,10 @@ extern "C" {
namespace ob {
class OBScreen;
class OBClient;
class OBActions;
class OBBindings;
class Screen;
class Client;
class Actions;
class Bindings;
//! Mouse cursors used throughout Openbox
struct Cursors {
@ -49,7 +49,7 @@ struct Cursors {
not exit until the window manager is ready to be destroyed. Destruction of
the Openbox class instance will shutdown the window manager.
*/
class Openbox : public otk::OtkEventDispatcher, public otk::OtkEventHandler
class Openbox : public otk::EventDispatcher, public otk::EventHandler
{
public:
//! The single instance of the Openbox class for the application
@ -67,10 +67,10 @@ public:
};
//! A map for looking up a specific client class from the window id
typedef std::map<Window, OBClient *> ClientMap;
typedef std::map<Window, Client *> ClientMap;
//! A list of OBScreen classes
typedef std::vector<OBScreen *> ScreenList;
//! A list of Screen classes
typedef std::vector<Screen *> ScreenList;
private:
// stuff that can be passed on the command line
@ -106,24 +106,24 @@ private:
//! Manages all timers for the application
/*!
Use of the otk::OBTimerQueueManager::fire funtion in this object ensures
Use of the otk::TimerQueueManager::fire funtion in this object ensures
that all timers fire when their times elapse.
*/
otk::OBTimerQueueManager _timermanager;
otk::TimerQueueManager _timermanager;
//! Cached atoms on the display
/*!
This is a pointer because the OBProperty class uses otk::OBDisplay::display
This is a pointer because the Property class uses otk::Display::display
in its constructor, so, it needs to be initialized <b>after</b> the display
is initialized in this class' constructor.
*/
otk::OBProperty *_property;
otk::Property *_property;
//! The action interface through which all user-available actions occur
OBActions *_actions;
Actions *_actions;
//! The interface through which keys/buttons are grabbed and handled
OBBindings *_bindings;
Bindings *_bindings;
//! The running state of the window manager
RunState _state;
@ -146,14 +146,14 @@ private:
/*!
Updated by the clients themselves.
*/
OBClient *_focused_client;
Client *_focused_client;
//! The screen with input focus
/*!
Updated by the clients when they update the Openbox::focused_client
property.
*/
OBScreen *_focused_screen;
Screen *_focused_screen;
//! Parses the command line used when executing this application
void parseCommandLine(int argv, char **argv);
@ -180,24 +180,24 @@ public:
//! Returns the state of the window manager (starting, exiting, etc)
inline RunState state() const { return _state; }
//! Returns the otk::OBTimerQueueManager for the application
//! Returns the otk::TimerQueueManager for the application
/*!
All otk::OBTimer objects used in the application should be made to use this
otk::OBTimerQueueManager.
All otk::Timer objects used in the application should be made to use this
otk::TimerQueueManager.
*/
inline otk::OBTimerQueueManager *timerManager() { return &_timermanager; }
inline otk::TimerQueueManager *timerManager() { return &_timermanager; }
//! Returns the otk::OBProperty instance for the window manager
inline const otk::OBProperty *property() const { return _property; }
//! Returns the otk::Property instance for the window manager
inline const otk::Property *property() const { return _property; }
//! Returns the OBActions instance for the window manager
inline OBActions *actions() const { return _actions; }
//! Returns the Actions instance for the window manager
inline Actions *actions() const { return _actions; }
//! Returns the OBBindings instance for the window manager
inline OBBindings *bindings() const { return _bindings; }
//! Returns the Bindings instance for the window manager
inline Bindings *bindings() const { return _bindings; }
//! Returns a managed screen
inline OBScreen *screen(int num) {
inline Screen *screen(int num) {
assert(num >= 0); assert(num < (signed)_screens.size());
if (num >= screenCount())
return NULL;
@ -222,26 +222,26 @@ public:
void eventLoop();
#endif
//! Adds an OBClient to the client list for lookups
void addClient(Window window, OBClient *client);
//! Adds an Client to the client list for lookups
void addClient(Window window, Client *client);
//! Removes an OBClient from the client list for lookups
//! Removes an Client from the client list for lookups
void removeClient(Window window);
//! Finds an OBClient based on its window id
OBClient *findClient(Window window);
//! Finds an Client based on its window id
Client *findClient(Window window);
//! The client with input focus
inline OBClient *focusedClient() { return _focused_client; }
inline Client *focusedClient() { return _focused_client; }
//! Change the client which has focus.
/*!
This is called by the clients themselves when their focus state changes.
*/
void setFocusedClient(OBClient *c);
void setFocusedClient(Client *c);
//! The screen with input focus
inline OBScreen *focusedScreen() { return _focused_screen; }
inline Screen *focusedScreen() { return _focused_screen; }
//! Requests that the window manager exit
/*!

View file

@ -18,7 +18,7 @@
%include "stl.i"
//%include std_list.i
//%template(ClientList) std::list<OBClient*>;
//%template(ClientList) std::list<Client*>;
%ignore ob::Openbox::instance;
%inline %{
@ -90,15 +90,15 @@ void python_callback(PyObject *func, KeyData *data)
}
%}
%ignore ob::OBScreen::clients;
%ignore ob::Screen::clients;
%{
#include <iterator>
%}
%extend ob::OBScreen {
OBClient *client(int i) {
%extend ob::Screen {
Client *client(int i) {
if (i >= (int)self->clients.size())
return NULL;
ob::OBClient::List::iterator it = self->clients.begin();
ob::Client::List::iterator it = self->clients.begin();
std::advance(it,i);
return *it;
}
@ -107,9 +107,9 @@ void python_callback(PyObject *func, KeyData *data)
}
};
%ignore otk::OBDisplay::display;
%ignore otk::Display::display;
%inline %{
Display *OBDisplay_display() { return otk::OBDisplay::display; }
Display *Display_display() { return otk::Display::display; }
%};
%include "../otk/display.hh"
@ -119,11 +119,6 @@ void python_callback(PyObject *func, KeyData *data)
%include "../otk/screeninfo.hh"
%include "../otk/strut.hh"
%rename(itostring_unsigned) itostring(unsigned int);
%rename(itostring_long) itostring(long);
%rename(itostring_unsigned_long) itostring(unsigned long);
%include "../otk/util.hh"
%include "../otk/eventhandler.hh"
%include "../otk/eventdispatcher.hh"

View file

@ -29,94 +29,94 @@ except AttributeError:
Openbox_instance = _openbox.Openbox_instance
OBDisplay_display = _openbox.OBDisplay_display
Display_display = _openbox.Display_display
class OBDisplay(_object):
class Display(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, OBDisplay, name, value)
__setattr__ = lambda self, name, value: _swig_setattr(self, Display, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, OBDisplay, name)
__swig_getmethods__["initialize"] = lambda x: _openbox.OBDisplay_initialize
if _newclass:initialize = staticmethod(_openbox.OBDisplay_initialize)
__swig_getmethods__["destroy"] = lambda x: _openbox.OBDisplay_destroy
if _newclass:destroy = staticmethod(_openbox.OBDisplay_destroy)
__swig_getmethods__["gcCache"] = lambda x: _openbox.OBDisplay_gcCache
if _newclass:gcCache = staticmethod(_openbox.OBDisplay_gcCache)
__swig_getmethods__["screenInfo"] = lambda x: _openbox.OBDisplay_screenInfo
if _newclass:screenInfo = staticmethod(_openbox.OBDisplay_screenInfo)
__swig_getmethods__["findScreen"] = lambda x: _openbox.OBDisplay_findScreen
if _newclass:findScreen = staticmethod(_openbox.OBDisplay_findScreen)
__swig_getmethods__["xkb"] = lambda x: _openbox.OBDisplay_xkb
if _newclass:xkb = staticmethod(_openbox.OBDisplay_xkb)
__swig_getmethods__["xkbEventBase"] = lambda x: _openbox.OBDisplay_xkbEventBase
if _newclass:xkbEventBase = staticmethod(_openbox.OBDisplay_xkbEventBase)
__swig_getmethods__["shape"] = lambda x: _openbox.OBDisplay_shape
if _newclass:shape = staticmethod(_openbox.OBDisplay_shape)
__swig_getmethods__["shapeEventBase"] = lambda x: _openbox.OBDisplay_shapeEventBase
if _newclass:shapeEventBase = staticmethod(_openbox.OBDisplay_shapeEventBase)
__swig_getmethods__["xinerama"] = lambda x: _openbox.OBDisplay_xinerama
if _newclass:xinerama = staticmethod(_openbox.OBDisplay_xinerama)
__swig_getmethods__["numLockMask"] = lambda x: _openbox.OBDisplay_numLockMask
if _newclass:numLockMask = staticmethod(_openbox.OBDisplay_numLockMask)
__swig_getmethods__["scrollLockMask"] = lambda x: _openbox.OBDisplay_scrollLockMask
if _newclass:scrollLockMask = staticmethod(_openbox.OBDisplay_scrollLockMask)
__swig_getmethods__["grab"] = lambda x: _openbox.OBDisplay_grab
if _newclass:grab = staticmethod(_openbox.OBDisplay_grab)
__swig_getmethods__["ungrab"] = lambda x: _openbox.OBDisplay_ungrab
if _newclass:ungrab = staticmethod(_openbox.OBDisplay_ungrab)
__swig_getmethods__["grabButton"] = lambda x: _openbox.OBDisplay_grabButton
if _newclass:grabButton = staticmethod(_openbox.OBDisplay_grabButton)
__swig_getmethods__["ungrabButton"] = lambda x: _openbox.OBDisplay_ungrabButton
if _newclass:ungrabButton = staticmethod(_openbox.OBDisplay_ungrabButton)
__swig_getmethods__["grabKey"] = lambda x: _openbox.OBDisplay_grabKey
if _newclass:grabKey = staticmethod(_openbox.OBDisplay_grabKey)
__swig_getmethods__["ungrabKey"] = lambda x: _openbox.OBDisplay_ungrabKey
if _newclass:ungrabKey = staticmethod(_openbox.OBDisplay_ungrabKey)
__getattr__ = lambda self, name: _swig_getattr(self, Display, name)
__swig_getmethods__["initialize"] = lambda x: _openbox.Display_initialize
if _newclass:initialize = staticmethod(_openbox.Display_initialize)
__swig_getmethods__["destroy"] = lambda x: _openbox.Display_destroy
if _newclass:destroy = staticmethod(_openbox.Display_destroy)
__swig_getmethods__["gcCache"] = lambda x: _openbox.Display_gcCache
if _newclass:gcCache = staticmethod(_openbox.Display_gcCache)
__swig_getmethods__["screenInfo"] = lambda x: _openbox.Display_screenInfo
if _newclass:screenInfo = staticmethod(_openbox.Display_screenInfo)
__swig_getmethods__["findScreen"] = lambda x: _openbox.Display_findScreen
if _newclass:findScreen = staticmethod(_openbox.Display_findScreen)
__swig_getmethods__["xkb"] = lambda x: _openbox.Display_xkb
if _newclass:xkb = staticmethod(_openbox.Display_xkb)
__swig_getmethods__["xkbEventBase"] = lambda x: _openbox.Display_xkbEventBase
if _newclass:xkbEventBase = staticmethod(_openbox.Display_xkbEventBase)
__swig_getmethods__["shape"] = lambda x: _openbox.Display_shape
if _newclass:shape = staticmethod(_openbox.Display_shape)
__swig_getmethods__["shapeEventBase"] = lambda x: _openbox.Display_shapeEventBase
if _newclass:shapeEventBase = staticmethod(_openbox.Display_shapeEventBase)
__swig_getmethods__["xinerama"] = lambda x: _openbox.Display_xinerama
if _newclass:xinerama = staticmethod(_openbox.Display_xinerama)
__swig_getmethods__["numLockMask"] = lambda x: _openbox.Display_numLockMask
if _newclass:numLockMask = staticmethod(_openbox.Display_numLockMask)
__swig_getmethods__["scrollLockMask"] = lambda x: _openbox.Display_scrollLockMask
if _newclass:scrollLockMask = staticmethod(_openbox.Display_scrollLockMask)
__swig_getmethods__["grab"] = lambda x: _openbox.Display_grab
if _newclass:grab = staticmethod(_openbox.Display_grab)
__swig_getmethods__["ungrab"] = lambda x: _openbox.Display_ungrab
if _newclass:ungrab = staticmethod(_openbox.Display_ungrab)
__swig_getmethods__["grabButton"] = lambda x: _openbox.Display_grabButton
if _newclass:grabButton = staticmethod(_openbox.Display_grabButton)
__swig_getmethods__["ungrabButton"] = lambda x: _openbox.Display_ungrabButton
if _newclass:ungrabButton = staticmethod(_openbox.Display_ungrabButton)
__swig_getmethods__["grabKey"] = lambda x: _openbox.Display_grabKey
if _newclass:grabKey = staticmethod(_openbox.Display_grabKey)
__swig_getmethods__["ungrabKey"] = lambda x: _openbox.Display_ungrabKey
if _newclass:ungrabKey = staticmethod(_openbox.Display_ungrabKey)
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<C OBDisplay instance at %s>" % (self.this,)
return "<C Display instance at %s>" % (self.this,)
class OBDisplayPtr(OBDisplay):
class DisplayPtr(Display):
def __init__(self,this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = OBDisplay
_openbox.OBDisplay_swigregister(OBDisplayPtr)
OBDisplay_initialize = _openbox.OBDisplay_initialize
self.__class__ = Display
_openbox.Display_swigregister(DisplayPtr)
Display_initialize = _openbox.Display_initialize
OBDisplay_destroy = _openbox.OBDisplay_destroy
Display_destroy = _openbox.Display_destroy
OBDisplay_gcCache = _openbox.OBDisplay_gcCache
Display_gcCache = _openbox.Display_gcCache
OBDisplay_screenInfo = _openbox.OBDisplay_screenInfo
Display_screenInfo = _openbox.Display_screenInfo
OBDisplay_findScreen = _openbox.OBDisplay_findScreen
Display_findScreen = _openbox.Display_findScreen
OBDisplay_xkb = _openbox.OBDisplay_xkb
Display_xkb = _openbox.Display_xkb
OBDisplay_xkbEventBase = _openbox.OBDisplay_xkbEventBase
Display_xkbEventBase = _openbox.Display_xkbEventBase
OBDisplay_shape = _openbox.OBDisplay_shape
Display_shape = _openbox.Display_shape
OBDisplay_shapeEventBase = _openbox.OBDisplay_shapeEventBase
Display_shapeEventBase = _openbox.Display_shapeEventBase
OBDisplay_xinerama = _openbox.OBDisplay_xinerama
Display_xinerama = _openbox.Display_xinerama
OBDisplay_numLockMask = _openbox.OBDisplay_numLockMask
Display_numLockMask = _openbox.Display_numLockMask
OBDisplay_scrollLockMask = _openbox.OBDisplay_scrollLockMask
Display_scrollLockMask = _openbox.Display_scrollLockMask
OBDisplay_grab = _openbox.OBDisplay_grab
Display_grab = _openbox.Display_grab
OBDisplay_ungrab = _openbox.OBDisplay_ungrab
Display_ungrab = _openbox.Display_ungrab
OBDisplay_grabButton = _openbox.OBDisplay_grabButton
Display_grabButton = _openbox.Display_grabButton
OBDisplay_ungrabButton = _openbox.OBDisplay_ungrabButton
Display_ungrabButton = _openbox.Display_ungrabButton
OBDisplay_grabKey = _openbox.OBDisplay_grabKey
Display_grabKey = _openbox.Display_grabKey
OBDisplay_ungrabKey = _openbox.OBDisplay_ungrabKey
Display_ungrabKey = _openbox.Display_ungrabKey
class Point(_object):
@ -142,126 +142,126 @@ class PointPtr(Point):
self.__class__ = Point
_openbox.Point_swigregister(PointPtr)
class OBProperty(_object):
class Property(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, OBProperty, name, value)
__setattr__ = lambda self, name, value: _swig_setattr(self, Property, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, OBProperty, name)
Atom_Cardinal = _openbox.OBProperty_Atom_Cardinal
Atom_Window = _openbox.OBProperty_Atom_Window
Atom_Pixmap = _openbox.OBProperty_Atom_Pixmap
Atom_Atom = _openbox.OBProperty_Atom_Atom
Atom_String = _openbox.OBProperty_Atom_String
Atom_Utf8 = _openbox.OBProperty_Atom_Utf8
openbox_pid = _openbox.OBProperty_openbox_pid
wm_colormap_windows = _openbox.OBProperty_wm_colormap_windows
wm_protocols = _openbox.OBProperty_wm_protocols
wm_state = _openbox.OBProperty_wm_state
wm_delete_window = _openbox.OBProperty_wm_delete_window
wm_take_focus = _openbox.OBProperty_wm_take_focus
wm_change_state = _openbox.OBProperty_wm_change_state
wm_name = _openbox.OBProperty_wm_name
wm_icon_name = _openbox.OBProperty_wm_icon_name
wm_class = _openbox.OBProperty_wm_class
wm_window_role = _openbox.OBProperty_wm_window_role
motif_wm_hints = _openbox.OBProperty_motif_wm_hints
blackbox_attributes = _openbox.OBProperty_blackbox_attributes
blackbox_change_attributes = _openbox.OBProperty_blackbox_change_attributes
blackbox_hints = _openbox.OBProperty_blackbox_hints
blackbox_structure_messages = _openbox.OBProperty_blackbox_structure_messages
blackbox_notify_startup = _openbox.OBProperty_blackbox_notify_startup
blackbox_notify_window_add = _openbox.OBProperty_blackbox_notify_window_add
blackbox_notify_window_del = _openbox.OBProperty_blackbox_notify_window_del
blackbox_notify_window_focus = _openbox.OBProperty_blackbox_notify_window_focus
blackbox_notify_current_workspace = _openbox.OBProperty_blackbox_notify_current_workspace
blackbox_notify_workspace_count = _openbox.OBProperty_blackbox_notify_workspace_count
blackbox_notify_window_raise = _openbox.OBProperty_blackbox_notify_window_raise
blackbox_notify_window_lower = _openbox.OBProperty_blackbox_notify_window_lower
blackbox_change_workspace = _openbox.OBProperty_blackbox_change_workspace
blackbox_change_window_focus = _openbox.OBProperty_blackbox_change_window_focus
blackbox_cycle_window_focus = _openbox.OBProperty_blackbox_cycle_window_focus
openbox_show_root_menu = _openbox.OBProperty_openbox_show_root_menu
openbox_show_workspace_menu = _openbox.OBProperty_openbox_show_workspace_menu
net_supported = _openbox.OBProperty_net_supported
net_client_list = _openbox.OBProperty_net_client_list
net_client_list_stacking = _openbox.OBProperty_net_client_list_stacking
net_number_of_desktops = _openbox.OBProperty_net_number_of_desktops
net_desktop_geometry = _openbox.OBProperty_net_desktop_geometry
net_desktop_viewport = _openbox.OBProperty_net_desktop_viewport
net_current_desktop = _openbox.OBProperty_net_current_desktop
net_desktop_names = _openbox.OBProperty_net_desktop_names
net_active_window = _openbox.OBProperty_net_active_window
net_workarea = _openbox.OBProperty_net_workarea
net_supporting_wm_check = _openbox.OBProperty_net_supporting_wm_check
net_close_window = _openbox.OBProperty_net_close_window
net_wm_moveresize = _openbox.OBProperty_net_wm_moveresize
net_wm_name = _openbox.OBProperty_net_wm_name
net_wm_visible_name = _openbox.OBProperty_net_wm_visible_name
net_wm_icon_name = _openbox.OBProperty_net_wm_icon_name
net_wm_visible_icon_name = _openbox.OBProperty_net_wm_visible_icon_name
net_wm_desktop = _openbox.OBProperty_net_wm_desktop
net_wm_window_type = _openbox.OBProperty_net_wm_window_type
net_wm_state = _openbox.OBProperty_net_wm_state
net_wm_strut = _openbox.OBProperty_net_wm_strut
net_wm_allowed_actions = _openbox.OBProperty_net_wm_allowed_actions
net_wm_window_type_desktop = _openbox.OBProperty_net_wm_window_type_desktop
net_wm_window_type_dock = _openbox.OBProperty_net_wm_window_type_dock
net_wm_window_type_toolbar = _openbox.OBProperty_net_wm_window_type_toolbar
net_wm_window_type_menu = _openbox.OBProperty_net_wm_window_type_menu
net_wm_window_type_utility = _openbox.OBProperty_net_wm_window_type_utility
net_wm_window_type_splash = _openbox.OBProperty_net_wm_window_type_splash
net_wm_window_type_dialog = _openbox.OBProperty_net_wm_window_type_dialog
net_wm_window_type_normal = _openbox.OBProperty_net_wm_window_type_normal
net_wm_moveresize_size_topleft = _openbox.OBProperty_net_wm_moveresize_size_topleft
net_wm_moveresize_size_topright = _openbox.OBProperty_net_wm_moveresize_size_topright
net_wm_moveresize_size_bottomleft = _openbox.OBProperty_net_wm_moveresize_size_bottomleft
net_wm_moveresize_size_bottomright = _openbox.OBProperty_net_wm_moveresize_size_bottomright
net_wm_moveresize_move = _openbox.OBProperty_net_wm_moveresize_move
net_wm_action_move = _openbox.OBProperty_net_wm_action_move
net_wm_action_resize = _openbox.OBProperty_net_wm_action_resize
net_wm_action_shade = _openbox.OBProperty_net_wm_action_shade
net_wm_action_maximize_horz = _openbox.OBProperty_net_wm_action_maximize_horz
net_wm_action_maximize_vert = _openbox.OBProperty_net_wm_action_maximize_vert
net_wm_action_change_desktop = _openbox.OBProperty_net_wm_action_change_desktop
net_wm_action_close = _openbox.OBProperty_net_wm_action_close
net_wm_state_modal = _openbox.OBProperty_net_wm_state_modal
net_wm_state_sticky = _openbox.OBProperty_net_wm_state_sticky
net_wm_state_maximized_vert = _openbox.OBProperty_net_wm_state_maximized_vert
net_wm_state_maximized_horz = _openbox.OBProperty_net_wm_state_maximized_horz
net_wm_state_shaded = _openbox.OBProperty_net_wm_state_shaded
net_wm_state_skip_taskbar = _openbox.OBProperty_net_wm_state_skip_taskbar
net_wm_state_skip_pager = _openbox.OBProperty_net_wm_state_skip_pager
net_wm_state_hidden = _openbox.OBProperty_net_wm_state_hidden
net_wm_state_fullscreen = _openbox.OBProperty_net_wm_state_fullscreen
net_wm_state_above = _openbox.OBProperty_net_wm_state_above
net_wm_state_below = _openbox.OBProperty_net_wm_state_below
kde_net_system_tray_windows = _openbox.OBProperty_kde_net_system_tray_windows
kde_net_wm_system_tray_window_for = _openbox.OBProperty_kde_net_wm_system_tray_window_for
kde_net_wm_window_type_override = _openbox.OBProperty_kde_net_wm_window_type_override
NUM_ATOMS = _openbox.OBProperty_NUM_ATOMS
ascii = _openbox.OBProperty_ascii
utf8 = _openbox.OBProperty_utf8
NUM_STRING_TYPE = _openbox.OBProperty_NUM_STRING_TYPE
__getattr__ = lambda self, name: _swig_getattr(self, Property, name)
Atom_Cardinal = _openbox.Property_Atom_Cardinal
Atom_Window = _openbox.Property_Atom_Window
Atom_Pixmap = _openbox.Property_Atom_Pixmap
Atom_Atom = _openbox.Property_Atom_Atom
Atom_String = _openbox.Property_Atom_String
Atom_Utf8 = _openbox.Property_Atom_Utf8
openbox_pid = _openbox.Property_openbox_pid
wm_colormap_windows = _openbox.Property_wm_colormap_windows
wm_protocols = _openbox.Property_wm_protocols
wm_state = _openbox.Property_wm_state
wm_delete_window = _openbox.Property_wm_delete_window
wm_take_focus = _openbox.Property_wm_take_focus
wm_change_state = _openbox.Property_wm_change_state
wm_name = _openbox.Property_wm_name
wm_icon_name = _openbox.Property_wm_icon_name
wm_class = _openbox.Property_wm_class
wm_window_role = _openbox.Property_wm_window_role
motif_wm_hints = _openbox.Property_motif_wm_hints
blackbox_attributes = _openbox.Property_blackbox_attributes
blackbox_change_attributes = _openbox.Property_blackbox_change_attributes
blackbox_hints = _openbox.Property_blackbox_hints
blackbox_structure_messages = _openbox.Property_blackbox_structure_messages
blackbox_notify_startup = _openbox.Property_blackbox_notify_startup
blackbox_notify_window_add = _openbox.Property_blackbox_notify_window_add
blackbox_notify_window_del = _openbox.Property_blackbox_notify_window_del
blackbox_notify_window_focus = _openbox.Property_blackbox_notify_window_focus
blackbox_notify_current_workspace = _openbox.Property_blackbox_notify_current_workspace
blackbox_notify_workspace_count = _openbox.Property_blackbox_notify_workspace_count
blackbox_notify_window_raise = _openbox.Property_blackbox_notify_window_raise
blackbox_notify_window_lower = _openbox.Property_blackbox_notify_window_lower
blackbox_change_workspace = _openbox.Property_blackbox_change_workspace
blackbox_change_window_focus = _openbox.Property_blackbox_change_window_focus
blackbox_cycle_window_focus = _openbox.Property_blackbox_cycle_window_focus
openbox_show_root_menu = _openbox.Property_openbox_show_root_menu
openbox_show_workspace_menu = _openbox.Property_openbox_show_workspace_menu
net_supported = _openbox.Property_net_supported
net_client_list = _openbox.Property_net_client_list
net_client_list_stacking = _openbox.Property_net_client_list_stacking
net_number_of_desktops = _openbox.Property_net_number_of_desktops
net_desktop_geometry = _openbox.Property_net_desktop_geometry
net_desktop_viewport = _openbox.Property_net_desktop_viewport
net_current_desktop = _openbox.Property_net_current_desktop
net_desktop_names = _openbox.Property_net_desktop_names
net_active_window = _openbox.Property_net_active_window
net_workarea = _openbox.Property_net_workarea
net_supporting_wm_check = _openbox.Property_net_supporting_wm_check
net_close_window = _openbox.Property_net_close_window
net_wm_moveresize = _openbox.Property_net_wm_moveresize
net_wm_name = _openbox.Property_net_wm_name
net_wm_visible_name = _openbox.Property_net_wm_visible_name
net_wm_icon_name = _openbox.Property_net_wm_icon_name
net_wm_visible_icon_name = _openbox.Property_net_wm_visible_icon_name
net_wm_desktop = _openbox.Property_net_wm_desktop
net_wm_window_type = _openbox.Property_net_wm_window_type
net_wm_state = _openbox.Property_net_wm_state
net_wm_strut = _openbox.Property_net_wm_strut
net_wm_allowed_actions = _openbox.Property_net_wm_allowed_actions
net_wm_window_type_desktop = _openbox.Property_net_wm_window_type_desktop
net_wm_window_type_dock = _openbox.Property_net_wm_window_type_dock
net_wm_window_type_toolbar = _openbox.Property_net_wm_window_type_toolbar
net_wm_window_type_menu = _openbox.Property_net_wm_window_type_menu
net_wm_window_type_utility = _openbox.Property_net_wm_window_type_utility
net_wm_window_type_splash = _openbox.Property_net_wm_window_type_splash
net_wm_window_type_dialog = _openbox.Property_net_wm_window_type_dialog
net_wm_window_type_normal = _openbox.Property_net_wm_window_type_normal
net_wm_moveresize_size_topleft = _openbox.Property_net_wm_moveresize_size_topleft
net_wm_moveresize_size_topright = _openbox.Property_net_wm_moveresize_size_topright
net_wm_moveresize_size_bottomleft = _openbox.Property_net_wm_moveresize_size_bottomleft
net_wm_moveresize_size_bottomright = _openbox.Property_net_wm_moveresize_size_bottomright
net_wm_moveresize_move = _openbox.Property_net_wm_moveresize_move
net_wm_action_move = _openbox.Property_net_wm_action_move
net_wm_action_resize = _openbox.Property_net_wm_action_resize
net_wm_action_shade = _openbox.Property_net_wm_action_shade
net_wm_action_maximize_horz = _openbox.Property_net_wm_action_maximize_horz
net_wm_action_maximize_vert = _openbox.Property_net_wm_action_maximize_vert
net_wm_action_change_desktop = _openbox.Property_net_wm_action_change_desktop
net_wm_action_close = _openbox.Property_net_wm_action_close
net_wm_state_modal = _openbox.Property_net_wm_state_modal
net_wm_state_sticky = _openbox.Property_net_wm_state_sticky
net_wm_state_maximized_vert = _openbox.Property_net_wm_state_maximized_vert
net_wm_state_maximized_horz = _openbox.Property_net_wm_state_maximized_horz
net_wm_state_shaded = _openbox.Property_net_wm_state_shaded
net_wm_state_skip_taskbar = _openbox.Property_net_wm_state_skip_taskbar
net_wm_state_skip_pager = _openbox.Property_net_wm_state_skip_pager
net_wm_state_hidden = _openbox.Property_net_wm_state_hidden
net_wm_state_fullscreen = _openbox.Property_net_wm_state_fullscreen
net_wm_state_above = _openbox.Property_net_wm_state_above
net_wm_state_below = _openbox.Property_net_wm_state_below
kde_net_system_tray_windows = _openbox.Property_kde_net_system_tray_windows
kde_net_wm_system_tray_window_for = _openbox.Property_kde_net_wm_system_tray_window_for
kde_net_wm_window_type_override = _openbox.Property_kde_net_wm_window_type_override
NUM_ATOMS = _openbox.Property_NUM_ATOMS
ascii = _openbox.Property_ascii
utf8 = _openbox.Property_utf8
NUM_STRING_TYPE = _openbox.Property_NUM_STRING_TYPE
def __init__(self,*args):
self.this = apply(_openbox.new_OBProperty,args)
self.this = apply(_openbox.new_Property,args)
self.thisown = 1
def __del__(self, destroy= _openbox.delete_OBProperty):
def __del__(self, destroy= _openbox.delete_Property):
try:
if self.thisown: destroy(self)
except: pass
def set(*args): return apply(_openbox.OBProperty_set,args)
def get(*args): return apply(_openbox.OBProperty_get,args)
def erase(*args): return apply(_openbox.OBProperty_erase,args)
def atom(*args): return apply(_openbox.OBProperty_atom,args)
def set(*args): return apply(_openbox.Property_set,args)
def get(*args): return apply(_openbox.Property_get,args)
def erase(*args): return apply(_openbox.Property_erase,args)
def atom(*args): return apply(_openbox.Property_atom,args)
def __repr__(self):
return "<C OBProperty instance at %s>" % (self.this,)
return "<C Property instance at %s>" % (self.this,)
class OBPropertyPtr(OBProperty):
class PropertyPtr(Property):
def __init__(self,this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = OBProperty
_openbox.OBProperty_swigregister(OBPropertyPtr)
self.__class__ = Property
_openbox.Property_swigregister(PropertyPtr)
class Rect(_object):
__swig_setmethods__ = {}
@ -365,110 +365,90 @@ class StrutPtr(Strut):
self.__class__ = Strut
_openbox.Strut_swigregister(StrutPtr)
expandTilde = _openbox.expandTilde
bexec = _openbox.bexec
textPropertyToString = _openbox.textPropertyToString
itostring_unsigned_long = _openbox.itostring_unsigned_long
itostring_long = _openbox.itostring_long
itostring_unsigned = _openbox.itostring_unsigned
itostring = _openbox.itostring
putenv = _openbox.putenv
basename = _openbox.basename
class OtkEventHandler(_object):
class EventHandler(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, OtkEventHandler, name, value)
__setattr__ = lambda self, name, value: _swig_setattr(self, EventHandler, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, OtkEventHandler, name)
def handle(*args): return apply(_openbox.OtkEventHandler_handle,args)
def keyPressHandler(*args): return apply(_openbox.OtkEventHandler_keyPressHandler,args)
def keyReleaseHandler(*args): return apply(_openbox.OtkEventHandler_keyReleaseHandler,args)
def buttonPressHandler(*args): return apply(_openbox.OtkEventHandler_buttonPressHandler,args)
def buttonReleaseHandler(*args): return apply(_openbox.OtkEventHandler_buttonReleaseHandler,args)
def motionHandler(*args): return apply(_openbox.OtkEventHandler_motionHandler,args)
def enterHandler(*args): return apply(_openbox.OtkEventHandler_enterHandler,args)
def leaveHandler(*args): return apply(_openbox.OtkEventHandler_leaveHandler,args)
def focusHandler(*args): return apply(_openbox.OtkEventHandler_focusHandler,args)
def unfocusHandler(*args): return apply(_openbox.OtkEventHandler_unfocusHandler,args)
def exposeHandler(*args): return apply(_openbox.OtkEventHandler_exposeHandler,args)
def graphicsExposeHandler(*args): return apply(_openbox.OtkEventHandler_graphicsExposeHandler,args)
def noExposeEventHandler(*args): return apply(_openbox.OtkEventHandler_noExposeEventHandler,args)
def circulateRequestHandler(*args): return apply(_openbox.OtkEventHandler_circulateRequestHandler,args)
def configureRequestHandler(*args): return apply(_openbox.OtkEventHandler_configureRequestHandler,args)
def mapRequestHandler(*args): return apply(_openbox.OtkEventHandler_mapRequestHandler,args)
def resizeRequestHandler(*args): return apply(_openbox.OtkEventHandler_resizeRequestHandler,args)
def circulateHandler(*args): return apply(_openbox.OtkEventHandler_circulateHandler,args)
def configureHandler(*args): return apply(_openbox.OtkEventHandler_configureHandler,args)
def createHandler(*args): return apply(_openbox.OtkEventHandler_createHandler,args)
def destroyHandler(*args): return apply(_openbox.OtkEventHandler_destroyHandler,args)
def gravityHandler(*args): return apply(_openbox.OtkEventHandler_gravityHandler,args)
def mapHandler(*args): return apply(_openbox.OtkEventHandler_mapHandler,args)
def mappingHandler(*args): return apply(_openbox.OtkEventHandler_mappingHandler,args)
def reparentHandler(*args): return apply(_openbox.OtkEventHandler_reparentHandler,args)
def unmapHandler(*args): return apply(_openbox.OtkEventHandler_unmapHandler,args)
def visibilityHandler(*args): return apply(_openbox.OtkEventHandler_visibilityHandler,args)
def colorMapHandler(*args): return apply(_openbox.OtkEventHandler_colorMapHandler,args)
def propertyHandler(*args): return apply(_openbox.OtkEventHandler_propertyHandler,args)
def selectionClearHandler(*args): return apply(_openbox.OtkEventHandler_selectionClearHandler,args)
def selectionHandler(*args): return apply(_openbox.OtkEventHandler_selectionHandler,args)
def selectionRequestHandler(*args): return apply(_openbox.OtkEventHandler_selectionRequestHandler,args)
def clientMessageHandler(*args): return apply(_openbox.OtkEventHandler_clientMessageHandler,args)
def __del__(self, destroy= _openbox.delete_OtkEventHandler):
__getattr__ = lambda self, name: _swig_getattr(self, EventHandler, name)
def handle(*args): return apply(_openbox.EventHandler_handle,args)
def keyPressHandler(*args): return apply(_openbox.EventHandler_keyPressHandler,args)
def keyReleaseHandler(*args): return apply(_openbox.EventHandler_keyReleaseHandler,args)
def buttonPressHandler(*args): return apply(_openbox.EventHandler_buttonPressHandler,args)
def buttonReleaseHandler(*args): return apply(_openbox.EventHandler_buttonReleaseHandler,args)
def motionHandler(*args): return apply(_openbox.EventHandler_motionHandler,args)
def enterHandler(*args): return apply(_openbox.EventHandler_enterHandler,args)
def leaveHandler(*args): return apply(_openbox.EventHandler_leaveHandler,args)
def focusHandler(*args): return apply(_openbox.EventHandler_focusHandler,args)
def unfocusHandler(*args): return apply(_openbox.EventHandler_unfocusHandler,args)
def exposeHandler(*args): return apply(_openbox.EventHandler_exposeHandler,args)
def graphicsExposeHandler(*args): return apply(_openbox.EventHandler_graphicsExposeHandler,args)
def noExposeEventHandler(*args): return apply(_openbox.EventHandler_noExposeEventHandler,args)
def circulateRequestHandler(*args): return apply(_openbox.EventHandler_circulateRequestHandler,args)
def configureRequestHandler(*args): return apply(_openbox.EventHandler_configureRequestHandler,args)
def mapRequestHandler(*args): return apply(_openbox.EventHandler_mapRequestHandler,args)
def resizeRequestHandler(*args): return apply(_openbox.EventHandler_resizeRequestHandler,args)
def circulateHandler(*args): return apply(_openbox.EventHandler_circulateHandler,args)
def configureHandler(*args): return apply(_openbox.EventHandler_configureHandler,args)
def createHandler(*args): return apply(_openbox.EventHandler_createHandler,args)
def destroyHandler(*args): return apply(_openbox.EventHandler_destroyHandler,args)
def gravityHandler(*args): return apply(_openbox.EventHandler_gravityHandler,args)
def mapHandler(*args): return apply(_openbox.EventHandler_mapHandler,args)
def mappingHandler(*args): return apply(_openbox.EventHandler_mappingHandler,args)
def reparentHandler(*args): return apply(_openbox.EventHandler_reparentHandler,args)
def unmapHandler(*args): return apply(_openbox.EventHandler_unmapHandler,args)
def visibilityHandler(*args): return apply(_openbox.EventHandler_visibilityHandler,args)
def colorMapHandler(*args): return apply(_openbox.EventHandler_colorMapHandler,args)
def propertyHandler(*args): return apply(_openbox.EventHandler_propertyHandler,args)
def selectionClearHandler(*args): return apply(_openbox.EventHandler_selectionClearHandler,args)
def selectionHandler(*args): return apply(_openbox.EventHandler_selectionHandler,args)
def selectionRequestHandler(*args): return apply(_openbox.EventHandler_selectionRequestHandler,args)
def clientMessageHandler(*args): return apply(_openbox.EventHandler_clientMessageHandler,args)
def __del__(self, destroy= _openbox.delete_EventHandler):
try:
if self.thisown: destroy(self)
except: pass
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<C OtkEventHandler instance at %s>" % (self.this,)
return "<C EventHandler instance at %s>" % (self.this,)
class OtkEventHandlerPtr(OtkEventHandler):
class EventHandlerPtr(EventHandler):
def __init__(self,this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = OtkEventHandler
_openbox.OtkEventHandler_swigregister(OtkEventHandlerPtr)
cvar = _openbox.cvar
BSENTINEL = cvar.BSENTINEL
self.__class__ = EventHandler
_openbox.EventHandler_swigregister(EventHandlerPtr)
class OtkEventDispatcher(_object):
class EventDispatcher(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, OtkEventDispatcher, name, value)
__setattr__ = lambda self, name, value: _swig_setattr(self, EventDispatcher, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, OtkEventDispatcher, name)
__getattr__ = lambda self, name: _swig_getattr(self, EventDispatcher, name)
def __init__(self,*args):
self.this = apply(_openbox.new_OtkEventDispatcher,args)
self.this = apply(_openbox.new_EventDispatcher,args)
self.thisown = 1
def __del__(self, destroy= _openbox.delete_OtkEventDispatcher):
def __del__(self, destroy= _openbox.delete_EventDispatcher):
try:
if self.thisown: destroy(self)
except: pass
def clearAllHandlers(*args): return apply(_openbox.OtkEventDispatcher_clearAllHandlers,args)
def registerHandler(*args): return apply(_openbox.OtkEventDispatcher_registerHandler,args)
def clearHandler(*args): return apply(_openbox.OtkEventDispatcher_clearHandler,args)
def dispatchEvents(*args): return apply(_openbox.OtkEventDispatcher_dispatchEvents,args)
def setFallbackHandler(*args): return apply(_openbox.OtkEventDispatcher_setFallbackHandler,args)
def getFallbackHandler(*args): return apply(_openbox.OtkEventDispatcher_getFallbackHandler,args)
def setMasterHandler(*args): return apply(_openbox.OtkEventDispatcher_setMasterHandler,args)
def getMasterHandler(*args): return apply(_openbox.OtkEventDispatcher_getMasterHandler,args)
def findHandler(*args): return apply(_openbox.OtkEventDispatcher_findHandler,args)
def lastTime(*args): return apply(_openbox.OtkEventDispatcher_lastTime,args)
def clearAllHandlers(*args): return apply(_openbox.EventDispatcher_clearAllHandlers,args)
def registerHandler(*args): return apply(_openbox.EventDispatcher_registerHandler,args)
def clearHandler(*args): return apply(_openbox.EventDispatcher_clearHandler,args)
def dispatchEvents(*args): return apply(_openbox.EventDispatcher_dispatchEvents,args)
def setFallbackHandler(*args): return apply(_openbox.EventDispatcher_setFallbackHandler,args)
def getFallbackHandler(*args): return apply(_openbox.EventDispatcher_getFallbackHandler,args)
def setMasterHandler(*args): return apply(_openbox.EventDispatcher_setMasterHandler,args)
def getMasterHandler(*args): return apply(_openbox.EventDispatcher_getMasterHandler,args)
def findHandler(*args): return apply(_openbox.EventDispatcher_findHandler,args)
def lastTime(*args): return apply(_openbox.EventDispatcher_lastTime,args)
def __repr__(self):
return "<C OtkEventDispatcher instance at %s>" % (self.this,)
return "<C EventDispatcher instance at %s>" % (self.this,)
class OtkEventDispatcherPtr(OtkEventDispatcher):
class EventDispatcherPtr(EventDispatcher):
def __init__(self,this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = OtkEventDispatcher
_openbox.OtkEventDispatcher_swigregister(OtkEventDispatcherPtr)
self.__class__ = EventDispatcher
_openbox.EventDispatcher_swigregister(EventDispatcherPtr)
class Cursors(_object):
__swig_setmethods__ = {}
@ -504,12 +484,12 @@ class CursorsPtr(Cursors):
self.__class__ = Cursors
_openbox.Cursors_swigregister(CursorsPtr)
class Openbox(OtkEventDispatcher,OtkEventHandler):
class Openbox(EventDispatcher,EventHandler):
__swig_setmethods__ = {}
for _s in [OtkEventDispatcher,OtkEventHandler]: __swig_setmethods__.update(_s.__swig_setmethods__)
for _s in [EventDispatcher,EventHandler]: __swig_setmethods__.update(_s.__swig_setmethods__)
__setattr__ = lambda self, name, value: _swig_setattr(self, Openbox, name, value)
__swig_getmethods__ = {}
for _s in [OtkEventDispatcher,OtkEventHandler]: __swig_getmethods__.update(_s.__swig_getmethods__)
for _s in [EventDispatcher,EventHandler]: __swig_getmethods__.update(_s.__swig_getmethods__)
__getattr__ = lambda self, name: _swig_getattr(self, Openbox, name)
State_Starting = _openbox.Openbox_State_Starting
State_Normal = _openbox.Openbox_State_Normal
@ -542,43 +522,43 @@ class OpenboxPtr(Openbox):
self.__class__ = Openbox
_openbox.Openbox_swigregister(OpenboxPtr)
class OBScreen(OtkEventHandler,):
class Screen(EventHandler,):
__swig_setmethods__ = {}
for _s in [OtkEventHandler,]: __swig_setmethods__.update(_s.__swig_setmethods__)
__setattr__ = lambda self, name, value: _swig_setattr(self, OBScreen, name, value)
for _s in [EventHandler,]: __swig_setmethods__.update(_s.__swig_setmethods__)
__setattr__ = lambda self, name, value: _swig_setattr(self, Screen, name, value)
__swig_getmethods__ = {}
for _s in [OtkEventHandler,]: __swig_getmethods__.update(_s.__swig_getmethods__)
__getattr__ = lambda self, name: _swig_getattr(self, OBScreen, name)
def client(*args): return apply(_openbox.OBScreen_client,args)
def clientCount(*args): return apply(_openbox.OBScreen_clientCount,args)
event_mask = _openbox.OBScreen_event_mask
def number(*args): return apply(_openbox.OBScreen_number,args)
def managed(*args): return apply(_openbox.OBScreen_managed,args)
def imageControl(*args): return apply(_openbox.OBScreen_imageControl,args)
def area(*args): return apply(_openbox.OBScreen_area,args)
def style(*args): return apply(_openbox.OBScreen_style,args)
def focuswindow(*args): return apply(_openbox.OBScreen_focuswindow,args)
def desktop(*args): return apply(_openbox.OBScreen_desktop,args)
def numDesktops(*args): return apply(_openbox.OBScreen_numDesktops,args)
def updateStrut(*args): return apply(_openbox.OBScreen_updateStrut,args)
def manageExisting(*args): return apply(_openbox.OBScreen_manageExisting,args)
def manageWindow(*args): return apply(_openbox.OBScreen_manageWindow,args)
def unmanageWindow(*args): return apply(_openbox.OBScreen_unmanageWindow,args)
def restack(*args): return apply(_openbox.OBScreen_restack,args)
def setDesktopName(*args): return apply(_openbox.OBScreen_setDesktopName,args)
def propertyHandler(*args): return apply(_openbox.OBScreen_propertyHandler,args)
def clientMessageHandler(*args): return apply(_openbox.OBScreen_clientMessageHandler,args)
def mapRequestHandler(*args): return apply(_openbox.OBScreen_mapRequestHandler,args)
for _s in [EventHandler,]: __swig_getmethods__.update(_s.__swig_getmethods__)
__getattr__ = lambda self, name: _swig_getattr(self, Screen, name)
def client(*args): return apply(_openbox.Screen_client,args)
def clientCount(*args): return apply(_openbox.Screen_clientCount,args)
event_mask = _openbox.Screen_event_mask
def number(*args): return apply(_openbox.Screen_number,args)
def managed(*args): return apply(_openbox.Screen_managed,args)
def imageControl(*args): return apply(_openbox.Screen_imageControl,args)
def area(*args): return apply(_openbox.Screen_area,args)
def style(*args): return apply(_openbox.Screen_style,args)
def focuswindow(*args): return apply(_openbox.Screen_focuswindow,args)
def desktop(*args): return apply(_openbox.Screen_desktop,args)
def numDesktops(*args): return apply(_openbox.Screen_numDesktops,args)
def updateStrut(*args): return apply(_openbox.Screen_updateStrut,args)
def manageExisting(*args): return apply(_openbox.Screen_manageExisting,args)
def manageWindow(*args): return apply(_openbox.Screen_manageWindow,args)
def unmanageWindow(*args): return apply(_openbox.Screen_unmanageWindow,args)
def restack(*args): return apply(_openbox.Screen_restack,args)
def setDesktopName(*args): return apply(_openbox.Screen_setDesktopName,args)
def propertyHandler(*args): return apply(_openbox.Screen_propertyHandler,args)
def clientMessageHandler(*args): return apply(_openbox.Screen_clientMessageHandler,args)
def mapRequestHandler(*args): return apply(_openbox.Screen_mapRequestHandler,args)
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<C OBScreen instance at %s>" % (self.this,)
return "<C Screen instance at %s>" % (self.this,)
class OBScreenPtr(OBScreen):
class ScreenPtr(Screen):
def __init__(self,this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = OBScreen
_openbox.OBScreen_swigregister(OBScreenPtr)
self.__class__ = Screen
_openbox.Screen_swigregister(ScreenPtr)
class MwmHints(_object):
__swig_setmethods__ = {}
@ -606,120 +586,120 @@ class MwmHintsPtr(MwmHints):
self.__class__ = MwmHints
_openbox.MwmHints_swigregister(MwmHintsPtr)
class OBClient(OtkEventHandler,):
class Client(EventHandler,):
__swig_setmethods__ = {}
for _s in [OtkEventHandler,]: __swig_setmethods__.update(_s.__swig_setmethods__)
__setattr__ = lambda self, name, value: _swig_setattr(self, OBClient, name, value)
for _s in [EventHandler,]: __swig_setmethods__.update(_s.__swig_setmethods__)
__setattr__ = lambda self, name, value: _swig_setattr(self, Client, name, value)
__swig_getmethods__ = {}
for _s in [OtkEventHandler,]: __swig_getmethods__.update(_s.__swig_getmethods__)
__getattr__ = lambda self, name: _swig_getattr(self, OBClient, name)
__swig_setmethods__["frame"] = _openbox.OBClient_frame_set
__swig_getmethods__["frame"] = _openbox.OBClient_frame_get
if _newclass:frame = property(_openbox.OBClient_frame_get,_openbox.OBClient_frame_set)
Layer_Icon = _openbox.OBClient_Layer_Icon
Layer_Desktop = _openbox.OBClient_Layer_Desktop
Layer_Below = _openbox.OBClient_Layer_Below
Layer_Normal = _openbox.OBClient_Layer_Normal
Layer_Above = _openbox.OBClient_Layer_Above
Layer_Top = _openbox.OBClient_Layer_Top
Layer_Fullscreen = _openbox.OBClient_Layer_Fullscreen
Layer_Internal = _openbox.OBClient_Layer_Internal
NUM_LAYERS = _openbox.OBClient_NUM_LAYERS
TopLeft = _openbox.OBClient_TopLeft
TopRight = _openbox.OBClient_TopRight
BottomLeft = _openbox.OBClient_BottomLeft
BottomRight = _openbox.OBClient_BottomRight
Type_Desktop = _openbox.OBClient_Type_Desktop
Type_Dock = _openbox.OBClient_Type_Dock
Type_Toolbar = _openbox.OBClient_Type_Toolbar
Type_Menu = _openbox.OBClient_Type_Menu
Type_Utility = _openbox.OBClient_Type_Utility
Type_Splash = _openbox.OBClient_Type_Splash
Type_Dialog = _openbox.OBClient_Type_Dialog
Type_Normal = _openbox.OBClient_Type_Normal
MwmFlag_Functions = _openbox.OBClient_MwmFlag_Functions
MwmFlag_Decorations = _openbox.OBClient_MwmFlag_Decorations
MwmFunc_All = _openbox.OBClient_MwmFunc_All
MwmFunc_Resize = _openbox.OBClient_MwmFunc_Resize
MwmFunc_Move = _openbox.OBClient_MwmFunc_Move
MwmFunc_Iconify = _openbox.OBClient_MwmFunc_Iconify
MwmFunc_Maximize = _openbox.OBClient_MwmFunc_Maximize
MwmDecor_All = _openbox.OBClient_MwmDecor_All
MwmDecor_Border = _openbox.OBClient_MwmDecor_Border
MwmDecor_Handle = _openbox.OBClient_MwmDecor_Handle
MwmDecor_Title = _openbox.OBClient_MwmDecor_Title
MwmDecor_Iconify = _openbox.OBClient_MwmDecor_Iconify
MwmDecor_Maximize = _openbox.OBClient_MwmDecor_Maximize
Func_Resize = _openbox.OBClient_Func_Resize
Func_Move = _openbox.OBClient_Func_Move
Func_Iconify = _openbox.OBClient_Func_Iconify
Func_Maximize = _openbox.OBClient_Func_Maximize
Func_Close = _openbox.OBClient_Func_Close
Decor_Titlebar = _openbox.OBClient_Decor_Titlebar
Decor_Handle = _openbox.OBClient_Decor_Handle
Decor_Border = _openbox.OBClient_Decor_Border
Decor_Iconify = _openbox.OBClient_Decor_Iconify
Decor_Maximize = _openbox.OBClient_Decor_Maximize
Decor_Sticky = _openbox.OBClient_Decor_Sticky
Decor_Close = _openbox.OBClient_Decor_Close
State_Remove = _openbox.OBClient_State_Remove
State_Add = _openbox.OBClient_State_Add
State_Toggle = _openbox.OBClient_State_Toggle
event_mask = _openbox.OBClient_event_mask
no_propagate_mask = _openbox.OBClient_no_propagate_mask
__swig_setmethods__["ignore_unmaps"] = _openbox.OBClient_ignore_unmaps_set
__swig_getmethods__["ignore_unmaps"] = _openbox.OBClient_ignore_unmaps_get
if _newclass:ignore_unmaps = property(_openbox.OBClient_ignore_unmaps_get,_openbox.OBClient_ignore_unmaps_set)
def screen(*args): return apply(_openbox.OBClient_screen,args)
def window(*args): return apply(_openbox.OBClient_window,args)
def type(*args): return apply(_openbox.OBClient_type,args)
def normal(*args): return apply(_openbox.OBClient_normal,args)
def desktop(*args): return apply(_openbox.OBClient_desktop,args)
def title(*args): return apply(_openbox.OBClient_title,args)
def iconTitle(*args): return apply(_openbox.OBClient_iconTitle,args)
def appName(*args): return apply(_openbox.OBClient_appName,args)
def appClass(*args): return apply(_openbox.OBClient_appClass,args)
def role(*args): return apply(_openbox.OBClient_role,args)
def canFocus(*args): return apply(_openbox.OBClient_canFocus,args)
def urgent(*args): return apply(_openbox.OBClient_urgent,args)
def focusNotify(*args): return apply(_openbox.OBClient_focusNotify,args)
def shaped(*args): return apply(_openbox.OBClient_shaped,args)
def gravity(*args): return apply(_openbox.OBClient_gravity,args)
def positionRequested(*args): return apply(_openbox.OBClient_positionRequested,args)
def decorations(*args): return apply(_openbox.OBClient_decorations,args)
def funtions(*args): return apply(_openbox.OBClient_funtions,args)
def transientFor(*args): return apply(_openbox.OBClient_transientFor,args)
def modal(*args): return apply(_openbox.OBClient_modal,args)
def shaded(*args): return apply(_openbox.OBClient_shaded,args)
def iconic(*args): return apply(_openbox.OBClient_iconic,args)
def maxVert(*args): return apply(_openbox.OBClient_maxVert,args)
def maxHorz(*args): return apply(_openbox.OBClient_maxHorz,args)
def layer(*args): return apply(_openbox.OBClient_layer,args)
def toggleClientBorder(*args): return apply(_openbox.OBClient_toggleClientBorder,args)
def area(*args): return apply(_openbox.OBClient_area,args)
def strut(*args): return apply(_openbox.OBClient_strut,args)
def move(*args): return apply(_openbox.OBClient_move,args)
def resize(*args): return apply(_openbox.OBClient_resize,args)
def focus(*args): return apply(_openbox.OBClient_focus,args)
def unfocus(*args): return apply(_openbox.OBClient_unfocus,args)
def focusHandler(*args): return apply(_openbox.OBClient_focusHandler,args)
def unfocusHandler(*args): return apply(_openbox.OBClient_unfocusHandler,args)
def propertyHandler(*args): return apply(_openbox.OBClient_propertyHandler,args)
def clientMessageHandler(*args): return apply(_openbox.OBClient_clientMessageHandler,args)
def configureRequestHandler(*args): return apply(_openbox.OBClient_configureRequestHandler,args)
def unmapHandler(*args): return apply(_openbox.OBClient_unmapHandler,args)
def destroyHandler(*args): return apply(_openbox.OBClient_destroyHandler,args)
def reparentHandler(*args): return apply(_openbox.OBClient_reparentHandler,args)
for _s in [EventHandler,]: __swig_getmethods__.update(_s.__swig_getmethods__)
__getattr__ = lambda self, name: _swig_getattr(self, Client, name)
__swig_setmethods__["frame"] = _openbox.Client_frame_set
__swig_getmethods__["frame"] = _openbox.Client_frame_get
if _newclass:frame = property(_openbox.Client_frame_get,_openbox.Client_frame_set)
Layer_Icon = _openbox.Client_Layer_Icon
Layer_Desktop = _openbox.Client_Layer_Desktop
Layer_Below = _openbox.Client_Layer_Below
Layer_Normal = _openbox.Client_Layer_Normal
Layer_Above = _openbox.Client_Layer_Above
Layer_Top = _openbox.Client_Layer_Top
Layer_Fullscreen = _openbox.Client_Layer_Fullscreen
Layer_Internal = _openbox.Client_Layer_Internal
NUM_LAYERS = _openbox.Client_NUM_LAYERS
TopLeft = _openbox.Client_TopLeft
TopRight = _openbox.Client_TopRight
BottomLeft = _openbox.Client_BottomLeft
BottomRight = _openbox.Client_BottomRight
Type_Desktop = _openbox.Client_Type_Desktop
Type_Dock = _openbox.Client_Type_Dock
Type_Toolbar = _openbox.Client_Type_Toolbar
Type_Menu = _openbox.Client_Type_Menu
Type_Utility = _openbox.Client_Type_Utility
Type_Splash = _openbox.Client_Type_Splash
Type_Dialog = _openbox.Client_Type_Dialog
Type_Normal = _openbox.Client_Type_Normal
MwmFlag_Functions = _openbox.Client_MwmFlag_Functions
MwmFlag_Decorations = _openbox.Client_MwmFlag_Decorations
MwmFunc_All = _openbox.Client_MwmFunc_All
MwmFunc_Resize = _openbox.Client_MwmFunc_Resize
MwmFunc_Move = _openbox.Client_MwmFunc_Move
MwmFunc_Iconify = _openbox.Client_MwmFunc_Iconify
MwmFunc_Maximize = _openbox.Client_MwmFunc_Maximize
MwmDecor_All = _openbox.Client_MwmDecor_All
MwmDecor_Border = _openbox.Client_MwmDecor_Border
MwmDecor_Handle = _openbox.Client_MwmDecor_Handle
MwmDecor_Title = _openbox.Client_MwmDecor_Title
MwmDecor_Iconify = _openbox.Client_MwmDecor_Iconify
MwmDecor_Maximize = _openbox.Client_MwmDecor_Maximize
Func_Resize = _openbox.Client_Func_Resize
Func_Move = _openbox.Client_Func_Move
Func_Iconify = _openbox.Client_Func_Iconify
Func_Maximize = _openbox.Client_Func_Maximize
Func_Close = _openbox.Client_Func_Close
Decor_Titlebar = _openbox.Client_Decor_Titlebar
Decor_Handle = _openbox.Client_Decor_Handle
Decor_Border = _openbox.Client_Decor_Border
Decor_Iconify = _openbox.Client_Decor_Iconify
Decor_Maximize = _openbox.Client_Decor_Maximize
Decor_Sticky = _openbox.Client_Decor_Sticky
Decor_Close = _openbox.Client_Decor_Close
State_Remove = _openbox.Client_State_Remove
State_Add = _openbox.Client_State_Add
State_Toggle = _openbox.Client_State_Toggle
event_mask = _openbox.Client_event_mask
no_propagate_mask = _openbox.Client_no_propagate_mask
__swig_setmethods__["ignore_unmaps"] = _openbox.Client_ignore_unmaps_set
__swig_getmethods__["ignore_unmaps"] = _openbox.Client_ignore_unmaps_get
if _newclass:ignore_unmaps = property(_openbox.Client_ignore_unmaps_get,_openbox.Client_ignore_unmaps_set)
def screen(*args): return apply(_openbox.Client_screen,args)
def window(*args): return apply(_openbox.Client_window,args)
def type(*args): return apply(_openbox.Client_type,args)
def normal(*args): return apply(_openbox.Client_normal,args)
def desktop(*args): return apply(_openbox.Client_desktop,args)
def title(*args): return apply(_openbox.Client_title,args)
def iconTitle(*args): return apply(_openbox.Client_iconTitle,args)
def appName(*args): return apply(_openbox.Client_appName,args)
def appClass(*args): return apply(_openbox.Client_appClass,args)
def role(*args): return apply(_openbox.Client_role,args)
def canFocus(*args): return apply(_openbox.Client_canFocus,args)
def urgent(*args): return apply(_openbox.Client_urgent,args)
def focusNotify(*args): return apply(_openbox.Client_focusNotify,args)
def shaped(*args): return apply(_openbox.Client_shaped,args)
def gravity(*args): return apply(_openbox.Client_gravity,args)
def positionRequested(*args): return apply(_openbox.Client_positionRequested,args)
def decorations(*args): return apply(_openbox.Client_decorations,args)
def funtions(*args): return apply(_openbox.Client_funtions,args)
def transientFor(*args): return apply(_openbox.Client_transientFor,args)
def modal(*args): return apply(_openbox.Client_modal,args)
def shaded(*args): return apply(_openbox.Client_shaded,args)
def iconic(*args): return apply(_openbox.Client_iconic,args)
def maxVert(*args): return apply(_openbox.Client_maxVert,args)
def maxHorz(*args): return apply(_openbox.Client_maxHorz,args)
def layer(*args): return apply(_openbox.Client_layer,args)
def toggleClientBorder(*args): return apply(_openbox.Client_toggleClientBorder,args)
def area(*args): return apply(_openbox.Client_area,args)
def strut(*args): return apply(_openbox.Client_strut,args)
def move(*args): return apply(_openbox.Client_move,args)
def resize(*args): return apply(_openbox.Client_resize,args)
def focus(*args): return apply(_openbox.Client_focus,args)
def unfocus(*args): return apply(_openbox.Client_unfocus,args)
def focusHandler(*args): return apply(_openbox.Client_focusHandler,args)
def unfocusHandler(*args): return apply(_openbox.Client_unfocusHandler,args)
def propertyHandler(*args): return apply(_openbox.Client_propertyHandler,args)
def clientMessageHandler(*args): return apply(_openbox.Client_clientMessageHandler,args)
def configureRequestHandler(*args): return apply(_openbox.Client_configureRequestHandler,args)
def unmapHandler(*args): return apply(_openbox.Client_unmapHandler,args)
def destroyHandler(*args): return apply(_openbox.Client_destroyHandler,args)
def reparentHandler(*args): return apply(_openbox.Client_reparentHandler,args)
def __init__(self): raise RuntimeError, "No constructor defined"
def __repr__(self):
return "<C OBClient instance at %s>" % (self.this,)
return "<C Client instance at %s>" % (self.this,)
class OBClientPtr(OBClient):
class ClientPtr(Client):
def __init__(self,this):
self.this = this
if not hasattr(self,"thisown"): self.thisown = 0
self.__class__ = OBClient
_openbox.OBClient_swigregister(OBClientPtr)
self.__class__ = Client
_openbox.Client_swigregister(ClientPtr)
MC_Frame = _openbox.MC_Frame
MC_Titlebar = _openbox.MC_Titlebar

File diff suppressed because it is too large Load diff

View file

@ -133,7 +133,7 @@ PyObject *kbind(PyObject *keylist, ob::KeyContext context, PyObject *func)
return NULL;
}
ob::OBBindings::StringVect vectkeylist;
ob::Bindings::StringVect vectkeylist;
for (int i = 0, end = PyList_Size(keylist); i < end; ++i) {
PyObject *str = PyList_GetItem(keylist, i);
if (!PyString_Check(str)) {
@ -163,7 +163,7 @@ PyObject *kunbind(PyObject *keylist, PyObject *func)
return NULL;
}
ob::OBBindings::StringVect vectkeylist;
ob::Bindings::StringVect vectkeylist;
for (int i = 0, end = PyList_Size(keylist); i < end; ++i) {
PyObject *str = PyList_GetItem(keylist, i);
if (!PyString_Check(str)) {
@ -195,9 +195,9 @@ PyObject *send_client_msg(Window target, int type, Window about,
long data, long data1, long data2,
long data3, long data4)
{
if (type < 0 || type >= otk::OBProperty::NUM_ATOMS) {
if (type < 0 || type >= otk::Property::NUM_ATOMS) {
PyErr_SetString(PyExc_TypeError,
"Invalid atom type. Must be from otk::OBProperty::Atoms");
"Invalid atom type. Must be from otk::Property::Atoms");
return NULL;
}
@ -205,7 +205,7 @@ PyObject *send_client_msg(Window target, int type, Window about,
e.xclient.type = ClientMessage;
e.xclient.format = 32;
e.xclient.message_type =
Openbox::instance->property()->atom((otk::OBProperty::Atoms)type);
Openbox::instance->property()->atom((otk::Property::Atoms)type);
e.xclient.window = about;
e.xclient.data.l[0] = data;
e.xclient.data.l[1] = data1;
@ -213,7 +213,7 @@ PyObject *send_client_msg(Window target, int type, Window about,
e.xclient.data.l[3] = data3;
e.xclient.data.l[4] = data4;
XSendEvent(otk::OBDisplay::display, target, false,
XSendEvent(otk::Display::display, target, false,
SubstructureRedirectMask | SubstructureNotifyMask,
&e);
Py_INCREF(Py_None); return Py_None;

View file

@ -21,7 +21,7 @@ extern "C" {
namespace ob {
class OBClient;
class Client;
enum MouseContext {
MC_Frame,
@ -68,7 +68,7 @@ enum EventAction {
class MouseData {
public:
int screen;
OBClient *client;
Client *client;
Time time;
unsigned int state;
unsigned int button;
@ -83,7 +83,7 @@ public:
int press_clientwidth;
int press_clientheight;
MouseData(int screen, OBClient *client, Time time, unsigned int state,
MouseData(int screen, Client *client, Time time, unsigned int state,
unsigned int button, MouseContext context, MouseAction action,
int xroot, int yroot, const otk::Point &initpos,
const otk::Rect &initarea) {
@ -103,7 +103,7 @@ public:
this->press_clientwidth = initarea.width();
this->press_clientheight = initarea.height();
}
MouseData(int screen, OBClient *client, Time time, unsigned int state,
MouseData(int screen, Client *client, Time time, unsigned int state,
unsigned int button, MouseContext context, MouseAction action) {
this->screen = screen;
this->client = client;
@ -126,11 +126,11 @@ public:
class EventData {
public:
int screen;
OBClient *client;
Client *client;
unsigned int state;
EventAction action;
EventData(int screen, OBClient *client, EventAction action,
EventData(int screen, Client *client, EventAction action,
unsigned int state) {
this->screen = screen;
this->client = client;
@ -142,18 +142,18 @@ public:
class KeyData {
public:
int screen;
OBClient *client;
Client *client;
Time time;
unsigned int state;
std::string key;
KeyData(int screen, OBClient *client, Time time, unsigned int state,
KeyData(int screen, Client *client, Time time, unsigned int state,
unsigned int key) {
this->screen = screen;
this->client = client;
this->time = time;
this->state = state;
this->key = XKeysymToString(XKeycodeToKeysym(otk::OBDisplay::display,
this->key = XKeysymToString(XKeycodeToKeysym(otk::Display::display,
key, 0));
}
};

View file

@ -45,18 +45,18 @@ static int anotherWMRunning(Display *display, XErrorEvent *) {
namespace ob {
OBScreen::OBScreen(int screen)
: OBWidget(OBWidget::Type_Root),
Screen::Screen(int screen)
: WidgetBase(WidgetBase::Type_Root),
_number(screen)
{
assert(screen >= 0); assert(screen < ScreenCount(otk::OBDisplay::display));
_info = otk::OBDisplay::screenInfo(screen);
assert(screen >= 0); assert(screen < ScreenCount(otk::Display::display));
_info = otk::Display::screenInfo(screen);
::running = false;
XErrorHandler old = XSetErrorHandler(::anotherWMRunning);
XSelectInput(otk::OBDisplay::display, _info->rootWindow(),
OBScreen::event_mask);
XSync(otk::OBDisplay::display, false);
XSelectInput(otk::Display::display, _info->rootWindow(),
Screen::event_mask);
XSync(otk::Display::display, false);
XSetErrorHandler(old);
_managed = !::running;
@ -66,17 +66,17 @@ OBScreen::OBScreen(int screen)
_number, XVisualIDFromVisual(_info->visual()), _info->depth());
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::openbox_pid,
otk::OBProperty::Atom_Cardinal,
otk::Property::openbox_pid,
otk::Property::Atom_Cardinal,
(unsigned long) getpid());
// set the mouse cursor for the root window (the default cursor)
XDefineCursor(otk::OBDisplay::display, _info->rootWindow(),
XDefineCursor(otk::Display::display, _info->rootWindow(),
Openbox::instance->cursors().session);
// initialize the shit that is used for all drawing on the screen
_image_control = new otk::BImageControl(Openbox::instance->timerManager(),
_info, true);
_image_control = new otk::ImageControl(Openbox::instance->timerManager(),
_info, true);
_image_control->installRootColormap();
_root_cmap_installed = True;
@ -102,16 +102,16 @@ OBScreen::OBScreen(int screen)
unsigned long geometry[] = { _info->width(),
_info->height() };
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_desktop_geometry,
otk::OBProperty::Atom_Cardinal,
otk::Property::net_desktop_geometry,
otk::Property::Atom_Cardinal,
geometry, 2);
// Set the net_desktop_names property
std::vector<std::string> names;
python_get_stringlist("desktop_names", &names);
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_desktop_names,
otk::OBProperty::utf8,
otk::Property::net_desktop_names,
otk::Property::utf8,
names);
// the above set() will cause the updateDesktopNames to fire right away so
// we have a list of desktop names
@ -126,10 +126,10 @@ OBScreen::OBScreen(int screen)
// create the window which gets focus when no clients get it
XSetWindowAttributes attr;
attr.override_redirect = true;
_focuswindow = XCreateWindow(otk::OBDisplay::display, _info->rootWindow(),
_focuswindow = XCreateWindow(otk::Display::display, _info->rootWindow(),
-100, -100, 1, 1, 0, 0, InputOnly,
_info->visual(), CWOverrideRedirect, &attr);
XMapWindow(otk::OBDisplay::display, _focuswindow);
XMapWindow(otk::Display::display, _focuswindow);
// these may be further updated if any pre-existing windows are found in
// the manageExising() function
@ -145,11 +145,11 @@ OBScreen::OBScreen(int screen)
}
OBScreen::~OBScreen()
Screen::~Screen()
{
if (! _managed) return;
XSelectInput(otk::OBDisplay::display, _info->rootWindow(), NoEventMask);
XSelectInput(otk::Display::display, _info->rootWindow(), NoEventMask);
// unmanage all windows
while (!clients.empty())
@ -159,25 +159,25 @@ OBScreen::~OBScreen()
EventData data(_number, 0, EventShutdown, 0);
Openbox::instance->bindings()->fireEvent(&data);
XDestroyWindow(otk::OBDisplay::display, _focuswindow);
XDestroyWindow(otk::OBDisplay::display, _supportwindow);
XDestroyWindow(otk::Display::display, _focuswindow);
XDestroyWindow(otk::Display::display, _supportwindow);
delete _image_control;
}
void OBScreen::manageExisting()
void Screen::manageExisting()
{
unsigned int i, j, nchild;
Window r, p, *children;
XQueryTree(otk::OBDisplay::display, _info->rootWindow(), &r, &p,
XQueryTree(otk::Display::display, _info->rootWindow(), &r, &p,
&children, &nchild);
// preen the window list of all icon windows... for better dockapp support
for (i = 0; i < nchild; i++) {
if (children[i] == None) continue;
XWMHints *wmhints = XGetWMHints(otk::OBDisplay::display,
XWMHints *wmhints = XGetWMHints(otk::Display::display,
children[i]);
if (wmhints) {
@ -201,7 +201,7 @@ void OBScreen::manageExisting()
continue;
XWindowAttributes attrib;
if (XGetWindowAttributes(otk::OBDisplay::display, children[i], &attrib)) {
if (XGetWindowAttributes(otk::Display::display, children[i], &attrib)) {
if (attrib.override_redirect) continue;
if (attrib.map_state != IsUnmapped) {
@ -214,11 +214,11 @@ void OBScreen::manageExisting()
}
void OBScreen::updateStrut()
void Screen::updateStrut()
{
_strut.left = _strut.right = _strut.top = _strut.bottom = 0;
OBClient::List::iterator it, end = clients.end();
Client::List::iterator it, end = clients.end();
for (it = clients.begin(); it != end; ++it) {
const otk::Strut &s = (*it)->strut();
_strut.left = std::max(_strut.left, s.left);
@ -230,7 +230,7 @@ void OBScreen::updateStrut()
}
void OBScreen::calcArea()
void Screen::calcArea()
{
otk::Rect old_area = _area;
@ -276,103 +276,103 @@ void OBScreen::calcArea()
}
void OBScreen::changeSupportedAtoms()
void Screen::changeSupportedAtoms()
{
// create the netwm support window
_supportwindow = XCreateSimpleWindow(otk::OBDisplay::display,
_supportwindow = XCreateSimpleWindow(otk::Display::display,
_info->rootWindow(),
0, 0, 1, 1, 0, 0, 0);
// set supporting window
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_supporting_wm_check,
otk::OBProperty::Atom_Window,
otk::Property::net_supporting_wm_check,
otk::Property::Atom_Window,
_supportwindow);
//set properties on the supporting window
Openbox::instance->property()->set(_supportwindow,
otk::OBProperty::net_wm_name,
otk::OBProperty::utf8,
otk::Property::net_wm_name,
otk::Property::utf8,
"Openbox");
Openbox::instance->property()->set(_supportwindow,
otk::OBProperty::net_supporting_wm_check,
otk::OBProperty::Atom_Window,
otk::Property::net_supporting_wm_check,
otk::Property::Atom_Window,
_supportwindow);
Atom supported[] = {
otk::OBProperty::net_current_desktop,
otk::OBProperty::net_number_of_desktops,
otk::OBProperty::net_desktop_geometry,
otk::OBProperty::net_desktop_viewport,
otk::OBProperty::net_active_window,
otk::OBProperty::net_workarea,
otk::OBProperty::net_client_list,
otk::OBProperty::net_client_list_stacking,
otk::OBProperty::net_desktop_names,
otk::OBProperty::net_close_window,
otk::OBProperty::net_wm_name,
otk::OBProperty::net_wm_visible_name,
otk::OBProperty::net_wm_icon_name,
otk::OBProperty::net_wm_visible_icon_name,
otk::Property::net_current_desktop,
otk::Property::net_number_of_desktops,
otk::Property::net_desktop_geometry,
otk::Property::net_desktop_viewport,
otk::Property::net_active_window,
otk::Property::net_workarea,
otk::Property::net_client_list,
otk::Property::net_client_list_stacking,
otk::Property::net_desktop_names,
otk::Property::net_close_window,
otk::Property::net_wm_name,
otk::Property::net_wm_visible_name,
otk::Property::net_wm_icon_name,
otk::Property::net_wm_visible_icon_name,
/*
otk::OBProperty::net_wm_desktop,
otk::Property::net_wm_desktop,
*/
otk::OBProperty::net_wm_strut,
otk::OBProperty::net_wm_window_type,
otk::OBProperty::net_wm_window_type_desktop,
otk::OBProperty::net_wm_window_type_dock,
otk::OBProperty::net_wm_window_type_toolbar,
otk::OBProperty::net_wm_window_type_menu,
otk::OBProperty::net_wm_window_type_utility,
otk::OBProperty::net_wm_window_type_splash,
otk::OBProperty::net_wm_window_type_dialog,
otk::OBProperty::net_wm_window_type_normal,
otk::Property::net_wm_strut,
otk::Property::net_wm_window_type,
otk::Property::net_wm_window_type_desktop,
otk::Property::net_wm_window_type_dock,
otk::Property::net_wm_window_type_toolbar,
otk::Property::net_wm_window_type_menu,
otk::Property::net_wm_window_type_utility,
otk::Property::net_wm_window_type_splash,
otk::Property::net_wm_window_type_dialog,
otk::Property::net_wm_window_type_normal,
/*
otk::OBProperty::net_wm_moveresize,
otk::OBProperty::net_wm_moveresize_size_topleft,
otk::OBProperty::net_wm_moveresize_size_topright,
otk::OBProperty::net_wm_moveresize_size_bottomleft,
otk::OBProperty::net_wm_moveresize_size_bottomright,
otk::OBProperty::net_wm_moveresize_move,
otk::Property::net_wm_moveresize,
otk::Property::net_wm_moveresize_size_topleft,
otk::Property::net_wm_moveresize_size_topright,
otk::Property::net_wm_moveresize_size_bottomleft,
otk::Property::net_wm_moveresize_size_bottomright,
otk::Property::net_wm_moveresize_move,
*/
/*
otk::OBProperty::net_wm_allowed_actions,
otk::OBProperty::net_wm_action_move,
otk::OBProperty::net_wm_action_resize,
otk::OBProperty::net_wm_action_shade,
otk::OBProperty::net_wm_action_maximize_horz,
otk::OBProperty::net_wm_action_maximize_vert,
otk::OBProperty::net_wm_action_change_desktop,
otk::OBProperty::net_wm_action_close,
otk::Property::net_wm_allowed_actions,
otk::Property::net_wm_action_move,
otk::Property::net_wm_action_resize,
otk::Property::net_wm_action_shade,
otk::Property::net_wm_action_maximize_horz,
otk::Property::net_wm_action_maximize_vert,
otk::Property::net_wm_action_change_desktop,
otk::Property::net_wm_action_close,
*/
otk::OBProperty::net_wm_state,
otk::OBProperty::net_wm_state_modal,
otk::OBProperty::net_wm_state_maximized_vert,
otk::OBProperty::net_wm_state_maximized_horz,
otk::OBProperty::net_wm_state_shaded,
otk::OBProperty::net_wm_state_skip_taskbar,
otk::OBProperty::net_wm_state_skip_pager,
otk::OBProperty::net_wm_state_hidden,
otk::OBProperty::net_wm_state_fullscreen,
otk::OBProperty::net_wm_state_above,
otk::OBProperty::net_wm_state_below,
otk::Property::net_wm_state,
otk::Property::net_wm_state_modal,
otk::Property::net_wm_state_maximized_vert,
otk::Property::net_wm_state_maximized_horz,
otk::Property::net_wm_state_shaded,
otk::Property::net_wm_state_skip_taskbar,
otk::Property::net_wm_state_skip_pager,
otk::Property::net_wm_state_hidden,
otk::Property::net_wm_state_fullscreen,
otk::Property::net_wm_state_above,
otk::Property::net_wm_state_below,
};
const int num_supported = sizeof(supported)/sizeof(Atom);
// convert to the atom values
for (int i = 0; i < num_supported; ++i)
supported[i] =
Openbox::instance->property()->atom((otk::OBProperty::Atoms)supported[i]);
Openbox::instance->property()->atom((otk::Property::Atoms)supported[i]);
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_supported,
otk::OBProperty::Atom_Atom,
otk::Property::net_supported,
otk::Property::Atom_Atom,
supported, num_supported);
}
void OBScreen::changeClientList()
void Screen::changeClientList()
{
Window *windows;
unsigned int size = clients.size();
@ -383,16 +383,16 @@ void OBScreen::changeClientList()
windows = new Window[size];
win_it = windows;
OBClient::List::const_iterator it = clients.begin();
const OBClient::List::const_iterator end = clients.end();
Client::List::const_iterator it = clients.begin();
const Client::List::const_iterator end = clients.end();
for (; it != end; ++it, ++win_it)
*win_it = (*it)->window();
} else
windows = (Window*) 0;
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_client_list,
otk::OBProperty::Atom_Window,
otk::Property::net_client_list,
otk::Property::Atom_Window,
windows, size);
if (size)
@ -402,7 +402,7 @@ void OBScreen::changeClientList()
}
void OBScreen::changeStackingList()
void Screen::changeStackingList()
{
Window *windows;
unsigned int size = _stacking.size();
@ -416,16 +416,16 @@ void OBScreen::changeStackingList()
windows = new Window[size];
win_it = windows;
OBClient::List::const_iterator it = _stacking.begin();
const OBClient::List::const_iterator end = _stacking.end();
Client::List::const_iterator it = _stacking.begin();
const Client::List::const_iterator end = _stacking.end();
for (; it != end; ++it, ++win_it)
*win_it = (*it)->window();
} else
windows = (Window*) 0;
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_client_list_stacking,
otk::OBProperty::Atom_Window,
otk::Property::net_client_list_stacking,
otk::Property::Atom_Window,
windows, size);
if (size)
@ -433,7 +433,7 @@ void OBScreen::changeStackingList()
}
void OBScreen::changeWorkArea() {
void Screen::changeWorkArea() {
unsigned long *dims = new unsigned long[4 * _num_desktops];
for (long i = 0; i < _num_desktops; ++i) {
// XXX: this could be different for each workspace
@ -443,27 +443,27 @@ void OBScreen::changeWorkArea() {
dims[(i * 4) + 3] = _area.height();
}
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_workarea,
otk::OBProperty::Atom_Cardinal,
otk::Property::net_workarea,
otk::Property::Atom_Cardinal,
dims, 4 * _num_desktops);
delete [] dims;
}
void OBScreen::manageWindow(Window window)
void Screen::manageWindow(Window window)
{
OBClient *client = 0;
Client *client = 0;
XWMHints *wmhint;
XSetWindowAttributes attrib_set;
otk::OBDisplay::grab();
otk::Display::grab();
// is the window a docking app
if ((wmhint = XGetWMHints(otk::OBDisplay::display, window))) {
if ((wmhint = XGetWMHints(otk::Display::display, window))) {
if ((wmhint->flags & StateHint) &&
wmhint->initial_state == WithdrawnState) {
//slit->addClient(w); // XXX: make dock apps work!
otk::OBDisplay::ungrab();
otk::Display::ungrab();
XFree(wmhint);
return;
@ -472,13 +472,13 @@ void OBScreen::manageWindow(Window window)
}
// choose the events we want to receive on the CLIENT window
attrib_set.event_mask = OBClient::event_mask;
attrib_set.do_not_propagate_mask = OBClient::no_propagate_mask;
XChangeWindowAttributes(otk::OBDisplay::display, window,
attrib_set.event_mask = Client::event_mask;
attrib_set.do_not_propagate_mask = Client::no_propagate_mask;
XChangeWindowAttributes(otk::Display::display, window,
CWEventMask|CWDontPropagate, &attrib_set);
// create the OBClient class, which gets all of the hints on the window
client = new OBClient(_number, window);
// create the Client class, which gets all of the hints on the window
client = new Client(_number, window);
// register for events
Openbox::instance->registerHandler(window, client);
// add to the wm's map
@ -489,7 +489,7 @@ void OBScreen::manageWindow(Window window)
// specify that if we exit, the window should not be destroyed and should be
// reparented back to root automatically
XChangeSaveSet(otk::OBDisplay::display, window, SetModeInsert);
XChangeSaveSet(otk::Display::display, window, SetModeInsert);
if (!(Openbox::instance->state() == Openbox::State_Starting ||
client->positionRequested())) {
@ -500,7 +500,7 @@ void OBScreen::manageWindow(Window window)
}
// create the decoration frame for the client window
client->frame = new OBFrame(client, &_style);
client->frame = new Frame(client, &_style);
// add to the wm's map
Openbox::instance->addClient(client->frame->window(), client);
@ -526,7 +526,7 @@ void OBScreen::manageWindow(Window window)
// XXX: handle any requested states such as maximized
otk::OBDisplay::ungrab();
otk::Display::ungrab();
// add to the screen's list
clients.push_back(client);
@ -548,9 +548,9 @@ void OBScreen::manageWindow(Window window)
}
void OBScreen::unmanageWindow(OBClient *client)
void Screen::unmanageWindow(Client *client)
{
OBFrame *frame = client->frame;
Frame *frame = client->frame;
// call the python CLOSEWINDOW binding
EventData data(_number, client, EventCloseWindow, 0);
@ -575,10 +575,10 @@ void OBScreen::unmanageWindow(OBClient *client)
Openbox::instance->clearHandler(client->window());
// remove the window from our save set
XChangeSaveSet(otk::OBDisplay::display, client->window(), SetModeDelete);
XChangeSaveSet(otk::Display::display, client->window(), SetModeDelete);
// we dont want events no more
XSelectInput(otk::OBDisplay::display, client->window(), NoEventMask);
XSelectInput(otk::Display::display, client->window(), NoEventMask);
frame->hide();
@ -610,7 +610,7 @@ void OBScreen::unmanageWindow(OBClient *client)
changeClientList();
}
void OBScreen::restack(bool raise, OBClient *client)
void Screen::restack(bool raise, Client *client)
{
const int layer = client->layer();
std::vector<Window> wins;
@ -619,7 +619,7 @@ void OBScreen::restack(bool raise, OBClient *client)
// the stacking list is from highest to lowest
OBClient::List::iterator it = _stacking.begin(), end = _stacking.end();
Client::List::iterator it = _stacking.begin(), end = _stacking.end();
// insert the windows above this window
for (; it != end; ++it) {
if ((*it)->layer() < layer || (raise && (*it)->layer() == layer))
@ -633,11 +633,11 @@ void OBScreen::restack(bool raise, OBClient *client)
for (; it != end; ++it)
wins.push_back((*it)->frame->window());
XRestackWindows(otk::OBDisplay::display, &wins[0], wins.size());
XRestackWindows(otk::Display::display, &wins[0], wins.size());
changeStackingList();
}
void OBScreen::changeDesktop(long desktop)
void Screen::changeDesktop(long desktop)
{
assert(desktop >= 0 && desktop < _num_desktops);
@ -649,13 +649,13 @@ void OBScreen::changeDesktop(long desktop)
_desktop = desktop;
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_current_desktop,
otk::OBProperty::Atom_Cardinal,
otk::Property::net_current_desktop,
otk::Property::Atom_Cardinal,
_desktop);
if (old == _desktop) return;
OBClient::List::iterator it, end = clients.end();
Client::List::iterator it, end = clients.end();
for (it = clients.begin(); it != end; ++it) {
if ((*it)->desktop() == old) {
(*it)->frame->hide();
@ -669,7 +669,7 @@ void OBScreen::changeDesktop(long desktop)
Openbox::instance->setFocusedClient(0);
}
void OBScreen::changeNumDesktops(long num)
void Screen::changeNumDesktops(long num)
{
assert(num > 0);
@ -679,16 +679,16 @@ void OBScreen::changeNumDesktops(long num)
_num_desktops = num;
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_number_of_desktops,
otk::OBProperty::Atom_Cardinal,
otk::Property::net_number_of_desktops,
otk::Property::Atom_Cardinal,
_num_desktops);
// set the viewport hint
unsigned long *viewport = new unsigned long[_num_desktops * 2];
memset(viewport, 0, sizeof(unsigned long) * _num_desktops * 2);
Openbox::instance->property()->set(_info->rootWindow(),
otk::OBProperty::net_desktop_viewport,
otk::OBProperty::Atom_Cardinal,
otk::Property::net_desktop_viewport,
otk::Property::Atom_Cardinal,
viewport, _num_desktops * 2);
delete [] viewport;
@ -697,79 +697,79 @@ void OBScreen::changeNumDesktops(long num)
}
void OBScreen::updateDesktopNames()
void Screen::updateDesktopNames()
{
const otk::OBProperty *property = Openbox::instance->property();
const otk::Property *property = Openbox::instance->property();
unsigned long num = (unsigned) -1;
if (!property->get(_info->rootWindow(),
otk::OBProperty::net_desktop_names,
otk::OBProperty::utf8, &num, &_desktop_names))
otk::Property::net_desktop_names,
otk::Property::utf8, &num, &_desktop_names))
_desktop_names.clear();
while ((long)_desktop_names.size() < _num_desktops)
_desktop_names.push_back("Unnamed");
}
void OBScreen::setDesktopName(long i, const std::string &name)
void Screen::setDesktopName(long i, const std::string &name)
{
assert(i >= 0);
if (i >= _num_desktops) return;
const otk::OBProperty *property = Openbox::instance->property();
const otk::Property *property = Openbox::instance->property();
otk::OBProperty::StringVect newnames = _desktop_names;
otk::Property::StringVect newnames = _desktop_names;
newnames[i] = name;
property->set(_info->rootWindow(), otk::OBProperty::net_desktop_names,
otk::OBProperty::utf8, newnames);
property->set(_info->rootWindow(), otk::Property::net_desktop_names,
otk::Property::utf8, newnames);
}
void OBScreen::propertyHandler(const XPropertyEvent &e)
void Screen::propertyHandler(const XPropertyEvent &e)
{
otk::OtkEventHandler::propertyHandler(e);
otk::EventHandler::propertyHandler(e);
const otk::OBProperty *property = Openbox::instance->property();
const otk::Property *property = Openbox::instance->property();
// compress changes to a single property into a single change
XEvent ce;
while (XCheckTypedEvent(otk::OBDisplay::display, e.type, &ce)) {
while (XCheckTypedEvent(otk::Display::display, e.type, &ce)) {
// XXX: it would be nice to compress ALL changes to a property, not just
// changes in a row without other props between.
if (ce.xproperty.atom != e.atom) {
XPutBackEvent(otk::OBDisplay::display, &ce);
XPutBackEvent(otk::Display::display, &ce);
break;
}
}
if (e.atom == property->atom(otk::OBProperty::net_desktop_names))
if (e.atom == property->atom(otk::Property::net_desktop_names))
updateDesktopNames();
}
void OBScreen::clientMessageHandler(const XClientMessageEvent &e)
void Screen::clientMessageHandler(const XClientMessageEvent &e)
{
otk::OtkEventHandler::clientMessageHandler(e);
otk::EventHandler::clientMessageHandler(e);
if (e.format != 32) return;
const otk::OBProperty *property = Openbox::instance->property();
const otk::Property *property = Openbox::instance->property();
if (e.message_type == property->atom(otk::OBProperty::net_current_desktop)) {
if (e.message_type == property->atom(otk::Property::net_current_desktop)) {
changeDesktop(e.data.l[0]);
} else if (e.message_type ==
property->atom(otk::OBProperty::net_number_of_desktops)) {
property->atom(otk::Property::net_number_of_desktops)) {
changeNumDesktops(e.data.l[0]);
}
// XXX: so many client messages to handle here! ..or not.. they go to clients
}
void OBScreen::mapRequestHandler(const XMapRequestEvent &e)
void Screen::mapRequestHandler(const XMapRequestEvent &e)
{
otk::OtkEventHandler::mapRequestHandler(e);
otk::EventHandler::mapRequestHandler(e);
#ifdef DEBUG
printf("MapRequest for 0x%lx\n", e.window);
@ -780,15 +780,15 @@ void OBScreen::mapRequestHandler(const XMapRequestEvent &e)
right to the client window, because of how they are sent and their struct
layout.
*/
OBClient *c = Openbox::instance->findClient(e.window);
Client *c = Openbox::instance->findClient(e.window);
if (c) {
// send a net_active_window message
XEvent ce;
ce.xclient.type = ClientMessage;
ce.xclient.message_type =
Openbox::instance->property()->atom(otk::OBProperty::net_active_window);
ce.xclient.display = otk::OBDisplay::display;
Openbox::instance->property()->atom(otk::Property::net_active_window);
ce.xclient.display = otk::Display::display;
ce.xclient.window = c->window();
ce.xclient.format = 32;
ce.xclient.data.l[0] = 0l;
@ -796,7 +796,7 @@ void OBScreen::mapRequestHandler(const XMapRequestEvent &e)
ce.xclient.data.l[2] = 0l;
ce.xclient.data.l[3] = 0l;
ce.xclient.data.l[4] = 0l;
XSendEvent(otk::OBDisplay::display, _info->rootWindow(), false,
XSendEvent(otk::Display::display, _info->rootWindow(), false,
SubstructureRedirectMask | SubstructureNotifyMask,
&ce);
} else

View file

@ -3,7 +3,7 @@
#define __screen_hh
/*! @file screen.hh
@brief OBScreen manages a single screen
@brief Screen manages a single screen
*/
extern "C" {
@ -25,13 +25,13 @@ extern "C" {
namespace ob {
class OBClient;
class OBRootWindow;
class Client;
class RootWindow;
//! Manages a single screen
/*!
*/
class OBScreen : public otk::OtkEventHandler, public OBWidget {
class Screen : public otk::EventHandler, public WidgetBase {
public:
//! Holds a list of otk::Strut objects
typedef std::list<otk::Strut*> StrutList;
@ -46,7 +46,7 @@ public:
ButtonReleaseMask;
//! All managed clients on the screen (in order of being mapped)
OBClient::List clients;
Client::List clients;
private:
//! Was %Openbox able to manage the screen?
@ -59,7 +59,7 @@ private:
const otk::ScreenInfo *_info;
//! The Image Control used for rendering on the screen
otk::BImageControl *_image_control;
otk::ImageControl *_image_control;
//! The style with which to render on the screen
otk::Style _style;
@ -81,7 +81,7 @@ private:
Window _supportwindow;
//! A list of all managed clients on the screen, in their stacking order
OBClient::List _stacking;
Client::List _stacking;
//! The desktop currently being displayed
long _desktop;
@ -90,16 +90,16 @@ private:
long _num_desktops;
//! The names of all desktops
otk::OBProperty::StringVect _desktop_names;
otk::Property::StringVect _desktop_names;
//! Calculate the OBScreen::_area member
//! Calculate the Screen::_area member
void calcArea();
//! Set the list of supported NETWM atoms on the root window
void changeSupportedAtoms();
//! Set the client list on the root window
/*!
Sets the _NET_CLIENT_LIST root window property.<br>
Also calls OBScreen::updateStackingList.
Also calls Screen::updateStackingList.
*/
void changeClientList();
//! Set the client stacking list on the root window
@ -133,10 +133,10 @@ private:
public:
#ifndef SWIG
//! Constructs a new OBScreen object
OBScreen(int screen);
//! Destroys the OBScreen object
virtual ~OBScreen();
//! Constructs a new Screen object
Screen(int screen);
//! Destroys the Screen object
virtual ~Screen();
#endif
inline int number() const { return _number; }
@ -148,7 +148,7 @@ public:
*/
inline bool managed() const { return _managed; }
//! Returns the Image Control used for rendering on the screen
inline otk::BImageControl *imageControl() { return _image_control; }
inline otk::ImageControl *imageControl() { return _image_control; }
//! Returns the area of the screen not reserved by applications' Struts
inline const otk::Rect &area() const { return _area; }
//! Returns the style in use on the screen
@ -179,11 +179,11 @@ public:
it, etc.
@param client The client to unmanage
*/
void unmanageWindow(OBClient *client);
void unmanageWindow(Client *client);
//! Raises/Lowers a client window above/below all others in its stacking
//! layer
void restack(bool raise, OBClient *client);
void restack(bool raise, Client *client);
//! Sets the name of a desktop by changing the root window property
/*!

View file

@ -1,12 +1,12 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifndef __obwidgetbase_hh
#define __obwidgetbase_hh
#ifndef __widgetbase_hh
#define __widgetbase_hh
#include "python.hh"
namespace ob {
class OBWidget {
class WidgetBase {
public:
enum WidgetType {
Type_Frame,
@ -28,7 +28,7 @@ private:
WidgetType _type;
public:
OBWidget(WidgetType type) : _type(type) {}
WidgetBase(WidgetType type) : _type(type) {}
inline WidgetType type() const { return _type; }
@ -68,4 +68,4 @@ public:
}
#endif // __obwidgetbase_hh
#endif // __widgetbase_hh