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
;
164 struct W_Balloon
*balloon
;
167 struct W_Pixmap
*checkButtonImageOn
;
168 struct W_Pixmap
*checkButtonImageOff
;
170 struct W_Pixmap
*radioButtonImageOn
;
171 struct W_Pixmap
*radioButtonImageOff
;
173 struct W_Pixmap
*buttonArrow
;
174 struct W_Pixmap
*pushedButtonArrow
;
176 struct W_Pixmap
*scrollerDimple
;
178 struct W_Pixmap
*upArrow
;
179 struct W_Pixmap
*downArrow
;
180 struct W_Pixmap
*leftArrow
;
181 struct W_Pixmap
*rightArrow
;
183 struct W_Pixmap
*hiUpArrow
;
184 struct W_Pixmap
*hiDownArrow
;
185 struct W_Pixmap
*hiLeftArrow
;
186 struct W_Pixmap
*hiRightArrow
;
188 struct W_Pixmap
*pullDownIndicator
;
189 struct W_Pixmap
*popUpIndicator
;
191 struct W_Pixmap
*checkMark
;
193 struct W_Pixmap
*homeIcon
;
194 struct W_Pixmap
*altHomeIcon
;
196 struct W_Pixmap
*magnifyIcon
;
197 struct W_Pixmap
*altMagnifyIcon
;
198 struct W_Pixmap
*wheelIcon
;
199 struct W_Pixmap
*grayIcon
;
200 struct W_Pixmap
*rgbIcon
;
201 struct W_Pixmap
*cmykIcon
;
202 struct W_Pixmap
*hsbIcon
;
203 struct W_Pixmap
*customPaletteIcon
;
204 struct W_Pixmap
*colorListIcon
;
206 struct W_Pixmap
*defaultObjectIcon
;
208 Cursor defaultCursor
;
212 Atom internalMessage
; /* for ClientMessage */
214 Atom attribsAtom
; /* GNUstepWindowAttributes */
216 Atom deleteWindowAtom
; /* WM_DELETE_WINDOW */
218 Atom protocolsAtom
; /* _XA_WM_PROTOCOLS */
220 Atom clipboardAtom
; /* CLIPBOARD */
223 /* stuff for detecting double-clicks */
224 Time lastClickTime
; /* time of last mousedown event */
225 Window lastClickWindow
; /* window of the last mousedown */
227 struct W_View
*modalView
;
229 unsigned ignoreNextDoubleClick
:1;
234 typedef struct W_View
{
235 struct W_Screen
*screen
;
237 WMWidget
*self
; /* must point to the widget the
246 struct W_View
*nextFocusChain
; /* next/prev in focus chain */
247 struct W_View
*prevFocusChain
;
249 struct W_View
*parent
; /* parent WMView */
251 struct W_View
*childrenList
; /* first in list of child windows */
253 struct W_View
*nextSister
; /* next on parent's children list */
255 struct W_EventHandler
*handlerList
;/* list of event handlers for this window */
257 unsigned long attribFlags
;
258 XSetWindowAttributes attribs
;
260 void *hangedData
; /* data holder for user program */
262 struct W_DragSourceProcs
*dragSourceProcs
;
263 struct W_DragDestinationProcs
*dragDestinationProcs
;
268 unsigned int realized
:1;
269 unsigned int mapped
:1;
270 unsigned int parentDying
:1;
271 unsigned int dying
:1; /* the view is being destroyed */
272 unsigned int topLevel
:1; /* is a top level window */
273 unsigned int root
:1; /* is the root window */
274 unsigned int mapWhenRealized
:1;/* map the view when it's realized */
275 unsigned int alreadyDead
:1; /* view was freed */
277 unsigned int dontCompressMotion
:1; /* motion notify event compress */
278 unsigned int notifySizeChanged
:1;
279 unsigned int dontCompressExpose
:1; /* will compress all expose
282 unsigned int worksWhenModal
:1;
283 unsigned int pendingRelease1
:1;
284 unsigned int pendingRelease2
:1;
285 unsigned int pendingRelease3
:1;
286 unsigned int pendingRelease4
:1;
287 unsigned int pendingRelease5
:1;
294 typedef struct W_EventHandler
{
295 unsigned long eventMask
;
301 struct W_EventHandler
*nextHandler
;
306 typedef struct W_ViewProcedureTable
{
307 void (*setBackgroundColor
)(WMWidget
*, WMColor
*color
);
308 void (*resize
)(WMWidget
*, unsigned int, unsigned int);
309 void (*move
)(WMWidget
*, int, int);
310 } W_ViewProcedureTable
;
314 typedef struct _WINGsConfiguration
{
316 char *boldSystemFont
;
317 unsigned doubleClickDelay
;
318 } _WINGsConfiguration
;
320 _WINGsConfiguration WINGsConfiguration
;
324 #define CHECK_CLASS(widget, class) assert(W_CLASS(widget)==(class))
327 #define W_CLASS(widget) (((W_WidgetType*)(widget))->widgetClass)
328 #define W_VIEW(widget) (((W_WidgetType*)(widget))->view)
330 #define W_VIEW_REALIZED(view) (view)->flags.realized
331 #define W_VIEW_MAPPED(view) (view)->flags.mapped
333 #define W_PIXEL(c) (c)->color.pixel
335 #define W_FONTID(f) (f)->font->fid
337 #define W_DRAWABLE(scr) (scr)->rcontext->drawable
341 W_View
*W_GetViewForXWindow(Display
*display
, Window window
);
343 W_View
*W_CreateView(W_View
*parent
);
345 W_View
*W_CreateTopView(W_Screen
*screen
);
348 W_View
*W_CreateRootView(W_Screen
*screen
);
350 void W_DestroyView(W_View
*view
);
352 void W_RealizeView(W_View
*view
);
354 void W_ReparentView(W_View
*view
, W_View
*newParent
, int x
, int y
);
356 void W_MapView(W_View
*view
);
358 void W_MapSubviews(W_View
*view
);
360 void W_UnmapSubviews(W_View
*view
);
362 W_View
*W_TopLevelOfView(W_View
*view
);
364 void W_UnmapView(W_View
*view
);
366 void W_MoveView(W_View
*view
, int x
, int y
);
368 void W_ResizeView(W_View
*view
, unsigned int width
, unsigned int height
);
370 void W_SetViewBackgroundColor(W_View
*view
, WMColor
*color
);
372 void W_DrawRelief(W_Screen
*scr
, Drawable d
, int x
, int y
, unsigned int width
,
373 unsigned int height
, WMReliefType relief
);
376 void W_CleanUpEvents(W_View
*view
);
378 void W_CallDestroyHandlers(W_View
*view
);
380 void W_PaintTextAndImage(W_View
*view
, int wrap
, GC textGC
, W_Font
*font
,
381 WMReliefType relief
, char *text
,
382 WMAlignment alignment
, W_Pixmap
*image
,
383 WMImagePosition position
, GC backGC
, int ofs
);
385 void W_PaintText(W_View
*view
, Drawable d
, WMFont
*font
, int x
, int y
,
386 int width
, WMAlignment alignment
, GC gc
,
387 int wrap
, char *text
, int length
);
389 int W_GetTextHeight(WMFont
*font
, char *text
, int width
, int wrap
);
392 int W_TextWidth(WMFont
*font
, char *text
, int length
);
395 void W_BroadcastMessage(W_View
*targetParent
, XEvent
*event
);
397 void W_DispatchMessage(W_View
*target
, XEvent
*event
);
399 Bool
W_CheckInternalMessage(W_Screen
*scr
, XClientMessageEvent
*cev
, int event
);
401 void W_SetFocusOfToplevel(W_View
*toplevel
, W_View
*view
);
403 W_View
*W_FocusedViewOfToplevel(W_View
*view
);
405 void W_SetFocusOfTopLevel(W_View
*toplevel
, W_View
*view
);
407 void W_ReleaseView(WMView
*view
);
409 WMView
*W_RetainView(WMView
*view
);
411 void W_InitApplication(WMScreen
*scr
);
413 void W_InitNotificationCenter(void);
415 W_Class
W_RegisterUserWidget(W_ViewProcedureTable
*procTable
);
417 void W_RedisplayView(WMView
*view
);
419 Bool
W_ApplicationInitialized(void);
421 char *W_GetTextSelection(WMScreen
*scr
, Atom selection
);
423 void W_HandleSelectionEvent(XEvent
*event
);
427 #endif /* __cplusplus */
429 #endif /* _WINGSP_H_ */
431 void W_FlushASAPNotificationQueue();
433 void W_FlushIdleNotificationQueue();