From a904d7b6b790396d396a57472467d4f2578b4f53 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 15 Oct 2002 10:54:40 +0000 Subject: antialias resource --- src/Screen.cc | 76 +++++++++++++++++++---------------------------------------- src/Screen.hh | 14 ++++++----- 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.71 2002/10/13 22:30:18 fluxgen Exp $ +// $Id: Screen.cc,v 1.72 2002/10/15 10:54:40 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -201,6 +201,7 @@ desktop_wheeling(rm, true, scrname+".desktopwheeling", altscrname+".DesktopWheel show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"), focus_last(rm, true, scrname+".focusLastWindow", altscrname+".FocusLastWindow"), focus_new(rm, true, scrname+".focusNewWindows", altscrname+".FocusNewWindows"), +antialias(rm, false, scrname+".antialias", altscrname+".Antialias"), rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), toolbar_width_percent(rm, 65, scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"), @@ -256,14 +257,14 @@ resource(rm, screenname, altscreenname) rootmenu = 0; - #ifdef HAVE_GETPID +#ifdef HAVE_GETPID pid_t bpid = getpid(); XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), fluxbox->getFluxboxPidAtom(), XA_CARDINAL, sizeof(pid_t) * 8, PropModeReplace, (unsigned char *) &bpid, 1); - #endif // HAVE_GETPID +#endif // HAVE_GETPID XDefineCursor(getBaseDisplay()->getXDisplay(), getRootWindow(), @@ -282,19 +283,6 @@ resource(rm, screenname, altscreenname) image_control, fluxbox->getStyleFilename(), getRootCommand().c_str()); - #ifdef NEWWMSPEC - Atom netwmsupported[] = { -// getBaseDisplay()->getNETWMStateAtom(), - getBaseDisplay()->getNETNumberOfDesktopsAtom(), - getBaseDisplay()->getNETCurrentDesktopAtom(), - getBaseDisplay()->getNETSupportingWMCheckAtom(), - }; - - XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), - getBaseDisplay()->getNETSupportedAtom(), XA_ATOM, 32, PropModeReplace, - (unsigned char *)netwmsupported, (sizeof netwmsupported)/sizeof netwmsupported[0]); - #endif //!NEWWMSPEC - const char *s = i18n->getMessage( FBNLS::ScreenSet, FBNLS::ScreenPositionLength, "0: 0000 x 0: 0000"); @@ -384,9 +372,9 @@ resource(rm, screenname, altscreenname) toolbar = new Toolbar(this); - #ifdef SLIT +#ifdef SLIT slit = new Slit(this); - #endif // SLIT +#endif // SLIT initMenu(); @@ -394,9 +382,10 @@ resource(rm, screenname, altscreenname) //update menus rootmenu->update(); - #ifdef SLIT +#ifdef SLIT slit->reconfigure(); - #endif +#endif // SLIT + changeWorkspaceID(0); updateNetizenWorkspaceCount(); @@ -465,7 +454,7 @@ resource(rm, screenname, altscreenname) XFree(children); XFlush(getBaseDisplay()->getXDisplay()); - + } namespace { @@ -486,10 +475,6 @@ BScreen::~BScreen() { removeWorkspaceNames(); -#ifdef __INTEL_COMPILER - //Didn't got icc to work with std::for_each - //so we do this by hand. - Workspaces::iterator w_it = workspacesList.begin(); Workspaces::iterator w_it_end = workspacesList.end(); for(; w_it != w_it_end; ++w_it) { @@ -510,32 +495,13 @@ BScreen::~BScreen() { delete (*n_it); } netizenList.clear(); - -#else //__INTEL_COMPILER - std::for_each( - workspacesList.begin(), - workspacesList.end(), - delete_obj); - - // don't delete items in the rootmenuList? - - std::for_each( - iconList.begin(), - iconList.end(), - delete_obj); - - std::for_each( - netizenList.begin(), - netizenList.end(), - delete_obj); -#endif //!__INTEL_COMPILER delete rootmenu; delete workspacemenu; delete iconmenu; delete configmenu; -#ifdef SLIT +#ifdef SLIT delete slit; #endif // SLIT @@ -547,14 +513,14 @@ BScreen::~BScreen() { } void BScreen::reconfigure() { - #ifdef DEBUG +#ifdef DEBUG cerr<<__FILE__<<"("<<__LINE__<<"): BScreen::reconfigure"<loadRootCommand(this); theme->setRootCommand(getRootCommand()); - + theme->reconfigure(*resource.antialias); theme->load(fluxbox->getStyleFilename()); - theme->reconfigure(); + I18n *i18n = I18n::instance(); const char *s = i18n->getMessage( @@ -723,6 +689,12 @@ FluxboxWindow *BScreen::getIcon(unsigned int index) { return 0; } +void BScreen::setAntialias(bool value) { + if (*resource.antialias == value) + return; + resource.antialias = value; + reconfigure(); +} int BScreen::addWorkspace() { Workspace *wkspc = new Workspace(this, workspacesList.size()); @@ -1024,9 +996,9 @@ void BScreen::raiseWindows(const Workspace::Stack &workspace_stack) { session_stack[i++] = workspacemenu->windowID(); - session_stack[i++] = configmenu->getFocusmenu()->windowID(); - session_stack[i++] = configmenu->getPlacementmenu()->windowID(); - session_stack[i++] = configmenu->getTabmenu()->windowID(); + session_stack[i++] = configmenu->focusmenu().windowID(); + session_stack[i++] = configmenu->placementmenu().windowID(); + session_stack[i++] = configmenu->tabmenu().windowID(); session_stack[i++] = configmenu->windowID(); #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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.46 2002/10/13 22:29:25 fluxgen Exp $ +// $Id: Screen.hh,v 1.47 2002/10/15 10:54:40 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -94,7 +94,7 @@ public: inline bool doFocusNew() const { return *resource.focus_new; } inline bool doFocusLast() const { return *resource.focus_last; } inline bool doShowWindowPos() const { return *resource.show_window_pos; } - + bool antialias() const { return *resource.antialias; } inline GC getOpGC() const { return theme->getOpGC(); } inline const FbTk::Color *getBorderColor() const { return &theme->getBorderColor(); } @@ -105,6 +105,7 @@ public: inline bool isSlitOnTop() const { return resource.slit_on_top; } inline bool doSlitAutoHide() const { return resource.slit_auto_hide; } inline Slit *getSlit() { return slit; } + inline const Slit *getSlit() const { return slit; } inline int getSlitPlacement() const { return resource.slit_placement; } inline int getSlitDirection() const { return resource.slit_direction; } inline void saveSlitPlacement(int p) { resource.slit_placement = p; } @@ -203,7 +204,7 @@ public: inline void iconUpdate() { iconmenu->update(); } inline Iconmenu *getIconmenu() { return iconmenu; } inline void setAutoGroupWindow(Window w = 0) { auto_group_window = w; } - + void setAntialias(bool value); #ifdef HAVE_STRFTIME inline const char *getStrftimeFormat() { return resource.strftime_format.c_str(); } @@ -212,7 +213,7 @@ public: inline int getDateFormat() { return resource.date_format; } inline void saveDateFormat(int f) { resource.date_format = f; } inline bool isClock24Hour() { return resource.clock24hour; } - inline void saveClock24Hour(Bool c) { resource.clock24hour = c; } + inline void saveClock24Hour(bool c) { resource.clock24hour = c; } #endif // HAVE_STRFTIME inline Theme::WindowStyle *getWindowStyle() { return &theme->getWindowStyle(); } @@ -344,7 +345,8 @@ private: max_over_slit, tab_rotate_vertical, sloppy_window_grouping, workspace_warping, desktop_wheeling, show_window_pos, - focus_last, focus_new; + focus_last, focus_new, + antialias; Resource rootcommand; bool auto_raise, sloppy_focus, semi_sloppy_focus, ordered_dither; @@ -362,7 +364,7 @@ private: #ifdef SLIT - Bool slit_on_top, slit_auto_hide; + bool slit_on_top, slit_auto_hide; int slit_placement, slit_direction; #ifdef XINERAMA -- cgit v0.11.2