diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2012-07-02 04:22:01 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2012-07-02 04:22:01 (GMT) |
commit | 610a15ac47371c5cbd4c2dcf6eec696aec5bb4fa (patch) | |
tree | 3287c744b1a3157d8498b4b7f215b386dc50b081 | |
parent | 940fbca3febe78b788c78d8bb90cdabed78bdf0b (diff) | |
download | fluxbox_pavel-610a15ac47371c5cbd4c2dcf6eec696aec5bb4fa.zip fluxbox_pavel-610a15ac47371c5cbd4c2dcf6eec696aec5bb4fa.tar.bz2 |
add fullscreen, maximizedhorizontal, and maximizedvertical tests to ClientPattern
-rw-r--r-- | doc/asciidoc/client-patterns.txt | 9 | ||||
-rw-r--r-- | src/ClientPattern.cc | 18 | ||||
-rw-r--r-- | src/ClientPattern.hh | 2 |
3 files changed, 27 insertions, 2 deletions
diff --git a/doc/asciidoc/client-patterns.txt b/doc/asciidoc/client-patterns.txt index 5bb50a0..ed1229d 100644 --- a/doc/asciidoc/client-patterns.txt +++ b/doc/asciidoc/client-patterns.txt | |||
@@ -32,9 +32,18 @@ The following values are accepted for 'propertyname'::: | |||
32 | *Maximized*;; | 32 | *Maximized*;; |
33 | Either *yes* or *no*, depending on whether the window is maximized or | 33 | Either *yes* or *no*, depending on whether the window is maximized or |
34 | not. | 34 | not. |
35 | *MaximizedHorizontal*;; | ||
36 | Either *yes* or *no*, depending on whether the window is maximized | ||
37 | horizontally or not. | ||
38 | *MaximizedVertical*;; | ||
39 | Either *yes* or *no*, depending on whether the window is maximized | ||
40 | vertically or not. | ||
35 | *Minimized*;; | 41 | *Minimized*;; |
36 | Either *yes* or *no*, depending on whether the window is minimized | 42 | Either *yes* or *no*, depending on whether the window is minimized |
37 | (iconified) or not. | 43 | (iconified) or not. |
44 | *Fullscreen*;; | ||
45 | Either *yes* or *no*, depending on whether the window is fullscreen or | ||
46 | not. | ||
38 | *Shaded*;; | 47 | *Shaded*;; |
39 | Either *yes* or *no*, depending on whether the window is shaded or | 48 | Either *yes* or *no*, depending on whether the window is shaded or |
40 | not. | 49 | not. |
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc index f49f7fd..f57513d 100644 --- a/src/ClientPattern.cc +++ b/src/ClientPattern.cc | |||
@@ -67,13 +67,17 @@ struct Name2WinProperty { | |||
67 | ClientPattern::WinProperty prop; | 67 | ClientPattern::WinProperty prop; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | const Name2WinProperty name_2_winproperties[] = { // sorted for 'bsearch' | 70 | // sorted alphabetically for 'bsearch' |
71 | const Name2WinProperty name_2_winproperties[] = { | ||
71 | { "class", ClientPattern::CLASS }, | 72 | { "class", ClientPattern::CLASS }, |
72 | { "focushidden", ClientPattern::FOCUSHIDDEN }, | 73 | { "focushidden", ClientPattern::FOCUSHIDDEN }, |
74 | { "fullscreen", ClientPattern::FULLSCREEN }, | ||
73 | { "head", ClientPattern::HEAD }, | 75 | { "head", ClientPattern::HEAD }, |
74 | { "iconhidden", ClientPattern::ICONHIDDEN }, | 76 | { "iconhidden", ClientPattern::ICONHIDDEN }, |
75 | { "layer", ClientPattern::LAYER }, | 77 | { "layer", ClientPattern::LAYER }, |
76 | { "maximized", ClientPattern::MAXIMIZED }, | 78 | { "maximized", ClientPattern::MAXIMIZED }, |
79 | { "maximizedhorizontal", ClientPattern::HORZMAX }, | ||
80 | { "maximizedvertical", ClientPattern::VERTMAX }, | ||
77 | { "minimized", ClientPattern::MINIMIZED }, | 81 | { "minimized", ClientPattern::MINIMIZED }, |
78 | { "name", ClientPattern::NAME }, | 82 | { "name", ClientPattern::NAME }, |
79 | { "role", ClientPattern::ROLE }, | 83 | { "role", ClientPattern::ROLE }, |
@@ -132,6 +136,9 @@ Prop2String property_2_strings[] = { // sorted by 'prop' | |||
132 | { ClientPattern::URGENT, "urgent" }, | 136 | { ClientPattern::URGENT, "urgent" }, |
133 | { ClientPattern::SCREEN, "screen" }, | 137 | { ClientPattern::SCREEN, "screen" }, |
134 | { ClientPattern::XPROP, "@" }, | 138 | { ClientPattern::XPROP, "@" }, |
139 | { ClientPattern::FULLSCREEN, "fullscreen" }, | ||
140 | { ClientPattern::VERTMAX, "maximizedvertical" }, | ||
141 | { ClientPattern::HORZMAX, "maximizedhorizontal" }, | ||
135 | }; | 142 | }; |
136 | 143 | ||
137 | 144 | ||
@@ -411,6 +418,15 @@ FbTk::FbString ClientPattern::getProperty(WinProperty prop, const Focusable &cli | |||
411 | case MINIMIZED: | 418 | case MINIMIZED: |
412 | result = (fbwin && fbwin->isIconic()) ? "yes" : "no"; | 419 | result = (fbwin && fbwin->isIconic()) ? "yes" : "no"; |
413 | break; | 420 | break; |
421 | case FULLSCREEN: | ||
422 | result = (fbwin && fbwin->isFullscreen()) ? "yes" : "no"; | ||
423 | break; | ||
424 | case VERTMAX: | ||
425 | result = (fbwin && fbwin->isMaximizedVert()) ? "yes" : "no"; | ||
426 | break; | ||
427 | case HORZMAX: | ||
428 | result = (fbwin && fbwin->isMaximizedHorz()) ? "yes" : "no"; | ||
429 | break; | ||
414 | case SHADED: | 430 | case SHADED: |
415 | result = (fbwin && fbwin->isShaded()) ? "yes" : "no"; | 431 | result = (fbwin && fbwin->isShaded()) ? "yes" : "no"; |
416 | break; | 432 | break; |
diff --git a/src/ClientPattern.hh b/src/ClientPattern.hh index 315edb1..a5b7206 100644 --- a/src/ClientPattern.hh +++ b/src/ClientPattern.hh | |||
@@ -55,7 +55,7 @@ public: | |||
55 | TITLE = 0, CLASS, NAME, ROLE, TRANSIENT, | 55 | TITLE = 0, CLASS, NAME, ROLE, TRANSIENT, |
56 | MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN, | 56 | MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN, |
57 | WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT, SCREEN, | 57 | WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT, SCREEN, |
58 | XPROP | 58 | XPROP, FULLSCREEN, VERTMAX, HORZMAX |
59 | }; | 59 | }; |
60 | 60 | ||
61 | /// Does this client match this pattern? | 61 | /// Does this client match this pattern? |