aboutsummaryrefslogtreecommitdiff
path: root/src/WinClient.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-04-14 12:13:36 (GMT)
committerfluxgen <fluxgen>2003-04-14 12:13:36 (GMT)
commitf4ce449632eeb85aaeae63f32a7165d71047cde0 (patch)
tree22c3cf8815c69cf4397d0567fd07327e988f9981 /src/WinClient.hh
parent0c895209d2d1425389100e6be734b960475c6883 (diff)
downloadfluxbox-f4ce449632eeb85aaeae63f32a7165d71047cde0.zip
fluxbox-f4ce449632eeb85aaeae63f32a7165d71047cde0.tar.bz2
merged with embedded-tab-branch
Diffstat (limited to 'src/WinClient.hh')
-rw-r--r--src/WinClient.hh112
1 files changed, 112 insertions, 0 deletions
diff --git a/src/WinClient.hh b/src/WinClient.hh
new file mode 100644
index 0000000..6cd14dd
--- /dev/null
+++ b/src/WinClient.hh
@@ -0,0 +1,112 @@
1// WinClient.hh for Fluxbox - an X11 Window manager
2// Copyright (c) 2003 Henrik Kinnunen (fluxgen(at)users.sourceforge.net)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22// $Id: WinClient.hh,v 1.2 2003/04/14 12:08:21 fluxgen Exp $
23
24#ifndef WINCLIENT_HH
25#define WINCLIENT_HH
26
27#include "BaseDisplay.hh"
28#include "Subject.hh"
29#include "FbWindow.hh"
30
31#include <X11/Xutil.h>
32#include <string>
33
34class FluxboxWindow;
35
36/// Holds client window info
37class WinClient:public FbTk::FbWindow {
38public:
39 typedef std::list<FluxboxWindow *> TransientList;
40
41 WinClient(Window win, FluxboxWindow &fbwin);
42
43 ~WinClient();
44 void updateRect(int x, int y, unsigned int width, unsigned int height);
45 void sendFocus();
46 void sendClose();
47 void reparent(Window win, int x, int y);
48 bool getAttrib(XWindowAttributes &attr) const;
49 bool getWMName(XTextProperty &textprop) const;
50 bool getWMIconName(XTextProperty &textprop) const;
51 void updateTitle();
52 void updateIconTitle();
53
54 /// notifies when this client dies
55 FbTk::Subject &dieSig() { return m_diesig; }
56
57 /// updates transient window information
58 void updateTransientInfo();
59 FluxboxWindow *transientFor() { return transient_for; }
60 const FluxboxWindow *transientFor() const { return transient_for; }
61 TransientList &transientList() { return transients; }
62 const TransientList &transientList() const { return transients; }
63 bool operator == (const FluxboxWindow &win) const {
64 return (m_win == &win);
65 }
66
67 const std::string &title() const { return m_title; }
68 const std::string &iconTitle() const { return m_icon_title; }
69 const FluxboxWindow *fbwindow() const { return m_win; }
70 FluxboxWindow *fbwindow() { return m_win; }
71 /**
72 !! TODO !!
73 remove or move these to private
74 */
75
76 FluxboxWindow *transient_for; // which window are we a transient for?
77 std::list<FluxboxWindow *> transients; // which windows are our transients?
78 Window window_group;
79
80
81 int x, y, old_bw;
82 unsigned int
83 min_width, min_height, max_width, max_height, width_inc, height_inc,
84 min_aspect_x, min_aspect_y, max_aspect_x, max_aspect_y,
85 base_width, base_height, win_gravity;
86 unsigned long initial_state, normal_hint_flags, wm_hint_flags;
87
88 // this structure only contains 3 elements... the Motif 2.0 structure contains
89 // 5... we only need the first 3... so that is all we will define
90 typedef struct MwmHints {
91 unsigned long flags; // Motif wm flags
92 unsigned long functions; // Motif wm functions
93 unsigned long decorations; // Motif wm decorations
94 } MwmHints;
95
96 MwmHints *mwm_hint;
97 BaseDisplay::BlackboxHints *blackbox_hint;
98 FluxboxWindow *m_win;
99 class WinClientSubj: public FbTk::Subject {
100 public:
101 explicit WinClientSubj(WinClient &client):m_winclient(client) { }
102 WinClient &winClient() { return m_winclient; }
103 private:
104 WinClient &m_winclient;
105 };
106
107private:
108 std::string m_title, m_icon_title;
109 WinClientSubj m_diesig;
110};
111
112#endif // WINCLIENT_HH