if (scrn == ~(0u))
scrn = DefaultScreen(OBDisplay::display);
- Colormap colormap = OBDisplay::screenInfo(scrn)->getColormap();
+ Colormap colormap = OBDisplay::screenInfo(scrn)->colormap();
// get rgb values from colorname
XColor xcol;
void BColor::allocate(void) {
if (scrn == ~(0u)) scrn = DefaultScreen(OBDisplay::display);
- Colormap colormap = OBDisplay::screenInfo(scrn)->getColormap();
+ Colormap colormap = OBDisplay::screenInfo(scrn)->colormap();
if (! isValid()) {
if (colorname.empty()) {
if (count > 0)
XFreeColors(OBDisplay::display,
- OBDisplay::screenInfo(i)->getColormap(),
+ OBDisplay::screenInfo(i)->colormap(),
pixels, count, 0);
}
: OtkFocusWidget(parent), _text("")
{
const ScreenInfo *info = OBDisplay::screenInfo(screen());
- _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->getVisual(),
- info->getColormap());
+ _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->visual(),
+ info->colormap());
}
OtkFocusLabel::~OtkFocusLabel()
BGCCacheContext *BGCCache::nextContext(unsigned int scr) {
- Window hd = OBDisplay::screenInfo(scr)->getRootWindow();
+ Window hd = OBDisplay::screenInfo(scr)->rootWindow();
BGCCacheContext *c;
XPutImage(OBDisplay::display, pixmap,
DefaultGC(OBDisplay::display,
- control->getScreenInfo()->getScreenNumber()),
+ control->getScreenInfo()->screen()),
image, 0, 0, 0, 0, width, height);
if (image->data) {
inline Window getDrawable(void) const { return window; }
- inline Visual *getVisual(void) { return screeninfo->getVisual(); }
+ inline Visual *getVisual(void) { return screeninfo->visual(); }
inline int getBitsPerPixel(void) const { return bits_per_pixel; }
inline int getDepth(void) const { return screen_depth; }
sqrt_table = (unsigned long *) 0;
- screen_depth = screeninfo->getDepth();
- window = screeninfo->getRootWindow();
- screen_number = screeninfo->getScreenNumber();
- colormap = screeninfo->getColormap();
+ screen_depth = screeninfo->depth();
+ window = screeninfo->rootWindow();
+ screen_number = screeninfo->screen();
+ colormap = screeninfo->colormap();
int count;
XPixmapFormatValues *pmv = XListPixmapFormats(OBDisplay::display,
: OtkWidget(parent), _text("")
{
const ScreenInfo *info = OBDisplay::screenInfo(screen());
- _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->getVisual(),
- info->getColormap());
+ _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->visual(),
+ info->colormap());
}
OtkLabel::~OtkLabel()
namespace otk {
ScreenInfo::ScreenInfo(unsigned int num) {
- screen_number = num;
+ _screen = num;
- root_window = RootWindow(OBDisplay::display, screen_number);
+ _root_window = RootWindow(OBDisplay::display, _screen);
- rect.setSize(WidthOfScreen(ScreenOfDisplay(OBDisplay::display,
- screen_number)),
+ _rect.setSize(WidthOfScreen(ScreenOfDisplay(OBDisplay::display,
+ _screen)),
HeightOfScreen(ScreenOfDisplay(OBDisplay::display,
- screen_number)));
+ _screen)));
/*
If the default depth is at least 8 we will use that,
otherwise we try to find the largest TrueColor visual.
Preference is given to 24 bit over larger depths if 24 bit is an option.
*/
- depth = DefaultDepth(OBDisplay::display, screen_number);
- visual = DefaultVisual(OBDisplay::display, screen_number);
- colormap = DefaultColormap(OBDisplay::display, screen_number);
+ _depth = DefaultDepth(OBDisplay::display, _screen);
+ _visual = DefaultVisual(OBDisplay::display, _screen);
+ _colormap = DefaultColormap(OBDisplay::display, _screen);
- if (depth < 8) {
+ if (_depth < 8) {
// search for a TrueColor Visual... if we can't find one...
// we will use the default visual for the screen
XVisualInfo vinfo_template, *vinfo_return;
int vinfo_nitems;
int best = -1;
- vinfo_template.screen = screen_number;
+ vinfo_template.screen = _screen;
vinfo_template.c_class = TrueColor;
vinfo_return = XGetVisualInfo(OBDisplay::display,
best = i;
}
}
- if (max_depth < depth) best = -1;
+ if (max_depth < _depth) best = -1;
}
if (best != -1) {
- depth = vinfo_return[best].depth;
- visual = vinfo_return[best].visual;
- colormap = XCreateColormap(OBDisplay::display, root_window, visual,
- AllocNone);
+ _depth = vinfo_return[best].depth;
+ _visual = vinfo_return[best].visual;
+ _colormap = XCreateColormap(OBDisplay::display, _root_window, _visual,
+ AllocNone);
}
XFree(vinfo_return);
if (pos != string::npos)
default_string.resize(pos);
- display_string = string("DISPLAY=") + default_string + '.' +
- otk::itostring(static_cast<unsigned long>(screen_number));
+ _display_string = string("DISPLAY=") + default_string + '.' +
+ otk::itostring(static_cast<unsigned long>(_screen));
#ifdef XINERAMA
- xinerama_active = False;
+ _xinerama_active = False;
if (d->hasXineramaExtensions()) {
if (d->getXineramaMajorVersion() == 1) {
XineramaScreenInfo *info = XineramaQueryScreens(OBDisplay::display,
&num);
if (num > 0 && info) {
- xinerama_areas.reserve(num);
+ _xinerama_areas.reserve(num);
for (int i = 0; i < num; ++i) {
- xinerama_areas.push_back(Rect(info[i].x_org, info[i].y_org,
- info[i].width, info[i].height));
+ _xinerama_areas.push_back(Rect(info[i].x_org, info[i].y_org,
+ info[i].width, info[i].height));
}
XFree(info);
// if we can't find any xinerama regions, then we act as if it is not
// active, even though it said it was
- xinerama_active = True;
+ _xinerama_active = True;
}
}
}
class ScreenInfo {
private:
- Visual *visual;
- Window root_window;
- Colormap colormap;
-
- int depth;
- unsigned int screen_number;
- std::string display_string;
- Rect rect;
+ Visual *_visual;
+ Window _root_window;
+ Colormap _colormap;
+
+ int _depth;
+ unsigned int _screen;
+ std::string _display_string;
+ Rect _rect;
#ifdef XINERAMA
- RectList xinerama_areas;
- bool xinerama_active;
+ RectList _xinerama_areas;
+ bool _xinerama_active;
#endif
public:
ScreenInfo(unsigned int num);
- inline Visual *getVisual(void) const { return visual; }
- inline Window getRootWindow(void) const { return root_window; }
- inline Colormap getColormap(void) const { return colormap; }
- inline int getDepth(void) const { return depth; }
- inline unsigned int getScreenNumber(void) const
- { return screen_number; }
- inline const Rect& getRect(void) const { return rect; }
- inline unsigned int getWidth(void) const { return rect.width(); }
- inline unsigned int getHeight(void) const { return rect.height(); }
- inline const std::string& displayString(void) const
- { return display_string; }
+ inline Visual *visual() const { return _visual; }
+ inline Window rootWindow() const { return _root_window; }
+ inline Colormap colormap() const { return _colormap; }
+ inline int depth() const { return _depth; }
+ inline unsigned int screen() const { return _screen; }
+ inline const Rect& rect() const { return _rect; }
+ inline unsigned int width() const { return _rect.width(); }
+ inline unsigned int height() const { return _rect.height(); }
+ inline const std::string& displayString() const { return _display_string; }
#ifdef XINERAMA
- inline const RectList &getXineramaAreas(void) const { return xinerama_areas; }
- inline bool isXineramaActive(void) const { return xinerama_active; }
+ inline const RectList &xineramaAreas() const { return _xinerama_areas; }
+ inline bool isXineramaActive() const { return _xinerama_active; }
#endif
};
Style::Style(BImageControl *ctrl)
: image_control(ctrl), font(0),
- screen_number(ctrl->getScreenInfo()->getScreenNumber())
+ screen_number(ctrl->getScreenInfo()->screen())
{
}
// load bevel, border and handle widths
const ScreenInfo *s_info = OBDisplay::screenInfo(screen_number);
- unsigned int width = s_info->getRect().width();
+ unsigned int width = s_info->rect().width();
if (! style.getValue("handleWidth", handle_width) ||
handle_width > width/2 || handle_width == 0)
void Style::readDatabaseMask(const std::string &rname, PixmapMask &pixmapMask,
const Configuration &style) {
- Window root_window = OBDisplay::screenInfo(screen_number)->getRootWindow();
+ Window root_window = OBDisplay::screenInfo(screen_number)->rootWindow();
std::string s;
int hx, hy; //ignored
int ret = BitmapOpenFailed; //default to failure.
inline void setImageControl(BImageControl *c) {
image_control = c;
- screen_number = c->getScreenInfo()->getScreenNumber();
+ screen_number = c->getScreenInfo()->screen();
}
inline unsigned int getScreen(void) { return screen_number; }
void OtkWidget::create(void)
{
const ScreenInfo *scr_info = otk::OBDisplay::screenInfo(_screen);
- Window p_window = _parent ? _parent->window() : scr_info->getRootWindow();
+ Window p_window = _parent ? _parent->window() : scr_info->rootWindow();
_rect.setRect(0, 0, 1, 1); // just some initial values
unsigned long create_mask = CWBackPixmap | CWBorderPixel | CWEventMask;
attrib_create.background_pixmap = None;
- attrib_create.colormap = scr_info->getColormap();
+ attrib_create.colormap = scr_info->colormap();
attrib_create.event_mask = ButtonPressMask | ButtonReleaseMask |
ButtonMotionMask | ExposureMask | StructureNotifyMask;
_window = XCreateWindow(otk::OBDisplay::display, p_window, _rect.x(),
_rect.y(), _rect.width(), _rect.height(), 0,
- scr_info->getDepth(), InputOutput,
- scr_info->getVisual(), create_mask, &attrib_create);
+ scr_info->depth(), InputOutput,
+ scr_info->visual(), create_mask, &attrib_create);
_ignore_config++;
}