- added WMCopyFontWithChanges() a more generic and powerful function, meant
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blob24b57e2b1b8a0f2a186168ec5c9c2cc556a75870
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 20021008
13 #ifdef __cplusplus
14 extern "C" {
15 #endif /* __cplusplus */
16 #if 0
18 #endif
21 typedef unsigned long WMPixel;
24 typedef struct {
25 unsigned int width;
26 unsigned int height;
27 } WMSize;
29 typedef struct {
30 int x;
31 int y;
32 } WMPoint;
34 typedef struct {
35 WMPoint pos;
36 WMSize size;
37 } WMRect;
43 #define ClientMessageMask (1L<<30)
46 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
47 #define _DEFINED_GNUSTEP_WINDOW_INFO
49 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
50 * NSDesktopWindowLevel intended to be the level at which things
51 * on the desktop sit ... so you should be able
52 * to put a desktop background just below it.
54 * Applications are actually permitted to use any value in the
55 * range INT_MIN+1 to INT_MAX
57 enum {
58 WMDesktopWindowLevel = -1000, /* GNUstep addition */
59 WMNormalWindowLevel = 0,
60 WMFloatingWindowLevel = 3,
61 WMSubmenuWindowLevel = 3,
62 WMTornOffMenuWindowLevel = 3,
63 WMMainMenuWindowLevel = 20,
64 WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */
65 WMStatusWindowLevel = 21,
66 WMModalPanelWindowLevel = 100,
67 WMPopUpMenuWindowLevel = 101,
68 WMScreenSaverWindowLevel = 1000
72 /* window attributes */
73 enum {
74 WMBorderlessWindowMask = 0,
75 WMTitledWindowMask = 1,
76 WMClosableWindowMask = 2,
77 WMMiniaturizableWindowMask = 4,
78 WMResizableWindowMask = 8,
79 WMIconWindowMask = 64,
80 WMMiniWindowMask = 128
82 #endif
85 /* button types */
86 typedef enum {
87 /* 0 is reserved for internal use */
88 WBTMomentaryPush = 1,
89 WBTPushOnPushOff = 2,
90 WBTToggle = 3,
91 WBTSwitch = 4,
92 WBTRadio = 5,
93 WBTMomentaryChange = 6,
94 WBTOnOff = 7,
95 WBTMomentaryLight = 8
96 } WMButtonType;
98 /* button behaviour masks */
99 enum {
100 WBBSpringLoadedMask = (1 << 0),
101 WBBPushInMask = (1 << 1),
102 WBBPushChangeMask = (1 << 2),
103 WBBPushLightMask = (1 << 3),
104 WBBStateLightMask = (1 << 5),
105 WBBStateChangeMask = (1 << 6),
106 WBBStatePushMask = (1 << 7)
110 /* Font flags */
111 typedef enum {
112 WFDefaultFont = 0,
113 WFNormalFont = (1<<0),
114 WFFontSet = (1<<1),
115 WFAntialiased = (1<<2),
116 WFNotAntialiased = (1<<3)
117 } WMFontFlags;
120 /* Use default system font size in system font name */
121 enum {
122 WFDefaultSize = -1
126 /* frame title positions */
127 typedef enum {
128 WTPNoTitle,
129 WTPAboveTop,
130 WTPAtTop,
131 WTPBelowTop,
132 WTPAboveBottom,
133 WTPAtBottom,
134 WTPBelowBottom
135 } WMTitlePosition;
138 /* relief types */
139 typedef enum {
140 WRFlat,
141 WRSimple,
142 WRRaised,
143 WRSunken,
144 WRGroove,
145 WRRidge,
146 WRPushed
147 } WMReliefType;
150 /* alignment types */
151 typedef enum {
152 WALeft,
153 WACenter,
154 WARight,
155 WAJustified /* not valid for textfields */
156 } WMAlignment;
159 /* image position */
160 typedef enum {
161 WIPNoImage,
162 WIPImageOnly,
163 WIPLeft,
164 WIPRight,
165 WIPBelow,
166 WIPAbove,
167 WIPOverlaps
168 } WMImagePosition;
171 /* scroller arrow position */
172 typedef enum {
173 WSAMaxEnd,
174 WSAMinEnd,
175 WSANone
176 } WMScrollArrowPosition;
178 /* scroller parts */
179 typedef enum {
180 WSNoPart,
181 WSDecrementPage,
182 WSIncrementPage,
183 WSDecrementLine,
184 WSIncrementLine,
185 WSDecrementWheel,
186 WSIncrementWheel,
187 WSKnob,
188 WSKnobSlot
189 } WMScrollerPart;
191 /* usable scroller parts */
192 typedef enum {
193 WSUNoParts,
194 WSUOnlyArrows,
195 WSUAllParts
196 } WMUsableScrollerParts;
198 /* matrix types */
199 typedef enum {
200 WMRadioMode,
201 WMHighlightMode,
202 WMListMode,
203 WMTrackMode
204 } WMMatrixTypes;
207 typedef enum {
208 WTTopTabsBevelBorder,
209 WTNoTabsBevelBorder,
210 WTNoTabsLineBorder,
211 WTNoTabsNoBorder
212 } WMTabViewType;
215 /* text movement types */
216 enum {
217 WMIllegalTextMovement,
218 WMReturnTextMovement,
219 WMEscapeTextMovement,
220 WMTabTextMovement,
221 WMBacktabTextMovement,
222 WMLeftTextMovement,
223 WMRightTextMovement,
224 WMUpTextMovement,
225 WMDownTextMovement
228 /* text field special events */
229 enum {
230 WMInsertTextEvent,
231 WMDeleteTextEvent
235 enum {
236 WLNotFound = -1 /* element was not found in WMList */
240 /* drag operations */
241 typedef enum {
242 WDOperationNone,
243 WDOperationCopy,
244 WDOperationMove,
245 WDOperationLink,
246 WDOperationAsk,
247 WDOperationPrivate
248 } WMDragOperationType;
251 typedef enum {
252 WMGrayModeColorPanel = 1,
253 WMRGBModeColorPanel = 2,
254 WMCMYKModeColorPanel = 3,
255 WMHSBModeColorPanel = 4,
256 WMCustomPaletteModeColorPanel = 5,
257 WMColorListModeColorPanel = 6,
258 WMWheelModeColorPanel = 7
259 } WMColorPanelMode;
263 /* system images */
264 #define WSIReturnArrow 1
265 #define WSIHighlightedReturnArrow 2
266 #define WSIScrollerDimple 3
267 #define WSIArrowLeft 4
268 #define WSIHighlightedArrowLeft 5
269 #define WSIArrowRight 6
270 #define WSIHighlightedArrowRight 7
271 #define WSIArrowUp 8
272 #define WSIHighlightedArrowUp 9
273 #define WSIArrowDown 10
274 #define WSIHighlightedArrowDown 11
275 #define WSICheckMark 12
277 enum {
278 WLDSSelected = (1 << 16),
279 WLDSDisabled = (1 << 17),
280 WLDSFocused = (1 << 18),
281 WLDSIsBranch = (1 << 19)
284 /* alert panel return values */
285 enum {
286 WAPRDefault = 0,
287 WAPRAlternate = 1,
288 WAPROther = -1,
289 WAPRError = -2
294 /* types of input observers */
295 enum {
296 WIReadMask = (1 << 0),
297 WIWriteMask = (1 << 1),
298 WIExceptMask = (1 << 2)
303 typedef int W_Class;
305 enum {
306 WC_Window = 0,
307 WC_Frame = 1,
308 WC_Label = 2,
309 WC_Button = 3,
310 WC_TextField = 4,
311 WC_Scroller = 5,
312 WC_ScrollView = 6,
313 WC_List = 7,
314 WC_Browser = 8,
315 WC_PopUpButton = 9,
316 WC_ColorWell = 10,
317 WC_Slider = 11,
318 WC_Matrix = 12, /* not ready */
319 WC_SplitView = 13,
320 WC_TabView = 14,
321 WC_ProgressIndicator = 15,
322 WC_MenuView = 16,
323 WC_Ruler = 17,
324 WC_Text = 18,
325 WC_Box = 19
328 /* All widgets must start with the following structure
329 * in that order. Used for typecasting to get some generic data */
330 typedef struct W_WidgetType {
331 W_Class widgetClass;
332 struct W_View *view;
334 } W_WidgetType;
337 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
338 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
341 /* widgets */
343 typedef void WMWidget;
345 typedef struct W_Pixmap WMPixmap;
346 typedef struct W_Font WMFont;
347 typedef struct W_Color WMColor;
349 typedef struct W_Screen WMScreen;
351 typedef struct W_View WMView;
353 typedef struct W_Window WMWindow;
354 typedef struct W_Frame WMFrame;
355 typedef struct W_Button WMButton;
356 typedef struct W_Label WMLabel;
357 typedef struct W_TextField WMTextField;
358 typedef struct W_Scroller WMScroller;
359 typedef struct W_ScrollView WMScrollView;
360 typedef struct W_List WMList;
361 typedef struct W_Browser WMBrowser;
362 typedef struct W_PopUpButton WMPopUpButton;
363 typedef struct W_ProgressIndicator WMProgressIndicator;
364 typedef struct W_ColorWell WMColorWell;
365 typedef struct W_Slider WMSlider;
366 typedef struct W_Matrix WMMatrix; /* not ready */
367 typedef struct W_SplitView WMSplitView;
368 typedef struct W_TabView WMTabView;
369 typedef struct W_Ruler WMRuler;
370 typedef struct W_Text WMText;
371 typedef struct W_Box WMBox;
374 /* not widgets */
375 typedef struct W_TabViewItem WMTabViewItem;
376 typedef struct W_MenuItem WMMenuItem;
379 typedef struct W_FilePanel WMFilePanel;
380 typedef WMFilePanel WMOpenPanel;
381 typedef WMFilePanel WMSavePanel;
383 typedef struct W_FontPanel WMFontPanel;
385 typedef struct W_ColorPanel WMColorPanel;
388 /* item for WMList */
389 typedef struct WMListItem {
390 char *text;
391 void *clientData; /* ptr for user clientdata. */
393 unsigned int uflags:16; /* flags for the user */
394 unsigned int selected:1;
395 unsigned int disabled:1;
396 unsigned int isBranch:1;
397 unsigned int loaded:1;
398 } WMListItem;
400 /* struct for message panel */
401 typedef struct WMAlertPanel {
402 WMWindow *win; /* window */
403 WMBox *vbox;
404 WMBox *hbox;
405 WMButton *defBtn; /* default button */
406 WMButton *altBtn; /* alternative button */
407 WMButton *othBtn; /* other button */
408 WMLabel *iLbl; /* icon label */
409 WMLabel *tLbl; /* title label */
410 WMLabel *mLbl; /* message label */
411 WMFrame *line; /* separator */
412 short result; /* button that was pushed */
413 } WMAlertPanel;
416 typedef struct WMGenericPanel {
417 WMWindow *win;
418 WMBox *vbox;
420 WMLabel *iLbl;
421 WMLabel *tLbl;
423 WMFrame *line;
425 WMFrame *content;
427 WMBox *buttonBox;
428 WMButton *defBtn;
429 WMButton *altBtn;
431 short result;
432 } WMGenericPanel;
435 typedef struct WMInputPanel {
436 WMWindow *win; /* window */
437 WMButton *defBtn; /* default button */
438 WMButton *altBtn; /* alternative button */
439 WMLabel *tLbl; /* title label */
440 WMLabel *mLbl; /* message label */
441 WMTextField *text; /* text field */
442 short result; /* button that was pushed */
443 } WMInputPanel;
447 #define WFAUnchanged (NULL)
448 /* Struct for font change operations */
449 typedef struct WMFontAttributes {
450 char *foundry;
451 char *family;
452 char *weight;
453 char *slant;
454 char *setWidth;
455 char *addStyle;
456 char *pixelSize;
457 char *pointSize;
458 char *resolutionX;
459 char *resolutionY;
460 char *spacing;
461 char *averageWidth;
462 char *registry;
463 char *encoding;
464 } WMFontAttributes;
466 extern const WMFontAttributes *WFANormal;
467 extern const WMFontAttributes *WFABold;
468 extern const WMFontAttributes *WFANonBold;
469 extern const WMFontAttributes *WFAEmphasized;
470 extern const WMFontAttributes *WFANonEmphasized;
471 extern const WMFontAttributes *WFABoldEmphasized;
474 /* WMRuler: */
475 typedef struct {
476 WMArray *tabs; /* a growable array of tabstops */
477 unsigned short left; /* left margin marker */
478 unsigned short right; /* right margin marker */
479 unsigned short first; /* indentation marker for first line only */
480 unsigned short body; /* body indentation marker */
481 unsigned short retainCount;
482 } WMRulerMargins;
483 /* All indentation and tab markers are _relative_ to the left margin marker */
486 typedef void WMEventProc(XEvent *event, void *clientData);
488 typedef void WMEventHook(XEvent *event);
490 /* self is set to the widget from where the callback is being called and
491 * clientData to the data set to with WMSetClientData() */
492 typedef void WMAction(WMWidget *self, void *clientData);
494 /* same as WMAction, but for stuff that arent widgets */
495 typedef void WMAction2(void *self, void *clientData);
498 typedef void WMDropDataCallback(WMView *view, WMData *data);
500 /* delegate method like stuff */
501 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
502 int state, WMRect *rect);
505 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
506 unsigned int oldWidth,
507 unsigned int oldHeight);
510 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
511 int *minSize, int *maxSize);
513 typedef WMWidget* WMMatrixCreateCellProc(WMMatrix *mPtr);
518 typedef struct WMBrowserDelegate {
519 void *data;
521 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
522 WMBrowser *sender, int column, WMList *list);
524 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
525 int column);
527 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
529 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
530 } WMBrowserDelegate;
533 typedef struct WMTextFieldDelegate {
534 void *data;
536 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
537 WMNotification *notif);
539 void (*didChange)(struct WMTextFieldDelegate *self,
540 WMNotification *notif);
542 void (*didEndEditing)(struct WMTextFieldDelegate *self,
543 WMNotification *notif);
545 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
546 WMTextField *tPtr);
548 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
549 WMTextField *tPtr);
550 } WMTextFieldDelegate;
553 typedef struct WMTextDelegate {
554 void *data;
556 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
557 void *description);
559 } WMTextDelegate;
563 typedef struct WMTabViewDelegate {
564 void *data;
566 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
567 WMTabView *tabView);
569 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
570 WMTabViewItem *item);
572 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
573 WMTabViewItem *item);
575 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
576 WMTabViewItem *item);
577 } WMTabViewDelegate;
582 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
583 Time timestamp, void *cdata, WMData *data);
586 typedef struct WMSelectionProcs {
587 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
588 void *cdata, Atom *type);
589 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
590 void (*selectionDone)(WMView *view, Atom selection, Atom target,
591 void *cdata);
592 } WMSelectionProcs;
595 typedef struct W_DraggingInfo WMDraggingInfo;
598 typedef struct W_DragSourceProcs {
599 unsigned (*draggingSourceOperation)(WMView *self, Bool local);
600 void (*beganDragImage)(WMView *self, WMPixmap *image, WMPoint point);
601 void (*endedDragImage)(WMView *self, WMPixmap *image, WMPoint point,
602 Bool deposited);
603 WMData* (*fetchDragData)(WMView *self, char *type);
604 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
605 } WMDragSourceProcs;
609 typedef struct W_DragDestinationProcs {
610 unsigned (*draggingEntered)(WMView *self, WMDraggingInfo *info);
611 unsigned (*draggingUpdated)(WMView *self, WMDraggingInfo *info);
612 void (*draggingExited)(WMView *self, WMDraggingInfo *info);
613 Bool (*prepareForDragOperation)(WMView *self, WMDraggingInfo *info);
614 Bool (*performDragOperation)(WMView *self, WMDraggingInfo *info);
615 void (*concludeDragOperation)(WMView *self, WMDraggingInfo *info);
616 } WMDragDestinationProcs;
620 /* ...................................................................... */
623 WMPoint wmkpoint(int x, int y);
625 WMSize wmksize(unsigned int width, unsigned int height);
627 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
628 #define wmksize(width, height) (WMSize){(width), (height)}
629 #define wmkpoint(x, y) (WMPoint){(x), (y)}
630 #endif
632 /* ....................................................................... */
636 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
638 void WMSetResourcePath(char *path);
640 /* don't free the returned string */
641 char* WMGetApplicationName();
643 /* Try to locate resource file. ext may be NULL */
644 char* WMPathForResourceOfType(char *resource, char *ext);
647 WMScreen* WMOpenScreen(const char *display);
649 WMScreen* WMCreateScreenWithRContext(Display *display, int screen,
650 RContext *context);
652 WMScreen* WMCreateScreen(Display *display, int screen);
654 WMScreen* WMCreateSimpleApplicationScreen(Display *display);
656 void WMScreenMainLoop(WMScreen *scr);
658 void WMBreakModalLoop(WMScreen *scr);
660 void WMRunModalLoop(WMScreen *scr, WMView *view);
662 RContext* WMScreenRContext(WMScreen *scr);
664 Display* WMScreenDisplay(WMScreen *scr);
666 int WMScreenDepth(WMScreen *scr);
670 void WMSetApplicationIconImage(WMScreen *app, RImage *image);
672 RImage* WMGetApplicationIconImage(WMScreen *app);
674 void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
676 WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
678 /* If color==NULL it will use the default color for panels: ae/aa/ae */
679 WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
681 void WMSetApplicationIconWindow(WMScreen *scr, Window window);
683 void WMSetFocusToWidget(WMWidget *widget);
685 WMEventHook* WMHookEventHandler(WMEventHook *handler);
687 int WMHandleEvent(XEvent *event);
689 Bool WMScreenPending(WMScreen *scr);
691 void WMCreateEventHandler(WMView *view, unsigned long mask,
692 WMEventProc *eventProc, void *clientData);
694 void WMDeleteEventHandler(WMView *view, unsigned long mask,
695 WMEventProc *eventProc, void *clientData);
697 int WMIsDoubleClick(XEvent *event);
699 /*int WMIsTripleClick(XEvent *event);*/
701 void WMNextEvent(Display *dpy, XEvent *event);
703 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
706 /* ....................................................................... */
709 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
710 WMSelectionProcs *procs, void *cdata);
712 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
714 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
715 Time timestamp, WMSelectionCallback *callback,
716 void *cdata);
719 extern char *WMSelectionOwnerDidChangeNotification;
721 /* ....................................................................... */
723 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
725 void WMDragImageFromView(WMView *view, WMPixmap *image, char *dataTypes[],
726 WMPoint atLocation, WMSize mouseOffset, XEvent *event,
727 Bool slideBack);
729 void WMRegisterViewForDraggedTypes(WMView *view, char *acceptedTypes[]);
731 void WMUnregisterViewDraggedTypes(WMView *view);
733 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
736 WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info);
738 /* ....................................................................... */
740 Bool WMHasAntialiasingSupport(WMScreen *scrPtr);
742 Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
744 /* ....................................................................... */
746 WMFont* WMCreateNormalFont(WMScreen *scrPtr, char *fontName);
748 WMFont* WMCreateFontSet(WMScreen *scrPtr, char *fontName);
750 WMFont* WMCreateAntialiasedFont(WMScreen *scrPtr, char *fontName);
752 WMFont* WMCreateAntialiasedFontSet(WMScreen *scrPtr, char *fontName);
754 WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
756 WMFont* WMCreateFontWithFlags(WMScreen *scrPtr, char *fontName,
757 WMFontFlags flags);
759 WMFont* WMCopyFontWithChanges(WMScreen *scrPtr, WMFont *font,
760 const WMFontAttributes *changes);
762 WMFont* WMRetainFont(WMFont *font);
764 void WMReleaseFont(WMFont *font);
766 unsigned int WMFontHeight(WMFont *font);
768 Bool WMIsAntialiasedFont(WMFont *font);
771 WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
773 WMFont* WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
777 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
779 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
781 WMFont* WMDefaultSystemFont(WMScreen *scrPtr);
783 WMFont* WMDefaultBoldSystemFont(WMScreen *scrPtr);
785 WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
787 WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
789 XFontSet WMGetFontFontSet(WMFont *font);
791 /* ....................................................................... */
793 WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
795 void WMReleasePixmap(WMPixmap *pixmap);
797 WMPixmap* WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
798 Bool masked);
800 WMPixmap* WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
801 Pixmap mask, int width, int height,
802 int depth);
804 WMPixmap* WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
805 int threshold);
807 WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
809 WMSize WMGetPixmapSize(WMPixmap *pixmap);
811 WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
813 WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
814 RColor *color);
816 WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
817 RColor *color);
819 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
821 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
823 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
825 WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
827 /* ....................................................................... */
830 WMColor* WMDarkGrayColor(WMScreen *scr);
832 WMColor* WMGrayColor(WMScreen *scr);
834 WMColor* WMBlackColor(WMScreen *scr);
836 WMColor* WMWhiteColor(WMScreen *scr);
838 void WMSetColorInGC(WMColor *color, GC gc);
840 GC WMColorGC(WMColor *color);
842 WMPixel WMColorPixel(WMColor *color);
844 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
845 unsigned int width, unsigned int height);
847 void WMReleaseColor(WMColor *color);
849 WMColor* WMRetainColor(WMColor *color);
851 WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
852 unsigned short green, unsigned short blue,
853 Bool exact);
855 WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
856 unsigned short green, unsigned short blue,
857 unsigned short alpha, Bool exact);
859 WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
861 void WMSetColorAlpha(WMColor *color, unsigned short alpha);
863 unsigned short WMRedComponentOfColor(WMColor *color);
865 unsigned short WMGreenComponentOfColor(WMColor *color);
867 unsigned short WMBlueComponentOfColor(WMColor *color);
869 unsigned short WMGetColorAlpha(WMColor *color);
871 char* WMGetColorRGBDescription(WMColor *color);
873 /* ....................................................................... */
876 void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
877 int x, int y, char *text, int length);
879 void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
880 WMColor *background, WMFont *font, int x, int y,
881 char *text, int length);
883 int WMWidthOfString(WMFont *font, char *text, int length);
887 /* ....................................................................... */
889 WMScreen* WMWidgetScreen(WMWidget *w);
891 unsigned int WMScreenWidth(WMScreen *scr);
893 unsigned int WMScreenHeight(WMScreen *scr);
895 void WMUnmapWidget(WMWidget *w);
897 void WMMapWidget(WMWidget *w);
899 Bool WMWidgetIsMapped(WMWidget *w);
901 void WMRaiseWidget(WMWidget *w);
903 void WMLowerWidget(WMWidget *w);
905 void WMMoveWidget(WMWidget *w, int x, int y);
907 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
909 void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
911 void WMMapSubwidgets(WMWidget *w);
913 void WMUnmapSubwidgets(WMWidget *w);
915 void WMRealizeWidget(WMWidget *w);
917 void WMReparentWidget(WMWidget *w, WMWidget *newParent, int x, int y);
919 void WMDestroyWidget(WMWidget *widget);
921 void WMHangData(WMWidget *widget, void *data);
923 void* WMGetHangedData(WMWidget *widget);
925 unsigned int WMWidgetWidth(WMWidget *w);
927 unsigned int WMWidgetHeight(WMWidget *w);
929 Window WMWidgetXID(WMWidget *w);
931 Window WMViewXID(WMView *view);
933 void WMRedisplayWidget(WMWidget *w);
935 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
937 void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
938 int rightOffs, int bottomOffs);
940 WMSize WMGetViewSize(WMView *view);
942 WMPoint WMGetViewPosition(WMView *view);
944 WMPoint WMGetViewScreenPosition(WMView *view);
946 WMWidget* WMWidgetOfView(WMView *view);
948 void WMSetViewNextResponder(WMView *view, WMView *responder);
950 void WMRelayToNextResponder(WMView *view, XEvent *event);
952 /* notifications */
953 extern char *WMViewSizeDidChangeNotification;
955 extern char *WMViewFocusDidChangeNotification;
957 extern char *WMViewRealizedNotification;
960 /* ....................................................................... */
962 void WMSetBalloonTextForView(char *text, WMView *view);
964 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
966 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
968 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
970 void WMSetBalloonDelay(WMScreen *scr, int delay);
972 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
975 /* ....................................................................... */
977 WMWindow* WMCreateWindow(WMScreen *screen, char *name);
979 WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
981 WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
982 int style);
984 WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
986 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
988 void WMSetWindowTitle(WMWindow *wPtr, char *title);
990 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
992 void WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap);
994 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
996 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
998 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
1000 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
1001 int maxX, int maxY);
1003 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
1005 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
1007 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
1009 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
1011 void WMSetWindowLevel(WMWindow *win, int level);
1013 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
1015 void WMCloseWindow(WMWindow *win);
1017 /* ....................................................................... */
1019 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
1021 #define WMCreateCommandButton(parent) \
1022 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1023 |WBBPushInMask\
1024 |WBBPushLightMask\
1025 |WBBPushChangeMask)
1027 #define WMCreateRadioButton(parent) \
1028 WMCreateButton((parent), WBTRadio)
1030 #define WMCreateSwitchButton(parent) \
1031 WMCreateButton((parent), WBTSwitch)
1033 WMButton* WMCreateButton(WMWidget *parent, WMButtonType type);
1035 WMButton* WMCreateCustomButton(WMWidget *parent, int behaviourMask);
1037 void WMSetButtonImageDefault(WMButton *bPtr);
1039 void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
1041 void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
1043 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
1045 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
1047 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
1049 void WMSetButtonText(WMButton *bPtr, char *text);
1051 void WMSetButtonAltText(WMButton *bPtr, char *text);
1053 void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
1055 void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
1057 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
1059 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
1061 int WMGetButtonSelected(WMButton *bPtr);
1063 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
1065 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
1067 int WMGetButtonEnabled(WMButton *bPtr);
1069 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
1071 void WMSetButtonTag(WMButton *bPtr, int tag);
1073 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
1075 void WMPerformButtonClick(WMButton *bPtr);
1077 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
1079 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
1081 /* ....................................................................... */
1083 WMLabel* WMCreateLabel(WMWidget *parent);
1085 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1087 void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
1089 WMPixmap* WMGetLabelImage(WMLabel *lPtr);
1091 char* WMGetLabelText(WMLabel *lPtr);
1093 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1095 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1097 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1099 void WMSetLabelText(WMLabel *lPtr, char *text);
1101 WMFont* WMGetLabelFont(WMLabel *lPtr);
1103 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1105 void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
1107 /* ....................................................................... */
1109 WMFrame* WMCreateFrame(WMWidget *parent);
1111 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1113 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1115 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1117 /* ....................................................................... */
1119 WMTextField* WMCreateTextField(WMWidget *parent);
1121 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1123 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1125 /* you can free the returned string */
1126 char* WMGetTextFieldText(WMTextField *tPtr);
1128 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1130 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1132 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1134 WMFont* WMGetTextFieldFont(WMTextField *tPtr);
1136 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1138 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1140 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1142 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1144 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1146 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1148 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1150 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1152 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1154 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1156 WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
1158 extern char *WMTextDidChangeNotification;
1159 extern char *WMTextDidBeginEditingNotification;
1160 extern char *WMTextDidEndEditingNotification;
1162 /* ....................................................................... */
1164 WMScroller* WMCreateScroller(WMWidget *parent);
1166 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1167 float knobProportion);
1169 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1171 float WMGetScrollerValue(WMScroller *sPtr);
1173 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1175 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1177 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1178 WMScrollArrowPosition position);
1180 extern char *WMScrollerDidScrollNotification;
1182 /* ....................................................................... */
1184 WMList* WMCreateList(WMWidget *parent);
1186 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1188 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1190 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1192 WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
1194 void WMSortListItems(WMList *lPtr);
1196 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1198 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1200 WMListItem* WMGetListItem(WMList *lPtr, int row);
1202 WMArray* WMGetListItems(WMList *lPtr);
1204 void WMRemoveListItem(WMList *lPtr, int row);
1206 void WMSelectListItem(WMList *lPtr, int row);
1208 void WMUnselectListItem(WMList *lPtr, int row);
1210 /* This will select all items in range, and deselect all the others */
1211 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1213 /* This will select all items in range, leaving the others as they are */
1214 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1216 void WMSelectAllListItems(WMList *lPtr);
1218 void WMUnselectAllListItems(WMList *lPtr);
1220 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1222 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1224 int WMGetListItemHeight(WMList *lPtr);
1226 /* don't free the returned data */
1227 WMArray* WMGetListSelectedItems(WMList *lPtr);
1230 * For the following 2 functions, in case WMList allows multiple selection,
1231 * the first item in the list of selected items, respective its row number,
1232 * will be returned.
1235 /* don't free the returned data */
1236 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1238 int WMGetListSelectedItemRow(WMList *lPtr);
1240 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1242 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1244 void WMClearList(WMList *lPtr);
1246 int WMGetListNumberOfRows(WMList *lPtr);
1248 void WMSetListPosition(WMList *lPtr, int row);
1250 void WMSetListBottomPosition(WMList *lPtr, int row);
1252 int WMGetListPosition(WMList *lPtr);
1254 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1256 Bool WMListAllowsEmptySelection(WMList *lPtr);
1259 extern char *WMListDidScrollNotification;
1260 extern char *WMListSelectionDidChangeNotification;
1262 /* ....................................................................... */
1264 WMBrowser* WMCreateBrowser(WMWidget *parent);
1266 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1268 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1270 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1272 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1274 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1276 int WMAddBrowserColumn(WMBrowser *bPtr);
1278 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1280 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1282 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1284 WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1286 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1288 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1289 WMCompareDataProc *func);
1291 /* Don't free the returned string. */
1292 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1294 /* free the returned string */
1295 char* WMGetBrowserPath(WMBrowser *bPtr);
1297 /* free the returned string */
1298 char* WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1300 /* free the returned array */
1301 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1303 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1305 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1306 void *clientData);
1308 WMListItem* WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1310 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1312 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1314 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1316 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1318 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1320 WMList* WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1322 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1324 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1326 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1328 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1330 /* ....................................................................... */
1333 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1335 WMMenuItem* WMCreateMenuItem(void);
1337 void WMDestroyMenuItem(WMMenuItem *item);
1339 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1341 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1343 char* WMGetMenuItemShortcut(WMMenuItem *item);
1345 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1347 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1349 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1351 void* WMGetMenuItemRepresentedObject(WMMenuItem *item);
1353 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1355 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1357 WMAction* WMGetMenuItemAction(WMMenuItem *item);
1359 void* WMGetMenuItemData(WMMenuItem *item);
1361 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1363 char* WMGetMenuItemTitle(WMMenuItem *item);
1365 void WMSetMenuItemState(WMMenuItem *item, int state);
1367 int WMGetMenuItemState(WMMenuItem *item);
1369 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1371 WMPixmap* WMGetMenuItemPixmap(WMMenuItem *item);
1373 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1375 WMPixmap* WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1377 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1379 WMPixmap* WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1381 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1383 WMPixmap* WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1385 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1388 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1390 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1393 /* ....................................................................... */
1395 WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
1397 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1398 void *clientData);
1400 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1402 WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1404 WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1405 char *title);
1407 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1409 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1411 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1413 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1415 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1417 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1419 /* don't free the returned data */
1420 char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1422 WMMenuItem* WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1425 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1427 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1429 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1431 /* ....................................................................... */
1433 WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
1435 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1437 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1439 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1441 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1443 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1445 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1448 /* ....................................................................... */
1450 WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
1452 void WMFreeColorPanel(WMColorPanel *panel);
1454 void WMShowColorPanel(WMColorPanel *panel);
1456 void WMCloseColorPanel(WMColorPanel *panel);
1458 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1460 WMColor* WMGetColorPanelColor(WMColorPanel *panel);
1462 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1464 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1466 extern char *WMColorPanelColorChangedNotification;
1468 /* ....................................................................... */
1470 WMColorWell* WMCreateColorWell(WMWidget *parent);
1472 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1474 WMColor* WMGetColorWellColor(WMColorWell *cPtr);
1476 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1479 extern char *WMColorWellDidChangeNotification;
1482 /* ...................................................................... */
1484 WMScrollView* WMCreateScrollView(WMWidget *parent);
1486 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1487 unsigned int height);
1489 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1491 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1493 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1495 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1497 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1499 WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1501 WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1503 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1505 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1507 /* ....................................................................... */
1509 WMSlider* WMCreateSlider(WMWidget *parent);
1511 int WMGetSliderMinValue(WMSlider *slider);
1513 int WMGetSliderMaxValue(WMSlider *slider);
1515 int WMGetSliderValue(WMSlider *slider);
1517 void WMSetSliderMinValue(WMSlider *slider, int value);
1519 void WMSetSliderMaxValue(WMSlider *slider, int value);
1521 void WMSetSliderValue(WMSlider *slider, int value);
1523 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1525 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1527 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1529 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1531 /* ....................................................................... */
1534 WMSplitView* WMCreateSplitView(WMWidget *parent);
1536 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1538 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1540 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1542 WMView* WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1544 /* remove the first subview == view */
1545 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1547 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1550 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1552 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1554 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1555 WMSplitViewConstrainProc *proc);
1558 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1559 WMSplitViewResizeSubviewsProc *proc);
1562 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1564 /* ...................................................................... */
1566 WMRuler* WMCreateRuler (WMWidget *parent);
1568 WMRulerMargins* WMGetRulerMargins(WMRuler *rPtr);
1570 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1572 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin);
1574 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1576 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1578 int WMGetRulerOffset(WMRuler *rPtr);
1580 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1582 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1584 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1586 /* ....................................................................... */
1589 #define WMCreateText(parent) WMCreateTextForDocumentType \
1590 ((parent), (NULL), (NULL))
1592 WMText* WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser,
1593 WMAction *writer);
1595 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1597 void WMFreezeText(WMText *tPtr);
1599 #define WMRefreshText(tPtr) WMThawText((tPtr))
1601 void WMThawText(WMText *tPtr);
1603 int WMScrollText(WMText *tPtr, int amount);
1605 int WMPageText(WMText *tPtr, Bool direction);
1607 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1609 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1611 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1613 void WMShowTextRuler(WMText *tPtr, Bool show);
1615 int WMGetTextRulerShown(WMText *tPtr);
1617 void WMSetTextEditable(WMText *tPtr, Bool editable);
1619 int WMGetTextEditable(WMText *tPtr);
1621 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1623 int WMGetTextUsesMonoFont(WMText *tPtr);
1625 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1627 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1629 int WMGetTextIgnoresNewline(WMText *tPtr);
1631 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1633 WMFont* WMGetTextDefaultFont(WMText *tPtr);
1635 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1637 WMColor* WMGetTextDefaultColor(WMText *tPtr);
1639 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1641 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1643 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1645 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1647 void WMPrependTextStream(WMText *tPtr, char *text);
1649 void WMAppendTextStream(WMText *tPtr, char *text);
1651 #define WMClearText(tPtr) WMAppendTextStream \
1652 ((tPtr), (NULL))
1654 /* free the text */
1655 char* WMGetTextStream(WMText *tPtr);
1657 /* free the text */
1658 char* WMGetTextSelectedStream(WMText *tPtr);
1660 /* destroy the array */
1661 WMArray* WMGetTextObjects(WMText *tPtr);
1663 /* destroy the array */
1664 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1666 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1668 WMColor* WMGetTextSelectionColor(WMText *tPtr);
1670 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1672 WMFont* WMGetTextSelectionFont(WMText *tPtr);
1674 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1676 int WMGetTextSelectionUnderlined(WMText *tPtr);
1678 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1680 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1681 Bool caseSensitive);
1683 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1686 /* parser related stuff... use only if implementing a new parser */
1688 void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1689 WMColor *color, unsigned short first,
1690 unsigned short extraInfo);
1692 void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1693 WMColor *color, unsigned short first,
1694 unsigned short extraInfo);
1696 void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1697 WMColor *color, unsigned short first,
1698 unsigned short length);
1700 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1701 unsigned int kanji, unsigned int underlined,
1702 int script, WMRulerMargins *margins);
1704 /* do NOT free the margins */
1705 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1706 unsigned int *kanji, unsigned int *underlined,
1707 int *script, WMRulerMargins *margins);
1709 int WMGetTextInsertType(WMText *tPtr);
1711 /*int WMGetTextBlocks(WMText *tPtr);
1713 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1715 int WMGetCurrentTextBlock(WMText *tPtr);*/
1717 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1719 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1721 void* WMRemoveTextBlock(WMText *tPtr);
1723 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1725 /* ....................................................................... */
1728 WMTabView* WMCreateTabView(WMWidget *parent);
1730 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1732 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1734 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1736 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1738 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1740 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1742 WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1743 int identifier, char *label);
1745 WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1747 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1749 void WMSelectLastTabViewItem(WMTabView *tPtr);
1751 void WMSelectNextTabViewItem(WMTabView *tPtr);
1753 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1755 WMTabViewItem* WMGetSelectedTabViewItem(WMTabView *tPtr);
1757 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1759 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1761 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1764 WMTabViewItem* WMCreateTabViewItemWithIdentifier(int identifier);
1766 void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
1768 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1770 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1772 char* WMGetTabViewItemLabel(WMTabViewItem *item);
1774 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1776 WMView* WMGetTabViewItemView(WMTabViewItem *item);
1778 void WMDestroyTabViewItem(WMTabViewItem *item);
1781 /* ....................................................................... */
1783 WMBox* WMCreateBox(WMWidget *parent);
1785 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1787 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1788 int minSize, int maxSize, int space);
1790 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1791 int minSize, int maxSize, int space);
1793 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1795 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1797 /* ....................................................................... */
1799 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1800 char *defaultButton, char *alternateButton,
1801 char *otherButton);
1803 /* you can free the returned string */
1804 char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1805 char *defaultText, char *okButton, char *cancelButton);
1807 WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1808 char *msg, char *defaultButton,
1809 char *alternateButton, char *otherButton);
1811 WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1812 char *msg, char *defaultText, char *okButton,
1813 char *cancelButton);
1816 WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
1817 char *title, char *defaultButton,
1818 char *alternateButton);
1820 void WMDestroyAlertPanel(WMAlertPanel *panel);
1822 void WMDestroyInputPanel(WMInputPanel *panel);
1824 void WMDestroyGenericPanel(WMGenericPanel *panel);
1826 /* ....................................................................... */
1828 /* only 1 instance per WMScreen */
1829 WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
1831 WMSavePanel* WMGetSavePanel(WMScreen *scrPtr);
1833 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1835 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1837 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1839 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1841 /* you can free the returned string */
1842 char* WMGetFilePanelFileName(WMFilePanel *panel);
1844 void WMFreeFilePanel(WMFilePanel *panel);
1846 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1847 char *path, char *name, char **fileTypes);
1849 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1851 WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
1854 /* ...................................................................... */
1856 /* only 1 instance per WMScreen */
1857 WMFontPanel* WMGetFontPanel(WMScreen *scr);
1859 void WMShowFontPanel(WMFontPanel *panel);
1861 void WMHideFontPanel(WMFontPanel *panel);
1863 void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
1865 /* you can free the returned string */
1866 char* WMGetFontPanelFontName(WMFontPanel *panel);
1868 WMFont* WMGetFontPanelFont(WMFontPanel *panel);
1870 #ifdef __cplusplus
1872 #endif /* __cplusplus */
1874 #endif