summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-23 00:14:44 +0000
committerDana Jansens <danakj@orodu.net>2003-01-23 00:14:44 +0000
commitdd6f90684899e8e26e653af4b2e7e7eab1abf798 (patch)
tree6abc26138d2e929dc05cad1435ec02664eb4c988 /src
parent17d63184998b747e1a0554dc4364a36238b039e1 (diff)
compiles with the new render subsystem...
Diffstat (limited to 'src')
-rw-r--r--src/backgroundwidget.cc16
-rw-r--r--src/backgroundwidget.hh2
-rw-r--r--src/buttonwidget.cc47
-rw-r--r--src/buttonwidget.hh3
-rw-r--r--src/frame.cc20
-rw-r--r--src/frame.hh6
-rw-r--r--src/labelwidget.cc38
-rw-r--r--src/labelwidget.hh12
-rw-r--r--src/openbox.py2
-rw-r--r--src/openbox_wrap.cc95
-rw-r--r--src/screen.cc15
-rw-r--r--src/screen.hh12
12 files changed, 134 insertions, 134 deletions
diff --git a/src/backgroundwidget.cc b/src/backgroundwidget.cc
index 9d660a79..4d1a51d0 100644
--- a/src/backgroundwidget.cc
+++ b/src/backgroundwidget.cc
@@ -26,21 +26,21 @@ void BackgroundWidget::setTextures()
switch (type()) {
case Type_Titlebar:
if (_focused)
- setTexture(_style->getTitleFocus());
+ setTexture(_style->titlebarFocusBackground());
else
- setTexture(_style->getTitleUnfocus());
+ setTexture(_style->titlebarUnfocusBackground());
break;
case Type_Handle:
if (_focused)
- setTexture(_style->getHandleFocus());
+ setTexture(_style->handleFocusBackground());
else
- setTexture(_style->getHandleUnfocus());
+ setTexture(_style->handleUnfocusBackground());
break;
case Type_Plate:
if (_focused)
- setBorderColor(&_style->getFrameFocus()->color());
+ setBorderColor(_style->clientBorderFocusColor());
else
- setBorderColor(&_style->getFrameUnfocus()->color());
+ setBorderColor(_style->clientBorderUnfocusColor());
break;
default:
assert(false); // there's no other background widgets!
@@ -48,14 +48,14 @@ void BackgroundWidget::setTextures()
}
-void BackgroundWidget::setStyle(otk::Style *style)
+void BackgroundWidget::setStyle(otk::RenderStyle *style)
{
Widget::setStyle(style);
setTextures();
switch (type()) {
case Type_Titlebar:
case Type_Handle:
- setBorderColor(_style->getBorderColor());
+ setBorderColor(_style->frameBorderColor());
break;
case Type_Plate:
break;
diff --git a/src/backgroundwidget.hh b/src/backgroundwidget.hh
index 23dd9918..640ac45e 100644
--- a/src/backgroundwidget.hh
+++ b/src/backgroundwidget.hh
@@ -16,7 +16,7 @@ public:
BackgroundWidget(otk::Widget *parent, WidgetBase::WidgetType type);
virtual ~BackgroundWidget();
- virtual void setStyle(otk::Style *style);
+ virtual void setStyle(otk::RenderStyle *style);
virtual void adjust();
diff --git a/src/buttonwidget.cc b/src/buttonwidget.cc
index 52398d92..4c1bd908 100644
--- a/src/buttonwidget.cc
+++ b/src/buttonwidget.cc
@@ -30,9 +30,9 @@ void ButtonWidget::setTextures()
case Type_LeftGrip:
case Type_RightGrip:
if (_focused)
- setTexture(_style->getGripFocus());
+ setTexture(_style->gripFocusBackground());
else
- setTexture(_style->getGripUnfocus());
+ setTexture(_style->gripUnfocusBackground());
break;
case Type_StickyButton:
case Type_CloseButton:
@@ -40,14 +40,14 @@ void ButtonWidget::setTextures()
case Type_IconifyButton:
if (_pressed) {
if (_focused)
- setTexture(_style->getButtonPressedFocus());
+ setTexture(_style->buttonPressFocusBackground());
else
- setTexture(_style->getButtonPressedUnfocus());
+ setTexture(_style->buttonPressUnfocusBackground());
} else {
if (_focused)
- setTexture(_style->getButtonFocus());
+ setTexture(_style->buttonUnpressFocusBackground());
else
- setTexture(_style->getButtonUnfocus());
+ setTexture(_style->buttonUnpressUnfocusBackground());
}
break;
default:
@@ -56,7 +56,7 @@ void ButtonWidget::setTextures()
}
-void ButtonWidget::setStyle(otk::Style *style)
+void ButtonWidget::setStyle(otk::RenderStyle *style)
{
otk::Widget::setStyle(style);
setTextures();
@@ -64,7 +64,7 @@ void ButtonWidget::setStyle(otk::Style *style)
switch (type()) {
case Type_LeftGrip:
case Type_RightGrip:
- setBorderColor(_style->getBorderColor());
+ setBorderColor(_style->frameBorderColor());
break;
case Type_StickyButton:
case Type_CloseButton:
@@ -79,25 +79,30 @@ void ButtonWidget::setStyle(otk::Style *style)
void ButtonWidget::update()
{
+ printf("ButtonWidget::update()\n");
+}
+
+void ButtonWidget::renderForeground()
+{
otk::PixmapMask *pm;
int width;
bool draw = _dirty;
- otk::Widget::update();
+ otk::Widget::renderForeground();
if (draw) {
switch (type()) {
case Type_StickyButton:
- pm = _style->getStickyButtonMask();
+ pm = _style->stickyMask();
break;
case Type_CloseButton:
- pm = _style->getCloseButtonMask();
+ pm = _style->closeMask();
break;
case Type_MaximizeButton:
- pm = _style->getMaximizeButtonMask();
+ pm = _style->maximizeMask();
break;
case Type_IconifyButton:
- pm = _style->getIconifyButtonMask();
+ pm = _style->iconifyMask();
break;
case Type_LeftGrip:
case Type_RightGrip:
@@ -109,23 +114,23 @@ void ButtonWidget::update()
if (pm->mask == None) return; // no mask for the button, leave it empty
width = _rect.width();
-
- otk::Pen pen(_focused ? *_style->getButtonPicFocus() :
- *_style->getButtonPicUnfocus());
+
+ otk::RenderColor *color = (_focused ? _style->buttonFocusColor() :
+ _style->buttonUnfocusColor());
// set the clip region
- XSetClipMask(**otk::display, pen.gc(), pm->mask);
- XSetClipOrigin(**otk::display, pen.gc(),
+ XSetClipMask(**otk::display, color->gc(), pm->mask);
+ XSetClipOrigin(**otk::display, color->gc(),
(width - pm->w)/2, (width - pm->h)/2);
// fill in the clipped region
- XFillRectangle(**otk::display, _window, pen.gc(),
+ XFillRectangle(**otk::display, _window, color->gc(),
(width - pm->w)/2, (width - pm->h)/2,
(width + pm->w)/2, (width + pm->h)/2);
// unset the clip region
- XSetClipMask(**otk::display, pen.gc(), None);
- XSetClipOrigin(**otk::display, pen.gc(), 0, 0);
+ XSetClipMask(**otk::display, color->gc(), None);
+ XSetClipOrigin(**otk::display, color->gc(), 0, 0);
}
}
diff --git a/src/buttonwidget.hh b/src/buttonwidget.hh
index 16a21184..5a994a9b 100644
--- a/src/buttonwidget.hh
+++ b/src/buttonwidget.hh
@@ -18,11 +18,12 @@ public:
ButtonWidget(otk::Widget *parent, WidgetBase::WidgetType type);
virtual ~ButtonWidget();
- virtual void setStyle(otk::Style *style);
+ virtual void setStyle(otk::RenderStyle *style);
virtual void adjust();
virtual void update();
+ virtual void renderForeground();
virtual void focus();
virtual void unfocus();
diff --git a/src/frame.cc b/src/frame.cc
index 9606c420..e186e898 100644
--- a/src/frame.cc
+++ b/src/frame.cc
@@ -23,7 +23,7 @@ namespace ob {
const long Frame::event_mask;
-Frame::Frame(Client *client, otk::Style *style)
+Frame::Frame(Client *client, otk::RenderStyle *style)
: otk::Widget(openbox, style, Horizontal, 0, 1, true),
WidgetBase(WidgetBase::Type_Frame),
_client(client),
@@ -71,7 +71,7 @@ void Frame::setTitle(const otk::ustring &text)
}
-void Frame::setStyle(otk::Style *style)
+void Frame::setStyle(otk::RenderStyle *style)
{
assert(style);
@@ -87,7 +87,7 @@ void Frame::setStyle(otk::Style *style)
_style = style;
- setBorderColor(_style->getBorderColor());
+ setBorderColor(_style->frameBorderColor());
// if !replace, then adjust() will get called after the client is grabbed!
if (replace) {
@@ -129,11 +129,11 @@ void Frame::adjustSize()
int bwidth; // width to make borders
int cbwidth; // width of the inner client border
int butsize=0; // width and height of the titlebar buttons
- const int bevel = _style->getBevelWidth();
+ const int bevel = _style->bevelWidth();
if (_decorations & Client::Decor_Border) {
- bwidth = _style->getBorderWidth();
- cbwidth = _style->getFrameWidth();
+ bwidth = _style->frameBorderWidth();
+ cbwidth = _style->clientBorderWidth();
} else
bwidth = cbwidth = 0;
_innersize.left = _innersize.top = _innersize.bottom = _innersize.right =
@@ -153,11 +153,11 @@ void Frame::adjustSize()
_titlebar.setGeometry(-bwidth,
-bwidth,
width,
- _style->getFont()->height() + bevel * 2);
+ _style->labelFont()->height() + bevel * 2);
_innersize.top += _titlebar.height() + bwidth;
// set the label size
- _label.setGeometry(0, bevel, width, _style->getFont()->height());
+ _label.setGeometry(0, bevel, width, _style->labelFont()->height());
// set the buttons sizes
butsize = _label.height() - 2;
if (_decorations & Client::Decor_Iconify)
@@ -275,7 +275,7 @@ void Frame::adjustSize()
if (_decorations & Client::Decor_Handle) {
_handle.setGeometry(-bwidth,
_innersize.top + _client->area().height() + cbwidth,
- width, _style->getHandleWidth());
+ width, _style->handleWidth());
_grip_left.setGeometry(-bwidth,
-bwidth,
// XXX: get a Point class in otk and use that for
@@ -357,7 +357,7 @@ void Frame::adjustShape()
{
#ifdef SHAPE
int bwidth = (_decorations & Client::Decor_Border) ?
- _style->getBorderWidth() : 0;
+ _style->frameBorderWidth() : 0;
if (!_client->shaped()) {
// clear the shape on the frame window
diff --git a/src/frame.hh b/src/frame.hh
index 3937afc2..35c884fa 100644
--- a/src/frame.hh
+++ b/src/frame.hh
@@ -16,7 +16,7 @@ extern "C" {
#include "otk/strut.hh"
#include "otk/rect.hh"
#include "otk/screeninfo.hh"
-#include "otk/style.hh"
+#include "otk/renderstyle.hh"
#include "otk/widget.hh"
#include "otk/ustring.hh"
@@ -71,7 +71,7 @@ public:
@param client The client window which will be decorated by the new Frame
@param style The style to use to decorate the frame
*/
- Frame(Client *client, otk::Style *style);
+ Frame(Client *client, otk::RenderStyle *style);
//! Destroys the Frame object
virtual ~Frame();
@@ -79,7 +79,7 @@ public:
const otk::Strut& size() const { return _size; }
//! Set the style to decorate the frame with
- virtual void setStyle(otk::Style *style);
+ virtual void setStyle(otk::RenderStyle *style);
//! Empty overridden method to prevent automatic alignment of children
virtual void adjust();
diff --git a/src/labelwidget.cc b/src/labelwidget.cc
index d76bd3f1..e45a8835 100644
--- a/src/labelwidget.cc
+++ b/src/labelwidget.cc
@@ -14,15 +14,11 @@ LabelWidget::LabelWidget(otk::Widget *parent, WidgetBase::WidgetType type)
: otk::Widget(parent),
WidgetBase(type)
{
- const otk::ScreenInfo *info = otk::display->screenInfo(_screen);
- _xftdraw = XftDrawCreate(**otk::display, _window, info->visual(),
- info->colormap());
}
LabelWidget::~LabelWidget()
{
- XftDrawDestroy(_xftdraw);
}
@@ -36,23 +32,24 @@ void LabelWidget::setText(const otk::ustring &text)
void LabelWidget::setTextures()
{
if (_focused) {
- setTexture(_style->getLabelFocus());
- _text_color = _style->getTextFocus();
+ setTexture(_style->labelFocusBackground());
+ _text_color = _style->textFocusColor();
} else {
- setTexture(_style->getLabelUnfocus());
- _text_color = _style->getTextUnfocus();
+ setTexture(_style->labelUnfocusBackground());
+ _text_color = _style->textUnfocusColor();
}
}
-void LabelWidget::setStyle(otk::Style *style)
+void LabelWidget::setStyle(otk::RenderStyle *style)
{
otk::Widget::setStyle(style);
setTextures();
- _font = style->getFont();
+ _font = style->labelFont();
+ _sidemargin = style->bevelWidth() * 2;
+ _justify = style->labelTextJustify();
+
assert(_font);
- _sidemargin = style->getBevelWidth() * 2;
- _justify = style->textJustify();
}
@@ -72,9 +69,15 @@ void LabelWidget::unfocus()
void LabelWidget::update()
{
+ printf("LabelWidget::update()\n");
+}
+
+
+void LabelWidget::renderForeground()
+{
bool draw = _dirty;
- otk::Widget::update();
+ otk::Widget::renderForeground();
if (draw) {
otk::ustring t = _text;
@@ -95,18 +98,19 @@ void LabelWidget::update()
// justify the text
switch (_justify) {
- case otk::Style::RightJustify:
+ case otk::RenderStyle::RightJustify:
x += max_length - length;
break;
- case otk::Style::CenterJustify:
+ case otk::RenderStyle::CenterJustify:
x += (max_length - length) / 2;
break;
- case otk::Style::LeftJustify:
+ case otk::RenderStyle::LeftJustify:
break;
}
}
- _font->drawString(_xftdraw, x, 0, *_text_color, t);
+ otk::display->renderControl(_screen)->drawString
+ (*_surface, *_font, x, 0, *_text_color, t);
}
}
diff --git a/src/labelwidget.hh b/src/labelwidget.hh
index 094cf868..6373e1d3 100644
--- a/src/labelwidget.hh
+++ b/src/labelwidget.hh
@@ -5,7 +5,7 @@
#include "widgetbase.hh"
#include "otk/widget.hh"
#include "otk/font.hh"
-#include "otk/style.hh"
+#include "otk/renderstyle.hh"
#include "otk/ustring.hh"
namespace ob {
@@ -15,18 +15,16 @@ class LabelWidget : public otk::Widget, public WidgetBase
private:
void setTextures();
const otk::Font *_font;
- otk::Color *_text_color;
+ otk::RenderColor *_text_color;
int _sidemargin;
- otk::Style::TextJustify _justify;
+ otk::RenderStyle::TextJustify _justify;
otk::ustring _text;
- //! Object used by Xft to render to the drawable
- XftDraw *_xftdraw;
public:
LabelWidget(otk::Widget *parent, WidgetBase::WidgetType type);
virtual ~LabelWidget();
- virtual void setStyle(otk::Style *style);
+ virtual void setStyle(otk::RenderStyle *style);
virtual void adjust();
@@ -35,6 +33,8 @@ public:
virtual void update();
+ virtual void renderForeground();
+
inline const otk::ustring &text() const { return _text; }
void setText(const otk::ustring &text);
};
diff --git a/src/openbox.py b/src/openbox.py
index 5a6d18b2..2a7a8c38 100644
--- a/src/openbox.py
+++ b/src/openbox.py
@@ -48,6 +48,7 @@ class Display(_object):
def gcCache(*args): return apply(_openbox.Display_gcCache,args)
def screenInfo(*args): return apply(_openbox.Display_screenInfo,args)
def findScreen(*args): return apply(_openbox.Display_findScreen,args)
+ def renderControl(*args): return apply(_openbox.Display_renderControl,args)
def xkb(*args): return apply(_openbox.Display_xkb,args)
def xkbEventBase(*args): return apply(_openbox.Display_xkbEventBase,args)
def shape(*args): return apply(_openbox.Display_shape,args)
@@ -664,7 +665,6 @@ class Screen(EventHandler,):
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)
diff --git a/src/openbox_wrap.cc b/src/openbox_wrap.cc
index 1fba163c..5143dd1e 100644
--- a/src/openbox_wrap.cc
+++ b/src/openbox_wrap.cc
@@ -668,7 +668,7 @@ SWIG_InstallConstants(PyObject *d, swig_const_info constants[]) {
#define SWIGTYPE_p_XPropertyEvent swig_types[20]
#define SWIGTYPE_p_XSelectionRequestEvent swig_types[21]
#define SWIGTYPE_p_ob__Cursors swig_types[22]
-#define SWIGTYPE_p_otk__ImageControl swig_types[23]
+#define SWIGTYPE_p_otk__RenderControl swig_types[23]
#define SWIGTYPE_p_ob__MwmHints swig_types[24]
#define SWIGTYPE_p_ob__Screen swig_types[25]
#define SWIGTYPE_p_ob__Frame swig_types[26]
@@ -682,19 +682,19 @@ SWIG_InstallConstants(PyObject *d, swig_const_info constants[]) {
#define SWIGTYPE_p_otk__Display swig_types[34]
#define SWIGTYPE_p_Display swig_types[35]
#define SWIGTYPE_p_XMappingEvent swig_types[36]
-#define SWIGTYPE_p_otk__Style swig_types[37]
-#define SWIGTYPE_p_otk__EventHandler swig_types[38]
-#define SWIGTYPE_p_XReparentEvent swig_types[39]
-#define SWIGTYPE_p_otk__EventDispatcher swig_types[40]
-#define SWIGTYPE_p_otk__GCCache swig_types[41]
-#define SWIGTYPE_p_ob__Bindings swig_types[42]
-#define SWIGTYPE_p_ob__Openbox swig_types[43]
-#define SWIGTYPE_p_ob__Actions swig_types[44]
-#define SWIGTYPE_p_otk__Widget swig_types[45]
-#define SWIGTYPE_p_XEvent swig_types[46]
-#define SWIGTYPE_p_otk__Property swig_types[47]
-#define SWIGTYPE_p_PyObject swig_types[48]
-#define SWIGTYPE_p_otk__ScreenInfo swig_types[49]
+#define SWIGTYPE_p_otk__EventHandler swig_types[37]
+#define SWIGTYPE_p_XReparentEvent swig_types[38]
+#define SWIGTYPE_p_otk__EventDispatcher swig_types[39]
+#define SWIGTYPE_p_otk__GCCache swig_types[40]
+#define SWIGTYPE_p_ob__Bindings swig_types[41]
+#define SWIGTYPE_p_ob__Openbox swig_types[42]
+#define SWIGTYPE_p_ob__Actions swig_types[43]
+#define SWIGTYPE_p_otk__Widget swig_types[44]
+#define SWIGTYPE_p_XEvent swig_types[45]
+#define SWIGTYPE_p_otk__Property swig_types[46]
+#define SWIGTYPE_p_PyObject swig_types[47]
+#define SWIGTYPE_p_otk__ScreenInfo swig_types[48]
+#define SWIGTYPE_p_otk__RenderStyle swig_types[49]
#define SWIGTYPE_p_ob__EventData swig_types[50]
#define SWIGTYPE_p_XCreateWindowEvent swig_types[51]
#define SWIGTYPE_p_XDestroyWindowEvent swig_types[52]
@@ -704,8 +704,8 @@ SWIG_InstallConstants(PyObject *d, swig_const_info constants[]) {
#define SWIGTYPE_p_XKeyEvent swig_types[56]
#define SWIGTYPE_p_int swig_types[57]
#define SWIGTYPE_p_otk__Strut swig_types[58]
-#define SWIGTYPE_p_unsigned_long swig_types[59]
-#define SWIGTYPE_p_p_unsigned_long swig_types[60]
+#define SWIGTYPE_p_p_unsigned_long swig_types[59]
+#define SWIGTYPE_p_unsigned_long swig_types[60]
#define SWIGTYPE_p_XMotionEvent swig_types[61]
#define SWIGTYPE_p_XButtonEvent swig_types[62]
#define SWIGTYPE_p_XSelectionEvent swig_types[63]
@@ -1038,6 +1038,24 @@ static PyObject *_wrap_Display_findScreen(PyObject *self, PyObject *args) {
}
+static PyObject *_wrap_Display_renderControl(PyObject *self, PyObject *args) {
+ PyObject *resultobj;
+ otk::Display *arg1 = (otk::Display *) 0 ;
+ int arg2 ;
+ otk::RenderControl *result;
+ PyObject * obj0 = 0 ;
+
+ if(!PyArg_ParseTuple(args,(char *)"Oi:Display_renderControl",&obj0,&arg2)) goto fail;
+ if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_otk__Display,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
+ result = (otk::RenderControl *)(arg1)->renderControl(arg2);
+
+ resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__RenderControl, 0);
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
static PyObject *_wrap_Display_xkb(PyObject *self, PyObject *args) {
PyObject *resultobj;
otk::Display *arg1 = (otk::Display *) 0 ;
@@ -8271,23 +8289,6 @@ static PyObject *_wrap_Screen_managed(PyObject *self, PyObject *args) {
}
-static PyObject *_wrap_Screen_imageControl(PyObject *self, PyObject *args) {
- PyObject *resultobj;
- ob::Screen *arg1 = (ob::Screen *) 0 ;
- otk::ImageControl *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:Screen_imageControl",&obj0)) goto fail;
- if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_ob__Screen,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
- result = (otk::ImageControl *)(arg1)->imageControl();
-
- resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__ImageControl, 0);
- return resultobj;
- fail:
- return NULL;
-}
-
-
static PyObject *_wrap_Screen_area(PyObject *self, PyObject *args) {
PyObject *resultobj;
ob::Screen *arg1 = (ob::Screen *) 0 ;
@@ -8311,14 +8312,14 @@ static PyObject *_wrap_Screen_area(PyObject *self, PyObject *args) {
static PyObject *_wrap_Screen_style(PyObject *self, PyObject *args) {
PyObject *resultobj;
ob::Screen *arg1 = (ob::Screen *) 0 ;
- otk::Style *result;
+ otk::RenderStyle *result;
PyObject * obj0 = 0 ;
if(!PyArg_ParseTuple(args,(char *)"O:Screen_style",&obj0)) goto fail;
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_ob__Screen,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
- result = (otk::Style *)((ob::Screen const *)arg1)->style();
+ result = (otk::RenderStyle *)((ob::Screen const *)arg1)->style();
- resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__Style, 0);
+ resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__RenderStyle, 0);
return resultobj;
fail:
return NULL;
@@ -9573,14 +9574,14 @@ static PyObject * Client_swigregister(PyObject *self, PyObject *args) {
static PyObject *_wrap_new_Frame(PyObject *self, PyObject *args) {
PyObject *resultobj;
ob::Client *arg1 = (ob::Client *) 0 ;
- otk::Style *arg2 = (otk::Style *) 0 ;
+ otk::RenderStyle *arg2 = (otk::RenderStyle *) 0 ;
ob::Frame *result;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if(!PyArg_ParseTuple(args,(char *)"OO:new_Frame",&obj0,&obj1)) goto fail;
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_ob__Client,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
- if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_otk__Style,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
+ if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_otk__RenderStyle,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
result = (ob::Frame *)new ob::Frame(arg1,arg2);
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_ob__Frame, 1);
@@ -9629,13 +9630,13 @@ static PyObject *_wrap_Frame_size(PyObject *self, PyObject *args) {
static PyObject *_wrap_Frame_setStyle(PyObject *self, PyObject *args) {
PyObject *resultobj;
ob::Frame *arg1 = (ob::Frame *) 0 ;
- otk::Style *arg2 = (otk::Style *) 0 ;
+ otk::RenderStyle *arg2 = (otk::RenderStyle *) 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if(!PyArg_ParseTuple(args,(char *)"OO:Frame_setStyle",&obj0,&obj1)) goto fail;
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_ob__Frame,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
- if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_otk__Style,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
+ if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_otk__RenderStyle,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
(arg1)->setStyle(arg2);
Py_INCREF(Py_None); resultobj = Py_None;
@@ -11297,6 +11298,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"Display_gcCache", _wrap_Display_gcCache, METH_VARARGS },
{ (char *)"Display_screenInfo", _wrap_Display_screenInfo, METH_VARARGS },
{ (char *)"Display_findScreen", _wrap_Display_findScreen, METH_VARARGS },
+ { (char *)"Display_renderControl", _wrap_Display_renderControl, METH_VARARGS },
{ (char *)"Display_xkb", _wrap_Display_xkb, METH_VARARGS },
{ (char *)"Display_xkbEventBase", _wrap_Display_xkbEventBase, METH_VARARGS },
{ (char *)"Display_shape", _wrap_Display_shape, METH_VARARGS },
@@ -11614,7 +11616,6 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"Screen_clientCount", _wrap_Screen_clientCount, METH_VARARGS },
{ (char *)"Screen_number", _wrap_Screen_number, METH_VARARGS },
{ (char *)"Screen_managed", _wrap_Screen_managed, METH_VARARGS },
- { (char *)"Screen_imageControl", _wrap_Screen_imageControl, METH_VARARGS },
{ (char *)"Screen_area", _wrap_Screen_area, METH_VARARGS },
{ (char *)"Screen_style", _wrap_Screen_style, METH_VARARGS },
{ (char *)"Screen_focuswindow", _wrap_Screen_focuswindow, METH_VARARGS },
@@ -11832,7 +11833,7 @@ static swig_type_info _swigt__p_XVisibilityEvent[] = {{"_p_XVisibilityEvent", 0,
static swig_type_info _swigt__p_XPropertyEvent[] = {{"_p_XPropertyEvent", 0, "XPropertyEvent *", 0},{"_p_XPropertyEvent"},{0}};
static swig_type_info _swigt__p_XSelectionRequestEvent[] = {{"_p_XSelectionRequestEvent", 0, "XSelectionRequestEvent *", 0},{"_p_XSelectionRequestEvent"},{0}};
static swig_type_info _swigt__p_ob__Cursors[] = {{"_p_ob__Cursors", 0, "ob::Cursors *", 0},{"_p_ob__Cursors"},{0}};
-static swig_type_info _swigt__p_otk__ImageControl[] = {{"_p_otk__ImageControl", 0, "otk::ImageControl *", 0},{"_p_otk__ImageControl"},{0}};
+static swig_type_info _swigt__p_otk__RenderControl[] = {{"_p_otk__RenderControl", 0, "otk::RenderControl *", 0},{"_p_otk__RenderControl"},{0}};
static swig_type_info _swigt__p_ob__MwmHints[] = {{"_p_ob__MwmHints", 0, "ob::MwmHints *", 0},{"_p_ob__MwmHints"},{0}};
static swig_type_info _swigt__p_ob__Screen[] = {{"_p_ob__Screen", 0, "ob::Screen *", 0},{"_p_ob__Screen"},{0}};
static swig_type_info _swigt__p_ob__Frame[] = {{"_p_ob__Frame", 0, "ob::Frame *", 0},{"_p_ob__Frame"},{0}};
@@ -11846,7 +11847,6 @@ static swig_type_info _swigt__p_XCrossingEvent[] = {{"_p_XCrossingEvent", 0, "XC
static swig_type_info _swigt__p_otk__Display[] = {{"_p_otk__Display", 0, "otk::Display *", 0},{"_p_otk__Display"},{0}};
static swig_type_info _swigt__p_Display[] = {{"_p_Display", 0, "Display *", 0},{"_p_Display"},{0}};
static swig_type_info _swigt__p_XMappingEvent[] = {{"_p_XMappingEvent", 0, "XMappingEvent *", 0},{"_p_XMappingEvent"},{0}};
-static swig_type_info _swigt__p_otk__Style[] = {{"_p_otk__Style", 0, "otk::Style *", 0},{"_p_otk__Style"},{0}};
static swig_type_info _swigt__p_otk__EventHandler[] = {{"_p_otk__EventHandler", 0, "otk::EventHandler *", 0},{"_p_ob__Client", _p_ob__ClientTo_p_otk__EventHandler},{"_p_ob__Actions", _p_ob__ActionsTo_p_otk__EventHandler},{"_p_otk__EventHandler"},{"_p_ob__Frame", _p_ob__FrameTo_p_otk__EventHandler},{"_p_ob__Openbox", _p_ob__OpenboxTo_p_otk__EventHandler},{"_p_otk__Widget", _p_otk__WidgetTo_p_otk__EventHandler},{"_p_ob__Screen", _p_ob__ScreenTo_p_otk__EventHandler},{0}};
static swig_type_info _swigt__p_XReparentEvent[] = {{"_p_XReparentEvent", 0, "XReparentEvent *", 0},{"_p_XReparentEvent"},{0}};
static swig_type_info _swigt__p_otk__EventDispatcher[] = {{"_p_otk__EventDispatcher", 0, "otk::EventDispatcher *", 0},{"_p_otk__EventDispatcher"},{"_p_ob__Openbox", _p_ob__OpenboxTo_p_otk__EventDispatcher},{0}};
@@ -11859,6 +11859,7 @@ static swig_type_info _swigt__p_XEvent[] = {{"_p_XEvent", 0, "XEvent *", 0},{"_p
static swig_type_info _swigt__p_otk__Property[] = {{"_p_otk__Property", 0, "otk::Property *", 0},{"_p_otk__Property"},{0}};
static swig_type_info _swigt__p_PyObject[] = {{"_p_PyObject", 0, "PyObject *", 0},{"_p_PyObject"},{0}};
static swig_type_info _swigt__p_otk__ScreenInfo[] = {{"_p_otk__ScreenInfo", 0, "otk::ScreenInfo *", 0},{"_p_otk__ScreenInfo"},{0}};
+static swig_type_info _swigt__p_otk__RenderStyle[] = {{"_p_otk__RenderStyle", 0, "otk::RenderStyle *", 0},{"_p_otk__RenderStyle"},{0}};
static swig_type_info _swigt__p_ob__EventData[] = {{"_p_ob__EventData", 0, "ob::EventData *", 0},{"_p_ob__EventData"},{0}};
static swig_type_info _swigt__p_XCreateWindowEvent[] = {{"_p_XCreateWindowEvent", 0, "XCreateWindowEvent *", 0},{"_p_XCreateWindowEvent"},{0}};
static swig_type_info _swigt__p_XDestroyWindowEvent[] = {{"_p_XDestroyWindowEvent", 0, "XDestroyWindowEvent *", 0},{"_p_XDestroyWindowEvent"},{0}};
@@ -11868,8 +11869,8 @@ static swig_type_info _swigt__p_otk__Atoms[] = {{"_p_otk__Atoms", 0, "otk::Atoms
static swig_type_info _swigt__p_XKeyEvent[] = {{"_p_XKeyEvent", 0, "XKeyEvent *", 0},{"_p_XKeyEvent"},{0}};
static swig_type_info _swigt__p_int[] = {{"_p_int", 0, "int *", 0},{"_p_int"},{0}};
static swig_type_info _swigt__p_otk__Strut[] = {{"_p_otk__Strut", 0, "otk::Strut *", 0},{"_p_otk__Strut"},{0}};
-static swig_type_info _swigt__p_unsigned_long[] = {{"_p_unsigned_long", 0, "unsigned long *", 0},{"_p_unsigned_long"},{0}};
static swig_type_info _swigt__p_p_unsigned_long[] = {{"_p_p_unsigned_long", 0, "unsigned long **", 0},{"_p_p_unsigned_long"},{0}};
+static swig_type_info _swigt__p_unsigned_long[] = {{"_p_unsigned_long", 0, "unsigned long *", 0},{"_p_unsigned_long"},{0}};
static swig_type_info _swigt__p_XMotionEvent[] = {{"_p_XMotionEvent", 0, "XMotionEvent *", 0},{"_p_XMotionEvent"},{0}};
static swig_type_info _swigt__p_XButtonEvent[] = {{"_p_XButtonEvent", 0, "XButtonEvent *", 0},{"_p_XButtonEvent"},{0}};
static swig_type_info _swigt__p_XSelectionEvent[] = {{"_p_XSelectionEvent", 0, "XSelectionEvent *", 0},{"_p_XSelectionEvent"},{0}};
@@ -11898,7 +11899,7 @@ _swigt__p_XVisibilityEvent,
_swigt__p_XPropertyEvent,
_swigt__p_XSelectionRequestEvent,
_swigt__p_ob__Cursors,
-_swigt__p_otk__ImageControl,
+_swigt__p_otk__RenderControl,
_swigt__p_ob__MwmHints,
_swigt__p_ob__Screen,
_swigt__p_ob__Frame,
@@ -11912,7 +11913,6 @@ _swigt__p_XCrossingEvent,
_swigt__p_otk__Display,
_swigt__p_Display,
_swigt__p_XMappingEvent,
-_swigt__p_otk__Style,
_swigt__p_otk__EventHandler,
_swigt__p_XReparentEvent,
_swigt__p_otk__EventDispatcher,
@@ -11925,6 +11925,7 @@ _swigt__p_XEvent,
_swigt__p_otk__Property,
_swigt__p_PyObject,
_swigt__p_otk__ScreenInfo,
+_swigt__p_otk__RenderStyle,
_swigt__p_ob__EventData,
_swigt__p_XCreateWindowEvent,
_swigt__p_XDestroyWindowEvent,
@@ -11934,8 +11935,8 @@ _swigt__p_otk__Atoms,
_swigt__p_XKeyEvent,
_swigt__p_int,
_swigt__p_otk__Strut,
-_swigt__p_unsigned_long,
_swigt__p_p_unsigned_long,
+_swigt__p_unsigned_long,
_swigt__p_XMotionEvent,
_swigt__p_XButtonEvent,
_swigt__p_XSelectionEvent,
diff --git a/src/screen.cc b/src/screen.cc
index 0bbcebc6..6bc04ad1 100644
--- a/src/screen.cc
+++ b/src/screen.cc
@@ -48,7 +48,8 @@ namespace ob {
Screen::Screen(int screen)
: WidgetBase(WidgetBase::Type_Root),
- _number(screen)
+ _number(screen),
+ _style(screen, "")
{
assert(screen >= 0); assert(screen < ScreenCount(**otk::display));
_info = otk::display->screenInfo(screen);
@@ -73,13 +74,8 @@ Screen::Screen(int screen)
XDefineCursor(**otk::display, _info->rootWindow(),
openbox->cursors().session);
- // initialize the shit that is used for all drawing on the screen
- _image_control = new otk::ImageControl(_info, true);
- _image_control->installRootColormap();
- _root_cmap_installed = True;
-
- // initialize the screen's style
- _style.setImageControl(_image_control);
+ // XXX: initialize the screen's style
+ /*
otk::ustring stylepath;
python_get_string("theme", &stylepath);
otk::Configuration sconfig(false);
@@ -92,6 +88,7 @@ Screen::Screen(int screen)
}
}
_style.load(sconfig);
+ */
// set up notification of netwm support
changeSupportedAtoms();
@@ -157,8 +154,6 @@ Screen::~Screen()
XDestroyWindow(**otk::display, _focuswindow);
XDestroyWindow(**otk::display, _supportwindow);
-
- delete _image_control;
}
diff --git a/src/screen.hh b/src/screen.hh
index 7f33b9c8..37e56cf1 100644
--- a/src/screen.hh
+++ b/src/screen.hh
@@ -12,10 +12,9 @@ extern "C" {
#include "client.hh"
#include "widgetbase.hh"
-#include "otk/image.hh"
+#include "otk/renderstyle.hh"
#include "otk/strut.hh"
#include "otk/rect.hh"
-#include "otk/style.hh"
#include "otk/screeninfo.hh"
#include "otk/eventhandler.hh"
#include "otk/property.hh"
@@ -59,11 +58,8 @@ private:
//! Information about this screen
const otk::ScreenInfo *_info;
- //! The Image Control used for rendering on the screen
- otk::ImageControl *_image_control;
-
//! The style with which to render on the screen
- otk::Style _style;
+ otk::RenderStyle _style;
//! Is the root colormap currently installed?
bool _root_cmap_installed;
@@ -148,12 +144,10 @@ public:
used.
*/
inline bool managed() const { return _managed; }
- //! Returns the Image Control used for rendering on the screen
- 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
- inline const otk::Style *style() const { return &_style; }
+ inline const otk::RenderStyle *style() const { return &_style; }
//! An offscreen window which gets focus when nothing else has it
inline Window focuswindow() const { return _focuswindow; }
//! Returns the desktop being displayed