fixed enums

This commit is contained in:
fluxgen 2002-01-11 10:21:44 +00:00
parent 1e6a318f25
commit 17f438db1e
4 changed files with 55 additions and 54 deletions

View file

@ -195,7 +195,7 @@ rootcommand("")
image_control->setDither(resource.image_dither); image_control->setDither(resource.image_dither);
theme = new Theme(getBaseDisplay()->getXDisplay(), getRootWindow(), getColormap(), getScreenNumber(), theme = new Theme(getBaseDisplay()->getXDisplay(), getRootWindow(), getColormap(), getScreenNumber(),
image_control, fluxbox->getStyleFilename(), getRootCommand().c_str()); image_control, fluxbox->getStyleFilename(), getRootCommand().c_str());
#ifdef GNOME #ifdef GNOME
/* create the GNOME window */ /* create the GNOME window */
Window gnome_win = XCreateSimpleWindow(getBaseDisplay()->getXDisplay(), Window gnome_win = XCreateSimpleWindow(getBaseDisplay()->getXDisplay(),
@ -205,12 +205,13 @@ rootcommand("")
XChangeProperty(getBaseDisplay()->getXDisplay(), XChangeProperty(getBaseDisplay()->getXDisplay(),
getRootWindow(), getBaseDisplay()->getGnomeSupportingWMCheckAtom(), getRootWindow(), getBaseDisplay()->getGnomeSupportingWMCheckAtom(),
XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1);
XChangeProperty(getBaseDisplay()->getXDisplay(), gnome_win, XChangeProperty(getBaseDisplay()->getXDisplay(), gnome_win,
getBaseDisplay()->getGnomeSupportingWMCheckAtom(), getBaseDisplay()->getGnomeSupportingWMCheckAtom(),
XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1);
Atom gnomeatomlist[1] = {getBaseDisplay()->getGnomeWorkspaceAtom()}; Atom gnomeatomlist[1] = {getBaseDisplay()->getGnomeWorkspaceAtom()};
XChangeProperty(getBaseDisplay()->getXDisplay(), XChangeProperty(getBaseDisplay()->getXDisplay(),
getRootWindow(), getBaseDisplay()->getGnomeProtAtom(), getRootWindow(), getBaseDisplay()->getGnomeProtAtom(),
XA_ATOM, 32, PropModeReplace, XA_ATOM, 32, PropModeReplace,
@ -1055,7 +1056,7 @@ void BScreen::InitMenu(void) {
0, 0, 0, 0,
#endif // NLS #endif // NLS
"xterm"), "xterm"),
BScreen::Execute, BScreen::EXECUTE,
i18n->getMessage( i18n->getMessage(
#ifdef NLS #ifdef NLS
ScreenSet, Screenxterm, ScreenSet, Screenxterm,
@ -1070,7 +1071,7 @@ void BScreen::InitMenu(void) {
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Restart"), "Restart"),
BScreen::Restart); BScreen::RESTART);
rootmenu->insert(i18n->getMessage( rootmenu->insert(i18n->getMessage(
#ifdef NLS #ifdef NLS
ScreenSet, ScreenExit, ScreenSet, ScreenExit,
@ -1078,7 +1079,7 @@ void BScreen::InitMenu(void) {
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Exit"), "Exit"),
BScreen::Exit); BScreen::EXIT);
} else } else
fluxbox->saveMenuFilename(fluxbox->getMenuFilename()); fluxbox->saveMenuFilename(fluxbox->getMenuFilename());
} }
@ -1181,7 +1182,7 @@ Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) {
continue; continue;
} }
menu->insert(label, BScreen::Execute, command); menu->insert(label, BScreen::EXECUTE, command);
break; break;
case 442: // exit case 442: // exit
@ -1198,7 +1199,7 @@ Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) {
continue; continue;
} }
menu->insert(label, BScreen::Exit); menu->insert(label, BScreen::EXIT);
break; break;
case 561: // style case 561: // style
@ -1238,7 +1239,7 @@ Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) {
*(style + command_length) = '\0'; *(style + command_length) = '\0';
} }
menu->insert(label, BScreen::SetStyle, style); menu->insert(label, BScreen::SETSTYLE, style);
} }
break; break;
@ -1380,9 +1381,9 @@ Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) {
} }
if (*command) if (*command)
menu->insert(label, BScreen::RestartOther, command); menu->insert(label, BScreen::RESTARTOTHER, command);
else else
menu->insert(label, BScreen::Restart); menu->insert(label, BScreen::RESTART);
} }
break; break;
@ -1403,7 +1404,7 @@ Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) {
continue; continue;
} }
menu->insert(label, BScreen::Reconfigure); menu->insert(label, BScreen::RECONFIGURE);
} }
break; break;
@ -1488,7 +1489,7 @@ Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) {
strncpy(style + slen + 1, ls[n], nlen + 1); strncpy(style + slen + 1, ls[n], nlen + 1);
if ((! stat(style, &statbuf)) && S_ISREG(statbuf.st_mode)) if ((! stat(style, &statbuf)) && S_ISREG(statbuf.st_mode))
stylesmenu->insert(ls[n], BScreen::SetStyle, style); stylesmenu->insert(ls[n], BScreen::SETSTYLE, style);
delete [] ls[n]; delete [] ls[n];
} }

View file

@ -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: Screen.hh,v 1.8 2002/01/10 12:49:15 fluxgen Exp $ // $Id: Screen.hh,v 1.9 2002/01/11 10:20:00 fluxgen Exp $
#ifndef _SCREEN_HH_ #ifndef _SCREEN_HH_
#define _SCREEN_HH_ #define _SCREEN_HH_
@ -270,13 +270,13 @@ public:
void updateNetizenWindowRaise(Window); void updateNetizenWindowRaise(Window);
void updateNetizenWindowLower(Window); void updateNetizenWindowLower(Window);
enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement, LeftRight, enum { ROWSMARTPLACEMENT = 1, COLSMARTPLACEMENT, CASCADEPLACEMENT, LEFTRIGHT,
RightLeft, TopBottom, BottomTop }; RIGHTLEFT, TOPBOTTOM, BOTTOMTOP };
enum { LeftJustify = 1, RightJustify, CenterJustify }; enum { LEFTJUSTIFY = 1, RIGHTJUSTIFY, CENTERJUSTIFY };
enum { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet }; enum { ROUNDBULLET = 1, TRIANGELBULLET, SQUAERBULLET, NOBULLET };
enum { Restart = 1, RestartOther, Exit, Shutdown, Execute, Reconfigure, enum { RESTART = 1, RESTARTOTHER, EXIT, SHUTDOWN, EXECUTE, RECONFIGURE,
WindowShade, WindowIconify, WindowMaximize, WindowClose, WindowRaise, WINDOWSHADE, WINDOWICONIFY, WINDOWMAXIMIZE, WINDOWCLOSE, WINDOWRAISE,
WindowLower, WindowStick, WindowKill, SetStyle, WindowTab}; WINDOWLOWER, WINDOWSTICK, WINDOWKILL, SETSTYLE, WINDOWTAB};
private: private:
Theme *theme; Theme *theme;

View file

@ -255,7 +255,7 @@ void Slit::reconfigure(void) {
LinkedListIterator<SlitClient> it(clientList); LinkedListIterator<SlitClient> it(clientList);
switch (screen->getSlitDirection()) { switch (screen->getSlitDirection()) {
case Vertical: case VERTICAL:
for (; it.current(); it++) { for (; it.current(); it++) {
frame.height += it.current()->height + screen->getBevelWidth(); frame.height += it.current()->height + screen->getBevelWidth();
@ -275,7 +275,7 @@ void Slit::reconfigure(void) {
break; break;
case Horizontal: case HORIZONTAL:
for (; it.current(); it++) { for (; it.current(); it++) {
frame.width += it.current()->width + screen->getBevelWidth(); frame.width += it.current()->width + screen->getBevelWidth();
@ -326,7 +326,7 @@ void Slit::reconfigure(void) {
it.reset(); it.reset();
switch (screen->getSlitDirection()) { switch (screen->getSlitDirection()) {
case Vertical: case VERTICAL:
x = 0; x = 0;
y = screen->getBevelWidth(); y = screen->getBevelWidth();
@ -363,7 +363,7 @@ void Slit::reconfigure(void) {
break; break;
case Horizontal: case HORIZONTAL:
x = screen->getBevelWidth(); x = screen->getBevelWidth();
y = 0; y = 0;
@ -408,10 +408,10 @@ void Slit::reconfigure(void) {
void Slit::reposition(void) { void Slit::reposition(void) {
// place the slit in the appropriate place // place the slit in the appropriate place
switch (screen->getSlitPlacement()) { switch (screen->getSlitPlacement()) {
case TopLeft: case TOPLEFT:
frame.x = 0; frame.x = 0;
frame.y = 0; frame.y = 0;
if (screen->getSlitDirection() == Vertical) { if (screen->getSlitDirection() == VERTICAL) {
frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth()
- frame.width; - frame.width;
frame.y_hidden = 0; frame.y_hidden = 0;
@ -422,7 +422,7 @@ void Slit::reposition(void) {
} }
break; break;
case CenterLeft: case CENTERLEFT:
frame.x = 0; frame.x = 0;
frame.y = (screen->getHeight() - frame.height) / 2; frame.y = (screen->getHeight() - frame.height) / 2;
frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth()
@ -430,10 +430,10 @@ void Slit::reposition(void) {
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
break; break;
case BottomLeft: case BOTTOMLEFT:
frame.x = 0; frame.x = 0;
frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x();
if (screen->getSlitDirection() == Vertical) { if (screen->getSlitDirection() == VERTICAL) {
frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth()
- frame.width; - frame.width;
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
@ -444,7 +444,7 @@ void Slit::reposition(void) {
} }
break; break;
case TopCenter: case TOPCENTER:
frame.x = (screen->getWidth() - frame.width) / 2; frame.x = (screen->getWidth() - frame.width) / 2;
frame.y = 0; frame.y = 0;
frame.x_hidden = frame.x; frame.x_hidden = frame.x;
@ -452,7 +452,7 @@ void Slit::reposition(void) {
- frame.height; - frame.height;
break; break;
case BottomCenter: case BOTTOMCENTER:
frame.x = (screen->getWidth() - frame.width) / 2; frame.x = (screen->getWidth() - frame.width) / 2;
frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x();
frame.x_hidden = frame.x; frame.x_hidden = frame.x;
@ -460,10 +460,10 @@ void Slit::reposition(void) {
- screen->getBorderWidth(); - screen->getBorderWidth();
break; break;
case TopRight: case TOPRIGHT:
frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x();
frame.y = 0; frame.y = 0;
if (screen->getSlitDirection() == Vertical) { if (screen->getSlitDirection() == VERTICAL) {
frame.x_hidden = screen->getWidth() - screen->getBevelWidth() frame.x_hidden = screen->getWidth() - screen->getBevelWidth()
- screen->getBorderWidth(); - screen->getBorderWidth();
frame.y_hidden = 0; frame.y_hidden = 0;
@ -474,7 +474,7 @@ void Slit::reposition(void) {
} }
break; break;
case CenterRight: case CENTERRIGHT:
default: default:
frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x();
frame.y = (screen->getHeight() - frame.height) / 2; frame.y = (screen->getHeight() - frame.height) / 2;
@ -483,10 +483,10 @@ void Slit::reposition(void) {
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
break; break;
case BottomRight: case BOTTOMRIGHT:
frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x();
frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x();
if (screen->getSlitDirection() == Vertical) { if (screen->getSlitDirection() == VERTICAL) {
frame.x_hidden = screen->getWidth() - screen->getBevelWidth() frame.x_hidden = screen->getWidth() - screen->getBevelWidth()
- screen->getBorderWidth(); - screen->getBorderWidth();
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
@ -508,13 +508,13 @@ void Slit::reposition(void) {
tbar->getY() < frame.y + sh && tbar->getY() + th > frame.y) { tbar->getY() < frame.y + sh && tbar->getY() + th > frame.y) {
if (frame.y < th) { if (frame.y < th) {
frame.y += tbar->getExposedHeight(); frame.y += tbar->getExposedHeight();
if (screen->getSlitDirection() == Vertical) if (screen->getSlitDirection() == VERTICAL)
frame.y_hidden += tbar->getExposedHeight(); frame.y_hidden += tbar->getExposedHeight();
else else
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
} else { } else {
frame.y -= tbar->getExposedHeight(); frame.y -= tbar->getExposedHeight();
if (screen->getSlitDirection() == Vertical) if (screen->getSlitDirection() == VERTICAL)
frame.y_hidden -= tbar->getExposedHeight(); frame.y_hidden -= tbar->getExposedHeight();
else else
frame.y_hidden = frame.y; frame.y_hidden = frame.y;
@ -764,7 +764,7 @@ Slitmenu::Directionmenu::Directionmenu(Slitmenu *sm) : Basemenu(sm->slit->screen
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Horizontal"), "Horizontal"),
Slit::Horizontal); Slit::HORIZONTAL);
insert(i18n->getMessage( insert(i18n->getMessage(
#ifdef NLS #ifdef NLS
CommonSet, CommonDirectionVert, CommonSet, CommonDirectionVert,
@ -772,11 +772,11 @@ Slitmenu::Directionmenu::Directionmenu(Slitmenu *sm) : Basemenu(sm->slit->screen
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Vertical"), "Vertical"),
Slit::Vertical); Slit::VERTICAL);
update(); update();
if (sm->slit->screen->getSlitDirection() == Slit::Horizontal) if (sm->slit->screen->getSlitDirection() == Slit::HORIZONTAL)
setItemSelected(0, True); setItemSelected(0, True);
else else
setItemSelected(1, True); setItemSelected(1, True);
@ -790,7 +790,7 @@ void Slitmenu::Directionmenu::itemSelected(int button, int index) {
slitmenu->slit->screen->saveSlitDirection(item->function()); slitmenu->slit->screen->saveSlitDirection(item->function());
if (item->function() == Slit::Horizontal) { if (item->function() == Slit::HORIZONTAL) {
setItemSelected(0, True); setItemSelected(0, True);
setItemSelected(1, False); setItemSelected(1, False);
} else { } else {
@ -825,7 +825,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Top Left"), "Top Left"),
Slit::TopLeft); Slit::TOPLEFT);
insert(i18n->getMessage( insert(i18n->getMessage(
#ifdef NLS #ifdef NLS
CommonSet, CommonPlacementCenterLeft, CommonSet, CommonPlacementCenterLeft,
@ -833,7 +833,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Center Left"), "Center Left"),
Slit::CenterLeft); Slit::CENTERLEFT);
insert(i18n->getMessage( insert(i18n->getMessage(
#ifdef NLS #ifdef NLS
CommonSet, CommonPlacementBottomLeft, CommonSet, CommonPlacementBottomLeft,
@ -841,7 +841,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Bottom Left"), "Bottom Left"),
Slit::BottomLeft); Slit::BOTTOMLEFT);
insert(i18n->getMessage( insert(i18n->getMessage(
#ifdef NLS #ifdef NLS
CommonSet, CommonPlacementTopCenter, CommonSet, CommonPlacementTopCenter,
@ -849,7 +849,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Top Center"), "Top Center"),
Slit::TopCenter); Slit::TOPCENTER);
insert(""); insert("");
insert(i18n->getMessage( insert(i18n->getMessage(
#ifdef NLS #ifdef NLS
@ -858,7 +858,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Bottom Center"), "Bottom Center"),
Slit::BottomCenter); Slit::BOTTOMCENTER);
insert(i18n->getMessage( insert(i18n->getMessage(
#ifdef NLS #ifdef NLS
CommonSet, CommonPlacementTopRight, CommonSet, CommonPlacementTopRight,
@ -866,7 +866,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Top Right"), "Top Right"),
Slit::TopRight); Slit::TOPRIGHT);
insert(i18n->getMessage( insert(i18n->getMessage(
#ifdef NLS #ifdef NLS
CommonSet, CommonPlacementCenterRight, CommonSet, CommonPlacementCenterRight,
@ -874,7 +874,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Center Right"), "Center Right"),
Slit::CenterRight); Slit::CENTERRIGHT);
insert(i18n->getMessage( insert(i18n->getMessage(
#ifdef NLS #ifdef NLS
CommonSet, CommonPlacementBottomRight, CommonSet, CommonPlacementBottomRight,
@ -882,7 +882,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen
0, 0, 0, 0,
#endif // NLS #endif // NLS
"Bottom Right"), "Bottom Right"),
Slit::BottomRight); Slit::BOTTOMRIGHT);
update(); update();
} }

View file

@ -150,9 +150,9 @@ public:
virtual void timeout(void); virtual void timeout(void);
enum { Vertical = 1, Horizontal }; enum { VERTICAL = 1, HORIZONTAL };
enum { TopLeft = 1, CenterLeft, BottomLeft, TopCenter, BottomCenter, enum { TOPLEFT = 1, CENTERLEFT, BOTTOMLEFT, TOPCENTER, BOTTOMCENTER,
TopRight, CenterRight, BottomRight }; TOPRIGHT, CENTERRIGHT, BOTTOMRIGHT };
}; };