CTWM
Loading...
Searching...
No Matches
/usr/src/RPM/BUILD/ctwm-4.1.0/twm_window_struct.h
Go to the documentation of this file.
1/**
2 * \file
3 * TwmWindow struct definition.
4 *
5 * This previously lived in ctwm.h, but was moved out here to make it a
6 * bit easier to scan either this struct or all the other stuff in
7 * ctwm.h, without so much rooting around. It's \#include'd in ctwm.h,
8 * and shouldn't be included elsewhere; it's split out purely for
9 * dev ease.
10 */
11#ifndef _CTWM_TWM_WINDOW_STRUCT_H
12#define _CTWM_TWM_WINDOW_STRUCT_H
13
14/* Needed for doxygen to get at the #define's for config (like EMWH) */
15#ifdef DOXYGEN
16# include "ctwm_config.h"
17#endif
18
19
20/**
21 * Info and control for every X Window we take over.
22 *
23 * As a window manager, our job is to... y'know. Manage windows. Every
24 * other window on the screen we wrap and control (as well as a few of
25 * our internal windows) gets one of these structs put around it to hold
26 * the various config and state info we track about it. They get put
27 * into various linked lists for each screen and workspace, and
28 * references get stashed in X Contexts so we can find the window that
29 * events happen on.
30 *
31 * Much of this is initially setup in AddWindow() when we find out about
32 * and take over a window.
33 */
34struct TwmWindow {
35 struct TwmWindow *next; ///< Next TwmWindow on the Screen
36 struct TwmWindow *prev; ///< Previous TwmWindow on the Screen
37
38 /// OTP control info for stacking. Created in OtpAdd().
40
41 /// The actual X Window handle
43
44 /// Original window border width before we took it over and made our
45 /// own bordering. This comes from the XWindowAttributes we get from
46 /// XGetWindowAttributes().
47 int old_bw;
48
49 /**
50 * \defgroup win_frame Window frame bits
51 * These fields are related to the "frame" window; the decoration we
52 * put around the application's own window (the thing in TwmWindow.w
53 * above) to display borders, titlebars, etc.
54 * @{
55 */
56 Window frame; ///< The X window for the overall frame
57 Window title_w; ///< The title bar Window
58 Window hilite_wl; ///< Left hilite window in titlebar
59 Window hilite_wr; ///< Right hilite window in titlebar
60 Window lolite_wl; ///< Left lolite window in titlebar
61 Window lolite_wr; ///< Right lolite window in titlebar
62
63 /// Current resize cursor. This changes depending on where on the
64 /// frame you are, if we're making them. \sa
65 /// ScreenInfo.BorderCursors
67
68 /// Pixmap to which the border is set to when window isn't focused.
69 /// \sa TwmWindow.borderC \sa SetFocusVisualAttributes()
70 /// \todo See the XXX in SetFocusVisualAttributes()
72
73 /// @}
74
75 struct Icon *icon; ///< The current icon. \sa CreateIconWindow()
76 name_list *iconslist; ///< The current list of potential icons
77
78 /// \addtogroup win_frame Window frame bits
79 /// @{
80 int frame_x; ///< X position on screen of frame
81 int frame_y; ///< Y position on screen of frame
82 unsigned int frame_width; ///< Width of frame
83 unsigned int frame_height; ///< Height of frame
84
85 /// 2d border width. \sa ScreenInfo.BorderWidth
87 /// 3d border width. \sa ScreenInfo.ThreeDBorderWidth
89
90 int actual_frame_x; ///< Saved frame_x when squeezed
91 int actual_frame_y; ///< Saved frame_y when squeezed
92 unsigned int actual_frame_width; ///< Saved frame_width when squeezed
93 unsigned int actual_frame_height; ///< Saved frame_height when squeezed
94
95 /// X coord of window title relative to title_w.
96 /// \sa ComputeTitleLocation()
98 /// Y coord of window title relative to title_w.
99 /// \sa ComputeTitleLocation()
101
102 unsigned int title_height; ///< Height of the full title bar
103 unsigned int title_width; ///< Width of the full title bar
104
105 /// @}
106
107 char *name; ///< Current window name. Points into TwmWindow::names.
108 char *icon_name; ///< Current icon name. Points into TwmWindow::names.
109
110 /// Various sources of window/icon names. These are the values from
111 /// the various window properties we look at to get the results. The
112 /// TwmWindow::name and TwmWindow::icon_name point to the currently
113 /// active element in here.
114 struct _names {
115 char *ctwm_wm_name; ///< Name from override CTWM_WM_NAME property
116#ifdef EWMH
117 char *net_wm_name; ///< Name from EWMH _NET_WM_NAME property
118#endif
119 char *wm_name; ///< Name from ICCCM WM_NAME property
120
121 /// Icon name from override CTWM_WM_ICON_NAME property
123#ifdef EWMH
124 /// Icon name from EWMH _NET_WM_ICON_NAME property
125 char *net_wm_icon_name;
126#endif
127 char *wm_icon_name; ///< Icon name from WM_ICON_NAME property
128
129 /// Whether an icon name property has been set. Since we default
130 /// the icon name to the window name when nothing is given, this
131 /// flag allows the window-name-setting code to know when it
132 /// needs to re-kick the icon-name-setting.
134 } names; ///< \copydoc TwmWindow::_names
135
136 /// \addtogroup win_frame Window frame bits
137 /// @{
138
139 /// Position of window title text, relative to title_w. Starts from
140 /// \ref title_x, but may be pushed over due to TitleJustification
141 /// config.
143 unsigned int name_width; ///< width of name text
144 int highlightxl; ///< Position of \ref hilite_wl and \ref lolite_wl
145 int highlightxr; ///< Position of \ref hilite_wr and \ref lolite_wr
146 int rightx; ///< Position of of right titlebar buttons
147 /// @}
148
149 /// Window attributes from XGetWindowAttributes()
151 /// Window size hints. From WM_NORMAL_HINTS property.
152 /// \sa GetWindowSizeHints()
154 /// Window manager hints. From WM_HINTS property, filled in via
155 /// XGetWMHints().
157 Window group; ///< Window group, from WM hints.
158 XClassHint class; ///< Window class info. From XGetClassHint().
159
160 /// List of the icon managers the window is in. \sa AddIconManager()
162
163 ColorPair borderC; ///< ColorPair for focused window borders
164 ColorPair border_tile; ///< ColorPair for non-focused window borders
165 ColorPair title; ///< ColorPair for various other titlebar bits
166
167 /// Has the window ever been iconified?
168 /// \todo This is almost write-only, and the one reader seems bogus
169 /// in light of what it does. Investigate further and possibly
170 /// remove.
172
173 bool isicon; ///< Is the window an icon now ?
174 bool icon_on; ///< Is the icon visible
175 bool mapped; ///< Is the window mapped ?
176 bool squeezed; ///< Is the window squeezed ?
177 bool auto_raise; ///< Should we auto-raise this window ?
178 bool auto_lower; ///< Should we auto-lower this window ?
179 bool forced; ///< Has had an icon forced upon it
180 bool icon_moved; ///< User explicitly moved the icon
181 bool highlight; ///< Should highlight this window
182 bool stackmode; ///< Honor stackmode requests. \sa ScreenInfo.StackMode
183 bool iconify_by_unmapping; ///< Unmap window to iconify it
184 bool isiconmgr; ///< This is an icon manager window
185 bool iswspmgr; ///< This is a workspace manager window
186 bool isoccupy; ///< This is an Occupy window
187
188 bool istransient; ///< This is a transient window
189 /// What window it's transient for. From XGetTransientForHint() and
190 /// XM_TRANSIENT_FOR property.
192
193 bool titlehighlight; ///< Should I highlight the title bar?
194
195 /// Pointer to the icon manager structure, for windows that are icon
196 /// managers. Currently also set for some other window types to
197 /// various things, but is only ever used for icon manager windows
198 /// (\ref isiconmgr = true).
200
201 int save_frame_x; ///< x position of frame (saved from zoom)
202 int save_frame_y; ///< y position of frame (saved from zoom)
203 unsigned int save_frame_width; ///< width of frame (saved from zoom)
204 unsigned int save_frame_height; ///< height of frame (saved from zoom)
205 int zoomed; ///< ZOOM_NONE || function causing zoom
206 bool wShaped; ///< This window is Shape'd
207 /// Which protocols this window handles. From WM_PROTOCOLS property
208 /// via XGetWMProtocols()
209 unsigned long protocols;
210 Colormaps cmaps; ///< colormaps for this application
211 /// Button windows in the titlebar. \ingroup win_frame
213 SqueezeInfo *squeeze_info; ///< Control info for title squeezing
214 bool squeeze_info_copied; ///< Should ->squeeze_info be free()'d?
215
216 /// Window ring connectivity
217 struct _ring {
218 struct TwmWindow *next; ///< Next window in the ring
219 struct TwmWindow *prev; ///< Previous window in the ring
220 bool cursor_valid; ///< Whether curs_x and curs_y are usable
221 int curs_x; ///< Stored cursor position in the window
222 int curs_y; ///< Stored cursor position in the window
223 } ring; ///< \copydoc TwmWindow::_ring
224 // x-ref ScreenInfo.InfoWindow about doxygen hackery
225
226 // Many of these are just the window's particular casing of various
227 // config params, inherited from the screen's info. In most cases,
228 // they're essentially a read-only cache.
229 bool OpaqueMove; ///< Move opaquely. \sa ScreenInfo.DoOpaqueMove
230 bool OpaqueResize; ///< Resize opaquely. \sa ScreenInfo.DoOpaqueResize
231 bool UnmapByMovingFarAway; ///< \sa ScreenInfo.UnmapByMovingFarAway
232 bool AutoSqueeze; ///< \sa ScreenInfo.AutoSqueeze
233 bool StartSqueezed; ///< \sa ScreenInfo.StartSqueezed
234 bool AlwaysSqueezeToGravity; ///< \sa ScreenInfo.AlwaysSqueezeToGravity
235 bool DontSetInactive; ///< \sa ScreenInfo.DontSetInactive
236
237 bool hasfocusvisible; ///< The window visibly has focus
238
239 int occupation; ///< Workspaces the window is in (bitmap)
240
241 Image *HiliteImage; ///< Titlebar hilite backround. \ingroup win_frame
242 Image *LoliteImage; ///< Titlebar lolite backround. \ingroup win_frame
243
244 /// WindowRegion containing this window. \todo Write-only? Reap?
246#ifdef WINBOX
247 WindowBox *winbox; ///< WindowBox containing this window.
248 bool iswinbox; ///< This is a WindowBox window.
249#endif
250
251 /// Saved window geometry. Used in f.savegeometry and
252 /// f.restoregeometry.
254 int x; ///< Saved x coord
255 int y; ///< Saved y coord
256 unsigned int width; ///< Saved width
257 unsigned int height; ///< Saved height
258 } savegeometry; ///< \copydoc TwmWindow::_savegeometry
259
260 /// Where the window is currently mapped (may be NULL)
262 /// Where the window is parented. Always set.
264
265 /// Where the window would be. Used only by f.showbackground.
266 /// \sa ShowBackground()
268
269 /// Has \ref TwmWindow::name ever changed? Used only in session saving.
271 /// Has \ref TwmWindow::attr width ever changed? Used only in sessions.
273 /// Has \ref TwmWindow::attr height ever changed? Used only in sessions.
275
276#ifdef EWMH
277 EwmhWindowType ewmhWindowType; ///< EWMH-defined window type
278 int ewmhFlags; ///< EWMH-defined window stats. Mostly from _NET_WM_STATE.
279#endif /* EWMH */
280};
281
282#endif /* _CTWM_TWM_WINDOW_STRUCT_H */
static int PlaceX
Definition add_window.c:82
EwmhWindowType
Definition ewmh.h:16
int frame_x
X position on screen of frame.
Window hilite_wl
Left hilite window in titlebar.
Image * LoliteImage
Titlebar lolite backround.
int actual_frame_x
Saved frame_x when squeezed.
int actual_frame_y
Saved frame_y when squeezed.
Window lolite_wl
Left lolite window in titlebar.
unsigned int title_width
Width of the full title bar.
Window hilite_wr
Right hilite window in titlebar.
int title_x
X coord of window title relative to title_w.
unsigned int actual_frame_height
Saved frame_height when squeezed.
Image * HiliteImage
Titlebar hilite backround.
int frame_y
Y position on screen of frame.
unsigned int name_width
width of name text
int rightx
Position of of right titlebar buttons.
unsigned int actual_frame_width
Saved frame_width when squeezed.
Window frame
The X window for the overall frame.
Window lolite_wr
Right lolite window in titlebar.
int frame_bw
2d border width.
TBWindow * titlebuttons
Button windows in the titlebar.
unsigned int title_height
Height of the full title bar.
Window title_w
The title bar Window.
Cursor curcurs
Current resize cursor.
unsigned int frame_width
Width of frame.
int highlightxl
Position of hilite_wl and lolite_wl.
Pixmap gray
Pixmap to which the border is set to when window isn't focused.
unsigned int frame_height
Height of frame.
int frame_bw3D
3d border width.
int name_x
Position of window title text, relative to title_w.
int title_y
Y coord of window title relative to title_w.
int highlightxr
Position of hilite_wr and lolite_wr.
Definition icons.h:26
Definition image.h:9
Various sources of window/icon names.
bool icon_set
Whether an icon name property has been set.
char * ctwm_wm_icon_name
Icon name from override CTWM_WM_ICON_NAME property.
char * wm_name
Name from ICCCM WM_NAME property.
char * wm_icon_name
Icon name from WM_ICON_NAME property.
char * ctwm_wm_name
Name from override CTWM_WM_NAME property.
Window ring connectivity.
struct TwmWindow * prev
Previous window in the ring.
int curs_x
Stored cursor position in the window.
int curs_y
Stored cursor position in the window.
bool cursor_valid
Whether curs_x and curs_y are usable.
struct TwmWindow * next
Next window in the ring.
Saved window geometry.
unsigned int width
Saved width.
unsigned int height
Saved height.
Info and control for every X Window we take over.
ColorPair border_tile
ColorPair for non-focused window borders.
unsigned long protocols
Which protocols this window handles.
struct TwmWindow * next
Next TwmWindow on the Screen.
bool iswspmgr
This is a workspace manager window.
bool OpaqueMove
Move opaquely.
bool titlehighlight
Should I highlight the title bar?
bool wShaped
This window is Shape'd.
bool isiconmgr
This is an icon manager window.
XWMHints * wmhints
Window manager hints.
bool heightEverChangedByUser
Has TwmWindow::attr height ever changed? Used only in sessions.
bool iconified
Has the window ever been iconified?
bool OpaqueResize
Resize opaquely.
int save_frame_y
y position of frame (saved from zoom)
Window w
The actual X Window handle.
bool auto_raise
Should we auto-raise this window ?
bool nameChanged
Has TwmWindow::name ever changed? Used only in session saving.
bool stackmode
Honor stackmode requests.
bool istransient
This is a transient window.
int zoomed
ZOOM_NONE || function causing zoom.
int old_bw
Original window border width before we took it over and made our own bordering.
struct TwmWindow::_ring ring
Window ring connectivity. "
char * name
Current window name. Points into TwmWindow::names.
bool auto_lower
Should we auto-lower this window ?
struct Icon * icon
The current icon.
char * icon_name
Current icon name. Points into TwmWindow::names.
bool squeeze_info_copied
Should ->squeeze_info be free()'d?
int occupation
Workspaces the window is in (bitmap)
bool widthEverChangedByUser
Has TwmWindow::attr width ever changed? Used only in sessions.
bool AlwaysSqueezeToGravity
SqueezeInfo * squeeze_info
Control info for title squeezing.
bool hasfocusvisible
The window visibly has focus.
unsigned int save_frame_width
width of frame (saved from zoom)
struct VirtualScreen * vs
Where the window is currently mapped (may be NULL)
bool mapped
Is the window mapped ?
bool icon_on
Is the icon visible.
unsigned int save_frame_height
height of frame (saved from zoom)
XSizeHints hints
Window size hints.
Colormaps cmaps
colormaps for this application
ColorPair borderC
ColorPair for focused window borders.
struct IconMgr * iconmgrp
Pointer to the icon manager structure, for windows that are icon managers.
bool icon_moved
User explicitly moved the icon.
ColorPair title
ColorPair for various other titlebar bits.
struct VirtualScreen * savevs
Where the window would be.
struct WList * iconmanagerlist
List of the icon managers the window is in.
struct VirtualScreen * parent_vs
Where the window is parented. Always set.
struct TwmWindow::_savegeometry savegeometry
Saved window geometry. "
bool forced
Has had an icon forced upon it.
struct TwmWindow::_names names
Various sources of window/icon names. "
struct TwmWindow * prev
Previous TwmWindow on the Screen.
XWindowAttributes attr
Window attributes from XGetWindowAttributes()
OtpWinList * otp
OTP control info for stacking. Created in OtpAdd().
name_list * iconslist
The current list of potential icons.
Window transientfor
What window it's transient for.
int save_frame_x
x position of frame (saved from zoom)
bool UnmapByMovingFarAway
Window group
Window group, from WM hints.
bool iconify_by_unmapping
Unmap window to iconify it.
bool isoccupy
This is an Occupy window.
bool highlight
Should highlight this window.
bool isicon
Is the window an icon now ?
bool squeezed
Is the window squeezed ?
WindowRegion * wr
WindowRegion containing this window.
struct WindowBox WindowBox
Definition types.h:44