12 #if WINGS_H_VERSION < 990222
13 #error There_is_an_old_WINGs.h_file_somewhere_in_your_system._Please_remove_it.
24 #endif /* __cplusplus */
30 #define WC_UserWidget 128
34 #define SCROLLER_WIDTH 20
36 /* internal messages */
37 #define WM_UPDATE_COLORWELL 130
40 #define WM_USER_MESSAGE 1024
43 #define SETUP_INTERNAL_MESSAGE(event, scrPtr) \
44 event.xclient.type=ClientMessage;\
45 event.xclient.display=scrPtr->display;\
46 event.xclient.send_event=False;\
47 event.xclient.serial=0;\
48 event.xclient.format=32;\
49 event.xclient.message_type=scrPtr->internalMessage;
52 typedef struct W_Font
{
53 struct W_Screen
*screen
;
63 unsigned int notFontSet
:1;
67 typedef struct W_Pixmap
{
68 struct W_Screen
*screen
;
72 unsigned short height
;
78 typedef struct W_Color
{
79 struct W_Screen
*screen
;
90 typedef struct W_FocusInfo
{
91 struct W_View
*toplevel
;
92 struct W_View
*focused
; /* view that has the focus in this toplevel */
93 struct W_FocusInfo
*next
;
96 typedef struct W_Screen
{
109 struct W_View
*rootView
;
113 /* application related */
115 W_FocusInfo
*focusInfo
;
117 struct W_Pixmap
*applicationIcon
;
119 struct W_Window
*windowList
; /* list of windows in the app */
121 Window groupLeader
; /* the leader of the application */
122 /* also used for other things */
124 struct W_SelectionHandlers
*selectionHandlerList
;
127 unsigned int hasAppIcon
:1;
128 unsigned int simpleApplication
:1;
131 WMOpenPanel
*sharedOpenPanel
;
132 WMSavePanel
*sharedSavePanel
;
134 struct W_FontPanel
*sharedFontPanel
;
136 struct W_ColorPanel
*sharedColorPanel
;
149 GC monoGC
; /* GC for 1bpp visuals */
153 GC ixorGC
; /* IncludeInferiors XOR */
161 WMHashTable
*fontCache
;
163 struct W_Pixmap
*checkButtonImageOn
;
164 struct W_Pixmap
*checkButtonImageOff
;
166 struct W_Pixmap
*radioButtonImageOn
;
167 struct W_Pixmap
*radioButtonImageOff
;
169 struct W_Pixmap
*buttonArrow
;
170 struct W_Pixmap
*pushedButtonArrow
;
172 struct W_Pixmap
*scrollerDimple
;
174 struct W_Pixmap
*upArrow
;
175 struct W_Pixmap
*downArrow
;
176 struct W_Pixmap
*leftArrow
;
177 struct W_Pixmap
*rightArrow
;
179 struct W_Pixmap
*hiUpArrow
;
180 struct W_Pixmap
*hiDownArrow
;
181 struct W_Pixmap
*hiLeftArrow
;
182 struct W_Pixmap
*hiRightArrow
;
184 struct W_Pixmap
*pullDownIndicator
;
185 struct W_Pixmap
*popUpIndicator
;
187 struct W_Pixmap
*checkMark
;
189 struct W_Pixmap
*homeIcon
;
190 struct W_Pixmap
*altHomeIcon
;
192 struct W_Pixmap
*magnifyIcon
;
193 struct W_Pixmap
*altMagnifyIcon
;
194 struct W_Pixmap
*wheelIcon
;
195 struct W_Pixmap
*grayIcon
;
196 struct W_Pixmap
*rgbIcon
;
197 struct W_Pixmap
*cmykIcon
;
198 struct W_Pixmap
*hsbIcon
;
199 struct W_Pixmap
*customPaletteIcon
;
200 struct W_Pixmap
*colorListIcon
;
202 struct W_Pixmap
*defaultObjectIcon
;
204 Cursor defaultCursor
;
208 Atom internalMessage
; /* for ClientMessage */
210 Atom attribsAtom
; /* GNUstepWindowAttributes */
212 Atom deleteWindowAtom
; /* WM_DELETE_WINDOW */
214 Atom protocolsAtom
; /* _XA_WM_PROTOCOLS */
216 Atom clipboardAtom
; /* CLIPBOARD */
219 /* stuff for detecting double-clicks */
220 Time lastClickTime
; /* time of last mousedown event */
221 Window lastClickWindow
; /* window of the last mousedown */
223 struct W_View
*modalView
;
225 unsigned ignoreNextDoubleClick
:1;
230 typedef struct W_View
{
231 struct W_Screen
*screen
;
233 WMWidget
*self
; /* must point to the widget the
242 struct W_View
*nextFocusChain
; /* next/prev in focus chain */
243 struct W_View
*prevFocusChain
;
245 struct W_View
*parent
; /* parent WMView */
247 struct W_View
*childrenList
; /* first in list of child windows */
249 struct W_View
*nextSister
; /* next on parent's children list */
251 struct W_EventHandler
*handlerList
;/* list of event handlers for this window */
253 unsigned long attribFlags
;
254 XSetWindowAttributes attribs
;
256 void *hangedData
; /* data holder for user program */
258 struct W_DragSourceProcs
*dragSourceProcs
;
259 struct W_DragDestinationProcs
*dragDestinationProcs
;
264 unsigned int realized
:1;
265 unsigned int mapped
:1;
266 unsigned int parentDying
:1;
267 unsigned int dying
:1; /* the view is being destroyed */
268 unsigned int topLevel
:1; /* is a top level window */
269 unsigned int root
:1; /* is the root window */
270 unsigned int mapWhenRealized
:1;/* map the view when it's realized */
271 unsigned int alreadyDead
:1; /* view was freed */
273 unsigned int dontCompressMotion
:1; /* motion notify event compress */
274 unsigned int notifySizeChanged
:1;
275 unsigned int dontCompressExpose
:1; /* will compress all expose
278 unsigned int worksWhenModal
:1;
279 unsigned int pendingRelease1
:1;
280 unsigned int pendingRelease2
:1;
281 unsigned int pendingRelease3
:1;
282 unsigned int pendingRelease4
:1;
283 unsigned int pendingRelease5
:1;
290 typedef struct W_EventHandler
{
291 unsigned long eventMask
;
297 struct W_EventHandler
*nextHandler
;
302 typedef struct W_ViewProcedureTable
{
303 void (*setBackgroundColor
)(WMWidget
*, WMColor
*color
);
304 void (*resize
)(WMWidget
*, unsigned int, unsigned int);
305 void (*move
)(WMWidget
*, int, int);
306 } W_ViewProcedureTable
;
310 typedef struct _WINGsConfiguration
{
312 char *boldSystemFont
;
313 unsigned doubleClickDelay
;
314 } _WINGsConfiguration
;
316 _WINGsConfiguration WINGsConfiguration
;
320 #define CHECK_CLASS(widget, class) assert(W_CLASS(widget)==(class))
323 #define W_CLASS(widget) (((W_WidgetType*)(widget))->widgetClass)
324 #define W_VIEW(widget) (((W_WidgetType*)(widget))->view)
326 #define W_VIEW_REALIZED(view) (view)->flags.realized
327 #define W_VIEW_MAPPED(view) (view)->flags.mapped
329 #define W_PIXEL(c) (c)->color.pixel
331 #define W_FONTID(f) (f)->font->fid
333 #define W_DRAWABLE(scr) (scr)->rcontext->drawable
337 W_View
*W_GetViewForXWindow(Display
*display
, Window window
);
339 W_View
*W_CreateView(W_View
*parent
);
341 W_View
*W_CreateTopView(W_Screen
*screen
);
344 W_View
*W_CreateRootView(W_Screen
*screen
);
346 void W_DestroyView(W_View
*view
);
348 void W_RealizeView(W_View
*view
);
350 void W_ReparentView(W_View
*view
, W_View
*newParent
, int x
, int y
);
352 void W_MapView(W_View
*view
);
354 void W_MapSubviews(W_View
*view
);
356 void W_UnmapSubviews(W_View
*view
);
358 W_View
*W_TopLevelOfView(W_View
*view
);
360 void W_UnmapView(W_View
*view
);
362 void W_MoveView(W_View
*view
, int x
, int y
);
364 void W_ResizeView(W_View
*view
, unsigned int width
, unsigned int height
);
366 void W_SetViewBackgroundColor(W_View
*view
, WMColor
*color
);
368 void W_DrawRelief(W_Screen
*scr
, Drawable d
, int x
, int y
, unsigned int width
,
369 unsigned int height
, WMReliefType relief
);
372 void W_CleanUpEvents(W_View
*view
);
374 void W_CallDestroyHandlers(W_View
*view
);
376 void W_PaintTextAndImage(W_View
*view
, int wrap
, GC textGC
, W_Font
*font
,
377 WMReliefType relief
, char *text
,
378 WMAlignment alignment
, W_Pixmap
*image
,
379 WMImagePosition position
, GC backGC
, int ofs
);
381 void W_PaintText(W_View
*view
, Drawable d
, WMFont
*font
, int x
, int y
,
382 int width
, WMAlignment alignment
, GC gc
,
383 int wrap
, char *text
, int length
);
385 int W_GetTextHeight(WMFont
*font
, char *text
, int width
, int wrap
);
388 int W_TextWidth(WMFont
*font
, char *text
, int length
);
391 void W_BroadcastMessage(W_View
*targetParent
, XEvent
*event
);
393 void W_DispatchMessage(W_View
*target
, XEvent
*event
);
395 Bool
W_CheckInternalMessage(W_Screen
*scr
, XClientMessageEvent
*cev
, int event
);
397 void W_SetFocusOfToplevel(W_View
*toplevel
, W_View
*view
);
399 W_View
*W_FocusedViewOfToplevel(W_View
*view
);
401 void W_SetFocusOfTopLevel(W_View
*toplevel
, W_View
*view
);
403 void W_ReleaseView(WMView
*view
);
405 WMView
*W_RetainView(WMView
*view
);
407 void W_InitApplication(WMScreen
*scr
);
409 void W_InitNotificationCenter(void);
411 W_Class
W_RegisterUserWidget(W_ViewProcedureTable
*procTable
);
413 void W_RedisplayView(WMView
*view
);
415 Bool
W_ApplicationInitialized(void);
417 char *W_GetTextSelection(WMScreen
*scr
, Atom selection
);
419 void W_HandleSelectionEvent(XEvent
*event
);
423 #endif /* __cplusplus */
425 #endif /* _WINGSP_H_ */
427 void W_FlushASAPNotificationQueue();
429 void W_FlushIdleNotificationQueue();