bracket enum declarations with preprocessor defines to avoid
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blob88a05ea547d4f060e65c22467bfb35118d5cc61e
3 #ifndef _WINGS_H_
4 #define _WINGS_H_
6 #include <wraster.h>
7 #include <WINGs/WUtil.h>
8 #include <X11/Xlib.h>
10 #define WINGS_H_VERSION 20010117
13 #ifdef __cplusplus
14 extern "C" {
15 #endif /* __cplusplus */
16 #if 0
18 #endif
21 typedef unsigned long WMPixel;
24 typedef struct {
25 unsigned int width;
26 unsigned int height;
27 } WMSize;
29 typedef struct {
30 int x;
31 int y;
32 } WMPoint;
34 typedef struct {
35 WMPoint pos;
36 WMSize size;
37 } WMRect;
40 /* WMRange was moved in WUtil.h */
42 #define ClientMessageMask (1L<<30)
45 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
46 #define _DEFINED_GNUSTEP_WINDOW_INFO
48 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
49 * NSDesktopWindowLevel intended to be the level at which things
50 * on the desktop sit ... so you should be able
51 * to put a desktop background just below it.
53 * Applications are actually permitted to use any value in the
54 * range INT_MIN+1 to INT_MAX
56 enum {
57 WMDesktopWindowLevel = -1000, /* GNUstep addition */
58 WMNormalWindowLevel = 0,
59 WMFloatingWindowLevel = 3,
60 WMSubmenuWindowLevel = 3,
61 WMTornOffMenuWindowLevel = 3,
62 WMMainMenuWindowLevel = 20,
63 WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */
64 WMStatusWindowLevel = 21,
65 WMModalPanelWindowLevel = 100,
66 WMPopUpMenuWindowLevel = 101,
67 WMScreenSaverWindowLevel = 1000
71 /* window attributes */
72 enum {
73 WMBorderlessWindowMask = 0,
74 WMTitledWindowMask = 1,
75 WMClosableWindowMask = 2,
76 WMMiniaturizableWindowMask = 4,
77 WMResizableWindowMask = 8,
78 WMIconWindowMask = 64,
79 WMMiniWindowMask = 128
81 #endif
84 /* button types */
85 typedef enum {
86 /* 0 is reserved for internal use */
87 WBTMomentaryPush = 1,
88 WBTPushOnPushOff = 2,
89 WBTToggle = 3,
90 WBTSwitch = 4,
91 WBTRadio = 5,
92 WBTMomentaryChange = 6,
93 WBTOnOff = 7,
94 WBTMomentaryLight = 8
95 } WMButtonType;
97 /* button behaviour masks */
98 enum {
99 WBBSpringLoadedMask = (1 << 0),
100 WBBPushInMask = (1 << 1),
101 WBBPushChangeMask = (1 << 2),
102 WBBPushLightMask = (1 << 3),
103 WBBStateLightMask = (1 << 5),
104 WBBStateChangeMask = (1 << 6),
105 WBBStatePushMask = (1 << 7)
109 /* frame title positions */
110 typedef enum {
111 WTPNoTitle,
112 WTPAboveTop,
113 WTPAtTop,
114 WTPBelowTop,
115 WTPAboveBottom,
116 WTPAtBottom,
117 WTPBelowBottom
118 } WMTitlePosition;
121 /* relief types */
122 typedef enum {
123 WRFlat,
124 WRSimple,
125 WRRaised,
126 WRSunken,
127 WRGroove,
128 WRRidge,
129 WRPushed
130 } WMReliefType;
133 /* alignment types */
134 typedef enum {
135 WALeft,
136 WACenter,
137 WARight,
138 WAJustified /* not valid for textfields */
139 } WMAlignment;
142 /* image position */
143 typedef enum {
144 WIPNoImage,
145 WIPImageOnly,
146 WIPLeft,
147 WIPRight,
148 WIPBelow,
149 WIPAbove,
150 WIPOverlaps
151 } WMImagePosition;
154 /* scroller arrow position */
155 typedef enum {
156 WSAMaxEnd,
157 WSAMinEnd,
158 WSANone
159 } WMScrollArrowPosition;
161 /* scroller parts */
162 typedef enum {
163 WSNoPart,
164 WSDecrementPage,
165 WSIncrementPage,
166 WSDecrementLine,
167 WSIncrementLine,
168 WSDecrementWheel,
169 WSIncrementWheel,
170 WSKnob,
171 WSKnobSlot
172 } WMScrollerPart;
174 /* usable scroller parts */
175 typedef enum {
176 WSUNoParts,
177 WSUOnlyArrows,
178 WSUAllParts
179 } WMUsableScrollerParts;
181 /* matrix types */
182 typedef enum {
183 WMRadioMode,
184 WMHighlightMode,
185 WMListMode,
186 WMTrackMode
187 } WMMatrixTypes;
190 typedef enum {
191 WTTopTabsBevelBorder,
192 WTNoTabsBevelBorder,
193 WTNoTabsLineBorder,
194 WTNoTabsNoBorder
195 } WMTabViewType;
198 /* text movement types */
199 enum {
200 WMIllegalTextMovement,
201 WMReturnTextMovement,
202 WMEscapeTextMovement,
203 WMTabTextMovement,
204 WMBacktabTextMovement,
205 WMLeftTextMovement,
206 WMRightTextMovement,
207 WMUpTextMovement,
208 WMDownTextMovement
211 /* text field special events */
212 enum {
213 WMInsertTextEvent,
214 WMDeleteTextEvent
218 enum {
219 WLNotFound = -1 /* element was not found in WMList */
223 /* drag operations */
224 typedef enum {
225 WDOperationNone,
226 WDOperationCopy,
227 WDOperationMove,
228 WDOperationLink,
229 WDOperationAsk,
230 WDOperationPrivate
231 } WMDragOperationType;
234 typedef enum {
235 WMGrayModeColorPanel = 1,
236 WMRGBModeColorPanel = 2,
237 WMCMYKModeColorPanel = 3,
238 WMHSBModeColorPanel = 4,
239 WMCustomPaletteModeColorPanel = 5,
240 WMColorListModeColorPanel = 6,
241 WMWheelModeColorPanel = 7
242 } WMColorPanelMode;
246 /* system images */
247 #define WSIReturnArrow 1
248 #define WSIHighlightedReturnArrow 2
249 #define WSIScrollerDimple 3
250 #define WSIArrowLeft 4
251 #define WSIHighlightedArrowLeft 5
252 #define WSIArrowRight 6
253 #define WSIHighlightedArrowRight 7
254 #define WSIArrowUp 8
255 #define WSIHighlightedArrowUp 9
256 #define WSIArrowDown 10
257 #define WSIHighlightedArrowDown 11
258 #define WSICheckMark 12
260 enum {
261 WLDSSelected = (1 << 16),
262 WLDSDisabled = (1 << 17),
263 WLDSFocused = (1 << 18),
264 WLDSIsBranch = (1 << 19)
267 /* alert panel return values */
268 enum {
269 WAPRDefault = 0,
270 WAPRAlternate = 1,
271 WAPROther = -1,
272 WAPRError = -2
277 /* types of input observers */
278 enum {
279 WIReadMask = (1 << 0),
280 WIWriteMask = (1 << 1),
281 WIExceptMask = (1 << 2)
286 typedef int W_Class;
288 enum {
289 WC_Window = 0,
290 WC_Frame = 1,
291 WC_Label = 2,
292 WC_Button = 3,
293 WC_TextField = 4,
294 WC_Scroller = 5,
295 WC_ScrollView = 6,
296 WC_List = 7,
297 WC_Browser = 8,
298 WC_PopUpButton = 9,
299 WC_ColorWell = 10,
300 WC_Slider = 11,
301 WC_Matrix = 12, /* not ready */
302 WC_SplitView = 13,
303 WC_TabView = 14,
304 WC_ProgressIndicator = 15,
305 WC_MenuView = 16,
306 WC_Ruler = 17,
307 WC_Text = 18,
308 WC_Box = 19
311 /* All widgets must start with the following structure
312 * in that order. Used for typecasting to get some generic data */
313 typedef struct W_WidgetType {
314 W_Class widgetClass;
315 struct W_View *view;
317 } W_WidgetType;
320 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
321 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
324 /* widgets */
326 typedef void WMWidget;
328 typedef struct W_Pixmap WMPixmap;
329 typedef struct W_Font WMFont;
330 typedef struct W_Color WMColor;
332 typedef struct W_Screen WMScreen;
334 typedef struct W_View WMView;
336 typedef struct W_Window WMWindow;
337 typedef struct W_Frame WMFrame;
338 typedef struct W_Button WMButton;
339 typedef struct W_Label WMLabel;
340 typedef struct W_TextField WMTextField;
341 typedef struct W_Scroller WMScroller;
342 typedef struct W_ScrollView WMScrollView;
343 typedef struct W_List WMList;
344 typedef struct W_Browser WMBrowser;
345 typedef struct W_PopUpButton WMPopUpButton;
346 typedef struct W_ProgressIndicator WMProgressIndicator;
347 typedef struct W_ColorWell WMColorWell;
348 typedef struct W_Slider WMSlider;
349 typedef struct W_Matrix WMMatrix; /* not ready */
350 typedef struct W_SplitView WMSplitView;
351 typedef struct W_TabView WMTabView;
352 typedef struct W_Ruler WMRuler;
353 typedef struct W_Text WMText;
354 typedef struct W_Box WMBox;
357 /* not widgets */
358 typedef struct W_TabViewItem WMTabViewItem;
359 typedef struct W_MenuItem WMMenuItem;
362 typedef struct W_FilePanel WMFilePanel;
363 typedef WMFilePanel WMOpenPanel;
364 typedef WMFilePanel WMSavePanel;
366 typedef struct W_FontPanel WMFontPanel;
368 typedef struct W_ColorPanel WMColorPanel;
371 /* item for WMList */
372 typedef struct WMListItem {
373 char *text;
374 void *clientData; /* ptr for user clientdata. */
376 unsigned int uflags:16; /* flags for the user */
377 unsigned int selected:1;
378 unsigned int disabled:1;
379 unsigned int isBranch:1;
380 unsigned int loaded:1;
381 } WMListItem;
383 /* struct for message panel */
384 typedef struct WMAlertPanel {
385 WMWindow *win; /* window */
386 WMBox *vbox;
387 WMButton *defBtn; /* default button */
388 WMButton *altBtn; /* alternative button */
389 WMButton *othBtn; /* other button */
390 WMLabel *iLbl; /* icon label */
391 WMLabel *tLbl; /* title label */
392 WMLabel *mLbl; /* message label */
393 WMFrame *line; /* separator */
394 short result; /* button that was pushed */
395 short done;
397 KeyCode retKey;
398 KeyCode escKey;
399 } WMAlertPanel;
402 typedef struct WMInputPanel {
403 WMWindow *win; /* window */
404 WMButton *defBtn; /* default button */
405 WMButton *altBtn; /* alternative button */
406 WMLabel *tLbl; /* title label */
407 WMLabel *mLbl; /* message label */
408 WMTextField *text; /* text field */
409 short result; /* button that was pushed */
410 short done;
412 KeyCode retKey;
413 KeyCode escKey;
414 } WMInputPanel;
419 /* WMRuler: */
420 typedef struct {
421 WMArray *tabs; /* a growable array of tabstops */
422 unsigned short left; /* left margin marker */
423 unsigned short right; /* right margin marker */
424 unsigned short first; /* indentation marker for first line only */
425 unsigned short body; /* body indentation marker */
426 unsigned short retainCount;
427 } WMRulerMargins;
428 /* All indentation and tab markers are _relative_ to the left margin marker */
431 typedef void *WMHandlerID;
433 typedef void WMInputProc(int fd, int mask, void *clientData);
435 typedef void WMEventProc(XEvent *event, void *clientData);
437 typedef void WMEventHook(XEvent *event);
439 /* self is set to the widget from where the callback is being called and
440 * clientData to the data set to with WMSetClientData() */
441 typedef void WMAction(WMWidget *self, void *clientData);
443 /* same as WMAction, but for stuff that arent widgets */
444 typedef void WMAction2(void *self, void *clientData);
447 typedef void WMCallback(void *data);
449 typedef void WMDropDataCallback(WMView *view, WMData *data);
451 /* delegate method like stuff */
452 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
453 int state, WMRect *rect);
456 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
457 unsigned int oldWidth,
458 unsigned int oldHeight);
461 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
462 int *minSize, int *maxSize);
464 typedef WMWidget *WMMatrixCreateCellProc(WMMatrix *mPtr);
469 typedef struct WMBrowserDelegate {
470 void *data;
472 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
473 WMBrowser *sender, int column, WMList *list);
475 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
476 int column);
478 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
480 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
481 } WMBrowserDelegate;
484 typedef struct WMTextFieldDelegate {
485 void *data;
487 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
488 WMNotification *notif);
490 void (*didChange)(struct WMTextFieldDelegate *self,
491 WMNotification *notif);
493 void (*didEndEditing)(struct WMTextFieldDelegate *self,
494 WMNotification *notif);
496 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
497 WMTextField *tPtr);
499 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
500 WMTextField *tPtr);
501 } WMTextFieldDelegate;
504 typedef struct WMTextDelegate {
505 void *data;
507 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
508 void *description);
510 } WMTextDelegate;
514 typedef struct WMTabViewDelegate {
515 void *data;
517 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
518 WMTabView *tabView);
520 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
521 WMTabViewItem *item);
523 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
524 WMTabViewItem *item);
526 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
527 WMTabViewItem *item);
528 } WMTabViewDelegate;
533 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
534 Time timestamp, void *cdata, WMData *data);
537 typedef struct WMSelectionProcs {
538 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
539 void *cdata, Atom *type);
540 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
541 void (*selectionDone)(WMView *view, Atom selection, Atom target,
542 void *cdata);
543 } WMSelectionProcs;
546 typedef struct W_DraggingInfo WMDraggingInfo;
549 typedef struct W_DragSourceProcs {
550 unsigned (*draggingSourceOperation)(WMView *self, Bool local);
551 void (*beganDragImage)(WMView *self, WMPixmap *image, WMPoint point);
552 void (*endedDragImage)(WMView *self, WMPixmap *image, WMPoint point,
553 Bool deposited);
554 WMData* (*fetchDragData)(WMView *self, char *type);
555 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
556 } WMDragSourceProcs;
560 typedef struct W_DragDestinationProcs {
561 unsigned (*draggingEntered)(WMView *self, WMDraggingInfo *info);
562 unsigned (*draggingUpdated)(WMView *self, WMDraggingInfo *info);
563 void (*draggingExited)(WMView *self, WMDraggingInfo *info);
564 Bool (*prepareForDragOperation)(WMView *self, WMDraggingInfo *info);
565 Bool (*performDragOperation)(WMView *self, WMDraggingInfo *info);
566 void (*concludeDragOperation)(WMView *self, WMDraggingInfo *info);
567 } WMDragDestinationProcs;
571 /* ...................................................................... */
574 WMRange wmkrange(int start, int count);
576 WMPoint wmkpoint(int x, int y);
578 WMSize wmksize(unsigned int width, unsigned int height);
581 /* ....................................................................... */
585 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
587 void WMSetResourcePath(char *path);
589 /* don't free the returned string */
590 char *WMGetApplicationName();
592 /* Try to locate resource file. ext may be NULL */
593 char *WMPathForResourceOfType(char *resource, char *ext);
596 WMScreen *WMOpenScreen();
598 WMScreen *WMCreateScreenWithRContext(Display *display, int screen,
599 RContext *context);
601 WMScreen *WMCreateScreen(Display *display, int screen);
603 WMScreen *WMCreateSimpleApplicationScreen(Display *display);
605 void WMScreenMainLoop(WMScreen *scr);
607 void WMBreakModalLoop(WMScreen *scr);
609 void WMRunModalLoop(WMScreen *scr, WMView *view);
611 RContext *WMScreenRContext(WMScreen *scr);
613 Display *WMScreenDisplay(WMScreen *scr);
615 int WMScreenDepth(WMScreen *scr);
619 void WMSetApplicationIconImage(WMScreen *app, WMPixmap *icon);
621 WMPixmap *WMGetApplicationIconImage(WMScreen *app);
623 void WMSetApplicationIconWindow(WMScreen *scr, Window window);
625 void WMSetFocusToWidget(WMWidget *widget);
627 WMEventHook *WMHookEventHandler(WMEventHook *handler);
629 int WMHandleEvent(XEvent *event);
631 Bool WMScreenPending(WMScreen *scr);
633 void WMCreateEventHandler(WMView *view, unsigned long mask,
634 WMEventProc *eventProc, void *clientData);
636 void WMDeleteEventHandler(WMView *view, unsigned long mask,
637 WMEventProc *eventProc, void *clientData);
639 int WMIsDoubleClick(XEvent *event);
641 int WMIsTripleClick(XEvent *event);
643 void WMNextEvent(Display *dpy, XEvent *event);
645 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
647 WMHandlerID WMAddTimerHandler(int milliseconds, WMCallback *callback,
648 void *cdata);
650 void WMDeleteTimerWithClientData(void *cdata);
652 void WMDeleteTimerHandler(WMHandlerID handlerID);
654 WMHandlerID WMAddIdleHandler(WMCallback *callback, void *cdata);
656 void WMDeleteIdleHandler(WMHandlerID handlerID);
658 WMHandlerID WMAddInputHandler(int fd, int condition, WMInputProc *proc,
659 void *clientData);
661 void WMDeleteInputHandler(WMHandlerID handlerID);
665 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
666 WMSelectionProcs *procs, void *cdata);
668 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
670 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
671 Time timestamp, WMSelectionCallback *callback,
672 void *cdata);
675 /* ....................................................................... */
677 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
679 void WMDragImageFromView(WMView *view, WMPixmap *image, char *dataTypes[],
680 WMPoint atLocation, WMSize mouseOffset, XEvent *event,
681 Bool slideBack);
683 void WMRegisterViewForDraggedTypes(WMView *view, char *acceptedTypes[]);
685 void WMUnregisterViewDraggedTypes(WMView *view);
687 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
690 WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info);
692 /* ....................................................................... */
694 WMFont *WMCreateFontSet(WMScreen *scrPtr, char *fontName);
696 WMFont *WMCreateNormalFont(WMScreen *scrPtr, char *fontName);
698 WMFont *WMCreateFont(WMScreen *scrPtr, char *fontName);
700 WMFont *WMRetainFont(WMFont *font);
702 void WMReleaseFont(WMFont *font);
704 unsigned int WMFontHeight(WMFont *font);
707 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
709 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
713 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
715 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
717 WMFont *WMSystemFontOfSize(WMScreen *scrPtr, int size);
719 WMFont *WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
721 XFontSet WMGetFontFontSet(WMFont *font);
723 WMFont * WMNormalizeFont(WMScreen *scr, WMFont *font);
725 WMFont * WMStrengthenFont(WMScreen *scr, WMFont *font);
727 WMFont * WMUnstrengthenFont(WMScreen *scr, WMFont *font);
729 WMFont * WMEmphasizeFont(WMScreen *scr, WMFont *font);
731 WMFont * WMUnemphasizeFont(WMScreen *scr, WMFont *font);
733 WMFont * WMGetFontOfSize(WMScreen *scr, WMFont *font, int size);
735 /* ....................................................................... */
737 WMPixmap *WMRetainPixmap(WMPixmap *pixmap);
739 void WMReleasePixmap(WMPixmap *pixmap);
741 WMPixmap *WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
742 Bool masked);
744 WMPixmap *WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
745 Pixmap mask, int width, int height,
746 int depth);
748 WMPixmap *WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
749 int threshold);
751 WMPixmap *WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
753 WMSize WMGetPixmapSize(WMPixmap *pixmap);
755 WMPixmap *WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
757 WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
758 RColor *color);
760 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
762 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
764 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
766 WMPixmap *WMGetSystemPixmap(WMScreen *scr, int image);
768 /* ....................................................................... */
771 WMColor *WMDarkGrayColor(WMScreen *scr);
773 WMColor *WMGrayColor(WMScreen *scr);
775 WMColor *WMBlackColor(WMScreen *scr);
777 WMColor *WMWhiteColor(WMScreen *scr);
779 void WMSetColorInGC(WMColor *color, GC gc);
781 GC WMColorGC(WMColor *color);
783 WMPixel WMColorPixel(WMColor *color);
785 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
786 unsigned int width, unsigned int height);
788 void WMReleaseColor(WMColor *color);
790 WMColor *WMRetainColor(WMColor *color);
792 WMColor *WMCreateRGBColor(WMScreen *scr, unsigned short red,
793 unsigned short green, unsigned short blue,
794 Bool exact);
796 WMColor *WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
798 unsigned short WMRedComponentOfColor(WMColor *color);
800 unsigned short WMGreenComponentOfColor(WMColor *color);
802 unsigned short WMBlueComponentOfColor(WMColor *color);
804 char *WMGetColorRGBDescription(WMColor *color);
806 /* ....................................................................... */
809 void WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
810 int y, char *text, int length);
812 void WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
813 int y, char *text, int length);
815 int WMWidthOfString(WMFont *font, char *text, int length);
819 /* ....................................................................... */
821 WMScreen *WMWidgetScreen(WMWidget *w);
823 unsigned int WMScreenWidth(WMScreen *scr);
825 unsigned int WMScreenHeight(WMScreen *scr);
827 void WMUnmapWidget(WMWidget *w);
829 void WMMapWidget(WMWidget *w);
831 Bool WMWidgetIsMapped(WMWidget *w);
833 void WMRaiseWidget(WMWidget *w);
835 void WMLowerWidget(WMWidget *w);
837 void WMMoveWidget(WMWidget *w, int x, int y);
839 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
841 void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
843 void WMMapSubwidgets(WMWidget *w);
845 void WMUnmapSubwidgets(WMWidget *w);
847 void WMRealizeWidget(WMWidget *w);
849 void WMDestroyWidget(WMWidget *widget);
851 void WMHangData(WMWidget *widget, void *data);
853 void *WMGetHangedData(WMWidget *widget);
855 unsigned int WMWidgetWidth(WMWidget *w);
857 unsigned int WMWidgetHeight(WMWidget *w);
859 Window WMWidgetXID(WMWidget *w);
861 Window WMViewXID(WMView *view);
863 void WMRedisplayWidget(WMWidget *w);
865 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
867 WMSize WMGetViewSize(WMView *view);
869 WMPoint WMGetViewPosition(WMView *view);
871 WMPoint WMGetViewScreenPosition(WMView *view);
873 WMWidget *WMWidgetOfView(WMView *view);
875 void WMSetViewNextResponder(WMView *view, WMView *responder);
877 void WMRelayToNextResponder(WMView *view, XEvent *event);
879 /* notifications */
880 extern char *WMViewSizeDidChangeNotification;
882 extern char *WMViewRealizedNotification;
884 extern char *WMFontPanelDidChangeNotification;
887 /* ....................................................................... */
889 void WMSetBalloonTextForView(char *text, WMView *view);
891 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
893 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
895 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
897 void WMSetBalloonDelay(WMScreen *scr, int delay);
899 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
902 /* ....................................................................... */
904 WMWindow *WMCreateWindow(WMScreen *screen, char *name);
906 WMWindow *WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
908 WMWindow *WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
909 int style);
911 WMWindow *WMCreatePanelForWindow(WMWindow *owner, char *name);
913 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
915 void WMSetWindowTitle(WMWindow *wPtr, char *title);
917 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
919 void WMSetWindowMiniwindowImage(WMWindow *win, WMPixmap *pixmap);
921 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
923 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
925 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
927 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
928 int maxX, int maxY);
930 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
932 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
934 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
936 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
938 void WMSetWindowLevel(WMWindow *win, int level);
940 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
942 void WMCloseWindow(WMWindow *win);
944 /* ....................................................................... */
946 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
948 #define WMCreateCommandButton(parent) \
949 WMCreateCustomButton((parent), WBBSpringLoadedMask\
950 |WBBPushInMask\
951 |WBBPushLightMask\
952 |WBBPushChangeMask)
954 #define WMCreateRadioButton(parent) \
955 WMCreateButton((parent), WBTRadio)
957 #define WMCreateSwitchButton(parent) \
958 WMCreateButton((parent), WBTSwitch)
960 WMButton *WMCreateButton(WMWidget *parent, WMButtonType type);
962 WMButton *WMCreateCustomButton(WMWidget *parent, int behaviourMask);
964 void WMSetButtonImageDefault(WMButton *bPtr);
966 void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
968 void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
970 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
972 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
974 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
976 void WMSetButtonText(WMButton *bPtr, char *text);
978 void WMSetButtonAltText(WMButton *bPtr, char *text);
980 void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
982 void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
984 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
986 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
988 int WMGetButtonSelected(WMButton *bPtr);
990 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
992 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
994 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
996 void WMSetButtonTag(WMButton *bPtr, int tag);
998 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
1000 void WMPerformButtonClick(WMButton *bPtr);
1002 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
1004 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
1006 /* ....................................................................... */
1008 WMLabel *WMCreateLabel(WMWidget *parent);
1010 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1012 void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
1014 WMPixmap *WMGetLabelImage(WMLabel *lPtr);
1016 char *WMGetLabelText(WMLabel *lPtr);
1018 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1020 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1022 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1024 void WMSetLabelText(WMLabel *lPtr, char *text);
1026 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1028 void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
1030 /* ....................................................................... */
1032 WMFrame *WMCreateFrame(WMWidget *parent);
1034 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1036 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1038 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1040 /* ....................................................................... */
1042 WMTextField *WMCreateTextField(WMWidget *parent);
1044 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1046 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1048 /* you can free the returned string */
1049 char *WMGetTextFieldText(WMTextField *tPtr);
1051 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1053 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1055 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1057 WMFont *WMGetTextFieldFont(WMTextField *tPtr);
1059 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1061 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1063 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1065 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1067 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1069 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1071 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1073 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1075 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1077 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1080 extern char *WMTextDidChangeNotification;
1081 extern char *WMTextDidBeginEditingNotification;
1082 extern char *WMTextDidEndEditingNotification;
1084 /* ....................................................................... */
1086 WMScroller *WMCreateScroller(WMWidget *parent);
1088 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1089 float knobProportion);
1091 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1093 float WMGetScrollerValue(WMScroller *sPtr);
1095 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1097 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1099 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1100 WMScrollArrowPosition position);
1102 extern char *WMScrollerDidScrollNotification;
1104 /* ....................................................................... */
1106 WMList *WMCreateList(WMWidget *parent);
1108 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1110 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1112 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1114 WMListItem *WMInsertListItem(WMList *lPtr, int row, char *text);
1116 void WMSortListItems(WMList *lPtr);
1118 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1120 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1122 WMListItem *WMGetListItem(WMList *lPtr, int row);
1124 WMArray *WMGetListItems(WMList *lPtr);
1126 void WMRemoveListItem(WMList *lPtr, int row);
1128 void WMSelectListItem(WMList *lPtr, int row);
1130 void WMUnselectListItem(WMList *lPtr, int row);
1132 /* This will select all items in range, and deselect all the others */
1133 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1135 /* This will select all items in range, leaving the others as they are */
1136 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1138 void WMSelectAllListItems(WMList *lPtr);
1140 void WMUnselectAllListItems(WMList *lPtr);
1142 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1144 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1146 int WMGetListItemHeight(WMList *lPtr);
1148 /* don't free the returned data */
1149 WMArray* WMGetListSelectedItems(WMList *lPtr);
1152 * For the following 2 functions, in case WMList allows multiple selection,
1153 * the first item in the list of selected items, respective its row number,
1154 * will be returned.
1157 /* don't free the returned data */
1158 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1160 int WMGetListSelectedItemRow(WMList *lPtr);
1162 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1164 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1166 void WMClearList(WMList *lPtr);
1168 int WMGetListNumberOfRows(WMList *lPtr);
1170 void WMSetListPosition(WMList *lPtr, int row);
1172 void WMSetListBottomPosition(WMList *lPtr, int row);
1174 int WMGetListPosition(WMList *lPtr);
1176 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1178 Bool WMListAllowsEmptySelection(WMList *lPtr);
1181 extern char *WMListDidScrollNotification;
1182 extern char *WMListSelectionDidChangeNotification;
1184 /* ....................................................................... */
1186 WMBrowser *WMCreateBrowser(WMWidget *parent);
1188 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1190 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1192 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1194 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1196 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1198 int WMAddBrowserColumn(WMBrowser *bPtr);
1200 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1202 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1204 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1206 WMListItem *WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1208 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1210 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1211 WMCompareDataProc *func);
1213 /* Don't free the returned string. */
1214 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1216 /* free the returned string */
1217 char *WMGetBrowserPath(WMBrowser *bPtr);
1219 /* free the returned string */
1220 char *WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1222 /* free the returned array */
1223 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1225 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1227 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1228 void *clientData);
1230 WMListItem *WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1232 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1234 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1236 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1238 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1240 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1242 WMList *WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1244 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1246 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1248 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1250 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1252 /* ....................................................................... */
1255 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1257 WMMenuItem *WMCreateMenuItem(void);
1259 void WMDestroyMenuItem(WMMenuItem *item);
1261 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1263 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1265 char *WMGetMenuItemShortcut(WMMenuItem *item);
1267 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1269 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1271 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1273 void *WMGetMenuItemRepresentedObject(WMMenuItem *item);
1275 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1277 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1279 WMAction *WMGetMenuItemAction(WMMenuItem *item);
1281 void *WMGetMenuItemData(WMMenuItem *item);
1283 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1285 char *WMGetMenuItemTitle(WMMenuItem *item);
1287 void WMSetMenuItemState(WMMenuItem *item, int state);
1289 int WMGetMenuItemState(WMMenuItem *item);
1291 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1293 WMPixmap *WMGetMenuItemPixmap(WMMenuItem *item);
1295 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1297 WMPixmap *WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1299 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1301 WMPixmap *WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1303 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1305 WMPixmap *WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1307 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1310 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1312 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1315 /* ....................................................................... */
1317 WMPopUpButton *WMCreatePopUpButton(WMWidget *parent);
1319 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1320 void *clientData);
1322 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1324 WMMenuItem *WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1326 WMMenuItem *WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1327 char *title);
1329 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1331 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1333 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1335 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1337 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1339 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1341 /* don't free the returned data */
1342 char *WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1344 WMMenuItem *WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1347 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1349 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1351 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1353 /* ....................................................................... */
1355 WMProgressIndicator *WMCreateProgressIndicator(WMWidget *parent);
1357 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1359 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1361 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1363 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1365 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1367 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1370 /* ....................................................................... */
1372 WMColorPanel *WMGetColorPanel(WMScreen *scrPtr);
1374 void WMFreeColorPanel(WMColorPanel *panel);
1376 void WMShowColorPanel(WMColorPanel *panel);
1378 void WMCloseColorPanel(WMColorPanel *panel);
1380 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1382 WMColor *WMGetColorPanelColor(WMColorPanel *panel);
1384 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1386 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1388 extern char *WMColorPanelColorChangedNotification;
1390 /* ....................................................................... */
1392 WMColorWell *WMCreateColorWell(WMWidget *parent);
1394 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1396 WMColor *WMGetColorWellColor(WMColorWell *cPtr);
1398 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1401 extern char *WMColorWellDidChangeNotification;
1404 /* ...................................................................... */
1406 WMScrollView *WMCreateScrollView(WMWidget *parent);
1408 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1409 unsigned int height);
1411 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1413 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1415 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1417 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1419 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1421 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1423 WMScroller *WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1425 WMScroller *WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1427 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1429 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1431 /* ....................................................................... */
1433 WMSlider *WMCreateSlider(WMWidget *parent);
1435 int WMGetSliderMinValue(WMSlider *slider);
1437 int WMGetSliderMaxValue(WMSlider *slider);
1439 int WMGetSliderValue(WMSlider *slider);
1441 void WMSetSliderMinValue(WMSlider *slider, int value);
1443 void WMSetSliderMaxValue(WMSlider *slider, int value);
1445 void WMSetSliderValue(WMSlider *slider, int value);
1447 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1449 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1451 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1453 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1455 /* ....................................................................... */
1458 WMSplitView *WMCreateSplitView(WMWidget *parent);
1459 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1460 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1462 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1464 WMView *WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1466 /* remove the first subview == view */
1467 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1469 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1472 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1474 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1476 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1477 WMSplitViewConstrainProc *proc);
1480 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1481 WMSplitViewResizeSubviewsProc *proc);
1484 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1486 /* ...................................................................... */
1488 WMRuler *WMCreateRuler (WMWidget *parent);
1490 WMRulerMargins *WMGetRulerMargins(WMRuler *rPtr);
1492 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1494 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin,
1495 WMRulerMargins *anotherMargin);
1497 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1499 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1501 int WMGetRulerOffset(WMRuler *rPtr);
1503 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1505 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1507 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1509 /* ....................................................................... */
1512 #define WMCreateText(parent) WMCreateTextForDocumentType \
1513 ((parent), (NULL), (NULL))
1515 WMText *WMCreateTextForDocumentType(WMWidget *parent,
1516 WMAction *parser, WMAction *writer);
1518 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1520 void WMFreezeText(WMText *tPtr);
1522 #define WMRefreshText(tPtr) WMThawText((tPtr))
1524 void WMThawText(WMText *tPtr);
1526 int WMScrollText(WMText *tPtr, int amount);
1528 int WMPageText(WMText *tPtr, Bool direction);
1530 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1532 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1534 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1536 void WMShowTextRuler(WMText *tPtr, Bool show);
1538 int WMGetTextRulerShown(WMText *tPtr);
1540 void WMSetTextEditable(WMText *tPtr, Bool editable);
1542 int WMGetTextEditable(WMText *tPtr);
1544 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1546 int WMGetTextUsesMonoFont(WMText *tPtr);
1548 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1550 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1552 int WMGetTextIgnoresNewline(WMText *tPtr);
1554 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1556 WMFont * WMGetTextDefaultFont(WMText *tPtr);
1558 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1560 WMColor * WMGetTextDefaultColor(WMText *tPtr);
1562 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1564 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1566 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1568 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1570 void WMPrependTextStream(WMText *tPtr, char *text);
1572 void WMAppendTextStream(WMText *tPtr, char *text);
1574 /* free the text */
1575 char * WMGetTextStream(WMText *tPtr);
1577 /* free the text */
1578 char * WMGetTextSelectedStream(WMText *tPtr);
1580 /* destroy the array */
1581 WMArray * WMGetTextObjects(WMText *tPtr);
1583 /* destroy the array */
1584 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1586 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1588 WMColor *WMGetTextSelectionColor(WMText *tPtr);
1590 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1592 WMFont *WMGetTextSelectionFont(WMText *tPtr);
1594 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1596 int WMGetTextSelectionUnderlined(WMText *tPtr);
1598 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1600 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1601 Bool caseSensitive);
1603 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1606 /* parser related stuff... use only if implementing a new parser */
1608 void *WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1609 WMColor *color, unsigned short first, unsigned short extraInfo);
1611 void *WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1612 WMColor *color, unsigned short first, unsigned short extraInfo);
1614 void *WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1615 WMColor *color, unsigned short first, unsigned short length);
1617 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1618 unsigned int kanji, unsigned int underlined, int script,
1619 WMRulerMargins *margins);
1621 /* do NOT free the margins */
1622 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1623 unsigned int *kanji, unsigned int *underlined, int *script,
1624 WMRulerMargins *margins);
1626 int WMGetTextInsertType(WMText *tPtr);
1628 int WMGetTextBlocks(WMText *tPtr);
1630 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1632 int WMGetCurrentTextBlock(WMText *tPtr);
1634 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1636 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1638 void *WMRemoveTextBlock(WMText *tPtr);
1640 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1642 /* ....................................................................... */
1645 WMTabView *WMCreateTabView(WMWidget *parent);
1647 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1649 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1651 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1653 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1655 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1657 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1659 WMTabViewItem *WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1660 int identifier, char *label);
1662 WMTabViewItem *WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1664 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1666 void WMSelectLastTabViewItem(WMTabView *tPtr);
1668 void WMSelectNextTabViewItem(WMTabView *tPtr);
1670 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1672 WMTabViewItem *WMGetSelectedTabViewItem(WMTabView *tPtr);
1674 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1676 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1678 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1681 WMTabViewItem *WMCreateTabViewItemWithIdentifier(int identifier);
1683 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1685 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1687 char *WMGetTabViewItemLabel(WMTabViewItem *item);
1689 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1691 WMView *WMGetTabViewItemView(WMTabViewItem *item);
1693 void WMDestroyTabViewItem(WMTabViewItem *item);
1696 /* ....................................................................... */
1698 WMBox *WMCreateBox(WMWidget *parent);
1700 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1702 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1703 int minSize, int maxSize, int space);
1705 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1706 int minSize, int maxSize, int space);
1708 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1710 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1712 void WMSetBoxExpandsToParent(WMBox *box, int topOffs, int bottomOffs,
1713 int leftOffs, int rightOffs);
1715 /* ....................................................................... */
1717 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1718 char *defaultButton, char *alternateButton,
1719 char *otherButton);
1721 /* you can free the returned string */
1722 char *WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1723 char *defaultText, char *okButton, char *cancelButton);
1725 WMAlertPanel *WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1726 char *msg, char *defaultButton,
1727 char *alternateButton, char *otherButton);
1729 WMInputPanel *WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1730 char *msg, char *defaultText, char *okButton,
1731 char *cancelButton);
1733 void WMDestroyAlertPanel(WMAlertPanel *panel);
1735 void WMDestroyInputPanel(WMInputPanel *panel);
1737 /* ....................................................................... */
1739 /* only 1 instance per WMScreen */
1740 WMOpenPanel *WMGetOpenPanel(WMScreen *scrPtr);
1742 WMSavePanel *WMGetSavePanel(WMScreen *scrPtr);
1744 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1746 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1748 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1750 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1752 /* you can free the returned string */
1753 char *WMGetFilePanelFileName(WMFilePanel *panel);
1755 void WMFreeFilePanel(WMFilePanel *panel);
1757 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1758 char *path, char *name, char **fileTypes);
1760 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1762 WMView *WMGetFilePanelAccessoryView(WMFilePanel *panel);
1765 /* ...................................................................... */
1767 /* only 1 instance per WMScreen */
1768 WMFontPanel *WMGetFontPanel(WMScreen *scr);
1770 void WMShowFontPanel(WMFontPanel *panel);
1772 void WMHideFontPanel(WMFontPanel *panel);
1774 void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
1776 /* you can free the returned string */
1777 char *WMGetFontPanelFontName(WMFontPanel *panel);
1779 WMFont *WMGetFontPanelFont(WMFontPanel *panel);
1781 #ifdef __cplusplus
1783 #endif /* __cplusplus */
1785 #endif