diff options
author | rathnor <rathnor> | 2004-09-12 14:56:20 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2004-09-12 14:56:20 (GMT) |
commit | 42c1fd3ae3dd058e146b7350c65b74386123c25c (patch) | |
tree | cc549c2c7b12c87f8c33198f5b30f00d9dd30bc6 /src/Screen.cc | |
parent | c39234195a46cece2bdb18dfdde6c91c7a190dc4 (diff) | |
download | fluxbox-42c1fd3ae3dd058e146b7350c65b74386123c25c.zip fluxbox-42c1fd3ae3dd058e146b7350c65b74386123c25c.tar.bz2 |
preliminary support for composite/compositing manager. Also general work
for consistency with transparency resources
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 4752ed4..9f5b07e 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.291 2004/09/11 23:01:34 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.292 2004/09/12 14:56:18 rathnor Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -68,6 +68,7 @@ | |||
68 | #include "FbTk/StringUtil.hh" | 68 | #include "FbTk/StringUtil.hh" |
69 | #include "FbTk/ImageControl.hh" | 69 | #include "FbTk/ImageControl.hh" |
70 | #include "FbTk/EventManager.hh" | 70 | #include "FbTk/EventManager.hh" |
71 | #include "FbTk/Transparent.hh" | ||
71 | 72 | ||
72 | //use GNU extensions | 73 | //use GNU extensions |
73 | #ifndef _GNU_SOURCE | 74 | #ifndef _GNU_SOURCE |
@@ -176,7 +177,9 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, | |||
176 | focus_model(rm, CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"), | 177 | focus_model(rm, CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"), |
177 | workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), | 178 | workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), |
178 | edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), | 179 | edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), |
179 | menu_alpha(rm, 255, scrname+".menuAlpha", altscrname+".MenuAlpha"), | 180 | focused_alpha(rm, 255, scrname+".window.focus.alpha", altscrname+".Window.Focus.Alpha"), |
181 | unfocused_alpha(rm, 255, scrname+".window.unfocus.alpha", altscrname+".Window.Unfocus.Alpha"), | ||
182 | menu_alpha(rm, 255, scrname+".menu.alpha", altscrname+".Menu.Alpha"), | ||
180 | menu_delay(rm, 0, scrname + ".menuDelay", altscrname+".MenuDelay"), | 183 | menu_delay(rm, 0, scrname + ".menuDelay", altscrname+".MenuDelay"), |
181 | menu_delay_close(rm, 0, scrname + ".menuDelayClose", altscrname+".MenuDelayClose"), | 184 | menu_delay_close(rm, 0, scrname + ".menuDelayClose", altscrname+".MenuDelayClose"), |
182 | menu_mode(rm, FbTk::MenuTheme::DELAY_OPEN, scrname+".menuMode", altscrname+".MenuMode"), | 185 | menu_mode(rm, FbTk::MenuTheme::DELAY_OPEN, scrname+".menuMode", altscrname+".MenuMode"), |
@@ -276,8 +279,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
276 | imageControl().installRootColormap(); | 279 | imageControl().installRootColormap(); |
277 | root_colormap_installed = true; | 280 | root_colormap_installed = true; |
278 | 281 | ||
279 | 282 | m_windowtheme->setFocusedAlpha(*resource.focused_alpha); | |
280 | 283 | m_windowtheme->setUnfocusedAlpha(*resource.unfocused_alpha); | |
281 | m_menutheme->setAlpha(*resource.menu_alpha); | 284 | m_menutheme->setAlpha(*resource.menu_alpha); |
282 | m_menutheme->setMenuMode(*resource.menu_mode); | 285 | m_menutheme->setMenuMode(*resource.menu_mode); |
283 | // clamp values | 286 | // clamp values |
@@ -654,6 +657,8 @@ void BScreen::hideWindowMenus(const FluxboxWindow* except) { | |||
654 | 657 | ||
655 | 658 | ||
656 | void BScreen::reconfigure() { | 659 | void BScreen::reconfigure() { |
660 | m_windowtheme->setFocusedAlpha(*resource.focused_alpha); | ||
661 | m_windowtheme->setUnfocusedAlpha(*resource.unfocused_alpha); | ||
657 | m_menutheme->setAlpha(*resource.menu_alpha); | 662 | m_menutheme->setAlpha(*resource.menu_alpha); |
658 | m_menutheme->setMenuMode(*resource.menu_mode); | 663 | m_menutheme->setMenuMode(*resource.menu_mode); |
659 | 664 | ||
@@ -1814,14 +1819,41 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1814 | "AntiAlias", "Use Anti-aliased fonts", | 1819 | "AntiAlias", "Use Anti-aliased fonts", |
1815 | *resource.antialias, save_and_reconfigure); | 1820 | *resource.antialias, save_and_reconfigure); |
1816 | #endif // USE_XFT | 1821 | #endif // USE_XFT |
1817 | #undef _BOOLITEM | ||
1818 | 1822 | ||
1819 | #ifdef HAVE_XRENDER | 1823 | #ifdef HAVE_XRENDER |
1820 | FbTk::MenuItem *menu_alpha_item = new IntResMenuItem("Menu Alpha", resource.menu_alpha, | 1824 | if (FbTk::Transparent::haveRender() || |
1821 | 0, 255); | 1825 | FbTk::Transparent::haveComposite()) { |
1822 | menu_alpha_item->setCommand(saverc_cmd); | 1826 | |
1823 | menu.insert(menu_alpha_item); | 1827 | const char *alphamenu_label = _FBTEXT(Configmenu, Transparency, |
1828 | "Transparency", "Menu containing various transparency options"); | ||
1829 | FbTk::Menu *alpha_menu = createMenu(alphamenu_label ? alphamenu_label : ""); | ||
1830 | |||
1831 | if (FbTk::Transparent::haveComposite(true)) { | ||
1832 | alpha_menu->insert(new BoolMenuItem(_FBTEXT(Configmenu, ForcePseudoTrans, | ||
1833 | "Force Pseudo-Transparency", "When composite is available, still use old pseudo-transparency"), | ||
1834 | Fluxbox::instance()->getPseudoTrans(), save_and_reconfigure)); | ||
1835 | } | ||
1836 | |||
1837 | FbTk::MenuItem *focused_alpha_item = new IntResMenuItem(_FBTEXT(Configmenu, FocusedAlpha, "Focused Window Alpha", "Transparency level of the focused window"), | ||
1838 | resource.focused_alpha, 0, 255); | ||
1839 | focused_alpha_item->setCommand(saverc_cmd); | ||
1840 | alpha_menu->insert(focused_alpha_item); | ||
1841 | |||
1842 | FbTk::MenuItem *unfocused_alpha_item = new IntResMenuItem(_FBTEXT(Configmenu, UnfocusedAlpha, "Unfocused Window Alpha", "Transparency level of unfocused windows"), | ||
1843 | resource.unfocused_alpha, 0, 255); | ||
1844 | unfocused_alpha_item->setCommand(saverc_cmd); | ||
1845 | alpha_menu->insert(unfocused_alpha_item); | ||
1846 | |||
1847 | FbTk::MenuItem *menu_alpha_item = new IntResMenuItem(_FBTEXT(Configmenu, MenuAlpha, "Menu Alpha", "Transparency level of menu"), | ||
1848 | resource.menu_alpha, 0, 255); | ||
1849 | menu_alpha_item->setCommand(saverc_cmd); | ||
1850 | alpha_menu->insert(menu_alpha_item); | ||
1851 | |||
1852 | alpha_menu->update(); | ||
1853 | menu.insert(alphamenu_label, alpha_menu); | ||
1854 | } | ||
1824 | #endif // HAVE_XRENDER | 1855 | #endif // HAVE_XRENDER |
1856 | #undef _BOOLITEM | ||
1825 | 1857 | ||
1826 | 1858 | ||
1827 | // finaly update menu | 1859 | // finaly update menu |