From 610a15ac47371c5cbd4c2dcf6eec696aec5bb4fa Mon Sep 17 00:00:00 2001
From: Mark Tiefenbruck <mark@fluxbox.org>
Date: Sun, 1 Jul 2012 21:22:01 -0700
Subject: add fullscreen, maximizedhorizontal, and maximizedvertical tests to
 ClientPattern

---
 doc/asciidoc/client-patterns.txt |  9 +++++++++
 src/ClientPattern.cc             | 18 +++++++++++++++++-
 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':::
 *Maximized*;;
 	Either *yes* or *no*, depending on whether the window is maximized or
 	not.
+*MaximizedHorizontal*;;
+	Either *yes* or *no*, depending on whether the window is maximized
+	horizontally or not.
+*MaximizedVertical*;;
+	Either *yes* or *no*, depending on whether the window is maximized
+	vertically or not.
 *Minimized*;;
 	Either *yes* or *no*, depending on whether the window is minimized
 	(iconified) or not.
+*Fullscreen*;;
+	Either *yes* or *no*, depending on whether the window is fullscreen or
+	not.
 *Shaded*;;
 	Either *yes* or *no*, depending on whether the window is shaded or
 	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 {
     ClientPattern::WinProperty prop;
 };
 
-const Name2WinProperty name_2_winproperties[] = { // sorted for 'bsearch'
+// sorted alphabetically for 'bsearch'
+const Name2WinProperty name_2_winproperties[] = {
     { "class", ClientPattern::CLASS },
     { "focushidden", ClientPattern::FOCUSHIDDEN },
+    { "fullscreen", ClientPattern::FULLSCREEN },
     { "head", ClientPattern::HEAD },
     { "iconhidden", ClientPattern::ICONHIDDEN },
     { "layer", ClientPattern::LAYER },
     { "maximized", ClientPattern::MAXIMIZED },
+    { "maximizedhorizontal", ClientPattern::HORZMAX },
+    { "maximizedvertical", ClientPattern::VERTMAX },
     { "minimized", ClientPattern::MINIMIZED },
     { "name", ClientPattern::NAME },
     { "role", ClientPattern::ROLE },
@@ -132,6 +136,9 @@ Prop2String property_2_strings[] = { // sorted by 'prop'
     { ClientPattern::URGENT, "urgent" },
     { ClientPattern::SCREEN, "screen" },
     { ClientPattern::XPROP, "@" },
+    { ClientPattern::FULLSCREEN, "fullscreen" },
+    { ClientPattern::VERTMAX, "maximizedvertical" },
+    { ClientPattern::HORZMAX, "maximizedhorizontal" },
 };
 
 
@@ -411,6 +418,15 @@ FbTk::FbString ClientPattern::getProperty(WinProperty prop, const Focusable &cli
     case MINIMIZED:
         result = (fbwin && fbwin->isIconic()) ? "yes" : "no";
         break;
+    case FULLSCREEN:
+        result = (fbwin && fbwin->isFullscreen()) ? "yes" : "no";
+        break;
+    case VERTMAX:
+        result = (fbwin && fbwin->isMaximizedVert()) ? "yes" : "no";
+        break;
+    case HORZMAX:
+        result = (fbwin && fbwin->isMaximizedHorz()) ? "yes" : "no";
+        break;
     case SHADED:
         result = (fbwin && fbwin->isShaded()) ? "yes" : "no";
         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:
         TITLE = 0, CLASS, NAME, ROLE, TRANSIENT,
         MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN,
         WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT, SCREEN,
-        XPROP
+        XPROP, FULLSCREEN, VERTMAX, HORZMAX
     };
 
     /// Does this client match this pattern?
-- 
cgit v0.11.2