fixed modifier bug in textfield again
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
blob0912ecd6c54cea9ee1f25eb1aef73f1ab118092c
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;
40 /* WMRange was moved in WUtil.h */
42 #define ClientMessageMask (1L<<30)
46 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
47 * NSDesktopWindowLevel intended to be the level at which things
48 * on the desktop sit ... so you should be able
49 * to put a desktop background just below it.
51 * Applications are actually permitted to use any value in the
52 * range INT_MIN+1 to INT_MAX
54 enum {
55 WMDesktopWindowLevel = -1000, /* GNUstep addition */
56 WMNormalWindowLevel = 0,
57 WMFloatingWindowLevel = 3,
58 WMSubmenuWindowLevel = 3,
59 WMTornOffMenuWindowLevel = 3,
60 WMMainMenuWindowLevel = 20,
61 WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */
62 WMStatusWindowLevel = 21,
63 WMModalPanelWindowLevel = 100,
64 WMPopUpMenuWindowLevel = 101,
65 WMScreenSaverWindowLevel = 1000
69 /* window attributes */
70 enum {
71 WMBorderlessWindowMask = 0,
72 WMTitledWindowMask = 1,
73 WMClosableWindowMask = 2,
74 WMMiniaturizableWindowMask = 4,
75 WMResizableWindowMask = 8,
76 WMIconWindowMask = 64,
77 WMMiniWindowMask = 128
80 /* button types */
81 typedef enum {
82 /* 0 is reserved for internal use */
83 WBTMomentaryPush = 1,
84 WBTPushOnPushOff = 2,
85 WBTToggle = 3,
86 WBTSwitch = 4,
87 WBTRadio = 5,
88 WBTMomentaryChange = 6,
89 WBTOnOff = 7,
90 WBTMomentaryLight = 8
91 } WMButtonType;
93 /* button behaviour masks */
94 enum {
95 WBBSpringLoadedMask = (1 << 0),
96 WBBPushInMask = (1 << 1),
97 WBBPushChangeMask = (1 << 2),
98 WBBPushLightMask = (1 << 3),
99 WBBStateLightMask = (1 << 5),
100 WBBStateChangeMask = (1 << 6),
101 WBBStatePushMask = (1 << 7)
105 /* frame title positions */
106 typedef enum {
107 WTPNoTitle,
108 WTPAboveTop,
109 WTPAtTop,
110 WTPBelowTop,
111 WTPAboveBottom,
112 WTPAtBottom,
113 WTPBelowBottom
114 } WMTitlePosition;
117 /* relief types */
118 typedef enum {
119 WRFlat,
120 WRSimple,
121 WRRaised,
122 WRSunken,
123 WRGroove,
124 WRRidge,
125 WRPushed
126 } WMReliefType;
129 /* alignment types */
130 typedef enum {
131 WALeft,
132 WACenter,
133 WARight,
134 WAJustified /* not valid for textfields */
135 } WMAlignment;
138 /* image position */
139 typedef enum {
140 WIPNoImage,
141 WIPImageOnly,
142 WIPLeft,
143 WIPRight,
144 WIPBelow,
145 WIPAbove,
146 WIPOverlaps
147 } WMImagePosition;
150 /* scroller arrow position */
151 typedef enum {
152 WSAMaxEnd,
153 WSAMinEnd,
154 WSANone
155 } WMScrollArrowPosition;
157 /* scroller parts */
158 typedef enum {
159 WSNoPart,
160 WSDecrementPage,
161 WSIncrementPage,
162 WSDecrementLine,
163 WSIncrementLine,
164 WSDecrementWheel,
165 WSIncrementWheel,
166 WSKnob,
167 WSKnobSlot
168 } WMScrollerPart;
170 /* usable scroller parts */
171 typedef enum {
172 WSUNoParts,
173 WSUOnlyArrows,
174 WSUAllParts
175 } WMUsableScrollerParts;
177 /* matrix types */
178 typedef enum {
179 WMRadioMode,
180 WMHighlightMode,
181 WMListMode,
182 WMTrackMode
183 } WMMatrixTypes;
186 typedef enum {
187 WTTopTabsBevelBorder,
188 WTNoTabsBevelBorder,
189 WTNoTabsLineBorder,
190 WTNoTabsNoBorder
191 } WMTabViewType;
194 /* text movement types */
195 enum {
196 WMIllegalTextMovement,
197 WMReturnTextMovement,
198 WMEscapeTextMovement,
199 WMTabTextMovement,
200 WMBacktabTextMovement,
201 WMLeftTextMovement,
202 WMRightTextMovement,
203 WMUpTextMovement,
204 WMDownTextMovement
207 /* text field special events */
208 enum {
209 WMInsertTextEvent,
210 WMDeleteTextEvent
214 enum {
215 WLNotFound = -1 /* element was not found in WMList */
219 /* drag operations */
220 typedef enum {
221 WDOperationNone,
222 WDOperationCopy,
223 WDOperationMove,
224 WDOperationLink,
225 WDOperationAsk,
226 WDOperationPrivate
227 } WMDragOperationType;
230 typedef enum {
231 WMGrayModeColorPanel = 1,
232 WMRGBModeColorPanel = 2,
233 WMCMYKModeColorPanel = 3,
234 WMHSBModeColorPanel = 4,
235 WMCustomPaletteModeColorPanel = 5,
236 WMColorListModeColorPanel = 6,
237 WMWheelModeColorPanel = 7
238 } WMColorPanelMode;
242 /* system images */
243 #define WSIReturnArrow 1
244 #define WSIHighlightedReturnArrow 2
245 #define WSIScrollerDimple 3
246 #define WSIArrowLeft 4
247 #define WSIHighlightedArrowLeft 5
248 #define WSIArrowRight 6
249 #define WSIHighlightedArrowRight 7
250 #define WSIArrowUp 8
251 #define WSIHighlightedArrowUp 9
252 #define WSIArrowDown 10
253 #define WSIHighlightedArrowDown 11
254 #define WSICheckMark 12
256 enum {
257 WLDSSelected = (1 << 16),
258 WLDSDisabled = (1 << 17),
259 WLDSFocused = (1 << 18),
260 WLDSIsBranch = (1 << 19)
263 /* alert panel return values */
264 enum {
265 WAPRDefault = 0,
266 WAPRAlternate = 1,
267 WAPROther = -1,
268 WAPRError = -2
273 /* types of input observers */
274 enum {
275 WIReadMask = (1 << 0),
276 WIWriteMask = (1 << 1),
277 WIExceptMask = (1 << 2)
282 typedef int W_Class;
284 enum {
285 WC_Window = 0,
286 WC_Frame = 1,
287 WC_Label = 2,
288 WC_Button = 3,
289 WC_TextField = 4,
290 WC_Scroller = 5,
291 WC_ScrollView = 6,
292 WC_List = 7,
293 WC_Browser = 8,
294 WC_PopUpButton = 9,
295 WC_ColorWell = 10,
296 WC_Slider = 11,
297 WC_Matrix = 12, /* not ready */
298 WC_SplitView = 13,
299 WC_TabView = 14,
300 WC_ProgressIndicator = 15,
301 WC_MenuView = 16,
302 WC_Ruler = 17,
303 WC_Text = 18,
304 WC_Box = 19
307 /* All widgets must start with the following structure
308 * in that order. Used for typecasting to get some generic data */
309 typedef struct W_WidgetType {
310 W_Class widgetClass;
311 struct W_View *view;
313 } W_WidgetType;
316 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
317 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
320 /* widgets */
322 typedef void WMWidget;
324 typedef struct W_Pixmap WMPixmap;
325 typedef struct W_Font WMFont;
326 typedef struct W_Color WMColor;
328 typedef struct W_Screen WMScreen;
330 typedef struct W_View WMView;
332 typedef struct W_Window WMWindow;
333 typedef struct W_Frame WMFrame;
334 typedef struct W_Button WMButton;
335 typedef struct W_Label WMLabel;
336 typedef struct W_TextField WMTextField;
337 typedef struct W_Scroller WMScroller;
338 typedef struct W_ScrollView WMScrollView;
339 typedef struct W_List WMList;
340 typedef struct W_Browser WMBrowser;
341 typedef struct W_PopUpButton WMPopUpButton;
342 typedef struct W_ProgressIndicator WMProgressIndicator;
343 typedef struct W_ColorWell WMColorWell;
344 typedef struct W_Slider WMSlider;
345 typedef struct W_Matrix WMMatrix; /* not ready */
346 typedef struct W_SplitView WMSplitView;
347 typedef struct W_TabView WMTabView;
348 typedef struct W_Ruler WMRuler;
349 typedef struct W_Text WMText;
350 typedef struct W_Box WMBox;
353 /* not widgets */
354 typedef struct W_TabViewItem WMTabViewItem;
355 typedef struct W_MenuItem WMMenuItem;
358 typedef struct W_FilePanel WMFilePanel;
359 typedef WMFilePanel WMOpenPanel;
360 typedef WMFilePanel WMSavePanel;
362 typedef struct W_FontPanel WMFontPanel;
364 typedef struct W_ColorPanel WMColorPanel;
367 /* item for WMList */
368 typedef struct WMListItem {
369 char *text;
370 void *clientData; /* ptr for user clientdata. */
372 unsigned int uflags:16; /* flags for the user */
373 unsigned int selected:1;
374 unsigned int disabled:1;
375 unsigned int isBranch:1;
376 unsigned int loaded:1;
377 } WMListItem;
379 /* struct for message panel */
380 typedef struct WMAlertPanel {
381 WMWindow *win; /* window */
382 WMBox *vbox;
383 WMButton *defBtn; /* default button */
384 WMButton *altBtn; /* alternative button */
385 WMButton *othBtn; /* other button */
386 WMLabel *iLbl; /* icon label */
387 WMLabel *tLbl; /* title label */
388 WMLabel *mLbl; /* message label */
389 WMFrame *line; /* separator */
390 short result; /* button that was pushed */
391 short done;
393 KeyCode retKey;
394 KeyCode escKey;
395 } WMAlertPanel;
398 typedef struct WMInputPanel {
399 WMWindow *win; /* window */
400 WMButton *defBtn; /* default button */
401 WMButton *altBtn; /* alternative button */
402 WMLabel *tLbl; /* title label */
403 WMLabel *mLbl; /* message label */
404 WMTextField *text; /* text field */
405 short result; /* button that was pushed */
406 short done;
408 KeyCode retKey;
409 KeyCode escKey;
410 } WMInputPanel;
415 /* WMRuler: */
416 typedef struct {
417 WMArray *tabs; /* a growable array of tabstops */
418 unsigned short left; /* left margin marker */
419 unsigned short right; /* right margin marker */
420 unsigned short first; /* indentation marker for first line only */
421 unsigned short body; /* body indentation marker */
422 unsigned short retainCount;
423 } WMRulerMargins;
424 /* All indentation and tab markers are _relative_ to the left margin marker */
427 typedef void *WMHandlerID;
429 typedef void WMInputProc(int fd, int mask, void *clientData);
431 typedef void WMEventProc(XEvent *event, void *clientData);
433 typedef void WMEventHook(XEvent *event);
435 /* self is set to the widget from where the callback is being called and
436 * clientData to the data set to with WMSetClientData() */
437 typedef void WMAction(WMWidget *self, void *clientData);
439 /* same as WMAction, but for stuff that arent widgets */
440 typedef void WMAction2(void *self, void *clientData);
443 typedef void WMCallback(void *data);
445 typedef void WMDropDataCallback(WMView *view, WMData *data);
447 /* delegate method like stuff */
448 typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
449 int state, WMRect *rect);
452 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
453 unsigned int oldWidth,
454 unsigned int oldHeight);
457 typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
458 int *minSize, int *maxSize);
460 typedef WMWidget *WMMatrixCreateCellProc(WMMatrix *mPtr);
465 typedef struct WMBrowserDelegate {
466 void *data;
468 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
469 WMBrowser *sender, int column, WMList *list);
471 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
472 int column);
474 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
476 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
477 } WMBrowserDelegate;
480 typedef struct WMTextFieldDelegate {
481 void *data;
483 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
484 WMNotification *notif);
486 void (*didChange)(struct WMTextFieldDelegate *self,
487 WMNotification *notif);
489 void (*didEndEditing)(struct WMTextFieldDelegate *self,
490 WMNotification *notif);
492 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
493 WMTextField *tPtr);
495 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
496 WMTextField *tPtr);
497 } WMTextFieldDelegate;
500 typedef struct WMTextDelegate {
501 void *data;
503 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
504 void *description);
506 } WMTextDelegate;
510 typedef struct WMTabViewDelegate {
511 void *data;
513 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
514 WMTabView *tabView);
516 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
517 WMTabViewItem *item);
519 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
520 WMTabViewItem *item);
522 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
523 WMTabViewItem *item);
524 } WMTabViewDelegate;
529 typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
530 Time timestamp, void *cdata, WMData *data);
533 typedef struct WMSelectionProcs {
534 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
535 void *cdata, Atom *type);
536 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
537 void (*selectionDone)(WMView *view, Atom selection, Atom target,
538 void *cdata);
539 } WMSelectionProcs;
542 typedef struct W_DraggingInfo WMDraggingInfo;
545 typedef struct W_DragSourceProcs {
546 unsigned (*draggingSourceOperation)(WMView *self, Bool local);
547 void (*beganDragImage)(WMView *self, WMPixmap *image, WMPoint point);
548 void (*endedDragImage)(WMView *self, WMPixmap *image, WMPoint point,
549 Bool deposited);
550 WMData* (*fetchDragData)(WMView *self, char *type);
551 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
552 } WMDragSourceProcs;
556 typedef struct W_DragDestinationProcs {
557 unsigned (*draggingEntered)(WMView *self, WMDraggingInfo *info);
558 unsigned (*draggingUpdated)(WMView *self, WMDraggingInfo *info);
559 void (*draggingExited)(WMView *self, WMDraggingInfo *info);
560 Bool (*prepareForDragOperation)(WMView *self, WMDraggingInfo *info);
561 Bool (*performDragOperation)(WMView *self, WMDraggingInfo *info);
562 void (*concludeDragOperation)(WMView *self, WMDraggingInfo *info);
563 } WMDragDestinationProcs;
567 /* ...................................................................... */
570 WMRange wmkrange(int start, int count);
572 WMPoint wmkpoint(int x, int y);
574 WMSize wmksize(unsigned int width, unsigned int height);
577 /* ....................................................................... */
581 void WMInitializeApplication(char *applicationName, int *argc, char **argv);
583 void WMSetResourcePath(char *path);
585 /* don't free the returned string */
586 char *WMGetApplicationName();
588 /* Try to locate resource file. ext may be NULL */
589 char *WMPathForResourceOfType(char *resource, char *ext);
592 WMScreen *WMOpenScreen();
594 WMScreen *WMCreateScreenWithRContext(Display *display, int screen,
595 RContext *context);
597 WMScreen *WMCreateScreen(Display *display, int screen);
599 WMScreen *WMCreateSimpleApplicationScreen(Display *display);
601 void WMScreenMainLoop(WMScreen *scr);
603 void WMBreakModalLoop(WMScreen *scr);
605 void WMRunModalLoop(WMScreen *scr, WMView *view);
607 RContext *WMScreenRContext(WMScreen *scr);
609 Display *WMScreenDisplay(WMScreen *scr);
611 int WMScreenDepth(WMScreen *scr);
615 void WMSetApplicationIconImage(WMScreen *app, WMPixmap *icon);
617 WMPixmap *WMGetApplicationIconImage(WMScreen *app);
619 void WMSetApplicationIconWindow(WMScreen *scr, Window window);
621 void WMSetFocusToWidget(WMWidget *widget);
623 WMEventHook *WMHookEventHandler(WMEventHook *handler);
625 int WMHandleEvent(XEvent *event);
627 Bool WMScreenPending(WMScreen *scr);
629 void WMCreateEventHandler(WMView *view, unsigned long mask,
630 WMEventProc *eventProc, void *clientData);
632 void WMDeleteEventHandler(WMView *view, unsigned long mask,
633 WMEventProc *eventProc, void *clientData);
635 int WMIsDoubleClick(XEvent *event);
637 int WMIsTripleClick(XEvent *event);
639 void WMNextEvent(Display *dpy, XEvent *event);
641 void WMMaskEvent(Display *dpy, long mask, XEvent *event);
643 WMHandlerID WMAddTimerHandler(int milliseconds, WMCallback *callback,
644 void *cdata);
646 void WMDeleteTimerWithClientData(void *cdata);
648 void WMDeleteTimerHandler(WMHandlerID handlerID);
650 WMHandlerID WMAddIdleHandler(WMCallback *callback, void *cdata);
652 void WMDeleteIdleHandler(WMHandlerID handlerID);
654 WMHandlerID WMAddInputHandler(int fd, int condition, WMInputProc *proc,
655 void *clientData);
657 void WMDeleteInputHandler(WMHandlerID handlerID);
661 Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
662 WMSelectionProcs *procs, void *cdata);
664 void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
666 Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
667 Time timestamp, WMSelectionCallback *callback,
668 void *cdata);
671 /* ....................................................................... */
673 void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
675 void WMDragImageFromView(WMView *view, WMPixmap *image, char *dataTypes[],
676 WMPoint atLocation, WMSize mouseOffset, XEvent *event,
677 Bool slideBack);
679 void WMRegisterViewForDraggedTypes(WMView *view, char *acceptedTypes[]);
681 void WMUnregisterViewDraggedTypes(WMView *view);
683 void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
686 WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info);
688 /* ....................................................................... */
690 WMFont *WMCreateFontSet(WMScreen *scrPtr, char *fontName);
692 WMFont *WMCreateNormalFont(WMScreen *scrPtr, char *fontName);
694 WMFont *WMCreateFont(WMScreen *scrPtr, char *fontName);
696 WMFont *WMRetainFont(WMFont *font);
698 void WMReleaseFont(WMFont *font);
700 unsigned int WMFontHeight(WMFont *font);
703 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
705 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
709 void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
711 void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
713 WMFont *WMSystemFontOfSize(WMScreen *scrPtr, int size);
715 WMFont *WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
717 XFontSet WMGetFontFontSet(WMFont *font);
719 WMFont * WMNormalizeFont(WMScreen *scr, WMFont *font);
721 WMFont * WMStrengthenFont(WMScreen *scr, WMFont *font);
723 WMFont * WMUnstrengthenFont(WMScreen *scr, WMFont *font);
725 WMFont * WMEmphasizeFont(WMScreen *scr, WMFont *font);
727 WMFont * WMUnemphasizeFont(WMScreen *scr, WMFont *font);
729 WMFont * WMGetFontOfSize(WMScreen *scr, WMFont *font, int size);
731 /* ....................................................................... */
733 WMPixmap *WMRetainPixmap(WMPixmap *pixmap);
735 void WMReleasePixmap(WMPixmap *pixmap);
737 WMPixmap *WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
738 Bool masked);
740 WMPixmap *WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
741 Pixmap mask, int width, int height,
742 int depth);
744 WMPixmap *WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
745 int threshold);
747 WMPixmap *WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
749 WMSize WMGetPixmapSize(WMPixmap *pixmap);
751 WMPixmap *WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
753 WMPixmap *WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
754 RColor *color);
756 void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
758 Pixmap WMGetPixmapXID(WMPixmap *pixmap);
760 Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
762 WMPixmap *WMGetSystemPixmap(WMScreen *scr, int image);
764 /* ....................................................................... */
767 WMColor *WMDarkGrayColor(WMScreen *scr);
769 WMColor *WMGrayColor(WMScreen *scr);
771 WMColor *WMBlackColor(WMScreen *scr);
773 WMColor *WMWhiteColor(WMScreen *scr);
775 void WMSetColorInGC(WMColor *color, GC gc);
777 GC WMColorGC(WMColor *color);
779 WMPixel WMColorPixel(WMColor *color);
781 void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
782 unsigned int width, unsigned int height);
784 void WMReleaseColor(WMColor *color);
786 WMColor *WMRetainColor(WMColor *color);
788 WMColor *WMCreateRGBColor(WMScreen *scr, unsigned short red,
789 unsigned short green, unsigned short blue,
790 Bool exact);
792 WMColor *WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
794 unsigned short WMRedComponentOfColor(WMColor *color);
796 unsigned short WMGreenComponentOfColor(WMColor *color);
798 unsigned short WMBlueComponentOfColor(WMColor *color);
800 char *WMGetColorRGBDescription(WMColor *color);
802 /* ....................................................................... */
805 void WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
806 int y, char *text, int length);
808 void WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x,
809 int y, char *text, int length);
811 int WMWidthOfString(WMFont *font, char *text, int length);
815 /* ....................................................................... */
817 WMScreen *WMWidgetScreen(WMWidget *w);
819 unsigned int WMScreenWidth(WMScreen *scr);
821 unsigned int WMScreenHeight(WMScreen *scr);
823 void WMUnmapWidget(WMWidget *w);
825 void WMMapWidget(WMWidget *w);
827 Bool WMWidgetIsMapped(WMWidget *w);
829 void WMRaiseWidget(WMWidget *w);
831 void WMLowerWidget(WMWidget *w);
833 void WMMoveWidget(WMWidget *w, int x, int y);
835 void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
837 void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
839 void WMMapSubwidgets(WMWidget *w);
841 void WMUnmapSubwidgets(WMWidget *w);
843 void WMRealizeWidget(WMWidget *w);
845 void WMDestroyWidget(WMWidget *widget);
847 void WMHangData(WMWidget *widget, void *data);
849 void *WMGetHangedData(WMWidget *widget);
851 unsigned int WMWidgetWidth(WMWidget *w);
853 unsigned int WMWidgetHeight(WMWidget *w);
855 Window WMWidgetXID(WMWidget *w);
857 Window WMViewXID(WMView *view);
859 void WMRedisplayWidget(WMWidget *w);
861 void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
863 WMSize WMGetViewSize(WMView *view);
865 WMPoint WMGetViewPosition(WMView *view);
867 WMPoint WMGetViewScreenPosition(WMView *view);
869 WMWidget *WMWidgetOfView(WMView *view);
871 void WMSetViewNextResponder(WMView *view, WMView *responder);
873 void WMRelayToNextResponder(WMView *view, XEvent *event);
875 /* notifications */
876 extern char *WMViewSizeDidChangeNotification;
878 extern char *WMViewRealizedNotification;
880 extern char *WMFontPanelDidChangeNotification;
883 /* ....................................................................... */
885 void WMSetBalloonTextForView(char *text, WMView *view);
887 void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
889 void WMSetBalloonFont(WMScreen *scr, WMFont *font);
891 void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
893 void WMSetBalloonDelay(WMScreen *scr, int delay);
895 void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
898 /* ....................................................................... */
900 WMWindow *WMCreateWindow(WMScreen *screen, char *name);
902 WMWindow *WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
904 WMWindow *WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
905 int style);
907 WMWindow *WMCreatePanelForWindow(WMWindow *owner, char *name);
909 void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
911 void WMSetWindowTitle(WMWindow *wPtr, char *title);
913 void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
915 void WMSetWindowMiniwindowImage(WMWindow *win, WMPixmap *pixmap);
917 void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
919 void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
921 void WMSetWindowUserPosition(WMWindow *win, int x, int y);
923 void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
924 int maxX, int maxY);
926 void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
928 void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
930 void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
932 void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
934 void WMSetWindowLevel(WMWindow *win, int level);
936 void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
938 void WMCloseWindow(WMWindow *win);
940 /* ....................................................................... */
942 void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
944 #define WMCreateCommandButton(parent) \
945 WMCreateCustomButton((parent), WBBSpringLoadedMask\
946 |WBBPushInMask\
947 |WBBPushLightMask\
948 |WBBPushChangeMask)
950 #define WMCreateRadioButton(parent) \
951 WMCreateButton((parent), WBTRadio)
953 #define WMCreateSwitchButton(parent) \
954 WMCreateButton((parent), WBTSwitch)
956 WMButton *WMCreateButton(WMWidget *parent, WMButtonType type);
958 WMButton *WMCreateCustomButton(WMWidget *parent, int behaviourMask);
960 void WMSetButtonImageDefault(WMButton *bPtr);
962 void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
964 void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
966 void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
968 void WMSetButtonFont(WMButton *bPtr, WMFont *font);
970 void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
972 void WMSetButtonText(WMButton *bPtr, char *text);
974 void WMSetButtonAltText(WMButton *bPtr, char *text);
976 void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
978 void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
980 void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
982 void WMSetButtonSelected(WMButton *bPtr, int isSelected);
984 int WMGetButtonSelected(WMButton *bPtr);
986 void WMSetButtonBordered(WMButton *bPtr, int isBordered);
988 void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
990 void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
992 void WMSetButtonTag(WMButton *bPtr, int tag);
994 void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
996 void WMPerformButtonClick(WMButton *bPtr);
998 void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
1000 void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
1002 /* ....................................................................... */
1004 WMLabel *WMCreateLabel(WMWidget *parent);
1006 void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1008 void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
1010 WMPixmap *WMGetLabelImage(WMLabel *lPtr);
1012 char *WMGetLabelText(WMLabel *lPtr);
1014 void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
1016 void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1018 void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
1020 void WMSetLabelText(WMLabel *lPtr, char *text);
1022 void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1024 void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
1026 /* ....................................................................... */
1028 WMFrame *WMCreateFrame(WMWidget *parent);
1030 void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1032 void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1034 void WMSetFrameTitle(WMFrame *fPtr, char *title);
1036 /* ....................................................................... */
1038 WMTextField *WMCreateTextField(WMWidget *parent);
1040 void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1042 void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1044 /* you can free the returned string */
1045 char *WMGetTextFieldText(WMTextField *tPtr);
1047 void WMSetTextFieldText(WMTextField *tPtr, char *text);
1049 void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1051 void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1053 WMFont *WMGetTextFieldFont(WMTextField *tPtr);
1055 void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1057 void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1059 Bool WMGetTextFieldEditable(WMTextField *tPtr);
1061 void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
1063 void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1065 void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1067 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1069 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1071 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1073 void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1076 extern char *WMTextDidChangeNotification;
1077 extern char *WMTextDidBeginEditingNotification;
1078 extern char *WMTextDidEndEditingNotification;
1080 /* ....................................................................... */
1082 WMScroller *WMCreateScroller(WMWidget *parent);
1084 void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
1085 float knobProportion);
1087 float WMGetScrollerKnobProportion(WMScroller *sPtr);
1089 float WMGetScrollerValue(WMScroller *sPtr);
1091 WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1093 void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1095 void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1096 WMScrollArrowPosition position);
1098 extern char *WMScrollerDidScrollNotification;
1100 /* ....................................................................... */
1102 WMList *WMCreateList(WMWidget *parent);
1104 void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1106 void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1108 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1110 WMListItem *WMInsertListItem(WMList *lPtr, int row, char *text);
1112 void WMSortListItems(WMList *lPtr);
1114 void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
1116 int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1118 WMListItem *WMGetListItem(WMList *lPtr, int row);
1120 WMArray *WMGetListItems(WMList *lPtr);
1122 void WMRemoveListItem(WMList *lPtr, int row);
1124 void WMSelectListItem(WMList *lPtr, int row);
1126 void WMUnselectListItem(WMList *lPtr, int row);
1128 /* This will select all items in range, and deselect all the others */
1129 void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1131 /* This will select all items in range, leaving the others as they are */
1132 void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1134 void WMSelectAllListItems(WMList *lPtr);
1136 void WMUnselectAllListItems(WMList *lPtr);
1138 void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1140 void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1142 int WMGetListItemHeight(WMList *lPtr);
1144 /* don't free the returned data */
1145 WMArray* WMGetListSelectedItems(WMList *lPtr);
1148 * For the following 2 functions, in case WMList allows multiple selection,
1149 * the first item in the list of selected items, respective its row number,
1150 * will be returned.
1153 /* don't free the returned data */
1154 WMListItem* WMGetListSelectedItem(WMList *lPtr);
1156 int WMGetListSelectedItemRow(WMList *lPtr);
1158 void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1160 void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1162 void WMClearList(WMList *lPtr);
1164 int WMGetListNumberOfRows(WMList *lPtr);
1166 void WMSetListPosition(WMList *lPtr, int row);
1168 void WMSetListBottomPosition(WMList *lPtr, int row);
1170 int WMGetListPosition(WMList *lPtr);
1172 Bool WMListAllowsMultipleSelection(WMList *lPtr);
1174 Bool WMListAllowsEmptySelection(WMList *lPtr);
1177 extern char *WMListDidScrollNotification;
1178 extern char *WMListSelectionDidChangeNotification;
1180 /* ....................................................................... */
1182 WMBrowser *WMCreateBrowser(WMWidget *parent);
1184 void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1186 void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1188 void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1190 void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1192 void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1194 int WMAddBrowserColumn(WMBrowser *bPtr);
1196 void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1198 void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1200 void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1202 WMListItem *WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
1204 void WMSortBrowserColumn(WMBrowser *bPtr, int column);
1206 void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
1207 WMCompareDataProc *func);
1209 /* Don't free the returned string. */
1210 char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
1212 /* free the returned string */
1213 char *WMGetBrowserPath(WMBrowser *bPtr);
1215 /* free the returned string */
1216 char *WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
1218 /* free the returned array */
1219 WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1221 void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1223 void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
1224 void *clientData);
1226 WMListItem *WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
1228 int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1230 int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1232 int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1234 int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1236 int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1238 WMList *WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
1240 void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
1242 Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1244 Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1246 void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
1248 /* ....................................................................... */
1251 Bool WMMenuItemIsSeparator(WMMenuItem *item);
1253 WMMenuItem *WMCreateMenuItem(void);
1255 void WMDestroyMenuItem(WMMenuItem *item);
1257 Bool WMGetMenuItemEnabled(WMMenuItem *item);
1259 void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1261 char *WMGetMenuItemShortcut(WMMenuItem *item);
1263 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1265 void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1267 void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1269 void *WMGetMenuItemRepresentedObject(WMMenuItem *item);
1271 void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1273 void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1275 WMAction *WMGetMenuItemAction(WMMenuItem *item);
1277 void *WMGetMenuItemData(WMMenuItem *item);
1279 void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1281 char *WMGetMenuItemTitle(WMMenuItem *item);
1283 void WMSetMenuItemState(WMMenuItem *item, int state);
1285 int WMGetMenuItemState(WMMenuItem *item);
1287 void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1289 WMPixmap *WMGetMenuItemPixmap(WMMenuItem *item);
1291 void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1293 WMPixmap *WMGetMenuItemOnStatePixmap(WMMenuItem *item);
1295 void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1297 WMPixmap *WMGetMenuItemOffStatePixmap(WMMenuItem *item);
1299 void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1301 WMPixmap *WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
1303 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1306 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1308 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1311 /* ....................................................................... */
1313 WMPopUpButton *WMCreatePopUpButton(WMWidget *parent);
1315 void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
1316 void *clientData);
1318 void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1320 WMMenuItem *WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
1322 WMMenuItem *WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
1323 char *title);
1325 void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1327 void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1329 Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1331 void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1333 int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1335 void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1337 /* don't free the returned data */
1338 char *WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
1340 WMMenuItem *WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
1343 int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1345 void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1347 Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1349 /* ....................................................................... */
1351 WMProgressIndicator *WMCreateProgressIndicator(WMWidget *parent);
1353 void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1355 void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1357 void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1359 int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1361 int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1363 int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1366 /* ....................................................................... */
1368 WMColorPanel *WMGetColorPanel(WMScreen *scrPtr);
1370 void WMFreeColorPanel(WMColorPanel *panel);
1372 void WMShowColorPanel(WMColorPanel *panel);
1374 void WMCloseColorPanel(WMColorPanel *panel);
1376 void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
1378 WMColor *WMGetColorPanelColor(WMColorPanel *panel);
1380 void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1382 void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
1384 extern char *WMColorPanelColorChangedNotification;
1386 /* ....................................................................... */
1388 WMColorWell *WMCreateColorWell(WMWidget *parent);
1390 void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1392 WMColor *WMGetColorWellColor(WMColorWell *cPtr);
1394 void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1397 extern char *WMColorWellDidChangeNotification;
1400 /* ...................................................................... */
1402 WMScrollView *WMCreateScrollView(WMWidget *parent);
1404 void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
1405 unsigned int height);
1407 void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1409 void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1411 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1413 void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1415 void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1417 WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1419 WMScroller *WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
1421 WMScroller *WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
1423 void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1425 void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1427 /* ....................................................................... */
1429 WMSlider *WMCreateSlider(WMWidget *parent);
1431 int WMGetSliderMinValue(WMSlider *slider);
1433 int WMGetSliderMaxValue(WMSlider *slider);
1435 int WMGetSliderValue(WMSlider *slider);
1437 void WMSetSliderMinValue(WMSlider *slider, int value);
1439 void WMSetSliderMaxValue(WMSlider *slider, int value);
1441 void WMSetSliderValue(WMSlider *slider, int value);
1443 void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1445 void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1447 void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1449 void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1451 /* ....................................................................... */
1454 WMSplitView *WMCreateSplitView(WMWidget *parent);
1455 Bool WMGetSplitViewVertical(WMSplitView *sPtr);
1456 void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1458 int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
1460 WMView *WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
1462 /* remove the first subview == view */
1463 void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1465 void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1468 void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1470 void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1472 void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1473 WMSplitViewConstrainProc *proc);
1476 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1477 WMSplitViewResizeSubviewsProc *proc);
1480 int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1482 /* ...................................................................... */
1484 WMRuler *WMCreateRuler (WMWidget *parent);
1486 WMRulerMargins *WMGetRulerMargins(WMRuler *rPtr);
1488 void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
1490 Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin,
1491 WMRulerMargins *anotherMargin);
1493 int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1495 int WMGetReleasedRulerMargin(WMRuler *rPtr);
1497 int WMGetRulerOffset(WMRuler *rPtr);
1499 void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1501 void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1503 void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
1505 /* ....................................................................... */
1508 #define WMCreateText(parent) WMCreateTextForDocumentType \
1509 ((parent), (NULL), (NULL))
1511 WMText *WMCreateTextForDocumentType(WMWidget *parent,
1512 WMAction *parser, WMAction *writer);
1514 void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1516 void WMFreezeText(WMText *tPtr);
1518 #define WMRefreshText(tPtr) WMThawText((tPtr))
1520 void WMThawText(WMText *tPtr);
1522 int WMScrollText(WMText *tPtr, int amount);
1524 int WMPageText(WMText *tPtr, Bool direction);
1526 void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
1528 void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
1530 void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
1532 void WMShowTextRuler(WMText *tPtr, Bool show);
1534 int WMGetTextRulerShown(WMText *tPtr);
1536 void WMSetTextEditable(WMText *tPtr, Bool editable);
1538 int WMGetTextEditable(WMText *tPtr);
1540 void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
1542 int WMGetTextUsesMonoFont(WMText *tPtr);
1544 void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1546 void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1548 int WMGetTextIgnoresNewline(WMText *tPtr);
1550 void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
1552 WMFont * WMGetTextDefaultFont(WMText *tPtr);
1554 void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1556 WMColor * WMGetTextDefaultColor(WMText *tPtr);
1558 void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1560 void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
1562 void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1564 void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1566 void WMPrependTextStream(WMText *tPtr, char *text);
1568 void WMAppendTextStream(WMText *tPtr, char *text);
1570 /* free the text */
1571 char * WMGetTextStream(WMText *tPtr);
1573 /* free the text */
1574 char * WMGetTextSelectedStream(WMText *tPtr);
1576 /* destroy the array */
1577 WMArray * WMGetTextObjects(WMText *tPtr);
1579 /* destroy the array */
1580 WMArray* WMGetTextSelectedObjects(WMText *tPtr);
1582 void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1584 WMColor *WMGetTextSelectionColor(WMText *tPtr);
1586 void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1588 WMFont *WMGetTextSelectionFont(WMText *tPtr);
1590 void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1592 int WMGetTextSelectionUnderlined(WMText *tPtr);
1594 void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
1596 Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
1597 Bool caseSensitive);
1599 Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1602 /* parser related stuff... use only if implementing a new parser */
1604 void *WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1605 WMColor *color, unsigned short first, unsigned short extraInfo);
1607 void *WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1608 WMColor *color, unsigned short first, unsigned short extraInfo);
1610 void *WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1611 WMColor *color, unsigned short first, unsigned short length);
1613 void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
1614 unsigned int kanji, unsigned int underlined, int script,
1615 WMRulerMargins *margins);
1617 /* do NOT free the margins */
1618 void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
1619 unsigned int *kanji, unsigned int *underlined, int *script,
1620 WMRulerMargins *margins);
1622 int WMGetTextInsertType(WMText *tPtr);
1624 int WMGetTextBlocks(WMText *tPtr);
1626 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1628 int WMGetCurrentTextBlock(WMText *tPtr);
1630 void WMPrependTextBlock(WMText *tPtr, void *vtb);
1632 void WMAppendTextBlock(WMText *tPtr, void *vtb);
1634 void *WMRemoveTextBlock(WMText *tPtr);
1636 void WMDestroyTextBlock(WMText *tPtr, void *vtb);
1638 /* ....................................................................... */
1641 WMTabView *WMCreateTabView(WMWidget *parent);
1643 void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1645 void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1647 void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1649 void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1651 void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1653 void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1655 WMTabViewItem *WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
1656 int identifier, char *label);
1658 WMTabViewItem *WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
1660 void WMSelectFirstTabViewItem(WMTabView *tPtr);
1662 void WMSelectLastTabViewItem(WMTabView *tPtr);
1664 void WMSelectNextTabViewItem(WMTabView *tPtr);
1666 void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1668 WMTabViewItem *WMGetSelectedTabViewItem(WMTabView *tPtr);
1670 void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1672 void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1674 void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
1677 WMTabViewItem *WMCreateTabViewItemWithIdentifier(int identifier);
1679 int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1681 void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1683 char *WMGetTabViewItemLabel(WMTabViewItem *item);
1685 void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1687 WMView *WMGetTabViewItemView(WMTabViewItem *item);
1689 void WMDestroyTabViewItem(WMTabViewItem *item);
1692 /* ....................................................................... */
1694 WMBox *WMCreateBox(WMWidget *parent);
1696 void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1698 void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1699 int minSize, int maxSize, int space);
1701 void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
1702 int minSize, int maxSize, int space);
1704 void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1706 void WMSetBoxHorizontal(WMBox *box, Bool flag);
1708 void WMSetBoxExpandsToParent(WMBox *box, int topOffs, int bottomOffs,
1709 int leftOffs, int rightOffs);
1711 /* ....................................................................... */
1713 int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1714 char *defaultButton, char *alternateButton,
1715 char *otherButton);
1717 /* you can free the returned string */
1718 char *WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1719 char *defaultText, char *okButton, char *cancelButton);
1721 WMAlertPanel *WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
1722 char *msg, char *defaultButton,
1723 char *alternateButton, char *otherButton);
1725 WMInputPanel *WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
1726 char *msg, char *defaultText, char *okButton,
1727 char *cancelButton);
1729 void WMDestroyAlertPanel(WMAlertPanel *panel);
1731 void WMDestroyInputPanel(WMInputPanel *panel);
1733 /* ....................................................................... */
1735 /* only 1 instance per WMScreen */
1736 WMOpenPanel *WMGetOpenPanel(WMScreen *scrPtr);
1738 WMSavePanel *WMGetSavePanel(WMScreen *scrPtr);
1740 void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1742 void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
1744 void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
1746 void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1748 /* you can free the returned string */
1749 char *WMGetFilePanelFileName(WMFilePanel *panel);
1751 void WMFreeFilePanel(WMFilePanel *panel);
1753 int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1754 char *path, char *name, char **fileTypes);
1756 void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1758 WMView *WMGetFilePanelAccessoryView(WMFilePanel *panel);
1761 /* ...................................................................... */
1763 /* only 1 instance per WMScreen */
1764 WMFontPanel *WMGetFontPanel(WMScreen *scr);
1766 void WMShowFontPanel(WMFontPanel *panel);
1768 void WMHideFontPanel(WMFontPanel *panel);
1770 void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
1772 /* you can free the returned string */
1773 char *WMGetFontPanelFontName(WMFontPanel *panel);
1775 WMFont *WMGetFontPanelFont(WMFontPanel *panel);
1777 #ifdef __cplusplus
1779 #endif /* __cplusplus */
1781 #endif