17#include <tqvaluevector.h>
21#include "lib/kdecoration.h"
47 :
public KDecorationDefines
50 WindowRules(
const TQValueVector< Rules* >& rules );
53 void discardTemporary();
54 bool contains(
const Rules* rule )
const;
55 void remove( Rules* rule );
56 Placement::Policy checkPlacement( Placement::Policy placement )
const;
57 TQRect checkGeometry( TQRect rect,
bool init =
false )
const;
59 TQPoint checkPosition( TQPoint pos,
bool init =
false )
const;
60 TQSize checkSize( TQSize s,
bool init =
false )
const;
61 TQSize checkMinSize( TQSize s )
const;
62 TQSize checkMaxSize( TQSize s )
const;
63 int checkOpacityActive(
int s)
const;
64 int checkOpacityInactive(
int s)
const;
65 bool checkIgnoreGeometry(
bool ignore )
const;
66 int checkDesktop(
int desktop,
bool init =
false )
const;
67 NET::WindowType checkType( NET::WindowType type )
const;
68 MaximizeMode checkMaximize( MaximizeMode mode,
bool init =
false )
const;
69 bool checkMinimize(
bool minimized,
bool init =
false )
const;
70 ShadeMode checkShade( ShadeMode shade,
bool init =
false )
const;
71 bool checkSkipTaskbar(
bool skip,
bool init =
false )
const;
72 bool checkSkipPager(
bool skip,
bool init =
false )
const;
73 bool checkKeepAbove(
bool above,
bool init =
false )
const;
74 bool checkKeepBelow(
bool below,
bool init =
false )
const;
75 bool checkFullScreen(
bool fs,
bool init =
false )
const;
76 bool checkNoBorder(
bool noborder,
bool init =
false )
const;
77 int checkFSP(
int fsp )
const;
78 bool checkAcceptFocus(
bool focus )
const;
79 Options::MoveResizeMode checkMoveResizeMode( Options::MoveResizeMode mode )
const;
80 bool checkCloseable(
bool closeable )
const;
81 bool checkStrictGeometry(
bool strict )
const;
82 TQString checkShortcut( TQString s,
bool init =
false )
const;
83 bool checkDisableGlobalShortcuts(
bool disable )
const;
84 bool checkIgnorePosition(
bool ignore )
const;
95 MaximizeMode checkMaximizeVert( MaximizeMode mode,
bool init )
const;
96 MaximizeMode checkMaximizeHoriz( MaximizeMode mode,
bool init )
const;
97 TQValueVector< Rules* > rules;
102 :
public KDecorationDefines
107 Rules(
const TQString&,
bool temporary );
108 void write( TDEConfig& )
const;
109 bool isEmpty()
const;
111 void discardUsed(
bool withdrawn );
112 bool match(
const Client* c )
const;
113 bool update( Client* );
114 bool isTemporary()
const;
115 bool discardTemporary(
bool force );
116 bool applyPlacement( Placement::Policy& placement )
const;
117 bool applyGeometry( TQRect& rect,
bool init )
const;
119 bool applyPosition( TQPoint& pos,
bool init )
const;
120 bool applySize( TQSize& s,
bool init )
const;
121 bool applyMinSize( TQSize& s )
const;
122 bool applyMaxSize( TQSize& s )
const;
123 bool applyOpacityActive(
int& s)
const;
124 bool applyOpacityInactive(
int& s)
const;
125 bool applyIgnoreGeometry(
bool& ignore )
const;
126 bool applyDesktop(
int& desktop,
bool init )
const;
127 bool applyType( NET::WindowType& type )
const;
128 bool applyMaximizeVert( MaximizeMode& mode,
bool init )
const;
129 bool applyMaximizeHoriz( MaximizeMode& mode,
bool init )
const;
130 bool applyMinimize(
bool& minimized,
bool init )
const;
131 bool applyShade( ShadeMode& shade,
bool init )
const;
132 bool applySkipTaskbar(
bool& skip,
bool init )
const;
133 bool applySkipPager(
bool& skip,
bool init )
const;
134 bool applyKeepAbove(
bool& above,
bool init )
const;
135 bool applyKeepBelow(
bool& below,
bool init )
const;
136 bool applyFullScreen(
bool& fs,
bool init )
const;
137 bool applyNoBorder(
bool& noborder,
bool init )
const;
138 bool applyFSP(
int& fsp )
const;
139 bool applyAcceptFocus(
bool& focus )
const;
140 bool applyMoveResizeMode( Options::MoveResizeMode& mode )
const;
141 bool applyCloseable(
bool& closeable )
const;
142 bool applyStrictGeometry(
bool& strict )
const;
143 bool applyShortcut( TQString& shortcut,
bool init )
const;
144 bool applyDisableGlobalShortcuts(
bool& disable )
const;
145 bool applyIgnorePosition(
bool& ignore )
const;
148 bool matchType( NET::WindowType match_type )
const;
149 bool matchWMClass(
const TQCString& match_class,
const TQCString& match_name )
const;
150 bool matchRole(
const TQCString& match_role )
const;
151 bool matchTitle(
const TQString& match_title )
const;
152 bool matchClientMachine(
const TQCString& match_machine )
const;
166 UnusedSetRule = Unused,
171 UnusedForceRule = Unused,
177 UnimportantMatch = FirstStringMatch,
181 LastStringMatch = RegExpMatch
183 void readFromCfg( TDEConfig& cfg );
184 static SetRule readSetRule( TDEConfig&,
const TQString& key );
185 static ForceRule readForceRule( TDEConfig&,
const TQString& key );
186 static NET::WindowType readType( TDEConfig&,
const TQString& key );
188 static bool checkSetRule( SetRule rule,
bool init );
189 static bool checkForceRule( ForceRule rule );
190 static bool checkSetStop( SetRule rule );
191 static bool checkForceStop( ForceRule rule );
194 TQString description;
196 StringMatch wmclassmatch;
197 bool wmclasscomplete;
198 TQCString windowrole;
199 StringMatch windowrolematch;
201 StringMatch titlematch;
203 StringMatch extrarolematch;
204 TQCString clientmachine;
205 StringMatch clientmachinematch;
207 Placement::Policy placement;
208 ForceRule placementrule;
210 SetRule positionrule;
214 ForceRule minsizerule;
216 ForceRule maxsizerule;
218 ForceRule opacityactiverule;
220 ForceRule opacityinactiverule;
222 ForceRule ignorepositionrule;
225 NET::WindowType type;
228 SetRule maximizevertrule;
230 SetRule maximizehorizrule;
232 SetRule minimizerule;
236 SetRule skiptaskbarrule;
238 SetRule skippagerrule;
244 SetRule fullscreenrule;
246 SetRule noborderrule;
248 ForceRule fsplevelrule;
250 ForceRule acceptfocusrule;
251 Options::MoveResizeMode moveresizemode;
252 ForceRule moveresizemoderule;
254 ForceRule closeablerule;
256 ForceRule strictgeometryrule;
258 SetRule shortcutrule;
259 bool disableglobalshortcuts;
260 ForceRule disableglobalshortcutsrule;
261 friend kdbgstream& operator<<( kdbgstream& stream,
const Rules* );
266bool Rules::checkSetRule( SetRule rule,
bool init )
268 if( rule > ( SetRule )DontAffect)
270 if( rule == ( SetRule )Force || rule == ( SetRule ) ApplyNow
271 || rule == ( SetRule ) ForceTemporarily || init )
278bool Rules::checkForceRule( ForceRule rule )
280 return rule == ( ForceRule )Force || rule == ( ForceRule ) ForceTemporarily;
284bool Rules::checkSetStop( SetRule rule )
286 return rule != UnusedSetRule;
290bool Rules::checkForceStop( ForceRule rule )
292 return rule != UnusedForceRule;
296WindowRules::WindowRules(
const TQValueVector< Rules* >& r )
302WindowRules::WindowRules()
307bool WindowRules::contains(
const Rules* rule )
const
309 return tqFind( rules.begin(), rules.end(), rule ) != rules.end();
313void WindowRules::remove( Rules* rule )
315 TQValueVector< Rules* >::Iterator pos = tqFind( rules.begin(), rules.end(), rule );
316 if( pos != rules.end())
324kndbgstream& operator<<( kndbgstream& stream,
const Rules* ) {
return stream; }
326kdbgstream& operator<<( kdbgstream& stream,
const Rules* );
The Client class encapsulates a window decoration frame.
The result of the apply* functions (at the time of writing there is only one: applyNoBorder()) which ...