Radio and Check buttons now work
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blobac805fc0590adcd609c736d8cb19e76bb5518cf8
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
11 #define NEW_LOOK 1
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */
17 #if 0
19 #endif
22 typedef unsigned long WMPixel;
25 typedef struct {
26 unsigned int width;
27 unsigned int height;
28 } WMSize;
30 typedef struct {
31 int x;
32 int y;
33 } WMPoint;
35 typedef struct {
36 WMPoint pos;
37 WMSize size;
38 } WMRect;
43 #define ClientMessageMask (1L<<30)
46 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
47 #define _DEFINED_GNUSTEP_WINDOW_INFO
49 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
50 * NSDesktopWindowLevel intended to be the level at which things
51 * on the desktop sit ... so you should be able
52 * to put a desktop background just below it.
54 * Applications are actually permitted to use any value in the
55 * range INT_MIN+1 to INT_MAX
57 enum {
58 WMDesktopWindowLevel = -1000, /* GNUstep addition */
59 WMNormalWindowLevel = 0,
60 WMFloatingWindowLevel = 3,
61 WMSubmenuWindowLevel = 3,
62 WMTornOffMenuWindowLevel = 3,
63 WMMainMenuWindowLevel = 20,
64 WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */
65 WMStatusWindowLevel = 21,
66 WMModalPanelWindowLevel = 100,
67 WMPopUpMenuWindowLevel = 101,
68 WMScreenSaverWindowLevel = 1000
72 /* window attributes */
73 enum {
74 WMBorderlessWindowMask = 0,
75 WMTitledWindowMask = 1,
76 WMClosableWindowMask = 2,
77 WMMiniaturizableWindowMask = 4,
78 WMResizableWindowMask = 8,
79 WMIconWindowMask = 64,
80 WMMiniWindowMask = 128
82 #endif
85 /* button types */
86 typedef enum {
87 /* 0 is reserved for internal use */
88 WBTMomentaryPush = 1,
89 WBTPushOnPushOff = 2,
90 WBTToggle = 3,
91 WBTSwitch = 4,
92 WBTRadio = 5,
93 WBTMomentaryChange = 6,
94 WBTOnOff = 7,
95 WBTMomentaryLight = 8
96 } WMButtonType;
98 /* button behaviour masks */
99 enum {
100 WBBSpringLoadedMask = (1 << 0),
101 WBBPushInMask = (1 << 1),
102 WBBPushChangeMask = (1 << 2),
103 WBBPushLightMask = (1 << 3),
104 WBBStateLightMask = (1 << 5),
105 WBBStateChangeMask = (1 << 6),
106 WBBStatePushMask = (1 << 7)
110 /* frame title positions */
111 typedef enum {
112 WTPNoTitle,
113 WTPAboveTop,
114 WTPAtTop,
115 WTPBelowTop,
116 WTPAboveBottom,
117 WTPAtBottom,
118 WTPBelowBottom
119 } WMTitlePosition;
122 /* relief types */
123 typedef enum {
124 WRFlat,
125 WRSimple,
126 WRRaised,
127 WRSunken,
128 WRGroove,
129 WRRidge,
130 WRPushed
131 } WMReliefType;
134 /* alignment types */
135 typedef enum {
136 WALeft,
137 WACenter,
138 WARight,
139 WAJustified /* not valid for textfields */
140 } WMAlignment;
143 /* image position */
144 typedef enum {
145 WIPNoImage,
146 WIPImageOnly,
147 WIPLeft,
148 WIPRight,
149 WIPBelow,
150 WIPAbove,
151 WIPOverlaps
152 } WMImagePosition;
155 /* scroller arrow position */
156 typedef enum {
157 WSAMaxEnd,
158 WSAMinEnd,
159 WSANone
160 } WMScrollArrowPosition;
162 /* scroller parts */
163 typedef enum {
164 WSNoPart,
165 WSDecrementPage,
166 WSIncrementPage,
167 WSDecrementLine,
168 WSIncrementLine,
169 WSDecrementWheel,
170 WSIncrementWheel,
171 WSKnob,
172 WSKnobSlot
173 } WMScrollerPart;
175 /* usable scroller parts */
176 typedef enum {
177 WSUNoParts,
178 WSUOnlyArrows,
179 WSUAllParts
180 } WMUsableScrollerParts;
182 /* matrix types */
183 typedef enum {
184 WMRadioMode,
185 WMHighlightMode,
186 WMListMode,
187 WMTrackMode
188 } WMMatrixTypes;
191 typedef enum {
192 WTTopTabsBevelBorder,
193 WTNoTabsBevelBorder,
194 WTNoTabsLineBorder,
195 WTNoTabsNoBorder
196 } WMTabViewType;
199 /* text movement types */
200 enum {
201 WMIllegalTextMovement,
202 WMReturnTextMovement,
203 WMEscapeTextMovement,
204 WMTabTextMovement,
205 WMBacktabTextMovement,
206 WMLeftTextMovement,
207 WMRightTextMovement,
208 WMUpTextMovement,
209 WMDownTextMovement
212 /* text field special events */
213 enum {
214 WMInsertTextEvent,
215 WMDeleteTextEvent
219 enum {
220 WLNotFound = -1 /* element was not found in WMList */
224 /* drag operations */
225 typedef enum {
226 WDOperationNone = 0,
227 WDOperationCopy,
228 WDOperationMove,
229 WDOperationLink,
230 WDOperationAsk,
231 WDOperationPrivate
232 } WMDragOperationType;
235 typedef enum {
236 WMGrayModeColorPanel = 1,
237 WMRGBModeColorPanel = 2,
238 WMCMYKModeColorPanel = 3,
239 WMHSBModeColorPanel = 4,
240 WMCustomPaletteModeColorPanel = 5,
241 WMColorListModeColorPanel = 6,
242 WMWheelModeColorPanel = 7
243 } WMColorPanelMode;
247 /* system images */
248 #define WSIReturnArrow 1
249 #define WSIHighlightedReturnArrow 2
250 #define WSIScrollerDimple 3
251 #define WSIArrowLeft 4
252 #define WSIHighlightedArrowLeft 5
253 #define WSIArrowRight 6
254 #define WSIHighlightedArrowRight 7
255 #define WSIArrowUp 8
256 #define WSIHighlightedArrowUp 9
257 #define WSIArrowDown 10
258 #define WSIHighlightedArrowDown 11
259 #define WSICheckMark 12
261 enum {
262 WLDSSelected = (1 << 16),
263 WLDSDisabled = (1 << 17),
264 WLDSFocused = (1 << 18),
265 WLDSIsBranch = (1 << 19)
268 /* alert panel return values */
269 enum {
270 WAPRDefault = 0,
271 WAPRAlternate = 1,
272 WAPROther = -1,
273 WAPRError = -2
278 /* types of input observers */
279 enum {
280 WIReadMask = (1 << 0),
281 WIWriteMask = (1 << 1),
282 WIExceptMask = (1 << 2)
287 typedef int W_Class;
289 enum {
290 WC_Window = 0,
291 WC_Frame = 1,
292 WC_Label = 2,
293 WC_Button = 3,
294 WC_TextField = 4,
295 WC_Scroller = 5,
296 WC_ScrollView = 6,
297 WC_List = 7,
298 WC_Browser = 8,
299 WC_PopUpButton = 9,
300 WC_ColorWell = 10,
301 WC_Slider = 11,
302 WC_Matrix = 12, /* not ready */
303 WC_SplitView = 13,
304 WC_TabView = 14,
305 WC_ProgressIndicator = 15,
306 WC_MenuView = 16,
307 WC_Ruler = 17,
308 WC_Text = 18,
309 WC_Box = 19
312 /* All widgets must start with the following structure
313 * in that order. Used for typecasting to get some generic data */
314 typedef struct W_WidgetType {
315 W_Class widgetClass;
316 struct W_View *view;
318 } W_WidgetType;
321 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
322 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
325 typedef struct {
326 unsigned char red;
327 unsigned char green;
328 unsigned char blue;
329 unsigned char alpha;
330 } WMColorSpec;
332 typedef cairo_surface_t WMImage;
334 /* widgets */
336 typedef void WMWidget;
338 typedef struct W_Pixmap WMPixmap;
339 typedef struct W_Font WMFont;
340 typedef struct W_Color WMColor;
342 typedef struct W_Screen WMScreen;
344 typedef struct W_View WMView;
346 typedef struct W_Window WMWindow;
347 typedef struct W_Frame WMFrame;
348 typedef struct W_Button WMButton;
349 typedef struct W_Label WMLabel;
350 typedef struct W_TextField WMTextField;
351 typedef struct W_Scroller WMScroller;
352 typedef struct W_ScrollView WMScrollView;
353 typedef struct W_List WMList;
354 typedef struct W_Browser WMBrowser;
355 typedef struct W_PopUpButton WMPopUpButton;
356 typedef struct W_ProgressIndicator WMProgressIndicator;
357 typedef struct W_ColorWell WMColorWell;
358 typedef struct W_Slider WMSlider;
359 typedef struct W_Matrix WMMatrix; /* not ready */
360 typedef struct W_SplitView WMSplitView;
361 typedef struct W_TabView WMTabView;
362 typedef struct W_Ruler WMRuler;
363 typedef struct W_Text WMText;
364 typedef struct W_Box WMBox;
367 /* not widgets */
368 typedef struct W_TabViewItem WMTabViewItem;
369 typedef struct W_MenuItem WMMenuItem;
372 typedef struct W_FilePanel WMFilePanel;
373 typedef WMFilePanel WMOpenPanel;
374 typedef WMFilePanel WMSavePanel;
376 typedef struct W_FontPanel WMFontPanel;
378 typedef struct W_ColorPanel WMColorPanel;
381 /* item for WMList */
382 typedef struct WMListItem {
383 char *text;
384 void *clientData; /* ptr for user clientdata. */
386 unsigned int uflags:16; /* flags for the user */
387 unsigned int selected:1;
388 unsigned int disabled:1;
389 unsigned int isBranch:1;
390 unsigned int loaded:1;
391 } WMListItem;
393 /* struct for message panel */
394 typedef struct WMAlertPanel {
395 WMWindow *win; /* window */
396 WMBox *vbox;
397 WMBox *hbox;
398 WMButton *defBtn; /* default button */
399 WMButton *altBtn; /* alternative button */
400 WMButton *othBtn; /* other button */
401 WMLabel *iLbl; /* icon label */
402 WMLabel *tLbl; /* title label */
403 WMLabel *mLbl; /* message label */
404 WMFrame *line; /* separator */
405 short result; /* button that was pushed */
406 } WMAlertPanel;
409 typedef struct WMGenericPanel {
410 WMWindow *win;
411 WMBox *vbox;
413 WMLabel *iLbl;
414 WMLabel *tLbl;
416 WMFrame *line;
418 WMFrame *content;
420 WMBox *buttonBox;
421 WMButton *defBtn;
422 WMButton *altBtn;
424 short result;
425 } WMGenericPanel;
428 typedef struct WMInputPanel {
429 WMWindow *win; /* window */
430 WMButton *defBtn; /* default button */
431 WMButton *altBtn; /* alternative button */
432 WMLabel *tLbl; /* title label */
433 WMLabel *mLbl; /* message label */
434 WMTextField *text; /* text field */
435 short result; /* button that was pushed */
436 } WMInputPanel;
439 /* Basic font styles. Used to easily get one style from another */
440 typedef enum WMFontStyle {
441 WFSNormal = 0,
442 WFSBold = 1,
443 WFSItalic = 2,
444 WFSBoldItalic = 3
445 } WMFontStyle;
448 /* WMRuler: */
449 typedef struct {
450 WMArray *tabs; /* a growable array of tabstops */
451 unsigned short left; /* left margin marker */
452 unsigned short right; /* right margin marker */
453 unsigned short first; /* indentation marker for first line only */
454 unsigned short body; /* body indentation marker */
455 unsigned short retainCount;
456 } WMRulerMargins;
457 /* All indentation and tab markers are _relative_ to the left margin marker */
460 typedef void WMEventProc(XEvent *event, void *clientData);
462 typedef void WMEventHook(XEvent *event);
464 /* self is set to the widget from where the callback is being called and
465 * clientData to the data set to with WMSetClientData() */
466 typedef void WMAction(WMWidget *self, void *clientData);
468 /* same as WMAction, but for stuff that arent widgets */
469 typedef void WMAction2(void *self, void *clientData);
472 /* delegate method like stuff */
473 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
474 int state, WMRect *rect);
478 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
479 unsigned int oldWidth,
480 unsigned int oldHeight);
483 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
484 int *minSize, int *maxSize);
486 typedef WMWidget* WMMatrixCreateCellProc(WMMatrix *mPtr);
491 typedef struct WMBrowserDelegate {
492 void *data;
494 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
495 WMBrowser *sender, int column, WMList *list);
497 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
498 int column);
500 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
502 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
503 } WMBrowserDelegate;
506 typedef struct WMTextFieldDelegate {
507 void *data;
509 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
510 WMNotification *notif);
512 void (*didChange)(struct WMTextFieldDelegate *self,
513 WMNotification *notif);
515 void (*didEndEditing)(struct WMTextFieldDelegate *self,
516 WMNotification *notif);
518 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
519 WMTextField *tPtr);
521 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
522 WMTextField *tPtr);
523 } WMTextFieldDelegate;
526 typedef struct WMTextDelegate {
527 void *data;
529 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
530 void *description);
532 } WMTextDelegate;
536 typedef struct WMTabViewDelegate {
537 void *data;
539 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
540 WMTabView *tabView);
542 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
543 WMTabViewItem *item);
545 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
546 WMTabViewItem *item);
548 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
549 WMTabViewItem *item);
550 } WMTabViewDelegate;
555 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
556 Time timestamp, void *cdata, WMData *data);
559 typedef struct WMSelectionProcs {
560 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
561 void *cdata, Atom *type);
562 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
563 void (*selectionDone)(WMView *view, Atom selection, Atom target,
564 void *cdata);
565 } WMSelectionProcs;
568 typedef struct W_DraggingInfo WMDraggingInfo;
571 /* links a label to a dnd operation. */
572 typedef struct W_DragOperationtItem WMDragOperationItem;
575 typedef struct W_DragSourceProcs {
576 WMArray* (*dropDataTypes)(WMView *self);
577 WMDragOperationType (*wantedDropOperation)(WMView *self);
578 WMArray* (*askedOperations)(WMView *self);
579 Bool (*acceptDropOperation)(WMView *self, WMDragOperationType operation);
580 void (*beganDrag)(WMView *self, WMPoint *point);
581 void (*endedDrag)(WMView *self, WMPoint *point, Bool deposited);
582 WMData* (*fetchDragData)(WMView *self, char *type);
583 /*Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
584 } WMDragSourceProcs;
588 typedef struct W_DragDestinationProcs {
589 void (*prepareForDragOperation)(WMView *self);
590 WMArray* (*requiredDataTypes)(WMView *self, WMDragOperationType request,
591 WMArray *sourceDataTypes);
592 WMDragOperationType (*allowedOperation)(WMView *self,
593 WMDragOperationType request,
594 WMArray *sourceDataTypes);
595 Bool (*inspectDropData)(WMView *self, WMArray *dropData);
596 void (*performDragOperation)(WMView *self, WMArray *dropData,
597 WMArray *operations, WMPoint *dropLocation);
598 void (*concludeDragOperation)(WMView *self);
599 } WMDragDestinationProcs;
602 /* ...................................................................... */
605 WMPoint wmkpoint(int x, int y);
607 WMSize wmksize(unsigned int width, unsigned int height);
609 WMRect wmkrect(int x, int y, unsigned int width, unsigned int height);
611 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
612 #define wmksize(width, height) (WMSize){(width), (height)}
613 #define wmkpoint(x, y) (WMPoint){(x), (y)}
614 #endif
616 /* ....................................................................... */
620 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
622 void WMSetResourcePath(char *path);
624 /* don't free the returned string */
625 char* WMGetApplicationName();
627 /* Try to locate resource file. ext may be NULL */
628 char* WMPathForResourceOfType(char *resource, char *ext);
631 WMScreen* WMOpenScreen(const char *display);
633 WMScreen* WMCreateScreen(Display *display, int screen);
635 WMScreen* WMCreateSimpleApplicationScreen(Display *display);
637 void WMScreenMainLoop(WMScreen *scr);
639 void WMBreakModalLoop(WMScreen *scr);
641 void WMRunModalLoop(WMScreen *scr, WMView *view);
643 Display* WMScreenDisplay(WMScreen *scr);
645 int WMScreenDepth(WMScreen *scr);
649 void WMSetApplicationIconImage(WMScreen *app, cairo_surface_t *image);
651 cairo_surface_t* WMGetApplicationIconImage(WMScreen *app);
653 void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
655 WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
657 /* If color==NULL it will use the default color for panels: ae/aa/ae */
658 WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, cairo_pattern_t *color);
660 void WMSetApplicationIconWindow(WMScreen *scr, Window window);
662 void WMSetFocusToWidget(WMWidget *widget);
664 WMEventHook* WMHookEventHandler(WMEventHook *handler);
666 int WMHandleEvent(XEvent *event);
668 Bool WMScreenPending(WMScreen *scr);
670 void WMCreateEventHandler(WMView *view, unsigned long mask,
671 WMEventProc *eventProc, void *clientData);
673 void WMDeleteEventHandler(WMView *view, unsigned long mask,
674 WMEventProc *eventProc, void *clientData);
676 int WMIsDoubleClick(XEvent *event);
678 /*int WMIsTripleClick(XEvent *event);*/
680 void WMNextEvent(Display *dpy, XEvent *event);
682 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
685 /* ....................................................................... */
688 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
689 WMSelectionProcs *procs, void *cdata);
691 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
693 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
694 Time timestamp, WMSelectionCallback *callback,
695 void *cdata);
698 extern char *WMSelectionOwnerDidChangeNotification;
700 /* ....................................................................... */
702 WMArray* WMCreateDragOperationArray(int initialSize);
704 WMDragOperationItem* WMCreateDragOperationItem(WMDragOperationType type,
705 char* text);
707 WMDragOperationType WMGetDragOperationItemType(WMDragOperationItem* item);
709 char* WMGetDragOperationItemText(WMDragOperationItem* item);
711 void WMSetViewDragImage(WMView* view, WMPixmap *dragImage);
713 void WMReleaseViewDragImage(WMView* view);
715 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
717 Bool WMIsDraggingFromView(WMView *view);
719 void WMDragImageFromView(WMView *view, XEvent *event);
721 /* Create a drag handler, associating drag event masks with dragEventProc */
722 void WMCreateDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
724 void WMDeleteDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
726 /* set default drag handler for view */
727 void WMSetViewDraggable(WMView *view, WMDragSourceProcs *procs, WMPixmap *dragImage);
729 void WMUnsetViewDraggable(WMView *view);
731 void WMRegisterViewForDraggedTypes(WMView *view, WMArray *acceptedTypes);
733 void WMUnregisterViewDraggedTypes(WMView *view);
735 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
737 /* ....................................................................... */
739 Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
741 /* ....................................................................... */
743 WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
745 WMFont* WMCopyFontWithStyle(WMScreen *scrPtr, WMFont *font, WMFontStyle style);
747 WMFont* WMRetainFont(WMFont *font);
749 void WMReleaseFont(WMFont *font);
751 char* WMGetFontName(WMFont *font);
753 unsigned int WMFontHeight(WMFont *font);
755 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
757 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
759 WMFont* WMDefaultSystemFont(WMScreen *scrPtr);
761 WMFont* WMDefaultBoldSystemFont(WMScreen *scrPtr);
763 WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
765 WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
767 /* ....................................................................... */
769 WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
771 void WMReleasePixmap(WMPixmap *pixmap);
773 WMPixmap* WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
774 Bool masked);
776 WMPixmap* WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
777 Pixmap mask, int width, int height,
778 int depth);
780 WMPixmap* WMCreatePixmapFromCairo(WMScreen *scrPtr, cairo_surface_t *image,
781 int threshold);
783 WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
785 WMSize WMGetPixmapSize(WMPixmap *pixmap);
787 WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
789 WMPixmap* WMCreateBlendedPixmapFromCairo(WMScreen *scrPtr, cairo_surface_t *image,
790 cairo_pattern_t *color);
792 WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
793 cairo_pattern_t *color);
795 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
797 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
799 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
801 WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
803 /* ....................................................................... */
806 WMColor* WMDarkGrayColor(WMScreen *scr);
808 WMColor* WMGrayColor(WMScreen *scr);
810 WMColor* WMBlackColor(WMScreen *scr);
812 WMColor* WMWhiteColor(WMScreen *scr);
814 void WMSetColorInGC(WMColor *color, GC gc);
816 GC WMColorGC(WMColor *color);
818 WMPixel WMColorPixel(WMColor *color);
820 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
821 unsigned int width, unsigned int height);
823 void WMReleaseColor(WMColor *color);
825 WMColor* WMRetainColor(WMColor *color);
827 XColor WMCreateColorWithSpec(WMScreen *scr, WMColorSpec *spec);
829 WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
830 unsigned short green, unsigned short blue,
831 Bool exact);
833 WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
834 unsigned short green, unsigned short blue,
835 unsigned short alpha, Bool exact);
837 WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
839 void WMGetComponentsFromColor(WMColor *color,
840 unsigned short *r, unsigned short *g,
841 unsigned short *b, unsigned short *a);
843 void WMSetColorAlpha(WMColor *color, unsigned short alpha);
845 unsigned short WMRedComponentOfColor(WMColor *color);
847 unsigned short WMGreenComponentOfColor(WMColor *color);
849 unsigned short WMBlueComponentOfColor(WMColor *color);
851 unsigned short WMGetColorAlpha(WMColor *color);
853 char* WMGetColorRGBDescription(WMColor *color);
856 void WMColorSpecSet(cairo_t *cairo, WMColorSpec *color);
858 WMColorSpec WMBlackColorSpec();
859 WMColorSpec WMGrayColorSpec();
860 WMColorSpec WMLightGrayColorSpec();
861 WMColorSpec WMTransparentColorSpec();
862 WMColorSpec WMWhiteColorSpec();
863 WMColorSpec WMDarkGrayColorSpec();
866 /* ....................................................................... */
869 void WMDrawString(cairo_t *cairo, WMColorSpec *color, WMFont *font,
870 int x, int y, char *text);
872 int WMWidthOfString(WMFont *font, const char *text);
876 /* ....................................................................... */
878 WMScreen* WMWidgetScreen(WMWidget *w);
880 unsigned int WMScreenWidth(WMScreen *scr);
882 unsigned int WMScreenHeight(WMScreen *scr);
884 void WMUnmapWidget(WMWidget *w);
886 void WMMapWidget(WMWidget *w);
888 Bool WMWidgetIsMapped(WMWidget *w);
890 void WMRaiseWidget(WMWidget *w);
892 void WMLowerWidget(WMWidget *w);
894 void WMMoveWidget(WMWidget *w, int x, int y);
896 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
898 void WMSetWidgetBackgroundColor(WMWidget *w, WMColorSpec *color);
900 WMColorSpec WMGetWidgetBackgroundColor(WMWidget *w);
902 void WMMapSubwidgets(WMWidget *w);
904 void WMUnmapSubwidgets(WMWidget *w);
906 void WMRealizeWidget(WMWidget *w);
908 void WMReparentWidget(WMWidget *w, WMWidget *newParent, int x, int y);
910 void WMDestroyWidget(WMWidget *widget);
912 void WMHangData(WMWidget *widget, void *data);
914 void* WMGetHangedData(WMWidget *widget);
916 unsigned int WMWidgetWidth(WMWidget *w);
918 unsigned int WMWidgetHeight(WMWidget *w);
920 Window WMWidgetXID(WMWidget *w);
922 Window WMViewXID(WMView *view);
924 void WMRedisplayWidget(WMWidget *w);
926 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
928 void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
929 int rightOffs, int bottomOffs);
931 WMSize WMGetViewSize(WMView *view);
933 WMPoint WMGetViewPosition(WMView *view);
935 WMPoint WMGetViewScreenPosition(WMView *view);
937 WMWidget* WMWidgetOfView(WMView *view);
939 void WMSetViewNextResponder(WMView *view, WMView *responder);
941 void WMRelayToNextResponder(WMView *view, XEvent *event);
943 /* notifications */
944 extern char *WMViewSizeDidChangeNotification;
946 extern char *WMViewFocusDidChangeNotification;
948 extern char *WMViewRealizedNotification;
951 /* ....................................................................... */
953 void WMSetBalloonTextForView(char *text, WMView *view);
955 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
957 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
959 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
961 void WMSetBalloonDelay(WMScreen *scr, int delay);
963 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
966 /* ....................................................................... */
968 WMWindow* WMCreateWindow(WMScreen *screen, char *name);
970 WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
972 WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
973 int style);
975 WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
977 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
979 void WMSetWindowTitle(WMWindow *wPtr, char *title);
981 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
983 void WMSetWindowMiniwindowImage(WMWindow *win, cairo_surface_t *image);
985 void WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap);
987 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
989 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
991 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
993 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
994 int maxX, int maxY);
996 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
998 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
1000 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
1002 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
1004 void WMSetWindowLevel(WMWindow *win, int level);
1006 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
1008 void WMCloseWindow(WMWindow *win);
1010 /* ....................................................................... */
1012 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
1014 #define WMCreateCommandButton(parent) \
1015 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1016 |WBBPushInMask\
1017 |WBBPushLightMask\
1018 |WBBPushChangeMask)
1020 #define WMCreateRadioButton(parent) \
1021 WMCreateButton((parent), WBTRadio)
1023 #define WMCreateSwitchButton(parent) \
1024 WMCreateButton((parent), WBTSwitch)
1026 WMButton* WMCreateButton(WMWidget *parent, WMButtonType type);
1028 WMButton* WMCreateCustomButton(WMWidget *parent, int behaviourMask);
1030 void WMSetButtonImageDefault(WMButton *bPtr);
1032 void WMSetButtonImage(WMButton *bPtr, WMImage *image);
1034 void WMSetButtonAltImage(WMButton *bPtr, WMImage *image);
1036 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
1038 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
1040 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
1042 void WMSetButtonText(WMButton *bPtr, char *text);
1044 void WMSetButtonAltText(WMButton *bPtr, char *text);
1046 void WMSetButtonTextColor(WMButton *bPtr, WMColorSpec *color);
1048 void WMSetButtonAltTextColor(WMButton *bPtr, WMColorSpec *color);
1050 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColorSpec *color);
1052 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
1054 int WMGetButtonSelected(WMButton *bPtr);
1056 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
1058 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
1060 int WMGetButtonEnabled(WMButton *bPtr);
1062 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
1064 void WMSetButtonTag(WMButton *bPtr, int tag);
1066 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
1068 void WMPerformButtonClick(WMButton *bPtr);
1070 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
1072 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
1074 /* ....................................................................... */
1076 WMLabel* WMCreateLabel(WMWidget *parent);
1078 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1080 void WMSetLabelImage(WMLabel *lPtr, WMImage *image);
1082 WMImage* WMGetLabelImage(WMLabel *lPtr);
1084 char* WMGetLabelText(WMLabel *lPtr);
1086 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1088 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1090 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1092 void WMSetLabelText(WMLabel *lPtr, char *text);
1094 WMFont* WMGetLabelFont(WMLabel *lPtr);
1096 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1098 void WMSetLabelTextColor(WMLabel *lPtr, WMColorSpec *color);
1100 /* ....................................................................... */
1102 WMFrame* WMCreateFrame(WMWidget *parent);
1104 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1106 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1108 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1110 /* ....................................................................... */
1112 WMTextField* WMCreateTextField(WMWidget *parent);
1114 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1116 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1118 /* you can free the returned string */
1119 char* WMGetTextFieldText(WMTextField *tPtr);
1121 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1123 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1125 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1127 WMFont* WMGetTextFieldFont(WMTextField *tPtr);
1129 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1131 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1133 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1135 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1137 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1139 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1141 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1143 unsigned WMGetTextFieldCursorPosition(WMTextField *tPtr);
1145 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1147 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1149 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1151 WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
1153 extern char *WMTextDidChangeNotification;
1154 extern char *WMTextDidBeginEditingNotification;
1155 extern char *WMTextDidEndEditingNotification;
1157 /* ....................................................................... */
1159 WMScroller* WMCreateScroller(WMWidget *parent);
1161 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1162 float knobProportion);
1164 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1166 float WMGetScrollerValue(WMScroller *sPtr);
1168 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1170 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1172 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1173 WMScrollArrowPosition position);
1175 extern char *WMScrollerDidScrollNotification;
1177 /* ....................................................................... */
1179 WMList* WMCreateList(WMWidget *parent);
1181 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1183 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1185 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1187 WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
1189 void WMSortListItems(WMList *lPtr);
1191 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1193 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1195 WMListItem* WMGetListItem(WMList *lPtr, int row);
1197 WMArray* WMGetListItems(WMList *lPtr);
1199 void WMRemoveListItem(WMList *lPtr, int row);
1201 void WMSelectListItem(WMList *lPtr, int row);
1203 void WMUnselectListItem(WMList *lPtr, int row);
1205 /* This will select all items in range, and deselect all the others */
1206 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1208 /* This will select all items in range, leaving the others as they are */
1209 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1211 void WMSelectAllListItems(WMList *lPtr);
1213 void WMUnselectAllListItems(WMList *lPtr);
1215 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1217 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1219 int WMGetListItemHeight(WMList *lPtr);
1221 /* don't free the returned data */
1222 WMArray* WMGetListSelectedItems(WMList *lPtr);
1225 * For the following 2 functions, in case WMList allows multiple selection,
1226 * the first item in the list of selected items, respective its row number,
1227 * will be returned.
1230 /* don't free the returned data */
1231 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1233 int WMGetListSelectedItemRow(WMList *lPtr);
1235 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1237 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1239 void WMClearList(WMList *lPtr);
1241 int WMGetListNumberOfRows(WMList *lPtr);
1243 void WMSetListPosition(WMList *lPtr, int row);
1245 void WMSetListBottomPosition(WMList *lPtr, int row);
1247 int WMGetListPosition(WMList *lPtr);
1249 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1251 Bool WMListAllowsEmptySelection(WMList *lPtr);
1254 extern char *WMListDidScrollNotification;
1255 extern char *WMListSelectionDidChangeNotification;
1257 /* ....................................................................... */
1259 WMBrowser* WMCreateBrowser(WMWidget *parent);
1261 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1263 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1265 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1267 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1269 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1271 int WMAddBrowserColumn(WMBrowser *bPtr);
1273 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1275 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1277 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1279 WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1281 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1283 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1284 WMCompareDataProc *func);
1286 /* Don't free the returned string. */
1287 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1289 /* free the returned string */
1290 char* WMGetBrowserPath(WMBrowser *bPtr);
1292 /* free the returned string */
1293 char* WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1295 /* free the returned array */
1296 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1298 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1300 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1301 void *clientData);
1303 WMListItem* WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1305 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1307 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1309 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1311 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1313 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1315 WMList* WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1317 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1319 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1321 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1323 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1325 /* ....................................................................... */
1328 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1330 WMMenuItem* WMCreateMenuItem(void);
1332 void WMDestroyMenuItem(WMMenuItem *item);
1334 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1336 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1338 char* WMGetMenuItemShortcut(WMMenuItem *item);
1340 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1342 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1344 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1346 void* WMGetMenuItemRepresentedObject(WMMenuItem *item);
1348 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1350 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1352 WMAction* WMGetMenuItemAction(WMMenuItem *item);
1354 void* WMGetMenuItemData(WMMenuItem *item);
1356 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1358 char* WMGetMenuItemTitle(WMMenuItem *item);
1360 void WMSetMenuItemState(WMMenuItem *item, int state);
1362 int WMGetMenuItemState(WMMenuItem *item);
1364 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1366 WMPixmap* WMGetMenuItemPixmap(WMMenuItem *item);
1368 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1370 WMPixmap* WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1372 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1374 WMPixmap* WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1376 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1378 WMPixmap* WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1380 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1383 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1385 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1388 /* ....................................................................... */
1390 WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
1392 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1393 void *clientData);
1395 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1397 WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1399 WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1400 char *title);
1402 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1404 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1406 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1408 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1410 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1412 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1414 /* don't free the returned data */
1415 char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1417 WMMenuItem* WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1419 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1421 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1423 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1425 /* ....................................................................... */
1427 WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
1429 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1431 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1433 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1435 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1437 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1439 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1442 /* ....................................................................... */
1444 WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
1446 void WMFreeColorPanel(WMColorPanel *panel);
1448 void WMShowColorPanel(WMColorPanel *panel);
1450 void WMCloseColorPanel(WMColorPanel *panel);
1452 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1454 WMColor* WMGetColorPanelColor(WMColorPanel *panel);
1456 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1458 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1460 extern char *WMColorPanelColorChangedNotification;
1462 /* ....................................................................... */
1464 WMColorWell* WMCreateColorWell(WMWidget *parent);
1466 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1468 WMColor* WMGetColorWellColor(WMColorWell *cPtr);
1470 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1473 extern char *WMColorWellDidChangeNotification;
1476 /* ...................................................................... */
1478 WMScrollView* WMCreateScrollView(WMWidget *parent);
1480 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1481 unsigned int height);
1483 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1485 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1487 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1489 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1491 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1493 WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1495 WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1497 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1499 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1501 /* ....................................................................... */
1503 WMSlider* WMCreateSlider(WMWidget *parent);
1505 int WMGetSliderMinValue(WMSlider *slider);
1507 int WMGetSliderMaxValue(WMSlider *slider);
1509 int WMGetSliderValue(WMSlider *slider);
1511 void WMSetSliderMinValue(WMSlider *slider, int value);
1513 void WMSetSliderMaxValue(WMSlider *slider, int value);
1515 void WMSetSliderValue(WMSlider *slider, int value);
1517 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1519 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1521 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1523 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1525 /* ....................................................................... */
1528 WMSplitView* WMCreateSplitView(WMWidget *parent);
1530 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1532 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1534 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1536 WMView* WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1538 /* remove the first subview == view */
1539 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1541 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1544 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1546 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1548 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1549 WMSplitViewConstrainProc *proc);
1552 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1553 WMSplitViewResizeSubviewsProc *proc);
1556 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1558 /* ...................................................................... */
1560 WMRuler* WMCreateRuler (WMWidget *parent);
1562 WMRulerMargins* WMGetRulerMargins(WMRuler *rPtr);
1564 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1566 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin);
1568 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1570 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1572 int WMGetRulerOffset(WMRuler *rPtr);
1574 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1576 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1578 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1580 /* ....................................................................... */
1583 #define WMCreateText(parent) WMCreateTextForDocumentType \
1584 ((parent), (NULL), (NULL))
1586 WMText* WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser,
1587 WMAction *writer);
1589 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1591 void WMFreezeText(WMText *tPtr);
1593 #define WMRefreshText(tPtr) WMThawText((tPtr))
1595 void WMThawText(WMText *tPtr);
1597 int WMScrollText(WMText *tPtr, int amount);
1599 int WMPageText(WMText *tPtr, Bool direction);
1601 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1603 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1605 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1607 void WMShowTextRuler(WMText *tPtr, Bool show);
1609 int WMGetTextRulerShown(WMText *tPtr);
1611 void WMSetTextEditable(WMText *tPtr, Bool editable);
1613 int WMGetTextEditable(WMText *tPtr);
1615 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1617 int WMGetTextUsesMonoFont(WMText *tPtr);
1619 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1621 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1623 int WMGetTextIgnoresNewline(WMText *tPtr);
1625 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1627 WMFont* WMGetTextDefaultFont(WMText *tPtr);
1629 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1631 WMColor* WMGetTextDefaultColor(WMText *tPtr);
1633 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1635 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1637 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1639 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1641 void WMPrependTextStream(WMText *tPtr, char *text);
1643 void WMAppendTextStream(WMText *tPtr, char *text);
1645 #define WMClearText(tPtr) WMAppendTextStream \
1646 ((tPtr), (NULL))
1648 /* free the text */
1649 char* WMGetTextStream(WMText *tPtr);
1651 /* free the text */
1652 char* WMGetTextSelectedStream(WMText *tPtr);
1654 /* destroy the array */
1655 WMArray* WMGetTextObjects(WMText *tPtr);
1657 /* destroy the array */
1658 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1660 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1662 WMColor* WMGetTextSelectionColor(WMText *tPtr);
1664 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1666 WMFont* WMGetTextSelectionFont(WMText *tPtr);
1668 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1670 int WMGetTextSelectionUnderlined(WMText *tPtr);
1672 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1674 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1675 Bool caseSensitive);
1677 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1680 /* parser related stuff... use only if implementing a new parser */
1682 void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1683 WMColor *color, unsigned short first,
1684 unsigned short extraInfo);
1686 void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1687 WMColor *color, unsigned short first,
1688 unsigned short extraInfo);
1690 void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1691 WMColor *color, unsigned short first,
1692 unsigned short length);
1694 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1695 unsigned int kanji, unsigned int underlined,
1696 int script, WMRulerMargins *margins);
1698 /* do NOT free the margins */
1699 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1700 unsigned int *kanji, unsigned int *underlined,
1701 int *script, WMRulerMargins *margins);
1703 int WMGetTextInsertType(WMText *tPtr);
1705 /*int WMGetTextBlocks(WMText *tPtr);
1707 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1709 int WMGetCurrentTextBlock(WMText *tPtr);*/
1711 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1713 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1715 void* WMRemoveTextBlock(WMText *tPtr);
1717 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1719 /* ....................................................................... */
1722 WMTabView* WMCreateTabView(WMWidget *parent);
1724 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1726 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1728 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1730 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1732 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1734 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1736 WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1737 int identifier, char *label);
1739 WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1741 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1743 void WMSelectLastTabViewItem(WMTabView *tPtr);
1745 void WMSelectNextTabViewItem(WMTabView *tPtr);
1747 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1749 WMTabViewItem* WMGetSelectedTabViewItem(WMTabView *tPtr);
1751 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1753 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1755 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1758 WMTabViewItem* WMCreateTabViewItemWithIdentifier(int identifier);
1760 void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
1762 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1764 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1766 char* WMGetTabViewItemLabel(WMTabViewItem *item);
1768 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1770 WMView* WMGetTabViewItemView(WMTabViewItem *item);
1772 void WMDestroyTabViewItem(WMTabViewItem *item);
1775 /* ....................................................................... */
1777 WMBox* WMCreateBox(WMWidget *parent);
1779 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1781 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1782 int minSize, int maxSize, int space);
1784 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1785 int minSize, int maxSize, int space);
1787 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1789 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1791 /* ....................................................................... */
1793 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1794 char *defaultButton, char *alternateButton,
1795 char *otherButton);
1797 /* you can free the returned string */
1798 char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1799 char *defaultText, char *okButton, char *cancelButton);
1801 WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1802 char *msg, char *defaultButton,
1803 char *alternateButton, char *otherButton);
1805 WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1806 char *msg, char *defaultText, char *okButton,
1807 char *cancelButton);
1810 WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
1811 char *title, char *defaultButton,
1812 char *alternateButton);
1814 void WMDestroyAlertPanel(WMAlertPanel *panel);
1816 void WMDestroyInputPanel(WMInputPanel *panel);
1818 void WMDestroyGenericPanel(WMGenericPanel *panel);
1820 /* ....................................................................... */
1822 WMImage *WMRetainImage(WMImage *image);
1823 void WMDestroyImage(WMImage *image);
1825 unsigned int WMGetImageWidth(WMImage *image);
1826 unsigned int WMGetImageHeight(WMImage *image);
1827 /* ....................................................................... */
1829 /* only 1 instance per WMScreen */
1830 WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
1832 WMSavePanel* WMGetSavePanel(WMScreen *scrPtr);
1834 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1836 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1838 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1840 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1842 /* you can free the returned string */
1843 char* WMGetFilePanelFileName(WMFilePanel *panel);
1845 void WMFreeFilePanel(WMFilePanel *panel);
1847 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1848 char *path, char *name, char **fileTypes);
1850 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1852 WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
1855 /* ...................................................................... */
1857 /* only 1 instance per WMScreen */
1858 WMFontPanel* WMGetFontPanel(WMScreen *scr);
1860 void WMShowFontPanel(WMFontPanel *panel);
1862 void WMHideFontPanel(WMFontPanel *panel);
1864 void WMFreeFontPanel(WMFontPanel *panel);
1866 void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
1868 void WMSetFontPanelFont(WMFontPanel *panel, char *fontName);
1870 WMFont* WMGetFontPanelFont(WMFontPanel *panel);
1872 #ifdef __cplusplus
1874 #endif /* __cplusplus */
1876 #endif