added options to change default fonts
[wmaker-crm.git] / WINGs / WINGs.h
blob0afab32c4dcbb48ef37acc911757796e77f9b4ae
3 #ifndef _WINGS_H_
4 #define _WINGS_H_
6 #include <wraster.h>
7 #include <WUtil.h>
8 #include <X11/Xlib.h>
10 #define WINGS_H_VERSION 20000521
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;
40 /* WMRange was moved in WUtil.h */
42 #define ClientMessageMask (1L<<30)
45 /* window stacking level */
46 enum {
47 WMNormalWindowLevel = 0,
48 WMFloatingWindowLevel = 3,
49 WMDockWindowLevel = 5,
50 WMSubmenuWindowLevel = 10,
51 WMMainMenuWindowLevel = 20
54 /* window attributes */
55 enum {
56 WMBorderlessWindowMask = 0,
57 WMTitledWindowMask = 1,
58 WMClosableWindowMask = 2,
59 WMMiniaturizableWindowMask = 4,
60 WMResizableWindowMask = 8
64 /* button types */
65 typedef enum {
66 /* 0 is reserved for internal use */
67 WBTMomentaryPush = 1,
68 WBTPushOnPushOff = 2,
69 WBTToggle = 3,
70 WBTSwitch = 4,
71 WBTRadio = 5,
72 WBTMomentaryChange = 6,
73 WBTOnOff = 7,
74 WBTMomentaryLight = 8
75 } WMButtonType;
77 /* button behaviour masks */
78 enum {
79 WBBSpringLoadedMask = (1 << 0),
80 WBBPushInMask = (1 << 1),
81 WBBPushChangeMask = (1 << 2),
82 WBBPushLightMask = (1 << 3),
83 WBBStateLightMask = (1 << 5),
84 WBBStateChangeMask = (1 << 6),
85 WBBStatePushMask = (1 << 7)
89 /* frame title positions */
90 typedef enum {
91 WTPNoTitle,
92 WTPAboveTop,
93 WTPAtTop,
94 WTPBelowTop,
95 WTPAboveBottom,
96 WTPAtBottom,
97 WTPBelowBottom
98 } WMTitlePosition;
101 /* relief types */
102 typedef enum {
103 WRFlat,
104 WRSimple,
105 WRRaised,
106 WRSunken,
107 WRGroove,
108 WRRidge,
109 WRPushed
110 } WMReliefType;
113 /* alignment types */
114 typedef enum {
115 WALeft,
116 WACenter,
117 WARight,
118 WAJustified /* not valid for textfields */
119 } WMAlignment;
122 /* image position */
123 typedef enum {
124 WIPNoImage,
125 WIPImageOnly,
126 WIPLeft,
127 WIPRight,
128 WIPBelow,
129 WIPAbove,
130 WIPOverlaps
131 } WMImagePosition;
134 /* scroller arrow position */
135 typedef enum {
136 WSAMaxEnd,
137 WSAMinEnd,
138 WSANone
139 } WMScrollArrowPosition;
141 /* scroller parts */
142 typedef enum {
143 WSNoPart,
144 WSDecrementPage,
145 WSIncrementPage,
146 WSDecrementLine,
147 WSIncrementLine,
148 WSKnob,
149 WSKnobSlot
150 } WMScrollerPart;
152 /* usable scroller parts */
153 typedef enum {
154 WSUNoParts,
155 WSUOnlyArrows,
156 WSUAllParts
157 } WMUsableScrollerParts;
159 /* matrix types */
160 typedef enum {
161 WMRadioMode,
162 WMHighlightMode,
163 WMListMode,
164 WMTrackMode
165 } WMMatrixTypes;
168 typedef enum {
169 WTTopTabsBevelBorder,
170 WTNoTabsBevelBorder,
171 WTNoTabsLineBorder,
172 WTNoTabsNoBorder
173 } WMTabViewType;
176 /* text movement types */
177 enum {
178 WMIllegalTextMovement,
179 WMReturnTextMovement,
180 WMEscapeTextMovement,
181 WMTabTextMovement,
182 WMBacktabTextMovement,
183 WMLeftTextMovement,
184 WMRightTextMovement,
185 WMUpTextMovement,
186 WMDownTextMovement
189 /* text field special events */
190 enum {
191 WMInsertTextEvent,
192 WMDeleteTextEvent
196 /* drag operations */
197 typedef enum {
198 WDOperationNone,
199 WDOperationCopy,
200 WDOperationMove,
201 WDOperationLink,
202 WDOperationAsk,
203 WDOperationPrivate
204 } WMDragOperationType;
207 typedef enum {
208 WMGrayModeColorPanel = 1,
209 WMRGBModeColorPanel = 2,
210 WMCMYKModeColorPanel = 3,
211 WMHSBModeColorPanel = 4,
212 WMCustomPaletteModeColorPanel = 5,
213 WMColorListModeColorPanel = 6,
214 WMWheelModeColorPanel = 7
215 } WMColorPanelMode;
219 /* system images */
220 #define WSIReturnArrow 1
221 #define WSIHighlightedReturnArrow 2
222 #define WSIScrollerDimple 3
223 #define WSIArrowLeft 4
224 #define WSIHighlightedArrowLeft 5
225 #define WSIArrowRight 6
226 #define WSIHighlightedArrowRight 7
227 #define WSIArrowUp 8
228 #define WSIHighlightedArrowUp 9
229 #define WSIArrowDown 10
230 #define WSIHighlightedArrowDown 11
231 #define WSICheckMark 12
233 enum {
234 WLDSSelected = (1 << 16),
235 WLDSDisabled = (1 << 17),
236 WLDSFocused = (1 << 18),
237 WLDSIsBranch = (1 << 19)
240 /* alert panel return values */
241 enum {
242 WAPRDefault = 0,
243 WAPRAlternate = 1,
244 WAPROther = -1,
245 WAPRError = -2
250 /* types of input observers */
251 enum {
252 WIReadMask = (1 << 0),
253 WIWriteMask = (1 << 1),
254 WIExceptMask = (1 << 2)
259 typedef int W_Class;
261 enum {
262 WC_Window = 0,
263 WC_Frame = 1,
264 WC_Label = 2,
265 WC_Button = 3,
266 WC_TextField = 4,
267 WC_Scroller = 5,
268 WC_ScrollView = 6,
269 WC_List = 7,
270 WC_Browser = 8,
271 WC_PopUpButton = 9,
272 WC_ColorWell = 10,
273 WC_Slider = 11,
274 WC_Matrix = 12, /* not ready */
275 WC_SplitView = 13,
276 WC_TabView = 14,
277 WC_ProgressIndicator = 15,
278 WC_MenuView = 16
281 /* All widgets must start with the following structure
282 * in that order. Used for typecasting to get some generic data */
283 typedef struct W_WidgetType {
284 W_Class widgetClass;
285 struct W_View *view;
287 } W_WidgetType;
290 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
291 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
294 /* widgets */
296 typedef void WMWidget;
298 typedef struct W_Pixmap WMPixmap;
299 typedef struct W_Font WMFont;
300 typedef struct W_Color WMColor;
302 typedef struct W_Screen WMScreen;
304 typedef struct W_View WMView;
306 typedef struct W_Window WMWindow;
307 typedef struct W_Frame WMFrame;
308 typedef struct W_Button WMButton;
309 typedef struct W_Label WMLabel;
310 typedef struct W_TextField WMTextField;
311 typedef struct W_Scroller WMScroller;
312 typedef struct W_ScrollView WMScrollView;
313 typedef struct W_List WMList;
314 typedef struct W_Browser WMBrowser;
315 typedef struct W_PopUpButton WMPopUpButton;
316 typedef struct W_ProgressIndicator WMProgressIndicator;
317 typedef struct W_ColorWell WMColorWell;
318 typedef struct W_Slider WMSlider;
319 typedef struct W_Matrix WMMatrix; /* not ready */
320 typedef struct W_SplitView WMSplitView;
321 typedef struct W_TabView WMTabView;
323 /* not widgets */
324 typedef struct W_TabViewItem WMTabViewItem;
325 typedef struct W_MenuItem WMMenuItem;
328 typedef struct W_FilePanel WMFilePanel;
329 typedef WMFilePanel WMOpenPanel;
330 typedef WMFilePanel WMSavePanel;
332 typedef struct W_FontPanel WMFontPanel;
334 typedef struct W_ColorPanel WMColorPanel;
337 /* item for WMList */
338 typedef struct WMListItem {
339 char *text;
340 void *clientData; /* ptr for user clientdata. */
342 unsigned int uflags:16; /* flags for the user */
343 unsigned int selected:1;
344 unsigned int disabled:1;
345 unsigned int isBranch:1;
346 unsigned int loaded:1;
347 } WMListItem;
349 /* struct for message panel */
350 typedef struct WMAlertPanel {
351 WMWindow *win; /* window */
352 WMButton *defBtn; /* default button */
353 WMButton *altBtn; /* alternative button */
354 WMButton *othBtn; /* other button */
355 WMLabel *iLbl; /* icon label */
356 WMLabel *tLbl; /* title label */
357 WMLabel *mLbl; /* message label */
358 WMFrame *line; /* separator */
359 short result; /* button that was pushed */
360 short done;
362 KeyCode retKey;
363 KeyCode escKey;
364 } WMAlertPanel;
367 typedef struct WMInputPanel {
368 WMWindow *win; /* window */
369 WMButton *defBtn; /* default button */
370 WMButton *altBtn; /* alternative button */
371 WMLabel *tLbl; /* title label */
372 WMLabel *mLbl; /* message label */
373 WMTextField *text; /* text field */
374 short result; /* button that was pushed */
375 short done;
377 KeyCode retKey;
378 KeyCode escKey;
379 } WMInputPanel;
387 typedef void *WMHandlerID;
389 typedef void WMInputProc(int fd, int mask, void *clientData);
391 typedef void WMEventProc(XEvent *event, void *clientData);
393 typedef void WMEventHook(XEvent *event);
395 /* self is set to the widget from where the callback is being called and
396 * clientData to the data set to with WMSetClientData() */
397 typedef void WMAction(WMWidget *self, void *clientData);
399 /* same as WMAction, but for stuff that arent widgets */
400 typedef void WMAction2(void *self, void *clientData);
403 typedef void WMCallback(void *data);
405 typedef void WMDropDataCallback(WMView *view, WMData *data);
407 /* delegate method like stuff */
408 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
409 int state, WMRect *rect);
412 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
413 unsigned int oldWidth,
414 unsigned int oldHeight);
417 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
418 int *minSize, int *maxSize);
420 typedef WMWidget *WMMatrixCreateCellProc(WMMatrix *mPtr);
425 typedef struct WMBrowserDelegate {
426 void *data;
428 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
429 WMBrowser *sender, int column, WMList *list);
431 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
432 int column);
434 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
436 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
437 } WMBrowserDelegate;
440 typedef struct WMTextFieldDelegate {
441 void *data;
443 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
444 WMNotification *notif);
446 void (*didChange)(struct WMTextFieldDelegate *self,
447 WMNotification *notif);
449 void (*didEndEditing)(struct WMTextFieldDelegate *self,
450 WMNotification *notif);
452 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
453 WMTextField *tPtr);
455 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
456 WMTextField *tPtr);
457 } WMTextFieldDelegate;
461 typedef struct WMTabViewDelegate {
462 void *data;
464 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
465 WMTabView *tabView);
467 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
468 WMTabViewItem *item);
470 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
471 WMTabViewItem *item);
473 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
474 WMTabViewItem *item);
475 } WMTabViewDelegate;
480 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
481 Time timestamp, void *cdata, WMData *data);
484 typedef struct WMSelectionProcs {
485 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
486 void *cdata, Atom *type);
487 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
488 void (*selectionDone)(WMView *view, Atom selection, Atom target,
489 void *cdata);
490 } WMSelectionProcs;
495 typedef struct W_DraggingInfo WMDraggingInfo;
498 typedef struct W_DragSourceProcs {
499 unsigned (*draggingSourceOperation)(WMView *self, Bool local);
500 void (*beganDragImage)(WMView *self, WMPixmap *image, WMPoint point);
501 void (*endedDragImage)(WMView *self, WMPixmap *image, WMPoint point,
502 Bool deposited);
503 WMData* (*fetchDragData)(WMView *self, char *type);
504 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
505 } WMDragSourceProcs;
509 typedef struct W_DragDestinationProcs {
510 unsigned (*draggingEntered)(WMView *self, WMDraggingInfo *info);
511 unsigned (*draggingUpdated)(WMView *self, WMDraggingInfo *info);
512 void (*draggingExited)(WMView *self, WMDraggingInfo *info);
513 Bool (*prepareForDragOperation)(WMView *self, WMDraggingInfo *info);
514 Bool (*performDragOperation)(WMView *self, WMDraggingInfo *info);
515 void (*concludeDragOperation)(WMView *self, WMDraggingInfo *info);
516 } WMDragDestinationProcs;
520 /* ...................................................................... */
523 WMRange wmkrange(int start, int count);
525 WMPoint wmkpoint(int x, int y);
527 WMSize wmksize(unsigned int width, unsigned int height);
530 /* ....................................................................... */
534 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
536 void WMSetResourcePath(char *path);
538 /* don't free the returned string */
539 char *WMGetApplicationName();
541 /* Try to locate resource file. ext may be NULL */
542 char *WMPathForResourceOfType(char *resource, char *ext);
544 WMScreen *WMCreateScreenWithRContext(Display *display, int screen,
545 RContext *context);
547 WMScreen *WMCreateScreen(Display *display, int screen);
549 WMScreen *WMCreateSimpleApplicationScreen(Display *display);
551 void WMScreenMainLoop(WMScreen *scr);
554 RContext *WMScreenRContext(WMScreen *scr);
556 Display *WMScreenDisplay(WMScreen *scr);
558 int WMScreenDepth(WMScreen *scr);
562 void WMSetApplicationIconImage(WMScreen *app, WMPixmap *icon);
564 WMPixmap *WMGetApplicationIconImage(WMScreen *app);
566 void WMSetFocusToWidget(WMWidget *widget);
568 WMEventHook *WMHookEventHandler(WMEventHook *handler);
570 int WMHandleEvent(XEvent *event);
572 Bool WMScreenPending(WMScreen *scr);
574 void WMCreateEventHandler(WMView *view, unsigned long mask,
575 WMEventProc *eventProc, void *clientData);
577 void WMDeleteEventHandler(WMView *view, unsigned long mask,
578 WMEventProc *eventProc, void *clientData);
580 int WMIsDoubleClick(XEvent *event);
582 void WMNextEvent(Display *dpy, XEvent *event);
584 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
586 WMHandlerID WMAddTimerHandler(int milliseconds, WMCallback *callback,
587 void *cdata);
589 void WMDeleteTimerWithClientData(void *cdata);
591 void WMDeleteTimerHandler(WMHandlerID handlerID);
593 WMHandlerID WMAddIdleHandler(WMCallback *callback, void *cdata);
595 void WMDeleteIdleHandler(WMHandlerID handlerID);
597 WMHandlerID WMAddInputHandler(int fd, int condition, WMInputProc *proc,
598 void *clientData);
600 void WMDeleteInputHandler(WMHandlerID handlerID);
604 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
605 WMSelectionProcs *procs, void *cdata);
607 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
609 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
610 Time timestamp, WMSelectionCallback *callback,
611 void *cdata);
614 /* ....................................................................... */
616 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
618 void WMDragImageFromView(WMView *view, WMPixmap *image, char *dataTypes[],
619 WMPoint atLocation, WMSize mouseOffset, XEvent *event,
620 Bool slideBack);
622 void WMRegisterViewForDraggedTypes(WMView *view, char *acceptedTypes[]);
624 void WMUnregisterViewDraggedTypes(WMView *view);
626 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
629 WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info);
631 /* ....................................................................... */
633 WMFont *WMCreateFontSet(WMScreen *scrPtr, char *fontName);
635 WMFont *WMCreateNormalFont(WMScreen *scrPtr, char *fontName);
637 WMFont *WMCreateFont(WMScreen *scrPtr, char *fontName);
639 WMFont *WMRetainFont(WMFont *font);
641 void WMReleaseFont(WMFont *font);
643 unsigned int WMFontHeight(WMFont *font);
646 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
648 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
652 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
654 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
656 WMFont *WMSystemFontOfSize(WMScreen *scrPtr, int size);
658 WMFont *WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
660 XFontSet WMGetFontFontSet(WMFont *font);
662 /* ....................................................................... */
664 WMPixmap *WMRetainPixmap(WMPixmap *pixmap);
666 void WMReleasePixmap(WMPixmap *pixmap);
668 WMPixmap *WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
669 Bool masked);
671 WMPixmap *WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
672 Pixmap mask, int width, int height,
673 int depth);
675 WMPixmap *WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
676 int threshold);
678 WMPixmap *WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
680 WMSize WMGetPixmapSize(WMPixmap *pixmap);
682 WMPixmap *WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
684 WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
685 RColor *color);
687 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
689 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
691 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
693 WMPixmap *WMGetSystemPixmap(WMScreen *scr, int image);
695 /* ....................................................................... */
698 WMColor *WMDarkGrayColor(WMScreen *scr);
700 WMColor *WMGrayColor(WMScreen *scr);
702 WMColor *WMBlackColor(WMScreen *scr);
704 WMColor *WMWhiteColor(WMScreen *scr);
706 void WMSetColorInGC(WMColor *color, GC gc);
708 GC WMColorGC(WMColor *color);
710 WMPixel WMColorPixel(WMColor *color);
712 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
713 unsigned int width, unsigned int height);
715 void WMReleaseColor(WMColor *color);
717 WMColor *WMRetainColor(WMColor *color);
719 WMColor *WMCreateRGBColor(WMScreen *scr, unsigned short red,
720 unsigned short green, unsigned short blue,
721 Bool exact);
723 WMColor *WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
725 unsigned short WMRedComponentOfColor(WMColor *color);
727 unsigned short WMGreenComponentOfColor(WMColor *color);
729 unsigned short WMBlueComponentOfColor(WMColor *color);
731 char *WMGetColorRGBDescription(WMColor *color);
733 /* ....................................................................... */
736 void WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
737 int y, char *text, int length);
739 void WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
740 int y, char *text, int length);
742 int WMWidthOfString(WMFont *font, char *text, int length);
746 /* ....................................................................... */
748 WMScreen *WMWidgetScreen(WMWidget *w);
750 unsigned int WMScreenWidth(WMScreen *scr);
752 unsigned int WMScreenHeight(WMScreen *scr);
754 void WMUnmapWidget(WMWidget *w);
756 void WMMapWidget(WMWidget *w);
758 void WMMoveWidget(WMWidget *w, int x, int y);
760 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
762 void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
764 void WMMapSubwidgets(WMWidget *w);
766 void WMUnmapSubwidgets(WMWidget *w);
768 void WMRealizeWidget(WMWidget *w);
770 void WMDestroyWidget(WMWidget *widget);
772 void WMHangData(WMWidget *widget, void *data);
774 void *WMGetHangedData(WMWidget *widget);
776 unsigned int WMWidgetWidth(WMWidget *w);
778 unsigned int WMWidgetHeight(WMWidget *w);
780 Window WMWidgetXID(WMWidget *w);
782 Window WMViewXID(WMView *view);
784 void WMRedisplayWidget(WMWidget *w);
786 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
788 WMSize WMGetViewSize(WMView *view);
790 WMPoint WMGetViewPosition(WMView *view);
792 WMPoint WMGetViewScreenPosition(WMView *view);
794 WMWidget *WMWidgetOfView(WMView *view);
796 /* notifications */
797 extern char *WMViewSizeDidChangeNotification;
799 extern char *WMViewRealizedNotification;
802 /* ....................................................................... */
804 void WMSetBalloonTextForView(char *text, WMView *view);
806 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
808 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
810 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
812 void WMSetBalloonDelay(WMScreen *scr, int delay);
814 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
817 /* ....................................................................... */
819 WMWindow *WMCreateWindow(WMScreen *screen, char *name);
821 WMWindow *WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
823 WMWindow *WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
824 int style);
826 WMWindow *WMCreatePanelForWindow(WMWindow *owner, char *name);
828 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
830 void WMSetWindowTitle(WMWindow *wPtr, char *title);
832 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
834 void WMSetWindowMiniwindowImage(WMWindow *win, WMPixmap *pixmap);
836 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
838 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
840 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
841 int maxX, int maxY);
843 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
845 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
847 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
849 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
851 void WMSetWindowLevel(WMWindow *win, int level);
853 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
855 void WMCloseWindow(WMWindow *win);
857 /* ....................................................................... */
859 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
861 #define WMCreateCommandButton(parent) \
862 WMCreateCustomButton((parent), WBBSpringLoadedMask\
863 |WBBPushInMask\
864 |WBBPushLightMask\
865 |WBBPushChangeMask)
867 #define WMCreateRadioButton(parent) \
868 WMCreateButton((parent), WBTRadio)
870 #define WMCreateSwitchButton(parent) \
871 WMCreateButton((parent), WBTSwitch)
873 WMButton *WMCreateButton(WMWidget *parent, WMButtonType type);
875 WMButton *WMCreateCustomButton(WMWidget *parent, int behaviourMask);
877 void WMSetButtonImageDefault(WMButton *bPtr);
879 void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
881 void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
883 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
885 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
887 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
889 void WMSetButtonText(WMButton *bPtr, char *text);
891 void WMSetButtonAltText(WMButton *bPtr, char *text);
893 void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
895 void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
897 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
899 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
901 int WMGetButtonSelected(WMButton *bPtr);
903 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
905 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
907 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
909 void WMSetButtonTag(WMButton *bPtr, int tag);
911 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
913 void WMPerformButtonClick(WMButton *bPtr);
915 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
917 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
919 /* ....................................................................... */
921 WMLabel *WMCreateLabel(WMWidget *parent);
923 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
925 void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
927 WMPixmap *WMGetLabelImage(WMLabel *lPtr);
929 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
931 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
933 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
935 void WMSetLabelText(WMLabel *lPtr, char *text);
937 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
939 void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
941 /* ....................................................................... */
943 WMFrame *WMCreateFrame(WMWidget *parent);
945 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
947 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
949 void WMSetFrameTitle(WMFrame *fPtr, char *title);
951 /* ....................................................................... */
953 WMTextField *WMCreateTextField(WMWidget *parent);
955 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
957 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
959 /* you can free the returned string */
960 char *WMGetTextFieldText(WMTextField *tPtr);
962 void WMSetTextFieldText(WMTextField *tPtr, char *text);
964 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
966 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
968 WMFont *WMGetTextFieldFont(WMTextField *tPtr);
970 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
972 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
974 Bool WMGetTextFieldEditable(WMTextField *tPtr);
976 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
978 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
980 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
982 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
984 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
986 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
988 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
991 extern char *WMTextDidChangeNotification;
992 extern char *WMTextDidBeginEditingNotification;
993 extern char *WMTextDidEndEditingNotification;
995 /* ....................................................................... */
997 WMScroller *WMCreateScroller(WMWidget *parent);
999 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1000 float knobProportion);
1002 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1004 float WMGetScrollerValue(WMScroller *sPtr);
1006 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1008 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1010 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1011 WMScrollArrowPosition position);
1013 /* ....................................................................... */
1015 WMList *WMCreateList(WMWidget *parent);
1017 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1019 WMListItem *WMInsertListItem(WMList *lPtr, int row, char *text);
1021 void WMSortListItems(WMList *lPtr);
1023 void WMSortListItemsWithComparer(WMList *lPtr,
1024 int (f)(const void*, const void*));
1026 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1028 WMListItem *WMGetListItem(WMList *lPtr, int row);
1030 WMBag *WMGetListItems(WMList *lPtr);
1033 void WMRemoveListItem(WMList *lPtr, int row);
1035 void WMSelectListItem(WMList *lPtr, int row);
1037 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1039 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1041 int WMGetListItemHeight(WMList *lPtr);
1043 /* don't free the returned data */
1044 WMListItem *WMGetListSelectedItem(WMList *lPtr);
1046 int WMGetListSelectedItemRow(WMList *lPtr);
1048 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1050 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1052 void WMClearList(WMList *lPtr);
1054 int WMGetListNumberOfRows(WMList *lPtr);
1056 void WMSetListPosition(WMList *lPtr, int row);
1058 void WMSetListBottomPosition(WMList *lPtr, int row);
1060 int WMGetListPosition(WMList *lPtr);
1062 extern char *WMListDidScrollNotification;
1063 extern char *WMListSelectionDidChangeNotification;
1065 /* ....................................................................... */
1067 WMBrowser *WMCreateBrowser(WMWidget *parent);
1069 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1071 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1073 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1075 int WMAddBrowserColumn(WMBrowser *bPtr);
1077 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1079 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1081 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1083 WMListItem *WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1085 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1087 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1088 int (f)(const void*, const void*));
1090 /* Don't free the returned string. */
1091 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1093 /* you can free the returned string */
1094 char *WMGetBrowserPath(WMBrowser *bPtr);
1095 /* you can free the returned string */
1096 char *WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1098 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1100 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1101 void *clientData);
1103 WMListItem *WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1105 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1107 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1109 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1111 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1113 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1115 WMList *WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1117 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1119 /* ....................................................................... */
1122 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1124 WMMenuItem *WMCreateMenuItem(void);
1126 void WMDestroyMenuItem(WMMenuItem *item);
1128 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1130 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1132 char *WMGetMenuItemShortcut(WMMenuItem *item);
1134 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1136 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1138 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1140 void *WMGetMenuItemRepresentedObject(WMMenuItem *item);
1142 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1144 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1146 WMAction *WMGetMenuItemAction(WMMenuItem *item);
1148 void *WMGetMenuItemData(WMMenuItem *item);
1150 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1152 char *WMGetMenuItemTitle(WMMenuItem *item);
1154 void WMSetMenuItemState(WMMenuItem *item, int state);
1156 int WMGetMenuItemState(WMMenuItem *item);
1158 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1160 WMPixmap *WMGetMenuItemPixmap(WMMenuItem *item);
1162 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1164 WMPixmap *WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1166 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1168 WMPixmap *WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1170 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1172 WMPixmap *WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1174 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1177 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1179 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1182 /* ....................................................................... */
1184 WMPopUpButton *WMCreatePopUpButton(WMWidget *parent);
1186 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1187 void *clientData);
1189 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1191 WMMenuItem *WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1193 WMMenuItem *WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1194 char *title);
1196 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1198 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1200 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1202 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1204 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1206 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1208 /* don't free the returned data */
1209 char *WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1211 WMMenuItem *WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1214 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1216 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1218 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1220 /* ....................................................................... */
1222 WMProgressIndicator *WMCreateProgressIndicator(WMWidget *parent);
1224 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1226 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1228 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1230 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1232 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1234 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1237 /* ....................................................................... */
1239 WMColorPanel *WMGetColorPanel(WMScreen *scrPtr);
1241 void WMFreeColorPanel(WMColorPanel *panel);
1243 void WMShowColorPanel(WMColorPanel *panel);
1245 void WMCloseColorPanel(WMColorPanel *panel);
1247 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1249 WMColor *WMGetColorPanelColor(WMColorPanel *panel);
1251 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1253 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1255 extern char *WMColorPanelColorChangedNotification;
1257 /* ....................................................................... */
1259 WMColorWell *WMCreateColorWell(WMWidget *parent);
1261 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1263 WMColor *WMGetColorWellColor(WMColorWell *cPtr);
1265 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1268 extern char *WMColorWellDidChangeNotification;
1271 /* ...................................................................... */
1273 WMScrollView *WMCreateScrollView(WMWidget *parent);
1275 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1276 unsigned int height);
1278 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1280 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1282 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1284 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1286 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1288 WMScroller *WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1290 WMScroller *WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1292 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1294 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1296 /* ....................................................................... */
1298 WMSlider *WMCreateSlider(WMWidget *parent);
1300 int WMGetSliderMinValue(WMSlider *slider);
1302 int WMGetSliderMaxValue(WMSlider *slider);
1304 int WMGetSliderValue(WMSlider *slider);
1306 void WMSetSliderMinValue(WMSlider *slider, int value);
1308 void WMSetSliderMaxValue(WMSlider *slider, int value);
1310 void WMSetSliderValue(WMSlider *slider, int value);
1312 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1314 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1316 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1318 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1320 /* ....................................................................... */
1323 WMSplitView *WMCreateSplitView(WMWidget *parent);
1324 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1325 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1327 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1329 WMView *WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1331 /* remove the first subview == view */
1332 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1334 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1337 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1339 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1341 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1342 WMSplitViewConstrainProc *proc);
1345 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1346 WMSplitViewResizeSubviewsProc *proc);
1349 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1352 /* ....................................................................... */
1355 WMTabView *WMCreateTabView(WMWidget *parent);
1357 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1359 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1361 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1363 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1365 WMTabViewItem *WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1367 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1369 void WMSelectLastTabViewItem(WMTabView *tPtr);
1371 void WMSelectNextTabViewItem(WMTabView *tPtr);
1373 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1375 WMTabViewItem *WMGetSelectedTabViewItem(WMTabView *tPtr);
1377 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1379 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1381 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1384 WMTabViewItem *WMCreateTabViewItemWithIdentifier(int identifier);
1386 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1388 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1390 char *WMGetTabViewItemLabel(WMTabViewItem *item);
1392 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1394 WMView *WMGetTabViewItemView(WMTabViewItem *item);
1396 void WMDestroyTabViewItem(WMTabViewItem *item);
1398 /* ....................................................................... */
1400 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1401 char *defaultButton, char *alternateButton,
1402 char *otherButton);
1404 /* you can free the returned string */
1405 char *WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1406 char *defaultText, char *okButton, char *cancelButton);
1408 WMAlertPanel *WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1409 char *msg, char *defaultButton,
1410 char *alternateButton, char *otherButton);
1412 WMInputPanel *WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1413 char *msg, char *defaultText, char *okButton,
1414 char *cancelButton);
1416 void WMDestroyAlertPanel(WMAlertPanel *panel);
1418 void WMDestroyInputPanel(WMInputPanel *panel);
1420 /* ....................................................................... */
1422 /* only 1 instance per WMScreen */
1423 WMOpenPanel *WMGetOpenPanel(WMScreen *scrPtr);
1425 WMSavePanel *WMGetSavePanel(WMScreen *scrPtr);
1427 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1429 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1431 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1433 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1435 /* you can free the returned string */
1436 char *WMGetFilePanelFileName(WMFilePanel *panel);
1438 void WMFreeFilePanel(WMFilePanel *panel);
1440 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1441 char *path, char *name, char **fileTypes);
1443 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1445 WMView *WMGetFilePanelAccessoryView(WMFilePanel *panel);
1448 /* ...................................................................... */
1450 /* only 1 instance per WMScreen */
1451 WMFontPanel *WMGetFontPanel(WMScreen *scr);
1453 void WMShowFontPanel(WMFontPanel *panel);
1455 void WMHideFontPanel(WMFontPanel *panel);
1457 void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
1459 /* you can free the returned string */
1460 char *WMGetFontPanelFontName(WMFontPanel *panel);
1462 WMFont *WMGetFontPanelFont(WMFontPanel *panel);
1464 #ifdef __cplusplus
1466 #endif /* __cplusplus */
1468 #endif