Started to move towards using xft2 only, for a unified font/locale handling
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blob7e0e2ed4b9aced4fe2a0ae51ddb9b53c4102bb8a
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 /* 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,
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 /* widgets */
327 typedef void WMWidget;
329 typedef struct W_Pixmap WMPixmap;
330 typedef struct W_Font WMFont;
331 typedef struct W_Color WMColor;
333 typedef struct W_Screen WMScreen;
335 typedef struct W_View WMView;
337 typedef struct W_Window WMWindow;
338 typedef struct W_Frame WMFrame;
339 typedef struct W_Button WMButton;
340 typedef struct W_Label WMLabel;
341 typedef struct W_TextField WMTextField;
342 typedef struct W_Scroller WMScroller;
343 typedef struct W_ScrollView WMScrollView;
344 typedef struct W_List WMList;
345 typedef struct W_Browser WMBrowser;
346 typedef struct W_PopUpButton WMPopUpButton;
347 typedef struct W_ProgressIndicator WMProgressIndicator;
348 typedef struct W_ColorWell WMColorWell;
349 typedef struct W_Slider WMSlider;
350 typedef struct W_Matrix WMMatrix; /* not ready */
351 typedef struct W_SplitView WMSplitView;
352 typedef struct W_TabView WMTabView;
353 typedef struct W_Ruler WMRuler;
354 typedef struct W_Text WMText;
355 typedef struct W_Box WMBox;
358 /* not widgets */
359 typedef struct W_TabViewItem WMTabViewItem;
360 typedef struct W_MenuItem WMMenuItem;
363 typedef struct W_FilePanel WMFilePanel;
364 typedef WMFilePanel WMOpenPanel;
365 typedef WMFilePanel WMSavePanel;
367 typedef struct W_FontPanel WMFontPanel;
369 typedef struct W_ColorPanel WMColorPanel;
372 /* item for WMList */
373 typedef struct WMListItem {
374 char *text;
375 void *clientData; /* ptr for user clientdata. */
377 unsigned int uflags:16; /* flags for the user */
378 unsigned int selected:1;
379 unsigned int disabled:1;
380 unsigned int isBranch:1;
381 unsigned int loaded:1;
382 } WMListItem;
384 /* struct for message panel */
385 typedef struct WMAlertPanel {
386 WMWindow *win; /* window */
387 WMBox *vbox;
388 WMBox *hbox;
389 WMButton *defBtn; /* default button */
390 WMButton *altBtn; /* alternative button */
391 WMButton *othBtn; /* other button */
392 WMLabel *iLbl; /* icon label */
393 WMLabel *tLbl; /* title label */
394 WMLabel *mLbl; /* message label */
395 WMFrame *line; /* separator */
396 short result; /* button that was pushed */
397 } WMAlertPanel;
400 typedef struct WMGenericPanel {
401 WMWindow *win;
402 WMBox *vbox;
404 WMLabel *iLbl;
405 WMLabel *tLbl;
407 WMFrame *line;
409 WMFrame *content;
411 WMBox *buttonBox;
412 WMButton *defBtn;
413 WMButton *altBtn;
415 short result;
416 } WMGenericPanel;
419 typedef struct WMInputPanel {
420 WMWindow *win; /* window */
421 WMButton *defBtn; /* default button */
422 WMButton *altBtn; /* alternative button */
423 WMLabel *tLbl; /* title label */
424 WMLabel *mLbl; /* message label */
425 WMTextField *text; /* text field */
426 short result; /* button that was pushed */
427 } WMInputPanel;
431 #define WFAUnchanged (NULL)
432 /* Struct for font change operations */
433 typedef struct WMFontAttributes {
434 char *foundry;
435 char *family;
436 char *weight;
437 char *slant;
438 char *setWidth;
439 char *addStyle;
440 char *pixelSize;
441 char *pointSize;
442 char *resolutionX;
443 char *resolutionY;
444 char *spacing;
445 char *averageWidth;
446 char *registry;
447 char *encoding;
448 } WMFontAttributes;
450 /* A few useful constant font attributes masks */
451 extern const WMFontAttributes *WFANormal;
452 extern const WMFontAttributes *WFABold;
453 extern const WMFontAttributes *WFANotBold;
454 extern const WMFontAttributes *WFAEmphasized;
455 extern const WMFontAttributes *WFANotEmphasized;
456 extern const WMFontAttributes *WFABoldEmphasized;
459 /* WMRuler: */
460 typedef struct {
461 WMArray *tabs; /* a growable array of tabstops */
462 unsigned short left; /* left margin marker */
463 unsigned short right; /* right margin marker */
464 unsigned short first; /* indentation marker for first line only */
465 unsigned short body; /* body indentation marker */
466 unsigned short retainCount;
467 } WMRulerMargins;
468 /* All indentation and tab markers are _relative_ to the left margin marker */
471 typedef void WMEventProc(XEvent *event, void *clientData);
473 typedef void WMEventHook(XEvent *event);
475 /* self is set to the widget from where the callback is being called and
476 * clientData to the data set to with WMSetClientData() */
477 typedef void WMAction(WMWidget *self, void *clientData);
479 /* same as WMAction, but for stuff that arent widgets */
480 typedef void WMAction2(void *self, void *clientData);
483 typedef void WMDropDataCallback(WMView *view, WMData *data);
485 /* delegate method like stuff */
486 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
487 int state, WMRect *rect);
490 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
491 unsigned int oldWidth,
492 unsigned int oldHeight);
495 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
496 int *minSize, int *maxSize);
498 typedef WMWidget* WMMatrixCreateCellProc(WMMatrix *mPtr);
503 typedef struct WMBrowserDelegate {
504 void *data;
506 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
507 WMBrowser *sender, int column, WMList *list);
509 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
510 int column);
512 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
514 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
515 } WMBrowserDelegate;
518 typedef struct WMTextFieldDelegate {
519 void *data;
521 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
522 WMNotification *notif);
524 void (*didChange)(struct WMTextFieldDelegate *self,
525 WMNotification *notif);
527 void (*didEndEditing)(struct WMTextFieldDelegate *self,
528 WMNotification *notif);
530 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
531 WMTextField *tPtr);
533 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
534 WMTextField *tPtr);
535 } WMTextFieldDelegate;
538 typedef struct WMTextDelegate {
539 void *data;
541 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
542 void *description);
544 } WMTextDelegate;
548 typedef struct WMTabViewDelegate {
549 void *data;
551 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
552 WMTabView *tabView);
554 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
555 WMTabViewItem *item);
557 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
558 WMTabViewItem *item);
560 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
561 WMTabViewItem *item);
562 } WMTabViewDelegate;
567 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
568 Time timestamp, void *cdata, WMData *data);
571 typedef struct WMSelectionProcs {
572 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
573 void *cdata, Atom *type);
574 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
575 void (*selectionDone)(WMView *view, Atom selection, Atom target,
576 void *cdata);
577 } WMSelectionProcs;
580 typedef struct W_DraggingInfo WMDraggingInfo;
583 typedef struct W_DragSourceProcs {
584 unsigned (*draggingSourceOperation)(WMView *self, Bool local);
585 void (*beganDragImage)(WMView *self, WMPixmap *image, WMPoint point);
586 void (*endedDragImage)(WMView *self, WMPixmap *image, WMPoint point,
587 Bool deposited);
588 WMData* (*fetchDragData)(WMView *self, char *type);
589 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
590 } WMDragSourceProcs;
594 typedef struct W_DragDestinationProcs {
595 unsigned (*draggingEntered)(WMView *self, WMDraggingInfo *info);
596 unsigned (*draggingUpdated)(WMView *self, WMDraggingInfo *info);
597 void (*draggingExited)(WMView *self, WMDraggingInfo *info);
598 Bool (*prepareForDragOperation)(WMView *self, WMDraggingInfo *info);
599 Bool (*performDragOperation)(WMView *self, WMDraggingInfo *info);
600 void (*concludeDragOperation)(WMView *self, WMDraggingInfo *info);
601 } WMDragDestinationProcs;
605 /* ...................................................................... */
608 WMPoint wmkpoint(int x, int y);
610 WMSize wmksize(unsigned int width, unsigned int height);
612 WMRect wmkrect(int x, int y, unsigned int width, unsigned int height);
614 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
615 #define wmksize(width, height) (WMSize){(width), (height)}
616 #define wmkpoint(x, y) (WMPoint){(x), (y)}
617 #endif
619 /* ....................................................................... */
623 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
625 void WMSetResourcePath(char *path);
627 /* don't free the returned string */
628 char* WMGetApplicationName();
630 /* Try to locate resource file. ext may be NULL */
631 char* WMPathForResourceOfType(char *resource, char *ext);
634 WMScreen* WMOpenScreen(const char *display);
636 WMScreen* WMCreateScreenWithRContext(Display *display, int screen,
637 RContext *context);
639 WMScreen* WMCreateScreen(Display *display, int screen);
641 WMScreen* WMCreateSimpleApplicationScreen(Display *display);
643 void WMScreenMainLoop(WMScreen *scr);
645 void WMBreakModalLoop(WMScreen *scr);
647 void WMRunModalLoop(WMScreen *scr, WMView *view);
649 RContext* WMScreenRContext(WMScreen *scr);
651 Display* WMScreenDisplay(WMScreen *scr);
653 int WMScreenDepth(WMScreen *scr);
657 void WMSetApplicationIconImage(WMScreen *app, RImage *image);
659 RImage* WMGetApplicationIconImage(WMScreen *app);
661 void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
663 WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
665 /* If color==NULL it will use the default color for panels: ae/aa/ae */
666 WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
668 void WMSetApplicationIconWindow(WMScreen *scr, Window window);
670 void WMSetFocusToWidget(WMWidget *widget);
672 WMEventHook* WMHookEventHandler(WMEventHook *handler);
674 int WMHandleEvent(XEvent *event);
676 Bool WMScreenPending(WMScreen *scr);
678 void WMCreateEventHandler(WMView *view, unsigned long mask,
679 WMEventProc *eventProc, void *clientData);
681 void WMDeleteEventHandler(WMView *view, unsigned long mask,
682 WMEventProc *eventProc, void *clientData);
684 int WMIsDoubleClick(XEvent *event);
686 /*int WMIsTripleClick(XEvent *event);*/
688 void WMNextEvent(Display *dpy, XEvent *event);
690 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
693 /* ....................................................................... */
696 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
697 WMSelectionProcs *procs, void *cdata);
699 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
701 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
702 Time timestamp, WMSelectionCallback *callback,
703 void *cdata);
706 extern char *WMSelectionOwnerDidChangeNotification;
708 /* ....................................................................... */
710 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
712 void WMDragImageFromView(WMView *view, WMPixmap *image, char *dataTypes[],
713 WMPoint atLocation, WMSize mouseOffset, XEvent *event,
714 Bool slideBack);
716 void WMRegisterViewForDraggedTypes(WMView *view, char *acceptedTypes[]);
718 void WMUnregisterViewDraggedTypes(WMView *view);
720 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
723 WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info);
725 /* ....................................................................... */
727 Bool WMHasAntialiasingSupport(WMScreen *scrPtr);
729 Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
731 /* ....................................................................... */
733 WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
735 //??
736 WMFont* WMCreateFontWithAttributes(WMScreen *scrPtr, char *fontName,
737 WMFontAttributes *attribs);
739 WMFont* WMCopyFontWithChanges(WMScreen *scrPtr, WMFont *font,
740 const WMFontAttributes *changes);
742 WMFont* WMRetainFont(WMFont *font);
744 void WMReleaseFont(WMFont *font);
746 char* WMGetFontName(WMFont *font);
748 unsigned int WMFontHeight(WMFont *font);
750 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
752 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
754 WMFont* WMDefaultSystemFont(WMScreen *scrPtr);
756 WMFont* WMDefaultBoldSystemFont(WMScreen *scrPtr);
758 WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
760 WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
762 /* ....................................................................... */
764 WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
766 void WMReleasePixmap(WMPixmap *pixmap);
768 WMPixmap* WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
769 Bool masked);
771 WMPixmap* WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
772 Pixmap mask, int width, int height,
773 int depth);
775 WMPixmap* WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
776 int threshold);
778 WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
780 WMSize WMGetPixmapSize(WMPixmap *pixmap);
782 WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
784 WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
785 RColor *color);
787 WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
788 RColor *color);
790 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
792 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
794 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
796 WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
798 /* ....................................................................... */
801 WMColor* WMDarkGrayColor(WMScreen *scr);
803 WMColor* WMGrayColor(WMScreen *scr);
805 WMColor* WMBlackColor(WMScreen *scr);
807 WMColor* WMWhiteColor(WMScreen *scr);
809 void WMSetColorInGC(WMColor *color, GC gc);
811 GC WMColorGC(WMColor *color);
813 WMPixel WMColorPixel(WMColor *color);
815 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
816 unsigned int width, unsigned int height);
818 void WMReleaseColor(WMColor *color);
820 WMColor* WMRetainColor(WMColor *color);
822 WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
823 unsigned short green, unsigned short blue,
824 Bool exact);
826 WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
827 unsigned short green, unsigned short blue,
828 unsigned short alpha, Bool exact);
830 WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
832 void WMSetColorAlpha(WMColor *color, unsigned short alpha);
834 unsigned short WMRedComponentOfColor(WMColor *color);
836 unsigned short WMGreenComponentOfColor(WMColor *color);
838 unsigned short WMBlueComponentOfColor(WMColor *color);
840 unsigned short WMGetColorAlpha(WMColor *color);
842 char* WMGetColorRGBDescription(WMColor *color);
844 /* ....................................................................... */
847 void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
848 int x, int y, char *text, int length);
850 void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
851 WMColor *background, WMFont *font, int x, int y,
852 char *text, int length);
854 int WMWidthOfString(WMFont *font, char *text, int length);
858 /* ....................................................................... */
860 WMScreen* WMWidgetScreen(WMWidget *w);
862 unsigned int WMScreenWidth(WMScreen *scr);
864 unsigned int WMScreenHeight(WMScreen *scr);
866 void WMUnmapWidget(WMWidget *w);
868 void WMMapWidget(WMWidget *w);
870 Bool WMWidgetIsMapped(WMWidget *w);
872 void WMRaiseWidget(WMWidget *w);
874 void WMLowerWidget(WMWidget *w);
876 void WMMoveWidget(WMWidget *w, int x, int y);
878 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
880 void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
882 WMColor* WMGetWidgetBackgroundColor(WMWidget *w);
884 void WMMapSubwidgets(WMWidget *w);
886 void WMUnmapSubwidgets(WMWidget *w);
888 void WMRealizeWidget(WMWidget *w);
890 void WMReparentWidget(WMWidget *w, WMWidget *newParent, int x, int y);
892 void WMDestroyWidget(WMWidget *widget);
894 void WMHangData(WMWidget *widget, void *data);
896 void* WMGetHangedData(WMWidget *widget);
898 unsigned int WMWidgetWidth(WMWidget *w);
900 unsigned int WMWidgetHeight(WMWidget *w);
902 Window WMWidgetXID(WMWidget *w);
904 Window WMViewXID(WMView *view);
906 void WMRedisplayWidget(WMWidget *w);
908 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
910 void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
911 int rightOffs, int bottomOffs);
913 WMSize WMGetViewSize(WMView *view);
915 WMPoint WMGetViewPosition(WMView *view);
917 WMPoint WMGetViewScreenPosition(WMView *view);
919 WMWidget* WMWidgetOfView(WMView *view);
921 void WMSetViewNextResponder(WMView *view, WMView *responder);
923 void WMRelayToNextResponder(WMView *view, XEvent *event);
925 /* notifications */
926 extern char *WMViewSizeDidChangeNotification;
928 extern char *WMViewFocusDidChangeNotification;
930 extern char *WMViewRealizedNotification;
933 /* ....................................................................... */
935 void WMSetBalloonTextForView(char *text, WMView *view);
937 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
939 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
941 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
943 void WMSetBalloonDelay(WMScreen *scr, int delay);
945 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
948 /* ....................................................................... */
950 WMWindow* WMCreateWindow(WMScreen *screen, char *name);
952 WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
954 WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
955 int style);
957 WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
959 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
961 void WMSetWindowTitle(WMWindow *wPtr, char *title);
963 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
965 void WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap);
967 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
969 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
971 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
973 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
974 int maxX, int maxY);
976 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
978 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
980 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
982 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
984 void WMSetWindowLevel(WMWindow *win, int level);
986 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
988 void WMCloseWindow(WMWindow *win);
990 /* ....................................................................... */
992 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
994 #define WMCreateCommandButton(parent) \
995 WMCreateCustomButton((parent), WBBSpringLoadedMask\
996 |WBBPushInMask\
997 |WBBPushLightMask\
998 |WBBPushChangeMask)
1000 #define WMCreateRadioButton(parent) \
1001 WMCreateButton((parent), WBTRadio)
1003 #define WMCreateSwitchButton(parent) \
1004 WMCreateButton((parent), WBTSwitch)
1006 WMButton* WMCreateButton(WMWidget *parent, WMButtonType type);
1008 WMButton* WMCreateCustomButton(WMWidget *parent, int behaviourMask);
1010 void WMSetButtonImageDefault(WMButton *bPtr);
1012 void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
1014 void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
1016 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
1018 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
1020 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
1022 void WMSetButtonText(WMButton *bPtr, char *text);
1024 void WMSetButtonAltText(WMButton *bPtr, char *text);
1026 void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
1028 void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
1030 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
1032 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
1034 int WMGetButtonSelected(WMButton *bPtr);
1036 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
1038 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
1040 int WMGetButtonEnabled(WMButton *bPtr);
1042 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
1044 void WMSetButtonTag(WMButton *bPtr, int tag);
1046 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
1048 void WMPerformButtonClick(WMButton *bPtr);
1050 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
1052 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
1054 /* ....................................................................... */
1056 WMLabel* WMCreateLabel(WMWidget *parent);
1058 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1060 void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
1062 WMPixmap* WMGetLabelImage(WMLabel *lPtr);
1064 char* WMGetLabelText(WMLabel *lPtr);
1066 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1068 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1070 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1072 void WMSetLabelText(WMLabel *lPtr, char *text);
1074 WMFont* WMGetLabelFont(WMLabel *lPtr);
1076 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1078 void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
1080 /* ....................................................................... */
1082 WMFrame* WMCreateFrame(WMWidget *parent);
1084 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1086 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1088 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1090 /* ....................................................................... */
1092 WMTextField* WMCreateTextField(WMWidget *parent);
1094 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1096 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1098 /* you can free the returned string */
1099 char* WMGetTextFieldText(WMTextField *tPtr);
1101 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1103 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1105 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1107 WMFont* WMGetTextFieldFont(WMTextField *tPtr);
1109 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1111 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1113 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1115 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1117 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1119 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1121 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1123 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1125 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1127 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1129 WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
1131 extern char *WMTextDidChangeNotification;
1132 extern char *WMTextDidBeginEditingNotification;
1133 extern char *WMTextDidEndEditingNotification;
1135 /* ....................................................................... */
1137 WMScroller* WMCreateScroller(WMWidget *parent);
1139 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1140 float knobProportion);
1142 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1144 float WMGetScrollerValue(WMScroller *sPtr);
1146 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1148 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1150 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1151 WMScrollArrowPosition position);
1153 extern char *WMScrollerDidScrollNotification;
1155 /* ....................................................................... */
1157 WMList* WMCreateList(WMWidget *parent);
1159 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1161 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1163 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1165 WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
1167 void WMSortListItems(WMList *lPtr);
1169 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1171 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1173 WMListItem* WMGetListItem(WMList *lPtr, int row);
1175 WMArray* WMGetListItems(WMList *lPtr);
1177 void WMRemoveListItem(WMList *lPtr, int row);
1179 void WMSelectListItem(WMList *lPtr, int row);
1181 void WMUnselectListItem(WMList *lPtr, int row);
1183 /* This will select all items in range, and deselect all the others */
1184 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1186 /* This will select all items in range, leaving the others as they are */
1187 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1189 void WMSelectAllListItems(WMList *lPtr);
1191 void WMUnselectAllListItems(WMList *lPtr);
1193 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1195 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1197 int WMGetListItemHeight(WMList *lPtr);
1199 /* don't free the returned data */
1200 WMArray* WMGetListSelectedItems(WMList *lPtr);
1203 * For the following 2 functions, in case WMList allows multiple selection,
1204 * the first item in the list of selected items, respective its row number,
1205 * will be returned.
1208 /* don't free the returned data */
1209 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1211 int WMGetListSelectedItemRow(WMList *lPtr);
1213 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1215 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1217 void WMClearList(WMList *lPtr);
1219 int WMGetListNumberOfRows(WMList *lPtr);
1221 void WMSetListPosition(WMList *lPtr, int row);
1223 void WMSetListBottomPosition(WMList *lPtr, int row);
1225 int WMGetListPosition(WMList *lPtr);
1227 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1229 Bool WMListAllowsEmptySelection(WMList *lPtr);
1232 extern char *WMListDidScrollNotification;
1233 extern char *WMListSelectionDidChangeNotification;
1235 /* ....................................................................... */
1237 WMBrowser* WMCreateBrowser(WMWidget *parent);
1239 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1241 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1243 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1245 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1247 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1249 int WMAddBrowserColumn(WMBrowser *bPtr);
1251 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1253 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1255 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1257 WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1259 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1261 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1262 WMCompareDataProc *func);
1264 /* Don't free the returned string. */
1265 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1267 /* free the returned string */
1268 char* WMGetBrowserPath(WMBrowser *bPtr);
1270 /* free the returned string */
1271 char* WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1273 /* free the returned array */
1274 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1276 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1278 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1279 void *clientData);
1281 WMListItem* WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1283 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1285 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1287 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1289 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1291 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1293 WMList* WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1295 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1297 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1299 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1301 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1303 /* ....................................................................... */
1306 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1308 WMMenuItem* WMCreateMenuItem(void);
1310 void WMDestroyMenuItem(WMMenuItem *item);
1312 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1314 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1316 char* WMGetMenuItemShortcut(WMMenuItem *item);
1318 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1320 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1322 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1324 void* WMGetMenuItemRepresentedObject(WMMenuItem *item);
1326 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1328 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1330 WMAction* WMGetMenuItemAction(WMMenuItem *item);
1332 void* WMGetMenuItemData(WMMenuItem *item);
1334 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1336 char* WMGetMenuItemTitle(WMMenuItem *item);
1338 void WMSetMenuItemState(WMMenuItem *item, int state);
1340 int WMGetMenuItemState(WMMenuItem *item);
1342 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1344 WMPixmap* WMGetMenuItemPixmap(WMMenuItem *item);
1346 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1348 WMPixmap* WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1350 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1352 WMPixmap* WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1354 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1356 WMPixmap* WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1358 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1361 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1363 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1366 /* ....................................................................... */
1368 WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
1370 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1371 void *clientData);
1373 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1375 WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1377 WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1378 char *title);
1380 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1382 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1384 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1386 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1388 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1390 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1392 /* don't free the returned data */
1393 char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1395 WMMenuItem* WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1398 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1400 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1402 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1404 /* ....................................................................... */
1406 WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
1408 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1410 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1412 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1414 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1416 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1418 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1421 /* ....................................................................... */
1423 WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
1425 void WMFreeColorPanel(WMColorPanel *panel);
1427 void WMShowColorPanel(WMColorPanel *panel);
1429 void WMCloseColorPanel(WMColorPanel *panel);
1431 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1433 WMColor* WMGetColorPanelColor(WMColorPanel *panel);
1435 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1437 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1439 extern char *WMColorPanelColorChangedNotification;
1441 /* ....................................................................... */
1443 WMColorWell* WMCreateColorWell(WMWidget *parent);
1445 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1447 WMColor* WMGetColorWellColor(WMColorWell *cPtr);
1449 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1452 extern char *WMColorWellDidChangeNotification;
1455 /* ...................................................................... */
1457 WMScrollView* WMCreateScrollView(WMWidget *parent);
1459 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1460 unsigned int height);
1462 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1464 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1466 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1468 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1470 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1472 WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1474 WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1476 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1478 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1480 /* ....................................................................... */
1482 WMSlider* WMCreateSlider(WMWidget *parent);
1484 int WMGetSliderMinValue(WMSlider *slider);
1486 int WMGetSliderMaxValue(WMSlider *slider);
1488 int WMGetSliderValue(WMSlider *slider);
1490 void WMSetSliderMinValue(WMSlider *slider, int value);
1492 void WMSetSliderMaxValue(WMSlider *slider, int value);
1494 void WMSetSliderValue(WMSlider *slider, int value);
1496 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1498 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1500 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1502 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1504 /* ....................................................................... */
1507 WMSplitView* WMCreateSplitView(WMWidget *parent);
1509 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1511 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1513 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1515 WMView* WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1517 /* remove the first subview == view */
1518 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1520 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1523 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1525 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1527 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1528 WMSplitViewConstrainProc *proc);
1531 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1532 WMSplitViewResizeSubviewsProc *proc);
1535 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1537 /* ...................................................................... */
1539 WMRuler* WMCreateRuler (WMWidget *parent);
1541 WMRulerMargins* WMGetRulerMargins(WMRuler *rPtr);
1543 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1545 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin);
1547 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1549 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1551 int WMGetRulerOffset(WMRuler *rPtr);
1553 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1555 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1557 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1559 /* ....................................................................... */
1562 #define WMCreateText(parent) WMCreateTextForDocumentType \
1563 ((parent), (NULL), (NULL))
1565 WMText* WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser,
1566 WMAction *writer);
1568 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1570 void WMFreezeText(WMText *tPtr);
1572 #define WMRefreshText(tPtr) WMThawText((tPtr))
1574 void WMThawText(WMText *tPtr);
1576 int WMScrollText(WMText *tPtr, int amount);
1578 int WMPageText(WMText *tPtr, Bool direction);
1580 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1582 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1584 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1586 void WMShowTextRuler(WMText *tPtr, Bool show);
1588 int WMGetTextRulerShown(WMText *tPtr);
1590 void WMSetTextEditable(WMText *tPtr, Bool editable);
1592 int WMGetTextEditable(WMText *tPtr);
1594 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1596 int WMGetTextUsesMonoFont(WMText *tPtr);
1598 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1600 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1602 int WMGetTextIgnoresNewline(WMText *tPtr);
1604 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1606 WMFont* WMGetTextDefaultFont(WMText *tPtr);
1608 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1610 WMColor* WMGetTextDefaultColor(WMText *tPtr);
1612 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1614 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1616 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1618 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1620 void WMPrependTextStream(WMText *tPtr, char *text);
1622 void WMAppendTextStream(WMText *tPtr, char *text);
1624 #define WMClearText(tPtr) WMAppendTextStream \
1625 ((tPtr), (NULL))
1627 /* free the text */
1628 char* WMGetTextStream(WMText *tPtr);
1630 /* free the text */
1631 char* WMGetTextSelectedStream(WMText *tPtr);
1633 /* destroy the array */
1634 WMArray* WMGetTextObjects(WMText *tPtr);
1636 /* destroy the array */
1637 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1639 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1641 WMColor* WMGetTextSelectionColor(WMText *tPtr);
1643 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1645 WMFont* WMGetTextSelectionFont(WMText *tPtr);
1647 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1649 int WMGetTextSelectionUnderlined(WMText *tPtr);
1651 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1653 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1654 Bool caseSensitive);
1656 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1659 /* parser related stuff... use only if implementing a new parser */
1661 void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1662 WMColor *color, unsigned short first,
1663 unsigned short extraInfo);
1665 void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1666 WMColor *color, unsigned short first,
1667 unsigned short extraInfo);
1669 void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1670 WMColor *color, unsigned short first,
1671 unsigned short length);
1673 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1674 unsigned int kanji, unsigned int underlined,
1675 int script, WMRulerMargins *margins);
1677 /* do NOT free the margins */
1678 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1679 unsigned int *kanji, unsigned int *underlined,
1680 int *script, WMRulerMargins *margins);
1682 int WMGetTextInsertType(WMText *tPtr);
1684 /*int WMGetTextBlocks(WMText *tPtr);
1686 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1688 int WMGetCurrentTextBlock(WMText *tPtr);*/
1690 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1692 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1694 void* WMRemoveTextBlock(WMText *tPtr);
1696 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1698 /* ....................................................................... */
1701 WMTabView* WMCreateTabView(WMWidget *parent);
1703 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1705 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1707 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1709 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1711 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1713 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1715 WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1716 int identifier, char *label);
1718 WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1720 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1722 void WMSelectLastTabViewItem(WMTabView *tPtr);
1724 void WMSelectNextTabViewItem(WMTabView *tPtr);
1726 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1728 WMTabViewItem* WMGetSelectedTabViewItem(WMTabView *tPtr);
1730 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1732 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1734 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1737 WMTabViewItem* WMCreateTabViewItemWithIdentifier(int identifier);
1739 void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
1741 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1743 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1745 char* WMGetTabViewItemLabel(WMTabViewItem *item);
1747 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1749 WMView* WMGetTabViewItemView(WMTabViewItem *item);
1751 void WMDestroyTabViewItem(WMTabViewItem *item);
1754 /* ....................................................................... */
1756 WMBox* WMCreateBox(WMWidget *parent);
1758 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1760 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1761 int minSize, int maxSize, int space);
1763 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1764 int minSize, int maxSize, int space);
1766 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1768 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1770 /* ....................................................................... */
1772 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1773 char *defaultButton, char *alternateButton,
1774 char *otherButton);
1776 /* you can free the returned string */
1777 char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1778 char *defaultText, char *okButton, char *cancelButton);
1780 WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1781 char *msg, char *defaultButton,
1782 char *alternateButton, char *otherButton);
1784 WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1785 char *msg, char *defaultText, char *okButton,
1786 char *cancelButton);
1789 WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
1790 char *title, char *defaultButton,
1791 char *alternateButton);
1793 void WMDestroyAlertPanel(WMAlertPanel *panel);
1795 void WMDestroyInputPanel(WMInputPanel *panel);
1797 void WMDestroyGenericPanel(WMGenericPanel *panel);
1799 /* ....................................................................... */
1801 /* only 1 instance per WMScreen */
1802 WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
1804 WMSavePanel* WMGetSavePanel(WMScreen *scrPtr);
1806 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1808 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1810 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1812 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1814 /* you can free the returned string */
1815 char* WMGetFilePanelFileName(WMFilePanel *panel);
1817 void WMFreeFilePanel(WMFilePanel *panel);
1819 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1820 char *path, char *name, char **fileTypes);
1822 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1824 WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
1827 /* ...................................................................... */
1829 /* only 1 instance per WMScreen */
1830 WMFontPanel* WMGetFontPanel(WMScreen *scr);
1832 void WMShowFontPanel(WMFontPanel *panel);
1834 void WMHideFontPanel(WMFontPanel *panel);
1836 void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
1838 void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
1840 /* you can free the returned string */
1841 char* WMGetFontPanelFontName(WMFontPanel *panel);
1843 WMFont* WMGetFontPanelFont(WMFontPanel *panel);
1845 #ifdef __cplusplus
1847 #endif /* __cplusplus */
1849 #endif