another test for cvs notifications
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blobd08936b92fd822ccfca49cfb6bc7422368c50662
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 20040406
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 = 0,
227 WDOperationCopy,
228 WDOperationMove,
229 WDOperationLink,
230 WDOperationAsk,
231 WDOperationPrivate
232 } WMDragOperationType;
235 typedef enum {
236 WMGrayModeColorPanel = 1,
237 WMRGBModeColorPanel = 2,
238 WMCMYKModeColorPanel = 3,
239 WMHSBModeColorPanel = 4,
240 WMCustomPaletteModeColorPanel = 5,
241 WMColorListModeColorPanel = 6,
242 WMWheelModeColorPanel = 7
243 } WMColorPanelMode;
247 /* system images */
248 #define WSIReturnArrow 1
249 #define WSIHighlightedReturnArrow 2
250 #define WSIScrollerDimple 3
251 #define WSIArrowLeft 4
252 #define WSIHighlightedArrowLeft 5
253 #define WSIArrowRight 6
254 #define WSIHighlightedArrowRight 7
255 #define WSIArrowUp 8
256 #define WSIHighlightedArrowUp 9
257 #define WSIArrowDown 10
258 #define WSIHighlightedArrowDown 11
259 #define WSICheckMark 12
261 enum {
262 WLDSSelected = (1 << 16),
263 WLDSDisabled = (1 << 17),
264 WLDSFocused = (1 << 18),
265 WLDSIsBranch = (1 << 19)
268 /* alert panel return values */
269 enum {
270 WAPRDefault = 0,
271 WAPRAlternate = 1,
272 WAPROther = -1,
273 WAPRError = -2
278 /* types of input observers */
279 enum {
280 WIReadMask = (1 << 0),
281 WIWriteMask = (1 << 1),
282 WIExceptMask = (1 << 2)
287 typedef int W_Class;
289 enum {
290 WC_Window = 0,
291 WC_Frame = 1,
292 WC_Label = 2,
293 WC_Button = 3,
294 WC_TextField = 4,
295 WC_Scroller = 5,
296 WC_ScrollView = 6,
297 WC_List = 7,
298 WC_Browser = 8,
299 WC_PopUpButton = 9,
300 WC_ColorWell = 10,
301 WC_Slider = 11,
302 WC_Matrix = 12, /* not ready */
303 WC_SplitView = 13,
304 WC_TabView = 14,
305 WC_ProgressIndicator = 15,
306 WC_MenuView = 16,
307 WC_Ruler = 17,
308 WC_Text = 18,
309 WC_Box = 19
312 /* All widgets must start with the following structure
313 * in that order. Used for typecasting to get some generic data */
314 typedef struct W_WidgetType {
315 W_Class widgetClass;
316 struct W_View *view;
318 } W_WidgetType;
321 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
322 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
325 /* 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;
430 /* Basic font styles. Used to easily get one style from another */
431 typedef enum WMFontStyle {
432 WFSNormal = 0,
433 WFSBold = 1,
434 WFSEmphasized = 2,
435 WFSBoldEmphasized = 3
436 } WMFontStyle;
439 /* WMRuler: */
440 typedef struct {
441 WMArray *tabs; /* a growable array of tabstops */
442 unsigned short left; /* left margin marker */
443 unsigned short right; /* right margin marker */
444 unsigned short first; /* indentation marker for first line only */
445 unsigned short body; /* body indentation marker */
446 unsigned short retainCount;
447 } WMRulerMargins;
448 /* All indentation and tab markers are _relative_ to the left margin marker */
451 typedef void WMEventProc(XEvent *event, void *clientData);
453 typedef void WMEventHook(XEvent *event);
455 /* self is set to the widget from where the callback is being called and
456 * clientData to the data set to with WMSetClientData() */
457 typedef void WMAction(WMWidget *self, void *clientData);
459 /* same as WMAction, but for stuff that arent widgets */
460 typedef void WMAction2(void *self, void *clientData);
463 /* delegate method like stuff */
464 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
465 int state, WMRect *rect);
468 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
469 unsigned int oldWidth,
470 unsigned int oldHeight);
473 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
474 int *minSize, int *maxSize);
476 typedef WMWidget* WMMatrixCreateCellProc(WMMatrix *mPtr);
481 typedef struct WMBrowserDelegate {
482 void *data;
484 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
485 WMBrowser *sender, int column, WMList *list);
487 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
488 int column);
490 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
492 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
493 } WMBrowserDelegate;
496 typedef struct WMTextFieldDelegate {
497 void *data;
499 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
500 WMNotification *notif);
502 void (*didChange)(struct WMTextFieldDelegate *self,
503 WMNotification *notif);
505 void (*didEndEditing)(struct WMTextFieldDelegate *self,
506 WMNotification *notif);
508 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
509 WMTextField *tPtr);
511 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
512 WMTextField *tPtr);
513 } WMTextFieldDelegate;
516 typedef struct WMTextDelegate {
517 void *data;
519 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
520 void *description);
522 } WMTextDelegate;
526 typedef struct WMTabViewDelegate {
527 void *data;
529 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
530 WMTabView *tabView);
532 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
533 WMTabViewItem *item);
535 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
536 WMTabViewItem *item);
538 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
539 WMTabViewItem *item);
540 } WMTabViewDelegate;
545 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
546 Time timestamp, void *cdata, WMData *data);
549 typedef struct WMSelectionProcs {
550 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
551 void *cdata, Atom *type);
552 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
553 void (*selectionDone)(WMView *view, Atom selection, Atom target,
554 void *cdata);
555 } WMSelectionProcs;
558 typedef struct W_DraggingInfo WMDraggingInfo;
561 /* links a label to a dnd operation. */
562 typedef struct W_DragOperationtItem WMDragOperationItem;
565 typedef struct W_DragSourceProcs {
566 WMArray* (*dropDataTypes)(WMView *self);
567 WMDragOperationType (*wantedDropOperation)(WMView *self);
568 WMArray* (*askedOperations)(WMView *self);
569 Bool (*acceptDropOperation)(WMView *self, WMDragOperationType operation);
570 void (*beganDrag)(WMView *self, WMPoint *point);
571 void (*endedDrag)(WMView *self, WMPoint *point, Bool deposited);
572 WMData* (*fetchDragData)(WMView *self, char *type);
573 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
574 } WMDragSourceProcs;
578 typedef struct W_DragDestinationProcs {
579 void (*prepareForDragOperation)(WMView *self);
580 WMArray* (*requiredDataTypes)(WMView *self, WMDragOperationType request,
581 WMArray *sourceDataTypes);
582 WMDragOperationType (*allowedOperation)(WMView *self,
583 WMDragOperationType request,
584 WMArray *sourceDataTypes);
585 Bool (*inspectDropData)(WMView *self, WMArray *dropData);
586 void (*performDragOperation)(WMView *self, WMArray *dropData,
587 WMArray *operations, WMPoint *dropLocation);
588 void (*concludeDragOperation)(WMView *self);
589 } WMDragDestinationProcs;
592 /* ...................................................................... */
595 WMPoint wmkpoint(int x, int y);
597 WMSize wmksize(unsigned int width, unsigned int height);
599 WMRect wmkrect(int x, int y, unsigned int width, unsigned int height);
601 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
602 #define wmksize(width, height) (WMSize){(width), (height)}
603 #define wmkpoint(x, y) (WMPoint){(x), (y)}
604 #endif
606 /* ....................................................................... */
610 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
612 void WMSetResourcePath(char *path);
614 /* don't free the returned string */
615 char* WMGetApplicationName();
617 /* Try to locate resource file. ext may be NULL */
618 char* WMPathForResourceOfType(char *resource, char *ext);
621 WMScreen* WMOpenScreen(const char *display);
623 WMScreen* WMCreateScreenWithRContext(Display *display, int screen,
624 RContext *context);
626 WMScreen* WMCreateScreen(Display *display, int screen);
628 WMScreen* WMCreateSimpleApplicationScreen(Display *display);
630 void WMScreenMainLoop(WMScreen *scr);
632 void WMBreakModalLoop(WMScreen *scr);
634 void WMRunModalLoop(WMScreen *scr, WMView *view);
636 RContext* WMScreenRContext(WMScreen *scr);
638 Display* WMScreenDisplay(WMScreen *scr);
640 int WMScreenDepth(WMScreen *scr);
644 void WMSetApplicationIconImage(WMScreen *app, RImage *image);
646 RImage* WMGetApplicationIconImage(WMScreen *app);
648 void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
650 WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
652 /* If color==NULL it will use the default color for panels: ae/aa/ae */
653 WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
655 void WMSetApplicationIconWindow(WMScreen *scr, Window window);
657 void WMSetFocusToWidget(WMWidget *widget);
659 WMEventHook* WMHookEventHandler(WMEventHook *handler);
661 int WMHandleEvent(XEvent *event);
663 Bool WMScreenPending(WMScreen *scr);
665 void WMCreateEventHandler(WMView *view, unsigned long mask,
666 WMEventProc *eventProc, void *clientData);
668 void WMDeleteEventHandler(WMView *view, unsigned long mask,
669 WMEventProc *eventProc, void *clientData);
671 int WMIsDoubleClick(XEvent *event);
673 /*int WMIsTripleClick(XEvent *event);*/
675 void WMNextEvent(Display *dpy, XEvent *event);
677 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
680 /* ....................................................................... */
683 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
684 WMSelectionProcs *procs, void *cdata);
686 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
688 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
689 Time timestamp, WMSelectionCallback *callback,
690 void *cdata);
693 extern char *WMSelectionOwnerDidChangeNotification;
695 /* ....................................................................... */
697 WMArray* WMCreateDragOperationArray(int initialSize);
699 WMDragOperationItem* WMCreateDragOperationItem(WMDragOperationType type,
700 char* text);
702 WMDragOperationType WMGetDragOperationItemType(WMDragOperationItem* item);
704 char* WMGetDragOperationItemText(WMDragOperationItem* item);
706 void WMSetViewDragImage(WMView* view, WMPixmap *dragImage);
708 void WMReleaseViewDragImage(WMView* view);
710 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
712 Bool WMIsDraggingFromView(WMView *view);
714 void WMDragImageFromView(WMView *view, XEvent *event);
716 /* Create a drag handler, associating drag event masks with dragEventProc */
717 void WMCreateDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
719 void WMDeleteDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
721 /* set default drag handler for view */
722 void WMSetViewDraggable(WMView *view, WMDragSourceProcs *procs, WMPixmap *dragImage);
724 void WMUnsetViewDraggable(WMView *view);
726 void WMRegisterViewForDraggedTypes(WMView *view, WMArray *acceptedTypes);
728 void WMUnregisterViewDraggedTypes(WMView *view);
730 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
732 /* ....................................................................... */
734 //Bool WMHasAntialiasingSupport(WMScreen *scrPtr);
736 Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
738 /* ....................................................................... */
740 WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
742 WMFont* WMCopyFontWithStyle(WMScreen *scrPtr, WMFont *font, WMFontStyle style);
744 WMFont* WMRetainFont(WMFont *font);
746 void WMReleaseFont(WMFont *font);
748 char* WMGetFontName(WMFont *font);
750 unsigned int WMFontHeight(WMFont *font);
752 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
754 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
756 WMFont* WMDefaultSystemFont(WMScreen *scrPtr);
758 WMFont* WMDefaultBoldSystemFont(WMScreen *scrPtr);
760 WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
762 WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
764 /* ....................................................................... */
766 WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
768 void WMReleasePixmap(WMPixmap *pixmap);
770 WMPixmap* WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
771 Bool masked);
773 WMPixmap* WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
774 Pixmap mask, int width, int height,
775 int depth);
777 WMPixmap* WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
778 int threshold);
780 WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
782 WMSize WMGetPixmapSize(WMPixmap *pixmap);
784 WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
786 WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
787 RColor *color);
789 WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
790 RColor *color);
792 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
794 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
796 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
798 WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
800 /* ....................................................................... */
803 WMColor* WMDarkGrayColor(WMScreen *scr);
805 WMColor* WMGrayColor(WMScreen *scr);
807 WMColor* WMBlackColor(WMScreen *scr);
809 WMColor* WMWhiteColor(WMScreen *scr);
811 void WMSetColorInGC(WMColor *color, GC gc);
813 GC WMColorGC(WMColor *color);
815 WMPixel WMColorPixel(WMColor *color);
817 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
818 unsigned int width, unsigned int height);
820 void WMReleaseColor(WMColor *color);
822 WMColor* WMRetainColor(WMColor *color);
824 WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
825 unsigned short green, unsigned short blue,
826 Bool exact);
828 WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
829 unsigned short green, unsigned short blue,
830 unsigned short alpha, Bool exact);
832 WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
834 void WMSetColorAlpha(WMColor *color, unsigned short alpha);
836 unsigned short WMRedComponentOfColor(WMColor *color);
838 unsigned short WMGreenComponentOfColor(WMColor *color);
840 unsigned short WMBlueComponentOfColor(WMColor *color);
842 unsigned short WMGetColorAlpha(WMColor *color);
844 char* WMGetColorRGBDescription(WMColor *color);
846 /* ....................................................................... */
849 void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
850 int x, int y, char *text, int length);
852 void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
853 WMColor *background, WMFont *font, int x, int y,
854 char *text, int length);
856 int WMWidthOfString(WMFont *font, char *text, int length);
860 /* ....................................................................... */
862 WMScreen* WMWidgetScreen(WMWidget *w);
864 unsigned int WMScreenWidth(WMScreen *scr);
866 unsigned int WMScreenHeight(WMScreen *scr);
868 void WMUnmapWidget(WMWidget *w);
870 void WMMapWidget(WMWidget *w);
872 Bool WMWidgetIsMapped(WMWidget *w);
874 void WMRaiseWidget(WMWidget *w);
876 void WMLowerWidget(WMWidget *w);
878 void WMMoveWidget(WMWidget *w, int x, int y);
880 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
882 void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
884 WMColor* WMGetWidgetBackgroundColor(WMWidget *w);
886 void WMMapSubwidgets(WMWidget *w);
888 void WMUnmapSubwidgets(WMWidget *w);
890 void WMRealizeWidget(WMWidget *w);
892 void WMReparentWidget(WMWidget *w, WMWidget *newParent, int x, int y);
894 void WMDestroyWidget(WMWidget *widget);
896 void WMHangData(WMWidget *widget, void *data);
898 void* WMGetHangedData(WMWidget *widget);
900 unsigned int WMWidgetWidth(WMWidget *w);
902 unsigned int WMWidgetHeight(WMWidget *w);
904 Window WMWidgetXID(WMWidget *w);
906 Window WMViewXID(WMView *view);
908 void WMRedisplayWidget(WMWidget *w);
910 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
912 void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
913 int rightOffs, int bottomOffs);
915 WMSize WMGetViewSize(WMView *view);
917 WMPoint WMGetViewPosition(WMView *view);
919 WMPoint WMGetViewScreenPosition(WMView *view);
921 WMWidget* WMWidgetOfView(WMView *view);
923 void WMSetViewNextResponder(WMView *view, WMView *responder);
925 void WMRelayToNextResponder(WMView *view, XEvent *event);
927 /* notifications */
928 extern char *WMViewSizeDidChangeNotification;
930 extern char *WMViewFocusDidChangeNotification;
932 extern char *WMViewRealizedNotification;
935 /* ....................................................................... */
937 void WMSetBalloonTextForView(char *text, WMView *view);
939 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
941 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
943 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
945 void WMSetBalloonDelay(WMScreen *scr, int delay);
947 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
950 /* ....................................................................... */
952 WMWindow* WMCreateWindow(WMScreen *screen, char *name);
954 WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
956 WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
957 int style);
959 WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
961 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
963 void WMSetWindowTitle(WMWindow *wPtr, char *title);
965 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
967 void WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap);
969 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
971 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
973 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
975 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
976 int maxX, int maxY);
978 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
980 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
982 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
984 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
986 void WMSetWindowLevel(WMWindow *win, int level);
988 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
990 void WMCloseWindow(WMWindow *win);
992 /* ....................................................................... */
994 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
996 #define WMCreateCommandButton(parent) \
997 WMCreateCustomButton((parent), WBBSpringLoadedMask\
998 |WBBPushInMask\
999 |WBBPushLightMask\
1000 |WBBPushChangeMask)
1002 #define WMCreateRadioButton(parent) \
1003 WMCreateButton((parent), WBTRadio)
1005 #define WMCreateSwitchButton(parent) \
1006 WMCreateButton((parent), WBTSwitch)
1008 WMButton* WMCreateButton(WMWidget *parent, WMButtonType type);
1010 WMButton* WMCreateCustomButton(WMWidget *parent, int behaviourMask);
1012 void WMSetButtonImageDefault(WMButton *bPtr);
1014 void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
1016 void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
1018 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
1020 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
1022 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
1024 void WMSetButtonText(WMButton *bPtr, char *text);
1026 void WMSetButtonAltText(WMButton *bPtr, char *text);
1028 void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
1030 void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
1032 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
1034 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
1036 int WMGetButtonSelected(WMButton *bPtr);
1038 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
1040 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
1042 int WMGetButtonEnabled(WMButton *bPtr);
1044 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
1046 void WMSetButtonTag(WMButton *bPtr, int tag);
1048 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
1050 void WMPerformButtonClick(WMButton *bPtr);
1052 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
1054 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
1056 /* ....................................................................... */
1058 WMLabel* WMCreateLabel(WMWidget *parent);
1060 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1062 void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
1064 WMPixmap* WMGetLabelImage(WMLabel *lPtr);
1066 char* WMGetLabelText(WMLabel *lPtr);
1068 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1070 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1072 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1074 void WMSetLabelText(WMLabel *lPtr, char *text);
1076 WMFont* WMGetLabelFont(WMLabel *lPtr);
1078 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1080 void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
1082 /* ....................................................................... */
1084 WMFrame* WMCreateFrame(WMWidget *parent);
1086 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1088 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1090 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1092 /* ....................................................................... */
1094 WMTextField* WMCreateTextField(WMWidget *parent);
1096 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1098 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1100 /* you can free the returned string */
1101 char* WMGetTextFieldText(WMTextField *tPtr);
1103 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1105 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1107 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1109 WMFont* WMGetTextFieldFont(WMTextField *tPtr);
1111 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1113 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1115 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1117 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1119 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1121 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1123 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1125 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1127 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1129 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1131 WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
1133 extern char *WMTextDidChangeNotification;
1134 extern char *WMTextDidBeginEditingNotification;
1135 extern char *WMTextDidEndEditingNotification;
1137 /* ....................................................................... */
1139 WMScroller* WMCreateScroller(WMWidget *parent);
1141 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1142 float knobProportion);
1144 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1146 float WMGetScrollerValue(WMScroller *sPtr);
1148 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1150 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1152 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1153 WMScrollArrowPosition position);
1155 extern char *WMScrollerDidScrollNotification;
1157 /* ....................................................................... */
1159 WMList* WMCreateList(WMWidget *parent);
1161 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1163 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1165 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1167 WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
1169 void WMSortListItems(WMList *lPtr);
1171 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1173 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1175 WMListItem* WMGetListItem(WMList *lPtr, int row);
1177 WMArray* WMGetListItems(WMList *lPtr);
1179 void WMRemoveListItem(WMList *lPtr, int row);
1181 void WMSelectListItem(WMList *lPtr, int row);
1183 void WMUnselectListItem(WMList *lPtr, int row);
1185 /* This will select all items in range, and deselect all the others */
1186 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1188 /* This will select all items in range, leaving the others as they are */
1189 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1191 void WMSelectAllListItems(WMList *lPtr);
1193 void WMUnselectAllListItems(WMList *lPtr);
1195 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1197 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1199 int WMGetListItemHeight(WMList *lPtr);
1201 /* don't free the returned data */
1202 WMArray* WMGetListSelectedItems(WMList *lPtr);
1205 * For the following 2 functions, in case WMList allows multiple selection,
1206 * the first item in the list of selected items, respective its row number,
1207 * will be returned.
1210 /* don't free the returned data */
1211 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1213 int WMGetListSelectedItemRow(WMList *lPtr);
1215 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1217 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1219 void WMClearList(WMList *lPtr);
1221 int WMGetListNumberOfRows(WMList *lPtr);
1223 void WMSetListPosition(WMList *lPtr, int row);
1225 void WMSetListBottomPosition(WMList *lPtr, int row);
1227 int WMGetListPosition(WMList *lPtr);
1229 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1231 Bool WMListAllowsEmptySelection(WMList *lPtr);
1234 extern char *WMListDidScrollNotification;
1235 extern char *WMListSelectionDidChangeNotification;
1237 /* ....................................................................... */
1239 WMBrowser* WMCreateBrowser(WMWidget *parent);
1241 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1243 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1245 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1247 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1249 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1251 int WMAddBrowserColumn(WMBrowser *bPtr);
1253 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1255 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1257 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1259 WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1261 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1263 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1264 WMCompareDataProc *func);
1266 /* Don't free the returned string. */
1267 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1269 /* free the returned string */
1270 char* WMGetBrowserPath(WMBrowser *bPtr);
1272 /* free the returned string */
1273 char* WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1275 /* free the returned array */
1276 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1278 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1280 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1281 void *clientData);
1283 WMListItem* WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1285 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1287 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1289 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1291 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1293 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1295 WMList* WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1297 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1299 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1301 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1303 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1305 /* ....................................................................... */
1308 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1310 WMMenuItem* WMCreateMenuItem(void);
1312 void WMDestroyMenuItem(WMMenuItem *item);
1314 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1316 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1318 char* WMGetMenuItemShortcut(WMMenuItem *item);
1320 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1322 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1324 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1326 void* WMGetMenuItemRepresentedObject(WMMenuItem *item);
1328 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1330 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1332 WMAction* WMGetMenuItemAction(WMMenuItem *item);
1334 void* WMGetMenuItemData(WMMenuItem *item);
1336 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1338 char* WMGetMenuItemTitle(WMMenuItem *item);
1340 void WMSetMenuItemState(WMMenuItem *item, int state);
1342 int WMGetMenuItemState(WMMenuItem *item);
1344 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1346 WMPixmap* WMGetMenuItemPixmap(WMMenuItem *item);
1348 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1350 WMPixmap* WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1352 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1354 WMPixmap* WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1356 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1358 WMPixmap* WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1360 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1363 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1365 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1368 /* ....................................................................... */
1370 WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
1372 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1373 void *clientData);
1375 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1377 WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1379 WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1380 char *title);
1382 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1384 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1386 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1388 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1390 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1392 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1394 /* don't free the returned data */
1395 char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1397 WMMenuItem* WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1399 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1401 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1403 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1405 /* ....................................................................... */
1407 WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
1409 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1411 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1413 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1415 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1417 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1419 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1422 /* ....................................................................... */
1424 WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
1426 void WMFreeColorPanel(WMColorPanel *panel);
1428 void WMShowColorPanel(WMColorPanel *panel);
1430 void WMCloseColorPanel(WMColorPanel *panel);
1432 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1434 WMColor* WMGetColorPanelColor(WMColorPanel *panel);
1436 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1438 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1440 extern char *WMColorPanelColorChangedNotification;
1442 /* ....................................................................... */
1444 WMColorWell* WMCreateColorWell(WMWidget *parent);
1446 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1448 WMColor* WMGetColorWellColor(WMColorWell *cPtr);
1450 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1453 extern char *WMColorWellDidChangeNotification;
1456 /* ...................................................................... */
1458 WMScrollView* WMCreateScrollView(WMWidget *parent);
1460 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1461 unsigned int height);
1463 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1465 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1467 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1469 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1471 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1473 WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1475 WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1477 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1479 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1481 /* ....................................................................... */
1483 WMSlider* WMCreateSlider(WMWidget *parent);
1485 int WMGetSliderMinValue(WMSlider *slider);
1487 int WMGetSliderMaxValue(WMSlider *slider);
1489 int WMGetSliderValue(WMSlider *slider);
1491 void WMSetSliderMinValue(WMSlider *slider, int value);
1493 void WMSetSliderMaxValue(WMSlider *slider, int value);
1495 void WMSetSliderValue(WMSlider *slider, int value);
1497 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1499 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1501 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1503 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1505 /* ....................................................................... */
1508 WMSplitView* WMCreateSplitView(WMWidget *parent);
1510 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1512 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1514 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1516 WMView* WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1518 /* remove the first subview == view */
1519 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1521 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1524 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1526 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1528 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1529 WMSplitViewConstrainProc *proc);
1532 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1533 WMSplitViewResizeSubviewsProc *proc);
1536 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1538 /* ...................................................................... */
1540 WMRuler* WMCreateRuler (WMWidget *parent);
1542 WMRulerMargins* WMGetRulerMargins(WMRuler *rPtr);
1544 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1546 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin);
1548 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1550 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1552 int WMGetRulerOffset(WMRuler *rPtr);
1554 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1556 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1558 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1560 /* ....................................................................... */
1563 #define WMCreateText(parent) WMCreateTextForDocumentType \
1564 ((parent), (NULL), (NULL))
1566 WMText* WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser,
1567 WMAction *writer);
1569 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1571 void WMFreezeText(WMText *tPtr);
1573 #define WMRefreshText(tPtr) WMThawText((tPtr))
1575 void WMThawText(WMText *tPtr);
1577 int WMScrollText(WMText *tPtr, int amount);
1579 int WMPageText(WMText *tPtr, Bool direction);
1581 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1583 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1585 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1587 void WMShowTextRuler(WMText *tPtr, Bool show);
1589 int WMGetTextRulerShown(WMText *tPtr);
1591 void WMSetTextEditable(WMText *tPtr, Bool editable);
1593 int WMGetTextEditable(WMText *tPtr);
1595 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1597 int WMGetTextUsesMonoFont(WMText *tPtr);
1599 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1601 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1603 int WMGetTextIgnoresNewline(WMText *tPtr);
1605 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1607 WMFont* WMGetTextDefaultFont(WMText *tPtr);
1609 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1611 WMColor* WMGetTextDefaultColor(WMText *tPtr);
1613 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1615 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1617 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1619 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1621 void WMPrependTextStream(WMText *tPtr, char *text);
1623 void WMAppendTextStream(WMText *tPtr, char *text);
1625 #define WMClearText(tPtr) WMAppendTextStream \
1626 ((tPtr), (NULL))
1628 /* free the text */
1629 char* WMGetTextStream(WMText *tPtr);
1631 /* free the text */
1632 char* WMGetTextSelectedStream(WMText *tPtr);
1634 /* destroy the array */
1635 WMArray* WMGetTextObjects(WMText *tPtr);
1637 /* destroy the array */
1638 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1640 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1642 WMColor* WMGetTextSelectionColor(WMText *tPtr);
1644 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1646 WMFont* WMGetTextSelectionFont(WMText *tPtr);
1648 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1650 int WMGetTextSelectionUnderlined(WMText *tPtr);
1652 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1654 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1655 Bool caseSensitive);
1657 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1660 /* parser related stuff... use only if implementing a new parser */
1662 void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1663 WMColor *color, unsigned short first,
1664 unsigned short extraInfo);
1666 void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1667 WMColor *color, unsigned short first,
1668 unsigned short extraInfo);
1670 void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1671 WMColor *color, unsigned short first,
1672 unsigned short length);
1674 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1675 unsigned int kanji, unsigned int underlined,
1676 int script, WMRulerMargins *margins);
1678 /* do NOT free the margins */
1679 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1680 unsigned int *kanji, unsigned int *underlined,
1681 int *script, WMRulerMargins *margins);
1683 int WMGetTextInsertType(WMText *tPtr);
1685 /*int WMGetTextBlocks(WMText *tPtr);
1687 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1689 int WMGetCurrentTextBlock(WMText *tPtr);*/
1691 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1693 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1695 void* WMRemoveTextBlock(WMText *tPtr);
1697 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1699 /* ....................................................................... */
1702 WMTabView* WMCreateTabView(WMWidget *parent);
1704 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1706 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1708 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1710 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1712 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1714 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1716 WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1717 int identifier, char *label);
1719 WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1721 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1723 void WMSelectLastTabViewItem(WMTabView *tPtr);
1725 void WMSelectNextTabViewItem(WMTabView *tPtr);
1727 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1729 WMTabViewItem* WMGetSelectedTabViewItem(WMTabView *tPtr);
1731 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1733 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1735 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1738 WMTabViewItem* WMCreateTabViewItemWithIdentifier(int identifier);
1740 void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
1742 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1744 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1746 char* WMGetTabViewItemLabel(WMTabViewItem *item);
1748 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1750 WMView* WMGetTabViewItemView(WMTabViewItem *item);
1752 void WMDestroyTabViewItem(WMTabViewItem *item);
1755 /* ....................................................................... */
1757 WMBox* WMCreateBox(WMWidget *parent);
1759 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1761 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1762 int minSize, int maxSize, int space);
1764 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1765 int minSize, int maxSize, int space);
1767 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1769 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1771 /* ....................................................................... */
1773 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1774 char *defaultButton, char *alternateButton,
1775 char *otherButton);
1777 /* you can free the returned string */
1778 char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1779 char *defaultText, char *okButton, char *cancelButton);
1781 WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1782 char *msg, char *defaultButton,
1783 char *alternateButton, char *otherButton);
1785 WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1786 char *msg, char *defaultText, char *okButton,
1787 char *cancelButton);
1790 WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
1791 char *title, char *defaultButton,
1792 char *alternateButton);
1794 void WMDestroyAlertPanel(WMAlertPanel *panel);
1796 void WMDestroyInputPanel(WMInputPanel *panel);
1798 void WMDestroyGenericPanel(WMGenericPanel *panel);
1800 /* ....................................................................... */
1802 /* only 1 instance per WMScreen */
1803 WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
1805 WMSavePanel* WMGetSavePanel(WMScreen *scrPtr);
1807 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1809 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1811 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1813 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1815 /* you can free the returned string */
1816 char* WMGetFilePanelFileName(WMFilePanel *panel);
1818 void WMFreeFilePanel(WMFilePanel *panel);
1820 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1821 char *path, char *name, char **fileTypes);
1823 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1825 WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
1828 /* ...................................................................... */
1830 /* only 1 instance per WMScreen */
1831 WMFontPanel* WMGetFontPanel(WMScreen *scr);
1833 void WMShowFontPanel(WMFontPanel *panel);
1835 void WMHideFontPanel(WMFontPanel *panel);
1837 void WMFreeFontPanel(WMFontPanel *panel);
1839 void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
1841 void WMSetFontPanelFont(WMFontPanel *panel, char *fontName);
1843 WMFont* WMGetFontPanelFont(WMFontPanel *panel);
1845 #ifdef __cplusplus
1847 #endif /* __cplusplus */
1849 #endif