fixed enums

This commit is contained in:
fluxgen 2002-01-11 10:43:55 +00:00
parent 17f438db1e
commit 06245dca91
3 changed files with 26 additions and 28 deletions

View file

@ -41,7 +41,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: Theme.cc,v 1.13 2002/01/09 14:11:20 fluxgen Exp $ // $Id: Theme.cc,v 1.14 2002/01/11 10:43:55 fluxgen Exp $
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
#define _GNU_SOURCE #define _GNU_SOURCE
@ -69,7 +69,6 @@
#include <iostream> #include <iostream>
using namespace std; using namespace std;
Theme::Theme(Display *display, Window rootwindow, Colormap colormap, Theme::Theme(Display *display, Window rootwindow, Colormap colormap,
int screennum, BImageControl *ic, const char *filename, const char *rootcommand): int screennum, BImageControl *ic, const char *filename, const char *rootcommand):
m_imagecontrol(ic), m_imagecontrol(ic),
@ -78,7 +77,6 @@ m_colormap(colormap),
m_screennum(screennum), m_screennum(screennum),
m_rootcommand(rootcommand==0 ? "" : rootcommand) //we dont want to send 0-pointer to std::string m_rootcommand(rootcommand==0 ? "" : rootcommand) //we dont want to send 0-pointer to std::string
{ {
//default settings //default settings
m_menustyle.titlefont.set = m_menustyle.framefont.set = m_toolbarstyle.font.set = m_menustyle.titlefont.set = m_menustyle.framefont.set = m_toolbarstyle.font.set =
m_windowstyle.font.set = m_windowstyle.tab.font.set = 0; m_windowstyle.font.set = m_windowstyle.tab.font.set = 0;
@ -362,27 +360,27 @@ void Theme::loadMenuStyle() {
&value_type, &value)) { &value_type, &value)) {
if (! strncasecmp(value.addr, "empty", value.size)) if (! strncasecmp(value.addr, "empty", value.size))
m_menustyle.bullet = Basemenu::Empty; m_menustyle.bullet = Basemenu::EMPTY;
else if (! strncasecmp(value.addr, "square", value.size)) else if (! strncasecmp(value.addr, "square", value.size))
m_menustyle.bullet = Basemenu::Square; m_menustyle.bullet = Basemenu::SQUARE;
else if (! strncasecmp(value.addr, "diamond", value.size)) else if (! strncasecmp(value.addr, "diamond", value.size))
m_menustyle.bullet = Basemenu::Diamond; m_menustyle.bullet = Basemenu::DIAMOND;
else else
m_menustyle.bullet = Basemenu::Triangle; m_menustyle.bullet = Basemenu::TRIANGLE;
} else } else
m_menustyle.bullet = Basemenu::Triangle; m_menustyle.bullet = Basemenu::TRIANGLE;
if (XrmGetResource(m_database, "menu.bullet.position", if (XrmGetResource(m_database, "menu.bullet.position",
"Menu.Bullet.Position", &value_type, &value)) { "Menu.Bullet.Position", &value_type, &value)) {
if (! strncasecmp(value.addr, "right", value.size)) if (! strncasecmp(value.addr, "right", value.size))
m_menustyle.bullet_pos = Basemenu::Right; m_menustyle.bullet_pos = Basemenu::RIGHT;
else else
m_menustyle.bullet_pos = Basemenu::Left; m_menustyle.bullet_pos = Basemenu::LEFT;
} else } else
m_menustyle.bullet_pos = Basemenu::Left; m_menustyle.bullet_pos = Basemenu::LEFT;
//---------- font //---------- font
@ -669,6 +667,7 @@ void Theme::loadRootCommand() {
cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.c_str()<<endl; cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.c_str()<<endl;
bexec(m_rootcommand.c_str(), const_cast<char *>(displaystring.c_str())); bexec(m_rootcommand.c_str(), const_cast<char *>(displaystring.c_str()));
#else // __EMX__ #else // __EMX__
spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", m_rootcommand.c_str(), NULL); spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", m_rootcommand.c_str(), NULL);
#endif // !__EMX__ #endif // !__EMX__
@ -687,12 +686,12 @@ void Theme::loadRootCommand() {
displaystring.append(DisplayString(m_display)); displaystring.append(DisplayString(m_display));
displaystring.append(tmpstring); // append m_screennum displaystring.append(tmpstring); // append m_screennum
cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.c_str()<<endl; cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.c_str()<<endl;
bexec(value.addr, const_cast<char *>(displaystring.c_str())); bexec(value.addr, const_cast<char *>(displaystring.c_str()));
#else // __EMX__ #else // __EMX__
spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", value.addr, NULL); spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", value.addr, NULL);
#endif // !__EMX__ #endif // !__EMX__
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "rootcommand:%s\n", value.addr); fprintf(stderr, "rootcommand:%s\n", value.addr);
#endif #endif
@ -965,7 +964,6 @@ void Theme::readDatabaseFont(char *rname, char *rclass, XFontStruct **font) {
void Theme::reconfigure() { void Theme::reconfigure() {
//Window rootwindow = DefaultRootWindow(m_display);
XGCValues gcv; XGCValues gcv;
unsigned long gc_value_mask = GCForeground; unsigned long gc_value_mask = GCForeground;
if (! I18n::instance()->multibyte()) if (! I18n::instance()->multibyte())

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: Window.hh,v 1.3 2002/01/09 14:11:20 fluxgen Exp $ // $Id: Window.hh,v 1.4 2002/01/11 10:40:59 fluxgen Exp $
#ifndef _WINDOW_HH_ #ifndef _WINDOW_HH_
#define _WINDOW_HH_ #define _WINDOW_HH_
@ -257,7 +257,7 @@ private:
bevel_w, resize_w, resize_h, snap_w, snap_h; bevel_w, resize_w, resize_h, snap_w, snap_h;
} frame; } frame;
enum { F_NoInput = 0, F_Passive, F_LocallyActive, F_GloballyActive }; enum { F_NOINPUT = 0, F_PASSIVE, F_LOCALLYACTIVE, F_GLOBALLYACTIVE };
void createButton(int type, ButtonEventProc, ButtonEventProc, ButtonDrawProc); void createButton(int type, ButtonEventProc, ButtonEventProc, ButtonDrawProc);
Window findTitleButton(int type); Window findTitleButton(int type);

View file

@ -355,27 +355,27 @@ void Workspace::placeWindow(FluxboxWindow *win) {
(screen->getBorderWidth2x() * 2), (screen->getBorderWidth2x() * 2),
place_x = 0, place_y = 0, change_x = 1, change_y = 1; place_x = 0, place_y = 0, change_x = 1, change_y = 1;
if (screen->getColPlacementDirection() == BScreen::BottomTop) if (screen->getColPlacementDirection() == BScreen::BOTTOMTOP)
change_y = -1; change_y = -1;
if (screen->getRowPlacementDirection() == BScreen::RightLeft) if (screen->getRowPlacementDirection() == BScreen::RIGHTLEFT)
change_x = -1; change_x = -1;
register int test_x, test_y, curr_w, curr_h; register int test_x, test_y, curr_w, curr_h;
switch (screen->getPlacementPolicy()) { switch (screen->getPlacementPolicy()) {
case BScreen::RowSmartPlacement: { case BScreen::ROWSMARTPLACEMENT: {
test_y = screen->getBorderWidth() + screen->getEdgeSnapThreshold(); test_y = screen->getBorderWidth() + screen->getEdgeSnapThreshold();
if (screen->getColPlacementDirection() == BScreen::BottomTop) if (screen->getColPlacementDirection() == BScreen::BOTTOMTOP)
test_y = screen->getHeight() - win_h - test_y; test_y = screen->getHeight() - win_h - test_y;
while (((screen->getColPlacementDirection() == BScreen::BottomTop) ? while (((screen->getColPlacementDirection() == BScreen::BOTTOMTOP) ?
test_y > 0 : test_y + win_h < (signed) screen->getHeight()) && test_y > 0 : test_y + win_h < (signed) screen->getHeight()) &&
! placed) { ! placed) {
test_x = screen->getBorderWidth() + screen->getEdgeSnapThreshold(); test_x = screen->getBorderWidth() + screen->getEdgeSnapThreshold();
if (screen->getRowPlacementDirection() == BScreen::RightLeft) if (screen->getRowPlacementDirection() == BScreen::RIGHTLEFT)
test_x = screen->getWidth() - win_w - test_x; test_x = screen->getWidth() - win_w - test_x;
while (((screen->getRowPlacementDirection() == BScreen::RightLeft) ? while (((screen->getRowPlacementDirection() == BScreen::RIGHTLEFT) ?
test_x > 0 : test_x + win_w < (signed) screen->getWidth()) && test_x > 0 : test_x + win_w < (signed) screen->getWidth()) &&
! placed) { ! placed) {
placed = True; placed = True;
@ -425,19 +425,19 @@ void Workspace::placeWindow(FluxboxWindow *win) {
break; } break; }
case BScreen::ColSmartPlacement: { case BScreen::COLSMARTPLACEMENT: {
test_x = screen->getBorderWidth() + screen->getEdgeSnapThreshold(); test_x = screen->getBorderWidth() + screen->getEdgeSnapThreshold();
if (screen->getRowPlacementDirection() == BScreen::RightLeft) if (screen->getRowPlacementDirection() == BScreen::RIGHTLEFT)
test_x = screen->getWidth() - win_w - test_x; test_x = screen->getWidth() - win_w - test_x;
while (((screen->getRowPlacementDirection() == BScreen::RightLeft) ? while (((screen->getRowPlacementDirection() == BScreen::RIGHTLEFT) ?
test_x > 0 : test_x + win_w < (signed) screen->getWidth()) && test_x > 0 : test_x + win_w < (signed) screen->getWidth()) &&
! placed) { ! placed) {
test_y = screen->getBorderWidth() + screen->getEdgeSnapThreshold(); test_y = screen->getBorderWidth() + screen->getEdgeSnapThreshold();
if (screen->getColPlacementDirection() == BScreen::BottomTop) if (screen->getColPlacementDirection() == BScreen::BOTTOMTOP)
test_y = screen->getHeight() - win_h - test_y; test_y = screen->getHeight() - win_h - test_y;
while (((screen->getColPlacementDirection() == BScreen::BottomTop) ? while (((screen->getColPlacementDirection() == BScreen::BOTTOMTOP) ?
test_y > 0 : test_y + win_h < (signed) screen->getHeight()) && test_y > 0 : test_y + win_h < (signed) screen->getHeight()) &&
! placed) { ! placed) {
placed = True; placed = True;