10 #define WINGS_H_VERSION 20000521
15 #endif /* __cplusplus */
21 typedef unsigned long WMPixel
;
40 /* WMRange was moved in WUtil.h */
42 #define ClientMessageMask (1L<<30)
45 /* window stacking level */
47 WMNormalWindowLevel
= 0,
48 WMFloatingWindowLevel
= 3,
49 WMDockWindowLevel
= 5,
50 WMSubmenuWindowLevel
= 10,
51 WMMainMenuWindowLevel
= 20
54 /* window attributes */
56 WMBorderlessWindowMask
= 0,
57 WMTitledWindowMask
= 1,
58 WMClosableWindowMask
= 2,
59 WMMiniaturizableWindowMask
= 4,
60 WMResizableWindowMask
= 8
66 /* 0 is reserved for internal use */
72 WBTMomentaryChange
= 6,
77 /* button behaviour masks */
79 WBBSpringLoadedMask
= (1 << 0),
80 WBBPushInMask
= (1 << 1),
81 WBBPushChangeMask
= (1 << 2),
82 WBBPushLightMask
= (1 << 3),
83 WBBStateLightMask
= (1 << 5),
84 WBBStateChangeMask
= (1 << 6),
85 WBBStatePushMask
= (1 << 7)
89 /* frame title positions */
113 /* alignment types */
118 WAJustified
/* not valid for textfields */
134 /* scroller arrow position */
139 } WMScrollArrowPosition
;
154 /* usable scroller parts */
159 } WMUsableScrollerParts
;
171 WTTopTabsBevelBorder
,
178 /* text movement types */
180 WMIllegalTextMovement
,
181 WMReturnTextMovement
,
182 WMEscapeTextMovement
,
184 WMBacktabTextMovement
,
191 /* text field special events */
199 WLNotFound
= -1 /* element was not found in WMList */
203 /* drag operations */
211 } WMDragOperationType
;
215 WMGrayModeColorPanel
= 1,
216 WMRGBModeColorPanel
= 2,
217 WMCMYKModeColorPanel
= 3,
218 WMHSBModeColorPanel
= 4,
219 WMCustomPaletteModeColorPanel
= 5,
220 WMColorListModeColorPanel
= 6,
221 WMWheelModeColorPanel
= 7
227 #define WSIReturnArrow 1
228 #define WSIHighlightedReturnArrow 2
229 #define WSIScrollerDimple 3
230 #define WSIArrowLeft 4
231 #define WSIHighlightedArrowLeft 5
232 #define WSIArrowRight 6
233 #define WSIHighlightedArrowRight 7
235 #define WSIHighlightedArrowUp 9
236 #define WSIArrowDown 10
237 #define WSIHighlightedArrowDown 11
238 #define WSICheckMark 12
241 WLDSSelected
= (1 << 16),
242 WLDSDisabled
= (1 << 17),
243 WLDSFocused
= (1 << 18),
244 WLDSIsBranch
= (1 << 19)
247 /* alert panel return values */
257 /* types of input observers */
259 WIReadMask
= (1 << 0),
260 WIWriteMask
= (1 << 1),
261 WIExceptMask
= (1 << 2)
281 WC_Matrix
= 12, /* not ready */
284 WC_ProgressIndicator
= 15,
291 /* All widgets must start with the following structure
292 * in that order. Used for typecasting to get some generic data */
293 typedef struct W_WidgetType
{
300 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
301 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
306 typedef void WMWidget
;
308 typedef struct W_Pixmap WMPixmap
;
309 typedef struct W_Font WMFont
;
310 typedef struct W_Color WMColor
;
312 typedef struct W_Screen WMScreen
;
314 typedef struct W_View WMView
;
316 typedef struct W_Window WMWindow
;
317 typedef struct W_Frame WMFrame
;
318 typedef struct W_Button WMButton
;
319 typedef struct W_Label WMLabel
;
320 typedef struct W_TextField WMTextField
;
321 typedef struct W_Scroller WMScroller
;
322 typedef struct W_ScrollView WMScrollView
;
323 typedef struct W_List WMList
;
324 typedef struct W_Browser WMBrowser
;
325 typedef struct W_PopUpButton WMPopUpButton
;
326 typedef struct W_ProgressIndicator WMProgressIndicator
;
327 typedef struct W_ColorWell WMColorWell
;
328 typedef struct W_Slider WMSlider
;
329 typedef struct W_Matrix WMMatrix
; /* not ready */
330 typedef struct W_SplitView WMSplitView
;
331 typedef struct W_TabView WMTabView
;
332 typedef struct W_Ruler WMRuler
;
333 typedef struct W_Text WMText
;
334 typedef struct W_Box WMBox
;
338 typedef struct W_TabViewItem WMTabViewItem
;
339 typedef struct W_MenuItem WMMenuItem
;
342 typedef struct W_FilePanel WMFilePanel
;
343 typedef WMFilePanel WMOpenPanel
;
344 typedef WMFilePanel WMSavePanel
;
346 typedef struct W_FontPanel WMFontPanel
;
348 typedef struct W_ColorPanel WMColorPanel
;
351 /* item for WMList */
352 typedef struct WMListItem
{
354 void *clientData
; /* ptr for user clientdata. */
356 unsigned int uflags
:16; /* flags for the user */
357 unsigned int selected
:1;
358 unsigned int disabled
:1;
359 unsigned int isBranch
:1;
360 unsigned int loaded
:1;
363 /* struct for message panel */
364 typedef struct WMAlertPanel
{
365 WMWindow
*win
; /* window */
366 WMButton
*defBtn
; /* default button */
367 WMButton
*altBtn
; /* alternative button */
368 WMButton
*othBtn
; /* other button */
369 WMLabel
*iLbl
; /* icon label */
370 WMLabel
*tLbl
; /* title label */
371 WMLabel
*mLbl
; /* message label */
372 WMFrame
*line
; /* separator */
373 short result
; /* button that was pushed */
381 typedef struct WMInputPanel
{
382 WMWindow
*win
; /* window */
383 WMButton
*defBtn
; /* default button */
384 WMButton
*altBtn
; /* alternative button */
385 WMLabel
*tLbl
; /* title label */
386 WMLabel
*mLbl
; /* message label */
387 WMTextField
*text
; /* text field */
388 short result
; /* button that was pushed */
400 WMArray
*tabs
; /* a growable array of tabstops */
401 unsigned short left
; /* left margin marker */
402 unsigned short right
; /* right margin marker */
403 unsigned short first
; /* indentation marker for first line only */
404 unsigned short body
; /* body indentation marker */
405 unsigned short retainCount
;
407 /* All indentation and tab markers are _relative_ to the left margin marker */
410 typedef void *WMHandlerID
;
412 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
414 typedef void WMEventProc(XEvent
*event
, void *clientData
);
416 typedef void WMEventHook(XEvent
*event
);
418 /* self is set to the widget from where the callback is being called and
419 * clientData to the data set to with WMSetClientData() */
420 typedef void WMAction(WMWidget
*self
, void *clientData
);
422 /* same as WMAction, but for stuff that arent widgets */
423 typedef void WMAction2(void *self
, void *clientData
);
426 typedef void WMCallback(void *data
);
428 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
430 /* delegate method like stuff */
431 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
432 int state
, WMRect
*rect
);
435 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
436 unsigned int oldWidth,
437 unsigned int oldHeight);
440 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
441 int *minSize
, int *maxSize
);
443 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
448 typedef struct WMBrowserDelegate
{
451 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
452 WMBrowser
*sender
, int column
, WMList
*list
);
454 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
457 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
459 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
463 typedef struct WMTextFieldDelegate
{
466 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
467 WMNotification
*notif
);
469 void (*didChange
)(struct WMTextFieldDelegate
*self
,
470 WMNotification
*notif
);
472 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
473 WMNotification
*notif
);
475 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
478 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
480 } WMTextFieldDelegate
;
483 typedef struct WMTextDelegate
{
486 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
493 typedef struct WMTabViewDelegate
{
496 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
499 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
500 WMTabViewItem
*item
);
502 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
503 WMTabViewItem
*item
);
505 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
506 WMTabViewItem
*item
);
512 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
513 Time timestamp
, void *cdata
, WMData
*data
);
516 typedef struct WMSelectionProcs
{
517 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
518 void *cdata
, Atom
*type
);
519 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
520 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
525 typedef struct W_DraggingInfo WMDraggingInfo
;
528 typedef struct W_DragSourceProcs
{
529 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
530 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
531 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
533 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
534 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
539 typedef struct W_DragDestinationProcs
{
540 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
541 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
542 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
543 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
544 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
545 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
546 } WMDragDestinationProcs
;
550 /* ...................................................................... */
553 WMRange
wmkrange(int start
, int count
);
555 WMPoint
wmkpoint(int x
, int y
);
557 WMSize
wmksize(unsigned int width
, unsigned int height
);
560 /* ....................................................................... */
564 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
566 void WMSetResourcePath(char *path
);
568 /* don't free the returned string */
569 char *WMGetApplicationName();
571 /* Try to locate resource file. ext may be NULL */
572 char *WMPathForResourceOfType(char *resource
, char *ext
);
574 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
577 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
579 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
581 void WMScreenMainLoop(WMScreen
*scr
);
584 RContext
*WMScreenRContext(WMScreen
*scr
);
586 Display
*WMScreenDisplay(WMScreen
*scr
);
588 int WMScreenDepth(WMScreen
*scr
);
592 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
594 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
596 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
598 void WMSetFocusToWidget(WMWidget
*widget
);
600 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
602 int WMHandleEvent(XEvent
*event
);
604 Bool
WMScreenPending(WMScreen
*scr
);
606 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
607 WMEventProc
*eventProc
, void *clientData
);
609 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
610 WMEventProc
*eventProc
, void *clientData
);
612 int WMIsDoubleClick(XEvent
*event
);
614 int WMIsTripleClick(XEvent
*event
);
616 void WMNextEvent(Display
*dpy
, XEvent
*event
);
618 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
620 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
623 void WMDeleteTimerWithClientData(void *cdata
);
625 void WMDeleteTimerHandler(WMHandlerID handlerID
);
627 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
629 void WMDeleteIdleHandler(WMHandlerID handlerID
);
631 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
634 void WMDeleteInputHandler(WMHandlerID handlerID
);
638 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
639 WMSelectionProcs
*procs
, void *cdata
);
641 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
643 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
644 Time timestamp
, WMSelectionCallback
*callback
,
648 /* ....................................................................... */
650 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
652 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
653 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
656 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
658 void WMUnregisterViewDraggedTypes(WMView
*view
);
660 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
663 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
665 /* ....................................................................... */
667 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
669 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
671 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
673 WMFont
*WMRetainFont(WMFont
*font
);
675 void WMReleaseFont(WMFont
*font
);
677 unsigned int WMFontHeight(WMFont
*font
);
680 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
682 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
686 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
688 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
690 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
692 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
694 XFontSet
WMGetFontFontSet(WMFont
*font
);
696 WMFont
* WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
698 WMFont
* WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
700 WMFont
* WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
702 WMFont
* WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
704 WMFont
* WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
706 WMFont
* WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
708 /* ....................................................................... */
710 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
712 void WMReleasePixmap(WMPixmap
*pixmap
);
714 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
717 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
718 Pixmap mask
, int width
, int height
,
721 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
724 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
726 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
728 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
730 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
733 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
735 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
737 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
739 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
741 /* ....................................................................... */
744 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
746 WMColor
*WMGrayColor(WMScreen
*scr
);
748 WMColor
*WMBlackColor(WMScreen
*scr
);
750 WMColor
*WMWhiteColor(WMScreen
*scr
);
752 void WMSetColorInGC(WMColor
*color
, GC gc
);
754 GC
WMColorGC(WMColor
*color
);
756 WMPixel
WMColorPixel(WMColor
*color
);
758 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
759 unsigned int width
, unsigned int height
);
761 void WMReleaseColor(WMColor
*color
);
763 WMColor
*WMRetainColor(WMColor
*color
);
765 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
766 unsigned short green
, unsigned short blue
,
769 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
771 unsigned short WMRedComponentOfColor(WMColor
*color
);
773 unsigned short WMGreenComponentOfColor(WMColor
*color
);
775 unsigned short WMBlueComponentOfColor(WMColor
*color
);
777 char *WMGetColorRGBDescription(WMColor
*color
);
779 /* ....................................................................... */
782 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
783 int y
, char *text
, int length
);
785 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
786 int y
, char *text
, int length
);
788 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
792 /* ....................................................................... */
794 WMScreen
*WMWidgetScreen(WMWidget
*w
);
796 unsigned int WMScreenWidth(WMScreen
*scr
);
798 unsigned int WMScreenHeight(WMScreen
*scr
);
800 void WMUnmapWidget(WMWidget
*w
);
802 void WMMapWidget(WMWidget
*w
);
804 Bool
WMWidgetIsMapped(WMWidget
*w
);
806 void WMRaiseWidget(WMWidget
*w
);
808 void WMLowerWidget(WMWidget
*w
);
810 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
812 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
814 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
816 void WMMapSubwidgets(WMWidget
*w
);
818 void WMUnmapSubwidgets(WMWidget
*w
);
820 void WMRealizeWidget(WMWidget
*w
);
822 void WMDestroyWidget(WMWidget
*widget
);
824 void WMHangData(WMWidget
*widget
, void *data
);
826 void *WMGetHangedData(WMWidget
*widget
);
828 unsigned int WMWidgetWidth(WMWidget
*w
);
830 unsigned int WMWidgetHeight(WMWidget
*w
);
832 Window
WMWidgetXID(WMWidget
*w
);
834 Window
WMViewXID(WMView
*view
);
836 void WMRedisplayWidget(WMWidget
*w
);
838 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
840 WMSize
WMGetViewSize(WMView
*view
);
842 WMPoint
WMGetViewPosition(WMView
*view
);
844 WMPoint
WMGetViewScreenPosition(WMView
*view
);
846 WMWidget
*WMWidgetOfView(WMView
*view
);
849 extern char *WMViewSizeDidChangeNotification
;
851 extern char *WMViewRealizedNotification
;
853 extern char *WMFontPanelDidChangeNotification
;
856 /* ....................................................................... */
858 void WMSetBalloonTextForView(char *text
, WMView
*view
);
860 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
862 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
864 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
866 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
868 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
871 /* ....................................................................... */
873 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
875 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
877 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
880 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
882 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
884 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
886 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
888 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
890 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
892 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
894 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
896 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
899 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
901 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
903 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
905 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
907 void WMSetWindowLevel(WMWindow
*win
, int level
);
909 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
911 void WMCloseWindow(WMWindow
*win
);
913 /* ....................................................................... */
915 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
917 #define WMCreateCommandButton(parent) \
918 WMCreateCustomButton((parent), WBBSpringLoadedMask\
923 #define WMCreateRadioButton(parent) \
924 WMCreateButton((parent), WBTRadio)
926 #define WMCreateSwitchButton(parent) \
927 WMCreateButton((parent), WBTSwitch)
929 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
931 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
933 void WMSetButtonImageDefault(WMButton
*bPtr
);
935 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
937 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
939 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
941 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
943 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
945 void WMSetButtonText(WMButton
*bPtr
, char *text
);
947 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
949 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
951 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
953 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
955 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
957 int WMGetButtonSelected(WMButton
*bPtr
);
959 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
961 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
963 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
965 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
967 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
969 void WMPerformButtonClick(WMButton
*bPtr
);
971 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
973 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
975 /* ....................................................................... */
977 WMLabel
*WMCreateLabel(WMWidget
*parent
);
979 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
981 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
983 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
985 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
987 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
989 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
991 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
993 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
995 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
997 /* ....................................................................... */
999 WMFrame
*WMCreateFrame(WMWidget
*parent
);
1001 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1003 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1005 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1007 /* ....................................................................... */
1009 WMTextField
*WMCreateTextField(WMWidget
*parent
);
1011 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1013 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1015 /* you can free the returned string */
1016 char *WMGetTextFieldText(WMTextField
*tPtr
);
1018 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1020 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1022 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1024 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
1026 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1028 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1030 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1032 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1034 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1036 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1038 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1040 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1042 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1044 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1047 extern char *WMTextDidChangeNotification
;
1048 extern char *WMTextDidBeginEditingNotification
;
1049 extern char *WMTextDidEndEditingNotification
;
1051 /* ....................................................................... */
1053 WMScroller
*WMCreateScroller(WMWidget
*parent
);
1055 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1056 float knobProportion
);
1058 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1060 float WMGetScrollerValue(WMScroller
*sPtr
);
1062 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1064 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1066 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1067 WMScrollArrowPosition position
);
1069 extern char *WMScrollerDidScrollNotification
;
1071 /* ....................................................................... */
1073 WMList
*WMCreateList(WMWidget
*parent
);
1075 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1077 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1079 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1081 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1083 void WMSortListItems(WMList
*lPtr
);
1085 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1087 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1089 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
1091 WMArray
*WMGetListItems(WMList
*lPtr
);
1093 void WMRemoveListItem(WMList
*lPtr
, int row
);
1095 void WMSelectListItem(WMList
*lPtr
, int row
);
1097 void WMUnselectListItem(WMList
*lPtr
, int row
);
1099 /* This will select all items in range, and deselect all the others */
1100 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1102 /* This will select all items in range, leaving the others as they are */
1103 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1105 void WMSelectAllListItems(WMList
*lPtr
);
1107 void WMUnselectAllListItems(WMList
*lPtr
);
1109 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1111 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1113 int WMGetListItemHeight(WMList
*lPtr
);
1115 /* don't free the returned data */
1116 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1119 * For the following 2 functions, in case WMList allows multiple selection,
1120 * the first item in the list of selected items, respective its row number,
1124 /* don't free the returned data */
1125 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1127 int WMGetListSelectedItemRow(WMList
*lPtr
);
1129 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1131 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1133 void WMClearList(WMList
*lPtr
);
1135 int WMGetListNumberOfRows(WMList
*lPtr
);
1137 void WMSetListPosition(WMList
*lPtr
, int row
);
1139 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1141 int WMGetListPosition(WMList
*lPtr
);
1143 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1145 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1148 extern char *WMListDidScrollNotification
;
1149 extern char *WMListSelectionDidChangeNotification
;
1151 /* ....................................................................... */
1153 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1155 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1157 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1159 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1161 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1163 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1165 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1167 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1169 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1171 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1173 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1175 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1177 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1178 WMCompareDataProc
*func
);
1180 /* Don't free the returned string. */
1181 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1183 /* free the returned string */
1184 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1186 /* free the returned string */
1187 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1189 /* free the returned array */
1190 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1192 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1194 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1197 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1199 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1201 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1203 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1205 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1207 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1209 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1211 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1213 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1215 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1218 /* ....................................................................... */
1221 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1223 WMMenuItem
*WMCreateMenuItem(void);
1225 void WMDestroyMenuItem(WMMenuItem
*item
);
1227 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1229 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1231 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1233 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1235 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1237 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1239 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1241 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1243 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1245 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1247 void *WMGetMenuItemData(WMMenuItem
*item
);
1249 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1251 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1253 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1255 int WMGetMenuItemState(WMMenuItem
*item
);
1257 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1259 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1261 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1263 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1265 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1267 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1269 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1271 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1273 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1276 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1278 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1281 /* ....................................................................... */
1283 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1285 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1288 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1290 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1292 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1295 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1297 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1299 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1301 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1303 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1305 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1307 /* don't free the returned data */
1308 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1310 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1313 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1315 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1317 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1319 /* ....................................................................... */
1321 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1323 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1325 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1327 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1329 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1331 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1333 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1336 /* ....................................................................... */
1338 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1340 void WMFreeColorPanel(WMColorPanel
*panel
);
1342 void WMShowColorPanel(WMColorPanel
*panel
);
1344 void WMCloseColorPanel(WMColorPanel
*panel
);
1346 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1348 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1350 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1352 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1354 extern char *WMColorPanelColorChangedNotification
;
1356 /* ....................................................................... */
1358 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1360 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1362 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1364 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1367 extern char *WMColorWellDidChangeNotification
;
1370 /* ...................................................................... */
1372 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1374 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1375 unsigned int height
);
1377 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1379 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1381 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1383 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1385 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1387 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1389 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1391 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1393 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1395 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1397 /* ....................................................................... */
1399 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1401 int WMGetSliderMinValue(WMSlider
*slider
);
1403 int WMGetSliderMaxValue(WMSlider
*slider
);
1405 int WMGetSliderValue(WMSlider
*slider
);
1407 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1409 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1411 void WMSetSliderValue(WMSlider
*slider
, int value
);
1413 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1415 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1417 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1419 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1421 /* ....................................................................... */
1424 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1425 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1426 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1428 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1430 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1432 /* remove the first subview == view */
1433 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1435 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1438 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1440 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1442 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1443 WMSplitViewConstrainProc
*proc
);
1446 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1447 WMSplitViewResizeSubviewsProc *proc);
1450 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1452 /* ...................................................................... */
1454 WMRuler
*WMCreateRuler (WMWidget
*parent
);
1456 WMRulerMargins
*WMGetRulerMargins(WMRuler
*rPtr
);
1458 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1460 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
,
1461 WMRulerMargins
*anotherMargin
);
1463 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1465 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1467 int WMGetRulerOffset(WMRuler
*rPtr
);
1469 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1471 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1473 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1475 /* ....................................................................... */
1478 #define WMCreateText(parent) WMCreateTextForDocumentType \
1479 ((parent), (NULL), (NULL))
1481 WMText
*WMCreateTextForDocumentType(WMWidget
*parent
,
1482 WMAction
*parser
, WMAction
*writer
);
1484 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1486 void WMFreezeText(WMText
*tPtr
);
1488 void WMThawText(WMText
*tPtr
);
1490 int WMScrollText(WMText
*tPtr
, int amount
);
1492 int WMPageText(WMText
*tPtr
, Bool direction
);
1494 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1496 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1498 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1500 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1502 int WMGetTextRulerShown(WMText
*tPtr
);
1504 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1506 int WMGetTextEditable(WMText
*tPtr
);
1508 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1510 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1512 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1514 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1516 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1518 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1520 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1522 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1524 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1526 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1528 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1530 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1532 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1534 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1537 char * WMGetTextStream(WMText
*tPtr
);
1540 char * WMGetTextSelectedStream(WMText
*tPtr
);
1542 /* destroy the array */
1543 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1545 /* destroy the array */
1546 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1548 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1550 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1552 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1554 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1555 Bool caseSensitive
);
1557 /* parser related stuff... use only if implementing a new parser */
1559 void *WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1560 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1562 void *WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1563 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1565 void *WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1566 WMColor
*color
, unsigned short first
, unsigned short length
);
1568 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1569 unsigned int kanji
, unsigned int underlined
, int script
,
1570 WMRulerMargins
*margins
);
1572 /* do NOT free the margins */
1573 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1574 unsigned int *kanji
, unsigned int *underlined
, int *script
,
1575 WMRulerMargins
*margins
);
1577 int WMGetTextInsertType(WMText
*tPtr
);
1579 int WMGetTextBlocks(WMText
*tPtr
);
1581 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1583 int WMGetCurrentTextBlock(WMText
*tPtr
);
1585 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1587 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1589 void *WMRemoveTextBlock(WMText
*tPtr
);
1591 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1593 /* ....................................................................... */
1596 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1598 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1600 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1602 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1604 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1606 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1608 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1610 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1612 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1614 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1616 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1618 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1620 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1622 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1625 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1627 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1629 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1631 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1633 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1635 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1637 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1640 /* ....................................................................... */
1642 WMBox
*WMCreateBox(WMWidget
*parent
);
1644 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1646 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1647 int minSize
, int maxSize
, int space
);
1649 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1651 /* ....................................................................... */
1653 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1654 char *defaultButton
, char *alternateButton
,
1657 /* you can free the returned string */
1658 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1659 char *defaultText
, char *okButton
, char *cancelButton
);
1661 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1662 char *msg
, char *defaultButton
,
1663 char *alternateButton
, char *otherButton
);
1665 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1666 char *msg
, char *defaultText
, char *okButton
,
1667 char *cancelButton
);
1669 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1671 void WMDestroyInputPanel(WMInputPanel
*panel
);
1673 /* ....................................................................... */
1675 /* only 1 instance per WMScreen */
1676 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1678 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1680 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1682 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1684 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1686 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1688 /* you can free the returned string */
1689 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1691 void WMFreeFilePanel(WMFilePanel
*panel
);
1693 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1694 char *path
, char *name
, char **fileTypes
);
1696 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1698 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1701 /* ...................................................................... */
1703 /* only 1 instance per WMScreen */
1704 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1706 void WMShowFontPanel(WMFontPanel
*panel
);
1708 void WMHideFontPanel(WMFontPanel
*panel
);
1710 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1712 /* you can free the returned string */
1713 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1715 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1719 #endif /* __cplusplus */