diff options
author | fluxgen <fluxgen> | 2002-10-15 10:54:40 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-10-15 10:54:40 (GMT) |
commit | a904d7b6b790396d396a57472467d4f2578b4f53 (patch) | |
tree | 327b87cde947dae96fa41f9dbe3673b405a5f7bf /src/Screen.cc | |
parent | d565c23cf97e8893f31c7743f867fe6036b7959e (diff) | |
download | fluxbox-a904d7b6b790396d396a57472467d4f2578b4f53.zip fluxbox-a904d7b6b790396d396a57472467d4f2578b4f53.tar.bz2 |
antialias resource
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 76 |
1 files changed, 24 insertions, 52 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 | |||
201 | show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"), | 201 | show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"), |
202 | focus_last(rm, true, scrname+".focusLastWindow", altscrname+".FocusLastWindow"), | 202 | focus_last(rm, true, scrname+".focusLastWindow", altscrname+".FocusLastWindow"), |
203 | focus_new(rm, true, scrname+".focusNewWindows", altscrname+".FocusNewWindows"), | 203 | focus_new(rm, true, scrname+".focusNewWindows", altscrname+".FocusNewWindows"), |
204 | antialias(rm, false, scrname+".antialias", altscrname+".Antialias"), | ||
204 | rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), | 205 | rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), |
205 | workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), | 206 | workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), |
206 | toolbar_width_percent(rm, 65, scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"), | 207 | toolbar_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 | ||
471 | namespace { | 460 | namespace { |
@@ -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 | ||
549 | void BScreen::reconfigure() { | 515 | void 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 | ||
692 | void BScreen::setAntialias(bool value) { | ||
693 | if (*resource.antialias == value) | ||
694 | return; | ||
695 | resource.antialias = value; | ||
696 | reconfigure(); | ||
697 | } | ||
726 | 698 | ||
727 | int BScreen::addWorkspace() { | 699 | int 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 |