comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/tkMacOSXWm.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 69:33d812a61356
1 /*
2 * tkMacOSXWm.h --
3 *
4 * Declarations of Macintosh specific window manager structures.
5 *
6 * Copyright 2001-2009, Apple Inc.
7 * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
8 *
9 * See the file "license.terms" for information on usage and redistribution of
10 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
11 */
12
13 #ifndef _TKMACWM
14 #define _TKMACWM
15
16 #include "tkMacOSXInt.h"
17 #include "tkMenu.h"
18
19 /*
20 * A data structure of the following type holds information for each window
21 * manager protocol (such as WM_DELETE_WINDOW) for which a handler (i.e. a Tcl
22 * command) has been defined for a particular top-level window.
23 */
24
25 typedef struct ProtocolHandler {
26 Atom protocol; /* Identifies the protocol. */
27 struct ProtocolHandler *nextPtr;
28 /* Next in list of protocol handlers for the
29 * same top-level window, or NULL for end of
30 * list. */
31 Tcl_Interp *interp; /* Interpreter in which to invoke command. */
32 char* command; /* Tcl command to invoke when a client message
33 * for this protocol arrives. The actual size
34 * of the structure varies to accommodate the
35 * needs of the actual command. THIS MUST BE
36 * THE LAST FIELD OF THE STRUCTURE. */
37 } ProtocolHandler;
38
39 /* The following data structure is used in the TkWmInfo to maintain a list of all of the
40 * transient windows belonging to a given container.
41 */
42
43 typedef struct Transient {
44 TkWindow *winPtr;
45 int flags;
46 struct Transient *nextPtr;
47 } Transient;
48
49 #define WITHDRAWN_BY_CONTAINER 0x1
50 #define WITHDRAWN_BY_MASTER 0x1
51
52 /*
53 * A data structure of the following type holds window-manager-related
54 * information for each top-level window in an application.
55 */
56
57 typedef struct TkWmInfo {
58 TkWindow *winPtr; /* Pointer to main Tk information for this
59 * window. */
60 Window reparent; /* If the window has been reparented, this
61 * gives the ID of the ancestor of the window
62 * that is a child of the root window (may not
63 * be window's immediate parent). If the window
64 * isn't reparented, this has the value
65 * None. */
66 Tk_Uid titleUid; /* Title to display in window caption. If NULL,
67 * use name of widget. */
68 char *iconName; /* Name to display in icon. */
69 Tk_Window container; /* Container window for TRANSIENT_FOR property,
70 * or None. */
71 XWMHints hints; /* Various pieces of information for window
72 * manager. */
73 char *leaderName; /* Path name of leader of window group
74 * (corresponds to hints.window_group).
75 * Malloc-ed. Note: this field doesn't get
76 * updated if leader is destroyed. */
77 Tk_Window icon; /* Window to use as icon for this window, or
78 * NULL. */
79 Tk_Window iconFor; /* Window for which this window is icon, or
80 * NULL if this isn't an icon for anyone. */
81 Transient *transientPtr; /* First item in a list of all transient windows
82 * belonging to this window, or NULL if there
83 * are no transients. */
84
85 /*
86 * Information used to construct an XSizeHints structure for the window
87 * manager:
88 */
89
90 int sizeHintsFlags; /* Flags word for XSizeHints structure. If the
91 * PBaseSize flag is set then the window is
92 * gridded; otherwise it isn't gridded. */
93 int minWidth, minHeight; /* Minimum dimensions of window, in grid units,
94 * not pixels. */
95 int maxWidth, maxHeight; /* Maximum dimensions of window, in grid units,
96 * not pixels. */
97 Tk_Window gridWin; /* Identifies the window that controls gridding
98 * for this top-level, or NULL if the top-level
99 * isn't currently gridded. */
100 int widthInc, heightInc; /* Increments for size changes (# pixels per
101 * step). */
102 struct {
103 int x; /* numerator */
104 int y; /* denominator */
105 } minAspect, maxAspect; /* Min/max aspect ratios for window. */
106 int reqGridWidth, reqGridHeight;
107 /* The dimensions of the window (in grid units)
108 * requested through the geometry manager. */
109 int gravity; /* Desired window gravity. */
110
111 /*
112 * Information used to manage the size and location of a window.
113 */
114
115 int width, height; /* Desired dimensions of window, specified in
116 * grid units. These values are set by the "wm
117 * geometry" command and by ConfigureNotify
118 * events (for when wm resizes window). -1
119 * means user hasn't requested dimensions. */
120 int x, y; /* Desired X and Y coordinates for window.
121 * These values are set by "wm geometry", plus
122 * by ConfigureNotify events (when wm moves
123 * window). These numbers are different than
124 * the numbers stored in winPtr->changes
125 * because (a) they could be measured from the
126 * right or bottom edge of the screen (see
127 * WM_NEGATIVE_X and WM_NEGATIVE_Y flags) and
128 * (b) if the window has been reparented then
129 * they refer to the parent rather than the
130 * window itself. */
131 int parentWidth, parentHeight;
132 /* Width and height of reparent, in pixels
133 * *including border*. If window hasn't been
134 * reparented then these will be the outer
135 * dimensions of the window, including
136 * border. */
137 int xInParent, yInParent; /* Offset of window within reparent, measured
138 * from upper-left outer corner of parent's
139 * border to upper-left outer corner of child's
140 * border. If not reparented then these are
141 * zero. */
142 int configX, configY; /* x,y position of toplevel when window is
143 * switched into fullscreen state, */
144 int configWidth, configHeight;
145 /* Dimensions passed to last request that we
146 * issued to change geometry of window. Used to
147 * eliminate redundant resize operations. */
148
149 /*
150 * Information about the virtual root window for this top-level, if there
151 * is one.
152 */
153
154 Window vRoot; /* Virtual root window for this top-level, or
155 * None if there is no virtual root window
156 * (i.e. just use the screen's root). */
157 int vRootX, vRootY; /* Position of the virtual root inside the root
158 * window. If the WM_VROOT_OFFSET_STALE flag is
159 * set then this information may be incorrect
160 * and needs to be refreshed from the OS. If
161 * vRoot is None then these values are both
162 * 0. */
163 unsigned int vRootWidth, vRootHeight;
164 /* Dimensions of the virtual root window. If
165 * vRoot is None, gives the dimensions of the
166 * containing screen. This information is never
167 * stale, even though vRootX and vRootY can
168 * be. */
169
170 /*
171 * List of children of the toplevel which have private colormaps.
172 */
173
174 TkWindow **cmapList; /* Array of window with private colormaps. */
175 int cmapCount; /* Number of windows in array. */
176
177 /*
178 * Miscellaneous information.
179 */
180
181 ProtocolHandler *protPtr; /* First in list of protocol handlers for this
182 * window (NULL means none). */
183 Tcl_Obj *commandObj; /* The command (guaranteed to be a list) for
184 * the WM_COMMAND property. NULL means nothing
185 * available. */
186 char *clientMachine; /* String to store in WM_CLIENT_MACHINE
187 * property, or NULL. */
188 int flags; /* Miscellaneous flags, defined below. */
189
190 /*
191 * Macintosh information.
192 */
193
194 WindowClass macClass;
195 UInt64 attributes, configAttributes;
196 TkWindow *scrollWinPtr; /* Ptr to scrollbar handling grow widget. */
197 TkMenu *menuPtr;
198 NSWindow *window;
199
200 /*
201 * Space to cache current window state when window becomes Fullscreen.
202 */
203
204 unsigned long cachedStyle;
205 unsigned long cachedPresentation;
206 NSRect cachedBounds;
207
208 } WmInfo;
209
210 /*
211 * Flag values for WmInfo structures:
212 *
213 * WM_NEVER_MAPPED - non-zero means window has never been mapped;
214 * need to update all info when window is first
215 * mapped.
216 * WM_UPDATE_PENDING - non-zero means a call to UpdateGeometryInfo
217 * has already been scheduled for this window; no
218 * need to schedule another one.
219 * WM_NEGATIVE_X - non-zero means x-coordinate is measured in
220 * pixels from right edge of screen, rather than
221 * from left edge.
222 * WM_NEGATIVE_Y - non-zero means y-coordinate is measured in
223 * pixels up from bottom of screen, rather than
224 * down from top.
225 * WM_UPDATE_SIZE_HINTS - non-zero means that new size hints need to be
226 * propagated to window manager.
227 * WM_SYNC_PENDING - set to non-zero while waiting for the window
228 * manager to respond to some state change.
229 * WM_VROOT_OFFSET_STALE - non-zero means that (x,y) offset information
230 * about the virtual root window is stale and
231 * needs to be fetched fresh from the X server.
232 * WM_ABOUT_TO_MAP - non-zero means that the window is about to be
233 * mapped by TkWmMapWindow. This is used by
234 * UpdateGeometryInfo to modify its behavior.
235 * WM_MOVE_PENDING - non-zero means the application has requested a
236 * new position for the window, but it hasn't
237 * been reflected through the window manager yet.
238 * WM_COLORMAPS_EXPLICIT - non-zero means the colormap windows were set
239 * explicitly via "wm colormapwindows".
240 * WM_ADDED_TOPLEVEL_COLORMAP - non-zero means that when "wm colormapwindows"
241 * was called the top-level itself wasn't
242 * specified, so we added it implicitly at the
243 * end of the list.
244 * WM_WIDTH_NOT_RESIZABLE - non-zero means that we're not supposed to
245 * allow the user to change the width of the
246 * window (controlled by "wm resizable" command).
247 * WM_HEIGHT_NOT_RESIZABLE - non-zero means that we're not supposed to
248 * allow the user to change the height of the
249 * window (controlled by "wm resizable" command).
250 */
251
252 #define WM_NEVER_MAPPED 0x0001
253 #define WM_UPDATE_PENDING 0x0002
254 #define WM_NEGATIVE_X 0x0004
255 #define WM_NEGATIVE_Y 0x0008
256 #define WM_UPDATE_SIZE_HINTS 0x0010
257 #define WM_SYNC_PENDING 0x0020
258 #define WM_VROOT_OFFSET_STALE 0x0040
259 #define WM_ABOUT_TO_MAP 0x0080
260 #define WM_MOVE_PENDING 0x0100
261 #define WM_COLORMAPS_EXPLICIT 0x0200
262 #define WM_ADDED_TOPLEVEL_COLORMAP 0x0400
263 #define WM_WIDTH_NOT_RESIZABLE 0x0800
264 #define WM_HEIGHT_NOT_RESIZABLE 0x1000
265 #define WM_TOPMOST 0x2000
266 #define WM_FULLSCREEN 0x4000
267 #define WM_TRANSPARENT 0x8000
268
269 #endif /* _TKMACWM */
270
271 /*
272 * Local Variables:
273 * mode: objc
274 * c-basic-offset: 4
275 * fill-column: 79
276 * coding: utf-8
277 * End:
278 */