- Now when Window Maker calls wmsetbg to set the background, it will pass the
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blobb8a512aeadf9f9e5a43a56bb27873a53c617529e
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;
39 #define wmksize(width, height) (WMSize){(width), (height)}
40 #define wmkpoint(x, y) (WMPoint){(x), (y)}
41 #define wmkrect(pos, size) (WMRect){(pos), (size)}
46 #define ClientMessageMask (1L<<30)
49 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
50 #define _DEFINED_GNUSTEP_WINDOW_INFO
52 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
53 * NSDesktopWindowLevel intended to be the level at which things
54 * on the desktop sit ... so you should be able
55 * to put a desktop background just below it.
57 * Applications are actually permitted to use any value in the
58 * range INT_MIN+1 to INT_MAX
60 enum {
61 WMDesktopWindowLevel = -1000, /* GNUstep addition */
62 WMNormalWindowLevel = 0,
63 WMFloatingWindowLevel = 3,
64 WMSubmenuWindowLevel = 3,
65 WMTornOffMenuWindowLevel = 3,
66 WMMainMenuWindowLevel = 20,
67 WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */
68 WMStatusWindowLevel = 21,
69 WMModalPanelWindowLevel = 100,
70 WMPopUpMenuWindowLevel = 101,
71 WMScreenSaverWindowLevel = 1000
75 /* window attributes */
76 enum {
77 WMBorderlessWindowMask = 0,
78 WMTitledWindowMask = 1,
79 WMClosableWindowMask = 2,
80 WMMiniaturizableWindowMask = 4,
81 WMResizableWindowMask = 8,
82 WMIconWindowMask = 64,
83 WMMiniWindowMask = 128
85 #endif
88 /* button types */
89 typedef enum {
90 /* 0 is reserved for internal use */
91 WBTMomentaryPush = 1,
92 WBTPushOnPushOff = 2,
93 WBTToggle = 3,
94 WBTSwitch = 4,
95 WBTRadio = 5,
96 WBTMomentaryChange = 6,
97 WBTOnOff = 7,
98 WBTMomentaryLight = 8
99 } WMButtonType;
101 /* button behaviour masks */
102 enum {
103 WBBSpringLoadedMask = (1 << 0),
104 WBBPushInMask = (1 << 1),
105 WBBPushChangeMask = (1 << 2),
106 WBBPushLightMask = (1 << 3),
107 WBBStateLightMask = (1 << 5),
108 WBBStateChangeMask = (1 << 6),
109 WBBStatePushMask = (1 << 7)
113 /* frame title positions */
114 typedef enum {
115 WTPNoTitle,
116 WTPAboveTop,
117 WTPAtTop,
118 WTPBelowTop,
119 WTPAboveBottom,
120 WTPAtBottom,
121 WTPBelowBottom
122 } WMTitlePosition;
125 /* relief types */
126 typedef enum {
127 WRFlat,
128 WRSimple,
129 WRRaised,
130 WRSunken,
131 WRGroove,
132 WRRidge,
133 WRPushed
134 } WMReliefType;
137 /* alignment types */
138 typedef enum {
139 WALeft,
140 WACenter,
141 WARight,
142 WAJustified /* not valid for textfields */
143 } WMAlignment;
146 /* image position */
147 typedef enum {
148 WIPNoImage,
149 WIPImageOnly,
150 WIPLeft,
151 WIPRight,
152 WIPBelow,
153 WIPAbove,
154 WIPOverlaps
155 } WMImagePosition;
158 /* scroller arrow position */
159 typedef enum {
160 WSAMaxEnd,
161 WSAMinEnd,
162 WSANone
163 } WMScrollArrowPosition;
165 /* scroller parts */
166 typedef enum {
167 WSNoPart,
168 WSDecrementPage,
169 WSIncrementPage,
170 WSDecrementLine,
171 WSIncrementLine,
172 WSDecrementWheel,
173 WSIncrementWheel,
174 WSKnob,
175 WSKnobSlot
176 } WMScrollerPart;
178 /* usable scroller parts */
179 typedef enum {
180 WSUNoParts,
181 WSUOnlyArrows,
182 WSUAllParts
183 } WMUsableScrollerParts;
185 /* matrix types */
186 typedef enum {
187 WMRadioMode,
188 WMHighlightMode,
189 WMListMode,
190 WMTrackMode
191 } WMMatrixTypes;
194 typedef enum {
195 WTTopTabsBevelBorder,
196 WTNoTabsBevelBorder,
197 WTNoTabsLineBorder,
198 WTNoTabsNoBorder
199 } WMTabViewType;
202 /* text movement types */
203 enum {
204 WMIllegalTextMovement,
205 WMReturnTextMovement,
206 WMEscapeTextMovement,
207 WMTabTextMovement,
208 WMBacktabTextMovement,
209 WMLeftTextMovement,
210 WMRightTextMovement,
211 WMUpTextMovement,
212 WMDownTextMovement
215 /* text field special events */
216 enum {
217 WMInsertTextEvent,
218 WMDeleteTextEvent
222 enum {
223 WLNotFound = -1 /* element was not found in WMList */
227 /* drag operations */
228 typedef enum {
229 WDOperationNone,
230 WDOperationCopy,
231 WDOperationMove,
232 WDOperationLink,
233 WDOperationAsk,
234 WDOperationPrivate
235 } WMDragOperationType;
238 typedef enum {
239 WMGrayModeColorPanel = 1,
240 WMRGBModeColorPanel = 2,
241 WMCMYKModeColorPanel = 3,
242 WMHSBModeColorPanel = 4,
243 WMCustomPaletteModeColorPanel = 5,
244 WMColorListModeColorPanel = 6,
245 WMWheelModeColorPanel = 7
246 } WMColorPanelMode;
250 /* system images */
251 #define WSIReturnArrow 1
252 #define WSIHighlightedReturnArrow 2
253 #define WSIScrollerDimple 3
254 #define WSIArrowLeft 4
255 #define WSIHighlightedArrowLeft 5
256 #define WSIArrowRight 6
257 #define WSIHighlightedArrowRight 7
258 #define WSIArrowUp 8
259 #define WSIHighlightedArrowUp 9
260 #define WSIArrowDown 10
261 #define WSIHighlightedArrowDown 11
262 #define WSICheckMark 12
264 enum {
265 WLDSSelected = (1 << 16),
266 WLDSDisabled = (1 << 17),
267 WLDSFocused = (1 << 18),
268 WLDSIsBranch = (1 << 19)
271 /* alert panel return values */
272 enum {
273 WAPRDefault = 0,
274 WAPRAlternate = 1,
275 WAPROther = -1,
276 WAPRError = -2
281 /* types of input observers */
282 enum {
283 WIReadMask = (1 << 0),
284 WIWriteMask = (1 << 1),
285 WIExceptMask = (1 << 2)
290 typedef int W_Class;
292 enum {
293 WC_Window = 0,
294 WC_Frame = 1,
295 WC_Label = 2,
296 WC_Button = 3,
297 WC_TextField = 4,
298 WC_Scroller = 5,
299 WC_ScrollView = 6,
300 WC_List = 7,
301 WC_Browser = 8,
302 WC_PopUpButton = 9,
303 WC_ColorWell = 10,
304 WC_Slider = 11,
305 WC_Matrix = 12, /* not ready */
306 WC_SplitView = 13,
307 WC_TabView = 14,
308 WC_ProgressIndicator = 15,
309 WC_MenuView = 16,
310 WC_Ruler = 17,
311 WC_Text = 18,
312 WC_Box = 19
315 /* All widgets must start with the following structure
316 * in that order. Used for typecasting to get some generic data */
317 typedef struct W_WidgetType {
318 W_Class widgetClass;
319 struct W_View *view;
321 } W_WidgetType;
324 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
325 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
328 /* widgets */
330 typedef void WMWidget;
332 typedef struct W_Pixmap WMPixmap;
333 typedef struct W_Font WMFont;
334 typedef struct W_Color WMColor;
336 typedef struct W_Screen WMScreen;
338 typedef struct W_View WMView;
340 typedef struct W_Window WMWindow;
341 typedef struct W_Frame WMFrame;
342 typedef struct W_Button WMButton;
343 typedef struct W_Label WMLabel;
344 typedef struct W_TextField WMTextField;
345 typedef struct W_Scroller WMScroller;
346 typedef struct W_ScrollView WMScrollView;
347 typedef struct W_List WMList;
348 typedef struct W_Browser WMBrowser;
349 typedef struct W_PopUpButton WMPopUpButton;
350 typedef struct W_ProgressIndicator WMProgressIndicator;
351 typedef struct W_ColorWell WMColorWell;
352 typedef struct W_Slider WMSlider;
353 typedef struct W_Matrix WMMatrix; /* not ready */
354 typedef struct W_SplitView WMSplitView;
355 typedef struct W_TabView WMTabView;
356 typedef struct W_Ruler WMRuler;
357 typedef struct W_Text WMText;
358 typedef struct W_Box WMBox;
361 /* not widgets */
362 typedef struct W_TabViewItem WMTabViewItem;
363 typedef struct W_MenuItem WMMenuItem;
366 typedef struct W_FilePanel WMFilePanel;
367 typedef WMFilePanel WMOpenPanel;
368 typedef WMFilePanel WMSavePanel;
370 typedef struct W_FontPanel WMFontPanel;
372 typedef struct W_ColorPanel WMColorPanel;
375 /* item for WMList */
376 typedef struct WMListItem {
377 char *text;
378 void *clientData; /* ptr for user clientdata. */
380 unsigned int uflags:16; /* flags for the user */
381 unsigned int selected:1;
382 unsigned int disabled:1;
383 unsigned int isBranch:1;
384 unsigned int loaded:1;
385 } WMListItem;
387 /* struct for message panel */
388 typedef struct WMAlertPanel {
389 WMWindow *win; /* window */
390 WMBox *vbox;
391 WMButton *defBtn; /* default button */
392 WMButton *altBtn; /* alternative button */
393 WMButton *othBtn; /* other button */
394 WMLabel *iLbl; /* icon label */
395 WMLabel *tLbl; /* title label */
396 WMLabel *mLbl; /* message label */
397 WMFrame *line; /* separator */
398 short result; /* button that was pushed */
399 } WMAlertPanel;
402 typedef struct WMGenericPanel {
403 WMWindow *win;
404 WMBox *vbox;
406 WMLabel *iLbl;
407 WMLabel *tLbl;
409 WMFrame *line;
411 WMFrame *content;
413 WMBox *buttonBox;
414 WMButton *defBtn;
415 WMButton *altBtn;
417 short result;
418 } WMGenericPanel;
423 typedef struct WMInputPanel {
424 WMWindow *win; /* window */
425 WMButton *defBtn; /* default button */
426 WMButton *altBtn; /* alternative button */
427 WMLabel *tLbl; /* title label */
428 WMLabel *mLbl; /* message label */
429 WMTextField *text; /* text field */
430 short result; /* button that was pushed */
431 } WMInputPanel;
434 /* WMRuler: */
435 typedef struct {
436 WMArray *tabs; /* a growable array of tabstops */
437 unsigned short left; /* left margin marker */
438 unsigned short right; /* right margin marker */
439 unsigned short first; /* indentation marker for first line only */
440 unsigned short body; /* body indentation marker */
441 unsigned short retainCount;
442 } WMRulerMargins;
443 /* All indentation and tab markers are _relative_ to the left margin marker */
446 typedef void WMEventProc(XEvent *event, void *clientData);
448 typedef void WMEventHook(XEvent *event);
450 /* self is set to the widget from where the callback is being called and
451 * clientData to the data set to with WMSetClientData() */
452 typedef void WMAction(WMWidget *self, void *clientData);
454 /* same as WMAction, but for stuff that arent widgets */
455 typedef void WMAction2(void *self, void *clientData);
458 typedef void WMDropDataCallback(WMView *view, WMData *data);
460 /* delegate method like stuff */
461 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
462 int state, WMRect *rect);
465 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
466 unsigned int oldWidth,
467 unsigned int oldHeight);
470 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
471 int *minSize, int *maxSize);
473 typedef WMWidget *WMMatrixCreateCellProc(WMMatrix *mPtr);
478 typedef struct WMBrowserDelegate {
479 void *data;
481 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
482 WMBrowser *sender, int column, WMList *list);
484 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
485 int column);
487 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
489 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
490 } WMBrowserDelegate;
493 typedef struct WMTextFieldDelegate {
494 void *data;
496 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
497 WMNotification *notif);
499 void (*didChange)(struct WMTextFieldDelegate *self,
500 WMNotification *notif);
502 void (*didEndEditing)(struct WMTextFieldDelegate *self,
503 WMNotification *notif);
505 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
506 WMTextField *tPtr);
508 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
509 WMTextField *tPtr);
510 } WMTextFieldDelegate;
513 typedef struct WMTextDelegate {
514 void *data;
516 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
517 void *description);
519 } WMTextDelegate;
523 typedef struct WMTabViewDelegate {
524 void *data;
526 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
527 WMTabView *tabView);
529 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
530 WMTabViewItem *item);
532 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
533 WMTabViewItem *item);
535 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
536 WMTabViewItem *item);
537 } WMTabViewDelegate;
542 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
543 Time timestamp, void *cdata, WMData *data);
546 typedef struct WMSelectionProcs {
547 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
548 void *cdata, Atom *type);
549 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
550 void (*selectionDone)(WMView *view, Atom selection, Atom target,
551 void *cdata);
552 } WMSelectionProcs;
555 typedef struct W_DraggingInfo WMDraggingInfo;
558 typedef struct W_DragSourceProcs {
559 unsigned (*draggingSourceOperation)(WMView *self, Bool local);
560 void (*beganDragImage)(WMView *self, WMPixmap *image, WMPoint point);
561 void (*endedDragImage)(WMView *self, WMPixmap *image, WMPoint point,
562 Bool deposited);
563 WMData* (*fetchDragData)(WMView *self, char *type);
564 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
565 } WMDragSourceProcs;
569 typedef struct W_DragDestinationProcs {
570 unsigned (*draggingEntered)(WMView *self, WMDraggingInfo *info);
571 unsigned (*draggingUpdated)(WMView *self, WMDraggingInfo *info);
572 void (*draggingExited)(WMView *self, WMDraggingInfo *info);
573 Bool (*prepareForDragOperation)(WMView *self, WMDraggingInfo *info);
574 Bool (*performDragOperation)(WMView *self, WMDraggingInfo *info);
575 void (*concludeDragOperation)(WMView *self, WMDraggingInfo *info);
576 } WMDragDestinationProcs;
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(const char *display);
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);
648 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
649 WMSelectionProcs *procs, void *cdata);
651 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
653 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
654 Time timestamp, WMSelectionCallback *callback,
655 void *cdata);
658 /* ....................................................................... */
660 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
662 void WMDragImageFromView(WMView *view, WMPixmap *image, char *dataTypes[],
663 WMPoint atLocation, WMSize mouseOffset, XEvent *event,
664 Bool slideBack);
666 void WMRegisterViewForDraggedTypes(WMView *view, char *acceptedTypes[]);
668 void WMUnregisterViewDraggedTypes(WMView *view);
670 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
673 WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info);
675 /* ....................................................................... */
677 WMFont *WMCreateFontSet(WMScreen *scrPtr, char *fontName);
679 WMFont *WMCreateNormalFont(WMScreen *scrPtr, char *fontName);
681 WMFont *WMCreateFont(WMScreen *scrPtr, char *fontName);
683 WMFont *WMRetainFont(WMFont *font);
685 void WMReleaseFont(WMFont *font);
687 unsigned int WMFontHeight(WMFont *font);
690 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
692 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
696 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
698 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
700 WMFont *WMSystemFontOfSize(WMScreen *scrPtr, int size);
702 WMFont *WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
704 XFontSet WMGetFontFontSet(WMFont *font);
706 WMFont *WMNormalizeFont(WMScreen *scr, WMFont *font);
708 WMFont *WMStrengthenFont(WMScreen *scr, WMFont *font);
710 WMFont *WMUnstrengthenFont(WMScreen *scr, WMFont *font);
712 WMFont *WMEmphasizeFont(WMScreen *scr, WMFont *font);
714 WMFont *WMUnemphasizeFont(WMScreen *scr, WMFont *font);
716 WMFont *WMGetFontOfSize(WMScreen *scr, WMFont *font, int size);
718 /* ....................................................................... */
720 WMPixmap *WMRetainPixmap(WMPixmap *pixmap);
722 void WMReleasePixmap(WMPixmap *pixmap);
724 WMPixmap *WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
725 Bool masked);
727 WMPixmap *WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
728 Pixmap mask, int width, int height,
729 int depth);
731 WMPixmap *WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
732 int threshold);
734 WMPixmap *WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
736 WMSize WMGetPixmapSize(WMPixmap *pixmap);
738 WMPixmap *WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
740 WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
741 RColor *color);
743 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
745 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
747 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
749 WMPixmap *WMGetSystemPixmap(WMScreen *scr, int image);
751 /* ....................................................................... */
754 WMColor *WMDarkGrayColor(WMScreen *scr);
756 WMColor *WMGrayColor(WMScreen *scr);
758 WMColor *WMBlackColor(WMScreen *scr);
760 WMColor *WMWhiteColor(WMScreen *scr);
762 void WMSetColorInGC(WMColor *color, GC gc);
764 GC WMColorGC(WMColor *color);
766 WMPixel WMColorPixel(WMColor *color);
768 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
769 unsigned int width, unsigned int height);
771 void WMReleaseColor(WMColor *color);
773 WMColor *WMRetainColor(WMColor *color);
775 WMColor *WMCreateRGBColor(WMScreen *scr, unsigned short red,
776 unsigned short green, unsigned short blue,
777 Bool exact);
779 WMColor *WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
781 unsigned short WMRedComponentOfColor(WMColor *color);
783 unsigned short WMGreenComponentOfColor(WMColor *color);
785 unsigned short WMBlueComponentOfColor(WMColor *color);
787 char *WMGetColorRGBDescription(WMColor *color);
789 /* ....................................................................... */
792 void WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
793 int y, char *text, int length);
795 void WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
796 int y, char *text, int length);
798 int WMWidthOfString(WMFont *font, char *text, int length);
802 /* ....................................................................... */
804 WMScreen *WMWidgetScreen(WMWidget *w);
806 unsigned int WMScreenWidth(WMScreen *scr);
808 unsigned int WMScreenHeight(WMScreen *scr);
810 void WMUnmapWidget(WMWidget *w);
812 void WMMapWidget(WMWidget *w);
814 Bool WMWidgetIsMapped(WMWidget *w);
816 void WMRaiseWidget(WMWidget *w);
818 void WMLowerWidget(WMWidget *w);
820 void WMMoveWidget(WMWidget *w, int x, int y);
822 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
824 void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
826 void WMMapSubwidgets(WMWidget *w);
828 void WMUnmapSubwidgets(WMWidget *w);
830 void WMRealizeWidget(WMWidget *w);
832 void WMDestroyWidget(WMWidget *widget);
834 void WMHangData(WMWidget *widget, void *data);
836 void *WMGetHangedData(WMWidget *widget);
838 unsigned int WMWidgetWidth(WMWidget *w);
840 unsigned int WMWidgetHeight(WMWidget *w);
842 Window WMWidgetXID(WMWidget *w);
844 Window WMViewXID(WMView *view);
846 void WMRedisplayWidget(WMWidget *w);
848 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
850 void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
851 int rightOffs, int bottomOffs);
853 WMSize WMGetViewSize(WMView *view);
855 WMPoint WMGetViewPosition(WMView *view);
857 WMPoint WMGetViewScreenPosition(WMView *view);
859 WMWidget *WMWidgetOfView(WMView *view);
861 void WMSetViewNextResponder(WMView *view, WMView *responder);
863 void WMRelayToNextResponder(WMView *view, XEvent *event);
865 /* notifications */
866 extern char *WMViewSizeDidChangeNotification;
868 extern char *WMViewRealizedNotification;
870 extern char *WMFontPanelDidChangeNotification;
873 /* ....................................................................... */
875 void WMSetBalloonTextForView(char *text, WMView *view);
877 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
879 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
881 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
883 void WMSetBalloonDelay(WMScreen *scr, int delay);
885 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
888 /* ....................................................................... */
890 WMWindow *WMCreateWindow(WMScreen *screen, char *name);
892 WMWindow *WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
894 WMWindow *WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
895 int style);
897 WMWindow *WMCreatePanelForWindow(WMWindow *owner, char *name);
899 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
901 void WMSetWindowTitle(WMWindow *wPtr, char *title);
903 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
905 void WMSetWindowMiniwindowImage(WMWindow *win, WMPixmap *pixmap);
907 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
909 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
911 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
913 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
914 int maxX, int maxY);
916 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
918 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
920 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
922 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
924 void WMSetWindowLevel(WMWindow *win, int level);
926 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
928 void WMCloseWindow(WMWindow *win);
930 /* ....................................................................... */
932 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
934 #define WMCreateCommandButton(parent) \
935 WMCreateCustomButton((parent), WBBSpringLoadedMask\
936 |WBBPushInMask\
937 |WBBPushLightMask\
938 |WBBPushChangeMask)
940 #define WMCreateRadioButton(parent) \
941 WMCreateButton((parent), WBTRadio)
943 #define WMCreateSwitchButton(parent) \
944 WMCreateButton((parent), WBTSwitch)
946 WMButton *WMCreateButton(WMWidget *parent, WMButtonType type);
948 WMButton *WMCreateCustomButton(WMWidget *parent, int behaviourMask);
950 void WMSetButtonImageDefault(WMButton *bPtr);
952 void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
954 void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
956 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
958 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
960 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
962 void WMSetButtonText(WMButton *bPtr, char *text);
964 void WMSetButtonAltText(WMButton *bPtr, char *text);
966 void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
968 void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
970 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
972 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
974 int WMGetButtonSelected(WMButton *bPtr);
976 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
978 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
980 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
982 void WMSetButtonTag(WMButton *bPtr, int tag);
984 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
986 void WMPerformButtonClick(WMButton *bPtr);
988 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
990 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
992 /* ....................................................................... */
994 WMLabel *WMCreateLabel(WMWidget *parent);
996 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
998 void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
1000 WMPixmap *WMGetLabelImage(WMLabel *lPtr);
1002 char *WMGetLabelText(WMLabel *lPtr);
1004 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1006 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1008 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1010 void WMSetLabelText(WMLabel *lPtr, char *text);
1012 WMFont* WMGetLabelFont(WMLabel *lPtr);
1014 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1016 void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
1018 /* ....................................................................... */
1020 WMFrame *WMCreateFrame(WMWidget *parent);
1022 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1024 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1026 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1028 /* ....................................................................... */
1030 WMTextField *WMCreateTextField(WMWidget *parent);
1032 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1034 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1036 /* you can free the returned string */
1037 char *WMGetTextFieldText(WMTextField *tPtr);
1039 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1041 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1043 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1045 WMFont *WMGetTextFieldFont(WMTextField *tPtr);
1047 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1049 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1051 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1053 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1055 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1057 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1059 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1061 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1063 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1065 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1068 extern char *WMTextDidChangeNotification;
1069 extern char *WMTextDidBeginEditingNotification;
1070 extern char *WMTextDidEndEditingNotification;
1072 /* ....................................................................... */
1074 WMScroller *WMCreateScroller(WMWidget *parent);
1076 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1077 float knobProportion);
1079 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1081 float WMGetScrollerValue(WMScroller *sPtr);
1083 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1085 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1087 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1088 WMScrollArrowPosition position);
1090 extern char *WMScrollerDidScrollNotification;
1092 /* ....................................................................... */
1094 WMList *WMCreateList(WMWidget *parent);
1096 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1098 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1100 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1102 WMListItem *WMInsertListItem(WMList *lPtr, int row, char *text);
1104 void WMSortListItems(WMList *lPtr);
1106 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1108 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1110 WMListItem *WMGetListItem(WMList *lPtr, int row);
1112 WMArray *WMGetListItems(WMList *lPtr);
1114 void WMRemoveListItem(WMList *lPtr, int row);
1116 void WMSelectListItem(WMList *lPtr, int row);
1118 void WMUnselectListItem(WMList *lPtr, int row);
1120 /* This will select all items in range, and deselect all the others */
1121 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1123 /* This will select all items in range, leaving the others as they are */
1124 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1126 void WMSelectAllListItems(WMList *lPtr);
1128 void WMUnselectAllListItems(WMList *lPtr);
1130 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1132 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1134 int WMGetListItemHeight(WMList *lPtr);
1136 /* don't free the returned data */
1137 WMArray* WMGetListSelectedItems(WMList *lPtr);
1140 * For the following 2 functions, in case WMList allows multiple selection,
1141 * the first item in the list of selected items, respective its row number,
1142 * will be returned.
1145 /* don't free the returned data */
1146 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1148 int WMGetListSelectedItemRow(WMList *lPtr);
1150 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1152 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1154 void WMClearList(WMList *lPtr);
1156 int WMGetListNumberOfRows(WMList *lPtr);
1158 void WMSetListPosition(WMList *lPtr, int row);
1160 void WMSetListBottomPosition(WMList *lPtr, int row);
1162 int WMGetListPosition(WMList *lPtr);
1164 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1166 Bool WMListAllowsEmptySelection(WMList *lPtr);
1169 extern char *WMListDidScrollNotification;
1170 extern char *WMListSelectionDidChangeNotification;
1172 /* ....................................................................... */
1174 WMBrowser *WMCreateBrowser(WMWidget *parent);
1176 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1178 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1180 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1182 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1184 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1186 int WMAddBrowserColumn(WMBrowser *bPtr);
1188 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1190 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1192 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1194 WMListItem *WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1196 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1198 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1199 WMCompareDataProc *func);
1201 /* Don't free the returned string. */
1202 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1204 /* free the returned string */
1205 char *WMGetBrowserPath(WMBrowser *bPtr);
1207 /* free the returned string */
1208 char *WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1210 /* free the returned array */
1211 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1213 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1215 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1216 void *clientData);
1218 WMListItem *WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1220 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1222 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1224 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1226 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1228 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1230 WMList *WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1232 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1234 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1236 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1238 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1240 /* ....................................................................... */
1243 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1245 WMMenuItem *WMCreateMenuItem(void);
1247 void WMDestroyMenuItem(WMMenuItem *item);
1249 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1251 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1253 char *WMGetMenuItemShortcut(WMMenuItem *item);
1255 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1257 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1259 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1261 void *WMGetMenuItemRepresentedObject(WMMenuItem *item);
1263 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1265 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1267 WMAction *WMGetMenuItemAction(WMMenuItem *item);
1269 void *WMGetMenuItemData(WMMenuItem *item);
1271 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1273 char *WMGetMenuItemTitle(WMMenuItem *item);
1275 void WMSetMenuItemState(WMMenuItem *item, int state);
1277 int WMGetMenuItemState(WMMenuItem *item);
1279 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1281 WMPixmap *WMGetMenuItemPixmap(WMMenuItem *item);
1283 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1285 WMPixmap *WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1287 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1289 WMPixmap *WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1291 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1293 WMPixmap *WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1295 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1298 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1300 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1303 /* ....................................................................... */
1305 WMPopUpButton *WMCreatePopUpButton(WMWidget *parent);
1307 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1308 void *clientData);
1310 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1312 WMMenuItem *WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1314 WMMenuItem *WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1315 char *title);
1317 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1319 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1321 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1323 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1325 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1327 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1329 /* don't free the returned data */
1330 char *WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1332 WMMenuItem *WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1335 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1337 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1339 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1341 /* ....................................................................... */
1343 WMProgressIndicator *WMCreateProgressIndicator(WMWidget *parent);
1345 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1347 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1349 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1351 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1353 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1355 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1358 /* ....................................................................... */
1360 WMColorPanel *WMGetColorPanel(WMScreen *scrPtr);
1362 void WMFreeColorPanel(WMColorPanel *panel);
1364 void WMShowColorPanel(WMColorPanel *panel);
1366 void WMCloseColorPanel(WMColorPanel *panel);
1368 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1370 WMColor *WMGetColorPanelColor(WMColorPanel *panel);
1372 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1374 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1376 extern char *WMColorPanelColorChangedNotification;
1378 /* ....................................................................... */
1380 WMColorWell *WMCreateColorWell(WMWidget *parent);
1382 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1384 WMColor *WMGetColorWellColor(WMColorWell *cPtr);
1386 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1389 extern char *WMColorWellDidChangeNotification;
1392 /* ...................................................................... */
1394 WMScrollView *WMCreateScrollView(WMWidget *parent);
1396 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1397 unsigned int height);
1399 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1401 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1403 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1405 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1407 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1409 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1411 WMScroller *WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1413 WMScroller *WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1415 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1417 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1419 /* ....................................................................... */
1421 WMSlider *WMCreateSlider(WMWidget *parent);
1423 int WMGetSliderMinValue(WMSlider *slider);
1425 int WMGetSliderMaxValue(WMSlider *slider);
1427 int WMGetSliderValue(WMSlider *slider);
1429 void WMSetSliderMinValue(WMSlider *slider, int value);
1431 void WMSetSliderMaxValue(WMSlider *slider, int value);
1433 void WMSetSliderValue(WMSlider *slider, int value);
1435 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1437 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1439 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1441 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1443 /* ....................................................................... */
1446 WMSplitView *WMCreateSplitView(WMWidget *parent);
1447 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1448 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1450 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1452 WMView *WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1454 /* remove the first subview == view */
1455 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1457 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1460 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1462 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1464 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1465 WMSplitViewConstrainProc *proc);
1468 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1469 WMSplitViewResizeSubviewsProc *proc);
1472 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1474 /* ...................................................................... */
1476 WMRuler *WMCreateRuler (WMWidget *parent);
1478 WMRulerMargins *WMGetRulerMargins(WMRuler *rPtr);
1480 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1482 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin,
1483 WMRulerMargins *anotherMargin);
1485 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1487 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1489 int WMGetRulerOffset(WMRuler *rPtr);
1491 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1493 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1495 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1497 /* ....................................................................... */
1500 #define WMCreateText(parent) WMCreateTextForDocumentType \
1501 ((parent), (NULL), (NULL))
1503 WMText *WMCreateTextForDocumentType(WMWidget *parent,
1504 WMAction *parser, WMAction *writer);
1506 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1508 void WMFreezeText(WMText *tPtr);
1510 #define WMRefreshText(tPtr) WMThawText((tPtr))
1512 void WMThawText(WMText *tPtr);
1514 int WMScrollText(WMText *tPtr, int amount);
1516 int WMPageText(WMText *tPtr, Bool direction);
1518 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1520 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1522 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1524 void WMShowTextRuler(WMText *tPtr, Bool show);
1526 int WMGetTextRulerShown(WMText *tPtr);
1528 void WMSetTextEditable(WMText *tPtr, Bool editable);
1530 int WMGetTextEditable(WMText *tPtr);
1532 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1534 int WMGetTextUsesMonoFont(WMText *tPtr);
1536 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1538 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1540 int WMGetTextIgnoresNewline(WMText *tPtr);
1542 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1544 WMFont * WMGetTextDefaultFont(WMText *tPtr);
1546 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1548 WMColor * WMGetTextDefaultColor(WMText *tPtr);
1550 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1552 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1554 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1556 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1558 void WMPrependTextStream(WMText *tPtr, char *text);
1560 void WMAppendTextStream(WMText *tPtr, char *text);
1562 #define WMClearText(tPtr) WMAppendTextStream \
1563 ((tPtr), (NULL))
1565 /* free the text */
1566 char * WMGetTextStream(WMText *tPtr);
1568 /* free the text */
1569 char * WMGetTextSelectedStream(WMText *tPtr);
1571 /* destroy the array */
1572 WMArray * WMGetTextObjects(WMText *tPtr);
1574 /* destroy the array */
1575 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1577 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1579 WMColor *WMGetTextSelectionColor(WMText *tPtr);
1581 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1583 WMFont *WMGetTextSelectionFont(WMText *tPtr);
1585 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1587 int WMGetTextSelectionUnderlined(WMText *tPtr);
1589 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1591 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1592 Bool caseSensitive);
1594 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1597 /* parser related stuff... use only if implementing a new parser */
1599 void *WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1600 WMColor *color, unsigned short first, unsigned short extraInfo);
1602 void *WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1603 WMColor *color, unsigned short first, unsigned short extraInfo);
1605 void *WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1606 WMColor *color, unsigned short first, unsigned short length);
1608 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1609 unsigned int kanji, unsigned int underlined, int script,
1610 WMRulerMargins *margins);
1612 /* do NOT free the margins */
1613 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1614 unsigned int *kanji, unsigned int *underlined, int *script,
1615 WMRulerMargins *margins);
1617 int WMGetTextInsertType(WMText *tPtr);
1619 int WMGetTextBlocks(WMText *tPtr);
1621 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1623 int WMGetCurrentTextBlock(WMText *tPtr);
1625 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1627 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1629 void *WMRemoveTextBlock(WMText *tPtr);
1631 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1633 /* ....................................................................... */
1636 WMTabView *WMCreateTabView(WMWidget *parent);
1638 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1640 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1642 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1644 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1646 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1648 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1650 WMTabViewItem *WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1651 int identifier, char *label);
1653 WMTabViewItem *WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1655 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1657 void WMSelectLastTabViewItem(WMTabView *tPtr);
1659 void WMSelectNextTabViewItem(WMTabView *tPtr);
1661 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1663 WMTabViewItem *WMGetSelectedTabViewItem(WMTabView *tPtr);
1665 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1667 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1669 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1672 WMTabViewItem *WMCreateTabViewItemWithIdentifier(int identifier);
1674 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1676 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1678 char *WMGetTabViewItemLabel(WMTabViewItem *item);
1680 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1682 WMView *WMGetTabViewItemView(WMTabViewItem *item);
1684 void WMDestroyTabViewItem(WMTabViewItem *item);
1687 /* ....................................................................... */
1689 WMBox *WMCreateBox(WMWidget *parent);
1691 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1693 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1694 int minSize, int maxSize, int space);
1696 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1697 int minSize, int maxSize, int space);
1699 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1701 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1703 /* ....................................................................... */
1705 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1706 char *defaultButton, char *alternateButton,
1707 char *otherButton);
1709 /* you can free the returned string */
1710 char *WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1711 char *defaultText, char *okButton, char *cancelButton);
1713 WMAlertPanel *WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1714 char *msg, char *defaultButton,
1715 char *alternateButton, char *otherButton);
1717 WMInputPanel *WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1718 char *msg, char *defaultText, char *okButton,
1719 char *cancelButton);
1722 WMGenericPanel *WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
1723 char *title, char *defaultButton,
1724 char *alternateButton);
1726 void WMDestroyAlertPanel(WMAlertPanel *panel);
1728 void WMDestroyInputPanel(WMInputPanel *panel);
1730 void WMDestroyGenericPanel(WMGenericPanel *panel);
1732 /* ....................................................................... */
1734 /* only 1 instance per WMScreen */
1735 WMOpenPanel *WMGetOpenPanel(WMScreen *scrPtr);
1737 WMSavePanel *WMGetSavePanel(WMScreen *scrPtr);
1739 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1741 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1743 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1745 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1747 /* you can free the returned string */
1748 char *WMGetFilePanelFileName(WMFilePanel *panel);
1750 void WMFreeFilePanel(WMFilePanel *panel);
1752 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1753 char *path, char *name, char **fileTypes);
1755 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1757 WMView *WMGetFilePanelAccessoryView(WMFilePanel *panel);
1760 /* ...................................................................... */
1762 /* only 1 instance per WMScreen */
1763 WMFontPanel *WMGetFontPanel(WMScreen *scr);
1765 void WMShowFontPanel(WMFontPanel *panel);
1767 void WMHideFontPanel(WMFontPanel *panel);
1769 void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
1771 /* you can free the returned string */
1772 char *WMGetFontPanelFontName(WMFontPanel *panel);
1774 WMFont *WMGetFontPanelFont(WMFontPanel *panel);
1776 #ifdef __cplusplus
1778 #endif /* __cplusplus */
1780 #endif