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
;
167 struct W_Balloon
*balloon
;
170 struct W_Pixmap
*checkButtonImageOn
;
171 struct W_Pixmap
*checkButtonImageOff
;
173 struct W_Pixmap
*radioButtonImageOn
;
174 struct W_Pixmap
*radioButtonImageOff
;
176 struct W_Pixmap
*buttonArrow
;
177 struct W_Pixmap
*pushedButtonArrow
;
179 struct W_Pixmap
*scrollerDimple
;
181 struct W_Pixmap
*upArrow
;
182 struct W_Pixmap
*downArrow
;
183 struct W_Pixmap
*leftArrow
;
184 struct W_Pixmap
*rightArrow
;
186 struct W_Pixmap
*hiUpArrow
;
187 struct W_Pixmap
*hiDownArrow
;
188 struct W_Pixmap
*hiLeftArrow
;
189 struct W_Pixmap
*hiRightArrow
;
191 struct W_Pixmap
*pullDownIndicator
;
192 struct W_Pixmap
*popUpIndicator
;
194 struct W_Pixmap
*checkMark
;
196 struct W_Pixmap
*homeIcon
;
197 struct W_Pixmap
*altHomeIcon
;
199 struct W_Pixmap
*magnifyIcon
;
200 /* struct W_Pixmap *altMagnifyIcon;*/
201 struct W_Pixmap
*wheelIcon
;
202 struct W_Pixmap
*grayIcon
;
203 struct W_Pixmap
*rgbIcon
;
204 struct W_Pixmap
*cmykIcon
;
205 struct W_Pixmap
*hsbIcon
;
206 struct W_Pixmap
*customPaletteIcon
;
207 struct W_Pixmap
*colorListIcon
;
209 struct W_Pixmap
*defaultObjectIcon
;
211 Cursor defaultCursor
;
215 Cursor invisibleCursor
;
217 Atom internalMessage
; /* for ClientMessage */
219 Atom attribsAtom
; /* GNUstepWindowAttributes */
221 Atom deleteWindowAtom
; /* WM_DELETE_WINDOW */
223 Atom protocolsAtom
; /* _XA_WM_PROTOCOLS */
225 Atom clipboardAtom
; /* CLIPBOARD */
228 /* stuff for detecting double-clicks */
229 Time lastClickTime
; /* time of last mousedown event */
230 Window lastClickWindow
; /* window of the last mousedown */
232 struct W_View
*modalView
;
234 unsigned ignoreNextDoubleClick
:1;
239 typedef struct W_ViewDelegate
{
242 void (*didMove
)(struct W_ViewDelegate
*, WMView
*);
244 void (*didResize
)(struct W_ViewDelegate
*, WMView
*);
246 void (*willMove
)(struct W_ViewDelegate
*, WMView
*, int*, int*);
248 void (*willResize
)(struct W_ViewDelegate
*, WMView
*,
249 unsigned int*, unsigned int*);
254 typedef struct W_View
{
255 struct W_Screen
*screen
;
257 WMWidget
*self
; /* must point to the widget the
260 W_ViewDelegate
*delegate
;
268 struct W_View
*nextFocusChain
; /* next/prev in focus chain */
269 struct W_View
*prevFocusChain
;
271 struct W_View
*parent
; /* parent WMView */
273 struct W_View
*childrenList
; /* first in list of child windows */
275 struct W_View
*nextSister
; /* next on parent's children list */
277 struct W_EventHandler
*handlerList
;/* list of event handlers for this window */
279 unsigned long attribFlags
;
280 XSetWindowAttributes attribs
;
282 void *hangedData
; /* data holder for user program */
287 struct W_DragSourceProcs
*dragSourceProcs
;
288 struct W_DragDestinationProcs
*dragDestinationProcs
;
293 unsigned int realized
:1;
294 unsigned int mapped
:1;
295 unsigned int parentDying
:1;
296 unsigned int dying
:1; /* the view is being destroyed */
297 unsigned int topLevel
:1; /* is a top level window */
298 unsigned int root
:1; /* is the root window */
299 unsigned int mapWhenRealized
:1;/* map the view when it's realized */
300 unsigned int alreadyDead
:1; /* view was freed */
302 unsigned int dontCompressMotion
:1; /* motion notify event compress */
303 unsigned int notifySizeChanged
:1;
304 unsigned int dontCompressExpose
:1; /* will compress all expose
307 unsigned int worksWhenModal
:1;
308 unsigned int pendingRelease1
:1;
309 unsigned int pendingRelease2
:1;
310 unsigned int pendingRelease3
:1;
311 unsigned int pendingRelease4
:1;
312 unsigned int pendingRelease5
:1;
319 typedef struct W_EventHandler
{
320 unsigned long eventMask
;
326 struct W_EventHandler
*nextHandler
;
332 typedef struct _WINGsConfiguration
{
334 char *boldSystemFont
;
336 unsigned doubleClickDelay
;
337 } _WINGsConfiguration
;
339 _WINGsConfiguration WINGsConfiguration
;
343 #define CHECK_CLASS(widget, class) assert(W_CLASS(widget)==(class))
346 #define W_CLASS(widget) (((W_WidgetType*)(widget))->widgetClass)
347 #define W_VIEW(widget) (((W_WidgetType*)(widget))->view)
349 #define W_VIEW_REALIZED(view) (view)->flags.realized
350 #define W_VIEW_MAPPED(view) (view)->flags.mapped
352 #define W_PIXEL(c) (c)->color.pixel
354 #define W_FONTID(f) (f)->font->fid
356 #define W_DRAWABLE(scr) (scr)->rcontext->drawable
360 W_View
*W_GetViewForXWindow(Display
*display
, Window window
);
362 W_View
*W_CreateView(W_View
*parent
);
364 W_View
*W_CreateTopView(W_Screen
*screen
);
367 W_View
*W_CreateRootView(W_Screen
*screen
);
369 void W_DestroyView(W_View
*view
);
371 void W_RealizeView(W_View
*view
);
373 void W_ReparentView(W_View
*view
, W_View
*newParent
, int x
, int y
);
375 void W_MapView(W_View
*view
);
377 void W_MapSubviews(W_View
*view
);
379 void W_UnmapSubviews(W_View
*view
);
381 W_View
*W_TopLevelOfView(W_View
*view
);
383 void W_UnmapView(W_View
*view
);
385 void W_MoveView(W_View
*view
, int x
, int y
);
387 void W_ResizeView(W_View
*view
, unsigned int width
, unsigned int height
);
389 void W_SetViewBackgroundColor(W_View
*view
, WMColor
*color
);
391 void W_DrawRelief(W_Screen
*scr
, Drawable d
, int x
, int y
, unsigned int width
,
392 unsigned int height
, WMReliefType relief
);
395 void W_CleanUpEvents(W_View
*view
);
397 void W_CallDestroyHandlers(W_View
*view
);
399 void W_PaintTextAndImage(W_View
*view
, int wrap
, GC textGC
, W_Font
*font
,
400 WMReliefType relief
, char *text
,
401 WMAlignment alignment
, W_Pixmap
*image
,
402 WMImagePosition position
, GC backGC
, int ofs
);
404 void W_PaintText(W_View
*view
, Drawable d
, WMFont
*font
, int x
, int y
,
405 int width
, WMAlignment alignment
, GC gc
,
406 int wrap
, char *text
, int length
);
408 int W_GetTextHeight(WMFont
*font
, char *text
, int width
, int wrap
);
411 int W_TextWidth(WMFont
*font
, char *text
, int length
);
414 void W_BroadcastMessage(W_View
*targetParent
, XEvent
*event
);
416 void W_DispatchMessage(W_View
*target
, XEvent
*event
);
418 Bool
W_CheckInternalMessage(W_Screen
*scr
, XClientMessageEvent
*cev
, int event
);
420 void W_SetFocusOfToplevel(W_View
*toplevel
, W_View
*view
);
422 W_View
*W_FocusedViewOfToplevel(W_View
*view
);
424 void W_SetFocusOfTopLevel(W_View
*toplevel
, W_View
*view
);
426 void W_ReleaseView(WMView
*view
);
428 WMView
*W_RetainView(WMView
*view
);
430 void W_InitApplication(WMScreen
*scr
);
432 void W_InitNotificationCenter(void);
434 W_Class
W_RegisterUserWidget(void);
436 void W_RedisplayView(WMView
*view
);
438 Bool
W_ApplicationInitialized(void);
440 char *W_GetTextSelection(WMScreen
*scr
, Atom selection
);
442 void W_HandleSelectionEvent(XEvent
*event
);
446 #endif /* __cplusplus */
448 #endif /* _WINGSP_H_ */
450 void W_FlushASAPNotificationQueue();
452 void W_FlushIdleNotificationQueue();
454 struct W_Balloon
*W_CreateBalloon(WMScreen
*scr
);
456 void W_BalloonHandleEnterView(WMView
*view
);
458 void W_BalloonHandleLeaveView(WMView
*view
);