- Fixed a bug with empty frame titles (Alexey Voinov <voins@voins.program.ru>)
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blob70decbbd3e5bda0356dccb71249ed0ac2f0222db
3 #ifndef _WINGS_H_
4 #define _WINGS_H_
6 #include <wraster.h>
7 #include <WINGs/WUtil.h>
8 #include <X11/Xlib.h>
10 #define WINGS_H_VERSION 20021124
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;
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 /* Font flags */
111 typedef enum {
112 WFDefaultFont = 0,
113 WFNormalFont = (1<<0),
114 WFFontSet = (1<<1),
115 WFAntialiased = (1<<2),
116 WFNotAntialiased = (1<<3)
117 } WMFontFlags;
120 /* Use default system font size in system font name */
121 enum {
122 WFDefaultSize = -1
126 /* frame title positions */
127 typedef enum {
128 WTPNoTitle,
129 WTPAboveTop,
130 WTPAtTop,
131 WTPBelowTop,
132 WTPAboveBottom,
133 WTPAtBottom,
134 WTPBelowBottom
135 } WMTitlePosition;
138 /* relief types */
139 typedef enum {
140 WRFlat,
141 WRSimple,
142 WRRaised,
143 WRSunken,
144 WRGroove,
145 WRRidge,
146 WRPushed
147 } WMReliefType;
150 /* alignment types */
151 typedef enum {
152 WALeft,
153 WACenter,
154 WARight,
155 WAJustified /* not valid for textfields */
156 } WMAlignment;
159 /* image position */
160 typedef enum {
161 WIPNoImage,
162 WIPImageOnly,
163 WIPLeft,
164 WIPRight,
165 WIPBelow,
166 WIPAbove,
167 WIPOverlaps
168 } WMImagePosition;
171 /* scroller arrow position */
172 typedef enum {
173 WSAMaxEnd,
174 WSAMinEnd,
175 WSANone
176 } WMScrollArrowPosition;
178 /* scroller parts */
179 typedef enum {
180 WSNoPart,
181 WSDecrementPage,
182 WSIncrementPage,
183 WSDecrementLine,
184 WSIncrementLine,
185 WSDecrementWheel,
186 WSIncrementWheel,
187 WSKnob,
188 WSKnobSlot
189 } WMScrollerPart;
191 /* usable scroller parts */
192 typedef enum {
193 WSUNoParts,
194 WSUOnlyArrows,
195 WSUAllParts
196 } WMUsableScrollerParts;
198 /* matrix types */
199 typedef enum {
200 WMRadioMode,
201 WMHighlightMode,
202 WMListMode,
203 WMTrackMode
204 } WMMatrixTypes;
207 typedef enum {
208 WTTopTabsBevelBorder,
209 WTNoTabsBevelBorder,
210 WTNoTabsLineBorder,
211 WTNoTabsNoBorder
212 } WMTabViewType;
215 /* text movement types */
216 enum {
217 WMIllegalTextMovement,
218 WMReturnTextMovement,
219 WMEscapeTextMovement,
220 WMTabTextMovement,
221 WMBacktabTextMovement,
222 WMLeftTextMovement,
223 WMRightTextMovement,
224 WMUpTextMovement,
225 WMDownTextMovement
228 /* text field special events */
229 enum {
230 WMInsertTextEvent,
231 WMDeleteTextEvent
235 enum {
236 WLNotFound = -1 /* element was not found in WMList */
240 /* drag operations */
241 typedef enum {
242 WDOperationNone,
243 WDOperationCopy,
244 WDOperationMove,
245 WDOperationLink,
246 WDOperationAsk,
247 WDOperationPrivate
248 } WMDragOperationType;
251 typedef enum {
252 WMGrayModeColorPanel = 1,
253 WMRGBModeColorPanel = 2,
254 WMCMYKModeColorPanel = 3,
255 WMHSBModeColorPanel = 4,
256 WMCustomPaletteModeColorPanel = 5,
257 WMColorListModeColorPanel = 6,
258 WMWheelModeColorPanel = 7
259 } WMColorPanelMode;
263 /* system images */
264 #define WSIReturnArrow 1
265 #define WSIHighlightedReturnArrow 2
266 #define WSIScrollerDimple 3
267 #define WSIArrowLeft 4
268 #define WSIHighlightedArrowLeft 5
269 #define WSIArrowRight 6
270 #define WSIHighlightedArrowRight 7
271 #define WSIArrowUp 8
272 #define WSIHighlightedArrowUp 9
273 #define WSIArrowDown 10
274 #define WSIHighlightedArrowDown 11
275 #define WSICheckMark 12
277 enum {
278 WLDSSelected = (1 << 16),
279 WLDSDisabled = (1 << 17),
280 WLDSFocused = (1 << 18),
281 WLDSIsBranch = (1 << 19)
284 /* alert panel return values */
285 enum {
286 WAPRDefault = 0,
287 WAPRAlternate = 1,
288 WAPROther = -1,
289 WAPRError = -2
294 /* types of input observers */
295 enum {
296 WIReadMask = (1 << 0),
297 WIWriteMask = (1 << 1),
298 WIExceptMask = (1 << 2)
303 typedef int W_Class;
305 enum {
306 WC_Window = 0,
307 WC_Frame = 1,
308 WC_Label = 2,
309 WC_Button = 3,
310 WC_TextField = 4,
311 WC_Scroller = 5,
312 WC_ScrollView = 6,
313 WC_List = 7,
314 WC_Browser = 8,
315 WC_PopUpButton = 9,
316 WC_ColorWell = 10,
317 WC_Slider = 11,
318 WC_Matrix = 12, /* not ready */
319 WC_SplitView = 13,
320 WC_TabView = 14,
321 WC_ProgressIndicator = 15,
322 WC_MenuView = 16,
323 WC_Ruler = 17,
324 WC_Text = 18,
325 WC_Box = 19
328 /* All widgets must start with the following structure
329 * in that order. Used for typecasting to get some generic data */
330 typedef struct W_WidgetType {
331 W_Class widgetClass;
332 struct W_View *view;
334 } W_WidgetType;
337 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
338 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
341 /* widgets */
343 typedef void WMWidget;
345 typedef struct W_Pixmap WMPixmap;
346 typedef struct W_Font WMFont;
347 typedef struct W_Color WMColor;
349 typedef struct W_Screen WMScreen;
351 typedef struct W_View WMView;
353 typedef struct W_Window WMWindow;
354 typedef struct W_Frame WMFrame;
355 typedef struct W_Button WMButton;
356 typedef struct W_Label WMLabel;
357 typedef struct W_TextField WMTextField;
358 typedef struct W_Scroller WMScroller;
359 typedef struct W_ScrollView WMScrollView;
360 typedef struct W_List WMList;
361 typedef struct W_Browser WMBrowser;
362 typedef struct W_PopUpButton WMPopUpButton;
363 typedef struct W_ProgressIndicator WMProgressIndicator;
364 typedef struct W_ColorWell WMColorWell;
365 typedef struct W_Slider WMSlider;
366 typedef struct W_Matrix WMMatrix; /* not ready */
367 typedef struct W_SplitView WMSplitView;
368 typedef struct W_TabView WMTabView;
369 typedef struct W_Ruler WMRuler;
370 typedef struct W_Text WMText;
371 typedef struct W_Box WMBox;
374 /* not widgets */
375 typedef struct W_TabViewItem WMTabViewItem;
376 typedef struct W_MenuItem WMMenuItem;
379 typedef struct W_FilePanel WMFilePanel;
380 typedef WMFilePanel WMOpenPanel;
381 typedef WMFilePanel WMSavePanel;
383 typedef struct W_FontPanel WMFontPanel;
385 typedef struct W_ColorPanel WMColorPanel;
388 /* item for WMList */
389 typedef struct WMListItem {
390 char *text;
391 void *clientData; /* ptr for user clientdata. */
393 unsigned int uflags:16; /* flags for the user */
394 unsigned int selected:1;
395 unsigned int disabled:1;
396 unsigned int isBranch:1;
397 unsigned int loaded:1;
398 } WMListItem;
400 /* struct for message panel */
401 typedef struct WMAlertPanel {
402 WMWindow *win; /* window */
403 WMBox *vbox;
404 WMBox *hbox;
405 WMButton *defBtn; /* default button */
406 WMButton *altBtn; /* alternative button */
407 WMButton *othBtn; /* other button */
408 WMLabel *iLbl; /* icon label */
409 WMLabel *tLbl; /* title label */
410 WMLabel *mLbl; /* message label */
411 WMFrame *line; /* separator */
412 short result; /* button that was pushed */
413 } WMAlertPanel;
416 typedef struct WMGenericPanel {
417 WMWindow *win;
418 WMBox *vbox;
420 WMLabel *iLbl;
421 WMLabel *tLbl;
423 WMFrame *line;
425 WMFrame *content;
427 WMBox *buttonBox;
428 WMButton *defBtn;
429 WMButton *altBtn;
431 short result;
432 } WMGenericPanel;
435 typedef struct WMInputPanel {
436 WMWindow *win; /* window */
437 WMButton *defBtn; /* default button */
438 WMButton *altBtn; /* alternative button */
439 WMLabel *tLbl; /* title label */
440 WMLabel *mLbl; /* message label */
441 WMTextField *text; /* text field */
442 short result; /* button that was pushed */
443 } WMInputPanel;
447 #define WFAUnchanged (NULL)
448 /* Struct for font change operations */
449 typedef struct WMFontAttributes {
450 char *foundry;
451 char *family;
452 char *weight;
453 char *slant;
454 char *setWidth;
455 char *addStyle;
456 char *pixelSize;
457 char *pointSize;
458 char *resolutionX;
459 char *resolutionY;
460 char *spacing;
461 char *averageWidth;
462 char *registry;
463 char *encoding;
464 } WMFontAttributes;
466 /* A few useful constant font attributes masks */
467 extern const WMFontAttributes *WFANormal;
468 extern const WMFontAttributes *WFABold;
469 extern const WMFontAttributes *WFANotBold;
470 extern const WMFontAttributes *WFAEmphasized;
471 extern const WMFontAttributes *WFANotEmphasized;
472 extern const WMFontAttributes *WFABoldEmphasized;
475 /* WMRuler: */
476 typedef struct {
477 WMArray *tabs; /* a growable array of tabstops */
478 unsigned short left; /* left margin marker */
479 unsigned short right; /* right margin marker */
480 unsigned short first; /* indentation marker for first line only */
481 unsigned short body; /* body indentation marker */
482 unsigned short retainCount;
483 } WMRulerMargins;
484 /* All indentation and tab markers are _relative_ to the left margin marker */
487 typedef void WMEventProc(XEvent *event, void *clientData);
489 typedef void WMEventHook(XEvent *event);
491 /* self is set to the widget from where the callback is being called and
492 * clientData to the data set to with WMSetClientData() */
493 typedef void WMAction(WMWidget *self, void *clientData);
495 /* same as WMAction, but for stuff that arent widgets */
496 typedef void WMAction2(void *self, void *clientData);
499 typedef void WMDropDataCallback(WMView *view, WMData *data);
501 /* delegate method like stuff */
502 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
503 int state, WMRect *rect);
506 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
507 unsigned int oldWidth,
508 unsigned int oldHeight);
511 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
512 int *minSize, int *maxSize);
514 typedef WMWidget* WMMatrixCreateCellProc(WMMatrix *mPtr);
519 typedef struct WMBrowserDelegate {
520 void *data;
522 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
523 WMBrowser *sender, int column, WMList *list);
525 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
526 int column);
528 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
530 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
531 } WMBrowserDelegate;
534 typedef struct WMTextFieldDelegate {
535 void *data;
537 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
538 WMNotification *notif);
540 void (*didChange)(struct WMTextFieldDelegate *self,
541 WMNotification *notif);
543 void (*didEndEditing)(struct WMTextFieldDelegate *self,
544 WMNotification *notif);
546 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
547 WMTextField *tPtr);
549 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
550 WMTextField *tPtr);
551 } WMTextFieldDelegate;
554 typedef struct WMTextDelegate {
555 void *data;
557 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
558 void *description);
560 } WMTextDelegate;
564 typedef struct WMTabViewDelegate {
565 void *data;
567 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
568 WMTabView *tabView);
570 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
571 WMTabViewItem *item);
573 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
574 WMTabViewItem *item);
576 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
577 WMTabViewItem *item);
578 } WMTabViewDelegate;
583 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
584 Time timestamp, void *cdata, WMData *data);
587 typedef struct WMSelectionProcs {
588 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
589 void *cdata, Atom *type);
590 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
591 void (*selectionDone)(WMView *view, Atom selection, Atom target,
592 void *cdata);
593 } WMSelectionProcs;
596 typedef struct W_DraggingInfo WMDraggingInfo;
599 typedef struct W_DragSourceProcs {
600 unsigned (*draggingSourceOperation)(WMView *self, Bool local);
601 void (*beganDragImage)(WMView *self, WMPixmap *image, WMPoint point);
602 void (*endedDragImage)(WMView *self, WMPixmap *image, WMPoint point,
603 Bool deposited);
604 WMData* (*fetchDragData)(WMView *self, char *type);
605 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
606 } WMDragSourceProcs;
610 typedef struct W_DragDestinationProcs {
611 unsigned (*draggingEntered)(WMView *self, WMDraggingInfo *info);
612 unsigned (*draggingUpdated)(WMView *self, WMDraggingInfo *info);
613 void (*draggingExited)(WMView *self, WMDraggingInfo *info);
614 Bool (*prepareForDragOperation)(WMView *self, WMDraggingInfo *info);
615 Bool (*performDragOperation)(WMView *self, WMDraggingInfo *info);
616 void (*concludeDragOperation)(WMView *self, WMDraggingInfo *info);
617 } WMDragDestinationProcs;
621 /* ...................................................................... */
624 WMPoint wmkpoint(int x, int y);
626 WMSize wmksize(unsigned int width, unsigned int height);
628 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
629 #define wmksize(width, height) (WMSize){(width), (height)}
630 #define wmkpoint(x, y) (WMPoint){(x), (y)}
631 #endif
633 /* ....................................................................... */
637 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
639 void WMSetResourcePath(char *path);
641 /* don't free the returned string */
642 char* WMGetApplicationName();
644 /* Try to locate resource file. ext may be NULL */
645 char* WMPathForResourceOfType(char *resource, char *ext);
648 WMScreen* WMOpenScreen(const char *display);
650 WMScreen* WMCreateScreenWithRContext(Display *display, int screen,
651 RContext *context);
653 WMScreen* WMCreateScreen(Display *display, int screen);
655 WMScreen* WMCreateSimpleApplicationScreen(Display *display);
657 void WMScreenMainLoop(WMScreen *scr);
659 void WMBreakModalLoop(WMScreen *scr);
661 void WMRunModalLoop(WMScreen *scr, WMView *view);
663 RContext* WMScreenRContext(WMScreen *scr);
665 Display* WMScreenDisplay(WMScreen *scr);
667 int WMScreenDepth(WMScreen *scr);
671 void WMSetApplicationIconImage(WMScreen *app, RImage *image);
673 RImage* WMGetApplicationIconImage(WMScreen *app);
675 void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
677 WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
679 /* If color==NULL it will use the default color for panels: ae/aa/ae */
680 WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
682 void WMSetApplicationIconWindow(WMScreen *scr, Window window);
684 void WMSetFocusToWidget(WMWidget *widget);
686 WMEventHook* WMHookEventHandler(WMEventHook *handler);
688 int WMHandleEvent(XEvent *event);
690 Bool WMScreenPending(WMScreen *scr);
692 void WMCreateEventHandler(WMView *view, unsigned long mask,
693 WMEventProc *eventProc, void *clientData);
695 void WMDeleteEventHandler(WMView *view, unsigned long mask,
696 WMEventProc *eventProc, void *clientData);
698 int WMIsDoubleClick(XEvent *event);
700 /*int WMIsTripleClick(XEvent *event);*/
702 void WMNextEvent(Display *dpy, XEvent *event);
704 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
707 /* ....................................................................... */
710 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
711 WMSelectionProcs *procs, void *cdata);
713 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
715 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
716 Time timestamp, WMSelectionCallback *callback,
717 void *cdata);
720 extern char *WMSelectionOwnerDidChangeNotification;
722 /* ....................................................................... */
724 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
726 void WMDragImageFromView(WMView *view, WMPixmap *image, char *dataTypes[],
727 WMPoint atLocation, WMSize mouseOffset, XEvent *event,
728 Bool slideBack);
730 void WMRegisterViewForDraggedTypes(WMView *view, char *acceptedTypes[]);
732 void WMUnregisterViewDraggedTypes(WMView *view);
734 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
737 WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info);
739 /* ....................................................................... */
741 Bool WMHasAntialiasingSupport(WMScreen *scrPtr);
743 Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
745 /* ....................................................................... */
747 WMFont* WMCreateNormalFont(WMScreen *scrPtr, char *fontName);
749 WMFont* WMCreateFontSet(WMScreen *scrPtr, char *fontName);
751 WMFont* WMCreateAntialiasedFont(WMScreen *scrPtr, char *fontName);
753 WMFont* WMCreateAntialiasedFontSet(WMScreen *scrPtr, char *fontName);
755 WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
757 WMFont* WMCreateFontWithFlags(WMScreen *scrPtr, char *fontName,
758 WMFontFlags flags);
760 WMFont* WMCopyFontWithChanges(WMScreen *scrPtr, WMFont *font,
761 const WMFontAttributes *changes);
763 WMFont* WMRetainFont(WMFont *font);
765 void WMReleaseFont(WMFont *font);
767 unsigned int WMFontHeight(WMFont *font);
769 Bool WMIsAntialiasedFont(WMFont *font);
772 WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
774 WMFont* WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
778 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
780 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
782 WMFont* WMDefaultSystemFont(WMScreen *scrPtr);
784 WMFont* WMDefaultBoldSystemFont(WMScreen *scrPtr);
786 WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
788 WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
790 XFontSet WMGetFontFontSet(WMFont *font);
792 /* ....................................................................... */
794 WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
796 void WMReleasePixmap(WMPixmap *pixmap);
798 WMPixmap* WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
799 Bool masked);
801 WMPixmap* WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
802 Pixmap mask, int width, int height,
803 int depth);
805 WMPixmap* WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
806 int threshold);
808 WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
810 WMSize WMGetPixmapSize(WMPixmap *pixmap);
812 WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
814 WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
815 RColor *color);
817 WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
818 RColor *color);
820 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
822 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
824 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
826 WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
828 /* ....................................................................... */
831 WMColor* WMDarkGrayColor(WMScreen *scr);
833 WMColor* WMGrayColor(WMScreen *scr);
835 WMColor* WMBlackColor(WMScreen *scr);
837 WMColor* WMWhiteColor(WMScreen *scr);
839 void WMSetColorInGC(WMColor *color, GC gc);
841 GC WMColorGC(WMColor *color);
843 WMPixel WMColorPixel(WMColor *color);
845 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
846 unsigned int width, unsigned int height);
848 void WMReleaseColor(WMColor *color);
850 WMColor* WMRetainColor(WMColor *color);
852 WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
853 unsigned short green, unsigned short blue,
854 Bool exact);
856 WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
857 unsigned short green, unsigned short blue,
858 unsigned short alpha, Bool exact);
860 WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
862 void WMSetColorAlpha(WMColor *color, unsigned short alpha);
864 unsigned short WMRedComponentOfColor(WMColor *color);
866 unsigned short WMGreenComponentOfColor(WMColor *color);
868 unsigned short WMBlueComponentOfColor(WMColor *color);
870 unsigned short WMGetColorAlpha(WMColor *color);
872 char* WMGetColorRGBDescription(WMColor *color);
874 /* ....................................................................... */
877 void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
878 int x, int y, char *text, int length);
880 void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
881 WMColor *background, WMFont *font, int x, int y,
882 char *text, int length);
884 int WMWidthOfString(WMFont *font, char *text, int length);
888 /* ....................................................................... */
890 WMScreen* WMWidgetScreen(WMWidget *w);
892 unsigned int WMScreenWidth(WMScreen *scr);
894 unsigned int WMScreenHeight(WMScreen *scr);
896 void WMUnmapWidget(WMWidget *w);
898 void WMMapWidget(WMWidget *w);
900 Bool WMWidgetIsMapped(WMWidget *w);
902 void WMRaiseWidget(WMWidget *w);
904 void WMLowerWidget(WMWidget *w);
906 void WMMoveWidget(WMWidget *w, int x, int y);
908 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
910 void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
912 WMColor* WMGetWidgetBackgroundColor(WMWidget *w);
914 void WMMapSubwidgets(WMWidget *w);
916 void WMUnmapSubwidgets(WMWidget *w);
918 void WMRealizeWidget(WMWidget *w);
920 void WMReparentWidget(WMWidget *w, WMWidget *newParent, int x, int y);
922 void WMDestroyWidget(WMWidget *widget);
924 void WMHangData(WMWidget *widget, void *data);
926 void* WMGetHangedData(WMWidget *widget);
928 unsigned int WMWidgetWidth(WMWidget *w);
930 unsigned int WMWidgetHeight(WMWidget *w);
932 Window WMWidgetXID(WMWidget *w);
934 Window WMViewXID(WMView *view);
936 void WMRedisplayWidget(WMWidget *w);
938 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
940 void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
941 int rightOffs, int bottomOffs);
943 WMSize WMGetViewSize(WMView *view);
945 WMPoint WMGetViewPosition(WMView *view);
947 WMPoint WMGetViewScreenPosition(WMView *view);
949 WMWidget* WMWidgetOfView(WMView *view);
951 void WMSetViewNextResponder(WMView *view, WMView *responder);
953 void WMRelayToNextResponder(WMView *view, XEvent *event);
955 /* notifications */
956 extern char *WMViewSizeDidChangeNotification;
958 extern char *WMViewFocusDidChangeNotification;
960 extern char *WMViewRealizedNotification;
963 /* ....................................................................... */
965 void WMSetBalloonTextForView(char *text, WMView *view);
967 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
969 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
971 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
973 void WMSetBalloonDelay(WMScreen *scr, int delay);
975 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
978 /* ....................................................................... */
980 WMWindow* WMCreateWindow(WMScreen *screen, char *name);
982 WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
984 WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
985 int style);
987 WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
989 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
991 void WMSetWindowTitle(WMWindow *wPtr, char *title);
993 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
995 void WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap);
997 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
999 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
1001 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
1003 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
1004 int maxX, int maxY);
1006 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
1008 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
1010 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
1012 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
1014 void WMSetWindowLevel(WMWindow *win, int level);
1016 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
1018 void WMCloseWindow(WMWindow *win);
1020 /* ....................................................................... */
1022 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
1024 #define WMCreateCommandButton(parent) \
1025 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1026 |WBBPushInMask\
1027 |WBBPushLightMask\
1028 |WBBPushChangeMask)
1030 #define WMCreateRadioButton(parent) \
1031 WMCreateButton((parent), WBTRadio)
1033 #define WMCreateSwitchButton(parent) \
1034 WMCreateButton((parent), WBTSwitch)
1036 WMButton* WMCreateButton(WMWidget *parent, WMButtonType type);
1038 WMButton* WMCreateCustomButton(WMWidget *parent, int behaviourMask);
1040 void WMSetButtonImageDefault(WMButton *bPtr);
1042 void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
1044 void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
1046 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
1048 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
1050 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
1052 void WMSetButtonText(WMButton *bPtr, char *text);
1054 void WMSetButtonAltText(WMButton *bPtr, char *text);
1056 void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
1058 void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
1060 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
1062 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
1064 int WMGetButtonSelected(WMButton *bPtr);
1066 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
1068 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
1070 int WMGetButtonEnabled(WMButton *bPtr);
1072 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
1074 void WMSetButtonTag(WMButton *bPtr, int tag);
1076 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
1078 void WMPerformButtonClick(WMButton *bPtr);
1080 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
1082 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
1084 /* ....................................................................... */
1086 WMLabel* WMCreateLabel(WMWidget *parent);
1088 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1090 void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
1092 WMPixmap* WMGetLabelImage(WMLabel *lPtr);
1094 char* WMGetLabelText(WMLabel *lPtr);
1096 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1098 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1100 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1102 void WMSetLabelText(WMLabel *lPtr, char *text);
1104 WMFont* WMGetLabelFont(WMLabel *lPtr);
1106 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1108 void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
1110 /* ....................................................................... */
1112 WMFrame* WMCreateFrame(WMWidget *parent);
1114 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1116 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1118 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1120 /* ....................................................................... */
1122 WMTextField* WMCreateTextField(WMWidget *parent);
1124 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1126 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1128 /* you can free the returned string */
1129 char* WMGetTextFieldText(WMTextField *tPtr);
1131 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1133 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1135 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1137 WMFont* WMGetTextFieldFont(WMTextField *tPtr);
1139 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1141 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1143 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1145 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1147 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1149 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1151 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1153 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1155 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1157 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1159 WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
1161 extern char *WMTextDidChangeNotification;
1162 extern char *WMTextDidBeginEditingNotification;
1163 extern char *WMTextDidEndEditingNotification;
1165 /* ....................................................................... */
1167 WMScroller* WMCreateScroller(WMWidget *parent);
1169 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1170 float knobProportion);
1172 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1174 float WMGetScrollerValue(WMScroller *sPtr);
1176 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1178 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1180 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1181 WMScrollArrowPosition position);
1183 extern char *WMScrollerDidScrollNotification;
1185 /* ....................................................................... */
1187 WMList* WMCreateList(WMWidget *parent);
1189 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1191 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1193 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1195 WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
1197 void WMSortListItems(WMList *lPtr);
1199 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1201 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1203 WMListItem* WMGetListItem(WMList *lPtr, int row);
1205 WMArray* WMGetListItems(WMList *lPtr);
1207 void WMRemoveListItem(WMList *lPtr, int row);
1209 void WMSelectListItem(WMList *lPtr, int row);
1211 void WMUnselectListItem(WMList *lPtr, int row);
1213 /* This will select all items in range, and deselect all the others */
1214 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1216 /* This will select all items in range, leaving the others as they are */
1217 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1219 void WMSelectAllListItems(WMList *lPtr);
1221 void WMUnselectAllListItems(WMList *lPtr);
1223 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1225 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1227 int WMGetListItemHeight(WMList *lPtr);
1229 /* don't free the returned data */
1230 WMArray* WMGetListSelectedItems(WMList *lPtr);
1233 * For the following 2 functions, in case WMList allows multiple selection,
1234 * the first item in the list of selected items, respective its row number,
1235 * will be returned.
1238 /* don't free the returned data */
1239 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1241 int WMGetListSelectedItemRow(WMList *lPtr);
1243 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1245 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1247 void WMClearList(WMList *lPtr);
1249 int WMGetListNumberOfRows(WMList *lPtr);
1251 void WMSetListPosition(WMList *lPtr, int row);
1253 void WMSetListBottomPosition(WMList *lPtr, int row);
1255 int WMGetListPosition(WMList *lPtr);
1257 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1259 Bool WMListAllowsEmptySelection(WMList *lPtr);
1262 extern char *WMListDidScrollNotification;
1263 extern char *WMListSelectionDidChangeNotification;
1265 /* ....................................................................... */
1267 WMBrowser* WMCreateBrowser(WMWidget *parent);
1269 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1271 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1273 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1275 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1277 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1279 int WMAddBrowserColumn(WMBrowser *bPtr);
1281 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1283 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1285 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1287 WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1289 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1291 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1292 WMCompareDataProc *func);
1294 /* Don't free the returned string. */
1295 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1297 /* free the returned string */
1298 char* WMGetBrowserPath(WMBrowser *bPtr);
1300 /* free the returned string */
1301 char* WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1303 /* free the returned array */
1304 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1306 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1308 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1309 void *clientData);
1311 WMListItem* WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1313 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1315 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1317 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1319 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1321 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1323 WMList* WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1325 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1327 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1329 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1331 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1333 /* ....................................................................... */
1336 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1338 WMMenuItem* WMCreateMenuItem(void);
1340 void WMDestroyMenuItem(WMMenuItem *item);
1342 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1344 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1346 char* WMGetMenuItemShortcut(WMMenuItem *item);
1348 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1350 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1352 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1354 void* WMGetMenuItemRepresentedObject(WMMenuItem *item);
1356 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1358 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1360 WMAction* WMGetMenuItemAction(WMMenuItem *item);
1362 void* WMGetMenuItemData(WMMenuItem *item);
1364 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1366 char* WMGetMenuItemTitle(WMMenuItem *item);
1368 void WMSetMenuItemState(WMMenuItem *item, int state);
1370 int WMGetMenuItemState(WMMenuItem *item);
1372 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1374 WMPixmap* WMGetMenuItemPixmap(WMMenuItem *item);
1376 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1378 WMPixmap* WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1380 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1382 WMPixmap* WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1384 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1386 WMPixmap* WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1388 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1391 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1393 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1396 /* ....................................................................... */
1398 WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
1400 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1401 void *clientData);
1403 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1405 WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1407 WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1408 char *title);
1410 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1412 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1414 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1416 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1418 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1420 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1422 /* don't free the returned data */
1423 char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1425 WMMenuItem* WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1428 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1430 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1432 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1434 /* ....................................................................... */
1436 WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
1438 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1440 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1442 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1444 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1446 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1448 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1451 /* ....................................................................... */
1453 WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
1455 void WMFreeColorPanel(WMColorPanel *panel);
1457 void WMShowColorPanel(WMColorPanel *panel);
1459 void WMCloseColorPanel(WMColorPanel *panel);
1461 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1463 WMColor* WMGetColorPanelColor(WMColorPanel *panel);
1465 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1467 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1469 extern char *WMColorPanelColorChangedNotification;
1471 /* ....................................................................... */
1473 WMColorWell* WMCreateColorWell(WMWidget *parent);
1475 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1477 WMColor* WMGetColorWellColor(WMColorWell *cPtr);
1479 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1482 extern char *WMColorWellDidChangeNotification;
1485 /* ...................................................................... */
1487 WMScrollView* WMCreateScrollView(WMWidget *parent);
1489 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1490 unsigned int height);
1492 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1494 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1496 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1498 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1500 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1502 WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1504 WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1506 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1508 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1510 /* ....................................................................... */
1512 WMSlider* WMCreateSlider(WMWidget *parent);
1514 int WMGetSliderMinValue(WMSlider *slider);
1516 int WMGetSliderMaxValue(WMSlider *slider);
1518 int WMGetSliderValue(WMSlider *slider);
1520 void WMSetSliderMinValue(WMSlider *slider, int value);
1522 void WMSetSliderMaxValue(WMSlider *slider, int value);
1524 void WMSetSliderValue(WMSlider *slider, int value);
1526 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1528 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1530 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1532 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1534 /* ....................................................................... */
1537 WMSplitView* WMCreateSplitView(WMWidget *parent);
1539 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1541 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1543 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1545 WMView* WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1547 /* remove the first subview == view */
1548 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1550 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1553 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1555 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1557 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1558 WMSplitViewConstrainProc *proc);
1561 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1562 WMSplitViewResizeSubviewsProc *proc);
1565 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1567 /* ...................................................................... */
1569 WMRuler* WMCreateRuler (WMWidget *parent);
1571 WMRulerMargins* WMGetRulerMargins(WMRuler *rPtr);
1573 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1575 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin);
1577 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1579 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1581 int WMGetRulerOffset(WMRuler *rPtr);
1583 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1585 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1587 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1589 /* ....................................................................... */
1592 #define WMCreateText(parent) WMCreateTextForDocumentType \
1593 ((parent), (NULL), (NULL))
1595 WMText* WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser,
1596 WMAction *writer);
1598 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1600 void WMFreezeText(WMText *tPtr);
1602 #define WMRefreshText(tPtr) WMThawText((tPtr))
1604 void WMThawText(WMText *tPtr);
1606 int WMScrollText(WMText *tPtr, int amount);
1608 int WMPageText(WMText *tPtr, Bool direction);
1610 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1612 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1614 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1616 void WMShowTextRuler(WMText *tPtr, Bool show);
1618 int WMGetTextRulerShown(WMText *tPtr);
1620 void WMSetTextEditable(WMText *tPtr, Bool editable);
1622 int WMGetTextEditable(WMText *tPtr);
1624 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1626 int WMGetTextUsesMonoFont(WMText *tPtr);
1628 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1630 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1632 int WMGetTextIgnoresNewline(WMText *tPtr);
1634 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1636 WMFont* WMGetTextDefaultFont(WMText *tPtr);
1638 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1640 WMColor* WMGetTextDefaultColor(WMText *tPtr);
1642 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1644 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1646 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1648 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1650 void WMPrependTextStream(WMText *tPtr, char *text);
1652 void WMAppendTextStream(WMText *tPtr, char *text);
1654 #define WMClearText(tPtr) WMAppendTextStream \
1655 ((tPtr), (NULL))
1657 /* free the text */
1658 char* WMGetTextStream(WMText *tPtr);
1660 /* free the text */
1661 char* WMGetTextSelectedStream(WMText *tPtr);
1663 /* destroy the array */
1664 WMArray* WMGetTextObjects(WMText *tPtr);
1666 /* destroy the array */
1667 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1669 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1671 WMColor* WMGetTextSelectionColor(WMText *tPtr);
1673 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1675 WMFont* WMGetTextSelectionFont(WMText *tPtr);
1677 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1679 int WMGetTextSelectionUnderlined(WMText *tPtr);
1681 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1683 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1684 Bool caseSensitive);
1686 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1689 /* parser related stuff... use only if implementing a new parser */
1691 void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1692 WMColor *color, unsigned short first,
1693 unsigned short extraInfo);
1695 void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1696 WMColor *color, unsigned short first,
1697 unsigned short extraInfo);
1699 void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1700 WMColor *color, unsigned short first,
1701 unsigned short length);
1703 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1704 unsigned int kanji, unsigned int underlined,
1705 int script, WMRulerMargins *margins);
1707 /* do NOT free the margins */
1708 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1709 unsigned int *kanji, unsigned int *underlined,
1710 int *script, WMRulerMargins *margins);
1712 int WMGetTextInsertType(WMText *tPtr);
1714 /*int WMGetTextBlocks(WMText *tPtr);
1716 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1718 int WMGetCurrentTextBlock(WMText *tPtr);*/
1720 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1722 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1724 void* WMRemoveTextBlock(WMText *tPtr);
1726 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1728 /* ....................................................................... */
1731 WMTabView* WMCreateTabView(WMWidget *parent);
1733 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1735 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1737 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1739 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1741 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1743 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1745 WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1746 int identifier, char *label);
1748 WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1750 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1752 void WMSelectLastTabViewItem(WMTabView *tPtr);
1754 void WMSelectNextTabViewItem(WMTabView *tPtr);
1756 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1758 WMTabViewItem* WMGetSelectedTabViewItem(WMTabView *tPtr);
1760 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1762 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1764 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1767 WMTabViewItem* WMCreateTabViewItemWithIdentifier(int identifier);
1769 void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
1771 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1773 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1775 char* WMGetTabViewItemLabel(WMTabViewItem *item);
1777 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1779 WMView* WMGetTabViewItemView(WMTabViewItem *item);
1781 void WMDestroyTabViewItem(WMTabViewItem *item);
1784 /* ....................................................................... */
1786 WMBox* WMCreateBox(WMWidget *parent);
1788 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1790 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1791 int minSize, int maxSize, int space);
1793 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1794 int minSize, int maxSize, int space);
1796 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1798 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1800 /* ....................................................................... */
1802 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1803 char *defaultButton, char *alternateButton,
1804 char *otherButton);
1806 /* you can free the returned string */
1807 char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1808 char *defaultText, char *okButton, char *cancelButton);
1810 WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1811 char *msg, char *defaultButton,
1812 char *alternateButton, char *otherButton);
1814 WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1815 char *msg, char *defaultText, char *okButton,
1816 char *cancelButton);
1819 WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
1820 char *title, char *defaultButton,
1821 char *alternateButton);
1823 void WMDestroyAlertPanel(WMAlertPanel *panel);
1825 void WMDestroyInputPanel(WMInputPanel *panel);
1827 void WMDestroyGenericPanel(WMGenericPanel *panel);
1829 /* ....................................................................... */
1831 /* only 1 instance per WMScreen */
1832 WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
1834 WMSavePanel* WMGetSavePanel(WMScreen *scrPtr);
1836 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1838 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1840 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1842 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1844 /* you can free the returned string */
1845 char* WMGetFilePanelFileName(WMFilePanel *panel);
1847 void WMFreeFilePanel(WMFilePanel *panel);
1849 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1850 char *path, char *name, char **fileTypes);
1852 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1854 WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
1857 /* ...................................................................... */
1859 /* only 1 instance per WMScreen */
1860 WMFontPanel* WMGetFontPanel(WMScreen *scr);
1862 void WMShowFontPanel(WMFontPanel *panel);
1864 void WMHideFontPanel(WMFontPanel *panel);
1866 void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
1868 /* you can free the returned string */
1869 char* WMGetFontPanelFontName(WMFontPanel *panel);
1871 WMFont* WMGetFontPanelFont(WMFontPanel *panel);
1873 #ifdef __cplusplus
1875 #endif /* __cplusplus */
1877 #endif