screenInfoList = new LinkedList<ScreenInfo>;
for (int i = 0; i < number_of_screens; i++) {
- ScreenInfo *screeninfo = new ScreenInfo(this, i);
+ ScreenInfo *screeninfo = new ScreenInfo(*this, i);
screenInfoList->insert(screeninfo);
}
}
-ScreenInfo::ScreenInfo(BaseDisplay *d, int num) {
- basedisplay = d;
+ScreenInfo::ScreenInfo(BaseDisplay &d, int num) : basedisplay(d) {
screen_number = num;
- root_window = RootWindow(basedisplay->getXDisplay(), screen_number);
- depth = DefaultDepth(basedisplay->getXDisplay(), screen_number);
+ root_window = RootWindow(basedisplay.getXDisplay(), screen_number);
+ depth = DefaultDepth(basedisplay.getXDisplay(), screen_number);
width =
- WidthOfScreen(ScreenOfDisplay(basedisplay->getXDisplay(), screen_number));
+ WidthOfScreen(ScreenOfDisplay(basedisplay.getXDisplay(), screen_number));
height =
- HeightOfScreen(ScreenOfDisplay(basedisplay->getXDisplay(), screen_number));
+ HeightOfScreen(ScreenOfDisplay(basedisplay.getXDisplay(), screen_number));
// search for a TrueColor Visual... if we can't find one... we will use the
// default visual for the screen
visual = (Visual *) 0;
- if ((vinfo_return = XGetVisualInfo(basedisplay->getXDisplay(),
+ if ((vinfo_return = XGetVisualInfo(basedisplay.getXDisplay(),
VisualScreenMask | VisualClassMask,
&vinfo_template, &vinfo_nitems)) &&
vinfo_nitems > 0) {
}
if (visual) {
- colormap = XCreateColormap(basedisplay->getXDisplay(), root_window,
+ colormap = XCreateColormap(basedisplay.getXDisplay(), root_window,
visual, AllocNone);
} else {
- visual = DefaultVisual(basedisplay->getXDisplay(), screen_number);
- colormap = DefaultColormap(basedisplay->getXDisplay(), screen_number);
+ visual = DefaultVisual(basedisplay.getXDisplay(), screen_number);
+ colormap = DefaultColormap(basedisplay.getXDisplay(), screen_number);
}
}
class ScreenInfo {
private:
- BaseDisplay *basedisplay;
+ BaseDisplay &basedisplay;
Visual *visual;
Window root_window;
Colormap colormap;
public:
- ScreenInfo(BaseDisplay *, int);
+ ScreenInfo(BaseDisplay &, int);
- inline BaseDisplay *getBaseDisplay(void) { return basedisplay; }
+ inline BaseDisplay &getBaseDisplay(void) { return basedisplay; }
inline Visual *getVisual(void) { return visual; }
inline const Window &getRootWindow(void) const { return root_window; }
static Basemenu *shown = (Basemenu *) 0;
-Basemenu::Basemenu(BScreen &scrn) : screen(scrn), openbox(*scrn.getOpenbox()) {
+Basemenu::Basemenu(BScreen &scrn) : screen(scrn), openbox(scrn.getOpenbox()) {
image_ctrl = screen.getImageControl();
display = openbox.getXDisplay();
parent = (Basemenu *) 0;
configmenu->screen.saveSloppyFocus(False);
configmenu->screen.saveAutoRaise(False);
- if (! configmenu->screen.getOpenbox()->getFocusedWindow())
- XSetInputFocus(configmenu->screen.getOpenbox()->getXDisplay(),
+ if (! configmenu->screen.getOpenbox().getFocusedWindow())
+ XSetInputFocus(configmenu->screen.getOpenbox().getXDisplay(),
configmenu->screen.getToolbar()->getWindowID(),
RevertToParent, CurrentTime);
else
- XSetInputFocus(configmenu->screen.getOpenbox()->getXDisplay(),
- configmenu->screen.getOpenbox()->
+ XSetInputFocus(configmenu->screen.getOpenbox().getXDisplay(),
+ configmenu->screen.getOpenbox().
getFocusedWindow()->getClientWindow(),
RevertToParent, CurrentTime);
#include "Netizen.h"
#include "Screen.h"
-Netizen::Netizen(BScreen *scr, Window win) {
- screen = scr;
- basedisplay = screen->getBaseDisplay();
- window = win;
-
+Netizen::Netizen(BScreen &scr, Window win) : screen(scr),
+ basedisplay(scr.getBaseDisplay()), window(win)
+{
event.type = ClientMessage;
- event.xclient.message_type = basedisplay->getOpenboxStructureMessagesAtom();
- event.xclient.display = basedisplay->getXDisplay();
+ event.xclient.message_type = basedisplay.getOpenboxStructureMessagesAtom();
+ event.xclient.display = basedisplay.getXDisplay();
event.xclient.window = window;
event.xclient.format = 32;
- event.xclient.data.l[0] = basedisplay->getOpenboxNotifyStartupAtom();
+ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyStartupAtom();
event.xclient.data.l[1] = event.xclient.data.l[2] =
event.xclient.data.l[3] = event.xclient.data.l[4] = 0l;
- XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
+ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event);
}
void Netizen::sendWorkspaceCount(void) {
- event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWorkspaceCountAtom();
- event.xclient.data.l[1] = screen->getWorkspaceCount();
+ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWorkspaceCountAtom();
+ event.xclient.data.l[1] = screen.getWorkspaceCount();
- XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
+ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event);
}
void Netizen::sendCurrentWorkspace(void) {
- event.xclient.data.l[0] = basedisplay->getOpenboxNotifyCurrentWorkspaceAtom();
- event.xclient.data.l[1] = screen->getCurrentWorkspaceID();
+ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyCurrentWorkspaceAtom();
+ event.xclient.data.l[1] = screen.getCurrentWorkspaceID();
- XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
+ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event);
}
void Netizen::sendWindowFocus(Window w) {
- event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWindowFocusAtom();
+ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWindowFocusAtom();
event.xclient.data.l[1] = w;
- XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
+ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event);
}
void Netizen::sendWindowAdd(Window w, unsigned long p) {
- event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWindowAddAtom();
+ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWindowAddAtom();
event.xclient.data.l[1] = w;
event.xclient.data.l[2] = p;
- XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
+ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event);
event.xclient.data.l[2] = 0l;
}
void Netizen::sendWindowDel(Window w) {
- event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWindowDelAtom();
+ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWindowDelAtom();
event.xclient.data.l[1] = w;
- XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
+ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event);
}
void Netizen::sendWindowRaise(Window w) {
- event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWindowRaiseAtom();
+ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWindowRaiseAtom();
event.xclient.data.l[1] = w;
- XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
+ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event);
}
void Netizen::sendWindowLower(Window w) {
- event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWindowLowerAtom();
+ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWindowLowerAtom();
event.xclient.data.l[1] = w;
- XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
+ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event);
}
void Netizen::sendConfigNotify(XEvent *e) {
- XSendEvent(basedisplay->getXDisplay(), window, False,
+ XSendEvent(basedisplay.getXDisplay(), window, False,
StructureNotifyMask, e);
}
class Netizen {
private:
- BaseDisplay *basedisplay;
- BScreen *screen;
+ BaseDisplay &basedisplay;
+ BScreen &screen;
Window window;
XEvent event;
protected:
public:
- Netizen(BScreen *, Window);
+ Netizen(BScreen &, Window);
inline const Window &getWindowID(void) const { return window; }
Rootmenu::Rootmenu(BScreen &scrn) : Basemenu(scrn), screen(scrn),
- openbox(*scrn.getOpenbox())
+ openbox(scrn.getOpenbox())
{
}
#ifndef __EMX__
char displaystring[MAXPATHLEN];
sprintf(displaystring, "DISPLAY=%s",
- DisplayString(screen.getBaseDisplay()->getXDisplay()));
+ DisplayString(screen.getBaseDisplay().getXDisplay()));
sprintf(displaystring + strlen(displaystring) - 1, "%d",
screen.getScreenNumber());
}
-BScreen::BScreen(Openbox *ob, int scrn) : ScreenInfo(ob, scrn) {
- openbox = ob;
-
+BScreen::BScreen(Openbox &ob, int scrn) : ScreenInfo(ob, scrn), openbox(ob) {
event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask |
SubstructureRedirectMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask;
XErrorHandler old = XSetErrorHandler((XErrorHandler) anotherWMRunning);
- XSelectInput(getBaseDisplay()->getXDisplay(), getRootWindow(), event_mask);
- XSync(getBaseDisplay()->getXDisplay(), False);
+ XSelectInput(getBaseDisplay().getXDisplay(), getRootWindow(), event_mask);
+ XSync(getBaseDisplay().getXDisplay(), False);
XSetErrorHandler((XErrorHandler) old);
managed = running;
#ifdef HAVE_GETPID
pid_t bpid = getpid();
- XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(),
- openbox->getOpenboxPidAtom(), XA_CARDINAL,
+ XChangeProperty(getBaseDisplay().getXDisplay(), getRootWindow(),
+ openbox.getOpenboxPidAtom(), XA_CARDINAL,
sizeof(pid_t) * 8, PropModeReplace,
(unsigned char *) &bpid, 1);
#endif // HAVE_GETPID
- XDefineCursor(getBaseDisplay()->getXDisplay(), getRootWindow(),
- openbox->getSessionCursor());
+ XDefineCursor(getBaseDisplay().getXDisplay(), getRootWindow(),
+ openbox.getSessionCursor());
workspaceNames = new LinkedList<char>;
workspacesList = new LinkedList<Workspace>;
iconList = new LinkedList<OpenboxWindow>;
image_control =
- new BImageControl(openbox, this, True, openbox->getColorsPerChannel(),
- openbox->getCacheLife(), openbox->getCacheMax());
+ new BImageControl(&openbox, this, True, openbox.getColorsPerChannel(),
+ openbox.getCacheLife(), openbox.getCacheMax());
image_control->installRootColormap();
root_colormap_installed = True;
- openbox->load_rc(this);
+ openbox.load_rc(this);
image_control->setDither(resource.image_dither);
unsigned long gc_value_mask = GCForeground;
if (! i18n->multibyte()) gc_value_mask |= GCFont;
- gcv.foreground = WhitePixel(getBaseDisplay()->getXDisplay(),
+ gcv.foreground = WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber())
- ^ BlackPixel(getBaseDisplay()->getXDisplay(),
+ ^ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber());
gcv.function = GXxor;
gcv.subwindow_mode = IncludeInferiors;
- opGC = XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ opGC = XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
GCForeground | GCFunction | GCSubwindowMode, &gcv);
gcv.foreground = resource.wstyle.l_text_focus.getPixel();
if (resource.wstyle.font)
gcv.font = resource.wstyle.font->fid;
resource.wstyle.l_text_focus_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
gcv.foreground = resource.wstyle.l_text_unfocus.getPixel();
if (resource.wstyle.font)
gcv.font = resource.wstyle.font->fid;
resource.wstyle.l_text_unfocus_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
gcv.foreground = resource.wstyle.b_pic_focus.getPixel();
resource.wstyle.b_pic_focus_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
GCForeground, &gcv);
gcv.foreground = resource.wstyle.b_pic_unfocus.getPixel();
resource.wstyle.b_pic_unfocus_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
GCForeground, &gcv);
gcv.foreground = resource.mstyle.t_text.getPixel();
if (resource.mstyle.t_font)
gcv.font = resource.mstyle.t_font->fid;
resource.mstyle.t_text_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
gcv.foreground = resource.mstyle.f_text.getPixel();
if (resource.mstyle.f_font)
gcv.font = resource.mstyle.f_font->fid;
resource.mstyle.f_text_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
gcv.foreground = resource.mstyle.h_text.getPixel();
resource.mstyle.h_text_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
gcv.foreground = resource.mstyle.d_text.getPixel();
resource.mstyle.d_text_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
gcv.foreground = resource.mstyle.hilite.getColor()->getPixel();
resource.mstyle.hilite_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
gcv.foreground = resource.tstyle.l_text.getPixel();
if (resource.tstyle.font)
gcv.font = resource.tstyle.font->fid;
resource.tstyle.l_text_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
gcv.foreground = resource.tstyle.w_text.getPixel();
resource.tstyle.w_text_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
gcv.foreground = resource.tstyle.c_text.getPixel();
resource.tstyle.c_text_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
gcv.foreground = resource.tstyle.b_pic.getPixel();
resource.tstyle.b_pic_gc =
- XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(),
gc_value_mask, &gcv);
const char *s = i18n->getMessage(ScreenSet, ScreenPositionLength,
attrib.save_under = True;
geom_window =
- XCreateWindow(getBaseDisplay()->getXDisplay(), getRootWindow(),
+ XCreateWindow(getBaseDisplay().getXDisplay(), getRootWindow(),
0, 0, geom_w, geom_h, resource.border_width, getDepth(),
InputOutput, getVisual(), mask, &attrib);
geom_visible = False;
if (resource.wstyle.t_focus.getTexture() ==
(BImage_Flat | BImage_Solid)) {
geom_pixmap = None;
- XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window,
+ XSetWindowBackground(getBaseDisplay().getXDisplay(), geom_window,
resource.wstyle.t_focus.getColor()->getPixel());
} else {
geom_pixmap = image_control->renderImage(geom_w, geom_h,
&resource.wstyle.t_focus);
- XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(),
+ XSetWindowBackgroundPixmap(getBaseDisplay().getXDisplay(),
geom_window, geom_pixmap);
}
} else {
if (resource.wstyle.l_focus.getTexture() ==
(BImage_Flat | BImage_Solid)) {
geom_pixmap = None;
- XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window,
+ XSetWindowBackground(getBaseDisplay().getXDisplay(), geom_window,
resource.wstyle.l_focus.getColor()->getPixel());
} else {
geom_pixmap = image_control->renderImage(geom_w, geom_h,
&resource.wstyle.l_focus);
- XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(),
+ XSetWindowBackgroundPixmap(getBaseDisplay().getXDisplay(),
geom_window, geom_pixmap);
}
}
current_workspace = workspacesList->first();
workspacemenu->setItemSelected(2, True);
- toolbar = new Toolbar(this);
+ toolbar = new Toolbar(*this);
#ifdef SLIT
- slit = new Slit(this);
+ slit = new Slit(*this);
#endif // SLIT
InitMenu();
int i;
unsigned int nchild;
Window r, p, *children;
- XQueryTree(getBaseDisplay()->getXDisplay(), getRootWindow(), &r, &p,
+ XQueryTree(getBaseDisplay().getXDisplay(), getRootWindow(), &r, &p,
&children, &nchild);
// preen the window list of all icon windows... for better dockapp support
for (i = 0; i < (int) nchild; i++) {
if (children[i] == None) continue;
- XWMHints *wmhints = XGetWMHints(getBaseDisplay()->getXDisplay(),
+ XWMHints *wmhints = XGetWMHints(getBaseDisplay().getXDisplay(),
children[i]);
if (wmhints) {
// manage shown windows
for (i = 0; i < (int) nchild; ++i) {
- if (children[i] == None || (! openbox->validateWindow(children[i])))
+ if (children[i] == None || (! openbox.validateWindow(children[i])))
continue;
XWindowAttributes attrib;
- if (XGetWindowAttributes(getBaseDisplay()->getXDisplay(), children[i],
+ if (XGetWindowAttributes(getBaseDisplay().getXDisplay(), children[i],
&attrib)) {
if (attrib.override_redirect) continue;
if (attrib.map_state != IsUnmapped) {
- new OpenboxWindow(openbox, children[i], this);
+ new OpenboxWindow(&openbox, children[i], this);
- OpenboxWindow *win = openbox->searchWindow(children[i]);
+ OpenboxWindow *win = openbox.searchWindow(children[i]);
if (win) {
XMapRequestEvent mre;
mre.window = children[i];
}
if (! resource.sloppy_focus)
- XSetInputFocus(getBaseDisplay()->getXDisplay(), toolbar->getWindowID(),
+ XSetInputFocus(getBaseDisplay().getXDisplay(), toolbar->getWindowID(),
RevertToParent, CurrentTime);
XFree(children);
- XFlush(getBaseDisplay()->getXDisplay());
+ XFlush(getBaseDisplay().getXDisplay());
}
image_control->removeImage(geom_pixmap);
if (geom_window != None)
- XDestroyWindow(getBaseDisplay()->getXDisplay(), geom_window);
+ XDestroyWindow(getBaseDisplay().getXDisplay(), geom_window);
removeWorkspaceNames();
delete netizenList;
if (resource.wstyle.fontset)
- XFreeFontSet(getBaseDisplay()->getXDisplay(), resource.wstyle.fontset);
+ XFreeFontSet(getBaseDisplay().getXDisplay(), resource.wstyle.fontset);
if (resource.mstyle.t_fontset)
- XFreeFontSet(getBaseDisplay()->getXDisplay(), resource.mstyle.t_fontset);
+ XFreeFontSet(getBaseDisplay().getXDisplay(), resource.mstyle.t_fontset);
if (resource.mstyle.f_fontset)
- XFreeFontSet(getBaseDisplay()->getXDisplay(), resource.mstyle.f_fontset);
+ XFreeFontSet(getBaseDisplay().getXDisplay(), resource.mstyle.f_fontset);
if (resource.tstyle.fontset)
- XFreeFontSet(getBaseDisplay()->getXDisplay(), resource.tstyle.fontset);
+ XFreeFontSet(getBaseDisplay().getXDisplay(), resource.tstyle.fontset);
if (resource.wstyle.font)
- XFreeFont(getBaseDisplay()->getXDisplay(), resource.wstyle.font);
+ XFreeFont(getBaseDisplay().getXDisplay(), resource.wstyle.font);
if (resource.mstyle.t_font)
- XFreeFont(getBaseDisplay()->getXDisplay(), resource.mstyle.t_font);
+ XFreeFont(getBaseDisplay().getXDisplay(), resource.mstyle.t_font);
if (resource.mstyle.f_font)
- XFreeFont(getBaseDisplay()->getXDisplay(), resource.mstyle.f_font);
+ XFreeFont(getBaseDisplay().getXDisplay(), resource.mstyle.f_font);
if (resource.tstyle.font)
- XFreeFont(getBaseDisplay()->getXDisplay(), resource.tstyle.font);
+ XFreeFont(getBaseDisplay().getXDisplay(), resource.tstyle.font);
if (resource.root_command != NULL)
delete [] resource.root_command;
- XFreeGC(getBaseDisplay()->getXDisplay(), opGC);
+ XFreeGC(getBaseDisplay().getXDisplay(), opGC);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.wstyle.l_text_focus_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.wstyle.l_text_unfocus_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.wstyle.b_pic_focus_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.wstyle.b_pic_unfocus_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.mstyle.t_text_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.mstyle.f_text_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.mstyle.h_text_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.mstyle.d_text_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.mstyle.hilite_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.tstyle.l_text_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.tstyle.w_text_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.tstyle.c_text_gc);
- XFreeGC(getBaseDisplay()->getXDisplay(),
+ XFreeGC(getBaseDisplay().getXDisplay(),
resource.tstyle.b_pic_gc);
}
if (xcol.blue >= 0xff) xcol.blue = 0xffff;
else xcol.blue *= 0xff;
- if (! XAllocColor(getBaseDisplay()->getXDisplay(),
+ if (! XAllocColor(getBaseDisplay().getXDisplay(),
getColormap(), &xcol))
xcol.pixel = 0;
(unsigned int) ((texture->getColor()->getBlue() >> 2) +
(texture->getColor()->getBlue() >> 1)) * 0xff;
- if (! XAllocColor(getBaseDisplay()->getXDisplay(),
+ if (! XAllocColor(getBaseDisplay().getXDisplay(),
getColormap(), &xcol))
xcol.pixel = 0;
std::string s;
if (*fontset)
- XFreeFontSet(getBaseDisplay()->getXDisplay(), *fontset);
+ XFreeFontSet(getBaseDisplay().getXDisplay(), *fontset);
if (resource.styleconfig.getValue(rname, rclass, s)) {
if (! (*fontset = createFontSet(s.c_str())))
std::string s;
if (*font)
- XFreeFont(getBaseDisplay()->getXDisplay(), *font);
+ XFreeFont(getBaseDisplay().getXDisplay(), *font);
if (resource.styleconfig.getValue(rname, rclass, s)) {
- if ((*font = XLoadQueryFont(getBaseDisplay()->getXDisplay(),
+ if ((*font = XLoadQueryFont(getBaseDisplay().getXDisplay(),
s.c_str())) == NULL) {
fprintf(stderr, i18n->getMessage(ScreenSet, ScreenFontLoadFail,
"BScreen::LoadStyle(): couldn't load font '%s'\n"),
load_default = true;
if (load_default) {
- if ((*font = XLoadQueryFont(getBaseDisplay()->getXDisplay(),
+ if ((*font = XLoadQueryFont(getBaseDisplay().getXDisplay(),
defaultFont)) == NULL) {
fprintf(stderr, i18n->getMessage(ScreenSet, ScreenDefaultFontLoadFail,
"BScreen::LoadStyle(): couldn't load default font.\n"));
int nmissing, pixel_size = 0, buf_size = 0;
char weight[FONT_ELEMENT_SIZE], slant[FONT_ELEMENT_SIZE];
- fs = XCreateFontSet(getBaseDisplay()->getXDisplay(),
+ fs = XCreateFontSet(getBaseDisplay().getXDisplay(),
fontname, &missing, &nmissing, &def);
if (fs && (! nmissing)) return fs;
if (nmissing) XFreeStringList(missing);
setlocale(LC_CTYPE, "C");
- fs = XCreateFontSet(getBaseDisplay()->getXDisplay(), fontname,
+ fs = XCreateFontSet(getBaseDisplay().getXDisplay(), fontname,
&missing, &nmissing, &def);
setlocale(LC_CTYPE, "");
}
fontname = pattern2;
if (nmissing) XFreeStringList(missing);
- if (fs) XFreeFontSet(getBaseDisplay()->getXDisplay(), fs);
+ if (fs) XFreeFontSet(getBaseDisplay().getXDisplay(), fs);
- fs = XCreateFontSet(getBaseDisplay()->getXDisplay(), fontname,
+ fs = XCreateFontSet(getBaseDisplay().getXDisplay(), fontname,
&missing, &nmissing, &def);
delete [] pattern2;
unsigned long gc_value_mask = GCForeground;
if (! i18n->multibyte()) gc_value_mask |= GCFont;
- gcv.foreground = WhitePixel(getBaseDisplay()->getXDisplay(),
+ gcv.foreground = WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber());
gcv.function = GXinvert;
gcv.subwindow_mode = IncludeInferiors;
- XChangeGC(getBaseDisplay()->getXDisplay(), opGC,
+ XChangeGC(getBaseDisplay().getXDisplay(), opGC,
GCForeground | GCFunction | GCSubwindowMode, &gcv);
gcv.foreground = resource.wstyle.l_text_focus.getPixel();
if (resource.wstyle.font)
gcv.font = resource.wstyle.font->fid;
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.wstyle.l_text_focus_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.wstyle.l_text_focus_gc,
gc_value_mask, &gcv);
gcv.foreground = resource.wstyle.l_text_unfocus.getPixel();
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.wstyle.l_text_unfocus_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.wstyle.l_text_unfocus_gc,
gc_value_mask, &gcv);
gcv.foreground = resource.wstyle.b_pic_focus.getPixel();
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.wstyle.b_pic_focus_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.wstyle.b_pic_focus_gc,
GCForeground, &gcv);
gcv.foreground = resource.wstyle.b_pic_unfocus.getPixel();
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.wstyle.b_pic_unfocus_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.wstyle.b_pic_unfocus_gc,
GCForeground, &gcv);
gcv.foreground = resource.mstyle.t_text.getPixel();
if (resource.mstyle.t_font)
gcv.font = resource.mstyle.t_font->fid;
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.mstyle.t_text_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.mstyle.t_text_gc,
gc_value_mask, &gcv);
gcv.foreground = resource.mstyle.f_text.getPixel();
if (resource.mstyle.f_font)
gcv.font = resource.mstyle.f_font->fid;
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.mstyle.f_text_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.mstyle.f_text_gc,
gc_value_mask, &gcv);
gcv.foreground = resource.mstyle.h_text.getPixel();
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.mstyle.h_text_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.mstyle.h_text_gc,
gc_value_mask, &gcv);
gcv.foreground = resource.mstyle.d_text.getPixel();
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.mstyle.d_text_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.mstyle.d_text_gc,
gc_value_mask, &gcv);
gcv.foreground = resource.mstyle.hilite.getColor()->getPixel();
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.mstyle.hilite_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.mstyle.hilite_gc,
gc_value_mask, &gcv);
gcv.foreground = resource.tstyle.l_text.getPixel();
if (resource.tstyle.font)
gcv.font = resource.tstyle.font->fid;
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.tstyle.l_text_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.tstyle.l_text_gc,
gc_value_mask, &gcv);
gcv.foreground = resource.tstyle.w_text.getPixel();
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.tstyle.w_text_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.tstyle.w_text_gc,
gc_value_mask, &gcv);
gcv.foreground = resource.tstyle.c_text.getPixel();
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.tstyle.c_text_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.tstyle.c_text_gc,
gc_value_mask, &gcv);
gcv.foreground = resource.tstyle.b_pic.getPixel();
- XChangeGC(getBaseDisplay()->getXDisplay(), resource.tstyle.b_pic_gc,
+ XChangeGC(getBaseDisplay().getXDisplay(), resource.tstyle.b_pic_gc,
gc_value_mask, &gcv);
const char *s = i18n->getMessage(ScreenSet, ScreenPositionLength,
if (resource.wstyle.t_focus.getTexture() ==
(BImage_Flat | BImage_Solid)) {
geom_pixmap = None;
- XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window,
+ XSetWindowBackground(getBaseDisplay().getXDisplay(), geom_window,
resource.wstyle.t_focus.getColor()->getPixel());
} else {
geom_pixmap = image_control->renderImage(geom_w, geom_h,
&resource.wstyle.t_focus);
- XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(),
+ XSetWindowBackgroundPixmap(getBaseDisplay().getXDisplay(),
geom_window, geom_pixmap);
}
} else {
if (resource.wstyle.l_focus.getTexture() ==
(BImage_Flat | BImage_Solid)) {
geom_pixmap = None;
- XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window,
+ XSetWindowBackground(getBaseDisplay().getXDisplay(), geom_window,
resource.wstyle.l_focus.getColor()->getPixel());
} else {
geom_pixmap = image_control->renderImage(geom_w, geom_h,
&resource.wstyle.l_focus);
- XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(),
+ XSetWindowBackgroundPixmap(getBaseDisplay().getXDisplay(),
geom_window, geom_pixmap);
}
}
if (tmp) image_control->removeImage(tmp);
- XSetWindowBorderWidth(getBaseDisplay()->getXDisplay(), geom_window,
+ XSetWindowBorderWidth(getBaseDisplay().getXDisplay(), geom_window,
resource.border_width);
- XSetWindowBorder(getBaseDisplay()->getXDisplay(), geom_window,
+ XSetWindowBorder(getBaseDisplay().getXDisplay(), geom_window,
resource.border_color.getPixel());
workspacemenu->reconfigure();
void BScreen::LoadStyle(void) {
obResource &conf = resource.styleconfig;
- conf.setFile(openbox->getStyleFilename());
+ conf.setFile(openbox.getStyleFilename());
if (!conf.load()) {
conf.setFile(DEFAULTSTYLE);
if (!conf.load()) {
// load window config
readDatabaseTexture("window.title.focus", "Window.Title.Focus",
&resource.wstyle.t_focus,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("window.title.unfocus", "Window.Title.Unfocus",
&resource.wstyle.t_unfocus,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("window.label.focus", "Window.Label.Focus",
&resource.wstyle.l_focus,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("window.label.unfocus", "Window.Label.Unfocus",
&resource.wstyle.l_unfocus,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("window.handle.focus", "Window.Handle.Focus",
&resource.wstyle.h_focus,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("window.handle.unfocus", "Window.Handle.Unfocus",
&resource.wstyle.h_unfocus,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("window.grip.focus", "Window.Grip.Focus",
&resource.wstyle.g_focus,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("window.grip.unfocus", "Window.Grip.Unfocus",
&resource.wstyle.g_unfocus,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("window.button.focus", "Window.Button.Focus",
&resource.wstyle.b_focus,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("window.button.unfocus", "Window.Button.Unfocus",
&resource.wstyle.b_unfocus,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("window.button.pressed", "Window.Button.Pressed",
&resource.wstyle.b_pressed,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("window.frame.focusColor",
"Window.Frame.FocusColor",
&resource.wstyle.f_focus,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("window.frame.unfocusColor",
"Window.Frame.UnfocusColor",
&resource.wstyle.f_unfocus,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("window.label.focus.textColor",
"Window.Label.Focus.TextColor",
&resource.wstyle.l_text_focus,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("window.label.unfocus.textColor",
"Window.Label.Unfocus.TextColor",
&resource.wstyle.l_text_unfocus,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("window.button.focus.picColor",
"Window.Button.Focus.PicColor",
&resource.wstyle.b_pic_focus,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("window.button.unfocus.picColor",
"Window.Button.Unfocus.PicColor",
&resource.wstyle.b_pic_unfocus,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
if (conf.getValue("window.justify", "Window.Justify", s)) {
// load toolbar config
readDatabaseTexture("toolbar", "Toolbar",
&resource.tstyle.toolbar,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("toolbar.label", "Toolbar.Label",
&resource.tstyle.label,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("toolbar.windowLabel", "Toolbar.WindowLabel",
&resource.tstyle.window,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("toolbar.button", "Toolbar.Button",
&resource.tstyle.button,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("toolbar.button.pressed", "Toolbar.Button.Pressed",
&resource.tstyle.pressed,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("toolbar.clock", "Toolbar.Clock",
&resource.tstyle.clock,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("toolbar.label.textColor", "Toolbar.Label.TextColor",
&resource.tstyle.l_text,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("toolbar.windowLabel.textColor",
"Toolbar.WindowLabel.TextColor",
&resource.tstyle.w_text,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("toolbar.clock.textColor", "Toolbar.Clock.TextColor",
&resource.tstyle.c_text,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("toolbar.button.picColor", "Toolbar.Button.PicColor",
&resource.tstyle.b_pic,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
if (conf.getValue("toolbar.justify", "Toolbar.Justify", s)) {
// load menu config
readDatabaseTexture("menu.title", "Menu.Title",
&resource.mstyle.title,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("menu.frame", "Menu.Frame",
&resource.mstyle.frame,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseTexture("menu.hilite", "Menu.Hilite",
&resource.mstyle.hilite,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("menu.title.textColor", "Menu.Title.TextColor",
&resource.mstyle.t_text,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("menu.frame.textColor", "Menu.Frame.TextColor",
&resource.mstyle.f_text,
- WhitePixel(getBaseDisplay()->getXDisplay(),
+ WhitePixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("menu.frame.disableColor", "Menu.Frame.DisableColor",
&resource.mstyle.d_text,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
readDatabaseColor("menu.hilite.textColor", "Menu.Hilite.TextColor",
&resource.mstyle.h_text,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
if (conf.getValue("menu.title.justify", "Menu.Title.Justify", s)) {
resource.mstyle.bullet_pos = Basemenu::Left;
readDatabaseColor("borderColor", "BorderColor", &resource.border_color,
- BlackPixel(getBaseDisplay()->getXDisplay(),
+ BlackPixel(getBaseDisplay().getXDisplay(),
getScreenNumber()));
// load bevel, border and handle widths
#ifndef __EMX__
char displaystring[MAXPATHLEN];
sprintf(displaystring, "DISPLAY=%s",
- DisplayString(getBaseDisplay()->getXDisplay()));
+ DisplayString(getBaseDisplay().getXDisplay()));
sprintf(displaystring + strlen(displaystring) - 1, "%d",
getScreenNumber());
workspacemenu->setItemSelected(current_workspace->getWorkspaceID() + 2,
False);
- if (openbox->getFocusedWindow() &&
- openbox->getFocusedWindow()->getScreen() == this &&
- (! openbox->getFocusedWindow()->isStuck())) {
- current_workspace->setLastFocusedWindow(openbox->getFocusedWindow());
- openbox->setFocusedWindow((OpenboxWindow *) 0);
+ if (openbox.getFocusedWindow() &&
+ openbox.getFocusedWindow()->getScreen() == this &&
+ (! openbox.getFocusedWindow()->isStuck())) {
+ current_workspace->setLastFocusedWindow(openbox.getFocusedWindow());
+ openbox.setFocusedWindow((OpenboxWindow *) 0);
}
current_workspace = getWorkspace(id);
current_workspace->showAll();
if (resource.focus_last && current_workspace->getLastFocusedWindow()) {
- XSync(openbox->getXDisplay(), False);
+ XSync(openbox.getXDisplay(), False);
current_workspace->getLastFocusedWindow()->setInputFocus();
}
}
w->getWorkspaceID());
}
- Window f = ((openbox->getFocusedWindow()) ?
- openbox->getFocusedWindow()->getClientWindow() : None);
+ Window f = ((openbox.getFocusedWindow()) ?
+ openbox.getFocusedWindow()->getClientWindow() : None);
n->sendWindowFocus(f);
}
void BScreen::updateNetizenWindowFocus(void) {
- Window f = ((openbox->getFocusedWindow()) ?
- openbox->getFocusedWindow()->getClientWindow() : None);
+ Window f = ((openbox.getFocusedWindow()) ?
+ openbox.getFocusedWindow()->getClientWindow() : None);
LinkedListIterator<Netizen> it(netizenList);
for (Netizen *n = it.current(); n; it++, n = it.current())
n->sendWindowFocus(f);
Window[(num + workspacesList->count() + rootmenuList->count() + 13)];
int i = 0, k = num;
- XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->getWindowID());
+ XRaiseWindow(getBaseDisplay().getXDisplay(), iconmenu->getWindowID());
*(session_stack + i++) = iconmenu->getWindowID();
LinkedListIterator<Workspace> wit(workspacesList);
while (k--)
*(session_stack + i++) = *(workspace_stack + k);
- XRestackWindows(getBaseDisplay()->getXDisplay(), session_stack, i);
+ XRestackWindows(getBaseDisplay().getXDisplay(), session_stack, i);
delete [] session_stack;
}
int focused_window_number = -1;
OpenboxWindow *next;
- if (openbox->getFocusedWindow()) {
- if (openbox->getFocusedWindow()->getScreen()->getScreenNumber() ==
+ if (openbox.getFocusedWindow()) {
+ if (openbox.getFocusedWindow()->getScreen()->getScreenNumber() ==
getScreenNumber()) {
have_focused = True;
- focused_window_number = openbox->getFocusedWindow()->getWindowNumber();
+ focused_window_number = openbox.getFocusedWindow()->getWindowNumber();
}
}
int focused_window_number = -1;
OpenboxWindow *prev;
- if (openbox->getFocusedWindow()) {
- if (openbox->getFocusedWindow()->getScreen()->getScreenNumber() ==
+ if (openbox.getFocusedWindow()) {
+ if (openbox.getFocusedWindow()->getScreen()->getScreenNumber() ==
getScreenNumber()) {
have_focused = True;
- focused_window_number = openbox->getFocusedWindow()->getWindowNumber();
+ focused_window_number = openbox.getFocusedWindow()->getWindowNumber();
}
}
Bool have_focused = False;
int focused_window_number = -1;
- if (openbox->getFocusedWindow()) {
- if (openbox->getFocusedWindow()->getScreen()->getScreenNumber() ==
+ if (openbox.getFocusedWindow()) {
+ if (openbox.getFocusedWindow()->getScreen()->getScreenNumber() ==
getScreenNumber()) {
have_focused = True;
- focused_window_number = openbox->getFocusedWindow()->getWindowNumber();
+ focused_window_number = openbox.getFocusedWindow()->getWindowNumber();
}
}
if ((getCurrentWorkspace()->getCount() > 1) && have_focused)
- getWorkspace(openbox->getFocusedWindow()->getWorkspaceNumber())->
- raiseWindow(openbox->getFocusedWindow());
+ getWorkspace(openbox.getFocusedWindow()->getWorkspaceNumber())->
+ raiseWindow(openbox.getFocusedWindow());
}
}
Bool defaultMenu = True;
- if (openbox->getMenuFilename()) {
- FILE *menu_file = fopen(openbox->getMenuFilename(), "r");
+ if (openbox.getMenuFilename()) {
+ FILE *menu_file = fopen(openbox.getMenuFilename(), "r");
if (!menu_file) {
- perror(openbox->getMenuFilename());
+ perror(openbox.getMenuFilename());
} else {
if (feof(menu_file)) {
fprintf(stderr, i18n->getMessage(ScreenSet, ScreenEmptyMenuFile,
"%s: Empty menu file"),
- openbox->getMenuFilename());
+ openbox.getMenuFilename());
} else {
char line[1024], label[1024];
memset(line, 0, 1024);
rootmenu->insert(i18n->getMessage(ScreenSet, ScreenExit, "Exit"),
BScreen::Exit);
} else {
- openbox->saveMenuFilename(openbox->getMenuFilename());
+ openbox.saveMenuFilename(openbox.getMenuFilename());
}
}
if (! feof(submenufile)) {
if (! parseMenuFile(submenufile, menu))
- openbox->saveMenuFilename(newfile);
+ openbox.saveMenuFilename(newfile);
fclose(submenufile);
}
rootmenuList->insert(stylesmenu);
}
- openbox->saveMenuFilename(stylesdir);
+ openbox.saveMenuFilename(stylesdir);
} else {
fprintf(stderr, i18n->getMessage(ScreenSet,
ScreenSTYLESDIRErrorNotDir,
void BScreen::shutdown(void) {
- openbox->grab();
+ openbox.grab();
- XSelectInput(getBaseDisplay()->getXDisplay(), getRootWindow(), NoEventMask);
- XSync(getBaseDisplay()->getXDisplay(), False);
+ XSelectInput(getBaseDisplay().getXDisplay(), getRootWindow(), NoEventMask);
+ XSync(getBaseDisplay().getXDisplay(), False);
LinkedListIterator<Workspace> it(workspacesList);
for (Workspace *w = it.current(); w; it++, w = it.current())
slit->shutdown();
#endif // SLIT
- openbox->ungrab();
+ openbox.ungrab();
}
void BScreen::showPosition(int x, int y) {
if (! geom_visible) {
- XMoveResizeWindow(getBaseDisplay()->getXDisplay(), geom_window,
+ XMoveResizeWindow(getBaseDisplay().getXDisplay(), geom_window,
(getWidth() - geom_w) / 2,
(getHeight() - geom_h) / 2, geom_w, geom_h);
- XMapWindow(getBaseDisplay()->getXDisplay(), geom_window);
- XRaiseWindow(getBaseDisplay()->getXDisplay(), geom_window);
+ XMapWindow(getBaseDisplay().getXDisplay(), geom_window);
+ XRaiseWindow(getBaseDisplay().getXDisplay(), geom_window);
geom_visible = True;
}
sprintf(label, i18n->getMessage(ScreenSet, ScreenPositionFormat,
"X: %4d x Y: %4d"), x, y);
- XClearWindow(getBaseDisplay()->getXDisplay(), geom_window);
+ XClearWindow(getBaseDisplay().getXDisplay(), geom_window);
if (i18n->multibyte()) {
- XmbDrawString(getBaseDisplay()->getXDisplay(), geom_window,
+ XmbDrawString(getBaseDisplay().getXDisplay(), geom_window,
resource.wstyle.fontset, resource.wstyle.l_text_focus_gc,
resource.bevel_width, resource.bevel_width -
resource.wstyle.fontset_extents->max_ink_extent.y,
label, strlen(label));
} else {
- XDrawString(getBaseDisplay()->getXDisplay(), geom_window,
+ XDrawString(getBaseDisplay().getXDisplay(), geom_window,
resource.wstyle.l_text_focus_gc,
resource.bevel_width,
resource.wstyle.font->ascent +
void BScreen::showGeometry(unsigned int gx, unsigned int gy) {
if (! geom_visible) {
- XMoveResizeWindow(getBaseDisplay()->getXDisplay(), geom_window,
+ XMoveResizeWindow(getBaseDisplay().getXDisplay(), geom_window,
(getWidth() - geom_w) / 2,
(getHeight() - geom_h) / 2, geom_w, geom_h);
- XMapWindow(getBaseDisplay()->getXDisplay(), geom_window);
- XRaiseWindow(getBaseDisplay()->getXDisplay(), geom_window);
+ XMapWindow(getBaseDisplay().getXDisplay(), geom_window);
+ XRaiseWindow(getBaseDisplay().getXDisplay(), geom_window);
geom_visible = True;
}
sprintf(label, i18n->getMessage(ScreenSet, ScreenGeometryFormat,
"W: %4d x H: %4d"), gx, gy);
- XClearWindow(getBaseDisplay()->getXDisplay(), geom_window);
+ XClearWindow(getBaseDisplay().getXDisplay(), geom_window);
if (i18n->multibyte()) {
- XmbDrawString(getBaseDisplay()->getXDisplay(), geom_window,
+ XmbDrawString(getBaseDisplay().getXDisplay(), geom_window,
resource.wstyle.fontset, resource.wstyle.l_text_focus_gc,
resource.bevel_width, resource.bevel_width -
resource.wstyle.fontset_extents->max_ink_extent.y,
label, strlen(label));
} else {
- XDrawString(getBaseDisplay()->getXDisplay(), geom_window,
+ XDrawString(getBaseDisplay().getXDisplay(), geom_window,
resource.wstyle.l_text_focus_gc,
resource.bevel_width,
resource.wstyle.font->ascent +
void BScreen::hideGeometry(void) {
if (geom_visible) {
- XUnmapWindow(getBaseDisplay()->getXDisplay(), geom_window);
+ XUnmapWindow(getBaseDisplay().getXDisplay(), geom_window);
geom_visible = False;
}
}
Pixmap geom_pixmap;
Window geom_window;
- Openbox *openbox;
+ Openbox &openbox;
BImageControl *image_control;
Configmenu *configmenu;
Iconmenu *iconmenu;
public:
- BScreen(Openbox *, int);
+ BScreen(Openbox &, int);
~BScreen(void);
inline const Bool &isToolbarOnTop(void) const
inline const GC &getOpGC() const { return opGC; }
- inline Openbox *getOpenbox(void) { return openbox; }
+ inline Openbox &getOpenbox(void) { return openbox; }
inline BColor *getBorderColor(void) { return &resource.border_color; }
inline BImageControl *getImageControl(void) { return image_control; }
inline Rootmenu *getRootmenu(void) { return rootmenu; }
#include "Toolbar.h"
-Slit::Slit(BScreen *scr) {
- screen = scr;
- openbox = screen->getOpenbox();
+Slit::Slit(BScreen &scr) : screen(scr), openbox(scr.getOpenbox()) {
+ on_top = screen.isSlitOnTop();
+ hidden = do_auto_hide = screen.doSlitAutoHide();
- on_top = screen->isSlitOnTop();
- hidden = do_auto_hide = screen->doSlitAutoHide();
-
- display = screen->getBaseDisplay()->getXDisplay();
+ display = screen.getBaseDisplay().getXDisplay();
frame.window = frame.pixmap = None;
- timer = new BTimer(*openbox, *this);
- timer->setTimeout(openbox->getAutoRaiseDelay());
+ timer = new BTimer(openbox, *this);
+ timer->setTimeout(openbox.getAutoRaiseDelay());
timer->fireOnce(True);
clientList = new LinkedList<SlitClient>;
CWColormap | CWOverrideRedirect | CWEventMask;
attrib.background_pixmap = None;
attrib.background_pixel = attrib.border_pixel =
- screen->getBorderColor()->getPixel();
- attrib.colormap = screen->getColormap();
+ screen.getBorderColor()->getPixel();
+ attrib.colormap = screen.getColormap();
attrib.override_redirect = True;
attrib.event_mask = SubstructureRedirectMask | ButtonPressMask |
EnterWindowMask | LeaveWindowMask;
frame.width = frame.height = 1;
frame.window =
- XCreateWindow(display, screen->getRootWindow(), frame.x, frame.y,
- frame.width, frame.height, screen->getBorderWidth(),
- screen->getDepth(), InputOutput, screen->getVisual(),
+ XCreateWindow(display, screen.getRootWindow(), frame.x, frame.y,
+ frame.width, frame.height, screen.getBorderWidth(),
+ screen.getDepth(), InputOutput, screen.getVisual(),
create_mask, &attrib);
- openbox->saveSlitSearch(frame.window, this);
+ openbox.saveSlitSearch(frame.window, this);
reconfigure();
}
Slit::~Slit() {
- openbox->grab();
+ openbox.grab();
if (timer->isTiming()) timer->stop();
delete timer;
delete clientList;
delete slitmenu;
- screen->getImageControl()->removeImage(frame.pixmap);
+ screen.getImageControl()->removeImage(frame.pixmap);
- openbox->removeSlitSearch(frame.window);
+ openbox.removeSlitSearch(frame.window);
XDestroyWindow(display, frame.window);
- openbox->ungrab();
+ openbox.ungrab();
}
void Slit::addClient(Window w) {
- openbox->grab();
+ openbox.grab();
- if (openbox->validateWindow(w)) {
+ if (openbox.validateWindow(w)) {
SlitClient *client = new SlitClient;
client->client_window = w;
if (wmhints) {
if ((wmhints->flags & IconWindowHint) &&
(wmhints->icon_window != None)) {
- XMoveWindow(display, client->client_window, screen->getWidth() + 10,
- screen->getHeight() + 10);
+ XMoveWindow(display, client->client_window, screen.getWidth() + 10,
+ screen.getHeight() + 10);
XMapWindow(display, client->client_window);
client->icon_window = wmhints->icon_window;
clientList->insert(client);
- openbox->saveSlitSearch(client->client_window, this);
- openbox->saveSlitSearch(client->icon_window, this);
+ openbox.saveSlitSearch(client->client_window, this);
+ openbox.saveSlitSearch(client->icon_window, this);
reconfigure();
}
- openbox->ungrab();
+ openbox.ungrab();
}
void Slit::removeClient(SlitClient *client, Bool remap) {
- openbox->removeSlitSearch(client->client_window);
- openbox->removeSlitSearch(client->icon_window);
+ openbox.removeSlitSearch(client->client_window);
+ openbox.removeSlitSearch(client->icon_window);
clientList->remove(client);
- screen->removeNetizen(client->window);
+ screen.removeNetizen(client->window);
- if (remap && openbox->validateWindow(client->window)) {
+ if (remap && openbox.validateWindow(client->window)) {
XSelectInput(display, frame.window, NoEventMask);
XSelectInput(display, client->window, NoEventMask);
- XReparentWindow(display, client->window, screen->getRootWindow(),
+ XReparentWindow(display, client->window, screen.getRootWindow(),
client->x, client->y);
XChangeSaveSet(display, client->window, SetModeDelete);
XSelectInput(display, frame.window, SubstructureRedirectMask |
void Slit::removeClient(Window w, Bool remap) {
- openbox->grab();
+ openbox.grab();
Bool reconf = False;
if (reconf) reconfigure();
- openbox->ungrab();
+ openbox.ungrab();
}
LinkedListIterator<SlitClient> it(clientList);
SlitClient *client;
- switch (screen->getSlitDirection()) {
+ switch (screen.getSlitDirection()) {
case Vertical:
for (client = it.current(); client; it++, client = it.current()) {
- frame.height += client->height + screen->getBevelWidth();
+ frame.height += client->height + screen.getBevelWidth();
if (frame.width < client->width)
frame.width = client->width;
if (frame.width < 1)
frame.width = 1;
else
- frame.width += (screen->getBevelWidth() * 2);
+ frame.width += (screen.getBevelWidth() * 2);
if (frame.height < 1)
frame.height = 1;
else
- frame.height += screen->getBevelWidth();
+ frame.height += screen.getBevelWidth();
break;
case Horizontal:
for (client = it.current(); client; it++, client = it.current()) {
- frame.width += client->width + screen->getBevelWidth();
+ frame.width += client->width + screen.getBevelWidth();
if (frame.height < client->height)
frame.height = client->height;
if (frame.width < 1)
frame.width = 1;
else
- frame.width += screen->getBevelWidth();
+ frame.width += screen.getBevelWidth();
if (frame.height < 1)
frame.height = 1;
else
- frame.height += (screen->getBevelWidth() * 2);
+ frame.height += (screen.getBevelWidth() * 2);
break;
}
reposition();
- XSetWindowBorderWidth(display ,frame.window, screen->getBorderWidth());
+ XSetWindowBorderWidth(display ,frame.window, screen.getBorderWidth());
XSetWindowBorder(display, frame.window,
- screen->getBorderColor()->getPixel());
+ screen.getBorderColor()->getPixel());
if (! clientList->count())
XUnmapWindow(display, frame.window);
XMapWindow(display, frame.window);
Pixmap tmp = frame.pixmap;
- BImageControl *image_ctrl = screen->getImageControl();
- BTexture *texture = &(screen->getToolbarStyle()->toolbar);
+ BImageControl *image_ctrl = screen.getImageControl();
+ BTexture *texture = &(screen.getToolbarStyle()->toolbar);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
frame.pixmap = None;
XSetWindowBackground(display, frame.window,
int x, y;
it.reset();
- switch (screen->getSlitDirection()) {
+ switch (screen.getSlitDirection()) {
case Vertical:
x = 0;
- y = screen->getBevelWidth();
+ y = screen.getBevelWidth();
for (client = it.current(); client; it++, client = it.current()) {
x = (frame.width - client->width) / 2;
XSendEvent(display, client->window, False, StructureNotifyMask, &event);
- y += client->height + screen->getBevelWidth();
+ y += client->height + screen.getBevelWidth();
}
break;
case Horizontal:
- x = screen->getBevelWidth();
+ x = screen.getBevelWidth();
y = 0;
for (client = it.current(); client; it++, client = it.current()) {
XSendEvent(display, client->window, False, StructureNotifyMask, &event);
- x += client->width + screen->getBevelWidth();
+ x += client->width + screen.getBevelWidth();
}
break;
void Slit::reposition(void) {
// place the slit in the appropriate place
- switch (screen->getSlitPlacement()) {
+ switch (screen.getSlitPlacement()) {
case TopLeft:
frame.x = 0;
frame.y = 0;
- if (screen->getSlitDirection() == Vertical) {
- frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth()
+ if (screen.getSlitDirection() == Vertical) {
+ frame.x_hidden = screen.getBevelWidth() - screen.getBorderWidth()
- frame.width;
frame.y_hidden = 0;
} else {
frame.x_hidden = 0;
- frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth()
+ frame.y_hidden = screen.getBevelWidth() - screen.getBorderWidth()
- frame.height;
}
break;
case CenterLeft:
frame.x = 0;
- frame.y = (screen->getHeight() - frame.height) / 2;
- frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth()
+ frame.y = (screen.getHeight() - frame.height) / 2;
+ frame.x_hidden = screen.getBevelWidth() - screen.getBorderWidth()
- frame.width;
frame.y_hidden = frame.y;
break;
case BottomLeft:
frame.x = 0;
- frame.y = screen->getHeight() - frame.height
- - (screen->getBorderWidth() * 2);
- if (screen->getSlitDirection() == Vertical) {
- frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth()
+ frame.y = screen.getHeight() - frame.height
+ - (screen.getBorderWidth() * 2);
+ if (screen.getSlitDirection() == Vertical) {
+ frame.x_hidden = screen.getBevelWidth() - screen.getBorderWidth()
- frame.width;
frame.y_hidden = frame.y;
} else {
frame.x_hidden = 0;
- frame.y_hidden = screen->getHeight() - screen->getBevelWidth()
- - screen->getBorderWidth();
+ frame.y_hidden = screen.getHeight() - screen.getBevelWidth()
+ - screen.getBorderWidth();
}
break;
case TopCenter:
- frame.x = (screen->getWidth() - frame.width) / 2;
+ frame.x = (screen.getWidth() - frame.width) / 2;
frame.y = 0;
frame.x_hidden = frame.x;
- frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth()
+ frame.y_hidden = screen.getBevelWidth() - screen.getBorderWidth()
- frame.height;
break;
case BottomCenter:
- frame.x = (screen->getWidth() - frame.width) / 2;
- frame.y = screen->getHeight() - frame.height
- - (screen->getBorderWidth() * 2);
+ frame.x = (screen.getWidth() - frame.width) / 2;
+ frame.y = screen.getHeight() - frame.height
+ - (screen.getBorderWidth() * 2);
frame.x_hidden = frame.x;
- frame.y_hidden = screen->getHeight() - screen->getBevelWidth()
- - screen->getBorderWidth();
+ frame.y_hidden = screen.getHeight() - screen.getBevelWidth()
+ - screen.getBorderWidth();
break;
case TopRight:
- frame.x = screen->getWidth() - frame.width
- - (screen->getBorderWidth() * 2);
+ frame.x = screen.getWidth() - frame.width
+ - (screen.getBorderWidth() * 2);
frame.y = 0;
- if (screen->getSlitDirection() == Vertical) {
- frame.x_hidden = screen->getWidth() - screen->getBevelWidth()
- - screen->getBorderWidth();
+ if (screen.getSlitDirection() == Vertical) {
+ frame.x_hidden = screen.getWidth() - screen.getBevelWidth()
+ - screen.getBorderWidth();
frame.y_hidden = 0;
} else {
frame.x_hidden = frame.x;
- frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth()
+ frame.y_hidden = screen.getBevelWidth() - screen.getBorderWidth()
- frame.height;
}
break;
case CenterRight:
default:
- frame.x = screen->getWidth() - frame.width
- - (screen->getBorderWidth() * 2);
- frame.y = (screen->getHeight() - frame.height) / 2;
- frame.x_hidden = screen->getWidth() - screen->getBevelWidth()
- - screen->getBorderWidth();
+ frame.x = screen.getWidth() - frame.width
+ - (screen.getBorderWidth() * 2);
+ frame.y = (screen.getHeight() - frame.height) / 2;
+ frame.x_hidden = screen.getWidth() - screen.getBevelWidth()
+ - screen.getBorderWidth();
frame.y_hidden = frame.y;
break;
case BottomRight:
- frame.x = screen->getWidth() - frame.width
- - (screen->getBorderWidth() * 2);
- frame.y = screen->getHeight() - frame.height
- - (screen->getBorderWidth() * 2);
- if (screen->getSlitDirection() == Vertical) {
- frame.x_hidden = screen->getWidth() - screen->getBevelWidth()
- - screen->getBorderWidth();
+ frame.x = screen.getWidth() - frame.width
+ - (screen.getBorderWidth() * 2);
+ frame.y = screen.getHeight() - frame.height
+ - (screen.getBorderWidth() * 2);
+ if (screen.getSlitDirection() == Vertical) {
+ frame.x_hidden = screen.getWidth() - screen.getBevelWidth()
+ - screen.getBorderWidth();
frame.y_hidden = frame.y;
} else {
frame.x_hidden = frame.x;
- frame.y_hidden = screen->getHeight() - screen->getBevelWidth()
- - screen->getBorderWidth();
+ frame.y_hidden = screen.getHeight() - screen.getBevelWidth()
+ - screen.getBorderWidth();
}
break;
}
- Toolbar *tbar = screen->getToolbar();
- int sw = frame.width + (screen->getBorderWidth() * 2),
- sh = frame.height + (screen->getBorderWidth() * 2),
- tw = tbar->getWidth() + screen->getBorderWidth(),
- th = tbar->getHeight() + screen->getBorderWidth();
+ Toolbar *tbar = screen.getToolbar();
+ int sw = frame.width + (screen.getBorderWidth() * 2),
+ sh = frame.height + (screen.getBorderWidth() * 2),
+ tw = tbar->getWidth() + screen.getBorderWidth(),
+ th = tbar->getHeight() + screen.getBorderWidth();
if (tbar->getX() < frame.x + sw && tbar->getX() + tw > frame.x &&
tbar->getY() < frame.y + sh && tbar->getY() + th > frame.y) {
if (frame.y < th) {
frame.y += tbar->getExposedHeight();
- if (screen->getSlitDirection() == Vertical)
+ if (screen.getSlitDirection() == Vertical)
frame.y_hidden += tbar->getExposedHeight();
else
frame.y_hidden = frame.y;
} else {
frame.y -= tbar->getExposedHeight();
- if (screen->getSlitDirection() == Vertical)
+ if (screen.getSlitDirection() == Vertical)
frame.y_hidden -= tbar->getExposedHeight();
else
frame.y_hidden = frame.y;
if (e->button == Button1 && (! on_top)) {
Window w[1] = { frame.window };
- screen->raiseWindows(w, 1);
+ screen.raiseWindows(w, 1);
} else if (e->button == Button2 && (! on_top)) {
XLowerWindow(display, frame.window);
} else if (e->button == Button3) {
if (x < 0)
x = 0;
- else if (x + slitmenu->getWidth() > screen->getWidth())
- x = screen->getWidth() - slitmenu->getWidth();
+ else if (x + slitmenu->getWidth() > screen.getWidth())
+ x = screen.getWidth() - slitmenu->getWidth();
if (y < 0)
y = 0;
- else if (y + slitmenu->getHeight() > screen->getHeight())
- y = screen->getHeight() - slitmenu->getHeight();
+ else if (y + slitmenu->getHeight() > screen.getHeight())
+ y = screen.getHeight() - slitmenu->getHeight();
slitmenu->move(x, y);
slitmenu->show();
void Slit::configureRequestEvent(XConfigureRequestEvent *e) {
- openbox->grab();
+ openbox.grab();
- if (openbox->validateWindow(e->window)) {
+ if (openbox.validateWindow(e->window)) {
Bool reconf = False;
XWindowChanges xwc;
}
- openbox->ungrab();
+ openbox.ungrab();
}
}
-Slitmenu::Slitmenu(Slit &sl) : Basemenu(*sl.screen), slit(sl) {
+Slitmenu::Slitmenu(Slit &sl) : Basemenu(sl.screen), slit(sl) {
setLabel(i18n->getMessage(SlitSet, SlitSlitTitle, "Slit"));
setInternalMenu();
slit.on_top = change;
setItemSelected(2, change);
- if (slit.isOnTop()) slit.screen->raiseWindows((Window *) 0, 0);
+ if (slit.isOnTop()) slit.screen.raiseWindows((Window *) 0, 0);
break;
}
Slitmenu::Directionmenu::Directionmenu(Slitmenu &sm)
- : Basemenu(*sm.slit.screen), slitmenu(sm) {
+ : Basemenu(sm.slit.screen), slitmenu(sm) {
setLabel(i18n->getMessage(SlitSet, SlitSlitDirection, "Slit Direction"));
setInternalMenu();
update();
- if (sm.slit.screen->getSlitDirection() == Slit::Horizontal)
+ if (sm.slit.screen.getSlitDirection() == Slit::Horizontal)
setItemSelected(0, True);
else
setItemSelected(1, True);
BasemenuItem *item = find(index);
if (! item) return;
- slitmenu.slit.screen->saveSlitDirection(item->function());
+ slitmenu.slit.screen.saveSlitDirection(item->function());
if (item->function() == Slit::Horizontal) {
setItemSelected(0, True);
Slitmenu::Placementmenu::Placementmenu(Slitmenu &sm)
- : Basemenu(*sm.slit.screen), slitmenu(sm) {
+ : Basemenu(sm.slit.screen), slitmenu(sm) {
setLabel(i18n->getMessage(SlitSet, SlitSlitPlacement, "Slit Placement"));
setMinimumSublevels(3);
BasemenuItem *item = find(index);
if (! (item && item->function())) return;
- slitmenu.slit.screen->saveSlitPlacement(item->function());
+ slitmenu.slit.screen.saveSlitPlacement(item->function());
hide();
slitmenu.slit.reconfigure();
}
Bool on_top, hidden, do_auto_hide;
Display *display;
- Openbox *openbox;
- BScreen *screen;
+ Openbox &openbox;
+ BScreen &screen;
BTimer *timer;
LinkedList<SlitClient> *clientList;
public:
- Slit(BScreen *);
+ Slit(BScreen &);
virtual ~Slit();
inline const Bool &isOnTop(void) const { return on_top; }
#endif // TIME_WITH_SYS_TIME
-Toolbar::Toolbar(BScreen *scrn) {
- screen = scrn;
- openbox = screen->getOpenbox();
-
+Toolbar::Toolbar(BScreen &scrn) : screen(scrn), openbox(scrn.getOpenbox()) {
// get the clock updating every minute
- clock_timer = new BTimer(*openbox, *this);
+ clock_timer = new BTimer(openbox, *this);
timeval now;
gettimeofday(&now, 0);
clock_timer->setTimeout((60 - (now.tv_sec % 60)) * 1000);
clock_timer->start();
hide_handler.toolbar = this;
- hide_timer = new BTimer(*openbox, hide_handler);
- hide_timer->setTimeout(openbox->getAutoRaiseDelay());
+ hide_timer = new BTimer(openbox, hide_handler);
+ hide_timer->setTimeout(openbox.getAutoRaiseDelay());
hide_timer->fireOnce(True);
- image_ctrl = screen->getImageControl();
+ image_ctrl = screen.getImageControl();
- on_top = screen->isToolbarOnTop();
- hidden = do_auto_hide = screen->doToolbarAutoHide();
+ on_top = screen.isToolbarOnTop();
+ hidden = do_auto_hide = screen.doToolbarAutoHide();
editing = False;
new_workspace_name = (char *) 0;
toolbarmenu = new Toolbarmenu(*this);
- display = openbox->getXDisplay();
+ display = openbox.getXDisplay();
XSetWindowAttributes attrib;
unsigned long create_mask = CWBackPixmap | CWBackPixel | CWBorderPixel |
CWColormap | CWOverrideRedirect | CWEventMask;
attrib.background_pixmap = None;
attrib.background_pixel = attrib.border_pixel =
- screen->getBorderColor()->getPixel();
- attrib.colormap = screen->getColormap();
+ screen.getBorderColor()->getPixel();
+ attrib.colormap = screen.getColormap();
attrib.override_redirect = True;
attrib.event_mask = ButtonPressMask | ButtonReleaseMask |
EnterWindowMask | LeaveWindowMask;
frame.window =
- XCreateWindow(display, screen->getRootWindow(), 0, 0, 1, 1, 0,
- screen->getDepth(), InputOutput, screen->getVisual(),
+ XCreateWindow(display, screen.getRootWindow(), 0, 0, 1, 1, 0,
+ screen.getDepth(), InputOutput, screen.getVisual(),
create_mask, &attrib);
- openbox->saveToolbarSearch(frame.window, this);
+ openbox.saveToolbarSearch(frame.window, this);
attrib.event_mask = ButtonPressMask | ButtonReleaseMask | ExposureMask |
KeyPressMask | EnterWindowMask;
frame.workspace_label =
- XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen->getDepth(),
- InputOutput, screen->getVisual(), create_mask, &attrib);
- openbox->saveToolbarSearch(frame.workspace_label, this);
+ XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen.getDepth(),
+ InputOutput, screen.getVisual(), create_mask, &attrib);
+ openbox.saveToolbarSearch(frame.workspace_label, this);
frame.window_label =
- XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen->getDepth(),
- InputOutput, screen->getVisual(), create_mask, &attrib);
- openbox->saveToolbarSearch(frame.window_label, this);
+ XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen.getDepth(),
+ InputOutput, screen.getVisual(), create_mask, &attrib);
+ openbox.saveToolbarSearch(frame.window_label, this);
frame.clock =
- XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen->getDepth(),
- InputOutput, screen->getVisual(), create_mask, &attrib);
- openbox->saveToolbarSearch(frame.clock, this);
+ XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen.getDepth(),
+ InputOutput, screen.getVisual(), create_mask, &attrib);
+ openbox.saveToolbarSearch(frame.clock, this);
frame.psbutton =
- XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(),
- InputOutput, screen->getVisual(), create_mask, &attrib);
- openbox->saveToolbarSearch(frame.psbutton, this);
+ XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen.getDepth(),
+ InputOutput, screen.getVisual(), create_mask, &attrib);
+ openbox.saveToolbarSearch(frame.psbutton, this);
frame.nsbutton =
- XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(),
- InputOutput, screen->getVisual(), create_mask, &attrib);
- openbox->saveToolbarSearch(frame.nsbutton, this);
+ XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen.getDepth(),
+ InputOutput, screen.getVisual(), create_mask, &attrib);
+ openbox.saveToolbarSearch(frame.nsbutton, this);
frame.pwbutton =
- XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(),
- InputOutput, screen->getVisual(), create_mask, &attrib);
- openbox->saveToolbarSearch(frame.pwbutton, this);
+ XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen.getDepth(),
+ InputOutput, screen.getVisual(), create_mask, &attrib);
+ openbox.saveToolbarSearch(frame.pwbutton, this);
frame.nwbutton =
- XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(),
- InputOutput, screen->getVisual(), create_mask, &attrib);
- openbox->saveToolbarSearch(frame.nwbutton, this);
+ XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen.getDepth(),
+ InputOutput, screen.getVisual(), create_mask, &attrib);
+ openbox.saveToolbarSearch(frame.nwbutton, this);
frame.base = frame.label = frame.wlabel = frame.clk = frame.button =
frame.pbutton = None;
if (frame.button) image_ctrl->removeImage(frame.button);
if (frame.pbutton) image_ctrl->removeImage(frame.pbutton);
- openbox->removeToolbarSearch(frame.window);
- openbox->removeToolbarSearch(frame.workspace_label);
- openbox->removeToolbarSearch(frame.window_label);
- openbox->removeToolbarSearch(frame.clock);
- openbox->removeToolbarSearch(frame.psbutton);
- openbox->removeToolbarSearch(frame.nsbutton);
- openbox->removeToolbarSearch(frame.pwbutton);
- openbox->removeToolbarSearch(frame.nwbutton);
+ openbox.removeToolbarSearch(frame.window);
+ openbox.removeToolbarSearch(frame.workspace_label);
+ openbox.removeToolbarSearch(frame.window_label);
+ openbox.removeToolbarSearch(frame.clock);
+ openbox.removeToolbarSearch(frame.psbutton);
+ openbox.removeToolbarSearch(frame.nsbutton);
+ openbox.removeToolbarSearch(frame.pwbutton);
+ openbox.removeToolbarSearch(frame.nwbutton);
XDestroyWindow(display, frame.workspace_label);
XDestroyWindow(display, frame.window_label);
void Toolbar::reconfigure(void) {
- frame.bevel_w = screen->getBevelWidth();
- frame.width = screen->getWidth() * screen->getToolbarWidthPercent() / 100;
+ frame.bevel_w = screen.getBevelWidth();
+ frame.width = screen.getWidth() * screen.getToolbarWidthPercent() / 100;
if (i18n->multibyte())
frame.height =
- screen->getToolbarStyle()->fontset_extents->max_ink_extent.height;
+ screen.getToolbarStyle()->fontset_extents->max_ink_extent.height;
else
- frame.height = screen->getToolbarStyle()->font->ascent +
- screen->getToolbarStyle()->font->descent;
+ frame.height = screen.getToolbarStyle()->font->ascent +
+ screen.getToolbarStyle()->font->descent;
frame.button_w = frame.height;
frame.height += 2;
frame.label_h = frame.height;
frame.height += (frame.bevel_w * 2);
- switch (screen->getToolbarPlacement()) {
+ switch (screen.getToolbarPlacement()) {
case TopLeft:
frame.x = 0;
frame.y = 0;
frame.x_hidden = 0;
- frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth()
+ frame.y_hidden = screen.getBevelWidth() - screen.getBorderWidth()
- frame.height;
break;
case BottomLeft:
frame.x = 0;
- frame.y = screen->getHeight() - frame.height
- - (screen->getBorderWidth() * 2);
+ frame.y = screen.getHeight() - frame.height
+ - (screen.getBorderWidth() * 2);
frame.x_hidden = 0;
- frame.y_hidden = screen->getHeight() - screen->getBevelWidth()
- - screen->getBorderWidth();
+ frame.y_hidden = screen.getHeight() - screen.getBevelWidth()
+ - screen.getBorderWidth();
break;
case TopCenter:
- frame.x = (screen->getWidth() - frame.width) / 2;
+ frame.x = (screen.getWidth() - frame.width) / 2;
frame.y = 0;
frame.x_hidden = frame.x;
- frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth()
+ frame.y_hidden = screen.getBevelWidth() - screen.getBorderWidth()
- frame.height;
break;
case BottomCenter:
default:
- frame.x = (screen->getWidth() - frame.width) / 2;
- frame.y = screen->getHeight() - frame.height
- - (screen->getBorderWidth() * 2);
+ frame.x = (screen.getWidth() - frame.width) / 2;
+ frame.y = screen.getHeight() - frame.height
+ - (screen.getBorderWidth() * 2);
frame.x_hidden = frame.x;
- frame.y_hidden = screen->getHeight() - screen->getBevelWidth()
- - screen->getBorderWidth();
+ frame.y_hidden = screen.getHeight() - screen.getBevelWidth()
+ - screen.getBorderWidth();
break;
case TopRight:
- frame.x = screen->getWidth() - frame.width
- - (screen->getBorderWidth() * 2);
+ frame.x = screen.getWidth() - frame.width
+ - (screen.getBorderWidth() * 2);
frame.y = 0;
frame.x_hidden = frame.x;
- frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth()
+ frame.y_hidden = screen.getBevelWidth() - screen.getBorderWidth()
- frame.height;
break;
case BottomRight:
- frame.x = screen->getWidth() - frame.width
- - (screen->getBorderWidth() * 2);
- frame.y = screen->getHeight() - frame.height
- - (screen->getBorderWidth() * 2);
+ frame.x = screen.getWidth() - frame.width
+ - (screen.getBorderWidth() * 2);
+ frame.y = screen.getHeight() - frame.height
+ - (screen.getBorderWidth() * 2);
frame.x_hidden = frame.x;
- frame.y_hidden = screen->getHeight() - screen->getBevelWidth()
- - screen->getBorderWidth();
+ frame.y_hidden = screen.getHeight() - screen.getBevelWidth()
+ - screen.getBorderWidth();
break;
}
tt = localtime(&ttmp);
if (tt) {
char t[1025], *time_string = (char *) 0;
- int len = strftime(t, 1024, screen->getStrftimeFormat(), tt);
+ int len = strftime(t, 1024, screen.getStrftimeFormat(), tt);
t[len++-1] = ' '; // add a space to the string for padding
t[len] = '\0';
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getToolbarStyle()->fontset, t, len, &ink,
+ XmbTextExtents(screen.getToolbarStyle()->fontset, t, len, &ink,
&logical);
frame.clock_w = logical.width;
// ben's additional solution to pad some space beside the numbers
//frame.clock_w +=
- // screen->getToolbarStyle()->fontset_extents->max_logical_extent.width *
+ // screen.getToolbarStyle()->fontset_extents->max_logical_extent.width *
// 4;
// brad's solution, which is currently buggy, too big
//frame.clock_w =
- // screen->getToolbarStyle()->fontset_extents->max_logical_extent.width
+ // screen.getToolbarStyle()->fontset_extents->max_logical_extent.width
// * len;
} else {
- frame.clock_w = XTextWidth(screen->getToolbarStyle()->font, t, len);
+ frame.clock_w = XTextWidth(screen.getToolbarStyle()->font, t, len);
// ben's additional solution to pad some space beside the numbers
- //frame.clock_w += screen->getToolbarStyle()->font->max_bounds.width * 4;
+ //frame.clock_w += screen.getToolbarStyle()->font->max_bounds.width * 4;
// brad's solution again, too big
- //frame.clock_w = screen->getToolbarStyle()->font->max_bounds.width * len;
+ //frame.clock_w = screen.getToolbarStyle()->font->max_bounds.width * len;
}
frame.clock_w += (frame.bevel_w * 4);
}
#else // !HAVE_STRFTIME
frame.clock_w =
- XTextWidth(screen->getToolbarStyle()->font,
+ XTextWidth(screen.getToolbarStyle()->font,
i18n->getMessage(ToolbarSet, ToolbarNoStrftimeLength,
"00:00000"),
strlen(i18n->getMessage(ToolbarSet, ToolbarNoStrftimeLength,
unsigned int w = 0;
frame.workspace_label_w = 0;
- for (i = 0; i < screen->getWorkspaceCount(); i++) {
+ for (i = 0; i < screen.getWorkspaceCount(); i++) {
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getToolbarStyle()->fontset,
- screen->getWorkspace(i)->getName(),
- strlen(screen->getWorkspace(i)->getName()),
+ XmbTextExtents(screen.getToolbarStyle()->fontset,
+ screen.getWorkspace(i)->getName(),
+ strlen(screen.getWorkspace(i)->getName()),
&ink, &logical);
w = logical.width;
} else {
- w = XTextWidth(screen->getToolbarStyle()->font,
- screen->getWorkspace(i)->getName(),
- strlen(screen->getWorkspace(i)->getName()));
+ w = XTextWidth(screen.getToolbarStyle()->font,
+ screen.getWorkspace(i)->getName(),
+ strlen(screen.getWorkspace(i)->getName()));
}
w += (frame.bevel_w * 4);
frame.label_h);
Pixmap tmp = frame.base;
- BTexture *texture = &(screen->getToolbarStyle()->toolbar);
+ BTexture *texture = &(screen.getToolbarStyle()->toolbar);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
frame.base = None;
XSetWindowBackground(display, frame.window,
if (tmp) image_ctrl->removeImage(tmp);
tmp = frame.label;
- texture = &(screen->getToolbarStyle()->window);
+ texture = &(screen.getToolbarStyle()->window);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
frame.label = None;
XSetWindowBackground(display, frame.window_label,
if (tmp) image_ctrl->removeImage(tmp);
tmp = frame.wlabel;
- texture = &(screen->getToolbarStyle()->label);
+ texture = &(screen.getToolbarStyle()->label);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
frame.wlabel = None;
XSetWindowBackground(display, frame.workspace_label,
if (tmp) image_ctrl->removeImage(tmp);
tmp = frame.clk;
- texture = &(screen->getToolbarStyle()->clock);
+ texture = &(screen.getToolbarStyle()->clock);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
frame.clk = None;
XSetWindowBackground(display, frame.clock,
if (tmp) image_ctrl->removeImage(tmp);
tmp = frame.button;
- texture = &(screen->getToolbarStyle()->button);
+ texture = &(screen.getToolbarStyle()->button);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
frame.button = None;
if (tmp) image_ctrl->removeImage(tmp);
tmp = frame.pbutton;
- texture = &(screen->getToolbarStyle()->pressed);
+ texture = &(screen.getToolbarStyle()->pressed);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
frame.pbutton = None;
frame.pbutton_pixel = texture->getColor()->getPixel();
if (tmp) image_ctrl->removeImage(tmp);
XSetWindowBorder(display, frame.window,
- screen->getBorderColor()->getPixel());
- XSetWindowBorderWidth(display, frame.window, screen->getBorderWidth());
+ screen.getBorderColor()->getPixel());
+ XSetWindowBorderWidth(display, frame.window, screen.getBorderWidth());
XClearWindow(display, frame.window);
XClearWindow(display, frame.workspace_label);
if (redraw) {
#ifdef HAVE_STRFTIME
char t[1024];
- if (! strftime(t, 1024, screen->getStrftimeFormat(), tt))
+ if (! strftime(t, 1024, screen.getStrftimeFormat(), tt))
return;
#else // !HAVE_STRFTIME
char t[9];
if (date) {
// format the date... with special consideration for y2k ;)
- if (screen->getDateFormat() == Openbox::B_EuropeanDate)
+ if (screen.getDateFormat() == Openbox::B_EuropeanDate)
sprintf(t, 18n->getMessage(ToolbarSet, ToolbarNoStrftimeDateFormatEu,
"%02d.%02d.%02d"),
tt->tm_mday, tt->tm_mon + 1,
tt->tm_mon + 1, tt->tm_mday,
(tt->tm_year >= 100) ? tt->tm_year - 100 : tt->tm_year);
} else {
- if (screen->isClock24Hour())
+ if (screen.isClock24Hour())
sprintf(t, i18n->getMessage(ToolbarSet, ToolbarNoStrftimeTimeFormat24,
" %02d:%02d "),
frame.hour, frame.minute);
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getToolbarStyle()->fontset,
+ XmbTextExtents(screen.getToolbarStyle()->fontset,
t, dlen, &ink, &logical);
l = logical.width;
} else {
- l = XTextWidth(screen->getToolbarStyle()->font, t, dlen);
+ l = XTextWidth(screen.getToolbarStyle()->font, t, dlen);
}
l += (frame.bevel_w * 4);
for (; dlen >= 0; dlen--) {
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getToolbarStyle()->fontset,
+ XmbTextExtents(screen.getToolbarStyle()->fontset,
t, dlen, &ink, &logical);
l = logical.width;
} else {
- l = XTextWidth(screen->getToolbarStyle()->font, t, dlen);
+ l = XTextWidth(screen.getToolbarStyle()->font, t, dlen);
}
l+= (frame.bevel_w * 4);
break;
}
}
- switch (screen->getToolbarStyle()->justify) {
+ switch (screen.getToolbarStyle()->justify) {
case BScreen::RightJustify:
dx += frame.clock_w - l;
break;
break;
}
- ToolbarStyle *style = screen->getToolbarStyle();
+ ToolbarStyle *style = screen.getToolbarStyle();
if (i18n->multibyte())
XmbDrawString(display, frame.clock, style->fontset, style->c_text_gc,
dx, (1 - style->fontset_extents->max_ink_extent.y),
void Toolbar::redrawWindowLabel(Bool redraw) {
- if (screen->getOpenbox()->getFocusedWindow()) {
+ if (screen.getOpenbox().getFocusedWindow()) {
if (redraw)
XClearWindow(display, frame.window_label);
- OpenboxWindow *foc = screen->getOpenbox()->getFocusedWindow();
- if (foc->getScreen() != screen) return;
+ OpenboxWindow *foc = screen.getOpenbox().getFocusedWindow();
+ if (foc->getScreen() != &screen) return;
int dx = (frame.bevel_w * 2), dlen = strlen(*foc->getTitle());
unsigned int l;
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getToolbarStyle()->fontset, *foc->getTitle(),
+ XmbTextExtents(screen.getToolbarStyle()->fontset, *foc->getTitle(),
dlen, &ink, &logical);
l = logical.width;
} else {
- l = XTextWidth(screen->getToolbarStyle()->font, *foc->getTitle(), dlen);
+ l = XTextWidth(screen.getToolbarStyle()->font, *foc->getTitle(), dlen);
}
l += (frame.bevel_w * 4);
for (; dlen >= 0; dlen--) {
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getToolbarStyle()->fontset,
+ XmbTextExtents(screen.getToolbarStyle()->fontset,
*foc->getTitle(), dlen, &ink, &logical);
l = logical.width;
} else {
- l = XTextWidth(screen->getToolbarStyle()->font,
+ l = XTextWidth(screen.getToolbarStyle()->font,
*foc->getTitle(), dlen);
}
l += (frame.bevel_w * 4);
break;
}
}
- switch (screen->getToolbarStyle()->justify) {
+ switch (screen.getToolbarStyle()->justify) {
case BScreen::RightJustify:
dx += frame.window_label_w - l;
break;
break;
}
- ToolbarStyle *style = screen->getToolbarStyle();
+ ToolbarStyle *style = screen.getToolbarStyle();
if (i18n->multibyte())
XmbDrawString(display, frame.window_label, style->fontset,
style->w_text_gc, dx,
void Toolbar::redrawWorkspaceLabel(Bool redraw) {
- if (screen->getCurrentWorkspace()->getName()) {
+ if (screen.getCurrentWorkspace()->getName()) {
if (redraw)
XClearWindow(display, frame.workspace_label);
int dx = (frame.bevel_w * 2), dlen =
- strlen(screen->getCurrentWorkspace()->getName());
+ strlen(screen.getCurrentWorkspace()->getName());
unsigned int l;
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getToolbarStyle()->fontset,
- screen->getCurrentWorkspace()->getName(), dlen,
+ XmbTextExtents(screen.getToolbarStyle()->fontset,
+ screen.getCurrentWorkspace()->getName(), dlen,
&ink, &logical);
l = logical.width;
} else {
- l = XTextWidth(screen->getToolbarStyle()->font,
- screen->getCurrentWorkspace()->getName(), dlen);
+ l = XTextWidth(screen.getToolbarStyle()->font,
+ screen.getCurrentWorkspace()->getName(), dlen);
}
l += (frame.bevel_w * 4);
for (; dlen >= 0; dlen--) {
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getToolbarStyle()->fontset,
- screen->getCurrentWorkspace()->getName(), dlen,
+ XmbTextExtents(screen.getToolbarStyle()->fontset,
+ screen.getCurrentWorkspace()->getName(), dlen,
&ink, &logical);
l = logical.width;
} else {
- l = XTextWidth(screen->getWindowStyle()->font,
- screen->getCurrentWorkspace()->getName(), dlen);
+ l = XTextWidth(screen.getWindowStyle()->font,
+ screen.getCurrentWorkspace()->getName(), dlen);
}
l += (frame.bevel_w * 4);
break;
}
}
- switch (screen->getToolbarStyle()->justify) {
+ switch (screen.getToolbarStyle()->justify) {
case BScreen::RightJustify:
dx += frame.workspace_label_w - l;
break;
break;
}
- ToolbarStyle *style = screen->getToolbarStyle();
+ ToolbarStyle *style = screen.getToolbarStyle();
if (i18n->multibyte())
XmbDrawString(display, frame.workspace_label, style->fontset,
style->l_text_gc, dx,
(1 - style->fontset_extents->max_ink_extent.y),
- (char *) screen->getCurrentWorkspace()->getName(), dlen);
+ (char *) screen.getCurrentWorkspace()->getName(), dlen);
else
XDrawString(display, frame.workspace_label, style->l_text_gc, dx,
(style->font->ascent + 1),
- (char *) screen->getCurrentWorkspace()->getName(), dlen);
+ (char *) screen.getCurrentWorkspace()->getName(), dlen);
}
}
pts[1].x = 4; pts[1].y = 2;
pts[2].x = 0; pts[2].y = -4;
- XFillPolygon(display, frame.psbutton, screen->getToolbarStyle()->b_pic_gc,
+ XFillPolygon(display, frame.psbutton, screen.getToolbarStyle()->b_pic_gc,
pts, 3, Convex, CoordModePrevious);
}
pts[1].x = 4; pts[1].y = 2;
pts[2].x = -4; pts[2].y = 2;
- XFillPolygon(display, frame.nsbutton, screen->getToolbarStyle()->b_pic_gc,
+ XFillPolygon(display, frame.nsbutton, screen.getToolbarStyle()->b_pic_gc,
pts, 3, Convex, CoordModePrevious);
}
pts[1].x = 4; pts[1].y = 2;
pts[2].x = 0; pts[2].y = -4;
- XFillPolygon(display, frame.pwbutton, screen->getToolbarStyle()->b_pic_gc,
+ XFillPolygon(display, frame.pwbutton, screen.getToolbarStyle()->b_pic_gc,
pts, 3, Convex, CoordModePrevious);
}
pts[1].x = 4; pts[1].y = 2;
pts[2].x = -4; pts[2].y = 2;
- XFillPolygon(display, frame.nwbutton, screen->getToolbarStyle()->b_pic_gc,
+ XFillPolygon(display, frame.nwbutton, screen.getToolbarStyle()->b_pic_gc,
pts, 3, Convex, CoordModePrevious);
}
return;
XSetInputFocus(display, frame.workspace_label,
- ((screen->isSloppyFocus()) ? RevertToPointerRoot :
+ ((screen.isSloppyFocus()) ? RevertToPointerRoot :
RevertToParent),
CurrentTime);
XClearWindow(display, frame.workspace_label);
- openbox->setNoFocus(True);
- if (openbox->getFocusedWindow())
- openbox->getFocusedWindow()->setFocusFlag(False);
+ openbox.setNoFocus(True);
+ if (openbox.getFocusedWindow())
+ openbox.getFocusedWindow()->setFocusFlag(False);
XDrawRectangle(display, frame.workspace_label,
- screen->getWindowStyle()->l_text_focus_gc,
+ screen.getWindowStyle()->l_text_focus_gc,
frame.workspace_label_w / 2, 0, 1,
frame.label_h - 1);
// change the background of the window to that of an active window label
Pixmap tmp = frame.wlabel;
- BTexture *texture = &(screen->getWindowStyle()->l_focus);
+ BTexture *texture = &(screen.getWindowStyle()->l_focus);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
frame.wlabel = None;
XSetWindowBackground(display, frame.workspace_label,
#endif // HAVE_STRFTIME
else if (! on_top) {
Window w[1] = { frame.window };
- screen->raiseWindows(w, 1);
+ screen.raiseWindows(w, 1);
}
} else if (be->button == 2 && (! on_top)) {
XLowerWindow(display, frame.window);
if (x < 0)
x = 0;
- else if (x + toolbarmenu->getWidth() > screen->getWidth())
- x = screen->getWidth() - toolbarmenu->getWidth();
+ else if (x + toolbarmenu->getWidth() > screen.getWidth())
+ x = screen.getWidth() - toolbarmenu->getWidth();
if (y < 0)
y = 0;
- else if (y + toolbarmenu->getHeight() > screen->getHeight())
- y = screen->getHeight() - toolbarmenu->getHeight();
+ else if (y + toolbarmenu->getHeight() > screen.getHeight())
+ y = screen.getHeight() - toolbarmenu->getHeight();
toolbarmenu->move(x, y);
toolbarmenu->show();
if (re->x >= 0 && re->x < (signed) frame.button_w &&
re->y >= 0 && re->y < (signed) frame.button_w)
- if (screen->getCurrentWorkspace()->getWorkspaceID() > 0)
- screen->changeWorkspaceID(screen->getCurrentWorkspace()->
+ if (screen.getCurrentWorkspace()->getWorkspaceID() > 0)
+ screen.changeWorkspaceID(screen.getCurrentWorkspace()->
getWorkspaceID() - 1);
else
- screen->changeWorkspaceID(screen->getWorkspaceCount() - 1);
+ screen.changeWorkspaceID(screen.getWorkspaceCount() - 1);
} else if (re->window == frame.nsbutton) {
redrawNextWorkspaceButton(False, True);
if (re->x >= 0 && re->x < (signed) frame.button_w &&
re->y >= 0 && re->y < (signed) frame.button_w)
- if (screen->getCurrentWorkspace()->getWorkspaceID() <
- screen->getWorkspaceCount() - 1)
- screen->changeWorkspaceID(screen->getCurrentWorkspace()->
+ if (screen.getCurrentWorkspace()->getWorkspaceID() <
+ screen.getWorkspaceCount() - 1)
+ screen.changeWorkspaceID(screen.getCurrentWorkspace()->
getWorkspaceID() + 1);
else
- screen->changeWorkspaceID(0);
+ screen.changeWorkspaceID(0);
} else if (re->window == frame.pwbutton) {
redrawPrevWindowButton(False, True);
if (re->x >= 0 && re->x < (signed) frame.button_w &&
re->y >= 0 && re->y < (signed) frame.button_w)
- screen->prevFocus();
+ screen.prevFocus();
} else if (re->window == frame.nwbutton) {
redrawNextWindowButton(False, True);
if (re->x >= 0 && re->x < (signed) frame.button_w &&
re->y >= 0 && re->y < (signed) frame.button_w)
- screen->nextFocus();
+ screen.nextFocus();
} else if (re->window == frame.window_label)
- screen->raiseFocus();
+ screen.raiseFocus();
#ifndef HAVE_STRFTIME
else if (re->window == frame.clock) {
XClearWindow(display, frame.clock);
void Toolbar::keyPressEvent(XKeyEvent *ke) {
if (ke->window == frame.workspace_label && editing) {
- openbox->grab();
+ openbox.grab();
if (! new_workspace_name) {
new_workspace_name = new char[128];
editing = False;
- openbox->setNoFocus(False);
- if (openbox->getFocusedWindow()) {
- openbox->getFocusedWindow()->setInputFocus();
- openbox->getFocusedWindow()->setFocusFlag(True);
+ openbox.setNoFocus(False);
+ if (openbox.getFocusedWindow()) {
+ openbox.getFocusedWindow()->setInputFocus();
+ openbox.getFocusedWindow()->setFocusFlag(True);
} else {
XSetInputFocus(display, PointerRoot, None, CurrentTime);
}
// workspace name which causes serious problems, especially for the
// Openbox::LoadRC() method.
if (*new_workspace_name) {
- screen->getCurrentWorkspace()->setName(new_workspace_name);
- screen->getCurrentWorkspace()->getMenu()->hide();
- screen->getWorkspacemenu()->
- remove(screen->getCurrentWorkspace()->getWorkspaceID() + 2);
- screen->getWorkspacemenu()->
- insert(screen->getCurrentWorkspace()->getName(),
- screen->getCurrentWorkspace()->getMenu(),
- screen->getCurrentWorkspace()->getWorkspaceID() + 2);
- screen->getWorkspacemenu()->update();
+ screen.getCurrentWorkspace()->setName(new_workspace_name);
+ screen.getCurrentWorkspace()->getMenu()->hide();
+ screen.getWorkspacemenu()->
+ remove(screen.getCurrentWorkspace()->getWorkspaceID() + 2);
+ screen.getWorkspacemenu()->
+ insert(screen.getCurrentWorkspace()->getName(),
+ screen.getCurrentWorkspace()->getMenu(),
+ screen.getCurrentWorkspace()->getWorkspaceID() + 2);
+ screen.getWorkspacemenu()->update();
}
delete [] new_workspace_name;
// reset the background to that of the workspace label (its normal
// setting)
Pixmap tmp = frame.wlabel;
- BTexture *texture = &(screen->getToolbarStyle()->label);
+ BTexture *texture = &(screen.getToolbarStyle()->label);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
frame.wlabel = None;
XSetWindowBackground(display, frame.workspace_label,
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getToolbarStyle()->fontset,
+ XmbTextExtents(screen.getToolbarStyle()->fontset,
new_workspace_name, l, &ink, &logical);
tw = logical.width;
} else {
- tw = XTextWidth(screen->getToolbarStyle()->font,
+ tw = XTextWidth(screen.getToolbarStyle()->font,
new_workspace_name, l);
}
x = (frame.workspace_label_w - tw) / 2;
if (x < (signed) frame.bevel_w) x = frame.bevel_w;
- WindowStyle *style = screen->getWindowStyle();
+ WindowStyle *style = screen.getWindowStyle();
if (i18n->multibyte())
XmbDrawString(display, frame.workspace_label, style->fontset,
style->l_text_focus_gc, x,
new_workspace_name, l);
XDrawRectangle(display, frame.workspace_label,
- screen->getWindowStyle()->l_text_focus_gc, x + tw, 0, 1,
+ screen.getWindowStyle()->l_text_focus_gc, x + tw, 0, 1,
frame.label_h - 1);
}
- openbox->ungrab();
+ openbox.ungrab();
}
}
}
-Toolbarmenu::Toolbarmenu(Toolbar &tb) : Basemenu(*tb.screen), toolbar(tb) {
+Toolbarmenu::Toolbarmenu(Toolbar &tb) : Basemenu(tb.screen), toolbar(tb) {
setLabel(i18n->getMessage(ToolbarSet, ToolbarToolbarTitle, "Toolbar"));
setInternalMenu();
toolbar.on_top = change;
setItemSelected(1, change);
- if (toolbar.isOnTop()) toolbar.screen->raiseWindows((Window *) 0, 0);
+ if (toolbar.isOnTop()) toolbar.screen.raiseWindows((Window *) 0, 0);
break;
}
setItemSelected(2, change);
#ifdef SLIT
- toolbar.screen->getSlit()->reposition();
+ toolbar.screen.getSlit()->reposition();
#endif // SLIT
break;
}
Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu &tm)
- : Basemenu(*tm.toolbar.screen), toolbarmenu(tm) {
+ : Basemenu(tm.toolbar.screen), toolbarmenu(tm) {
setLabel(i18n->getMessage(ToolbarSet, ToolbarToolbarPlacement,
"Toolbar Placement"));
setInternalMenu();
BasemenuItem *item = find(index);
if (! item) return;
- toolbarmenu.toolbar.screen->saveToolbarPlacement(item->function());
+ toolbarmenu.toolbar.screen.saveToolbarPlacement(item->function());
hide();
toolbarmenu.toolbar.reconfigure();
#ifdef SLIT
// reposition the slit as well to make sure it doesn't intersect the
// toolbar
- toolbarmenu.toolbar.screen->getSlit()->reposition();
+ toolbarmenu.toolbar.screen.getSlit()->reposition();
#endif // SLIT
}
virtual void timeout(void);
} hide_handler;
- Openbox *openbox;
+ Openbox &openbox;
BImageControl *image_ctrl;
- BScreen *screen;
+ BScreen &screen;
BTimer *clock_timer, *hide_timer;
Toolbarmenu *toolbarmenu;
public:
- Toolbar(BScreen *);
+ Toolbar(BScreen &);
virtual ~Toolbar(void);
inline Toolbarmenu *getMenu(void) { return toolbarmenu; }
else if (proto[i] == openbox->getWMTakeFocusAtom())
flags.send_focus_message = True;
else if (proto[i] == openbox->getOpenboxStructureMessagesAtom())
- screen->addNetizen(new Netizen(screen, client.window));
+ screen->addNetizen(new Netizen(*screen, client.window));
}
XFree(proto);
break;
case BScreen::WindowKill:
- XKillClient(screen.getBaseDisplay()->getXDisplay(),
+ XKillClient(screen.getBaseDisplay().getXDisplay(),
window.getClientWindow());
break;
}
w->getTransientFor()->isVisible()) {
w->getTransientFor()->setInputFocus();
} else if (screen->isSloppyFocus()) {
- screen->getOpenbox()->setFocusedWindow((OpenboxWindow *) 0);
+ screen->getOpenbox().setFocusedWindow((OpenboxWindow *) 0);
} else {
OpenboxWindow *top = stackingList->first();
if (! top || ! top->setInputFocus()) {
- screen->getOpenbox()->setFocusedWindow((OpenboxWindow *) 0);
- XSetInputFocus(screen->getOpenbox()->getXDisplay(),
+ screen->getOpenbox().setFocusedWindow((OpenboxWindow *) 0);
+ XSetInputFocus(screen->getOpenbox().getXDisplay(),
screen->getToolbar()->getWindowID(),
RevertToParent, CurrentTime);
}
win = win->getTransientFor();
}
- screen->getOpenbox()->grab();
+ screen->getOpenbox().grab();
- XLowerWindow(screen->getBaseDisplay()->getXDisplay(), *nstack);
- XRestackWindows(screen->getBaseDisplay()->getXDisplay(), nstack, i);
+ XLowerWindow(screen->getBaseDisplay().getXDisplay(), *nstack);
+ XRestackWindows(screen->getBaseDisplay().getXDisplay(), nstack, i);
- screen->getOpenbox()->ungrab();
+ screen->getOpenbox().ungrab();
delete [] nstack;
}
screenList = new LinkedList<BScreen>;
for (int i = 0; i < getNumberOfScreens(); i++) {
- BScreen *screen = new BScreen(this, i);
+ BScreen *screen = new BScreen(*this, i);
if (! screen->isScreenManaged()) {
delete screen;