aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-17 01:20:49 (GMT)
committerfluxgen <fluxgen>2003-12-17 01:20:49 (GMT)
commit175a9ace5212ef3035c7b78fd83b155476680a4a (patch)
treed11d6951e1a54469f02a1e12a2761c13e6cec8af
parentf89c71c0db3ace047429028c6b3e21e1016c3f03 (diff)
downloadfluxbox-175a9ace5212ef3035c7b78fd83b155476680a4a.zip
fluxbox-175a9ace5212ef3035c7b78fd83b155476680a4a.tar.bz2
rearrangement and some minor style cleaning
-rw-r--r--src/WinClient.hh125
1 files changed, 69 insertions, 56 deletions
diff --git a/src/WinClient.hh b/src/WinClient.hh
index c93a76d..a3fa8d9 100644
--- a/src/WinClient.hh
+++ b/src/WinClient.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: WinClient.hh,v 1.15 2003/09/29 14:58:15 rathnor Exp $ 22// $Id: WinClient.hh,v 1.16 2003/12/17 01:20:49 fluxgen Exp $
23 23
24#ifndef WINCLIENT_HH 24#ifndef WINCLIENT_HH
25#define WINCLIENT_HH 25#define WINCLIENT_HH
@@ -38,70 +38,50 @@ class Strut;
38class WinClient:public FbTk::FbWindow { 38class WinClient:public FbTk::FbWindow {
39public: 39public:
40 typedef std::list<WinClient *> TransientList; 40 typedef std::list<WinClient *> TransientList;
41 // this structure only contains 3 elements... the Motif 2.0 structure contains
42 // 5... we only need the first 3... so that is all we will define
43 typedef struct MwmHints {
44 unsigned long flags; // Motif wm flags
45 unsigned long functions; // Motif wm functions
46 unsigned long decorations; // Motif wm decorations
47 } MwmHints;
41 48
42 WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin = 0); 49 WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin = 0);
43 50
44 ~WinClient(); 51 ~WinClient();
52
45 void updateRect(int x, int y, unsigned int width, unsigned int height); 53 void updateRect(int x, int y, unsigned int width, unsigned int height);
54
46 bool sendFocus(); // returns whether we sent a message or not 55 bool sendFocus(); // returns whether we sent a message or not
47 // i.e. whether we assume the focus will get taken 56 // i.e. whether we assume the focus will get taken
48 void sendClose(bool forceful = false); 57 void sendClose(bool forceful = false);
49 // not aware of anything that makes this false at present 58 // not aware of anything that makes this false at present
50 inline bool isClosable() const { return true; } 59 inline bool isClosable() const { return true; }
51 void reparent(Window win, int x, int y); 60 void reparent(Window win, int x, int y);
52 bool getAttrib(XWindowAttributes &attr) const; 61
53 bool getWMName(XTextProperty &textprop) const; 62 void addModal(); // some transient of ours (or us) is modal
54 bool getWMIconName(XTextProperty &textprop) const; 63 void removeModal(); // some transient (or us) is no longer modal
55 /// @return name member of class structure 64
56 const std::string &getWMClassName() const;
57 /// @return class member of class structure
58 const std::string &getWMClassClass() const;
59 /// updates from wm class hints 65 /// updates from wm class hints
60 void updateWMClassHint(); 66 void updateWMClassHint();
61 void updateWMProtocols(); 67 void updateWMProtocols();
62 68
63 inline const std::string &getTitle() const { return m_title; } 69
64 void updateTitle(); 70 void updateTitle();
65 void updateIconTitle(); 71 void updateIconTitle();
66 BScreen &screen() { return m_screen; }
67 const BScreen &screen() const { return m_screen; }
68 /// notifies when this client dies
69 FbTk::Subject &dieSig() { return m_diesig; }
70
71 /// updates transient window information 72 /// updates transient window information
72 void updateTransientInfo(); 73 void updateTransientInfo();
73 WinClient *transientFor() { return transient_for; }
74 const WinClient *transientFor() const { return transient_for; }
75 TransientList &transientList() { return transients; }
76 const TransientList &transientList() const { return transients; }
77 bool isTransient() const { return transient_for != 0; }
78
79 bool isModal() const { return m_modal > 0; }
80 void addModal(); // some transient of ours (or us) is modal
81 void removeModal(); // some transient (or us) is no longer modal
82 74
83 bool operator == (const FluxboxWindow &win) const { 75 void updateBlackboxHints();
84 return (m_win == &win); 76 void updateMWMHints();
85 } 77 void updateWMHints();
78 void updateWMNormalHints();
86 79
87 void setStrut(Strut *strut); 80 void setStrut(Strut *strut);
88 void clearStrut(); 81 void clearStrut();
89 82
90 bool focus(); // calls Window->setCurrentClient to give focus to this client 83 bool focus(); // calls Window->setCurrentClient to give focus to this client
91 84
92 const std::string &title() const { return m_title; }
93 const std::string &iconTitle() const { return m_icon_title; }
94 const FluxboxWindow *fbwindow() const { return m_win; }
95 FluxboxWindow *fbwindow() { return m_win; }
96
97 static const int PropBlackboxHintsElements = 5;
98 static const int PropMwmHintsElements = 3;
99
100 void updateBlackboxHints();
101 void updateMWMHints();
102 void updateWMHints();
103 void updateWMNormalHints();
104
105 /** 85 /**
106 * Changes width and height to the nearest (lower) value 86 * Changes width and height to the nearest (lower) value
107 * that conforms to it's size hints. 87 * that conforms to it's size hints.
@@ -112,16 +92,62 @@ public:
112 */ 92 */
113 void applySizeHints(int &width, int &height, int *display_width = 0, int *display_height = 0); 93 void applySizeHints(int &width, int &height, int *display_width = 0, int *display_height = 0);
114 94
115 // grouping is tracked by remembering the window to the left in the group 95
116 Window getGroupLeftWindow() const;
117 void setGroupLeftWindow(Window win); 96 void setGroupLeftWindow(Window win);
118 bool hasGroupLeftWindow() const; 97
98 void saveBlackboxAttribs(FluxboxWindow::BlackboxAttributes &blackbox_attribs);
119 99
120 // does this client have a pending unmap or destroy event? 100 // does this client have a pending unmap or destroy event?
121 bool validateClient() const; 101 bool validateClient() const;
122 102
103 //
104 // accessors
105 //
106
107 bool getAttrib(XWindowAttributes &attr) const;
108 bool getWMName(XTextProperty &textprop) const;
109 bool getWMIconName(XTextProperty &textprop) const;
110 /// @return name member of class structure
111 const std::string &getWMClassName() const;
112 /// @return class member of class structure
113 const std::string &getWMClassClass() const;
114
115 BScreen &screen() { return m_screen; }
116 const BScreen &screen() const { return m_screen; }
117 /// notifies when this client dies
118 FbTk::Subject &dieSig() { return m_diesig; }
119
120 inline WinClient *transientFor() { return transient_for; }
121 inline const WinClient *transientFor() const { return transient_for; }
122 inline TransientList &transientList() { return transients; }
123 inline const TransientList &transientList() const { return transients; }
124 inline bool isTransient() const { return transient_for != 0; }
125
126 inline bool isModal() const { return m_modal > 0; }
127
128 inline bool operator == (const FluxboxWindow &win) const {
129 return (m_win == &win);
130 }
131
132
133 inline const std::string &title() const { return m_title; }
134 inline const std::string &iconTitle() const { return m_icon_title; }
135 inline const FluxboxWindow *fbwindow() const { return m_win; }
136 inline FluxboxWindow *fbwindow() { return m_win; }
123 inline int gravity() const { return m_win_gravity; } 137 inline int gravity() const { return m_win_gravity; }
124 138
139 bool hasGroupLeftWindow() const;
140 // grouping is tracked by remembering the window to the left in the group
141 Window getGroupLeftWindow() const;
142
143 inline int getFocusMode() const { return m_focus_mode; }
144 inline const FluxboxWindow::BlackboxHints *getBlackboxHint() const { return m_blackbox_hint; }
145 inline const MwmHints *getMwmHint() const { return m_mwm_hint; }
146
147
148 static const int PropBlackboxHintsElements = 5;
149 static const int PropMwmHintsElements = 3;
150
125 /** 151 /**
126 !! TODO !! 152 !! TODO !!
127 remove or move these to private 153 remove or move these to private
@@ -139,13 +165,6 @@ public:
139 base_width, base_height; 165 base_width, base_height;
140 unsigned long initial_state, normal_hint_flags, wm_hint_flags; 166 unsigned long initial_state, normal_hint_flags, wm_hint_flags;
141 167
142 // this structure only contains 3 elements... the Motif 2.0 structure contains
143 // 5... we only need the first 3... so that is all we will define
144 typedef struct MwmHints {
145 unsigned long flags; // Motif wm flags
146 unsigned long functions; // Motif wm functions
147 unsigned long decorations; // Motif wm decorations
148 } MwmHints;
149 168
150 FluxboxWindow *m_win; 169 FluxboxWindow *m_win;
151 class WinClientSubj: public FbTk::Subject { 170 class WinClientSubj: public FbTk::Subject {
@@ -156,13 +175,7 @@ public:
156 WinClient &m_winclient; 175 WinClient &m_winclient;
157 }; 176 };
158 177
159 inline int getFocusMode() const { return m_focus_mode; } 178 enum FocusMode { F_NOINPUT = 0, F_PASSIVE, F_LOCALLYACTIVE, F_GLOBALLYACTIVE };
160 inline const FluxboxWindow::BlackboxHints *getBlackboxHint() const {
161 return m_blackbox_hint; }
162 void saveBlackboxAttribs(FluxboxWindow::BlackboxAttributes &blackbox_attribs);
163 inline const MwmHints *getMwmHint() const { return m_mwm_hint; }
164
165 enum { F_NOINPUT = 0, F_PASSIVE, F_LOCALLYACTIVE, F_GLOBALLYACTIVE };
166 179
167private: 180private:
168 // number of transients which we are modal for 181 // number of transients which we are modal for