summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-10-15 10:54:40 (GMT)
committerfluxgen <fluxgen>2002-10-15 10:54:40 (GMT)
commita904d7b6b790396d396a57472467d4f2578b4f53 (patch)
tree327b87cde947dae96fa41f9dbe3673b405a5f7bf
parentd565c23cf97e8893f31c7743f867fe6036b7959e (diff)
downloadfluxbox_lack-a904d7b6b790396d396a57472467d4f2578b4f53.zip
fluxbox_lack-a904d7b6b790396d396a57472467d4f2578b4f53.tar.bz2
antialias resource
-rw-r--r--src/Screen.cc76
-rw-r--r--src/Screen.hh14
2 files changed, 32 insertions, 58 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index f2f7af6..f7c3cc8 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.71 2002/10/13 22:30:18 fluxgen Exp $ 25// $Id: Screen.cc,v 1.72 2002/10/15 10:54:40 fluxgen Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -201,6 +201,7 @@ desktop_wheeling(rm, true, scrname+".desktopwheeling", altscrname+".DesktopWheel
201show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"), 201show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"),
202focus_last(rm, true, scrname+".focusLastWindow", altscrname+".FocusLastWindow"), 202focus_last(rm, true, scrname+".focusLastWindow", altscrname+".FocusLastWindow"),
203focus_new(rm, true, scrname+".focusNewWindows", altscrname+".FocusNewWindows"), 203focus_new(rm, true, scrname+".focusNewWindows", altscrname+".FocusNewWindows"),
204antialias(rm, false, scrname+".antialias", altscrname+".Antialias"),
204rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), 205rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
205workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), 206workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"),
206toolbar_width_percent(rm, 65, scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"), 207toolbar_width_percent(rm, 65, scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"),
@@ -256,14 +257,14 @@ resource(rm, screenname, altscreenname)
256 257
257 rootmenu = 0; 258 rootmenu = 0;
258 259
259 #ifdef HAVE_GETPID 260#ifdef HAVE_GETPID
260 pid_t bpid = getpid(); 261 pid_t bpid = getpid();
261 262
262 XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), 263 XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(),
263 fluxbox->getFluxboxPidAtom(), XA_CARDINAL, 264 fluxbox->getFluxboxPidAtom(), XA_CARDINAL,
264 sizeof(pid_t) * 8, PropModeReplace, 265 sizeof(pid_t) * 8, PropModeReplace,
265 (unsigned char *) &bpid, 1); 266 (unsigned char *) &bpid, 1);
266 #endif // HAVE_GETPID 267#endif // HAVE_GETPID
267 268
268 269
269 XDefineCursor(getBaseDisplay()->getXDisplay(), getRootWindow(), 270 XDefineCursor(getBaseDisplay()->getXDisplay(), getRootWindow(),
@@ -282,19 +283,6 @@ resource(rm, screenname, altscreenname)
282 image_control, fluxbox->getStyleFilename(), getRootCommand().c_str()); 283 image_control, fluxbox->getStyleFilename(), getRootCommand().c_str());
283 284
284 285
285 #ifdef NEWWMSPEC
286 Atom netwmsupported[] = {
287// getBaseDisplay()->getNETWMStateAtom(),
288 getBaseDisplay()->getNETNumberOfDesktopsAtom(),
289 getBaseDisplay()->getNETCurrentDesktopAtom(),
290 getBaseDisplay()->getNETSupportingWMCheckAtom(),
291 };
292
293 XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(),
294 getBaseDisplay()->getNETSupportedAtom(), XA_ATOM, 32, PropModeReplace,
295 (unsigned char *)netwmsupported, (sizeof netwmsupported)/sizeof netwmsupported[0]);
296 #endif //!NEWWMSPEC
297
298 const char *s = i18n->getMessage( 286 const char *s = i18n->getMessage(
299 FBNLS::ScreenSet, FBNLS::ScreenPositionLength, 287 FBNLS::ScreenSet, FBNLS::ScreenPositionLength,
300 "0: 0000 x 0: 0000"); 288 "0: 0000 x 0: 0000");
@@ -384,9 +372,9 @@ resource(rm, screenname, altscreenname)
384 372
385 toolbar = new Toolbar(this); 373 toolbar = new Toolbar(this);
386 374
387 #ifdef SLIT 375#ifdef SLIT
388 slit = new Slit(this); 376 slit = new Slit(this);
389 #endif // SLIT 377#endif // SLIT
390 378
391 initMenu(); 379 initMenu();
392 380
@@ -394,9 +382,10 @@ resource(rm, screenname, altscreenname)
394 382
395 //update menus 383 //update menus
396 rootmenu->update(); 384 rootmenu->update();
397 #ifdef SLIT 385#ifdef SLIT
398 slit->reconfigure(); 386 slit->reconfigure();
399 #endif 387#endif // SLIT
388
400 389
401 changeWorkspaceID(0); 390 changeWorkspaceID(0);
402 updateNetizenWorkspaceCount(); 391 updateNetizenWorkspaceCount();
@@ -465,7 +454,7 @@ resource(rm, screenname, altscreenname)
465 454
466 XFree(children); 455 XFree(children);
467 XFlush(getBaseDisplay()->getXDisplay()); 456 XFlush(getBaseDisplay()->getXDisplay());
468 457
469} 458}
470 459
471namespace { 460namespace {
@@ -486,10 +475,6 @@ BScreen::~BScreen() {
486 475
487 removeWorkspaceNames(); 476 removeWorkspaceNames();
488 477
489#ifdef __INTEL_COMPILER
490 //Didn't got icc to work with std::for_each
491 //so we do this by hand.
492
493 Workspaces::iterator w_it = workspacesList.begin(); 478 Workspaces::iterator w_it = workspacesList.begin();
494 Workspaces::iterator w_it_end = workspacesList.end(); 479 Workspaces::iterator w_it_end = workspacesList.end();
495 for(; w_it != w_it_end; ++w_it) { 480 for(; w_it != w_it_end; ++w_it) {
@@ -510,32 +495,13 @@ BScreen::~BScreen() {
510 delete (*n_it); 495 delete (*n_it);
511 } 496 }
512 netizenList.clear(); 497 netizenList.clear();
513
514#else //__INTEL_COMPILER
515 std::for_each(
516 workspacesList.begin(),
517 workspacesList.end(),
518 delete_obj<Workspace>);
519
520 // don't delete items in the rootmenuList?
521
522 std::for_each(
523 iconList.begin(),
524 iconList.end(),
525 delete_obj<FluxboxWindow>);
526
527 std::for_each(
528 netizenList.begin(),
529 netizenList.end(),
530 delete_obj<Netizen>);
531#endif //!__INTEL_COMPILER
532 498
533 delete rootmenu; 499 delete rootmenu;
534 delete workspacemenu; 500 delete workspacemenu;
535 delete iconmenu; 501 delete iconmenu;
536 delete configmenu; 502 delete configmenu;
537 503
538#ifdef SLIT 504#ifdef SLIT
539 delete slit; 505 delete slit;
540#endif // SLIT 506#endif // SLIT
541 507
@@ -547,14 +513,14 @@ BScreen::~BScreen() {
547} 513}
548 514
549void BScreen::reconfigure() { 515void BScreen::reconfigure() {
550 #ifdef DEBUG 516#ifdef DEBUG
551 cerr<<__FILE__<<"("<<__LINE__<<"): BScreen::reconfigure"<<endl; 517 cerr<<__FILE__<<"("<<__LINE__<<"): BScreen::reconfigure"<<endl;
552 #endif 518#endif // DEBUG
553 Fluxbox::instance()->loadRootCommand(this); 519 Fluxbox::instance()->loadRootCommand(this);
554 theme->setRootCommand(getRootCommand()); 520 theme->setRootCommand(getRootCommand());
555 521 theme->reconfigure(*resource.antialias);
556 theme->load(fluxbox->getStyleFilename()); 522 theme->load(fluxbox->getStyleFilename());
557 theme->reconfigure(); 523
558 I18n *i18n = I18n::instance(); 524 I18n *i18n = I18n::instance();
559 525
560 const char *s = i18n->getMessage( 526 const char *s = i18n->getMessage(
@@ -723,6 +689,12 @@ FluxboxWindow *BScreen::getIcon(unsigned int index) {
723 return 0; 689 return 0;
724} 690}
725 691
692void BScreen::setAntialias(bool value) {
693 if (*resource.antialias == value)
694 return;
695 resource.antialias = value;
696 reconfigure();
697}
726 698
727int BScreen::addWorkspace() { 699int BScreen::addWorkspace() {
728 Workspace *wkspc = new Workspace(this, workspacesList.size()); 700 Workspace *wkspc = new Workspace(this, workspacesList.size());
@@ -1024,9 +996,9 @@ void BScreen::raiseWindows(const Workspace::Stack &workspace_stack) {
1024 996
1025 session_stack[i++] = workspacemenu->windowID(); 997 session_stack[i++] = workspacemenu->windowID();
1026 998
1027 session_stack[i++] = configmenu->getFocusmenu()->windowID(); 999 session_stack[i++] = configmenu->focusmenu().windowID();
1028 session_stack[i++] = configmenu->getPlacementmenu()->windowID(); 1000 session_stack[i++] = configmenu->placementmenu().windowID();
1029 session_stack[i++] = configmenu->getTabmenu()->windowID(); 1001 session_stack[i++] = configmenu->tabmenu().windowID();
1030 session_stack[i++] = configmenu->windowID(); 1002 session_stack[i++] = configmenu->windowID();
1031 1003
1032 #ifdef SLIT 1004 #ifdef SLIT
diff --git a/src/Screen.hh b/src/Screen.hh
index eb6ad6d..60883c1 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.hh,v 1.46 2002/10/13 22:29:25 fluxgen Exp $ 25// $Id: Screen.hh,v 1.47 2002/10/15 10:54:40 fluxgen Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -94,7 +94,7 @@ public:
94 inline bool doFocusNew() const { return *resource.focus_new; } 94 inline bool doFocusNew() const { return *resource.focus_new; }
95 inline bool doFocusLast() const { return *resource.focus_last; } 95 inline bool doFocusLast() const { return *resource.focus_last; }
96 inline bool doShowWindowPos() const { return *resource.show_window_pos; } 96 inline bool doShowWindowPos() const { return *resource.show_window_pos; }
97 97 bool antialias() const { return *resource.antialias; }
98 inline GC getOpGC() const { return theme->getOpGC(); } 98 inline GC getOpGC() const { return theme->getOpGC(); }
99 99
100 inline const FbTk::Color *getBorderColor() const { return &theme->getBorderColor(); } 100 inline const FbTk::Color *getBorderColor() const { return &theme->getBorderColor(); }
@@ -105,6 +105,7 @@ public:
105 inline bool isSlitOnTop() const { return resource.slit_on_top; } 105 inline bool isSlitOnTop() const { return resource.slit_on_top; }
106 inline bool doSlitAutoHide() const { return resource.slit_auto_hide; } 106 inline bool doSlitAutoHide() const { return resource.slit_auto_hide; }
107 inline Slit *getSlit() { return slit; } 107 inline Slit *getSlit() { return slit; }
108 inline const Slit *getSlit() const { return slit; }
108 inline int getSlitPlacement() const { return resource.slit_placement; } 109 inline int getSlitPlacement() const { return resource.slit_placement; }
109 inline int getSlitDirection() const { return resource.slit_direction; } 110 inline int getSlitDirection() const { return resource.slit_direction; }
110 inline void saveSlitPlacement(int p) { resource.slit_placement = p; } 111 inline void saveSlitPlacement(int p) { resource.slit_placement = p; }
@@ -203,7 +204,7 @@ public:
203 inline void iconUpdate() { iconmenu->update(); } 204 inline void iconUpdate() { iconmenu->update(); }
204 inline Iconmenu *getIconmenu() { return iconmenu; } 205 inline Iconmenu *getIconmenu() { return iconmenu; }
205 inline void setAutoGroupWindow(Window w = 0) { auto_group_window = w; } 206 inline void setAutoGroupWindow(Window w = 0) { auto_group_window = w; }
206 207 void setAntialias(bool value);
207 208
208 #ifdef HAVE_STRFTIME 209 #ifdef HAVE_STRFTIME
209 inline const char *getStrftimeFormat() { return resource.strftime_format.c_str(); } 210 inline const char *getStrftimeFormat() { return resource.strftime_format.c_str(); }
@@ -212,7 +213,7 @@ public:
212 inline int getDateFormat() { return resource.date_format; } 213 inline int getDateFormat() { return resource.date_format; }
213 inline void saveDateFormat(int f) { resource.date_format = f; } 214 inline void saveDateFormat(int f) { resource.date_format = f; }
214 inline bool isClock24Hour() { return resource.clock24hour; } 215 inline bool isClock24Hour() { return resource.clock24hour; }
215 inline void saveClock24Hour(Bool c) { resource.clock24hour = c; } 216 inline void saveClock24Hour(bool c) { resource.clock24hour = c; }
216 #endif // HAVE_STRFTIME 217 #endif // HAVE_STRFTIME
217 218
218 inline Theme::WindowStyle *getWindowStyle() { return &theme->getWindowStyle(); } 219 inline Theme::WindowStyle *getWindowStyle() { return &theme->getWindowStyle(); }
@@ -344,7 +345,8 @@ private:
344 max_over_slit, tab_rotate_vertical, 345 max_over_slit, tab_rotate_vertical,
345 sloppy_window_grouping, workspace_warping, 346 sloppy_window_grouping, workspace_warping,
346 desktop_wheeling, show_window_pos, 347 desktop_wheeling, show_window_pos,
347 focus_last, focus_new; 348 focus_last, focus_new,
349 antialias;
348 Resource<std::string> rootcommand; 350 Resource<std::string> rootcommand;
349 bool auto_raise, sloppy_focus, semi_sloppy_focus, 351 bool auto_raise, sloppy_focus, semi_sloppy_focus,
350 ordered_dither; 352 ordered_dither;
@@ -362,7 +364,7 @@ private:
362 364
363 365
364 #ifdef SLIT 366 #ifdef SLIT
365 Bool slit_on_top, slit_auto_hide; 367 bool slit_on_top, slit_auto_hide;
366 int slit_placement, slit_direction; 368 int slit_placement, slit_direction;
367 369
368 #ifdef XINERAMA 370 #ifdef XINERAMA