Added WMCreateBlendedPixmapFromRImage()
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blob8ad523ea135640aff607e57bbc797bd9465a096f
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 20010117
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;
39 #define wmksize(width, height) (WMSize){(width), (height)}
40 #define wmkpoint(x, y) (WMPoint){(x), (y)}
41 #define wmkrect(pos, size) (WMRect){(pos), (size)}
46 #define ClientMessageMask (1L<<30)
49 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
50 #define _DEFINED_GNUSTEP_WINDOW_INFO
52 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
53 * NSDesktopWindowLevel intended to be the level at which things
54 * on the desktop sit ... so you should be able
55 * to put a desktop background just below it.
57 * Applications are actually permitted to use any value in the
58 * range INT_MIN+1 to INT_MAX
60 enum {
61 WMDesktopWindowLevel = -1000, /* GNUstep addition */
62 WMNormalWindowLevel = 0,
63 WMFloatingWindowLevel = 3,
64 WMSubmenuWindowLevel = 3,
65 WMTornOffMenuWindowLevel = 3,
66 WMMainMenuWindowLevel = 20,
67 WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */
68 WMStatusWindowLevel = 21,
69 WMModalPanelWindowLevel = 100,
70 WMPopUpMenuWindowLevel = 101,
71 WMScreenSaverWindowLevel = 1000
75 /* window attributes */
76 enum {
77 WMBorderlessWindowMask = 0,
78 WMTitledWindowMask = 1,
79 WMClosableWindowMask = 2,
80 WMMiniaturizableWindowMask = 4,
81 WMResizableWindowMask = 8,
82 WMIconWindowMask = 64,
83 WMMiniWindowMask = 128
85 #endif
88 /* button types */
89 typedef enum {
90 /* 0 is reserved for internal use */
91 WBTMomentaryPush = 1,
92 WBTPushOnPushOff = 2,
93 WBTToggle = 3,
94 WBTSwitch = 4,
95 WBTRadio = 5,
96 WBTMomentaryChange = 6,
97 WBTOnOff = 7,
98 WBTMomentaryLight = 8
99 } WMButtonType;
101 /* button behaviour masks */
102 enum {
103 WBBSpringLoadedMask = (1 << 0),
104 WBBPushInMask = (1 << 1),
105 WBBPushChangeMask = (1 << 2),
106 WBBPushLightMask = (1 << 3),
107 WBBStateLightMask = (1 << 5),
108 WBBStateChangeMask = (1 << 6),
109 WBBStatePushMask = (1 << 7)
113 /* frame title positions */
114 typedef enum {
115 WTPNoTitle,
116 WTPAboveTop,
117 WTPAtTop,
118 WTPBelowTop,
119 WTPAboveBottom,
120 WTPAtBottom,
121 WTPBelowBottom
122 } WMTitlePosition;
125 /* relief types */
126 typedef enum {
127 WRFlat,
128 WRSimple,
129 WRRaised,
130 WRSunken,
131 WRGroove,
132 WRRidge,
133 WRPushed
134 } WMReliefType;
137 /* alignment types */
138 typedef enum {
139 WALeft,
140 WACenter,
141 WARight,
142 WAJustified /* not valid for textfields */
143 } WMAlignment;
146 /* image position */
147 typedef enum {
148 WIPNoImage,
149 WIPImageOnly,
150 WIPLeft,
151 WIPRight,
152 WIPBelow,
153 WIPAbove,
154 WIPOverlaps
155 } WMImagePosition;
158 /* scroller arrow position */
159 typedef enum {
160 WSAMaxEnd,
161 WSAMinEnd,
162 WSANone
163 } WMScrollArrowPosition;
165 /* scroller parts */
166 typedef enum {
167 WSNoPart,
168 WSDecrementPage,
169 WSIncrementPage,
170 WSDecrementLine,
171 WSIncrementLine,
172 WSDecrementWheel,
173 WSIncrementWheel,
174 WSKnob,
175 WSKnobSlot
176 } WMScrollerPart;
178 /* usable scroller parts */
179 typedef enum {
180 WSUNoParts,
181 WSUOnlyArrows,
182 WSUAllParts
183 } WMUsableScrollerParts;
185 /* matrix types */
186 typedef enum {
187 WMRadioMode,
188 WMHighlightMode,
189 WMListMode,
190 WMTrackMode
191 } WMMatrixTypes;
194 typedef enum {
195 WTTopTabsBevelBorder,
196 WTNoTabsBevelBorder,
197 WTNoTabsLineBorder,
198 WTNoTabsNoBorder
199 } WMTabViewType;
202 /* text movement types */
203 enum {
204 WMIllegalTextMovement,
205 WMReturnTextMovement,
206 WMEscapeTextMovement,
207 WMTabTextMovement,
208 WMBacktabTextMovement,
209 WMLeftTextMovement,
210 WMRightTextMovement,
211 WMUpTextMovement,
212 WMDownTextMovement
215 /* text field special events */
216 enum {
217 WMInsertTextEvent,
218 WMDeleteTextEvent
222 enum {
223 WLNotFound = -1 /* element was not found in WMList */
227 /* drag operations */
228 typedef enum {
229 WDOperationNone,
230 WDOperationCopy,
231 WDOperationMove,
232 WDOperationLink,
233 WDOperationAsk,
234 WDOperationPrivate
235 } WMDragOperationType;
238 typedef enum {
239 WMGrayModeColorPanel = 1,
240 WMRGBModeColorPanel = 2,
241 WMCMYKModeColorPanel = 3,
242 WMHSBModeColorPanel = 4,
243 WMCustomPaletteModeColorPanel = 5,
244 WMColorListModeColorPanel = 6,
245 WMWheelModeColorPanel = 7
246 } WMColorPanelMode;
250 /* system images */
251 #define WSIReturnArrow 1
252 #define WSIHighlightedReturnArrow 2
253 #define WSIScrollerDimple 3
254 #define WSIArrowLeft 4
255 #define WSIHighlightedArrowLeft 5
256 #define WSIArrowRight 6
257 #define WSIHighlightedArrowRight 7
258 #define WSIArrowUp 8
259 #define WSIHighlightedArrowUp 9
260 #define WSIArrowDown 10
261 #define WSIHighlightedArrowDown 11
262 #define WSICheckMark 12
264 enum {
265 WLDSSelected = (1 << 16),
266 WLDSDisabled = (1 << 17),
267 WLDSFocused = (1 << 18),
268 WLDSIsBranch = (1 << 19)
271 /* alert panel return values */
272 enum {
273 WAPRDefault = 0,
274 WAPRAlternate = 1,
275 WAPROther = -1,
276 WAPRError = -2
281 /* types of input observers */
282 enum {
283 WIReadMask = (1 << 0),
284 WIWriteMask = (1 << 1),
285 WIExceptMask = (1 << 2)
290 typedef int W_Class;
292 enum {
293 WC_Window = 0,
294 WC_Frame = 1,
295 WC_Label = 2,
296 WC_Button = 3,
297 WC_TextField = 4,
298 WC_Scroller = 5,
299 WC_ScrollView = 6,
300 WC_List = 7,
301 WC_Browser = 8,
302 WC_PopUpButton = 9,
303 WC_ColorWell = 10,
304 WC_Slider = 11,
305 WC_Matrix = 12, /* not ready */
306 WC_SplitView = 13,
307 WC_TabView = 14,
308 WC_ProgressIndicator = 15,
309 WC_MenuView = 16,
310 WC_Ruler = 17,
311 WC_Text = 18,
312 WC_Box = 19
315 /* All widgets must start with the following structure
316 * in that order. Used for typecasting to get some generic data */
317 typedef struct W_WidgetType {
318 W_Class widgetClass;
319 struct W_View *view;
321 } W_WidgetType;
324 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
325 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
328 /* widgets */
330 typedef void WMWidget;
332 typedef struct W_Pixmap WMPixmap;
333 typedef struct W_Font WMFont;
334 typedef struct W_Color WMColor;
336 typedef struct W_Screen WMScreen;
338 typedef struct W_View WMView;
340 typedef struct W_Window WMWindow;
341 typedef struct W_Frame WMFrame;
342 typedef struct W_Button WMButton;
343 typedef struct W_Label WMLabel;
344 typedef struct W_TextField WMTextField;
345 typedef struct W_Scroller WMScroller;
346 typedef struct W_ScrollView WMScrollView;
347 typedef struct W_List WMList;
348 typedef struct W_Browser WMBrowser;
349 typedef struct W_PopUpButton WMPopUpButton;
350 typedef struct W_ProgressIndicator WMProgressIndicator;
351 typedef struct W_ColorWell WMColorWell;
352 typedef struct W_Slider WMSlider;
353 typedef struct W_Matrix WMMatrix; /* not ready */
354 typedef struct W_SplitView WMSplitView;
355 typedef struct W_TabView WMTabView;
356 typedef struct W_Ruler WMRuler;
357 typedef struct W_Text WMText;
358 typedef struct W_Box WMBox;
361 /* not widgets */
362 typedef struct W_TabViewItem WMTabViewItem;
363 typedef struct W_MenuItem WMMenuItem;
366 typedef struct W_FilePanel WMFilePanel;
367 typedef WMFilePanel WMOpenPanel;
368 typedef WMFilePanel WMSavePanel;
370 typedef struct W_FontPanel WMFontPanel;
372 typedef struct W_ColorPanel WMColorPanel;
375 /* item for WMList */
376 typedef struct WMListItem {
377 char *text;
378 void *clientData; /* ptr for user clientdata. */
380 unsigned int uflags:16; /* flags for the user */
381 unsigned int selected:1;
382 unsigned int disabled:1;
383 unsigned int isBranch:1;
384 unsigned int loaded:1;
385 } WMListItem;
387 /* struct for message panel */
388 typedef struct WMAlertPanel {
389 WMWindow *win; /* window */
390 WMBox *vbox;
391 WMButton *defBtn; /* default button */
392 WMButton *altBtn; /* alternative button */
393 WMButton *othBtn; /* other button */
394 WMLabel *iLbl; /* icon label */
395 WMLabel *tLbl; /* title label */
396 WMLabel *mLbl; /* message label */
397 WMFrame *line; /* separator */
398 short result; /* button that was pushed */
399 } WMAlertPanel;
402 typedef struct WMGenericPanel {
403 WMWindow *win;
404 WMBox *vbox;
406 WMLabel *iLbl;
407 WMLabel *tLbl;
409 WMFrame *line;
411 WMFrame *content;
413 WMBox *buttonBox;
414 WMButton *defBtn;
415 WMButton *altBtn;
417 short result;
418 } WMGenericPanel;
423 typedef struct WMInputPanel {
424 WMWindow *win; /* window */
425 WMButton *defBtn; /* default button */
426 WMButton *altBtn; /* alternative button */
427 WMLabel *tLbl; /* title label */
428 WMLabel *mLbl; /* message label */
429 WMTextField *text; /* text field */
430 short result; /* button that was pushed */
431 } WMInputPanel;
434 /* WMRuler: */
435 typedef struct {
436 WMArray *tabs; /* a growable array of tabstops */
437 unsigned short left; /* left margin marker */
438 unsigned short right; /* right margin marker */
439 unsigned short first; /* indentation marker for first line only */
440 unsigned short body; /* body indentation marker */
441 unsigned short retainCount;
442 } WMRulerMargins;
443 /* All indentation and tab markers are _relative_ to the left margin marker */
446 typedef void WMEventProc(XEvent *event, void *clientData);
448 typedef void WMEventHook(XEvent *event);
450 /* self is set to the widget from where the callback is being called and
451 * clientData to the data set to with WMSetClientData() */
452 typedef void WMAction(WMWidget *self, void *clientData);
454 /* same as WMAction, but for stuff that arent widgets */
455 typedef void WMAction2(void *self, void *clientData);
458 typedef void WMDropDataCallback(WMView *view, WMData *data);
460 /* delegate method like stuff */
461 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
462 int state, WMRect *rect);
465 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
466 unsigned int oldWidth,
467 unsigned int oldHeight);
470 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
471 int *minSize, int *maxSize);
473 typedef WMWidget *WMMatrixCreateCellProc(WMMatrix *mPtr);
478 typedef struct WMBrowserDelegate {
479 void *data;
481 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
482 WMBrowser *sender, int column, WMList *list);
484 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
485 int column);
487 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
489 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
490 } WMBrowserDelegate;
493 typedef struct WMTextFieldDelegate {
494 void *data;
496 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
497 WMNotification *notif);
499 void (*didChange)(struct WMTextFieldDelegate *self,
500 WMNotification *notif);
502 void (*didEndEditing)(struct WMTextFieldDelegate *self,
503 WMNotification *notif);
505 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
506 WMTextField *tPtr);
508 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
509 WMTextField *tPtr);
510 } WMTextFieldDelegate;
513 typedef struct WMTextDelegate {
514 void *data;
516 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
517 void *description);
519 } WMTextDelegate;
523 typedef struct WMTabViewDelegate {
524 void *data;
526 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
527 WMTabView *tabView);
529 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
530 WMTabViewItem *item);
532 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
533 WMTabViewItem *item);
535 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
536 WMTabViewItem *item);
537 } WMTabViewDelegate;
542 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
543 Time timestamp, void *cdata, WMData *data);
546 typedef struct WMSelectionProcs {
547 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
548 void *cdata, Atom *type);
549 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
550 void (*selectionDone)(WMView *view, Atom selection, Atom target,
551 void *cdata);
552 } WMSelectionProcs;
555 typedef struct W_DraggingInfo WMDraggingInfo;
558 typedef struct W_DragSourceProcs {
559 unsigned (*draggingSourceOperation)(WMView *self, Bool local);
560 void (*beganDragImage)(WMView *self, WMPixmap *image, WMPoint point);
561 void (*endedDragImage)(WMView *self, WMPixmap *image, WMPoint point,
562 Bool deposited);
563 WMData* (*fetchDragData)(WMView *self, char *type);
564 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
565 } WMDragSourceProcs;
569 typedef struct W_DragDestinationProcs {
570 unsigned (*draggingEntered)(WMView *self, WMDraggingInfo *info);
571 unsigned (*draggingUpdated)(WMView *self, WMDraggingInfo *info);
572 void (*draggingExited)(WMView *self, WMDraggingInfo *info);
573 Bool (*prepareForDragOperation)(WMView *self, WMDraggingInfo *info);
574 Bool (*performDragOperation)(WMView *self, WMDraggingInfo *info);
575 void (*concludeDragOperation)(WMView *self, WMDraggingInfo *info);
576 } WMDragDestinationProcs;
581 /* ....................................................................... */
585 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
587 void WMSetResourcePath(char *path);
589 /* don't free the returned string */
590 char *WMGetApplicationName();
592 /* Try to locate resource file. ext may be NULL */
593 char *WMPathForResourceOfType(char *resource, char *ext);
596 WMScreen *WMOpenScreen(const char *display);
598 WMScreen *WMCreateScreenWithRContext(Display *display, int screen,
599 RContext *context);
601 WMScreen *WMCreateScreen(Display *display, int screen);
603 WMScreen *WMCreateSimpleApplicationScreen(Display *display);
605 void WMScreenMainLoop(WMScreen *scr);
607 void WMBreakModalLoop(WMScreen *scr);
609 void WMRunModalLoop(WMScreen *scr, WMView *view);
611 RContext *WMScreenRContext(WMScreen *scr);
613 Display *WMScreenDisplay(WMScreen *scr);
615 int WMScreenDepth(WMScreen *scr);
619 void WMSetApplicationIconImage(WMScreen *app, WMPixmap *icon);
621 WMPixmap *WMGetApplicationIconImage(WMScreen *app);
623 void WMSetApplicationIconWindow(WMScreen *scr, Window window);
625 void WMSetFocusToWidget(WMWidget *widget);
627 WMEventHook *WMHookEventHandler(WMEventHook *handler);
629 int WMHandleEvent(XEvent *event);
631 Bool WMScreenPending(WMScreen *scr);
633 void WMCreateEventHandler(WMView *view, unsigned long mask,
634 WMEventProc *eventProc, void *clientData);
636 void WMDeleteEventHandler(WMView *view, unsigned long mask,
637 WMEventProc *eventProc, void *clientData);
639 int WMIsDoubleClick(XEvent *event);
641 int WMIsTripleClick(XEvent *event);
643 void WMNextEvent(Display *dpy, XEvent *event);
645 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
648 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
649 WMSelectionProcs *procs, void *cdata);
651 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
653 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
654 Time timestamp, WMSelectionCallback *callback,
655 void *cdata);
658 /* ....................................................................... */
660 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
662 void WMDragImageFromView(WMView *view, WMPixmap *image, char *dataTypes[],
663 WMPoint atLocation, WMSize mouseOffset, XEvent *event,
664 Bool slideBack);
666 void WMRegisterViewForDraggedTypes(WMView *view, char *acceptedTypes[]);
668 void WMUnregisterViewDraggedTypes(WMView *view);
670 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
673 WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info);
675 /* ....................................................................... */
677 WMFont *WMCreateFontSet(WMScreen *scrPtr, char *fontName);
679 WMFont *WMCreateNormalFont(WMScreen *scrPtr, char *fontName);
681 WMFont *WMCreateFont(WMScreen *scrPtr, char *fontName);
683 WMFont *WMRetainFont(WMFont *font);
685 void WMReleaseFont(WMFont *font);
687 unsigned int WMFontHeight(WMFont *font);
690 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
692 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
696 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
698 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
700 WMFont *WMSystemFontOfSize(WMScreen *scrPtr, int size);
702 WMFont *WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
704 XFontSet WMGetFontFontSet(WMFont *font);
706 WMFont *WMNormalizeFont(WMScreen *scr, WMFont *font);
708 WMFont *WMStrengthenFont(WMScreen *scr, WMFont *font);
710 WMFont *WMUnstrengthenFont(WMScreen *scr, WMFont *font);
712 WMFont *WMEmphasizeFont(WMScreen *scr, WMFont *font);
714 WMFont *WMUnemphasizeFont(WMScreen *scr, WMFont *font);
716 WMFont *WMGetFontOfSize(WMScreen *scr, WMFont *font, int size);
718 /* ....................................................................... */
720 WMPixmap *WMRetainPixmap(WMPixmap *pixmap);
722 void WMReleasePixmap(WMPixmap *pixmap);
724 WMPixmap *WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
725 Bool masked);
727 WMPixmap *WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
728 Pixmap mask, int width, int height,
729 int depth);
731 WMPixmap *WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
732 int threshold);
734 WMPixmap *WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
736 WMSize WMGetPixmapSize(WMPixmap *pixmap);
738 WMPixmap *WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
740 WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
741 RColor *color);
743 WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
744 RColor *color);
746 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
748 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
750 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
752 WMPixmap *WMGetSystemPixmap(WMScreen *scr, int image);
754 /* ....................................................................... */
757 WMColor *WMDarkGrayColor(WMScreen *scr);
759 WMColor *WMGrayColor(WMScreen *scr);
761 WMColor *WMBlackColor(WMScreen *scr);
763 WMColor *WMWhiteColor(WMScreen *scr);
765 void WMSetColorInGC(WMColor *color, GC gc);
767 GC WMColorGC(WMColor *color);
769 WMPixel WMColorPixel(WMColor *color);
771 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
772 unsigned int width, unsigned int height);
774 void WMReleaseColor(WMColor *color);
776 WMColor *WMRetainColor(WMColor *color);
778 WMColor *WMCreateRGBColor(WMScreen *scr, unsigned short red,
779 unsigned short green, unsigned short blue,
780 Bool exact);
782 WMColor *WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
784 unsigned short WMRedComponentOfColor(WMColor *color);
786 unsigned short WMGreenComponentOfColor(WMColor *color);
788 unsigned short WMBlueComponentOfColor(WMColor *color);
790 char *WMGetColorRGBDescription(WMColor *color);
792 /* ....................................................................... */
795 void WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
796 int y, char *text, int length);
798 void WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
799 int y, char *text, int length);
801 int WMWidthOfString(WMFont *font, char *text, int length);
805 /* ....................................................................... */
807 WMScreen *WMWidgetScreen(WMWidget *w);
809 unsigned int WMScreenWidth(WMScreen *scr);
811 unsigned int WMScreenHeight(WMScreen *scr);
813 void WMUnmapWidget(WMWidget *w);
815 void WMMapWidget(WMWidget *w);
817 Bool WMWidgetIsMapped(WMWidget *w);
819 void WMRaiseWidget(WMWidget *w);
821 void WMLowerWidget(WMWidget *w);
823 void WMMoveWidget(WMWidget *w, int x, int y);
825 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
827 void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
829 void WMMapSubwidgets(WMWidget *w);
831 void WMUnmapSubwidgets(WMWidget *w);
833 void WMRealizeWidget(WMWidget *w);
835 void WMDestroyWidget(WMWidget *widget);
837 void WMHangData(WMWidget *widget, void *data);
839 void *WMGetHangedData(WMWidget *widget);
841 unsigned int WMWidgetWidth(WMWidget *w);
843 unsigned int WMWidgetHeight(WMWidget *w);
845 Window WMWidgetXID(WMWidget *w);
847 Window WMViewXID(WMView *view);
849 void WMRedisplayWidget(WMWidget *w);
851 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
853 void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
854 int rightOffs, int bottomOffs);
856 WMSize WMGetViewSize(WMView *view);
858 WMPoint WMGetViewPosition(WMView *view);
860 WMPoint WMGetViewScreenPosition(WMView *view);
862 WMWidget *WMWidgetOfView(WMView *view);
864 void WMSetViewNextResponder(WMView *view, WMView *responder);
866 void WMRelayToNextResponder(WMView *view, XEvent *event);
868 /* notifications */
869 extern char *WMViewSizeDidChangeNotification;
871 extern char *WMViewRealizedNotification;
873 extern char *WMFontPanelDidChangeNotification;
876 /* ....................................................................... */
878 void WMSetBalloonTextForView(char *text, WMView *view);
880 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
882 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
884 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
886 void WMSetBalloonDelay(WMScreen *scr, int delay);
888 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
891 /* ....................................................................... */
893 WMWindow *WMCreateWindow(WMScreen *screen, char *name);
895 WMWindow *WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
897 WMWindow *WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
898 int style);
900 WMWindow *WMCreatePanelForWindow(WMWindow *owner, char *name);
902 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
904 void WMSetWindowTitle(WMWindow *wPtr, char *title);
906 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
908 void WMSetWindowMiniwindowImage(WMWindow *win, WMPixmap *pixmap);
910 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
912 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
914 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
916 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
917 int maxX, int maxY);
919 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
921 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
923 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
925 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
927 void WMSetWindowLevel(WMWindow *win, int level);
929 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
931 void WMCloseWindow(WMWindow *win);
933 /* ....................................................................... */
935 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
937 #define WMCreateCommandButton(parent) \
938 WMCreateCustomButton((parent), WBBSpringLoadedMask\
939 |WBBPushInMask\
940 |WBBPushLightMask\
941 |WBBPushChangeMask)
943 #define WMCreateRadioButton(parent) \
944 WMCreateButton((parent), WBTRadio)
946 #define WMCreateSwitchButton(parent) \
947 WMCreateButton((parent), WBTSwitch)
949 WMButton *WMCreateButton(WMWidget *parent, WMButtonType type);
951 WMButton *WMCreateCustomButton(WMWidget *parent, int behaviourMask);
953 void WMSetButtonImageDefault(WMButton *bPtr);
955 void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
957 void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
959 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
961 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
963 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
965 void WMSetButtonText(WMButton *bPtr, char *text);
967 void WMSetButtonAltText(WMButton *bPtr, char *text);
969 void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
971 void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
973 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
975 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
977 int WMGetButtonSelected(WMButton *bPtr);
979 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
981 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
983 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
985 void WMSetButtonTag(WMButton *bPtr, int tag);
987 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
989 void WMPerformButtonClick(WMButton *bPtr);
991 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
993 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
995 /* ....................................................................... */
997 WMLabel *WMCreateLabel(WMWidget *parent);
999 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1001 void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
1003 WMPixmap *WMGetLabelImage(WMLabel *lPtr);
1005 char *WMGetLabelText(WMLabel *lPtr);
1007 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1009 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1011 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1013 void WMSetLabelText(WMLabel *lPtr, char *text);
1015 WMFont* WMGetLabelFont(WMLabel *lPtr);
1017 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1019 void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
1021 /* ....................................................................... */
1023 WMFrame *WMCreateFrame(WMWidget *parent);
1025 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1027 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1029 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1031 /* ....................................................................... */
1033 WMTextField *WMCreateTextField(WMWidget *parent);
1035 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1037 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1039 /* you can free the returned string */
1040 char *WMGetTextFieldText(WMTextField *tPtr);
1042 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1044 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1046 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1048 WMFont *WMGetTextFieldFont(WMTextField *tPtr);
1050 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1052 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1054 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1056 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1058 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1060 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1062 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1064 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1066 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1068 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1071 extern char *WMTextDidChangeNotification;
1072 extern char *WMTextDidBeginEditingNotification;
1073 extern char *WMTextDidEndEditingNotification;
1075 /* ....................................................................... */
1077 WMScroller *WMCreateScroller(WMWidget *parent);
1079 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1080 float knobProportion);
1082 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1084 float WMGetScrollerValue(WMScroller *sPtr);
1086 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1088 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1090 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1091 WMScrollArrowPosition position);
1093 extern char *WMScrollerDidScrollNotification;
1095 /* ....................................................................... */
1097 WMList *WMCreateList(WMWidget *parent);
1099 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1101 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1103 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1105 WMListItem *WMInsertListItem(WMList *lPtr, int row, char *text);
1107 void WMSortListItems(WMList *lPtr);
1109 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1111 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1113 WMListItem *WMGetListItem(WMList *lPtr, int row);
1115 WMArray *WMGetListItems(WMList *lPtr);
1117 void WMRemoveListItem(WMList *lPtr, int row);
1119 void WMSelectListItem(WMList *lPtr, int row);
1121 void WMUnselectListItem(WMList *lPtr, int row);
1123 /* This will select all items in range, and deselect all the others */
1124 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1126 /* This will select all items in range, leaving the others as they are */
1127 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1129 void WMSelectAllListItems(WMList *lPtr);
1131 void WMUnselectAllListItems(WMList *lPtr);
1133 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1135 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1137 int WMGetListItemHeight(WMList *lPtr);
1139 /* don't free the returned data */
1140 WMArray* WMGetListSelectedItems(WMList *lPtr);
1143 * For the following 2 functions, in case WMList allows multiple selection,
1144 * the first item in the list of selected items, respective its row number,
1145 * will be returned.
1148 /* don't free the returned data */
1149 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1151 int WMGetListSelectedItemRow(WMList *lPtr);
1153 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1155 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1157 void WMClearList(WMList *lPtr);
1159 int WMGetListNumberOfRows(WMList *lPtr);
1161 void WMSetListPosition(WMList *lPtr, int row);
1163 void WMSetListBottomPosition(WMList *lPtr, int row);
1165 int WMGetListPosition(WMList *lPtr);
1167 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1169 Bool WMListAllowsEmptySelection(WMList *lPtr);
1172 extern char *WMListDidScrollNotification;
1173 extern char *WMListSelectionDidChangeNotification;
1175 /* ....................................................................... */
1177 WMBrowser *WMCreateBrowser(WMWidget *parent);
1179 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1181 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1183 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1185 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1187 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1189 int WMAddBrowserColumn(WMBrowser *bPtr);
1191 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1193 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1195 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1197 WMListItem *WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1199 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1201 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1202 WMCompareDataProc *func);
1204 /* Don't free the returned string. */
1205 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1207 /* free the returned string */
1208 char *WMGetBrowserPath(WMBrowser *bPtr);
1210 /* free the returned string */
1211 char *WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1213 /* free the returned array */
1214 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1216 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1218 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1219 void *clientData);
1221 WMListItem *WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1223 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1225 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1227 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1229 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1231 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1233 WMList *WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1235 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1237 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1239 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1241 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1243 /* ....................................................................... */
1246 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1248 WMMenuItem *WMCreateMenuItem(void);
1250 void WMDestroyMenuItem(WMMenuItem *item);
1252 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1254 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1256 char *WMGetMenuItemShortcut(WMMenuItem *item);
1258 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1260 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1262 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1264 void *WMGetMenuItemRepresentedObject(WMMenuItem *item);
1266 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1268 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1270 WMAction *WMGetMenuItemAction(WMMenuItem *item);
1272 void *WMGetMenuItemData(WMMenuItem *item);
1274 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1276 char *WMGetMenuItemTitle(WMMenuItem *item);
1278 void WMSetMenuItemState(WMMenuItem *item, int state);
1280 int WMGetMenuItemState(WMMenuItem *item);
1282 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1284 WMPixmap *WMGetMenuItemPixmap(WMMenuItem *item);
1286 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1288 WMPixmap *WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1290 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1292 WMPixmap *WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1294 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1296 WMPixmap *WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1298 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1301 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1303 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1306 /* ....................................................................... */
1308 WMPopUpButton *WMCreatePopUpButton(WMWidget *parent);
1310 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1311 void *clientData);
1313 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1315 WMMenuItem *WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1317 WMMenuItem *WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1318 char *title);
1320 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1322 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1324 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1326 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1328 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1330 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1332 /* don't free the returned data */
1333 char *WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1335 WMMenuItem *WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1338 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1340 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1342 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1344 /* ....................................................................... */
1346 WMProgressIndicator *WMCreateProgressIndicator(WMWidget *parent);
1348 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1350 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1352 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1354 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1356 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1358 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1361 /* ....................................................................... */
1363 WMColorPanel *WMGetColorPanel(WMScreen *scrPtr);
1365 void WMFreeColorPanel(WMColorPanel *panel);
1367 void WMShowColorPanel(WMColorPanel *panel);
1369 void WMCloseColorPanel(WMColorPanel *panel);
1371 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1373 WMColor *WMGetColorPanelColor(WMColorPanel *panel);
1375 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1377 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1379 extern char *WMColorPanelColorChangedNotification;
1381 /* ....................................................................... */
1383 WMColorWell *WMCreateColorWell(WMWidget *parent);
1385 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1387 WMColor *WMGetColorWellColor(WMColorWell *cPtr);
1389 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1392 extern char *WMColorWellDidChangeNotification;
1395 /* ...................................................................... */
1397 WMScrollView *WMCreateScrollView(WMWidget *parent);
1399 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1400 unsigned int height);
1402 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1404 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1406 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1408 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1410 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1412 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1414 WMScroller *WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1416 WMScroller *WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1418 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1420 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1422 /* ....................................................................... */
1424 WMSlider *WMCreateSlider(WMWidget *parent);
1426 int WMGetSliderMinValue(WMSlider *slider);
1428 int WMGetSliderMaxValue(WMSlider *slider);
1430 int WMGetSliderValue(WMSlider *slider);
1432 void WMSetSliderMinValue(WMSlider *slider, int value);
1434 void WMSetSliderMaxValue(WMSlider *slider, int value);
1436 void WMSetSliderValue(WMSlider *slider, int value);
1438 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1440 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1442 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1444 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1446 /* ....................................................................... */
1449 WMSplitView *WMCreateSplitView(WMWidget *parent);
1450 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1451 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1453 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1455 WMView *WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1457 /* remove the first subview == view */
1458 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1460 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1463 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1465 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1467 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1468 WMSplitViewConstrainProc *proc);
1471 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1472 WMSplitViewResizeSubviewsProc *proc);
1475 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1477 /* ...................................................................... */
1479 WMRuler *WMCreateRuler (WMWidget *parent);
1481 WMRulerMargins *WMGetRulerMargins(WMRuler *rPtr);
1483 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1485 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin,
1486 WMRulerMargins *anotherMargin);
1488 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1490 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1492 int WMGetRulerOffset(WMRuler *rPtr);
1494 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1496 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1498 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1500 /* ....................................................................... */
1503 #define WMCreateText(parent) WMCreateTextForDocumentType \
1504 ((parent), (NULL), (NULL))
1506 WMText *WMCreateTextForDocumentType(WMWidget *parent,
1507 WMAction *parser, WMAction *writer);
1509 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1511 void WMFreezeText(WMText *tPtr);
1513 #define WMRefreshText(tPtr) WMThawText((tPtr))
1515 void WMThawText(WMText *tPtr);
1517 int WMScrollText(WMText *tPtr, int amount);
1519 int WMPageText(WMText *tPtr, Bool direction);
1521 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1523 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1525 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1527 void WMShowTextRuler(WMText *tPtr, Bool show);
1529 int WMGetTextRulerShown(WMText *tPtr);
1531 void WMSetTextEditable(WMText *tPtr, Bool editable);
1533 int WMGetTextEditable(WMText *tPtr);
1535 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1537 int WMGetTextUsesMonoFont(WMText *tPtr);
1539 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1541 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1543 int WMGetTextIgnoresNewline(WMText *tPtr);
1545 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1547 WMFont * WMGetTextDefaultFont(WMText *tPtr);
1549 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1551 WMColor * WMGetTextDefaultColor(WMText *tPtr);
1553 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1555 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1557 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1559 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1561 void WMPrependTextStream(WMText *tPtr, char *text);
1563 void WMAppendTextStream(WMText *tPtr, char *text);
1565 #define WMClearText(tPtr) WMAppendTextStream \
1566 ((tPtr), (NULL))
1568 /* free the text */
1569 char * WMGetTextStream(WMText *tPtr);
1571 /* free the text */
1572 char * WMGetTextSelectedStream(WMText *tPtr);
1574 /* destroy the array */
1575 WMArray * WMGetTextObjects(WMText *tPtr);
1577 /* destroy the array */
1578 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1580 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1582 WMColor *WMGetTextSelectionColor(WMText *tPtr);
1584 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1586 WMFont *WMGetTextSelectionFont(WMText *tPtr);
1588 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1590 int WMGetTextSelectionUnderlined(WMText *tPtr);
1592 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1594 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1595 Bool caseSensitive);
1597 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1600 /* parser related stuff... use only if implementing a new parser */
1602 void *WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1603 WMColor *color, unsigned short first, unsigned short extraInfo);
1605 void *WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1606 WMColor *color, unsigned short first, unsigned short extraInfo);
1608 void *WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1609 WMColor *color, unsigned short first, unsigned short length);
1611 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1612 unsigned int kanji, unsigned int underlined, int script,
1613 WMRulerMargins *margins);
1615 /* do NOT free the margins */
1616 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1617 unsigned int *kanji, unsigned int *underlined, int *script,
1618 WMRulerMargins *margins);
1620 int WMGetTextInsertType(WMText *tPtr);
1622 int WMGetTextBlocks(WMText *tPtr);
1624 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1626 int WMGetCurrentTextBlock(WMText *tPtr);
1628 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1630 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1632 void *WMRemoveTextBlock(WMText *tPtr);
1634 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1636 /* ....................................................................... */
1639 WMTabView *WMCreateTabView(WMWidget *parent);
1641 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1643 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1645 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1647 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1649 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1651 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1653 WMTabViewItem *WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1654 int identifier, char *label);
1656 WMTabViewItem *WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1658 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1660 void WMSelectLastTabViewItem(WMTabView *tPtr);
1662 void WMSelectNextTabViewItem(WMTabView *tPtr);
1664 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1666 WMTabViewItem *WMGetSelectedTabViewItem(WMTabView *tPtr);
1668 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1670 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1672 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1675 WMTabViewItem *WMCreateTabViewItemWithIdentifier(int identifier);
1677 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1679 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1681 char *WMGetTabViewItemLabel(WMTabViewItem *item);
1683 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1685 WMView *WMGetTabViewItemView(WMTabViewItem *item);
1687 void WMDestroyTabViewItem(WMTabViewItem *item);
1690 /* ....................................................................... */
1692 WMBox *WMCreateBox(WMWidget *parent);
1694 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1696 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1697 int minSize, int maxSize, int space);
1699 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1700 int minSize, int maxSize, int space);
1702 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1704 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1706 /* ....................................................................... */
1708 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1709 char *defaultButton, char *alternateButton,
1710 char *otherButton);
1712 /* you can free the returned string */
1713 char *WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1714 char *defaultText, char *okButton, char *cancelButton);
1716 WMAlertPanel *WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1717 char *msg, char *defaultButton,
1718 char *alternateButton, char *otherButton);
1720 WMInputPanel *WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1721 char *msg, char *defaultText, char *okButton,
1722 char *cancelButton);
1725 WMGenericPanel *WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
1726 char *title, char *defaultButton,
1727 char *alternateButton);
1729 void WMDestroyAlertPanel(WMAlertPanel *panel);
1731 void WMDestroyInputPanel(WMInputPanel *panel);
1733 void WMDestroyGenericPanel(WMGenericPanel *panel);
1735 /* ....................................................................... */
1737 /* only 1 instance per WMScreen */
1738 WMOpenPanel *WMGetOpenPanel(WMScreen *scrPtr);
1740 WMSavePanel *WMGetSavePanel(WMScreen *scrPtr);
1742 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1744 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1746 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1748 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1750 /* you can free the returned string */
1751 char *WMGetFilePanelFileName(WMFilePanel *panel);
1753 void WMFreeFilePanel(WMFilePanel *panel);
1755 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1756 char *path, char *name, char **fileTypes);
1758 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1760 WMView *WMGetFilePanelAccessoryView(WMFilePanel *panel);
1763 /* ...................................................................... */
1765 /* only 1 instance per WMScreen */
1766 WMFontPanel *WMGetFontPanel(WMScreen *scr);
1768 void WMShowFontPanel(WMFontPanel *panel);
1770 void WMHideFontPanel(WMFontPanel *panel);
1772 void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
1774 /* you can free the returned string */
1775 char *WMGetFontPanelFontName(WMFontPanel *panel);
1777 WMFont *WMGetFontPanelFont(WMFontPanel *panel);
1779 #ifdef __cplusplus
1781 #endif /* __cplusplus */
1783 #endif