Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/tkMacOSXInt.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 * tkMacOSXInt.h -- | |
3 * | |
4 * Declarations of Macintosh specific shared variables and procedures. | |
5 * | |
6 * Copyright (c) 1995-1997 Sun Microsystems, Inc. | |
7 * Copyright 2001-2009, Apple Inc. | |
8 * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net> | |
9 * | |
10 * See the file "license.terms" for information on usage and redistribution | |
11 * of this file, and for a DISCLAIMER OF ALL WARRANTIES. | |
12 */ | |
13 | |
14 #ifndef _TKMACINT | |
15 #define _TKMACINT | |
16 | |
17 #ifndef _TKINT | |
18 #include "tkInt.h" | |
19 #endif | |
20 | |
21 /* | |
22 * Include platform specific public interfaces. | |
23 */ | |
24 | |
25 #ifndef _TKMAC | |
26 #include "tkMacOSX.h" | |
27 #import <Cocoa/Cocoa.h> | |
28 #endif | |
29 | |
30 /* | |
31 * Define compatibility platform types used in the structures below so that | |
32 * this header can be included without pulling in the platform headers. | |
33 */ | |
34 | |
35 #ifndef _TKMACPRIV | |
36 # ifndef CGGEOMETRY_H_ | |
37 # ifndef CGFLOAT_DEFINED | |
38 # if __LP64__ | |
39 # define CGFloat double | |
40 # else | |
41 # define CGFloat float | |
42 # endif | |
43 # endif | |
44 # define CGSize struct {CGFloat width; CGFloat height;} | |
45 # endif | |
46 # ifndef CGCONTEXT_H_ | |
47 # define CGContextRef void * | |
48 # endif | |
49 # ifndef CGCOLOR_H_ | |
50 # define CGColorRef void * | |
51 # endif | |
52 # ifndef __HISHAPE__ | |
53 # define HIShapeRef void * | |
54 # endif | |
55 # ifndef _APPKITDEFINES_H | |
56 # define NSView void * | |
57 # endif | |
58 #endif | |
59 | |
60 struct TkWindowPrivate { | |
61 TkWindow *winPtr; /* Ptr to tk window or NULL if Pixmap */ | |
62 NSView *view; | |
63 CGContextRef context; | |
64 int xOff; /* X offset from toplevel window */ | |
65 int yOff; /* Y offset from toplevel window */ | |
66 CGSize size; | |
67 HIShapeRef visRgn; /* Visible region of window */ | |
68 HIShapeRef aboveVisRgn; /* Visible region of window & its children */ | |
69 HIShapeRef drawRgn; /* Clipped drawing region */ | |
70 int referenceCount; /* Don't delete toplevel until children are | |
71 * gone. */ | |
72 struct TkWindowPrivate *toplevel; | |
73 /* Pointer to the toplevel datastruct. */ | |
74 CGFloat fillRGBA[4]; /* Background used by the ttk FillElement */ | |
75 int flags; /* Various state see defines below. */ | |
76 }; | |
77 typedef struct TkWindowPrivate MacDrawable; | |
78 | |
79 /* | |
80 * Defines use for the flags field of the MacDrawable data structure. | |
81 */ | |
82 | |
83 #define TK_SCROLLBAR_GROW 0x01 | |
84 #define TK_CLIP_INVALID 0x02 | |
85 #define TK_HOST_EXISTS 0x04 | |
86 #define TK_DRAWN_UNDER_MENU 0x08 | |
87 #define TK_IS_PIXMAP 0x10 | |
88 #define TK_IS_BW_PIXMAP 0x20 | |
89 #define TK_DO_NOT_DRAW 0x40 | |
90 #define TTK_HAS_CONTRASTING_BG 0x80 | |
91 | |
92 /* | |
93 * I am reserving TK_EMBEDDED = 0x100 in the MacDrawable flags | |
94 * This is defined in tk.h. We need to duplicate the TK_EMBEDDED flag in the | |
95 * TkWindow structure for the window, but in the MacWin. This way we can | |
96 * still tell what the correct port is after the TKWindow structure has been | |
97 * freed. This actually happens when you bind destroy of a toplevel to | |
98 * Destroy of a child. | |
99 */ | |
100 | |
101 /* | |
102 * This structure is for handling Netscape-type in process | |
103 * embedding where Tk does not control the top-level. It contains | |
104 * various functions that are needed by Mac specific routines, like | |
105 * TkMacOSXGetDrawablePort. The definitions of the function types | |
106 * are in tkMacOSX.h. | |
107 */ | |
108 | |
109 typedef struct { | |
110 Tk_MacOSXEmbedRegisterWinProc *registerWinProc; | |
111 Tk_MacOSXEmbedGetGrafPortProc *getPortProc; | |
112 Tk_MacOSXEmbedMakeContainerExistProc *containerExistProc; | |
113 Tk_MacOSXEmbedGetClipProc *getClipProc; | |
114 Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc; | |
115 } TkMacOSXEmbedHandler; | |
116 | |
117 MODULE_SCOPE TkMacOSXEmbedHandler *tkMacOSXEmbedHandler; | |
118 | |
119 /* | |
120 * Undef compatibility platform types defined above. | |
121 */ | |
122 | |
123 #ifndef _TKMACPRIV | |
124 # ifndef CGGEOMETRY_H_ | |
125 # ifndef CGFLOAT_DEFINED | |
126 # undef CGFloat | |
127 # endif | |
128 # undef CGSize | |
129 # endif | |
130 # ifndef CGCONTEXT_H_ | |
131 # undef CGContextRef | |
132 # endif | |
133 # ifndef CGCOLOR_H_ | |
134 # undef CGColorRef | |
135 # endif | |
136 # ifndef __HISHAPE__ | |
137 # undef HIShapeRef | |
138 # endif | |
139 # ifndef _APPKITDEFINES_H | |
140 # undef NSView | |
141 # endif | |
142 #endif | |
143 | |
144 /* | |
145 * Defines used for TkMacOSXInvalidateWindow | |
146 */ | |
147 | |
148 #define TK_WINDOW_ONLY 0 | |
149 #define TK_PARENT_WINDOW 1 | |
150 | |
151 /* | |
152 * Accessor for the privatePtr flags field for the TK_HOST_EXISTS field | |
153 */ | |
154 | |
155 #define TkMacOSXHostToplevelExists(tkwin) \ | |
156 (((TkWindow *) (tkwin))->privatePtr->toplevel->flags & TK_HOST_EXISTS) | |
157 | |
158 /* | |
159 * Defines used for the flags argument to TkGenWMConfigureEvent. | |
160 */ | |
161 | |
162 #define TK_LOCATION_CHANGED 1 | |
163 #define TK_SIZE_CHANGED 2 | |
164 #define TK_BOTH_CHANGED 3 | |
165 #define TK_MACOSX_HANDLE_EVENT_IMMEDIATELY 1024 | |
166 | |
167 /* | |
168 * Defines for tkTextDisp.c and tkFont.c | |
169 */ | |
170 | |
171 #define TK_LAYOUT_WITH_BASE_CHUNKS 1 | |
172 #define TK_DRAW_IN_CONTEXT 1 | |
173 | |
174 /* | |
175 * Prototypes of internal procs not in the stubs table. | |
176 */ | |
177 | |
178 MODULE_SCOPE void TkMacOSXDefaultStartupScript(void); | |
179 MODULE_SCOPE void TkpClipDrawableToRect(Display *display, Drawable d, int x, | |
180 int y, int width, int height); | |
181 MODULE_SCOPE void TkpShiftButton(NSButton *button, NSPoint delta); | |
182 MODULE_SCOPE Bool TkTestLogDisplay(Drawable drawable); | |
183 | |
184 /* | |
185 * Include the stubbed internal platform-specific API. | |
186 */ | |
187 | |
188 #include "tkIntPlatDecls.h" | |
189 | |
190 #endif /* _TKMACINT */ | |
191 | |
192 /* | |
193 * Local Variables: | |
194 * mode: objc | |
195 * c-basic-offset: 4 | |
196 * fill-column: 79 | |
197 * coding: utf-8 | |
198 * End: | |
199 */ |