static Basemenu *shown = (Basemenu *) 0;
-Basemenu::Basemenu(BScreen *scrn) {
- screen = scrn;
- openbox = screen->getOpenbox();
- image_ctrl = screen->getImageControl();
- display = openbox->getXDisplay();
+Basemenu::Basemenu(BScreen &scrn) : screen(scrn), openbox(*scrn.getOpenbox()) {
+ image_ctrl = screen.getImageControl();
+ display = openbox.getXDisplay();
parent = (Basemenu *) 0;
alignment = AlignDontCare;
menu.hilite_pixmap =
menu.sel_pixmap = None;
- menu.bevel_w = screen->getBevelWidth();
+ menu.bevel_w = screen.getBevelWidth();
if (i18n->multibyte())
menu.width = menu.title_h = menu.item_w = menu.frame_h =
- screen->getMenuStyle()->t_fontset_extents->max_ink_extent.height +
+ screen.getMenuStyle()->t_fontset_extents->max_ink_extent.height +
(menu.bevel_w * 2);
else
menu.width = menu.title_h = menu.item_w = menu.frame_h =
- screen->getMenuStyle()->t_font->ascent +
- screen->getMenuStyle()->t_font->descent + (menu.bevel_w * 2);
+ screen.getMenuStyle()->t_font->ascent +
+ screen.getMenuStyle()->t_font->descent + (menu.bevel_w * 2);
menu.label = 0;
menu.persub =
menu.minsub = 0;
- MenuStyle *style = screen->getMenuStyle();
+ MenuStyle *style = screen.getMenuStyle();
if (i18n->multibyte()) {
menu.item_h = style->f_fontset_extents->max_ink_extent.height +
(menu.bevel_w);
(menu.bevel_w);
}
- menu.height = menu.title_h + screen->getBorderWidth() + menu.frame_h;
+ menu.height = menu.title_h + screen.getBorderWidth() + menu.frame_h;
unsigned long attrib_mask = CWBackPixmap | CWBackPixel | CWBorderPixel |
CWColormap | CWOverrideRedirect | CWEventMask;
XSetWindowAttributes attrib;
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 |
ButtonMotionMask | ExposureMask;
menu.window =
- XCreateWindow(display, screen->getRootWindow(), menu.x, menu.y, menu.width,
- menu.height, screen->getBorderWidth(), screen->getDepth(),
- InputOutput, screen->getVisual(), attrib_mask, &attrib);
- openbox->saveMenuSearch(menu.window, this);
+ XCreateWindow(display, screen.getRootWindow(), menu.x, menu.y, menu.width,
+ menu.height, screen.getBorderWidth(), screen.getDepth(),
+ InputOutput, screen.getVisual(), attrib_mask, &attrib);
+ openbox.saveMenuSearch(menu.window, this);
attrib_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | CWEventMask;
- attrib.background_pixel = screen->getBorderColor()->getPixel();
+ attrib.background_pixel = screen.getBorderColor()->getPixel();
attrib.event_mask |= EnterWindowMask | LeaveWindowMask;
menu.title =
XCreateWindow(display, menu.window, 0, 0, menu.width, menu.height, 0,
- screen->getDepth(), InputOutput, screen->getVisual(),
+ screen.getDepth(), InputOutput, screen.getVisual(),
attrib_mask, &attrib);
- openbox->saveMenuSearch(menu.title, this);
+ openbox.saveMenuSearch(menu.title, this);
attrib.event_mask |= PointerMotionMask;
menu.frame = XCreateWindow(display, menu.window, 0,
- menu.title_h + screen->getBorderWidth(),
+ menu.title_h + screen.getBorderWidth(),
menu.width, menu.frame_h, 0,
- screen->getDepth(), InputOutput,
- screen->getVisual(), attrib_mask, &attrib);
- openbox->saveMenuSearch(menu.frame, this);
+ screen.getDepth(), InputOutput,
+ screen.getVisual(), attrib_mask, &attrib);
+ openbox.saveMenuSearch(menu.frame, this);
menuitems = new LinkedList<BasemenuItem>;
if (menu.sel_pixmap)
image_ctrl->removeImage(menu.sel_pixmap);
- openbox->removeMenuSearch(menu.title);
+ openbox.removeMenuSearch(menu.title);
XDestroyWindow(display, menu.title);
- openbox->removeMenuSearch(menu.frame);
+ openbox.removeMenuSearch(menu.frame);
XDestroyWindow(display, menu.frame);
- openbox->removeMenuSearch(menu.window);
+ openbox.removeMenuSearch(menu.window);
XDestroyWindow(display, menu.window);
}
void Basemenu::update(void) {
- MenuStyle *style = screen->getMenuStyle();
+ MenuStyle *style = screen.getMenuStyle();
if (i18n->multibyte()) {
menu.item_h = style->f_fontset_extents->max_ink_extent.height +
menu.bevel_w;
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getMenuStyle()->t_fontset, s, l, &ink, &logical);
+ XmbTextExtents(screen.getMenuStyle()->t_fontset, s, l, &ink, &logical);
menu.item_w = logical.width;
} else {
- menu.item_w = XTextWidth(screen->getMenuStyle()->t_font, s, l);
+ menu.item_w = XTextWidth(screen.getMenuStyle()->t_font, s, l);
}
menu.item_w += (menu.bevel_w * 2);
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getMenuStyle()->f_fontset, s, l, &ink, &logical);
+ XmbTextExtents(screen.getMenuStyle()->f_fontset, s, l, &ink, &logical);
ii = logical.width;
} else
- ii = XTextWidth(screen->getMenuStyle()->f_font, s, l);
+ ii = XTextWidth(screen.getMenuStyle()->f_font, s, l);
ii += (menu.bevel_w * 2) + (menu.item_h * 2);
menu.sublevels = 1;
while (((menu.item_h * (menuitems->count() + 1) / menu.sublevels)
- + menu.title_h + screen->getBorderWidth()) >
- screen->getHeight())
+ + menu.title_h + screen.getBorderWidth()) >
+ screen.getHeight())
menu.sublevels++;
if (menu.sublevels < menu.minsub) menu.sublevels = menu.minsub;
if (! menu.width) menu.width = menu.item_w;
menu.frame_h = (menu.item_h * menu.persub);
- menu.height = ((title_vis) ? menu.title_h + screen->getBorderWidth() : 0) +
+ menu.height = ((title_vis) ? menu.title_h + screen.getBorderWidth() : 0) +
menu.frame_h;
if (! menu.frame_h) menu.frame_h = 1;
if (menu.height < 1) menu.height = 1;
BTexture *texture;
if (title_vis) {
tmp = menu.title_pixmap;
- texture = &(screen->getMenuStyle()->title);
+ texture = &(screen.getMenuStyle()->title);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
menu.title_pixmap = None;
XSetWindowBackground(display, menu.title,
}
tmp = menu.frame_pixmap;
- texture = &(screen->getMenuStyle()->frame);
+ texture = &(screen.getMenuStyle()->frame);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
menu.frame_pixmap = None;
XSetWindowBackground(display, menu.frame,
if (tmp) image_ctrl->removeImage(tmp);
tmp = menu.hilite_pixmap;
- texture = &(screen->getMenuStyle()->hilite);
+ texture = &(screen.getMenuStyle()->hilite);
if (texture->getTexture() == (BImage_Flat | BImage_Solid)) {
menu.hilite_pixmap = None;
} else {
XMoveResizeWindow(display, menu.frame, 0,
((title_vis) ? menu.title_h +
- screen->getBorderWidth() : 0), menu.width,
+ screen.getBorderWidth() : 0), menu.width,
menu.frame_h);
XClearWindow(display, menu.window);
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getMenuStyle()->t_fontset, text, len, &ink, &logical);
+ XmbTextExtents(screen.getMenuStyle()->t_fontset, text, len, &ink, &logical);
l = logical.width;
} else {
- l = XTextWidth(screen->getMenuStyle()->t_font, text, len);
+ l = XTextWidth(screen.getMenuStyle()->t_font, text, len);
}
l += (menu.bevel_w * 2);
- switch (screen->getMenuStyle()->t_justify) {
+ switch (screen.getMenuStyle()->t_justify) {
case BScreen::RightJustify:
dx += menu.width - l;
break;
break;
}
- MenuStyle *style = screen->getMenuStyle();
+ MenuStyle *style = screen.getMenuStyle();
if (i18n->multibyte())
XmbDrawString(display, menu.title, style->t_fontset, style->t_text_gc, dx,
(menu.bevel_w - style->t_fontset_extents->max_ink_extent.y),
if (item->submenu()->parent != this) item->submenu()->parent = this;
int sbl = index / menu.persub, i = index - (sbl * menu.persub),
x = menu.x +
- ((menu.item_w * (sbl + 1)) + screen->getBorderWidth()), y;
+ ((menu.item_w * (sbl + 1)) + screen.getBorderWidth()), y;
if (alignment == AlignTop)
y = (((shifted) ? menu.y_shift : menu.y) +
- ((title_vis) ? menu.title_h + screen->getBorderWidth() : 0) -
+ ((title_vis) ? menu.title_h + screen.getBorderWidth() : 0) -
((item->submenu()->title_vis) ?
- item->submenu()->menu.title_h + screen->getBorderWidth() : 0));
+ item->submenu()->menu.title_h + screen.getBorderWidth() : 0));
else
y = (((shifted) ? menu.y_shift : menu.y) +
(menu.item_h * i) +
- ((title_vis) ? menu.title_h + screen->getBorderWidth() : 0) -
+ ((title_vis) ? menu.title_h + screen.getBorderWidth() : 0) -
((item->submenu()->title_vis) ?
- item->submenu()->menu.title_h + screen->getBorderWidth() : 0));
+ item->submenu()->menu.title_h + screen.getBorderWidth() : 0));
if (alignment == AlignBottom &&
(y + item->submenu()->menu.height) > ((shifted) ? menu.y_shift :
y = (((shifted) ? menu.y_shift : menu.y) +
menu.height - item->submenu()->menu.height);
- if ((x + item->submenu()->getWidth()) > screen->getWidth()) {
+ if ((x + item->submenu()->getWidth()) > screen.getWidth()) {
x = ((shifted) ? menu.x_shift : menu.x) -
- item->submenu()->getWidth() - screen->getBorderWidth();
+ item->submenu()->getWidth() - screen.getBorderWidth();
}
if (x < 0) x = 0;
- if ((y + item->submenu()->getHeight()) > screen->getHeight())
- y = screen->getHeight() - item->submenu()->getHeight() -
- (screen->getBorderWidth() * 2);
+ if ((y + item->submenu()->getHeight()) > screen.getHeight())
+ y = screen.getHeight() - item->submenu()->getHeight() -
+ (screen.getBorderWidth() * 2);
if (y < 0) y = 0;
item->submenu()->move(x, y);
if (text) {
if (i18n->multibyte()) {
XRectangle ink, logical;
- XmbTextExtents(screen->getMenuStyle()->f_fontset,
+ XmbTextExtents(screen.getMenuStyle()->f_fontset,
text, len, &ink, &logical);
text_w = logical.width;
text_y = item_y + (menu.bevel_w / 2) -
- screen->getMenuStyle()->f_fontset_extents->max_ink_extent.y;
+ screen.getMenuStyle()->f_fontset_extents->max_ink_extent.y;
} else {
- text_w = XTextWidth(screen->getMenuStyle()->f_font, text, len);
+ text_w = XTextWidth(screen.getMenuStyle()->f_font, text, len);
text_y = item_y +
- screen->getMenuStyle()->f_font->ascent +
+ screen.getMenuStyle()->f_font->ascent +
(menu.bevel_w / 2);
}
- switch(screen->getMenuStyle()->f_justify) {
+ switch(screen.getMenuStyle()->f_justify) {
case BScreen::LeftJustify:
text_x = item_x + menu.bevel_w + menu.item_h + 1;
break;
}
GC gc =
- ((highlight || item->isSelected()) ? screen->getMenuStyle()->h_text_gc :
- screen->getMenuStyle()->f_text_gc),
+ ((highlight || item->isSelected()) ? screen.getMenuStyle()->h_text_gc :
+ screen.getMenuStyle()->f_text_gc),
tgc =
- ((highlight) ? screen->getMenuStyle()->h_text_gc :
- ((item->isEnabled()) ? screen->getMenuStyle()->f_text_gc :
- screen->getMenuStyle()->d_text_gc));
+ ((highlight) ? screen.getMenuStyle()->h_text_gc :
+ ((item->isEnabled()) ? screen.getMenuStyle()->f_text_gc :
+ screen.getMenuStyle()->d_text_gc));
sel_x = item_x;
- if (screen->getMenuStyle()->bullet_pos == Right)
+ if (screen.getMenuStyle()->bullet_pos == Right)
sel_x += (menu.item_w - menu.item_h - menu.bevel_w);
sel_x += quarter_w;
sel_y = item_y + quarter_w;
if (dohilite && highlight && (menu.hilite_pixmap != ParentRelative)) {
if (menu.hilite_pixmap)
XCopyArea(display, menu.hilite_pixmap, menu.frame,
- screen->getMenuStyle()->hilite_gc, hoff_x, hoff_y,
+ screen.getMenuStyle()->hilite_gc, hoff_x, hoff_y,
hilite_w, hilite_h, hilite_x, hilite_y);
else
XFillRectangle(display, menu.frame,
- screen->getMenuStyle()->hilite_gc,
+ screen.getMenuStyle()->hilite_gc,
hilite_x, hilite_y, hilite_w, hilite_h);
} else if (dosel && item->isSelected() &&
(menu.sel_pixmap != ParentRelative)) {
if (menu.sel_pixmap)
XCopyArea(display, menu.sel_pixmap, menu.frame,
- screen->getMenuStyle()->hilite_gc, 0, 0,
+ screen.getMenuStyle()->hilite_gc, 0, 0,
half_w, half_w, sel_x, sel_y);
else
XFillRectangle(display, menu.frame,
- screen->getMenuStyle()->hilite_gc,
+ screen.getMenuStyle()->hilite_gc,
sel_x, sel_y, half_w, half_w);
}
if (dotext && text) {
if (i18n->multibyte())
- XmbDrawString(display, menu.frame, screen->getMenuStyle()->f_fontset,
+ XmbDrawString(display, menu.frame, screen.getMenuStyle()->f_fontset,
tgc, text_x, text_y, text, len);
else
XDrawString(display, menu.frame, tgc, text_x, text_y, text, len);
}
if (dosel && item->submenu()) {
- switch (screen->getMenuStyle()->bullet) {
+ switch (screen.getMenuStyle()->bullet) {
case Square:
XDrawRectangle(display, menu.frame, gc, sel_x, sel_y, half_w, half_w);
break;
case Triangle:
XPoint tri[3];
- if (screen->getMenuStyle()->bullet_pos == Right) {
+ if (screen.getMenuStyle()->bullet_pos == Right) {
tri[0].x = sel_x + quarter_w - 2;
tri[0].y = sel_y + quarter_w - 2;
tri[1].x = 4;
void Basemenu::enterNotifyEvent(XCrossingEvent *ce) {
if (ce->window == menu.frame) {
menu.x_shift = menu.x, menu.y_shift = menu.y;
- if (menu.x + menu.width > screen->getWidth()) {
- menu.x_shift = screen->getWidth() - menu.width -
- screen->getBorderWidth();
+ if (menu.x + menu.width > screen.getWidth()) {
+ menu.x_shift = screen.getWidth() - menu.width -
+ screen.getBorderWidth();
shifted = True;
} else if (menu.x < 0) {
- menu.x_shift = -screen->getBorderWidth();
+ menu.x_shift = -screen.getBorderWidth();
shifted = True;
}
- if (menu.y + menu.height > screen->getHeight()) {
- menu.y_shift = screen->getHeight() - menu.height -
- screen->getBorderWidth();
+ if (menu.y + menu.height > screen.getHeight()) {
+ menu.y_shift = screen.getHeight() - menu.height -
+ screen.getBorderWidth();
shifted = True;
} else if (menu.y + (signed) menu.title_h < 0) {
- menu.y_shift = -screen->getBorderWidth();
+ menu.y_shift = -screen.getBorderWidth();
shifted = True;
}
void Basemenu::reconfigure(void) {
XSetWindowBackground(display, menu.window,
- screen->getBorderColor()->getPixel());
+ screen.getBorderColor()->getPixel());
XSetWindowBorder(display, menu.window,
- screen->getBorderColor()->getPixel());
- XSetWindowBorderWidth(display, menu.window, screen->getBorderWidth());
+ screen.getBorderColor()->getPixel());
+ XSetWindowBorderWidth(display, menu.window, screen.getBorderWidth());
- menu.bevel_w = screen->getBevelWidth();
+ menu.bevel_w = screen.getBevelWidth();
update();
}
class Basemenu {
private:
LinkedList<BasemenuItem> *menuitems;
- Openbox *openbox;
+ Openbox &openbox;
Basemenu *parent;
BImageControl *image_ctrl;
- BScreen *screen;
+ BScreen &screen;
Bool moving, visible, movable, torn, internal_menu, title_vis, shifted,
hide_tree;
public:
- Basemenu(BScreen *);
+ Basemenu(BScreen &);
virtual ~Basemenu(void);
inline const Bool &isTorn(void) const { return torn; }
inline const Bool &isVisible(void) const { return visible; }
- inline BScreen *getScreen(void) { return screen; }
+ inline BScreen &getScreen(void) { return screen; }
inline const Window &getWindowID(void) const { return menu.window; }
#include "Workspacemenu.h"
-Clientmenu::Clientmenu(Workspace *ws) : Basemenu(ws->getScreen()) {
- wkspc = ws;
- screen = wkspc->getScreen();
-
+Clientmenu::Clientmenu(Workspace &ws) : Basemenu(*ws.getScreen()),
+ screen(*ws.getScreen()), wkspc(ws)
+{
setInternalMenu();
}
void Clientmenu::itemSelected(int button, int index) {
if (button > 2) return;
- OpenboxWindow *win = wkspc->getWindow(index);
+ OpenboxWindow *win = wkspc.getWindow(index);
if (win) {
if (button == 1) {
- if (! wkspc->isCurrent()) wkspc->setCurrent();
+ if (! wkspc.isCurrent()) wkspc.setCurrent();
} else if (button == 2) {
- if (! wkspc->isCurrent()) win->deiconify(True, False);
+ if (! wkspc.isCurrent()) win->deiconify(True, False);
}
- wkspc->raiseWindow(win);
+ wkspc.raiseWindow(win);
win->setInputFocus();
}
- if (! (screen->getWorkspacemenu()->isTorn() || isTorn())) hide();
+ if (! (screen.getWorkspacemenu()->isTorn() || isTorn())) hide();
}
class Clientmenu : public Basemenu {
private:
- BScreen *screen;
- Workspace *wkspc;
+ BScreen &screen;
+ Workspace &wkspc;
protected:
virtual void itemSelected(int, int);
public:
- Clientmenu(Workspace *);
+ Clientmenu(Workspace &);
};
#include "Window.h"
#include "Screen.h"
-Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) {
- screen = scr;
- openbox = screen->getOpenbox();
+Configmenu::Configmenu(BScreen &scr) : Basemenu(scr), screen(scr)
+{
setLabel(i18n->getMessage(ConfigmenuSet, ConfigmenuConfigOptions,
"Config options"));
setInternalMenu();
"Focus Last Window on Workspace"), 5);
update();
- setItemSelected(2, screen->getImageControl()->doDither());
- setItemSelected(3, screen->doOpaqueMove());
- setItemSelected(4, screen->doFullMax());
- setItemSelected(5, screen->doFocusNew());
- setItemSelected(6, screen->doFocusLast());
+ setItemSelected(2, screen.getImageControl()->doDither());
+ setItemSelected(3, screen.doOpaqueMove());
+ setItemSelected(4, screen.doFullMax());
+ setItemSelected(5, screen.doFocusNew());
+ setItemSelected(6, screen.doFocusLast());
}
Configmenu::~Configmenu(void) {
switch(item->function()) {
case 1: { // dither
- screen->getImageControl()->
- setDither((! screen->getImageControl()->doDither()));
+ screen.getImageControl()->
+ setDither((! screen.getImageControl()->doDither()));
- setItemSelected(index, screen->getImageControl()->doDither());
+ setItemSelected(index, screen.getImageControl()->doDither());
break;
}
case 2: { // opaque move
- screen->saveOpaqueMove((! screen->doOpaqueMove()));
+ screen.saveOpaqueMove((! screen.doOpaqueMove()));
- setItemSelected(index, screen->doOpaqueMove());
+ setItemSelected(index, screen.doOpaqueMove());
break;
}
case 3: { // full maximization
- screen->saveFullMax((! screen->doFullMax()));
+ screen.saveFullMax((! screen.doFullMax()));
- setItemSelected(index, screen->doFullMax());
+ setItemSelected(index, screen.doFullMax());
break;
}
case 4: { // focus new windows
- screen->saveFocusNew((! screen->doFocusNew()));
+ screen.saveFocusNew((! screen.doFocusNew()));
- setItemSelected(index, screen->doFocusNew());
+ setItemSelected(index, screen.doFocusNew());
break;
}
case 5: { // focus last window on workspace
- screen->saveFocusLast((! screen->doFocusLast()));
- setItemSelected(index, screen->doFocusLast());
+ screen.saveFocusLast((! screen.doFocusLast()));
+ setItemSelected(index, screen.doFocusLast());
break;
}
} // switch
"Auto Raise"), 3);
update();
- setItemSelected(0, (! configmenu->screen->isSloppyFocus()));
- setItemSelected(1, configmenu->screen->isSloppyFocus());
- setItemEnabled(2, configmenu->screen->isSloppyFocus());
- setItemSelected(2, configmenu->screen->doAutoRaise());
+ setItemSelected(0, (! configmenu->screen.isSloppyFocus()));
+ setItemSelected(1, configmenu->screen.isSloppyFocus());
+ setItemEnabled(2, configmenu->screen.isSloppyFocus());
+ setItemSelected(2, configmenu->screen.doAutoRaise());
}
void Configmenu::Focusmenu::itemSelected(int button, int index) {
switch (item->function()) {
case 1: // click to focus
- configmenu->screen->saveSloppyFocus(False);
- configmenu->screen->saveAutoRaise(False);
+ configmenu->screen.saveSloppyFocus(False);
+ configmenu->screen.saveAutoRaise(False);
- if (! configmenu->screen->getOpenbox()->getFocusedWindow())
- XSetInputFocus(configmenu->screen->getOpenbox()->getXDisplay(),
- configmenu->screen->getToolbar()->getWindowID(),
+ 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);
- configmenu->screen->reconfigure();
+ configmenu->screen.reconfigure();
break;
case 2: // sloppy focus
- configmenu->screen->saveSloppyFocus(True);
+ configmenu->screen.saveSloppyFocus(True);
- configmenu->screen->reconfigure();
+ configmenu->screen.reconfigure();
break;
case 3: // auto raise with sloppy focus
- Bool change = ((configmenu->screen->doAutoRaise()) ? False : True);
- configmenu->screen->saveAutoRaise(change);
+ Bool change = ((configmenu->screen.doAutoRaise()) ? False : True);
+ configmenu->screen.saveAutoRaise(change);
break;
}
- setItemSelected(0, (! configmenu->screen->isSloppyFocus()));
- setItemSelected(1, configmenu->screen->isSloppyFocus());
- setItemEnabled(2, configmenu->screen->isSloppyFocus());
- setItemSelected(2, configmenu->screen->doAutoRaise());
+ setItemSelected(0, (! configmenu->screen.isSloppyFocus()));
+ setItemSelected(1, configmenu->screen.isSloppyFocus());
+ setItemEnabled(2, configmenu->screen.isSloppyFocus());
+ setItemSelected(2, configmenu->screen.doAutoRaise());
}
Configmenu::Placementmenu::Placementmenu(Configmenu *cm) :
"Bottom to Top"), BScreen::BottomTop);
update();
- switch (configmenu->screen->getPlacementPolicy()) {
+ switch (configmenu->screen.getPlacementPolicy()) {
case BScreen::RowSmartPlacement:
setItemSelected(0, True);
break;
break;
}
- Bool rl = (configmenu->screen->getRowPlacementDirection() ==
+ Bool rl = (configmenu->screen.getRowPlacementDirection() ==
BScreen::LeftRight),
- tb = (configmenu->screen->getColPlacementDirection() ==
+ tb = (configmenu->screen.getColPlacementDirection() ==
BScreen::TopBottom);
setItemSelected(4, rl);
switch (item->function()) {
case BScreen::RowSmartPlacement:
- configmenu->screen->savePlacementPolicy(item->function());
+ configmenu->screen.savePlacementPolicy(item->function());
setItemSelected(0, True);
setItemSelected(1, False);
break;
case BScreen::ColSmartPlacement:
- configmenu->screen->savePlacementPolicy(item->function());
+ configmenu->screen.savePlacementPolicy(item->function());
setItemSelected(0, False);
setItemSelected(1, True);
break;
case BScreen::CascadePlacement:
- configmenu->screen->savePlacementPolicy(item->function());
+ configmenu->screen.savePlacementPolicy(item->function());
setItemSelected(0, False);
setItemSelected(1, False);
break;
case BScreen::BestFitPlacement:
- configmenu->screen->savePlacementPolicy(item->function());
+ configmenu->screen.savePlacementPolicy(item->function());
setItemSelected(0, False);
setItemSelected(1, False);
break;
case BScreen::LeftRight:
- configmenu->screen->saveRowPlacementDirection(BScreen::LeftRight);
+ configmenu->screen.saveRowPlacementDirection(BScreen::LeftRight);
setItemSelected(4, True);
setItemSelected(5, False);
break;
case BScreen::RightLeft:
- configmenu->screen->saveRowPlacementDirection(BScreen::RightLeft);
+ configmenu->screen.saveRowPlacementDirection(BScreen::RightLeft);
setItemSelected(4, False);
setItemSelected(5, True);
break;
case BScreen::TopBottom:
- configmenu->screen->saveColPlacementDirection(BScreen::TopBottom);
+ configmenu->screen.saveColPlacementDirection(BScreen::TopBottom);
setItemSelected(5, True);
setItemSelected(6, False);
break;
case BScreen::BottomTop:
- configmenu->screen->saveColPlacementDirection(BScreen::BottomTop);
+ configmenu->screen.saveColPlacementDirection(BScreen::BottomTop);
setItemSelected(5, False);
setItemSelected(6, True);
Placementmenu(Configmenu *);
};
- Openbox *openbox;
- BScreen *screen;
+ BScreen &screen;
Focusmenu *focusmenu;
Placementmenu *placementmenu;
virtual void itemSelected(int, int);
public:
- Configmenu(BScreen *);
+ Configmenu(BScreen &);
virtual ~Configmenu(void);
inline Basemenu *getFocusmenu(void) { return focusmenu; }
#include "Window.h"
-Iconmenu::Iconmenu(BScreen *scrn) : Basemenu(scrn) {
+Iconmenu::Iconmenu(BScreen &scrn) : Basemenu(scrn), screen(scrn) {
setInternalMenu();
- screen = scrn;
-
setLabel(i18n->getMessage(IconSet, IconIcons, "Icons"));
update();
}
if (button != 1)
return;
- if (index >= 0 && index < screen->getIconCount()) {
- OpenboxWindow *win = screen->getIcon(index);
+ if (index >= 0 && index < screen.getIconCount()) {
+ OpenboxWindow *win = screen.getIcon(index);
if (win) {
win->deiconify();
}
}
- if (! (screen->getWorkspacemenu()->isTorn() || isTorn()))
+ if (! (screen.getWorkspacemenu()->isTorn() || isTorn()))
hide();
}
class Iconmenu : public Basemenu {
private:
- BScreen *screen;
+ BScreen &screen;
protected:
virtual void itemSelected(int, int);
public:
- Iconmenu(BScreen *);
+ Iconmenu(BScreen &);
};
cache_max = cmax;
#ifdef TIMEDCACHE
if (cache_timeout) {
- timer = new BTimer(basedisplay, this);
+ timer = new BTimer(*basedisplay, *this);
timer->setTimeout(cache_timeout);
timer->start();
} else
#endif // MAXPATHLEN
-Rootmenu::Rootmenu(BScreen *scrn) : Basemenu(scrn) {
- screen = scrn;
- openbox = screen->getOpenbox();
+Rootmenu::Rootmenu(BScreen &scrn) : Basemenu(scrn), screen(scrn),
+ 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());
+ screen.getScreenNumber());
bexec(item->exec(), displaystring);
#else // __EMX__
break;
case BScreen::Restart:
- openbox->restart();
+ openbox.restart();
break;
case BScreen::RestartOther:
if (item->exec())
- openbox->restart(item->exec());
+ openbox.restart(item->exec());
break;
case BScreen::Exit:
- openbox->shutdown();
+ openbox.shutdown();
break;
case BScreen::SetStyle:
if (item->exec())
- openbox->saveStyleFilename(item->exec());
+ openbox.saveStyleFilename(item->exec());
case BScreen::Reconfigure:
- openbox->reconfigure();
+ openbox.reconfigure();
return;
}
- if (! (screen->getRootmenu()->isTorn() || isTorn()) &&
+ if (! (screen.getRootmenu()->isTorn() || isTorn()) &&
item->function() != BScreen::Reconfigure &&
item->function() != BScreen::SetStyle)
hide();
class Rootmenu : public Basemenu {
private:
- Openbox *openbox;
- BScreen *screen;
+ Openbox &openbox;
+ BScreen &screen;
protected:
public:
- Rootmenu(BScreen *);
+ Rootmenu(BScreen &);
};
}
-BScreen::BScreen(Openbox *bb, int scrn) : ScreenInfo(bb, scrn) {
- openbox = bb;
+BScreen::BScreen(Openbox *ob, int scrn) : ScreenInfo(ob, scrn) {
+ openbox = ob;
event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask |
SubstructureRedirectMask | KeyPressMask | KeyReleaseMask |
}
}
- workspacemenu = new Workspacemenu(this);
- iconmenu = new Iconmenu(this);
- configmenu = new Configmenu(this);
+ workspacemenu = new Workspacemenu(*this);
+ iconmenu = new Iconmenu(*this);
+ configmenu = new Configmenu(*this);
Workspace *wkspc = (Workspace *) 0;
if (resource.workspaces != 0) {
while (rootmenu->getCount())
rootmenu->remove(0);
} else {
- rootmenu = new Rootmenu(this);
+ rootmenu = new Rootmenu(*this);
}
Bool defaultMenu = True;
continue;
}
- Rootmenu *submenu = new Rootmenu(this);
+ Rootmenu *submenu = new Rootmenu(*this);
if (*command)
submenu->setLabel(command);
Rootmenu *stylesmenu;
if (newmenu)
- stylesmenu = new Rootmenu(this);
+ stylesmenu = new Rootmenu(*this);
else
stylesmenu = menu;
display = screen->getBaseDisplay()->getXDisplay();
frame.window = frame.pixmap = None;
- timer = new BTimer(openbox, this);
+ timer = new BTimer(*openbox, *this);
timer->setTimeout(openbox->getAutoRaiseDelay());
timer->fireOnce(True);
clientList = new LinkedList<SlitClient>;
- slitmenu = new Slitmenu(this);
+ slitmenu = new Slitmenu(*this);
XSetWindowAttributes attrib;
unsigned long create_mask = CWBackPixmap | CWBackPixel | CWBorderPixel |
}
-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();
- directionmenu = new Directionmenu(this);
- placementmenu = new Placementmenu(this);
+ directionmenu = new Directionmenu(*this);
+ placementmenu = new Placementmenu(*this);
insert(i18n->getMessage(CommonSet, CommonDirectionTitle, "Direction"),
directionmenu);
update();
- if (slit->isOnTop()) setItemSelected(2, True);
- if (slit->doAutoHide()) setItemSelected(3, True);
+ if (slit.isOnTop()) setItemSelected(2, True);
+ if (slit.doAutoHide()) setItemSelected(3, True);
}
switch (item->function()) {
case 1: { // always on top
- Bool change = ((slit->isOnTop()) ? False : True);
- slit->on_top = change;
+ Bool change = ((slit.isOnTop()) ? False : True);
+ 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;
}
case 2: { // auto hide
- Bool change = ((slit->doAutoHide()) ? False : True);
- slit->do_auto_hide = change;
+ Bool change = ((slit.doAutoHide()) ? False : True);
+ slit.do_auto_hide = change;
setItemSelected(3, change);
break;
void Slitmenu::internal_hide(void) {
Basemenu::internal_hide();
- if (slit->doAutoHide())
- slit->timeout();
+ if (slit.doAutoHide())
+ slit.timeout();
}
}
-Slitmenu::Directionmenu::Directionmenu(Slitmenu *sm)
- : Basemenu(sm->slit->screen) {
- slitmenu = sm;
-
+Slitmenu::Directionmenu::Directionmenu(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);
}
hide();
- slitmenu->slit->reconfigure();
+ slitmenu.slit.reconfigure();
}
-Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm)
- : Basemenu(sm->slit->screen) {
- slitmenu = sm;
+Slitmenu::Placementmenu::Placementmenu(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();
+ slitmenu.slit.reconfigure();
}
private:
class Directionmenu : public Basemenu {
private:
- Slitmenu *slitmenu;
+ Slitmenu &slitmenu;
protected:
virtual void itemSelected(int, int);
public:
- Directionmenu(Slitmenu *);
+ Directionmenu(Slitmenu &);
};
class Placementmenu : public Basemenu {
private:
- Slitmenu *slitmenu;
+ Slitmenu &slitmenu;
protected:
virtual void itemSelected(int, int);
public:
- Placementmenu(Slitmenu *);
+ Placementmenu(Slitmenu &);
};
Directionmenu *directionmenu;
Placementmenu *placementmenu;
- Slit *slit;
+ Slit &slit;
friend class Directionmenu;
friend class Placementmenu;
public:
- Slitmenu(Slit *);
+ Slitmenu(Slit &);
virtual ~Slitmenu(void);
inline Basemenu *getDirectionmenu(void) { return directionmenu; }
#include "BaseDisplay.h"
#include "Timer.h"
-BTimer::BTimer(BaseDisplay *d, TimeoutHandler *h) {
- display = d;
- handler = h;
-
+BTimer::BTimer(BaseDisplay &d, TimeoutHandler &h) : display(d), handler(h) {
once = timing = False;
}
if (! timing) {
timing = True;
- display->addTimer(this);
+ display.addTimer(this);
}
}
void BTimer::stop(void) {
timing = False;
- display->removeTimer(this);
+ display.removeTimer(this);
}
void BTimer::fireTimeout(void) {
- if (handler) handler->timeout();
+ handler.timeout();
}
class BTimer {
friend class BaseDisplay;
private:
- BaseDisplay *display;
- TimeoutHandler *handler;
+ BaseDisplay &display;
+ TimeoutHandler &handler;
int timing, once;
timeval _start, _timeout;
void fireTimeout(void);
public:
- BTimer(BaseDisplay *, TimeoutHandler *);
+ BTimer(BaseDisplay &, TimeoutHandler &);
virtual ~BTimer(void);
inline const int &isTiming(void) const { return timing; }
openbox = screen->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 = new BTimer(*openbox, hide_handler);
hide_timer->setTimeout(openbox->getAutoRaiseDelay());
hide_timer->fireOnce(True);
new_name_pos = 0;
frame.grab_x = frame.grab_y = 0;
- toolbarmenu = new Toolbarmenu(this);
+ toolbarmenu = new Toolbarmenu(*this);
display = openbox->getXDisplay();
XSetWindowAttributes attrib;
}
-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();
- placementmenu = new Placementmenu(this);
+ placementmenu = new Placementmenu(*this);
insert(i18n->getMessage(CommonSet, CommonPlacementTitle, "Placement"),
placementmenu);
update();
- if (toolbar->isOnTop()) setItemSelected(1, True);
- if (toolbar->doAutoHide()) setItemSelected(2, True);
+ if (toolbar.isOnTop()) setItemSelected(1, True);
+ if (toolbar.doAutoHide()) setItemSelected(2, True);
}
switch (item->function()) {
case 1: { // always on top
- Bool change = ((toolbar->isOnTop()) ? False : True);
- toolbar->on_top = change;
+ Bool change = ((toolbar.isOnTop()) ? False : True);
+ 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;
}
case 2: { // auto hide
- Bool change = ((toolbar->doAutoHide()) ? False : True);
- toolbar->do_auto_hide = change;
+ Bool change = ((toolbar.doAutoHide()) ? False : True);
+ toolbar.do_auto_hide = change;
setItemSelected(2, change);
#ifdef SLIT
- toolbar->screen->getSlit()->reposition();
+ toolbar.screen->getSlit()->reposition();
#endif // SLIT
break;
}
case 3: { // edit current workspace name
- toolbar->edit();
+ toolbar.edit();
hide();
break;
void Toolbarmenu::internal_hide(void) {
Basemenu::internal_hide();
- if (toolbar->doAutoHide() && ! toolbar->isEditing())
- toolbar->hide_handler.timeout();
+ if (toolbar.doAutoHide() && ! toolbar.isEditing())
+ toolbar.hide_handler.timeout();
}
}
-Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm)
- : Basemenu(tm->toolbar->screen) {
- toolbarmenu = tm;
-
+Toolbarmenu::Placementmenu::Placementmenu(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();
+ 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
}
private:
class Placementmenu : public Basemenu {
private:
- Toolbarmenu *toolbarmenu;
+ Toolbarmenu &toolbarmenu;
protected:
virtual void itemSelected(int, int);
public:
- Placementmenu(Toolbarmenu *);
+ Placementmenu(Toolbarmenu &);
};
- Toolbar *toolbar;
+ Toolbar &toolbar;
Placementmenu *placementmenu;
friend class Placementmenu;
virtual void internal_hide(void);
public:
- Toolbarmenu(Toolbar *);
+ Toolbarmenu(Toolbar &);
~Toolbarmenu(void);
inline Basemenu *getPlacementmenu(void) { return placementmenu; }
lastButtonPressTime = 0;
image_ctrl = screen->getImageControl();
- timer = new BTimer(openbox, this);
+ timer = new BTimer(*openbox, *this);
timer->setTimeout(openbox->getAutoRaiseDelay());
timer->fireOnce(True);
XMapSubwindows(display, frame.window);
if (decorations.menu)
- windowmenu = new Windowmenu(this);
+ windowmenu = new Windowmenu(*this);
decorate();
#endif // STDC_HEADERS
-Windowmenu::Windowmenu(OpenboxWindow *win) : Basemenu(win->getScreen()) {
- window = win;
- screen = window->getScreen();
+Windowmenu::Windowmenu(OpenboxWindow &win) : Basemenu(*win.getScreen()),
+ window(win), screen(*win.getScreen())
+{
setTitleVisibility(False);
setMovable(False);
setInternalMenu();
- sendToMenu = new SendtoWorkspacemenu(this);
+ sendToMenu = new SendtoWorkspacemenu(*this);
insert(i18n->getMessage(WindowmenuSet, WindowmenuSendTo, "Send To ..."),
sendToMenu);
insert(i18n->getMessage(WindowmenuSet, WindowmenuShade, "Shade"),
update();
- setItemEnabled(1, window->hasTitlebar());
- setItemEnabled(2, window->isIconifiable());
- setItemEnabled(3, window->isMaximizable());
- setItemEnabled(8, window->isClosable());
+ setItemEnabled(1, window.hasTitlebar());
+ setItemEnabled(2, window.isIconifiable());
+ setItemEnabled(3, window.isMaximizable());
+ setItemEnabled(8, window.isClosable());
}
void Windowmenu::show(void) {
- if (isItemEnabled(1)) setItemSelected(1, window->isShaded());
- if (isItemEnabled(3)) setItemSelected(3, window->isMaximized());
- if (isItemEnabled(6)) setItemSelected(6, window->isStuck());
+ if (isItemEnabled(1)) setItemSelected(1, window.isShaded());
+ if (isItemEnabled(3)) setItemSelected(3, window.isMaximized());
+ if (isItemEnabled(6)) setItemSelected(6, window.isStuck());
Basemenu::show();
}
hide();
switch (item->function()) {
case BScreen::WindowShade:
- window->shade();
+ window.shade();
break;
case BScreen::WindowIconify:
- window->iconify();
+ window.iconify();
break;
case BScreen::WindowMaximize:
- window->maximize((unsigned int) button);
+ window.maximize((unsigned int) button);
break;
case BScreen::WindowClose:
- window->close();
+ window.close();
break;
case BScreen::WindowRaise:
- screen->getWorkspace(window->getWorkspaceNumber())->raiseWindow(window);
+ screen.getWorkspace(window.getWorkspaceNumber())->raiseWindow(&window);
break;
case BScreen::WindowLower:
- screen->getWorkspace(window->getWorkspaceNumber())->lowerWindow(window);
+ screen.getWorkspace(window.getWorkspaceNumber())->lowerWindow(&window);
break;
case BScreen::WindowStick:
- window->stick();
+ window.stick();
break;
case BScreen::WindowKill:
- XKillClient(screen->getBaseDisplay()->getXDisplay(),
- window->getClientWindow());
+ XKillClient(screen.getBaseDisplay()->getXDisplay(),
+ window.getClientWindow());
break;
}
} else if (item->function() == BScreen::WindowMaximize) {
hide();
- window->maximize((unsigned int) button);
+ window.maximize((unsigned int) button);
}
}
void Windowmenu::reconfigure(void) {
- setItemEnabled(1, window->hasTitlebar());
- setItemEnabled(2, window->isIconifiable());
- setItemEnabled(3, window->isMaximizable());
- setItemEnabled(8, window->isClosable());
+ setItemEnabled(1, window.hasTitlebar());
+ setItemEnabled(2, window.isIconifiable());
+ setItemEnabled(3, window.isMaximizable());
+ setItemEnabled(8, window.isClosable());
sendToMenu->reconfigure();
}
-Windowmenu::SendtoWorkspacemenu::SendtoWorkspacemenu(Windowmenu *w)
- : Basemenu(w->screen) {
- windowmenu = w;
-
+Windowmenu::SendtoWorkspacemenu::SendtoWorkspacemenu(Windowmenu &w)
+ : Basemenu(w.screen), windowmenu(w) {
setTitleVisibility(False);
setMovable(False);
setInternalMenu();
void Windowmenu::SendtoWorkspacemenu::itemSelected(int button, int index) {
if (button > 2) return;
- if (index <= windowmenu->screen->getWorkspaceCount()) {
- if (index == windowmenu->screen->getCurrentWorkspaceID()) return;
- if (windowmenu->window->isStuck()) windowmenu->window->stick();
+ if (index <= windowmenu.screen.getWorkspaceCount()) {
+ if (index == windowmenu.screen.getCurrentWorkspaceID()) return;
+ if (windowmenu.window.isStuck()) windowmenu.window.stick();
- if (button == 1) windowmenu->window->withdraw();
- windowmenu->screen->reassociateWindow(windowmenu->window, index, True);
- if (button == 2) windowmenu->screen->changeWorkspaceID(index);
+ if (button == 1) windowmenu.window.withdraw();
+ windowmenu.screen.reassociateWindow(&(windowmenu.window), index, True);
+ if (button == 2) windowmenu.screen.changeWorkspaceID(index);
}
hide();
}
for (i = 0; i < r; ++i)
remove(0);
- for (i = 0; i < windowmenu->screen->getWorkspaceCount(); ++i)
- insert(windowmenu->screen->getWorkspace(i)->getName());
+ for (i = 0; i < windowmenu.screen.getWorkspaceCount(); ++i)
+ insert(windowmenu.screen.getWorkspace(i)->getName());
Basemenu::update();
}
class Windowmenu : public Basemenu {
private:
- OpenboxWindow *window;
- BScreen *screen;
+ OpenboxWindow &window;
+ BScreen &screen;
class SendtoWorkspacemenu : public Basemenu {
private:
- Windowmenu *windowmenu;
+ Windowmenu &windowmenu;
protected:
virtual void itemSelected(int, int);
public:
- SendtoWorkspacemenu(Windowmenu *);
+ SendtoWorkspacemenu(Windowmenu &);
void update(void);
public:
- Windowmenu(OpenboxWindow *);
+ Windowmenu(OpenboxWindow &);
virtual ~Windowmenu(void);
inline Basemenu *getSendToMenu(void) { return (Basemenu *) sendToMenu; }
stackingList = new LinkedList<OpenboxWindow>;
windowList = new LinkedList<OpenboxWindow>;
- clientmenu = new Clientmenu(this);
+ clientmenu = new Clientmenu(*this);
lastfocus = (OpenboxWindow *) 0;
#include "Workspace.h"
-Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) {
- screen = scrn;
-
+Workspacemenu::Workspacemenu(BScreen &scrn) : Basemenu(scrn), screen(scrn) {
setInternalMenu();
setLabel(i18n->getMessage(WorkspacemenuSet, WorkspacemenuWorkspacesTitle,
return;
if (index == 0)
- screen->addWorkspace();
+ screen.addWorkspace();
else if (index == 1)
- screen->removeLastWorkspace();
- else if ((screen->getCurrentWorkspace()->getWorkspaceID() !=
- (index - 2)) && ((index - 2) < screen->getWorkspaceCount()))
- screen->changeWorkspaceID(index - 2);
+ screen.removeLastWorkspace();
+ else if ((screen.getCurrentWorkspace()->getWorkspaceID() !=
+ (index - 2)) && ((index - 2) < screen.getWorkspaceCount()))
+ screen.changeWorkspaceID(index - 2);
- if (! (screen->getWorkspacemenu()->isTorn() || isTorn()))
+ if (! (screen.getWorkspacemenu()->isTorn() || isTorn()))
hide();
}
class Workspacemenu : public Basemenu {
private:
- BScreen *screen;
+ BScreen &screen;
protected:
virtual void itemSelected(int, int);
public:
- Workspacemenu(BScreen *);
+ Workspacemenu(BScreen &);
};
reconfigure_wait = reread_menu_wait = False;
- timer = new BTimer(this, this);
+ timer = new BTimer(*this, *this);
timer->setTimeout(0);
timer->fireOnce(True);