fixed enums
This commit is contained in:
parent
11ba4d17bd
commit
e2ddbd4ff1
5 changed files with 137 additions and 98 deletions
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Basemenu.cc,v 1.5 2002/01/09 14:11:20 fluxgen Exp $
|
// $Id: Basemenu.cc,v 1.6 2002/01/11 09:26:33 fluxgen Exp $
|
||||||
|
|
||||||
// stupid macros needed to access some functions in version 2 of the GNU C
|
// stupid macros needed to access some functions in version 2 of the GNU C
|
||||||
// library
|
// library
|
||||||
|
@ -58,7 +58,7 @@ Basemenu::Basemenu(BScreen *scrn) {
|
||||||
image_ctrl = screen->getImageControl();
|
image_ctrl = screen->getImageControl();
|
||||||
display = fluxbox->getXDisplay();
|
display = fluxbox->getXDisplay();
|
||||||
parent = (Basemenu *) 0;
|
parent = (Basemenu *) 0;
|
||||||
alignment = AlignDontCare;
|
alignment = ALIGNDONTCARE;
|
||||||
|
|
||||||
title_vis =
|
title_vis =
|
||||||
movable =
|
movable =
|
||||||
|
@ -556,7 +556,7 @@ void Basemenu::drawSubmenu(int index) {
|
||||||
x = menu.x +
|
x = menu.x +
|
||||||
((menu.item_w * (sbl + 1)) + screen->getBorderWidth()), y;
|
((menu.item_w * (sbl + 1)) + screen->getBorderWidth()), y;
|
||||||
|
|
||||||
if (alignment == AlignTop) {
|
if (alignment == ALIGNTOP) {
|
||||||
y = (((shifted) ? menu.y_shift : menu.y) +
|
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()->title_vis) ?
|
||||||
|
@ -569,7 +569,7 @@ void Basemenu::drawSubmenu(int index) {
|
||||||
item->submenu()->menu.title_h + screen->getBorderWidth() : 0));
|
item->submenu()->menu.title_h + screen->getBorderWidth() : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alignment == AlignBottom &&
|
if (alignment == ALIGNBOTTOM &&
|
||||||
(y + item->submenu()->menu.height) > ((shifted) ? menu.y_shift :
|
(y + item->submenu()->menu.height) > ((shifted) ? menu.y_shift :
|
||||||
menu.y) + menu.height) {
|
menu.y) + menu.height) {
|
||||||
y = (((shifted) ? menu.y_shift : menu.y) +
|
y = (((shifted) ? menu.y_shift : menu.y) +
|
||||||
|
@ -675,7 +675,7 @@ void Basemenu::drawItem(int index, Bool highlight, Bool clear,
|
||||||
|
|
||||||
sel_x = item_x;
|
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 += (menu.item_w - menu.item_h - menu.bevel_w);
|
||||||
|
|
||||||
sel_x += quarter_w;
|
sel_x += quarter_w;
|
||||||
|
@ -744,14 +744,14 @@ void Basemenu::drawItem(int index, Bool highlight, Bool clear,
|
||||||
|
|
||||||
if (dosel && item->submenu()) {
|
if (dosel && item->submenu()) {
|
||||||
switch (screen->getMenuStyle()->bullet) {
|
switch (screen->getMenuStyle()->bullet) {
|
||||||
case Square:
|
case SQUARE:
|
||||||
XDrawRectangle(display, menu.frame, gc, sel_x, sel_y, half_w, half_w);
|
XDrawRectangle(display, menu.frame, gc, sel_x, sel_y, half_w, half_w);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Triangle:
|
case TRIANGLE:
|
||||||
XPoint tri[3];
|
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].x = sel_x + quarter_w - 2;
|
||||||
tri[0].y = sel_y + quarter_w - 2;
|
tri[0].y = sel_y + quarter_w - 2;
|
||||||
tri[1].x = 4;
|
tri[1].x = 4;
|
||||||
|
@ -771,7 +771,7 @@ void Basemenu::drawItem(int index, Bool highlight, Bool clear,
|
||||||
CoordModePrevious);
|
CoordModePrevious);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Diamond:
|
case DIAMOND:
|
||||||
XPoint dia[4];
|
XPoint dia[4];
|
||||||
|
|
||||||
dia[0].x = sel_x + quarter_w - 3;
|
dia[0].x = sel_x + quarter_w - 3;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Basemenu.hh,v 1.3 2002/01/09 14:11:20 fluxgen Exp $
|
// $Id: Basemenu.hh,v 1.4 2002/01/11 09:24:46 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef _BASEMENU_HH_
|
#ifndef _BASEMENU_HH_
|
||||||
#define _BASEMENU_HH_
|
#define _BASEMENU_HH_
|
||||||
|
@ -133,9 +133,10 @@ public:
|
||||||
virtual void show(void);
|
virtual void show(void);
|
||||||
virtual void hide(void);
|
virtual void hide(void);
|
||||||
|
|
||||||
enum { AlignDontCare = 1, AlignTop, AlignBottom };
|
enum { ALIGNDONTCARE = 1, ALIGNTOP, ALIGNBOTTOM };
|
||||||
enum { Right = 1, Left };
|
enum { RIGHT = 1, LEFT };
|
||||||
enum { Empty = 0, Square, Triangle, Diamond };
|
enum { EMPTY = 0, SQUARE, TRIANGLE, DIAMOND };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Configmenu.cc,v 1.8 2002/01/09 14:11:20 fluxgen Exp $
|
// $Id: Configmenu.cc,v 1.9 2002/01/11 09:20:42 fluxgen Exp $
|
||||||
|
|
||||||
// stupid macros needed to access some functions in version 2 of the GNU C
|
// stupid macros needed to access some functions in version 2 of the GNU C
|
||||||
// library
|
// library
|
||||||
|
@ -382,70 +382,70 @@ Configmenu::Placementmenu::Placementmenu(Configmenu *cm) : Basemenu(cm->screen)
|
||||||
#else // !NLS
|
#else // !NLS
|
||||||
0, 0,
|
0, 0,
|
||||||
#endif // NLS
|
#endif // NLS
|
||||||
"Smart Placement (Rows)"), BScreen::RowSmartPlacement);
|
"Smart Placement (Rows)"), BScreen::ROWSMARTPLACEMENT);
|
||||||
insert(i18n->getMessage(
|
insert(i18n->getMessage(
|
||||||
#ifdef NLS
|
#ifdef NLS
|
||||||
ConfigmenuSet, ConfigmenuSmartCols,
|
ConfigmenuSet, ConfigmenuSmartCols,
|
||||||
#else // !NLS
|
#else // !NLS
|
||||||
0, 0,
|
0, 0,
|
||||||
#endif // NLS
|
#endif // NLS
|
||||||
"Smart Placement (Columns)"), BScreen::ColSmartPlacement);
|
"Smart Placement (Columns)"), BScreen::COLSMARTPLACEMENT);
|
||||||
insert(i18n->getMessage(
|
insert(i18n->getMessage(
|
||||||
#ifdef NLS
|
#ifdef NLS
|
||||||
ConfigmenuSet, ConfigmenuCascade,
|
ConfigmenuSet, ConfigmenuCascade,
|
||||||
#else // !NLS
|
#else // !NLS
|
||||||
0, 0,
|
0, 0,
|
||||||
#endif // NLS
|
#endif // NLS
|
||||||
"Cascade Placement"), BScreen::CascadePlacement);
|
"Cascade Placement"), BScreen::CASCADEPLACEMENT);
|
||||||
insert(i18n->getMessage(
|
insert(i18n->getMessage(
|
||||||
#ifdef NLS
|
#ifdef NLS
|
||||||
ConfigmenuSet, ConfigmenuLeftRight,
|
ConfigmenuSet, ConfigmenuLeftRight,
|
||||||
#else // !NLS
|
#else // !NLS
|
||||||
0, 0,
|
0, 0,
|
||||||
#endif // NLS
|
#endif // NLS
|
||||||
"Left to Right"), BScreen::LeftRight);
|
"Left to Right"), BScreen::LEFTRIGHT);
|
||||||
insert(i18n->getMessage(
|
insert(i18n->getMessage(
|
||||||
#ifdef NLS
|
#ifdef NLS
|
||||||
ConfigmenuSet, ConfigmenuRightLeft,
|
ConfigmenuSet, ConfigmenuRightLeft,
|
||||||
#else // !NLS
|
#else // !NLS
|
||||||
0, 0,
|
0, 0,
|
||||||
#endif // NLS
|
#endif // NLS
|
||||||
"Right to Left"), BScreen::RightLeft);
|
"Right to Left"), BScreen::RIGHTLEFT);
|
||||||
insert(i18n->getMessage(
|
insert(i18n->getMessage(
|
||||||
#ifdef NLS
|
#ifdef NLS
|
||||||
ConfigmenuSet, ConfigmenuTopBottom,
|
ConfigmenuSet, ConfigmenuTopBottom,
|
||||||
#else // !NLS
|
#else // !NLS
|
||||||
0, 0,
|
0, 0,
|
||||||
#endif // NLS
|
#endif // NLS
|
||||||
"Top to Bottom"), BScreen::TopBottom);
|
"Top to Bottom"), BScreen::TOPBOTTOM);
|
||||||
insert(i18n->getMessage(
|
insert(i18n->getMessage(
|
||||||
#ifdef NLS
|
#ifdef NLS
|
||||||
ConfigmenuSet, ConfigmenuBottomTop,
|
ConfigmenuSet, ConfigmenuBottomTop,
|
||||||
#else // !NLS
|
#else // !NLS
|
||||||
0, 0,
|
0, 0,
|
||||||
#endif // NLS
|
#endif // NLS
|
||||||
"Bottom to Top"), BScreen::BottomTop);
|
"Bottom to Top"), BScreen::BOTTOMTOP);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
||||||
switch (configmenu->screen->getPlacementPolicy()) {
|
switch (configmenu->screen->getPlacementPolicy()) {
|
||||||
case BScreen::RowSmartPlacement:
|
case BScreen::ROWSMARTPLACEMENT:
|
||||||
setItemSelected(0, True);
|
setItemSelected(0, True);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BScreen::ColSmartPlacement:
|
case BScreen::COLSMARTPLACEMENT:
|
||||||
setItemSelected(1, True);
|
setItemSelected(1, True);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BScreen::CascadePlacement:
|
case BScreen::CASCADEPLACEMENT:
|
||||||
setItemSelected(2, True);
|
setItemSelected(2, True);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool rl = (configmenu->screen->getRowPlacementDirection() ==
|
Bool rl = (configmenu->screen->getRowPlacementDirection() ==
|
||||||
BScreen::LeftRight),
|
BScreen::LEFTRIGHT),
|
||||||
tb = (configmenu->screen->getColPlacementDirection() ==
|
tb = (configmenu->screen->getColPlacementDirection() ==
|
||||||
BScreen::TopBottom);
|
BScreen::TOPBOTTOM);
|
||||||
|
|
||||||
setItemSelected(3, rl);
|
setItemSelected(3, rl);
|
||||||
setItemSelected(4, ! rl);
|
setItemSelected(4, ! rl);
|
||||||
|
@ -461,7 +461,7 @@ void Configmenu::Placementmenu::itemSelected(int button, int index) {
|
||||||
|
|
||||||
if (item->function()) {
|
if (item->function()) {
|
||||||
switch (item->function()) {
|
switch (item->function()) {
|
||||||
case BScreen::RowSmartPlacement:
|
case BScreen::ROWSMARTPLACEMENT:
|
||||||
configmenu->screen->savePlacementPolicy(item->function());
|
configmenu->screen->savePlacementPolicy(item->function());
|
||||||
|
|
||||||
setItemSelected(0, True);
|
setItemSelected(0, True);
|
||||||
|
@ -470,7 +470,7 @@ void Configmenu::Placementmenu::itemSelected(int button, int index) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BScreen::ColSmartPlacement:
|
case BScreen::COLSMARTPLACEMENT:
|
||||||
configmenu->screen->savePlacementPolicy(item->function());
|
configmenu->screen->savePlacementPolicy(item->function());
|
||||||
|
|
||||||
setItemSelected(0, False);
|
setItemSelected(0, False);
|
||||||
|
@ -479,7 +479,7 @@ void Configmenu::Placementmenu::itemSelected(int button, int index) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BScreen::CascadePlacement:
|
case BScreen::CASCADEPLACEMENT:
|
||||||
configmenu->screen->savePlacementPolicy(item->function());
|
configmenu->screen->savePlacementPolicy(item->function());
|
||||||
|
|
||||||
setItemSelected(0, False);
|
setItemSelected(0, False);
|
||||||
|
@ -488,32 +488,32 @@ void Configmenu::Placementmenu::itemSelected(int button, int index) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BScreen::LeftRight:
|
case BScreen::LEFTRIGHT:
|
||||||
configmenu->screen->saveRowPlacementDirection(BScreen::LeftRight);
|
configmenu->screen->saveRowPlacementDirection(BScreen::LEFTRIGHT);
|
||||||
|
|
||||||
setItemSelected(3, True);
|
setItemSelected(3, True);
|
||||||
setItemSelected(4, False);
|
setItemSelected(4, False);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BScreen::RightLeft:
|
case BScreen::RIGHTLEFT:
|
||||||
configmenu->screen->saveRowPlacementDirection(BScreen::RightLeft);
|
configmenu->screen->saveRowPlacementDirection(BScreen::RIGHTLEFT);
|
||||||
|
|
||||||
setItemSelected(3, False);
|
setItemSelected(3, False);
|
||||||
setItemSelected(4, True);
|
setItemSelected(4, True);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BScreen::TopBottom:
|
case BScreen::TOPBOTTOM:
|
||||||
configmenu->screen->saveColPlacementDirection(BScreen::TopBottom);
|
configmenu->screen->saveColPlacementDirection(BScreen::TOPBOTTOM);
|
||||||
|
|
||||||
setItemSelected(5, True);
|
setItemSelected(5, True);
|
||||||
setItemSelected(6, False);
|
setItemSelected(6, False);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BScreen::BottomTop:
|
case BScreen::BOTTOMTOP:
|
||||||
configmenu->screen->saveColPlacementDirection(BScreen::BottomTop);
|
configmenu->screen->saveColPlacementDirection(BScreen::BOTTOMTOP);
|
||||||
|
|
||||||
setItemSelected(5, False);
|
setItemSelected(5, False);
|
||||||
setItemSelected(6, True);
|
setItemSelected(6, True);
|
||||||
|
|
136
src/fluxbox.cc
136
src/fluxbox.cc
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: fluxbox.cc,v 1.18 2002/01/10 12:51:21 fluxgen Exp $
|
// $Id: fluxbox.cc,v 1.19 2002/01/11 09:17:37 fluxgen Exp $
|
||||||
|
|
||||||
// stupid macros needed to access some functions in version 2 of the GNU C
|
// stupid macros needed to access some functions in version 2 of the GNU C
|
||||||
// library
|
// library
|
||||||
|
@ -988,6 +988,7 @@ void Fluxbox::process_event(XEvent *e) {
|
||||||
BScreen *screen = searchScreen(e->xclient.window);
|
BScreen *screen = searchScreen(e->xclient.window);
|
||||||
if (screen)
|
if (screen)
|
||||||
screen->changeWorkspaceID(e->xclient.data.l[0]);
|
screen->changeWorkspaceID(e->xclient.data.l[0]);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif //!GNOME
|
#endif //!GNOME
|
||||||
}
|
}
|
||||||
|
@ -1018,6 +1019,9 @@ void Fluxbox::doWindowAction(Keys::KeyAction action) {
|
||||||
if (!focused_window)
|
if (!focused_window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
unsigned int t_placement = focused_window->getScreen()->getTabPlacement();
|
||||||
|
unsigned int t_alignment = focused_window->getScreen()->getTabAlignment();
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case Keys::ICONIFY:
|
case Keys::ICONIFY:
|
||||||
focused_window->iconify();
|
focused_window->iconify();
|
||||||
|
@ -1093,24 +1097,56 @@ void Fluxbox::doWindowAction(Keys::KeyAction action) {
|
||||||
focused_window->configure(
|
focused_window->configure(
|
||||||
focused_window->getXFrame(), focused_window->getYFrame(),
|
focused_window->getXFrame(), focused_window->getYFrame(),
|
||||||
focused_window->getWidth()+10, focused_window->getHeight());
|
focused_window->getWidth()+10, focused_window->getHeight());
|
||||||
|
|
||||||
|
if (focused_window->hasTab() &&
|
||||||
|
(t_placement == Tab::PTOP || t_placement == Tab::PBOTTOM)) {
|
||||||
|
if (t_alignment == Tab::ARELATIVE)
|
||||||
|
focused_window->getTab()->calcIncrease();
|
||||||
|
if (t_alignment != Tab::PLEFT)
|
||||||
|
focused_window->getTab()->setPosition();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Keys::VERTINC:
|
case Keys::VERTINC:
|
||||||
if (focused_window->isResizable())
|
if (focused_window->isResizable())
|
||||||
focused_window->configure(
|
focused_window->configure(
|
||||||
focused_window->getXFrame(), focused_window->getYFrame(),
|
focused_window->getXFrame(), focused_window->getYFrame(),
|
||||||
focused_window->getWidth(), focused_window->getHeight()+10);
|
focused_window->getWidth(), focused_window->getHeight()+10);
|
||||||
|
|
||||||
|
if (focused_window->hasTab() &&
|
||||||
|
(t_placement == Tab::PLEFT || t_placement == Tab::PRIGHT)) {
|
||||||
|
if (t_alignment == Tab::ARELATIVE)
|
||||||
|
focused_window->getTab()->calcIncrease();
|
||||||
|
if (t_alignment != Tab::PRIGHT)
|
||||||
|
focused_window->getTab()->setPosition();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Keys::HORIZDEC:
|
case Keys::HORIZDEC:
|
||||||
if (focused_window->isResizable())
|
if (focused_window->isResizable())
|
||||||
focused_window->configure(
|
focused_window->configure(
|
||||||
focused_window->getXFrame(), focused_window->getYFrame(),
|
focused_window->getXFrame(), focused_window->getYFrame(),
|
||||||
focused_window->getWidth()-10, focused_window->getHeight());
|
focused_window->getWidth()-10, focused_window->getHeight());
|
||||||
|
|
||||||
|
if (focused_window->hasTab() &&
|
||||||
|
(t_placement == Tab::PTOP || t_placement == Tab::PBOTTOM)) {
|
||||||
|
if (t_alignment == Tab::ARELATIVE)
|
||||||
|
focused_window->getTab()->calcIncrease();
|
||||||
|
if (t_alignment != Tab::PLEFT)
|
||||||
|
focused_window->getTab()->setPosition();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Keys::VERTDEC:
|
case Keys::VERTDEC:
|
||||||
if (focused_window->isResizable())
|
if (focused_window->isResizable())
|
||||||
focused_window->configure(
|
focused_window->configure(
|
||||||
focused_window->getXFrame(), focused_window->getYFrame(),
|
focused_window->getXFrame(), focused_window->getYFrame(),
|
||||||
focused_window->getWidth(), focused_window->getHeight()-10);
|
focused_window->getWidth(), focused_window->getHeight()-10);
|
||||||
|
|
||||||
|
if (focused_window->hasTab() &&
|
||||||
|
(t_placement == Tab::PLEFT || t_placement == Tab::PRIGHT)) {
|
||||||
|
if (t_alignment == Tab::ARELATIVE)
|
||||||
|
focused_window->getTab()->calcIncrease();
|
||||||
|
if (t_alignment != Tab::PRIGHT)
|
||||||
|
focused_window->getTab()->setPosition();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -1464,14 +1500,14 @@ void Fluxbox::save_rc(void) {
|
||||||
char *slit_placement = (char *) 0;
|
char *slit_placement = (char *) 0;
|
||||||
|
|
||||||
switch (screen->getSlitPlacement()) {
|
switch (screen->getSlitPlacement()) {
|
||||||
case Slit::TopLeft: slit_placement = "TopLeft"; break;
|
case Slit::TOPLEFT: slit_placement = "TopLeft"; break;
|
||||||
case Slit::CenterLeft: slit_placement = "CenterLeft"; break;
|
case Slit::CENTERLEFT: slit_placement = "CenterLeft"; break;
|
||||||
case Slit::BottomLeft: slit_placement = "BottomLeft"; break;
|
case Slit::BOTTOMLEFT: slit_placement = "BottomLeft"; break;
|
||||||
case Slit::TopCenter: slit_placement = "TopCenter"; break;
|
case Slit::TOPCENTER: slit_placement = "TopCenter"; break;
|
||||||
case Slit::BottomCenter: slit_placement = "BottomCenter"; break;
|
case Slit::BOTTOMCENTER: slit_placement = "BottomCenter"; break;
|
||||||
case Slit::TopRight: slit_placement = "TopRight"; break;
|
case Slit::TOPRIGHT: slit_placement = "TopRight"; break;
|
||||||
case Slit::BottomRight: slit_placement = "BottomRight"; break;
|
case Slit::BOTTOMRIGHT: slit_placement = "BottomRight"; break;
|
||||||
case Slit::CenterRight: default: slit_placement = "CenterRight"; break;
|
case Slit::CENTERRIGHT: default: slit_placement = "CenterRight"; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number,
|
sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number,
|
||||||
|
@ -1479,7 +1515,7 @@ void Fluxbox::save_rc(void) {
|
||||||
XrmPutLineResource(&new_blackboxrc, rc_string);
|
XrmPutLineResource(&new_blackboxrc, rc_string);
|
||||||
|
|
||||||
sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number,
|
sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number,
|
||||||
((screen->getSlitDirection() == Slit::Horizontal) ? "Horizontal" :
|
((screen->getSlitDirection() == Slit::HORIZONTAL) ? "Horizontal" :
|
||||||
"Vertical"));
|
"Vertical"));
|
||||||
XrmPutLineResource(&new_blackboxrc, rc_string);
|
XrmPutLineResource(&new_blackboxrc, rc_string);
|
||||||
|
|
||||||
|
@ -1506,6 +1542,7 @@ void Fluxbox::save_rc(void) {
|
||||||
|
|
||||||
sprintf(rc_string, "session.screen%d.rootCommand: %s", screen_number,
|
sprintf(rc_string, "session.screen%d.rootCommand: %s", screen_number,
|
||||||
screen->getRootCommand().c_str());
|
screen->getRootCommand().c_str());
|
||||||
|
|
||||||
XrmPutLineResource(&new_blackboxrc, rc_string);
|
XrmPutLineResource(&new_blackboxrc, rc_string);
|
||||||
|
|
||||||
sprintf(rc_string, "session.screen%d.focusNewWindows: %s", screen_number,
|
sprintf(rc_string, "session.screen%d.focusNewWindows: %s", screen_number,
|
||||||
|
@ -1517,12 +1554,12 @@ void Fluxbox::save_rc(void) {
|
||||||
XrmPutLineResource(&new_blackboxrc, rc_string);
|
XrmPutLineResource(&new_blackboxrc, rc_string);
|
||||||
|
|
||||||
sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number,
|
sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number,
|
||||||
((screen->getRowPlacementDirection() == BScreen::LeftRight) ?
|
((screen->getRowPlacementDirection() == BScreen::LEFTRIGHT) ?
|
||||||
"LeftToRight" : "RightToLeft"));
|
"LeftToRight" : "RightToLeft"));
|
||||||
XrmPutLineResource(&new_blackboxrc, rc_string);
|
XrmPutLineResource(&new_blackboxrc, rc_string);
|
||||||
|
|
||||||
sprintf(rc_string, "session.screen%d.colPlacementDirection: %s", screen_number,
|
sprintf(rc_string, "session.screen%d.colPlacementDirection: %s", screen_number,
|
||||||
((screen->getColPlacementDirection() == BScreen::TopBottom) ?
|
((screen->getColPlacementDirection() == BScreen::TOPBOTTOM) ?
|
||||||
"TopToBottom" : "BottomToTop"));
|
"TopToBottom" : "BottomToTop"));
|
||||||
XrmPutLineResource(&new_blackboxrc, rc_string);
|
XrmPutLineResource(&new_blackboxrc, rc_string);
|
||||||
|
|
||||||
|
@ -1532,16 +1569,16 @@ void Fluxbox::save_rc(void) {
|
||||||
((screen->doMaxOverSlit()) ? "True" : "False"));
|
((screen->doMaxOverSlit()) ? "True" : "False"));
|
||||||
XrmPutLineResource(&new_blackboxrc, rc_string);
|
XrmPutLineResource(&new_blackboxrc, rc_string);
|
||||||
switch (screen->getPlacementPolicy()) {
|
switch (screen->getPlacementPolicy()) {
|
||||||
case BScreen::CascadePlacement:
|
case BScreen::CASCADEPLACEMENT:
|
||||||
placement = "CascadePlacement";
|
placement = "CascadePlacement";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BScreen::ColSmartPlacement:
|
case BScreen::COLSMARTPLACEMENT:
|
||||||
placement = "ColSmartPlacement";
|
placement = "ColSmartPlacement";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case BScreen::RowSmartPlacement:
|
case BScreen::ROWSMARTPLACEMENT:
|
||||||
placement = "RowSmartPlacement";
|
placement = "RowSmartPlacement";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1692,6 +1729,7 @@ char *Fluxbox::getRcFilename() {
|
||||||
if (!rc_file) {
|
if (!rc_file) {
|
||||||
string str(getenv("HOME")+string("/.")+RC_PATH+string("/")+RC_INIT_FILE);
|
string str(getenv("HOME")+string("/.")+RC_PATH+string("/")+RC_INIT_FILE);
|
||||||
return StringUtil::strdup(str.c_str());
|
return StringUtil::strdup(str.c_str());
|
||||||
|
|
||||||
} else
|
} else
|
||||||
dbfile = StringUtil::strdup(rc_file);
|
dbfile = StringUtil::strdup(rc_file);
|
||||||
|
|
||||||
|
@ -1853,17 +1891,17 @@ void Fluxbox::setTitlebar(vector<Fluxbox::Titlebar>& dir, const char *arg) {
|
||||||
vector<string> argv = parseTitleArgs(arg);
|
vector<string> argv = parseTitleArgs(arg);
|
||||||
for (unsigned int i=0; i<argv.size(); i++) {
|
for (unsigned int i=0; i<argv.size(); i++) {
|
||||||
if (argv[i]==NAME_STICKY)
|
if (argv[i]==NAME_STICKY)
|
||||||
dir.push_back(Stick);
|
dir.push_back(STICK);
|
||||||
else if (argv[i]==NAME_MAXIMIZE)
|
else if (argv[i]==NAME_MAXIMIZE)
|
||||||
dir.push_back(Maximize);
|
dir.push_back(MAXIMIZE);
|
||||||
else if (argv[i]==NAME_MINIMIZE)
|
else if (argv[i]==NAME_MINIMIZE)
|
||||||
dir.push_back(Minimize);
|
dir.push_back(MINIMIZE);
|
||||||
else if (argv[i]== NAME_CLOSE)
|
else if (argv[i]== NAME_CLOSE)
|
||||||
dir.push_back(Close);
|
dir.push_back(CLOSE);
|
||||||
else if (argv[i]==NAME_SHADE)
|
else if (argv[i]==NAME_SHADE)
|
||||||
dir.push_back(Shade);
|
dir.push_back(SHADE);
|
||||||
else if (argv[i]==NAME_MENU)
|
else if (argv[i]==NAME_MENU)
|
||||||
dir.push_back(Menu);
|
dir.push_back(MENU);
|
||||||
else if(argv[i]==NAME_NONE);//do nothing
|
else if(argv[i]==NAME_NONE);//do nothing
|
||||||
else
|
else
|
||||||
cerr<<"Fluxbox::Titlebar Unknown type: \""<<argv[i]<<"\""<<endl;
|
cerr<<"Fluxbox::Titlebar Unknown type: \""<<argv[i]<<"\""<<endl;
|
||||||
|
@ -1890,7 +1928,7 @@ void Fluxbox::loadTitlebar() {
|
||||||
cerr<<"Fluxbox: \'Left\' not found in "<<resource.titlebar_file<<endl;
|
cerr<<"Fluxbox: \'Left\' not found in "<<resource.titlebar_file<<endl;
|
||||||
cerr<<"Using default."<<endl;
|
cerr<<"Using default."<<endl;
|
||||||
//default settings
|
//default settings
|
||||||
titlebar.left.push_back(Shade);
|
titlebar.left.push_back(SHADE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XrmGetResource(database, "right", "Right", &value_type, &value)) {
|
if (XrmGetResource(database, "right", "Right", &value_type, &value)) {
|
||||||
|
@ -1899,10 +1937,10 @@ void Fluxbox::loadTitlebar() {
|
||||||
cerr<<"Fluxbox: \'Right\' not found in "<<resource.titlebar_file<<endl;
|
cerr<<"Fluxbox: \'Right\' not found in "<<resource.titlebar_file<<endl;
|
||||||
cerr<<"Using default."<<endl;
|
cerr<<"Using default."<<endl;
|
||||||
//default settings
|
//default settings
|
||||||
titlebar.right.push_back(Stick);
|
titlebar.right.push_back(STICK);
|
||||||
titlebar.right.push_back(Minimize);
|
titlebar.right.push_back(MINIMIZE);
|
||||||
titlebar.right.push_back(Maximize);
|
titlebar.right.push_back(MAXIMIZE);
|
||||||
titlebar.right.push_back(Close);
|
titlebar.right.push_back(CLOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XrmDestroyDatabase(database);
|
// XrmDestroyDatabase(database);
|
||||||
|
@ -1921,7 +1959,6 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
char *value_type, name_lookup[1024], class_lookup[1024];
|
char *value_type, name_lookup[1024], class_lookup[1024];
|
||||||
int screen_number = screen->getScreenNumber();
|
int screen_number = screen->getScreenNumber();
|
||||||
|
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.fullMaximization", screen_number);
|
sprintf(name_lookup, "session.screen%d.fullMaximization", screen_number);
|
||||||
sprintf(class_lookup, "Session.Screen%d.FullMaximization", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.FullMaximization", screen_number);
|
||||||
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
||||||
|
@ -1968,7 +2005,7 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
if (! strncasecmp(value.addr, "righttoleft", value.size))
|
if (! strncasecmp(value.addr, "righttoleft", value.size))
|
||||||
screen->saveRowPlacementDirection(BScreen::RightLeft);
|
screen->saveRowPlacementDirection(BScreen::RIGHTLEFT);
|
||||||
else
|
else
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.maxOverSlit", screen_number);
|
sprintf(name_lookup, "session.screen%d.maxOverSlit", screen_number);
|
||||||
|
@ -1981,20 +2018,20 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
screen->saveMaxOverSlit(False);
|
screen->saveMaxOverSlit(False);
|
||||||
} else
|
} else
|
||||||
screen->saveMaxOverSlit(False);
|
screen->saveMaxOverSlit(False);
|
||||||
screen->saveRowPlacementDirection(BScreen::LeftRight);
|
screen->saveRowPlacementDirection(BScreen::LEFTRIGHT);
|
||||||
} else
|
} else
|
||||||
screen->saveRowPlacementDirection(BScreen::LeftRight);
|
screen->saveRowPlacementDirection(BScreen::LEFTRIGHT);
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.colPlacementDirection", screen_number);
|
sprintf(name_lookup, "session.screen%d.colPlacementDirection", screen_number);
|
||||||
sprintf(class_lookup, "Session.Screen%d.ColPlacementDirection", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.ColPlacementDirection", screen_number);
|
||||||
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
if (! strncasecmp(value.addr, "bottomtotop", value.size))
|
if (! strncasecmp(value.addr, "bottomtotop", value.size))
|
||||||
screen->saveColPlacementDirection(BScreen::BottomTop);
|
screen->saveColPlacementDirection(BScreen::BOTTOMTOP);
|
||||||
else
|
else
|
||||||
screen->saveColPlacementDirection(BScreen::TopBottom);
|
screen->saveColPlacementDirection(BScreen::TOPBOTTOM);
|
||||||
} else
|
} else
|
||||||
screen->saveColPlacementDirection(BScreen::TopBottom);
|
screen->saveColPlacementDirection(BScreen::TOPBOTTOM);
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.workspaces", screen_number);
|
sprintf(name_lookup, "session.screen%d.workspaces", screen_number);
|
||||||
sprintf(class_lookup, "Session.Screen%d.Workspaces", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.Workspaces", screen_number);
|
||||||
|
@ -2128,13 +2165,13 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
||||||
&value))
|
&value))
|
||||||
if (! strncasecmp(value.addr, "RowSmartPlacement", value.size))
|
if (! strncasecmp(value.addr, "RowSmartPlacement", value.size))
|
||||||
screen->savePlacementPolicy(BScreen::RowSmartPlacement);
|
screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT);
|
||||||
else if (! strncasecmp(value.addr, "ColSmartPlacement", value.size))
|
else if (! strncasecmp(value.addr, "ColSmartPlacement", value.size))
|
||||||
screen->savePlacementPolicy(BScreen::ColSmartPlacement);
|
screen->savePlacementPolicy(BScreen::COLSMARTPLACEMENT);
|
||||||
else
|
else
|
||||||
screen->savePlacementPolicy(BScreen::CascadePlacement);
|
screen->savePlacementPolicy(BScreen::CASCADEPLACEMENT);
|
||||||
else
|
else
|
||||||
screen->savePlacementPolicy(BScreen::RowSmartPlacement);
|
screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT);
|
||||||
|
|
||||||
#ifdef SLIT
|
#ifdef SLIT
|
||||||
sprintf(name_lookup, "session.screen%d.slit.placement", screen_number);
|
sprintf(name_lookup, "session.screen%d.slit.placement", screen_number);
|
||||||
|
@ -2142,34 +2179,34 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
||||||
&value))
|
&value))
|
||||||
if (! strncasecmp(value.addr, "TopLeft", value.size))
|
if (! strncasecmp(value.addr, "TopLeft", value.size))
|
||||||
screen->saveSlitPlacement(Slit::TopLeft);
|
screen->saveSlitPlacement(Slit::TOPLEFT);
|
||||||
else if (! strncasecmp(value.addr, "CenterLeft", value.size))
|
else if (! strncasecmp(value.addr, "CenterLeft", value.size))
|
||||||
screen->saveSlitPlacement(Slit::CenterLeft);
|
screen->saveSlitPlacement(Slit::CENTERLEFT);
|
||||||
else if (! strncasecmp(value.addr, "BottomLeft", value.size))
|
else if (! strncasecmp(value.addr, "BottomLeft", value.size))
|
||||||
screen->saveSlitPlacement(Slit::BottomLeft);
|
screen->saveSlitPlacement(Slit::BOTTOMLEFT);
|
||||||
else if (! strncasecmp(value.addr, "TopCenter", value.size))
|
else if (! strncasecmp(value.addr, "TopCenter", value.size))
|
||||||
screen->saveSlitPlacement(Slit::TopCenter);
|
screen->saveSlitPlacement(Slit::TOPCENTER);
|
||||||
else if (! strncasecmp(value.addr, "BottomCenter", value.size))
|
else if (! strncasecmp(value.addr, "BottomCenter", value.size))
|
||||||
screen->saveSlitPlacement(Slit::BottomCenter);
|
screen->saveSlitPlacement(Slit::BOTTOMCENTER);
|
||||||
else if (! strncasecmp(value.addr, "TopRight", value.size))
|
else if (! strncasecmp(value.addr, "TopRight", value.size))
|
||||||
screen->saveSlitPlacement(Slit::TopRight);
|
screen->saveSlitPlacement(Slit::TOPRIGHT);
|
||||||
else if (! strncasecmp(value.addr, "BottomRight", value.size))
|
else if (! strncasecmp(value.addr, "BottomRight", value.size))
|
||||||
screen->saveSlitPlacement(Slit::BottomRight);
|
screen->saveSlitPlacement(Slit::BOTTOMRIGHT);
|
||||||
else
|
else
|
||||||
screen->saveSlitPlacement(Slit::CenterRight);
|
screen->saveSlitPlacement(Slit::CENTERRIGHT);
|
||||||
else
|
else
|
||||||
screen->saveSlitPlacement(Slit::CenterRight);
|
screen->saveSlitPlacement(Slit::CENTERRIGHT);
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.slit.direction", screen_number);
|
sprintf(name_lookup, "session.screen%d.slit.direction", screen_number);
|
||||||
sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number);
|
||||||
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(database, name_lookup, class_lookup, &value_type,
|
||||||
&value))
|
&value))
|
||||||
if (! strncasecmp(value.addr, "Horizontal", value.size))
|
if (! strncasecmp(value.addr, "Horizontal", value.size))
|
||||||
screen->saveSlitDirection(Slit::Horizontal);
|
screen->saveSlitDirection(Slit::HORIZONTAL);
|
||||||
else
|
else
|
||||||
screen->saveSlitDirection(Slit::Vertical);
|
screen->saveSlitDirection(Slit::VERTICAL);
|
||||||
else
|
else
|
||||||
screen->saveSlitDirection(Slit::Vertical);
|
screen->saveSlitDirection(Slit::VERTICAL);
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.slit.onTop", screen_number);
|
sprintf(name_lookup, "session.screen%d.slit.onTop", screen_number);
|
||||||
sprintf(class_lookup, "Session.Screen%d.Slit.OnTop", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.Slit.OnTop", screen_number);
|
||||||
|
@ -2359,6 +2396,7 @@ void Fluxbox::loadRootCommand(BScreen *screen) {
|
||||||
screen->saveRootCommand("");
|
screen->saveRootCommand("");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fluxbox::reload_rc(void) {
|
void Fluxbox::reload_rc(void) {
|
||||||
load_rc();
|
load_rc();
|
||||||
reconfigure();
|
reconfigure();
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: fluxbox.hh,v 1.5 2002/01/10 12:51:21 fluxgen Exp $
|
// $Id: fluxbox.hh,v 1.6 2002/01/11 09:18:58 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef _FLUXBOX_HH_
|
#ifndef _FLUXBOX_HH_
|
||||||
#define _FLUXBOX_HH_
|
#define _FLUXBOX_HH_
|
||||||
|
@ -122,7 +122,7 @@ public:
|
||||||
Toolbar *searchToolbar(Window);
|
Toolbar *searchToolbar(Window);
|
||||||
Tab *searchTab(Window);
|
Tab *searchTab(Window);
|
||||||
|
|
||||||
enum Titlebar{Shade=0, Minimize, Maximize, Close, Stick, Menu, Empty};
|
enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENU, EMPTY};
|
||||||
|
|
||||||
inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() { return titlebar.right; }
|
inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() { return titlebar.right; }
|
||||||
inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() { return titlebar.left; }
|
inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() { return titlebar.left; }
|
||||||
|
@ -184,7 +184,7 @@ public:
|
||||||
|
|
||||||
#ifndef HAVE_STRFTIME
|
#ifndef HAVE_STRFTIME
|
||||||
|
|
||||||
enum { B_AmericanDate = 1, B_EuropeanDate };
|
enum { B_AMERICANDATE = 1, B_EUROPEANDATE };
|
||||||
#endif // HAVE_STRFTIME
|
#endif // HAVE_STRFTIME
|
||||||
|
|
||||||
template <class Z>
|
template <class Z>
|
||||||
|
|
Loading…
Reference in a new issue