From 28b8f67562bb7eb15134f2bf7a8394f0a009b9ba Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 23 Jan 2003 05:20:13 +0000 Subject: remove the word "sticky" from everywhere, and replace with "all desktops". change the titlebar layout to use D instead of S for the all-desktops button --- src/buttonwidget.cc | 12 ++++++------ src/client.cc | 4 ++-- src/client.hh | 18 ++++++++++-------- src/frame.cc | 30 +++++++++++++----------------- src/frame.hh | 6 +++--- src/openbox.py | 6 +++--- src/openbox_wrap.cc | 12 ++++++------ src/python.hh | 2 +- src/screen.cc | 4 ++-- src/widgetbase.hh | 6 +++--- 10 files changed, 49 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/buttonwidget.cc b/src/buttonwidget.cc index c6677861..810911be 100644 --- a/src/buttonwidget.cc +++ b/src/buttonwidget.cc @@ -32,7 +32,7 @@ void ButtonWidget::setTextures() bool p = _pressed; switch (type()) { - case Type_StickyButton: + case Type_AllDesktopsButton: if (_client->desktop() == (signed)0xffffffff) p = true; break; @@ -52,7 +52,7 @@ void ButtonWidget::setTextures() else setTexture(_style->gripUnfocusBackground()); break; - case Type_StickyButton: + case Type_AllDesktopsButton: case Type_MaximizeButton: case Type_CloseButton: case Type_IconifyButton: @@ -84,7 +84,7 @@ void ButtonWidget::setStyle(otk::RenderStyle *style) case Type_RightGrip: setBorderColor(_style->frameBorderColor()); break; - case Type_StickyButton: + case Type_AllDesktopsButton: case Type_CloseButton: case Type_MaximizeButton: case Type_IconifyButton: @@ -98,7 +98,7 @@ void ButtonWidget::setStyle(otk::RenderStyle *style) void ButtonWidget::update() { switch (type()) { - case Type_StickyButton: + case Type_AllDesktopsButton: if ((_client->desktop() == (signed)0xffffffff) != _state) { _state = !_state; setTextures(); @@ -128,8 +128,8 @@ void ButtonWidget::renderForeground() if (draw) { switch (type()) { - case Type_StickyButton: - pm = _style->stickyMask(); + case Type_AllDesktopsButton: + pm = _style->alldesktopsMask(); break; case Type_CloseButton: pm = _style->closeMask(); diff --git a/src/client.cc b/src/client.cc index 54afbc9a..27d89c07 100644 --- a/src/client.cc +++ b/src/client.cc @@ -169,8 +169,8 @@ void Client::getType() void Client::setupDecorAndFunctions() { // start with everything (cept fullscreen) - _decorations = Decor_Titlebar | Decor_Handle | Decor_Border | Decor_Sticky | - Decor_Iconify | Decor_Maximize; + _decorations = Decor_Titlebar | Decor_Handle | Decor_Border | + Decor_AllDesktops | Decor_Iconify | Decor_Maximize; _functions = Func_Resize | Func_Move | Func_Iconify | Func_Maximize | Func_Shade; diff --git a/src/client.hh b/src/client.hh index 5788a3e6..123193d4 100644 --- a/src/client.hh +++ b/src/client.hh @@ -89,7 +89,7 @@ public: enum WindowType { Type_Desktop, //!< A desktop (bottom-most window) Type_Dock, //!< A dock bar/panel window Type_Toolbar, //!< A toolbar window, pulled off an app - Type_Menu, //!< A sticky menu from an app + Type_Menu, //!< An unpinned menu from an app Type_Utility, //!< A small utility window such as a palette Type_Splash, //!< A splash screen window Type_Dialog, //!< A dialog window @@ -133,13 +133,15 @@ public: typedef unsigned char FunctionFlags; //! The decorations the client window wants to be displayed on it - enum Decoration { Decor_Titlebar = 1 << 0, //!< Display a titlebar - Decor_Handle = 1 << 1, //!< Display a handle (bottom) - Decor_Border = 1 << 2, //!< Display a border - Decor_Iconify = 1 << 3, //!< Display an iconify button - Decor_Maximize = 1 << 4, //!< Display a maximize button - Decor_Sticky = 1 << 5, //!< Display a sticky button - Decor_Close = 1 << 6 //!< Display a close button + enum Decoration { Decor_Titlebar = 1 << 0, //!< Display a titlebar + Decor_Handle = 1 << 1, //!< Display a handle (bottom) + Decor_Border = 1 << 2, //!< Display a border + Decor_Iconify = 1 << 3, //!< Display an iconify button + Decor_Maximize = 1 << 4, //!< Display a maximize button + //! Display a button to toggle the window's placement on + //! all desktops + Decor_AllDesktops = 1 << 5, + Decor_Close = 1 << 6 //!< Display a close button }; //! Holds a bitmask of Client::Decoration values typedef unsigned char DecorationFlags; diff --git a/src/frame.cc b/src/frame.cc index 531db48d..956e853c 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -33,7 +33,7 @@ Frame::Frame(Client *client, otk::RenderStyle *style) _button_close(&_titlebar, WidgetBase::Type_CloseButton, client), _button_iconify(&_titlebar, WidgetBase::Type_IconifyButton, client), _button_max(&_titlebar, WidgetBase::Type_MaximizeButton, client), - _button_stick(&_titlebar, WidgetBase::Type_StickyButton, client), + _button_alldesk(&_titlebar, WidgetBase::Type_AllDesktopsButton, client), _label(&_titlebar, WidgetBase::Type_Label), _handle(this, WidgetBase::Type_Handle), _grip_left(&_handle, WidgetBase::Type_LeftGrip, client), @@ -164,8 +164,8 @@ void Frame::adjustSize() _button_iconify.setGeometry(0, bevel + 1, butsize, butsize); if (_decorations & Client::Decor_Maximize) _button_max.setGeometry(0, bevel + 1, butsize, butsize); - if (_decorations & Client::Decor_Sticky) - _button_stick.setGeometry(0, bevel + 1, butsize, butsize); + if (_decorations & Client::Decor_AllDesktops) + _button_alldesk.setGeometry(0, bevel + 1, butsize, butsize); if (_decorations & Client::Decor_Close) _button_close.setGeometry(0, bevel + 1, butsize, butsize); @@ -204,9 +204,9 @@ void Frame::adjustSize() continue; } break; - case 's': - case 'S': - if (!tit_s && (_decorations & Client::Decor_Sticky)) { + case 'd': + case 'D': + if (!tit_s && (_decorations & Client::Decor_AllDesktops)) { tit_s = true; continue; } @@ -255,10 +255,10 @@ void Frame::adjustSize() _button_max.move(x, _button_max.rect().y()); x += _button_max.width(); break; - case 's': - case 'S': - _button_stick.move(x, _button_stick.rect().y()); - x += _button_stick.width(); + case 'd': + case 'D': + _button_alldesk.move(x, _button_alldesk.rect().y()); + x += _button_alldesk.width(); break; case 'c': case 'C': @@ -278,15 +278,11 @@ void Frame::adjustSize() width, _style->handleWidth()); _grip_left.setGeometry(-bwidth, -bwidth, - // XXX: get a Point class in otk and use that for - // the 'buttons size' since theyre all the same butsize * 2, _handle.height()); _grip_right.setGeometry(((_handle.rect().right() + 1) - butsize * 2), -bwidth, - // XXX: get a Point class in otk and use that for - // the 'buttons size' since theyre all the same butsize * 2, _handle.height()); _innersize.bottom += _handle.height() + bwidth; @@ -317,9 +313,9 @@ void Frame::adjustSize() else _button_max.hide(); if (tit_s) - _button_stick.show(); + _button_alldesk.show(); else - _button_stick.hide(); + _button_alldesk.hide(); if (tit_c) _button_close.show(); else @@ -401,7 +397,7 @@ void Frame::adjustShape() void Frame::adjustState() { - _button_stick.update(); + _button_alldesk.update(); _button_max.update(); } diff --git a/src/frame.hh b/src/frame.hh index 40c08199..b2cc2d16 100644 --- a/src/frame.hh +++ b/src/frame.hh @@ -52,7 +52,7 @@ private: ButtonWidget _button_close; ButtonWidget _button_iconify; ButtonWidget _button_max; - ButtonWidget _button_stick; + ButtonWidget _button_alldesk; LabelWidget _label; BackgroundWidget _handle; ButtonWidget _grip_left; @@ -132,8 +132,8 @@ public: inline Window button_iconify() const { return _button_iconify.window(); } //! Gets the window id of the frame's "maximize button" subelement inline Window button_max() const { return _button_max.window(); } - //! Gets the window id of the frame's "sticky button" subelement - inline Window button_stick() const { return _button_stick.window(); } + //! Gets the window id of the frame's "all desktops button" subelement + inline Window button_alldesk() const { return _button_alldesk.window(); } //! Gets the window id of the frame's "handle" subelement inline Window handle() const { return _handle.window(); } //! Gets the window id of the frame's "left grip" subelement diff --git a/src/openbox.py b/src/openbox.py index ac8b0c6c..ea88e12a 100644 --- a/src/openbox.py +++ b/src/openbox.py @@ -773,7 +773,7 @@ class Client(EventHandler,): 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_AllDesktops = _openbox.Client_Decor_AllDesktops Decor_Close = _openbox.Client_Decor_Close State_Remove = _openbox.Client_State_Remove State_Add = _openbox.Client_State_Add @@ -869,7 +869,7 @@ class Frame(_object): def button_close(*args): return apply(_openbox.Frame_button_close,args) def button_iconify(*args): return apply(_openbox.Frame_button_iconify,args) def button_max(*args): return apply(_openbox.Frame_button_max,args) - def button_stick(*args): return apply(_openbox.Frame_button_stick,args) + def button_alldesk(*args): return apply(_openbox.Frame_button_alldesk,args) def handle(*args): return apply(_openbox.Frame_handle,args) def grip_left(*args): return apply(_openbox.Frame_grip_left,args) def grip_right(*args): return apply(_openbox.Frame_grip_right,args) @@ -890,7 +890,7 @@ MC_Window = _openbox.MC_Window MC_MaximizeButton = _openbox.MC_MaximizeButton MC_CloseButton = _openbox.MC_CloseButton MC_IconifyButton = _openbox.MC_IconifyButton -MC_StickyButton = _openbox.MC_StickyButton +MC_AllDesktopsButton = _openbox.MC_AllDesktopsButton MC_Grip = _openbox.MC_Grip MC_Root = _openbox.MC_Root MC_MenuItem = _openbox.MC_MenuItem diff --git a/src/openbox_wrap.cc b/src/openbox_wrap.cc index 523e8451..43b0e95e 100644 --- a/src/openbox_wrap.cc +++ b/src/openbox_wrap.cc @@ -9975,15 +9975,15 @@ static PyObject *_wrap_Frame_button_max(PyObject *self, PyObject *args) { } -static PyObject *_wrap_Frame_button_stick(PyObject *self, PyObject *args) { +static PyObject *_wrap_Frame_button_alldesk(PyObject *self, PyObject *args) { PyObject *resultobj; ob::Frame *arg1 = (ob::Frame *) 0 ; Window result; PyObject * obj0 = 0 ; - if(!PyArg_ParseTuple(args,(char *)"O:Frame_button_stick",&obj0)) goto fail; + if(!PyArg_ParseTuple(args,(char *)"O:Frame_button_alldesk",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_ob__Frame,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - result = (Window)((ob::Frame const *)arg1)->button_stick(); + result = (Window)((ob::Frame const *)arg1)->button_alldesk(); resultobj = PyInt_FromLong((long)result); return resultobj; @@ -11724,7 +11724,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Frame_button_close", _wrap_Frame_button_close, METH_VARARGS }, { (char *)"Frame_button_iconify", _wrap_Frame_button_iconify, METH_VARARGS }, { (char *)"Frame_button_max", _wrap_Frame_button_max, METH_VARARGS }, - { (char *)"Frame_button_stick", _wrap_Frame_button_stick, METH_VARARGS }, + { (char *)"Frame_button_alldesk", _wrap_Frame_button_alldesk, METH_VARARGS }, { (char *)"Frame_handle", _wrap_Frame_handle, METH_VARARGS }, { (char *)"Frame_grip_left", _wrap_Frame_grip_left, METH_VARARGS }, { (char *)"Frame_grip_right", _wrap_Frame_grip_right, METH_VARARGS }, @@ -12018,7 +12018,7 @@ static swig_const_info swig_const_table[] = { { SWIG_PY_INT, (char *)"Client_Decor_Border", (long) ob::Client::Decor_Border, 0, 0, 0}, { SWIG_PY_INT, (char *)"Client_Decor_Iconify", (long) ob::Client::Decor_Iconify, 0, 0, 0}, { SWIG_PY_INT, (char *)"Client_Decor_Maximize", (long) ob::Client::Decor_Maximize, 0, 0, 0}, -{ SWIG_PY_INT, (char *)"Client_Decor_Sticky", (long) ob::Client::Decor_Sticky, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"Client_Decor_AllDesktops", (long) ob::Client::Decor_AllDesktops, 0, 0, 0}, { SWIG_PY_INT, (char *)"Client_Decor_Close", (long) ob::Client::Decor_Close, 0, 0, 0}, { SWIG_PY_INT, (char *)"Client_State_Remove", (long) ob::Client::State_Remove, 0, 0, 0}, { SWIG_PY_INT, (char *)"Client_State_Add", (long) ob::Client::State_Add, 0, 0, 0}, @@ -12033,7 +12033,7 @@ static swig_const_info swig_const_table[] = { { SWIG_PY_INT, (char *)"MC_MaximizeButton", (long) ob::MC_MaximizeButton, 0, 0, 0}, { SWIG_PY_INT, (char *)"MC_CloseButton", (long) ob::MC_CloseButton, 0, 0, 0}, { SWIG_PY_INT, (char *)"MC_IconifyButton", (long) ob::MC_IconifyButton, 0, 0, 0}, -{ SWIG_PY_INT, (char *)"MC_StickyButton", (long) ob::MC_StickyButton, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"MC_AllDesktopsButton", (long) ob::MC_AllDesktopsButton, 0, 0, 0}, { SWIG_PY_INT, (char *)"MC_Grip", (long) ob::MC_Grip, 0, 0, 0}, { SWIG_PY_INT, (char *)"MC_Root", (long) ob::MC_Root, 0, 0, 0}, { SWIG_PY_INT, (char *)"MC_MenuItem", (long) ob::MC_MenuItem, 0, 0, 0}, diff --git a/src/python.hh b/src/python.hh index de9afdfb..b9798781 100644 --- a/src/python.hh +++ b/src/python.hh @@ -32,7 +32,7 @@ enum MouseContext { MC_MaximizeButton, MC_CloseButton, MC_IconifyButton, - MC_StickyButton, + MC_AllDesktopsButton, MC_Grip, MC_Root, MC_MenuItem, diff --git a/src/screen.cc b/src/screen.cc index a7aded34..1de4f72a 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -478,7 +478,7 @@ void Screen::manageWindow(Window window) openbox->addClient(client->frame->label(), client); openbox->addClient(client->frame->button_max(), client); openbox->addClient(client->frame->button_iconify(), client); - openbox->addClient(client->frame->button_stick(), client); + openbox->addClient(client->frame->button_alldesk(), client); openbox->addClient(client->frame->button_close(), client); openbox->addClient(client->frame->handle(), client); openbox->addClient(client->frame->grip_left(), client); @@ -543,7 +543,7 @@ void Screen::unmanageWindow(Client *client) openbox->removeClient(frame->label()); openbox->removeClient(frame->button_max()); openbox->removeClient(frame->button_iconify()); - openbox->removeClient(frame->button_stick()); + openbox->removeClient(frame->button_alldesk()); openbox->removeClient(frame->button_close()); openbox->removeClient(frame->handle()); openbox->removeClient(frame->grip_left()); diff --git a/src/widgetbase.hh b/src/widgetbase.hh index 29211f4a..d8307574 100644 --- a/src/widgetbase.hh +++ b/src/widgetbase.hh @@ -17,7 +17,7 @@ public: Type_MaximizeButton, Type_CloseButton, Type_IconifyButton, - Type_StickyButton, + Type_AllDesktopsButton, Type_LeftGrip, Type_RightGrip, Type_Client, @@ -50,8 +50,8 @@ public: return MC_CloseButton; case Type_IconifyButton: return MC_IconifyButton; - case Type_StickyButton: - return MC_StickyButton; + case Type_AllDesktopsButton: + return MC_AllDesktopsButton; case Type_LeftGrip: return MC_Grip; case Type_RightGrip: -- cgit v1.2.3