changed indentation to use spaces only
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blob97eeaa5a560f83a1352026b18ab3a82e2eff6d44
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);
469 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
470 unsigned int oldWidth,
471 unsigned int oldHeight);
474 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
475 int *minSize, int *maxSize);
477 typedef WMWidget* WMMatrixCreateCellProc(WMMatrix *mPtr);
482 typedef struct WMBrowserDelegate {
483 void *data;
485 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
486 WMBrowser *sender, int column, WMList *list);
488 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
489 int column);
491 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
493 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
494 } WMBrowserDelegate;
497 typedef struct WMTextFieldDelegate {
498 void *data;
500 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
501 WMNotification *notif);
503 void (*didChange)(struct WMTextFieldDelegate *self,
504 WMNotification *notif);
506 void (*didEndEditing)(struct WMTextFieldDelegate *self,
507 WMNotification *notif);
509 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
510 WMTextField *tPtr);
512 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
513 WMTextField *tPtr);
514 } WMTextFieldDelegate;
517 typedef struct WMTextDelegate {
518 void *data;
520 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
521 void *description);
523 } WMTextDelegate;
527 typedef struct WMTabViewDelegate {
528 void *data;
530 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
531 WMTabView *tabView);
533 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
534 WMTabViewItem *item);
536 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
537 WMTabViewItem *item);
539 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
540 WMTabViewItem *item);
541 } WMTabViewDelegate;
546 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
547 Time timestamp, void *cdata, WMData *data);
550 typedef struct WMSelectionProcs {
551 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
552 void *cdata, Atom *type);
553 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
554 void (*selectionDone)(WMView *view, Atom selection, Atom target,
555 void *cdata);
556 } WMSelectionProcs;
559 typedef struct W_DraggingInfo WMDraggingInfo;
562 /* links a label to a dnd operation. */
563 typedef struct W_DragOperationtItem WMDragOperationItem;
566 typedef struct W_DragSourceProcs {
567 WMArray* (*dropDataTypes)(WMView *self);
568 WMDragOperationType (*wantedDropOperation)(WMView *self);
569 WMArray* (*askedOperations)(WMView *self);
570 Bool (*acceptDropOperation)(WMView *self, WMDragOperationType operation);
571 void (*beganDrag)(WMView *self, WMPoint *point);
572 void (*endedDrag)(WMView *self, WMPoint *point, Bool deposited);
573 WMData* (*fetchDragData)(WMView *self, char *type);
574 /*Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
575 } WMDragSourceProcs;
579 typedef struct W_DragDestinationProcs {
580 void (*prepareForDragOperation)(WMView *self);
581 WMArray* (*requiredDataTypes)(WMView *self, WMDragOperationType request,
582 WMArray *sourceDataTypes);
583 WMDragOperationType (*allowedOperation)(WMView *self,
584 WMDragOperationType request,
585 WMArray *sourceDataTypes);
586 Bool (*inspectDropData)(WMView *self, WMArray *dropData);
587 void (*performDragOperation)(WMView *self, WMArray *dropData,
588 WMArray *operations, WMPoint *dropLocation);
589 void (*concludeDragOperation)(WMView *self);
590 } WMDragDestinationProcs;
593 /* ...................................................................... */
596 WMPoint wmkpoint(int x, int y);
598 WMSize wmksize(unsigned int width, unsigned int height);
600 WMRect wmkrect(int x, int y, unsigned int width, unsigned int height);
602 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
603 #define wmksize(width, height) (WMSize){(width), (height)}
604 #define wmkpoint(x, y) (WMPoint){(x), (y)}
605 #endif
607 /* ....................................................................... */
611 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
613 void WMSetResourcePath(char *path);
615 /* don't free the returned string */
616 char* WMGetApplicationName();
618 /* Try to locate resource file. ext may be NULL */
619 char* WMPathForResourceOfType(char *resource, char *ext);
622 WMScreen* WMOpenScreen(const char *display);
624 WMScreen* WMCreateScreenWithRContext(Display *display, int screen,
625 RContext *context);
627 WMScreen* WMCreateScreen(Display *display, int screen);
629 WMScreen* WMCreateSimpleApplicationScreen(Display *display);
631 void WMScreenMainLoop(WMScreen *scr);
633 void WMBreakModalLoop(WMScreen *scr);
635 void WMRunModalLoop(WMScreen *scr, WMView *view);
637 RContext* WMScreenRContext(WMScreen *scr);
639 Display* WMScreenDisplay(WMScreen *scr);
641 int WMScreenDepth(WMScreen *scr);
645 void WMSetApplicationIconImage(WMScreen *app, RImage *image);
647 RImage* WMGetApplicationIconImage(WMScreen *app);
649 void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
651 WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
653 /* If color==NULL it will use the default color for panels: ae/aa/ae */
654 WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
656 void WMSetApplicationIconWindow(WMScreen *scr, Window window);
658 void WMSetFocusToWidget(WMWidget *widget);
660 WMEventHook* WMHookEventHandler(WMEventHook *handler);
662 int WMHandleEvent(XEvent *event);
664 Bool WMScreenPending(WMScreen *scr);
666 void WMCreateEventHandler(WMView *view, unsigned long mask,
667 WMEventProc *eventProc, void *clientData);
669 void WMDeleteEventHandler(WMView *view, unsigned long mask,
670 WMEventProc *eventProc, void *clientData);
672 int WMIsDoubleClick(XEvent *event);
674 /*int WMIsTripleClick(XEvent *event);*/
676 void WMNextEvent(Display *dpy, XEvent *event);
678 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
681 /* ....................................................................... */
684 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
685 WMSelectionProcs *procs, void *cdata);
687 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
689 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
690 Time timestamp, WMSelectionCallback *callback,
691 void *cdata);
694 extern char *WMSelectionOwnerDidChangeNotification;
696 /* ....................................................................... */
698 WMArray* WMCreateDragOperationArray(int initialSize);
700 WMDragOperationItem* WMCreateDragOperationItem(WMDragOperationType type,
701 char* text);
703 WMDragOperationType WMGetDragOperationItemType(WMDragOperationItem* item);
705 char* WMGetDragOperationItemText(WMDragOperationItem* item);
707 void WMSetViewDragImage(WMView* view, WMPixmap *dragImage);
709 void WMReleaseViewDragImage(WMView* view);
711 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
713 Bool WMIsDraggingFromView(WMView *view);
715 void WMDragImageFromView(WMView *view, XEvent *event);
717 /* Create a drag handler, associating drag event masks with dragEventProc */
718 void WMCreateDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
720 void WMDeleteDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
722 /* set default drag handler for view */
723 void WMSetViewDraggable(WMView *view, WMDragSourceProcs *procs, WMPixmap *dragImage);
725 void WMUnsetViewDraggable(WMView *view);
727 void WMRegisterViewForDraggedTypes(WMView *view, WMArray *acceptedTypes);
729 void WMUnregisterViewDraggedTypes(WMView *view);
731 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
733 /* ....................................................................... */
735 //Bool WMHasAntialiasingSupport(WMScreen *scrPtr);
737 Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
739 /* ....................................................................... */
741 WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
743 WMFont* WMCopyFontWithStyle(WMScreen *scrPtr, WMFont *font, WMFontStyle style);
745 WMFont* WMRetainFont(WMFont *font);
747 void WMReleaseFont(WMFont *font);
749 char* WMGetFontName(WMFont *font);
751 unsigned int WMFontHeight(WMFont *font);
753 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
755 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
757 WMFont* WMDefaultSystemFont(WMScreen *scrPtr);
759 WMFont* WMDefaultBoldSystemFont(WMScreen *scrPtr);
761 WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
763 WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
765 /* ....................................................................... */
767 WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
769 void WMReleasePixmap(WMPixmap *pixmap);
771 WMPixmap* WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
772 Bool masked);
774 WMPixmap* WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
775 Pixmap mask, int width, int height,
776 int depth);
778 WMPixmap* WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
779 int threshold);
781 WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
783 WMSize WMGetPixmapSize(WMPixmap *pixmap);
785 WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
787 WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
788 RColor *color);
790 WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
791 RColor *color);
793 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
795 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
797 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
799 WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
801 /* ....................................................................... */
804 WMColor* WMDarkGrayColor(WMScreen *scr);
806 WMColor* WMGrayColor(WMScreen *scr);
808 WMColor* WMBlackColor(WMScreen *scr);
810 WMColor* WMWhiteColor(WMScreen *scr);
812 void WMSetColorInGC(WMColor *color, GC gc);
814 GC WMColorGC(WMColor *color);
816 WMPixel WMColorPixel(WMColor *color);
818 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
819 unsigned int width, unsigned int height);
821 void WMReleaseColor(WMColor *color);
823 WMColor* WMRetainColor(WMColor *color);
825 WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
826 unsigned short green, unsigned short blue,
827 Bool exact);
829 WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
830 unsigned short green, unsigned short blue,
831 unsigned short alpha, Bool exact);
833 WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
835 void WMSetColorAlpha(WMColor *color, unsigned short alpha);
837 unsigned short WMRedComponentOfColor(WMColor *color);
839 unsigned short WMGreenComponentOfColor(WMColor *color);
841 unsigned short WMBlueComponentOfColor(WMColor *color);
843 unsigned short WMGetColorAlpha(WMColor *color);
845 char* WMGetColorRGBDescription(WMColor *color);
847 /* ....................................................................... */
850 void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
851 int x, int y, char *text, int length);
853 void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
854 WMColor *background, WMFont *font, int x, int y,
855 char *text, int length);
857 int WMWidthOfString(WMFont *font, char *text, int length);
861 /* ....................................................................... */
863 WMScreen* WMWidgetScreen(WMWidget *w);
865 unsigned int WMScreenWidth(WMScreen *scr);
867 unsigned int WMScreenHeight(WMScreen *scr);
869 void WMUnmapWidget(WMWidget *w);
871 void WMMapWidget(WMWidget *w);
873 Bool WMWidgetIsMapped(WMWidget *w);
875 void WMRaiseWidget(WMWidget *w);
877 void WMLowerWidget(WMWidget *w);
879 void WMMoveWidget(WMWidget *w, int x, int y);
881 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
883 void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
885 WMColor* WMGetWidgetBackgroundColor(WMWidget *w);
887 void WMMapSubwidgets(WMWidget *w);
889 void WMUnmapSubwidgets(WMWidget *w);
891 void WMRealizeWidget(WMWidget *w);
893 void WMReparentWidget(WMWidget *w, WMWidget *newParent, int x, int y);
895 void WMDestroyWidget(WMWidget *widget);
897 void WMHangData(WMWidget *widget, void *data);
899 void* WMGetHangedData(WMWidget *widget);
901 unsigned int WMWidgetWidth(WMWidget *w);
903 unsigned int WMWidgetHeight(WMWidget *w);
905 Window WMWidgetXID(WMWidget *w);
907 Window WMViewXID(WMView *view);
909 void WMRedisplayWidget(WMWidget *w);
911 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
913 void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
914 int rightOffs, int bottomOffs);
916 WMSize WMGetViewSize(WMView *view);
918 WMPoint WMGetViewPosition(WMView *view);
920 WMPoint WMGetViewScreenPosition(WMView *view);
922 WMWidget* WMWidgetOfView(WMView *view);
924 void WMSetViewNextResponder(WMView *view, WMView *responder);
926 void WMRelayToNextResponder(WMView *view, XEvent *event);
928 /* notifications */
929 extern char *WMViewSizeDidChangeNotification;
931 extern char *WMViewFocusDidChangeNotification;
933 extern char *WMViewRealizedNotification;
936 /* ....................................................................... */
938 void WMSetBalloonTextForView(char *text, WMView *view);
940 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
942 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
944 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
946 void WMSetBalloonDelay(WMScreen *scr, int delay);
948 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
951 /* ....................................................................... */
953 WMWindow* WMCreateWindow(WMScreen *screen, char *name);
955 WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
957 WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
958 int style);
960 WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
962 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
964 void WMSetWindowTitle(WMWindow *wPtr, char *title);
966 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
968 void WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap);
970 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
972 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
974 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
976 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
977 int maxX, int maxY);
979 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
981 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
983 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
985 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
987 void WMSetWindowLevel(WMWindow *win, int level);
989 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
991 void WMCloseWindow(WMWindow *win);
993 /* ....................................................................... */
995 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
997 #define WMCreateCommandButton(parent) \
998 WMCreateCustomButton((parent), WBBSpringLoadedMask\
999 |WBBPushInMask\
1000 |WBBPushLightMask\
1001 |WBBPushChangeMask)
1003 #define WMCreateRadioButton(parent) \
1004 WMCreateButton((parent), WBTRadio)
1006 #define WMCreateSwitchButton(parent) \
1007 WMCreateButton((parent), WBTSwitch)
1009 WMButton* WMCreateButton(WMWidget *parent, WMButtonType type);
1011 WMButton* WMCreateCustomButton(WMWidget *parent, int behaviourMask);
1013 void WMSetButtonImageDefault(WMButton *bPtr);
1015 void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
1017 void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
1019 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
1021 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
1023 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
1025 void WMSetButtonText(WMButton *bPtr, char *text);
1027 void WMSetButtonAltText(WMButton *bPtr, char *text);
1029 void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
1031 void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
1033 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
1035 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
1037 int WMGetButtonSelected(WMButton *bPtr);
1039 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
1041 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
1043 int WMGetButtonEnabled(WMButton *bPtr);
1045 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
1047 void WMSetButtonTag(WMButton *bPtr, int tag);
1049 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
1051 void WMPerformButtonClick(WMButton *bPtr);
1053 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
1055 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
1057 /* ....................................................................... */
1059 WMLabel* WMCreateLabel(WMWidget *parent);
1061 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1063 void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
1065 WMPixmap* WMGetLabelImage(WMLabel *lPtr);
1067 char* WMGetLabelText(WMLabel *lPtr);
1069 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1071 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1073 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1075 void WMSetLabelText(WMLabel *lPtr, char *text);
1077 WMFont* WMGetLabelFont(WMLabel *lPtr);
1079 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1081 void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
1083 /* ....................................................................... */
1085 WMFrame* WMCreateFrame(WMWidget *parent);
1087 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1089 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1091 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1093 /* ....................................................................... */
1095 WMTextField* WMCreateTextField(WMWidget *parent);
1097 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1099 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1101 /* you can free the returned string */
1102 char* WMGetTextFieldText(WMTextField *tPtr);
1104 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1106 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1108 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1110 WMFont* WMGetTextFieldFont(WMTextField *tPtr);
1112 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1114 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1116 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1118 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1120 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1122 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1124 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1126 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1128 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1130 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1132 WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
1134 extern char *WMTextDidChangeNotification;
1135 extern char *WMTextDidBeginEditingNotification;
1136 extern char *WMTextDidEndEditingNotification;
1138 /* ....................................................................... */
1140 WMScroller* WMCreateScroller(WMWidget *parent);
1142 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1143 float knobProportion);
1145 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1147 float WMGetScrollerValue(WMScroller *sPtr);
1149 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1151 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1153 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1154 WMScrollArrowPosition position);
1156 extern char *WMScrollerDidScrollNotification;
1158 /* ....................................................................... */
1160 WMList* WMCreateList(WMWidget *parent);
1162 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1164 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1166 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1168 WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
1170 void WMSortListItems(WMList *lPtr);
1172 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1174 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1176 WMListItem* WMGetListItem(WMList *lPtr, int row);
1178 WMArray* WMGetListItems(WMList *lPtr);
1180 void WMRemoveListItem(WMList *lPtr, int row);
1182 void WMSelectListItem(WMList *lPtr, int row);
1184 void WMUnselectListItem(WMList *lPtr, int row);
1186 /* This will select all items in range, and deselect all the others */
1187 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1189 /* This will select all items in range, leaving the others as they are */
1190 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1192 void WMSelectAllListItems(WMList *lPtr);
1194 void WMUnselectAllListItems(WMList *lPtr);
1196 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1198 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1200 int WMGetListItemHeight(WMList *lPtr);
1202 /* don't free the returned data */
1203 WMArray* WMGetListSelectedItems(WMList *lPtr);
1206 * For the following 2 functions, in case WMList allows multiple selection,
1207 * the first item in the list of selected items, respective its row number,
1208 * will be returned.
1211 /* don't free the returned data */
1212 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1214 int WMGetListSelectedItemRow(WMList *lPtr);
1216 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1218 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1220 void WMClearList(WMList *lPtr);
1222 int WMGetListNumberOfRows(WMList *lPtr);
1224 void WMSetListPosition(WMList *lPtr, int row);
1226 void WMSetListBottomPosition(WMList *lPtr, int row);
1228 int WMGetListPosition(WMList *lPtr);
1230 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1232 Bool WMListAllowsEmptySelection(WMList *lPtr);
1235 extern char *WMListDidScrollNotification;
1236 extern char *WMListSelectionDidChangeNotification;
1238 /* ....................................................................... */
1240 WMBrowser* WMCreateBrowser(WMWidget *parent);
1242 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1244 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1246 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1248 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1250 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1252 int WMAddBrowserColumn(WMBrowser *bPtr);
1254 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1256 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1258 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1260 WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1262 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1264 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1265 WMCompareDataProc *func);
1267 /* Don't free the returned string. */
1268 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1270 /* free the returned string */
1271 char* WMGetBrowserPath(WMBrowser *bPtr);
1273 /* free the returned string */
1274 char* WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1276 /* free the returned array */
1277 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1279 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1281 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1282 void *clientData);
1284 WMListItem* WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1286 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1288 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1290 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1292 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1294 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1296 WMList* WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1298 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1300 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1302 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1304 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1306 /* ....................................................................... */
1309 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1311 WMMenuItem* WMCreateMenuItem(void);
1313 void WMDestroyMenuItem(WMMenuItem *item);
1315 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1317 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1319 char* WMGetMenuItemShortcut(WMMenuItem *item);
1321 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1323 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1325 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1327 void* WMGetMenuItemRepresentedObject(WMMenuItem *item);
1329 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1331 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1333 WMAction* WMGetMenuItemAction(WMMenuItem *item);
1335 void* WMGetMenuItemData(WMMenuItem *item);
1337 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1339 char* WMGetMenuItemTitle(WMMenuItem *item);
1341 void WMSetMenuItemState(WMMenuItem *item, int state);
1343 int WMGetMenuItemState(WMMenuItem *item);
1345 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1347 WMPixmap* WMGetMenuItemPixmap(WMMenuItem *item);
1349 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1351 WMPixmap* WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1353 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1355 WMPixmap* WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1357 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1359 WMPixmap* WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1361 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1364 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1366 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1369 /* ....................................................................... */
1371 WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
1373 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1374 void *clientData);
1376 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1378 WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1380 WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1381 char *title);
1383 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1385 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1387 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1389 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1391 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1393 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1395 /* don't free the returned data */
1396 char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1398 WMMenuItem* WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1400 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1402 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1404 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1406 /* ....................................................................... */
1408 WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
1410 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1412 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1414 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1416 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1418 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1420 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1423 /* ....................................................................... */
1425 WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
1427 void WMFreeColorPanel(WMColorPanel *panel);
1429 void WMShowColorPanel(WMColorPanel *panel);
1431 void WMCloseColorPanel(WMColorPanel *panel);
1433 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1435 WMColor* WMGetColorPanelColor(WMColorPanel *panel);
1437 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1439 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1441 extern char *WMColorPanelColorChangedNotification;
1443 /* ....................................................................... */
1445 WMColorWell* WMCreateColorWell(WMWidget *parent);
1447 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1449 WMColor* WMGetColorWellColor(WMColorWell *cPtr);
1451 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1454 extern char *WMColorWellDidChangeNotification;
1457 /* ...................................................................... */
1459 WMScrollView* WMCreateScrollView(WMWidget *parent);
1461 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1462 unsigned int height);
1464 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1466 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1468 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1470 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1472 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1474 WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1476 WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1478 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1480 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1482 /* ....................................................................... */
1484 WMSlider* WMCreateSlider(WMWidget *parent);
1486 int WMGetSliderMinValue(WMSlider *slider);
1488 int WMGetSliderMaxValue(WMSlider *slider);
1490 int WMGetSliderValue(WMSlider *slider);
1492 void WMSetSliderMinValue(WMSlider *slider, int value);
1494 void WMSetSliderMaxValue(WMSlider *slider, int value);
1496 void WMSetSliderValue(WMSlider *slider, int value);
1498 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1500 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1502 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1504 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1506 /* ....................................................................... */
1509 WMSplitView* WMCreateSplitView(WMWidget *parent);
1511 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1513 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1515 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1517 WMView* WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1519 /* remove the first subview == view */
1520 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1522 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1525 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1527 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1529 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1530 WMSplitViewConstrainProc *proc);
1533 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1534 WMSplitViewResizeSubviewsProc *proc);
1537 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1539 /* ...................................................................... */
1541 WMRuler* WMCreateRuler (WMWidget *parent);
1543 WMRulerMargins* WMGetRulerMargins(WMRuler *rPtr);
1545 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1547 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin);
1549 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1551 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1553 int WMGetRulerOffset(WMRuler *rPtr);
1555 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1557 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1559 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1561 /* ....................................................................... */
1564 #define WMCreateText(parent) WMCreateTextForDocumentType \
1565 ((parent), (NULL), (NULL))
1567 WMText* WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser,
1568 WMAction *writer);
1570 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1572 void WMFreezeText(WMText *tPtr);
1574 #define WMRefreshText(tPtr) WMThawText((tPtr))
1576 void WMThawText(WMText *tPtr);
1578 int WMScrollText(WMText *tPtr, int amount);
1580 int WMPageText(WMText *tPtr, Bool direction);
1582 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1584 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1586 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1588 void WMShowTextRuler(WMText *tPtr, Bool show);
1590 int WMGetTextRulerShown(WMText *tPtr);
1592 void WMSetTextEditable(WMText *tPtr, Bool editable);
1594 int WMGetTextEditable(WMText *tPtr);
1596 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1598 int WMGetTextUsesMonoFont(WMText *tPtr);
1600 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1602 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1604 int WMGetTextIgnoresNewline(WMText *tPtr);
1606 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1608 WMFont* WMGetTextDefaultFont(WMText *tPtr);
1610 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1612 WMColor* WMGetTextDefaultColor(WMText *tPtr);
1614 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1616 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1618 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1620 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1622 void WMPrependTextStream(WMText *tPtr, char *text);
1624 void WMAppendTextStream(WMText *tPtr, char *text);
1626 #define WMClearText(tPtr) WMAppendTextStream \
1627 ((tPtr), (NULL))
1629 /* free the text */
1630 char* WMGetTextStream(WMText *tPtr);
1632 /* free the text */
1633 char* WMGetTextSelectedStream(WMText *tPtr);
1635 /* destroy the array */
1636 WMArray* WMGetTextObjects(WMText *tPtr);
1638 /* destroy the array */
1639 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1641 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1643 WMColor* WMGetTextSelectionColor(WMText *tPtr);
1645 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1647 WMFont* WMGetTextSelectionFont(WMText *tPtr);
1649 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1651 int WMGetTextSelectionUnderlined(WMText *tPtr);
1653 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1655 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1656 Bool caseSensitive);
1658 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1661 /* parser related stuff... use only if implementing a new parser */
1663 void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1664 WMColor *color, unsigned short first,
1665 unsigned short extraInfo);
1667 void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1668 WMColor *color, unsigned short first,
1669 unsigned short extraInfo);
1671 void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1672 WMColor *color, unsigned short first,
1673 unsigned short length);
1675 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1676 unsigned int kanji, unsigned int underlined,
1677 int script, WMRulerMargins *margins);
1679 /* do NOT free the margins */
1680 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1681 unsigned int *kanji, unsigned int *underlined,
1682 int *script, WMRulerMargins *margins);
1684 int WMGetTextInsertType(WMText *tPtr);
1686 /*int WMGetTextBlocks(WMText *tPtr);
1688 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1690 int WMGetCurrentTextBlock(WMText *tPtr);*/
1692 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1694 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1696 void* WMRemoveTextBlock(WMText *tPtr);
1698 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1700 /* ....................................................................... */
1703 WMTabView* WMCreateTabView(WMWidget *parent);
1705 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1707 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1709 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1711 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1713 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1715 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1717 WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1718 int identifier, char *label);
1720 WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1722 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1724 void WMSelectLastTabViewItem(WMTabView *tPtr);
1726 void WMSelectNextTabViewItem(WMTabView *tPtr);
1728 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1730 WMTabViewItem* WMGetSelectedTabViewItem(WMTabView *tPtr);
1732 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1734 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1736 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1739 WMTabViewItem* WMCreateTabViewItemWithIdentifier(int identifier);
1741 void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
1743 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1745 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1747 char* WMGetTabViewItemLabel(WMTabViewItem *item);
1749 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1751 WMView* WMGetTabViewItemView(WMTabViewItem *item);
1753 void WMDestroyTabViewItem(WMTabViewItem *item);
1756 /* ....................................................................... */
1758 WMBox* WMCreateBox(WMWidget *parent);
1760 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1762 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1763 int minSize, int maxSize, int space);
1765 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1766 int minSize, int maxSize, int space);
1768 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1770 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1772 /* ....................................................................... */
1774 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1775 char *defaultButton, char *alternateButton,
1776 char *otherButton);
1778 /* you can free the returned string */
1779 char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1780 char *defaultText, char *okButton, char *cancelButton);
1782 WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1783 char *msg, char *defaultButton,
1784 char *alternateButton, char *otherButton);
1786 WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1787 char *msg, char *defaultText, char *okButton,
1788 char *cancelButton);
1791 WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
1792 char *title, char *defaultButton,
1793 char *alternateButton);
1795 void WMDestroyAlertPanel(WMAlertPanel *panel);
1797 void WMDestroyInputPanel(WMInputPanel *panel);
1799 void WMDestroyGenericPanel(WMGenericPanel *panel);
1801 /* ....................................................................... */
1803 /* only 1 instance per WMScreen */
1804 WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
1806 WMSavePanel* WMGetSavePanel(WMScreen *scrPtr);
1808 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1810 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1812 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1814 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1816 /* you can free the returned string */
1817 char* WMGetFilePanelFileName(WMFilePanel *panel);
1819 void WMFreeFilePanel(WMFilePanel *panel);
1821 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1822 char *path, char *name, char **fileTypes);
1824 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1826 WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
1829 /* ...................................................................... */
1831 /* only 1 instance per WMScreen */
1832 WMFontPanel* WMGetFontPanel(WMScreen *scr);
1834 void WMShowFontPanel(WMFontPanel *panel);
1836 void WMHideFontPanel(WMFontPanel *panel);
1838 void WMFreeFontPanel(WMFontPanel *panel);
1840 void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
1842 void WMSetFontPanelFont(WMFontPanel *panel, char *fontName);
1844 WMFont* WMGetFontPanelFont(WMFontPanel *panel);
1846 #ifdef __cplusplus
1848 #endif /* __cplusplus */
1850 #endif