aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2001-12-19 13:53:35 (GMT)
committerfluxgen <fluxgen>2001-12-19 13:53:35 (GMT)
commitcf442c375ab9d69754ff1aea1f1bc6b37bdb5825 (patch)
tree2b67e6f9a6e9110498bfa45c36a1bb312c207362 /src/Window.cc
parent479495b2fac9d8ecff374f865108cec7787a05e2 (diff)
downloadfluxbox_pavel-cf442c375ab9d69754ff1aea1f1bc6b37bdb5825.zip
fluxbox_pavel-cf442c375ab9d69754ff1aea1f1bc6b37bdb5825.tar.bz2
Updated Attrib flags and struct
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc146
1 files changed, 73 insertions, 73 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 3618e32..a99c9a6 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -143,7 +143,7 @@ FluxboxWindow::FluxboxWindow(Window w, BScreen *s) {
143 client.title_len = 0; 143 client.title_len = 0;
144 client.icon_title = 0; 144 client.icon_title = 0;
145 client.mwm_hint = (MwmHints *) 0; 145 client.mwm_hint = (MwmHints *) 0;
146 client.blackbox_hint = (BlackboxHints *) 0; 146 client.blackbox_hint = 0;
147 147
148 windowmenu = 0; 148 windowmenu = 0;
149 lastButtonPressTime = 0; 149 lastButtonPressTime = 0;
@@ -1473,28 +1473,28 @@ void FluxboxWindow::getBlackboxHints(void) {
1473 (unsigned char **) &client.blackbox_hint) == Success && 1473 (unsigned char **) &client.blackbox_hint) == Success &&
1474 client.blackbox_hint) 1474 client.blackbox_hint)
1475 if (num == PropBlackboxHintsElements) { 1475 if (num == PropBlackboxHintsElements) {
1476 if (client.blackbox_hint->flags & AttribShaded) 1476 if (client.blackbox_hint->flags & BaseDisplay::ATTRIB_SHADED)
1477 shaded = (client.blackbox_hint->attrib & AttribShaded); 1477 shaded = (client.blackbox_hint->attrib & BaseDisplay::ATTRIB_SHADED);
1478 1478
1479 if ((client.blackbox_hint->flags & AttribMaxHoriz) && 1479 if ((client.blackbox_hint->flags & BaseDisplay::ATTRIB_MAXHORIZ) &&
1480 (client.blackbox_hint->flags & AttribMaxVert)) 1480 (client.blackbox_hint->flags & BaseDisplay::ATTRIB_MAXVERT))
1481 maximized = ((client.blackbox_hint->attrib & 1481 maximized = ((client.blackbox_hint->attrib &
1482 (AttribMaxHoriz | AttribMaxVert)) ? 1 : 0); 1482 (BaseDisplay::ATTRIB_MAXHORIZ | BaseDisplay::ATTRIB_MAXVERT)) ? 1 : 0);
1483 else if (client.blackbox_hint->flags & AttribMaxVert) 1483 else if (client.blackbox_hint->flags & BaseDisplay::ATTRIB_MAXVERT)
1484 maximized = ((client.blackbox_hint->attrib & AttribMaxVert) ? 2 : 0); 1484 maximized = ((client.blackbox_hint->attrib & BaseDisplay::ATTRIB_MAXVERT) ? 2 : 0);
1485 else if (client.blackbox_hint->flags & AttribMaxHoriz) 1485 else if (client.blackbox_hint->flags & BaseDisplay::ATTRIB_MAXHORIZ)
1486 maximized = ((client.blackbox_hint->attrib & AttribMaxHoriz) ? 3 : 0); 1486 maximized = ((client.blackbox_hint->attrib & BaseDisplay::ATTRIB_MAXHORIZ) ? 3 : 0);
1487 1487
1488 if (client.blackbox_hint->flags & AttribOmnipresent) 1488 if (client.blackbox_hint->flags & BaseDisplay::ATTRIB_OMNIPRESENT)
1489 stuck = (client.blackbox_hint->attrib & AttribOmnipresent); 1489 stuck = (client.blackbox_hint->attrib & BaseDisplay::ATTRIB_OMNIPRESENT);
1490 1490
1491 if (client.blackbox_hint->flags & AttribWorkspace) 1491 if (client.blackbox_hint->flags & BaseDisplay::ATTRIB_WORKSPACE)
1492 workspace_number = client.blackbox_hint->workspace; 1492 workspace_number = client.blackbox_hint->workspace;
1493 1493
1494 1494
1495 if (client.blackbox_hint->flags & AttribDecoration) { 1495 if (client.blackbox_hint->flags & BaseDisplay::ATTRIB_DECORATION) {
1496 switch (client.blackbox_hint->decoration) { 1496 switch (client.blackbox_hint->decoration) {
1497 case DecorNone: 1497 case BaseDisplay::DECOR_NONE:
1498 decorations.titlebar = decorations.border = decorations.handle = 1498 decorations.titlebar = decorations.border = decorations.handle =
1499 decorations.iconify = decorations.maximize = 1499 decorations.iconify = decorations.maximize =
1500 decorations.menu = false; 1500 decorations.menu = false;
@@ -1504,7 +1504,7 @@ void FluxboxWindow::getBlackboxHints(void) {
1504 break; 1504 break;
1505 1505
1506 default: 1506 default:
1507 case DecorNormal: 1507 case BaseDisplay::DECOR_NORMAL:
1508 decorations.titlebar = decorations.border = decorations.handle = 1508 decorations.titlebar = decorations.border = decorations.handle =
1509 decorations.iconify = decorations.maximize = 1509 decorations.iconify = decorations.maximize =
1510 decorations.menu = true; 1510 decorations.menu = true;
@@ -1513,7 +1513,7 @@ void FluxboxWindow::getBlackboxHints(void) {
1513 1513
1514 break; 1514 break;
1515 1515
1516 case DecorTiny: 1516 case BaseDisplay::DECOR_TINY:
1517 decorations.titlebar = decorations.iconify = decorations.menu = 1517 decorations.titlebar = decorations.iconify = decorations.menu =
1518 functions.move = functions.iconify = true; 1518 functions.move = functions.iconify = true;
1519 decorations.border = decorations.handle = decorations.maximize = 1519 decorations.border = decorations.handle = decorations.maximize =
@@ -1521,7 +1521,7 @@ void FluxboxWindow::getBlackboxHints(void) {
1521 1521
1522 break; 1522 break;
1523 1523
1524 case DecorTool: 1524 case BaseDisplay::DECOR_TOOL:
1525 decorations.titlebar = decorations.menu = functions.move = true; 1525 decorations.titlebar = decorations.menu = functions.move = true;
1526 decorations.iconify = decorations.border = decorations.handle = 1526 decorations.iconify = decorations.border = decorations.handle =
1527 decorations.maximize = functions.resize = functions.maximize = 1527 decorations.maximize = functions.resize = functions.maximize =
@@ -1916,27 +1916,27 @@ void FluxboxWindow::maximize(unsigned int button) {
1916 1916
1917 switch(button) { 1917 switch(button) {
1918 case 1: 1918 case 1:
1919 blackbox_attrib.flags |= AttribMaxHoriz | AttribMaxVert; 1919 blackbox_attrib.flags |= BaseDisplay::ATTRIB_MAXHORIZ | BaseDisplay::ATTRIB_MAXVERT;
1920 blackbox_attrib.attrib |= AttribMaxHoriz | AttribMaxVert; 1920 blackbox_attrib.attrib |= BaseDisplay::ATTRIB_MAXHORIZ | BaseDisplay::ATTRIB_MAXVERT;
1921 1921
1922 break; 1922 break;
1923 1923
1924 case 2: 1924 case 2:
1925 blackbox_attrib.flags |= AttribMaxVert; 1925 blackbox_attrib.flags |= BaseDisplay::ATTRIB_MAXVERT;
1926 blackbox_attrib.attrib |= AttribMaxVert; 1926 blackbox_attrib.attrib |= BaseDisplay::ATTRIB_MAXVERT;
1927 1927
1928 break; 1928 break;
1929 1929
1930 case 3: 1930 case 3:
1931 blackbox_attrib.flags |= AttribMaxHoriz; 1931 blackbox_attrib.flags |= BaseDisplay::ATTRIB_MAXHORIZ;
1932 blackbox_attrib.attrib |= AttribMaxHoriz; 1932 blackbox_attrib.attrib |= BaseDisplay::ATTRIB_MAXHORIZ;
1933 1933
1934 break; 1934 break;
1935 } 1935 }
1936 1936
1937 if (shaded) { 1937 if (shaded) {
1938 blackbox_attrib.flags ^= AttribShaded; 1938 blackbox_attrib.flags ^= BaseDisplay::ATTRIB_SHADED;
1939 blackbox_attrib.attrib ^= AttribShaded; 1939 blackbox_attrib.attrib ^= BaseDisplay::ATTRIB_SHADED;
1940 shaded = false; 1940 shaded = false;
1941 } 1941 }
1942 1942
@@ -1950,8 +1950,8 @@ void FluxboxWindow::maximize(unsigned int button) {
1950 } else { 1950 } else {
1951 maximized = false; 1951 maximized = false;
1952 1952
1953 blackbox_attrib.flags &= ! (AttribMaxHoriz | AttribMaxVert); 1953 blackbox_attrib.flags &= ! (BaseDisplay::ATTRIB_MAXHORIZ | BaseDisplay::ATTRIB_MAXVERT);
1954 blackbox_attrib.attrib &= ! (AttribMaxHoriz | AttribMaxVert); 1954 blackbox_attrib.attrib &= ! (BaseDisplay::ATTRIB_MAXHORIZ | BaseDisplay::ATTRIB_MAXVERT);
1955 1955
1956 configure(blackbox_attrib.premax_x, blackbox_attrib.premax_y, 1956 configure(blackbox_attrib.premax_x, blackbox_attrib.premax_y,
1957 blackbox_attrib.premax_w, blackbox_attrib.premax_h); 1957 blackbox_attrib.premax_w, blackbox_attrib.premax_h);
@@ -1970,7 +1970,7 @@ void FluxboxWindow::maximize(unsigned int button) {
1970void FluxboxWindow::setWorkspace(int n) { 1970void FluxboxWindow::setWorkspace(int n) {
1971 workspace_number = n; 1971 workspace_number = n;
1972 1972
1973 blackbox_attrib.flags |= AttribWorkspace; 1973 blackbox_attrib.flags |= BaseDisplay::ATTRIB_WORKSPACE;
1974 blackbox_attrib.workspace = workspace_number; 1974 blackbox_attrib.workspace = workspace_number;
1975} 1975}
1976 1976
@@ -1980,15 +1980,15 @@ void FluxboxWindow::shade(void) {
1980 if (shaded) { 1980 if (shaded) {
1981 XResizeWindow(display, frame.window, frame.width, frame.height); 1981 XResizeWindow(display, frame.window, frame.width, frame.height);
1982 shaded = false; 1982 shaded = false;
1983 blackbox_attrib.flags ^= AttribShaded; 1983 blackbox_attrib.flags ^= BaseDisplay::ATTRIB_SHADED;
1984 blackbox_attrib.attrib ^= AttribShaded; 1984 blackbox_attrib.attrib ^= BaseDisplay::ATTRIB_SHADED;
1985 1985
1986 setState(NormalState); 1986 setState(NormalState);
1987 } else { 1987 } else {
1988 XResizeWindow(display, frame.window, frame.width, frame.title_h); 1988 XResizeWindow(display, frame.window, frame.width, frame.title_h);
1989 shaded = true; 1989 shaded = true;
1990 blackbox_attrib.flags |= AttribShaded; 1990 blackbox_attrib.flags |= BaseDisplay::ATTRIB_SHADED;
1991 blackbox_attrib.attrib |= AttribShaded; 1991 blackbox_attrib.attrib |= BaseDisplay::ATTRIB_SHADED;
1992 1992
1993 setState(IconicState); 1993 setState(IconicState);
1994 } 1994 }
@@ -2000,8 +2000,8 @@ void FluxboxWindow::stick(void) {
2000 if (tab) //if it got a tab then do tab's stick on all of the objects in the list 2000 if (tab) //if it got a tab then do tab's stick on all of the objects in the list
2001 tab->stick(); //this window will stick too. 2001 tab->stick(); //this window will stick too.
2002 else if (stuck) { 2002 else if (stuck) {
2003 blackbox_attrib.flags ^= AttribOmnipresent; 2003 blackbox_attrib.flags ^= BaseDisplay::ATTRIB_OMNIPRESENT;
2004 blackbox_attrib.attrib ^= AttribOmnipresent; 2004 blackbox_attrib.attrib ^= BaseDisplay::ATTRIB_OMNIPRESENT;
2005 2005
2006 stuck = false; 2006 stuck = false;
2007 2007
@@ -2012,8 +2012,8 @@ void FluxboxWindow::stick(void) {
2012 } else { 2012 } else {
2013 stuck = true; 2013 stuck = true;
2014 2014
2015 blackbox_attrib.flags |= AttribOmnipresent; 2015 blackbox_attrib.flags |= BaseDisplay::ATTRIB_OMNIPRESENT;
2016 blackbox_attrib.attrib |= AttribOmnipresent; 2016 blackbox_attrib.attrib |= BaseDisplay::ATTRIB_OMNIPRESENT;
2017 2017
2018 } 2018 }
2019 2019
@@ -2232,7 +2232,7 @@ void FluxboxWindow::restoreAttributes(void) {
2232 unsigned long ulfoo, nitems; 2232 unsigned long ulfoo, nitems;
2233 Fluxbox *fluxbox = Fluxbox::instance(); 2233 Fluxbox *fluxbox = Fluxbox::instance();
2234 2234
2235 BlackboxAttributes *net; 2235 BaseDisplay::BlackboxAttributes *net;
2236 if (XGetWindowProperty(display, client.window, 2236 if (XGetWindowProperty(display, client.window,
2237 fluxbox->getFluxboxAttributesAtom(), 0l, 2237 fluxbox->getFluxboxAttributesAtom(), 0l,
2238 PropBlackboxAttributesElements, false, 2238 PropBlackboxAttributesElements, false,
@@ -2252,8 +2252,8 @@ void FluxboxWindow::restoreAttributes(void) {
2252 } else 2252 } else
2253 return; 2253 return;
2254 2254
2255 if (blackbox_attrib.flags & AttribShaded && 2255 if (blackbox_attrib.flags & BaseDisplay::ATTRIB_SHADED &&
2256 blackbox_attrib.attrib & AttribShaded) { 2256 blackbox_attrib.attrib & BaseDisplay::ATTRIB_SHADED) {
2257 int save_state = 2257 int save_state =
2258 ((current_state == IconicState) ? NormalState : current_state); 2258 ((current_state == IconicState) ? NormalState : current_state);
2259 2259
@@ -2273,29 +2273,29 @@ void FluxboxWindow::restoreAttributes(void) {
2273 } else if (current_state == WithdrawnState) 2273 } else if (current_state == WithdrawnState)
2274 current_state = NormalState; 2274 current_state = NormalState;
2275 2275
2276 if (blackbox_attrib.flags & AttribOmnipresent && 2276 if (blackbox_attrib.flags & BaseDisplay::ATTRIB_OMNIPRESENT &&
2277 blackbox_attrib.attrib & AttribOmnipresent) { 2277 blackbox_attrib.attrib & BaseDisplay::ATTRIB_OMNIPRESENT) {
2278 stuck = false; 2278 stuck = false;
2279 stick(); 2279 stick();
2280 2280
2281 current_state = NormalState; 2281 current_state = NormalState;
2282 } 2282 }
2283 2283
2284 if ((blackbox_attrib.flags & AttribMaxHoriz) || 2284 if ((blackbox_attrib.flags & BaseDisplay::ATTRIB_MAXHORIZ) ||
2285 (blackbox_attrib.flags & AttribMaxVert)) { 2285 (blackbox_attrib.flags & BaseDisplay::ATTRIB_MAXVERT)) {
2286 int x = blackbox_attrib.premax_x, y = blackbox_attrib.premax_y; 2286 int x = blackbox_attrib.premax_x, y = blackbox_attrib.premax_y;
2287 unsigned int w = blackbox_attrib.premax_w, h = blackbox_attrib.premax_h; 2287 unsigned int w = blackbox_attrib.premax_w, h = blackbox_attrib.premax_h;
2288 maximized = false; 2288 maximized = false;
2289 2289
2290 int m; 2290 int m;
2291 if ((blackbox_attrib.flags & AttribMaxHoriz) && 2291 if ((blackbox_attrib.flags & BaseDisplay::ATTRIB_MAXHORIZ) &&
2292 (blackbox_attrib.flags & AttribMaxVert)) 2292 (blackbox_attrib.flags & BaseDisplay::ATTRIB_MAXVERT))
2293 m = ((blackbox_attrib.attrib & (AttribMaxHoriz | AttribMaxVert)) ? 2293 m = ((blackbox_attrib.attrib & (BaseDisplay::ATTRIB_MAXHORIZ | BaseDisplay::ATTRIB_MAXVERT)) ?
2294 1 : 0); 2294 1 : 0);
2295 else if (blackbox_attrib.flags & AttribMaxVert) 2295 else if (blackbox_attrib.flags & BaseDisplay::ATTRIB_MAXVERT)
2296 m = ((blackbox_attrib.attrib & AttribMaxVert) ? 2 : 0); 2296 m = ((blackbox_attrib.attrib & BaseDisplay::ATTRIB_MAXVERT) ? 2 : 0);
2297 else if (blackbox_attrib.flags & AttribMaxHoriz) 2297 else if (blackbox_attrib.flags & BaseDisplay::ATTRIB_MAXHORIZ)
2298 m = ((blackbox_attrib.attrib & AttribMaxHoriz) ? 3 : 0); 2298 m = ((blackbox_attrib.attrib & BaseDisplay::ATTRIB_MAXHORIZ) ? 3 : 0);
2299 else 2299 else
2300 m = 0; 2300 m = 0;
2301 2301
@@ -3128,37 +3128,37 @@ void FluxboxWindow::timeout(void) {
3128} 3128}
3129 3129
3130 3130
3131void FluxboxWindow::changeBlackboxHints(BlackboxHints *net) { 3131void FluxboxWindow::changeBlackboxHints(BaseDisplay::BlackboxHints *net) {
3132 if ((net->flags & AttribShaded) && 3132 if ((net->flags & BaseDisplay::ATTRIB_SHADED) &&
3133 ((blackbox_attrib.attrib & AttribShaded) != 3133 ((blackbox_attrib.attrib & BaseDisplay::ATTRIB_SHADED) !=
3134 (net->attrib & AttribShaded))) 3134 (net->attrib & BaseDisplay::ATTRIB_SHADED)))
3135 shade(); 3135 shade();
3136 3136
3137 if ((net->flags & (AttribMaxVert | AttribMaxHoriz)) && 3137 if ((net->flags & (BaseDisplay::ATTRIB_MAXVERT | BaseDisplay::ATTRIB_MAXHORIZ)) &&
3138 ((blackbox_attrib.attrib & (AttribMaxVert | AttribMaxHoriz)) != 3138 ((blackbox_attrib.attrib & (BaseDisplay::ATTRIB_MAXVERT | BaseDisplay::ATTRIB_MAXHORIZ)) !=
3139 (net->attrib & (AttribMaxVert | AttribMaxHoriz)))) { 3139 (net->attrib & (BaseDisplay::ATTRIB_MAXVERT | BaseDisplay::ATTRIB_MAXHORIZ)))) {
3140 if (maximized) { 3140 if (maximized) {
3141 maximize(0); 3141 maximize(0);
3142 } else { 3142 } else {
3143 int m = 0; 3143 int m = 0;
3144 3144
3145 if ((net->flags & AttribMaxHoriz) && (net->flags & AttribMaxVert)) 3145 if ((net->flags & BaseDisplay::ATTRIB_MAXHORIZ) && (net->flags & BaseDisplay::ATTRIB_MAXVERT))
3146 m = ((net->attrib & (AttribMaxHoriz | AttribMaxVert)) ? 1 : 0); 3146 m = ((net->attrib & (BaseDisplay::ATTRIB_MAXHORIZ | BaseDisplay::ATTRIB_MAXVERT)) ? 1 : 0);
3147 else if (net->flags & AttribMaxVert) 3147 else if (net->flags & BaseDisplay::ATTRIB_MAXVERT)
3148 m = ((net->attrib & AttribMaxVert) ? 2 : 0); 3148 m = ((net->attrib & BaseDisplay::ATTRIB_MAXVERT) ? 2 : 0);
3149 else if (net->flags & AttribMaxHoriz) 3149 else if (net->flags & BaseDisplay::ATTRIB_MAXHORIZ)
3150 m = ((net->attrib & AttribMaxHoriz) ? 3 : 0); 3150 m = ((net->attrib & BaseDisplay::ATTRIB_MAXHORIZ) ? 3 : 0);
3151 3151
3152 maximize(m); 3152 maximize(m);
3153 } 3153 }
3154 } 3154 }
3155 3155
3156 if ((net->flags & AttribOmnipresent) && 3156 if ((net->flags & BaseDisplay::ATTRIB_OMNIPRESENT) &&
3157 ((blackbox_attrib.attrib & AttribOmnipresent) != 3157 ((blackbox_attrib.attrib & BaseDisplay::ATTRIB_OMNIPRESENT) !=
3158 (net->attrib & AttribOmnipresent))) 3158 (net->attrib & BaseDisplay::ATTRIB_OMNIPRESENT)))
3159 stick(); 3159 stick();
3160 3160
3161 if ((net->flags & AttribWorkspace) && 3161 if ((net->flags & BaseDisplay::ATTRIB_WORKSPACE) &&
3162 (workspace_number != (signed) net->workspace)) { 3162 (workspace_number != (signed) net->workspace)) {
3163 screen->reassociateWindow(this, net->workspace, true); 3163 screen->reassociateWindow(this, net->workspace, true);
3164 3164
@@ -3168,9 +3168,9 @@ void FluxboxWindow::changeBlackboxHints(BlackboxHints *net) {
3168 deiconify(); 3168 deiconify();
3169 } 3169 }
3170 3170
3171 if (net->flags & AttribDecoration) { 3171 if (net->flags & BaseDisplay::ATTRIB_DECORATION) {
3172 switch (net->decoration) { 3172 switch (net->decoration) {
3173 case DecorNone: 3173 case BaseDisplay::DECOR_NONE:
3174 decorations.titlebar = decorations.border = decorations.handle = 3174 decorations.titlebar = decorations.border = decorations.handle =
3175 decorations.iconify = decorations.maximize = 3175 decorations.iconify = decorations.maximize =
3176 decorations.menu = false; 3176 decorations.menu = false;
@@ -3180,7 +3180,7 @@ void FluxboxWindow::changeBlackboxHints(BlackboxHints *net) {
3180 break; 3180 break;
3181 3181
3182 default: 3182 default:
3183 case DecorNormal: 3183 case BaseDisplay::DECOR_NORMAL:
3184 decorations.titlebar = decorations.border = decorations.handle = 3184 decorations.titlebar = decorations.border = decorations.handle =
3185 decorations.iconify = decorations.maximize = 3185 decorations.iconify = decorations.maximize =
3186 decorations.menu = true; 3186 decorations.menu = true;
@@ -3189,7 +3189,7 @@ void FluxboxWindow::changeBlackboxHints(BlackboxHints *net) {
3189 3189
3190 break; 3190 break;
3191 3191
3192 case DecorTiny: 3192 case BaseDisplay::DECOR_TINY:
3193 decorations.titlebar = decorations.iconify = decorations.menu = 3193 decorations.titlebar = decorations.iconify = decorations.menu =
3194 functions.move = functions.iconify = true; 3194 functions.move = functions.iconify = true;
3195 decorations.border = decorations.handle = decorations.maximize = 3195 decorations.border = decorations.handle = decorations.maximize =
@@ -3197,7 +3197,7 @@ void FluxboxWindow::changeBlackboxHints(BlackboxHints *net) {
3197 3197
3198 break; 3198 break;
3199 3199
3200 case DecorTool: 3200 case BaseDisplay::DECOR_TOOL:
3201 decorations.titlebar = decorations.menu = functions.move = true; 3201 decorations.titlebar = decorations.menu = functions.move = true;
3202 decorations.iconify = decorations.border = decorations.handle = 3202 decorations.iconify = decorations.border = decorations.handle =
3203 decorations.maximize = functions.resize = functions.maximize = 3203 decorations.maximize = functions.resize = functions.maximize =