WINGs buttons and labels now have text
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blob43e4b7a9434294035c7f4d8fee1c71ed593f36a6
3 #ifndef _WINGS_H_
4 #define _WINGS_H_
6 #include <WINGs/WUtil.h>
7 #include <X11/Xlib.h>
8 #include <cairo.h>
10 #define WINGS_H_VERSION 20041030
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;
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 = 0,
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 typedef struct {
325 unsigned char red;
326 unsigned char green;
327 unsigned char blue;
328 unsigned char alpha;
329 } WMColorSpec;
331 typedef cairo_surface_t WMImage;
333 /* widgets */
335 typedef void WMWidget;
337 typedef struct W_Pixmap WMPixmap;
338 typedef struct W_Font WMFont;
339 typedef struct W_Color WMColor;
341 typedef struct W_Screen WMScreen;
343 typedef struct W_View WMView;
345 typedef struct W_Window WMWindow;
346 typedef struct W_Frame WMFrame;
347 typedef struct W_Button WMButton;
348 typedef struct W_Label WMLabel;
349 typedef struct W_TextField WMTextField;
350 typedef struct W_Scroller WMScroller;
351 typedef struct W_ScrollView WMScrollView;
352 typedef struct W_List WMList;
353 typedef struct W_Browser WMBrowser;
354 typedef struct W_PopUpButton WMPopUpButton;
355 typedef struct W_ProgressIndicator WMProgressIndicator;
356 typedef struct W_ColorWell WMColorWell;
357 typedef struct W_Slider WMSlider;
358 typedef struct W_Matrix WMMatrix; /* not ready */
359 typedef struct W_SplitView WMSplitView;
360 typedef struct W_TabView WMTabView;
361 typedef struct W_Ruler WMRuler;
362 typedef struct W_Text WMText;
363 typedef struct W_Box WMBox;
366 /* not widgets */
367 typedef struct W_TabViewItem WMTabViewItem;
368 typedef struct W_MenuItem WMMenuItem;
371 typedef struct W_FilePanel WMFilePanel;
372 typedef WMFilePanel WMOpenPanel;
373 typedef WMFilePanel WMSavePanel;
375 typedef struct W_FontPanel WMFontPanel;
377 typedef struct W_ColorPanel WMColorPanel;
380 /* item for WMList */
381 typedef struct WMListItem {
382 char *text;
383 void *clientData; /* ptr for user clientdata. */
385 unsigned int uflags:16; /* flags for the user */
386 unsigned int selected:1;
387 unsigned int disabled:1;
388 unsigned int isBranch:1;
389 unsigned int loaded:1;
390 } WMListItem;
392 /* struct for message panel */
393 typedef struct WMAlertPanel {
394 WMWindow *win; /* window */
395 WMBox *vbox;
396 WMBox *hbox;
397 WMButton *defBtn; /* default button */
398 WMButton *altBtn; /* alternative button */
399 WMButton *othBtn; /* other button */
400 WMLabel *iLbl; /* icon label */
401 WMLabel *tLbl; /* title label */
402 WMLabel *mLbl; /* message label */
403 WMFrame *line; /* separator */
404 short result; /* button that was pushed */
405 } WMAlertPanel;
408 typedef struct WMGenericPanel {
409 WMWindow *win;
410 WMBox *vbox;
412 WMLabel *iLbl;
413 WMLabel *tLbl;
415 WMFrame *line;
417 WMFrame *content;
419 WMBox *buttonBox;
420 WMButton *defBtn;
421 WMButton *altBtn;
423 short result;
424 } WMGenericPanel;
427 typedef struct WMInputPanel {
428 WMWindow *win; /* window */
429 WMButton *defBtn; /* default button */
430 WMButton *altBtn; /* alternative button */
431 WMLabel *tLbl; /* title label */
432 WMLabel *mLbl; /* message label */
433 WMTextField *text; /* text field */
434 short result; /* button that was pushed */
435 } WMInputPanel;
438 /* Basic font styles. Used to easily get one style from another */
439 typedef enum WMFontStyle {
440 WFSNormal = 0,
441 WFSBold = 1,
442 WFSItalic = 2,
443 WFSBoldItalic = 3
444 } WMFontStyle;
447 /* WMRuler: */
448 typedef struct {
449 WMArray *tabs; /* a growable array of tabstops */
450 unsigned short left; /* left margin marker */
451 unsigned short right; /* right margin marker */
452 unsigned short first; /* indentation marker for first line only */
453 unsigned short body; /* body indentation marker */
454 unsigned short retainCount;
455 } WMRulerMargins;
456 /* All indentation and tab markers are _relative_ to the left margin marker */
459 typedef void WMEventProc(XEvent *event, void *clientData);
461 typedef void WMEventHook(XEvent *event);
463 /* self is set to the widget from where the callback is being called and
464 * clientData to the data set to with WMSetClientData() */
465 typedef void WMAction(WMWidget *self, void *clientData);
467 /* same as WMAction, but for stuff that arent widgets */
468 typedef void WMAction2(void *self, void *clientData);
471 /* delegate method like stuff */
472 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
473 int state, WMRect *rect);
477 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
478 unsigned int oldWidth,
479 unsigned int oldHeight);
482 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
483 int *minSize, int *maxSize);
485 typedef WMWidget* WMMatrixCreateCellProc(WMMatrix *mPtr);
490 typedef struct WMBrowserDelegate {
491 void *data;
493 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
494 WMBrowser *sender, int column, WMList *list);
496 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
497 int column);
499 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
501 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
502 } WMBrowserDelegate;
505 typedef struct WMTextFieldDelegate {
506 void *data;
508 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
509 WMNotification *notif);
511 void (*didChange)(struct WMTextFieldDelegate *self,
512 WMNotification *notif);
514 void (*didEndEditing)(struct WMTextFieldDelegate *self,
515 WMNotification *notif);
517 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
518 WMTextField *tPtr);
520 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
521 WMTextField *tPtr);
522 } WMTextFieldDelegate;
525 typedef struct WMTextDelegate {
526 void *data;
528 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
529 void *description);
531 } WMTextDelegate;
535 typedef struct WMTabViewDelegate {
536 void *data;
538 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
539 WMTabView *tabView);
541 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
542 WMTabViewItem *item);
544 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
545 WMTabViewItem *item);
547 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
548 WMTabViewItem *item);
549 } WMTabViewDelegate;
554 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
555 Time timestamp, void *cdata, WMData *data);
558 typedef struct WMSelectionProcs {
559 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
560 void *cdata, Atom *type);
561 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
562 void (*selectionDone)(WMView *view, Atom selection, Atom target,
563 void *cdata);
564 } WMSelectionProcs;
567 typedef struct W_DraggingInfo WMDraggingInfo;
570 /* links a label to a dnd operation. */
571 typedef struct W_DragOperationtItem WMDragOperationItem;
574 typedef struct W_DragSourceProcs {
575 WMArray* (*dropDataTypes)(WMView *self);
576 WMDragOperationType (*wantedDropOperation)(WMView *self);
577 WMArray* (*askedOperations)(WMView *self);
578 Bool (*acceptDropOperation)(WMView *self, WMDragOperationType operation);
579 void (*beganDrag)(WMView *self, WMPoint *point);
580 void (*endedDrag)(WMView *self, WMPoint *point, Bool deposited);
581 WMData* (*fetchDragData)(WMView *self, char *type);
582 /*Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
583 } WMDragSourceProcs;
587 typedef struct W_DragDestinationProcs {
588 void (*prepareForDragOperation)(WMView *self);
589 WMArray* (*requiredDataTypes)(WMView *self, WMDragOperationType request,
590 WMArray *sourceDataTypes);
591 WMDragOperationType (*allowedOperation)(WMView *self,
592 WMDragOperationType request,
593 WMArray *sourceDataTypes);
594 Bool (*inspectDropData)(WMView *self, WMArray *dropData);
595 void (*performDragOperation)(WMView *self, WMArray *dropData,
596 WMArray *operations, WMPoint *dropLocation);
597 void (*concludeDragOperation)(WMView *self);
598 } WMDragDestinationProcs;
601 /* ...................................................................... */
604 WMPoint wmkpoint(int x, int y);
606 WMSize wmksize(unsigned int width, unsigned int height);
608 WMRect wmkrect(int x, int y, unsigned int width, unsigned int height);
610 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
611 #define wmksize(width, height) (WMSize){(width), (height)}
612 #define wmkpoint(x, y) (WMPoint){(x), (y)}
613 #endif
615 /* ....................................................................... */
619 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
621 void WMSetResourcePath(char *path);
623 /* don't free the returned string */
624 char* WMGetApplicationName();
626 /* Try to locate resource file. ext may be NULL */
627 char* WMPathForResourceOfType(char *resource, char *ext);
630 WMScreen* WMOpenScreen(const char *display);
632 WMScreen* WMCreateScreen(Display *display, int screen);
634 WMScreen* WMCreateSimpleApplicationScreen(Display *display);
636 void WMScreenMainLoop(WMScreen *scr);
638 void WMBreakModalLoop(WMScreen *scr);
640 void WMRunModalLoop(WMScreen *scr, WMView *view);
642 Display* WMScreenDisplay(WMScreen *scr);
644 int WMScreenDepth(WMScreen *scr);
648 void WMSetApplicationIconImage(WMScreen *app, cairo_surface_t *image);
650 cairo_surface_t* WMGetApplicationIconImage(WMScreen *app);
652 void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
654 WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
656 /* If color==NULL it will use the default color for panels: ae/aa/ae */
657 WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, cairo_pattern_t *color);
659 void WMSetApplicationIconWindow(WMScreen *scr, Window window);
661 void WMSetFocusToWidget(WMWidget *widget);
663 WMEventHook* WMHookEventHandler(WMEventHook *handler);
665 int WMHandleEvent(XEvent *event);
667 Bool WMScreenPending(WMScreen *scr);
669 void WMCreateEventHandler(WMView *view, unsigned long mask,
670 WMEventProc *eventProc, void *clientData);
672 void WMDeleteEventHandler(WMView *view, unsigned long mask,
673 WMEventProc *eventProc, void *clientData);
675 int WMIsDoubleClick(XEvent *event);
677 /*int WMIsTripleClick(XEvent *event);*/
679 void WMNextEvent(Display *dpy, XEvent *event);
681 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
684 /* ....................................................................... */
687 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
688 WMSelectionProcs *procs, void *cdata);
690 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
692 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
693 Time timestamp, WMSelectionCallback *callback,
694 void *cdata);
697 extern char *WMSelectionOwnerDidChangeNotification;
699 /* ....................................................................... */
701 WMArray* WMCreateDragOperationArray(int initialSize);
703 WMDragOperationItem* WMCreateDragOperationItem(WMDragOperationType type,
704 char* text);
706 WMDragOperationType WMGetDragOperationItemType(WMDragOperationItem* item);
708 char* WMGetDragOperationItemText(WMDragOperationItem* item);
710 void WMSetViewDragImage(WMView* view, WMPixmap *dragImage);
712 void WMReleaseViewDragImage(WMView* view);
714 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
716 Bool WMIsDraggingFromView(WMView *view);
718 void WMDragImageFromView(WMView *view, XEvent *event);
720 /* Create a drag handler, associating drag event masks with dragEventProc */
721 void WMCreateDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
723 void WMDeleteDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
725 /* set default drag handler for view */
726 void WMSetViewDraggable(WMView *view, WMDragSourceProcs *procs, WMPixmap *dragImage);
728 void WMUnsetViewDraggable(WMView *view);
730 void WMRegisterViewForDraggedTypes(WMView *view, WMArray *acceptedTypes);
732 void WMUnregisterViewDraggedTypes(WMView *view);
734 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
736 /* ....................................................................... */
738 Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
740 /* ....................................................................... */
742 WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
744 WMFont* WMCopyFontWithStyle(WMScreen *scrPtr, WMFont *font, WMFontStyle style);
746 WMFont* WMRetainFont(WMFont *font);
748 void WMReleaseFont(WMFont *font);
750 char* WMGetFontName(WMFont *font);
752 unsigned int WMFontHeight(WMFont *font);
754 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
756 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
758 WMFont* WMDefaultSystemFont(WMScreen *scrPtr);
760 WMFont* WMDefaultBoldSystemFont(WMScreen *scrPtr);
762 WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
764 WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
766 /* ....................................................................... */
768 WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
770 void WMReleasePixmap(WMPixmap *pixmap);
772 WMPixmap* WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
773 Bool masked);
775 WMPixmap* WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
776 Pixmap mask, int width, int height,
777 int depth);
779 WMPixmap* WMCreatePixmapFromCairo(WMScreen *scrPtr, cairo_surface_t *image,
780 int threshold);
782 WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
784 WMSize WMGetPixmapSize(WMPixmap *pixmap);
786 WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
788 WMPixmap* WMCreateBlendedPixmapFromCairo(WMScreen *scrPtr, cairo_surface_t *image,
789 cairo_pattern_t *color);
791 WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
792 cairo_pattern_t *color);
794 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
796 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
798 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
800 WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
802 /* ....................................................................... */
805 WMColor* WMDarkGrayColor(WMScreen *scr);
807 WMColor* WMGrayColor(WMScreen *scr);
809 WMColor* WMBlackColor(WMScreen *scr);
811 WMColor* WMWhiteColor(WMScreen *scr);
813 void WMSetColorInGC(WMColor *color, GC gc);
815 GC WMColorGC(WMColor *color);
817 WMPixel WMColorPixel(WMColor *color);
819 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
820 unsigned int width, unsigned int height);
822 void WMReleaseColor(WMColor *color);
824 WMColor* WMRetainColor(WMColor *color);
826 WMColor* WMCreateColorWithSpec(WMScreen *scr, WMColorSpec *spec);
828 WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
829 unsigned short green, unsigned short blue,
830 Bool exact);
832 WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
833 unsigned short green, unsigned short blue,
834 unsigned short alpha, Bool exact);
836 WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
838 void WMGetComponentsFromColor(WMColor *color,
839 unsigned short *r, unsigned short *g,
840 unsigned short *b, unsigned short *a);
842 void WMSetColorAlpha(WMColor *color, unsigned short alpha);
844 unsigned short WMRedComponentOfColor(WMColor *color);
846 unsigned short WMGreenComponentOfColor(WMColor *color);
848 unsigned short WMBlueComponentOfColor(WMColor *color);
850 unsigned short WMGetColorAlpha(WMColor *color);
852 char* WMGetColorRGBDescription(WMColor *color);
855 void WMColorSpecSet(cairo_t *cairo, WMColorSpec *color);
857 WMColorSpec WMBlackColorSpec();
858 WMColorSpec WMGrayColorSpec();
859 WMColorSpec WMWhiteColorSpec();
860 WMColorSpec WMDarkGrayColorSpec();
863 /* ....................................................................... */
866 void WMDrawString(cairo_t *cairo, WMColorSpec *color, WMFont *font,
867 int x, int y, char *text);
869 int WMWidthOfString(WMFont *font, const char *text);
873 /* ....................................................................... */
875 WMScreen* WMWidgetScreen(WMWidget *w);
877 unsigned int WMScreenWidth(WMScreen *scr);
879 unsigned int WMScreenHeight(WMScreen *scr);
881 void WMUnmapWidget(WMWidget *w);
883 void WMMapWidget(WMWidget *w);
885 Bool WMWidgetIsMapped(WMWidget *w);
887 void WMRaiseWidget(WMWidget *w);
889 void WMLowerWidget(WMWidget *w);
891 void WMMoveWidget(WMWidget *w, int x, int y);
893 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
895 void WMSetWidgetBackgroundColor(WMWidget *w, WMColorSpec *color);
897 WMColorSpec WMGetWidgetBackgroundColor(WMWidget *w);
899 void WMMapSubwidgets(WMWidget *w);
901 void WMUnmapSubwidgets(WMWidget *w);
903 void WMRealizeWidget(WMWidget *w);
905 void WMReparentWidget(WMWidget *w, WMWidget *newParent, int x, int y);
907 void WMDestroyWidget(WMWidget *widget);
909 void WMHangData(WMWidget *widget, void *data);
911 void* WMGetHangedData(WMWidget *widget);
913 unsigned int WMWidgetWidth(WMWidget *w);
915 unsigned int WMWidgetHeight(WMWidget *w);
917 Window WMWidgetXID(WMWidget *w);
919 Window WMViewXID(WMView *view);
921 void WMRedisplayWidget(WMWidget *w);
923 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
925 void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
926 int rightOffs, int bottomOffs);
928 WMSize WMGetViewSize(WMView *view);
930 WMPoint WMGetViewPosition(WMView *view);
932 WMPoint WMGetViewScreenPosition(WMView *view);
934 WMWidget* WMWidgetOfView(WMView *view);
936 void WMSetViewNextResponder(WMView *view, WMView *responder);
938 void WMRelayToNextResponder(WMView *view, XEvent *event);
940 /* notifications */
941 extern char *WMViewSizeDidChangeNotification;
943 extern char *WMViewFocusDidChangeNotification;
945 extern char *WMViewRealizedNotification;
948 /* ....................................................................... */
950 void WMSetBalloonTextForView(char *text, WMView *view);
952 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
954 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
956 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
958 void WMSetBalloonDelay(WMScreen *scr, int delay);
960 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
963 /* ....................................................................... */
965 WMWindow* WMCreateWindow(WMScreen *screen, char *name);
967 WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
969 WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
970 int style);
972 WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
974 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
976 void WMSetWindowTitle(WMWindow *wPtr, char *title);
978 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
980 void WMSetWindowMiniwindowImage(WMWindow *win, cairo_surface_t *image);
982 void WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap);
984 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
986 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
988 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
990 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
991 int maxX, int maxY);
993 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
995 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
997 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
999 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
1001 void WMSetWindowLevel(WMWindow *win, int level);
1003 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
1005 void WMCloseWindow(WMWindow *win);
1007 /* ....................................................................... */
1009 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
1011 #define WMCreateCommandButton(parent) \
1012 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1013 |WBBPushInMask\
1014 |WBBPushLightMask\
1015 |WBBPushChangeMask)
1017 #define WMCreateRadioButton(parent) \
1018 WMCreateButton((parent), WBTRadio)
1020 #define WMCreateSwitchButton(parent) \
1021 WMCreateButton((parent), WBTSwitch)
1023 WMButton* WMCreateButton(WMWidget *parent, WMButtonType type);
1025 WMButton* WMCreateCustomButton(WMWidget *parent, int behaviourMask);
1027 void WMSetButtonImageDefault(WMButton *bPtr);
1029 void WMSetButtonImage(WMButton *bPtr, WMImage *image);
1031 void WMSetButtonAltImage(WMButton *bPtr, WMImage *image);
1033 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
1035 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
1037 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
1039 void WMSetButtonText(WMButton *bPtr, char *text);
1041 void WMSetButtonAltText(WMButton *bPtr, char *text);
1043 void WMSetButtonTextColor(WMButton *bPtr, WMColorSpec *color);
1045 void WMSetButtonAltTextColor(WMButton *bPtr, WMColorSpec *color);
1047 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColorSpec *color);
1049 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
1051 int WMGetButtonSelected(WMButton *bPtr);
1053 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
1055 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
1057 int WMGetButtonEnabled(WMButton *bPtr);
1059 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
1061 void WMSetButtonTag(WMButton *bPtr, int tag);
1063 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
1065 void WMPerformButtonClick(WMButton *bPtr);
1067 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
1069 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
1071 /* ....................................................................... */
1073 WMLabel* WMCreateLabel(WMWidget *parent);
1075 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1077 void WMSetLabelImage(WMLabel *lPtr, WMImage *image);
1079 WMImage* WMGetLabelImage(WMLabel *lPtr);
1081 char* WMGetLabelText(WMLabel *lPtr);
1083 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1085 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1087 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1089 void WMSetLabelText(WMLabel *lPtr, char *text);
1091 WMFont* WMGetLabelFont(WMLabel *lPtr);
1093 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1095 void WMSetLabelTextColor(WMLabel *lPtr, WMColorSpec *color);
1097 /* ....................................................................... */
1099 WMFrame* WMCreateFrame(WMWidget *parent);
1101 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1103 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1105 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1107 /* ....................................................................... */
1109 WMTextField* WMCreateTextField(WMWidget *parent);
1111 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1113 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1115 /* you can free the returned string */
1116 char* WMGetTextFieldText(WMTextField *tPtr);
1118 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1120 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1122 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1124 WMFont* WMGetTextFieldFont(WMTextField *tPtr);
1126 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1128 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1130 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1132 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1134 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1136 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1138 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1140 unsigned WMGetTextFieldCursorPosition(WMTextField *tPtr);
1142 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1144 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1146 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1148 WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
1150 extern char *WMTextDidChangeNotification;
1151 extern char *WMTextDidBeginEditingNotification;
1152 extern char *WMTextDidEndEditingNotification;
1154 /* ....................................................................... */
1156 WMScroller* WMCreateScroller(WMWidget *parent);
1158 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1159 float knobProportion);
1161 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1163 float WMGetScrollerValue(WMScroller *sPtr);
1165 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1167 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1169 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1170 WMScrollArrowPosition position);
1172 extern char *WMScrollerDidScrollNotification;
1174 /* ....................................................................... */
1176 WMList* WMCreateList(WMWidget *parent);
1178 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1180 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1182 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1184 WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
1186 void WMSortListItems(WMList *lPtr);
1188 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1190 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1192 WMListItem* WMGetListItem(WMList *lPtr, int row);
1194 WMArray* WMGetListItems(WMList *lPtr);
1196 void WMRemoveListItem(WMList *lPtr, int row);
1198 void WMSelectListItem(WMList *lPtr, int row);
1200 void WMUnselectListItem(WMList *lPtr, int row);
1202 /* This will select all items in range, and deselect all the others */
1203 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1205 /* This will select all items in range, leaving the others as they are */
1206 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1208 void WMSelectAllListItems(WMList *lPtr);
1210 void WMUnselectAllListItems(WMList *lPtr);
1212 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1214 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1216 int WMGetListItemHeight(WMList *lPtr);
1218 /* don't free the returned data */
1219 WMArray* WMGetListSelectedItems(WMList *lPtr);
1222 * For the following 2 functions, in case WMList allows multiple selection,
1223 * the first item in the list of selected items, respective its row number,
1224 * will be returned.
1227 /* don't free the returned data */
1228 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1230 int WMGetListSelectedItemRow(WMList *lPtr);
1232 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1234 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1236 void WMClearList(WMList *lPtr);
1238 int WMGetListNumberOfRows(WMList *lPtr);
1240 void WMSetListPosition(WMList *lPtr, int row);
1242 void WMSetListBottomPosition(WMList *lPtr, int row);
1244 int WMGetListPosition(WMList *lPtr);
1246 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1248 Bool WMListAllowsEmptySelection(WMList *lPtr);
1251 extern char *WMListDidScrollNotification;
1252 extern char *WMListSelectionDidChangeNotification;
1254 /* ....................................................................... */
1256 WMBrowser* WMCreateBrowser(WMWidget *parent);
1258 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1260 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1262 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1264 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1266 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1268 int WMAddBrowserColumn(WMBrowser *bPtr);
1270 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1272 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1274 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1276 WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1278 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1280 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1281 WMCompareDataProc *func);
1283 /* Don't free the returned string. */
1284 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1286 /* free the returned string */
1287 char* WMGetBrowserPath(WMBrowser *bPtr);
1289 /* free the returned string */
1290 char* WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1292 /* free the returned array */
1293 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1295 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1297 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1298 void *clientData);
1300 WMListItem* WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1302 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1304 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1306 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1308 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1310 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1312 WMList* WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1314 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1316 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1318 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1320 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1322 /* ....................................................................... */
1325 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1327 WMMenuItem* WMCreateMenuItem(void);
1329 void WMDestroyMenuItem(WMMenuItem *item);
1331 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1333 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1335 char* WMGetMenuItemShortcut(WMMenuItem *item);
1337 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1339 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1341 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1343 void* WMGetMenuItemRepresentedObject(WMMenuItem *item);
1345 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1347 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1349 WMAction* WMGetMenuItemAction(WMMenuItem *item);
1351 void* WMGetMenuItemData(WMMenuItem *item);
1353 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1355 char* WMGetMenuItemTitle(WMMenuItem *item);
1357 void WMSetMenuItemState(WMMenuItem *item, int state);
1359 int WMGetMenuItemState(WMMenuItem *item);
1361 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1363 WMPixmap* WMGetMenuItemPixmap(WMMenuItem *item);
1365 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1367 WMPixmap* WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1369 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1371 WMPixmap* WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1373 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1375 WMPixmap* WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1377 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1380 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1382 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1385 /* ....................................................................... */
1387 WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
1389 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1390 void *clientData);
1392 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1394 WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1396 WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1397 char *title);
1399 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1401 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1403 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1405 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1407 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1409 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1411 /* don't free the returned data */
1412 char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1414 WMMenuItem* WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1416 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1418 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1420 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1422 /* ....................................................................... */
1424 WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
1426 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1428 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1430 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1432 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1434 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1436 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1439 /* ....................................................................... */
1441 WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
1443 void WMFreeColorPanel(WMColorPanel *panel);
1445 void WMShowColorPanel(WMColorPanel *panel);
1447 void WMCloseColorPanel(WMColorPanel *panel);
1449 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1451 WMColor* WMGetColorPanelColor(WMColorPanel *panel);
1453 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1455 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1457 extern char *WMColorPanelColorChangedNotification;
1459 /* ....................................................................... */
1461 WMColorWell* WMCreateColorWell(WMWidget *parent);
1463 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1465 WMColor* WMGetColorWellColor(WMColorWell *cPtr);
1467 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1470 extern char *WMColorWellDidChangeNotification;
1473 /* ...................................................................... */
1475 WMScrollView* WMCreateScrollView(WMWidget *parent);
1477 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1478 unsigned int height);
1480 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1482 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1484 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1486 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1488 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1490 WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1492 WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1494 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1496 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1498 /* ....................................................................... */
1500 WMSlider* WMCreateSlider(WMWidget *parent);
1502 int WMGetSliderMinValue(WMSlider *slider);
1504 int WMGetSliderMaxValue(WMSlider *slider);
1506 int WMGetSliderValue(WMSlider *slider);
1508 void WMSetSliderMinValue(WMSlider *slider, int value);
1510 void WMSetSliderMaxValue(WMSlider *slider, int value);
1512 void WMSetSliderValue(WMSlider *slider, int value);
1514 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1516 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1518 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1520 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1522 /* ....................................................................... */
1525 WMSplitView* WMCreateSplitView(WMWidget *parent);
1527 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1529 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1531 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1533 WMView* WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1535 /* remove the first subview == view */
1536 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1538 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1541 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1543 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1545 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1546 WMSplitViewConstrainProc *proc);
1549 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1550 WMSplitViewResizeSubviewsProc *proc);
1553 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1555 /* ...................................................................... */
1557 WMRuler* WMCreateRuler (WMWidget *parent);
1559 WMRulerMargins* WMGetRulerMargins(WMRuler *rPtr);
1561 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1563 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin);
1565 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1567 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1569 int WMGetRulerOffset(WMRuler *rPtr);
1571 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1573 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1575 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1577 /* ....................................................................... */
1580 #define WMCreateText(parent) WMCreateTextForDocumentType \
1581 ((parent), (NULL), (NULL))
1583 WMText* WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser,
1584 WMAction *writer);
1586 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1588 void WMFreezeText(WMText *tPtr);
1590 #define WMRefreshText(tPtr) WMThawText((tPtr))
1592 void WMThawText(WMText *tPtr);
1594 int WMScrollText(WMText *tPtr, int amount);
1596 int WMPageText(WMText *tPtr, Bool direction);
1598 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1600 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1602 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1604 void WMShowTextRuler(WMText *tPtr, Bool show);
1606 int WMGetTextRulerShown(WMText *tPtr);
1608 void WMSetTextEditable(WMText *tPtr, Bool editable);
1610 int WMGetTextEditable(WMText *tPtr);
1612 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1614 int WMGetTextUsesMonoFont(WMText *tPtr);
1616 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1618 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1620 int WMGetTextIgnoresNewline(WMText *tPtr);
1622 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1624 WMFont* WMGetTextDefaultFont(WMText *tPtr);
1626 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1628 WMColor* WMGetTextDefaultColor(WMText *tPtr);
1630 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1632 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1634 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1636 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1638 void WMPrependTextStream(WMText *tPtr, char *text);
1640 void WMAppendTextStream(WMText *tPtr, char *text);
1642 #define WMClearText(tPtr) WMAppendTextStream \
1643 ((tPtr), (NULL))
1645 /* free the text */
1646 char* WMGetTextStream(WMText *tPtr);
1648 /* free the text */
1649 char* WMGetTextSelectedStream(WMText *tPtr);
1651 /* destroy the array */
1652 WMArray* WMGetTextObjects(WMText *tPtr);
1654 /* destroy the array */
1655 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1657 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1659 WMColor* WMGetTextSelectionColor(WMText *tPtr);
1661 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1663 WMFont* WMGetTextSelectionFont(WMText *tPtr);
1665 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1667 int WMGetTextSelectionUnderlined(WMText *tPtr);
1669 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1671 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1672 Bool caseSensitive);
1674 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1677 /* parser related stuff... use only if implementing a new parser */
1679 void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1680 WMColor *color, unsigned short first,
1681 unsigned short extraInfo);
1683 void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1684 WMColor *color, unsigned short first,
1685 unsigned short extraInfo);
1687 void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1688 WMColor *color, unsigned short first,
1689 unsigned short length);
1691 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1692 unsigned int kanji, unsigned int underlined,
1693 int script, WMRulerMargins *margins);
1695 /* do NOT free the margins */
1696 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1697 unsigned int *kanji, unsigned int *underlined,
1698 int *script, WMRulerMargins *margins);
1700 int WMGetTextInsertType(WMText *tPtr);
1702 /*int WMGetTextBlocks(WMText *tPtr);
1704 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1706 int WMGetCurrentTextBlock(WMText *tPtr);*/
1708 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1710 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1712 void* WMRemoveTextBlock(WMText *tPtr);
1714 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1716 /* ....................................................................... */
1719 WMTabView* WMCreateTabView(WMWidget *parent);
1721 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1723 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1725 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1727 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1729 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1731 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1733 WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1734 int identifier, char *label);
1736 WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1738 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1740 void WMSelectLastTabViewItem(WMTabView *tPtr);
1742 void WMSelectNextTabViewItem(WMTabView *tPtr);
1744 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1746 WMTabViewItem* WMGetSelectedTabViewItem(WMTabView *tPtr);
1748 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1750 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1752 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1755 WMTabViewItem* WMCreateTabViewItemWithIdentifier(int identifier);
1757 void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
1759 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1761 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1763 char* WMGetTabViewItemLabel(WMTabViewItem *item);
1765 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1767 WMView* WMGetTabViewItemView(WMTabViewItem *item);
1769 void WMDestroyTabViewItem(WMTabViewItem *item);
1772 /* ....................................................................... */
1774 WMBox* WMCreateBox(WMWidget *parent);
1776 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1778 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1779 int minSize, int maxSize, int space);
1781 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1782 int minSize, int maxSize, int space);
1784 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1786 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1788 /* ....................................................................... */
1790 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1791 char *defaultButton, char *alternateButton,
1792 char *otherButton);
1794 /* you can free the returned string */
1795 char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1796 char *defaultText, char *okButton, char *cancelButton);
1798 WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1799 char *msg, char *defaultButton,
1800 char *alternateButton, char *otherButton);
1802 WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1803 char *msg, char *defaultText, char *okButton,
1804 char *cancelButton);
1807 WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
1808 char *title, char *defaultButton,
1809 char *alternateButton);
1811 void WMDestroyAlertPanel(WMAlertPanel *panel);
1813 void WMDestroyInputPanel(WMInputPanel *panel);
1815 void WMDestroyGenericPanel(WMGenericPanel *panel);
1817 /* ....................................................................... */
1819 WMImage *WMRetainImage(WMImage *image);
1820 void WMDestroyImage(WMImage *image);
1822 unsigned int WMGetImageWidth(WMImage *image);
1823 unsigned int WMGetImageHeight(WMImage *image);
1824 /* ....................................................................... */
1826 /* only 1 instance per WMScreen */
1827 WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
1829 WMSavePanel* WMGetSavePanel(WMScreen *scrPtr);
1831 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1833 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1835 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1837 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1839 /* you can free the returned string */
1840 char* WMGetFilePanelFileName(WMFilePanel *panel);
1842 void WMFreeFilePanel(WMFilePanel *panel);
1844 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1845 char *path, char *name, char **fileTypes);
1847 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1849 WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
1852 /* ...................................................................... */
1854 /* only 1 instance per WMScreen */
1855 WMFontPanel* WMGetFontPanel(WMScreen *scr);
1857 void WMShowFontPanel(WMFontPanel *panel);
1859 void WMHideFontPanel(WMFontPanel *panel);
1861 void WMFreeFontPanel(WMFontPanel *panel);
1863 void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
1865 void WMSetFontPanelFont(WMFontPanel *panel, char *fontName);
1867 WMFont* WMGetFontPanelFont(WMFontPanel *panel);
1869 #ifdef __cplusplus
1871 #endif /* __cplusplus */
1873 #endif