buttons have their pixmaps!
Dana Jansens danakj@orodu.net
7 files changed,
168 insertions(+),
41 deletions(-)
M
otk/otk_wrap.cc
→
otk/otk_wrap.cc
@@ -10927,6 +10927,74 @@ return NULL;
} +static PyObject *_wrap_Style_getCloseButtonMask(PyObject *self, PyObject *args) { + PyObject *resultobj; + otk::Style *arg1 = (otk::Style *) 0 ; + otk::PixmapMask *result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:Style_getCloseButtonMask",&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_otk__Style,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + result = (otk::PixmapMask *)(arg1)->getCloseButtonMask(); + + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__PixmapMask, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Style_getMaximizeButtonMask(PyObject *self, PyObject *args) { + PyObject *resultobj; + otk::Style *arg1 = (otk::Style *) 0 ; + otk::PixmapMask *result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:Style_getMaximizeButtonMask",&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_otk__Style,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + result = (otk::PixmapMask *)(arg1)->getMaximizeButtonMask(); + + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__PixmapMask, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Style_getIconifyButtonMask(PyObject *self, PyObject *args) { + PyObject *resultobj; + otk::Style *arg1 = (otk::Style *) 0 ; + otk::PixmapMask *result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:Style_getIconifyButtonMask",&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_otk__Style,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + result = (otk::PixmapMask *)(arg1)->getIconifyButtonMask(); + + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__PixmapMask, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Style_getStickyButtonMask(PyObject *self, PyObject *args) { + PyObject *resultobj; + otk::Style *arg1 = (otk::Style *) 0 ; + otk::PixmapMask *result; + PyObject * obj0 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"O:Style_getStickyButtonMask",&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_otk__Style,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + result = (otk::PixmapMask *)(arg1)->getStickyButtonMask(); + + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__PixmapMask, 0); + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_Style_getTextFocus(PyObject *self, PyObject *args) { PyObject *resultobj; otk::Style *arg1 = (otk::Style *) 0 ;@@ -13077,6 +13145,10 @@ { (char *)"Style_readDatabaseTexture", _wrap_Style_readDatabaseTexture, METH_VARARGS },
{ (char *)"Style_readDatabaseColor", _wrap_Style_readDatabaseColor, METH_VARARGS }, { (char *)"Style_readDatabaseFont", _wrap_Style_readDatabaseFont, METH_VARARGS }, { (char *)"Style_load", _wrap_Style_load, METH_VARARGS }, + { (char *)"Style_getCloseButtonMask", _wrap_Style_getCloseButtonMask, METH_VARARGS }, + { (char *)"Style_getMaximizeButtonMask", _wrap_Style_getMaximizeButtonMask, METH_VARARGS }, + { (char *)"Style_getIconifyButtonMask", _wrap_Style_getIconifyButtonMask, METH_VARARGS }, + { (char *)"Style_getStickyButtonMask", _wrap_Style_getStickyButtonMask, METH_VARARGS }, { (char *)"Style_getTextFocus", _wrap_Style_getTextFocus, METH_VARARGS }, { (char *)"Style_getTextUnfocus", _wrap_Style_getTextUnfocus, METH_VARARGS }, { (char *)"Style_getButtonPicFocus", _wrap_Style_getButtonPicFocus, METH_VARARGS },
M
otk/style.hh
→
otk/style.hh
@@ -84,6 +84,11 @@ const Configuration &style);
void load(const Configuration &style); + inline PixmapMask *getCloseButtonMask(void) { return &close_button; } + inline PixmapMask *getMaximizeButtonMask(void) { return &max_button; } + inline PixmapMask *getIconifyButtonMask(void) { return &icon_button; } + inline PixmapMask *getStickyButtonMask(void) { return &stick_button; } + inline BColor *getTextFocus(void) { return &l_text_focus; } inline BColor *getTextUnfocus(void) { return &l_text_unfocus; }
M
otk/texture.cc
→
otk/texture.cc
@@ -158,8 +158,8 @@ Pixmap BTexture::render(const unsigned int width, const unsigned int height,
const Pixmap old) { assert(texture() != BTexture::NoTexture); - if (texture() == (BTexture::Flat | BTexture::Solid)) - return None; +// if (texture() == (BTexture::Flat | BTexture::Solid)) +// return None; if (texture() == BTexture::Parent_Relative) return ParentRelative;
M
src/client.cc
→
src/client.cc
@@ -1009,14 +1009,14 @@
void OBClient::reparentHandler(const XReparentEvent &e) { + // this is when the client is first taken captive in the frame + if (e.parent == frame->plate()) return; + #ifdef DEBUG printf("ReparentNotify for 0x%lx\n", e.window); #endif // DEBUG OtkEventHandler::reparentHandler(e); - - // this is when the client is first taken captive in the frame - if (e.parent == frame->plate()) return; /* This event is quite rare and is usually handled in unmapHandler.
M
src/labelwidget.cc
→
src/labelwidget.cc
@@ -72,41 +72,38 @@
void OBLabelWidget::update() { - if (_dirty) { - std::string t = _text; - int x = _sidemargin; // x coord for the text + OtkWidget::update(); - // find a string that will fit inside the area for text - int max_length = width() - _sidemargin * 2; - if (max_length <= 0) { - t = ""; // can't fit anything - } else { - size_t text_len = t.size(); - int length; + std::string t = _text; + int x = _sidemargin; // x coord for the text + + // find a string that will fit inside the area for text + int max_length = width() - _sidemargin * 2; + if (max_length <= 0) { + t = ""; // can't fit anything + } else { + size_t text_len = t.size(); + int length; - do { - t.resize(text_len); - length = _font->measureString(t); - } while (length > max_length && text_len-- > 0); + do { + t.resize(text_len); + length = _font->measureString(t); + } while (length > max_length && text_len-- > 0); - // justify the text - switch (_justify) { - case otk::Style::RightJustify: - x += max_length - length; - break; - case otk::Style::CenterJustify: - x += (max_length - length) / 2; - break; - case otk::Style::LeftJustify: - break; - } + // justify the text + switch (_justify) { + case otk::Style::RightJustify: + x += max_length - length; + break; + case otk::Style::CenterJustify: + x += (max_length - length) / 2; + break; + case otk::Style::LeftJustify: + break; } - - OtkWidget::update(); + } - _font->drawString(_xftdraw, x, 0, *_text_color, t); - } else - OtkWidget::update(); + _font->drawString(_xftdraw, x, 0, *_text_color, t); }