11 #if WINGS_H_VERSION < 990516
12 #error There_is_an_old_WINGs.h_file_somewhere_in_your_system._Please_remove_it.
23 #endif /* __cplusplus */
29 #define WC_UserWidget 128
33 #define SCROLLER_WIDTH 20
35 /* internal messages */
36 #define WM_UPDATE_COLORWELL 130
39 #define WM_USER_MESSAGE 1024
42 #define SETUP_INTERNAL_MESSAGE(event, scrPtr) \
43 event.xclient.type=ClientMessage;\
44 event.xclient.display=scrPtr->display;\
45 event.xclient.send_event=False;\
46 event.xclient.serial=0;\
47 event.xclient.format=32;\
48 event.xclient.message_type=scrPtr->internalMessage;
51 typedef struct W_Font
{
52 struct W_Screen
*screen
;
62 unsigned int notFontSet
:1;
66 typedef struct W_Pixmap
{
67 struct W_Screen
*screen
;
71 unsigned short height
;
77 typedef struct W_Color
{
78 struct W_Screen
*screen
;
89 typedef struct W_FocusInfo
{
90 struct W_View
*toplevel
;
91 struct W_View
*focused
; /* view that has the focus in this toplevel */
92 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
;
151 GC monoGC
; /* GC for 1bpp visuals */
155 GC ixorGC
; /* IncludeInferiors XOR */
163 WMHashTable
*fontCache
;
166 struct W_Balloon
*balloon
;
169 struct W_Pixmap
*checkButtonImageOn
;
170 struct W_Pixmap
*checkButtonImageOff
;
172 struct W_Pixmap
*radioButtonImageOn
;
173 struct W_Pixmap
*radioButtonImageOff
;
175 struct W_Pixmap
*buttonArrow
;
176 struct W_Pixmap
*pushedButtonArrow
;
178 struct W_Pixmap
*scrollerDimple
;
180 struct W_Pixmap
*upArrow
;
181 struct W_Pixmap
*downArrow
;
182 struct W_Pixmap
*leftArrow
;
183 struct W_Pixmap
*rightArrow
;
185 struct W_Pixmap
*hiUpArrow
;
186 struct W_Pixmap
*hiDownArrow
;
187 struct W_Pixmap
*hiLeftArrow
;
188 struct W_Pixmap
*hiRightArrow
;
190 struct W_Pixmap
*pullDownIndicator
;
191 struct W_Pixmap
*popUpIndicator
;
193 struct W_Pixmap
*checkMark
;
195 struct W_Pixmap
*homeIcon
;
196 struct W_Pixmap
*altHomeIcon
;
198 struct W_Pixmap
*magnifyIcon
;
199 /* struct W_Pixmap *altMagnifyIcon;*/
200 struct W_Pixmap
*wheelIcon
;
201 struct W_Pixmap
*grayIcon
;
202 struct W_Pixmap
*rgbIcon
;
203 struct W_Pixmap
*cmykIcon
;
204 struct W_Pixmap
*hsbIcon
;
205 struct W_Pixmap
*customPaletteIcon
;
206 struct W_Pixmap
*colorListIcon
;
208 struct W_Pixmap
*defaultObjectIcon
;
210 Cursor defaultCursor
;
214 Cursor invisibleCursor
;
216 Atom internalMessage
; /* for ClientMessage */
218 Atom attribsAtom
; /* GNUstepWindowAttributes */
220 Atom deleteWindowAtom
; /* WM_DELETE_WINDOW */
222 Atom protocolsAtom
; /* _XA_WM_PROTOCOLS */
224 Atom clipboardAtom
; /* CLIPBOARD */
227 /* stuff for detecting double-clicks */
228 Time lastClickTime
; /* time of last mousedown event */
229 Window lastClickWindow
; /* window of the last mousedown */
231 struct W_View
*modalView
;
233 unsigned ignoreNextDoubleClick
:1;
238 typedef struct W_ViewDelegate
{
241 void (*didMove
)(struct W_ViewDelegate
*, WMView
*);
243 void (*didResize
)(struct W_ViewDelegate
*, WMView
*);
245 void (*willMove
)(struct W_ViewDelegate
*, WMView
*, int*, int*);
247 void (*willResize
)(struct W_ViewDelegate
*, WMView
*,
248 unsigned int*, unsigned int*);
253 typedef struct W_View
{
254 struct W_Screen
*screen
;
256 WMWidget
*self
; /* must point to the widget the
259 W_ViewDelegate
*delegate
;
267 struct W_View
*nextFocusChain
; /* next/prev in focus chain */
268 struct W_View
*prevFocusChain
;
270 struct W_View
*parent
; /* parent WMView */
272 struct W_View
*childrenList
; /* first in list of child windows */
274 struct W_View
*nextSister
; /* next on parent's children list */
276 struct W_EventHandler
*handlerList
;/* list of event handlers for this window */
278 unsigned long attribFlags
;
279 XSetWindowAttributes attribs
;
281 void *hangedData
; /* data holder for user program */
286 struct W_DragSourceProcs
*dragSourceProcs
;
287 struct W_DragDestinationProcs
*dragDestinationProcs
;
292 unsigned int realized
:1;
293 unsigned int mapped
:1;
294 unsigned int parentDying
:1;
295 unsigned int dying
:1; /* the view is being destroyed */
296 unsigned int topLevel
:1; /* is a top level window */
297 unsigned int root
:1; /* is the root window */
298 unsigned int mapWhenRealized
:1;/* map the view when it's realized */
299 unsigned int alreadyDead
:1; /* view was freed */
301 unsigned int dontCompressMotion
:1; /* motion notify event compress */
302 unsigned int notifySizeChanged
:1;
303 unsigned int dontCompressExpose
:1; /* will compress all expose
306 unsigned int worksWhenModal
:1;
307 unsigned int pendingRelease1
:1;
308 unsigned int pendingRelease2
:1;
309 unsigned int pendingRelease3
:1;
310 unsigned int pendingRelease4
:1;
311 unsigned int pendingRelease5
:1;
318 typedef struct W_EventHandler
{
319 unsigned long eventMask
;
325 struct W_EventHandler
*nextHandler
;
331 typedef struct _WINGsConfiguration
{
333 char *boldSystemFont
;
334 unsigned doubleClickDelay
;
335 } _WINGsConfiguration
;
337 _WINGsConfiguration WINGsConfiguration
;
341 #define CHECK_CLASS(widget, class) assert(W_CLASS(widget)==(class))
344 #define W_CLASS(widget) (((W_WidgetType*)(widget))->widgetClass)
345 #define W_VIEW(widget) (((W_WidgetType*)(widget))->view)
347 #define W_VIEW_REALIZED(view) (view)->flags.realized
348 #define W_VIEW_MAPPED(view) (view)->flags.mapped
350 #define W_PIXEL(c) (c)->color.pixel
352 #define W_FONTID(f) (f)->font->fid
354 #define W_DRAWABLE(scr) (scr)->rcontext->drawable
358 W_View
*W_GetViewForXWindow(Display
*display
, Window window
);
360 W_View
*W_CreateView(W_View
*parent
);
362 W_View
*W_CreateTopView(W_Screen
*screen
);
365 W_View
*W_CreateRootView(W_Screen
*screen
);
367 void W_DestroyView(W_View
*view
);
369 void W_RealizeView(W_View
*view
);
371 void W_ReparentView(W_View
*view
, W_View
*newParent
, int x
, int y
);
373 void W_MapView(W_View
*view
);
375 void W_MapSubviews(W_View
*view
);
377 void W_UnmapSubviews(W_View
*view
);
379 W_View
*W_TopLevelOfView(W_View
*view
);
381 void W_UnmapView(W_View
*view
);
383 void W_MoveView(W_View
*view
, int x
, int y
);
385 void W_ResizeView(W_View
*view
, unsigned int width
, unsigned int height
);
387 void W_SetViewBackgroundColor(W_View
*view
, WMColor
*color
);
389 void W_DrawRelief(W_Screen
*scr
, Drawable d
, int x
, int y
, unsigned int width
,
390 unsigned int height
, WMReliefType relief
);
393 void W_CleanUpEvents(W_View
*view
);
395 void W_CallDestroyHandlers(W_View
*view
);
397 void W_PaintTextAndImage(W_View
*view
, int wrap
, GC textGC
, W_Font
*font
,
398 WMReliefType relief
, char *text
,
399 WMAlignment alignment
, W_Pixmap
*image
,
400 WMImagePosition position
, GC backGC
, int ofs
);
402 void W_PaintText(W_View
*view
, Drawable d
, WMFont
*font
, int x
, int y
,
403 int width
, WMAlignment alignment
, GC gc
,
404 int wrap
, char *text
, int length
);
406 int W_GetTextHeight(WMFont
*font
, char *text
, int width
, int wrap
);
409 int W_TextWidth(WMFont
*font
, char *text
, int length
);
412 void W_BroadcastMessage(W_View
*targetParent
, XEvent
*event
);
414 void W_DispatchMessage(W_View
*target
, XEvent
*event
);
416 Bool
W_CheckInternalMessage(W_Screen
*scr
, XClientMessageEvent
*cev
, int event
);
418 void W_SetFocusOfToplevel(W_View
*toplevel
, W_View
*view
);
420 W_View
*W_FocusedViewOfToplevel(W_View
*view
);
422 void W_SetFocusOfTopLevel(W_View
*toplevel
, W_View
*view
);
424 void W_ReleaseView(WMView
*view
);
426 WMView
*W_RetainView(WMView
*view
);
428 void W_InitApplication(WMScreen
*scr
);
430 void W_InitNotificationCenter(void);
432 W_Class
W_RegisterUserWidget(void);
434 void W_RedisplayView(WMView
*view
);
436 Bool
W_ApplicationInitialized(void);
438 char *W_GetTextSelection(WMScreen
*scr
, Atom selection
);
440 void W_HandleSelectionEvent(XEvent
*event
);
444 #endif /* __cplusplus */
446 #endif /* _WINGSP_H_ */
448 void W_FlushASAPNotificationQueue();
450 void W_FlushIdleNotificationQueue();
452 struct W_Balloon
*W_CreateBalloon(WMScreen
*scr
);
454 void W_BalloonHandleEnterView(WMView
*view
);
456 void W_BalloonHandleLeaveView(WMView
*view
);