10 #define WINGS_H_VERSION 991003
15 #endif /* __cplusplus */
21 typedef unsigned long WMPixel
;
45 #define ClientMessageMask (1L<<30)
48 /* window stacking level */
50 WMNormalWindowLevel
= 0,
51 WMFloatingWindowLevel
= 3,
52 WMDockWindowLevel
= 5,
53 WMSubmenuWindowLevel
= 10,
54 WMMainMenuWindowLevel
= 20
57 /* window attributes */
59 WMBorderlessWindowMask
= 0,
60 WMTitledWindowMask
= 1,
61 WMClosableWindowMask
= 2,
62 WMMiniaturizableWindowMask
= 4,
63 WMResizableWindowMask
= 8
69 /* 0 is reserved for internal use */
75 WBTMomentaryChange
= 6,
80 /* button behaviour masks */
82 WBBSpringLoadedMask
= (1 << 0),
83 WBBPushInMask
= (1 << 1),
84 WBBPushChangeMask
= (1 << 2),
85 WBBPushLightMask
= (1 << 3),
86 WBBStateLightMask
= (1 << 5),
87 WBBStateChangeMask
= (1 << 6),
88 WBBStatePushMask
= (1 << 7)
92 /* frame title positions */
116 /* alignment types */
121 WAJustified
/* not valid for textfields */
137 /* scroller arrow position */
142 } WMScrollArrowPosition
;
155 /* usable scroller parts */
160 } WMUsableScrollerParts
;
172 WTTopTabsBevelBorder
,
179 /* text movement types */
181 WMIllegalTextMovement
,
182 WMReturnTextMovement
,
183 WMEscapeTextMovement
,
185 WMBacktabTextMovement
,
192 /* text field special events */
199 WMGrayModeColorPanel
,
201 WMCMYKModeColorPanel
,
203 WMCustomPaletteModeColorPanel
,
204 WMColorListModeColorPanel
,
205 WMWheelModeColorPanel
211 #define WSIReturnArrow 1
212 #define WSIHighlightedReturnArrow 2
213 #define WSIScrollerDimple 3
214 #define WSIArrowLeft 4
215 #define WSIHighlightedArrowLeft 5
216 #define WSIArrowRight 6
217 #define WSIHighlightedArrowRight 7
219 #define WSIHighlightedArrowUp 9
220 #define WSIArrowDown 10
221 #define WSIHighlightedArrowDown 11
222 #define WSICheckMark 12
225 WLDSSelected
= (1 << 16),
226 WLDSDisabled
= (1 << 17),
227 WLDSFocused
= (1 << 18),
228 WLDSIsBranch
= (1 << 19)
231 /* alert panel return values */
241 /* types of input observers */
243 WIReadMask
= (1 << 0),
244 WIWriteMask
= (1 << 1),
245 WIExceptMask
= (1 << 2)
265 WC_Matrix
= 12, /* not ready */
268 WC_ProgressIndicator
= 15
271 /* All widgets must start with the following structure
272 * in that order. Used for typecasting to get some generic data */
273 typedef struct W_WidgetType
{
280 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
281 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
286 typedef void WMWidget
;
288 typedef struct W_Pixmap WMPixmap
;
289 typedef struct W_Font WMFont
;
290 typedef struct W_Color WMColor
;
292 typedef struct W_Screen WMScreen
;
294 typedef struct W_View WMView
;
296 typedef struct W_Window WMWindow
;
297 typedef struct W_Frame WMFrame
;
298 typedef struct W_Button WMButton
;
299 typedef struct W_Label WMLabel
;
300 typedef struct W_TextField WMTextField
;
301 typedef struct W_Scroller WMScroller
;
302 typedef struct W_ScrollView WMScrollView
;
303 typedef struct W_List WMList
;
304 typedef struct W_Browser WMBrowser
;
305 typedef struct W_PopUpButton WMPopUpButton
;
306 typedef struct W_ProgressIndicator WMProgressIndicator
;
307 typedef struct W_ColorWell WMColorWell
;
308 typedef struct W_Slider WMSlider
;
309 typedef struct W_Matrix WMMatrix
; /* not ready */
310 typedef struct W_SplitView WMSplitView
;
311 typedef struct W_TabView WMTabView
;
314 typedef struct W_TabViewItem WMTabViewItem
;
317 typedef struct W_FilePanel WMFilePanel
;
318 typedef WMFilePanel WMOpenPanel
;
319 typedef WMFilePanel WMSavePanel
;
321 typedef struct W_FontPanel WMFontPanel
;
323 typedef struct W_ColorPanel WMColorPanel
;
326 /* item for WMList */
327 typedef struct WMListItem
{
329 void *clientData
; /* ptr for user clientdata. */
331 unsigned int uflags
:16; /* flags for the user */
332 unsigned int selected
:1;
333 unsigned int disabled
:1;
334 unsigned int isBranch
:1;
335 unsigned int loaded
:1;
338 /* struct for message panel */
339 typedef struct WMAlertPanel
{
340 WMWindow
*win
; /* window */
341 WMButton
*defBtn
; /* default button */
342 WMButton
*altBtn
; /* alternative button */
343 WMButton
*othBtn
; /* other button */
344 WMLabel
*iLbl
; /* icon label */
345 WMLabel
*tLbl
; /* title label */
346 WMLabel
*mLbl
; /* message label */
347 WMFrame
*line
; /* separator */
348 short result
; /* button that was pushed */
356 typedef struct WMInputPanel
{
357 WMWindow
*win
; /* window */
358 WMButton
*defBtn
; /* default button */
359 WMButton
*altBtn
; /* alternative button */
360 WMLabel
*tLbl
; /* title label */
361 WMLabel
*mLbl
; /* message label */
362 WMTextField
*text
; /* text field */
363 short result
; /* button that was pushed */
376 typedef void *WMHandlerID
;
378 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
380 typedef void WMEventProc(XEvent
*event
, void *clientData
);
382 typedef void WMEventHook(XEvent
*event
);
384 /* self is set to the widget from where the callback is being called and
385 * clientData to the data set to with WMSetClientData() */
386 typedef void WMAction(WMWidget
*self
, void *clientData
);
388 /* same as WMAction, but for stuff that arent widgets */
389 typedef void WMAction2(void *self
, void *clientData
);
392 typedef void WMCallback(void *data
);
395 /* delegate method like stuff */
396 typedef void WMFreeDataProc(void *data
);
398 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
399 int state
, WMRect
*rect
);
402 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
403 unsigned int oldWidth,
404 unsigned int oldHeight);
407 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
408 int *minCoordinate
, int *maxCoordinate
);
410 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
413 typedef Bool
WMConvertSelectionProc(WMWidget
*w
, Atom selection
, Atom target
,
414 Atom
*type
, void **value
, unsigned *length
,
417 typedef void WMLoseSelectionProc(WMWidget
*w
, Atom selection
);
419 typedef void WMSelectionDoneProc(WMWidget
*w
, Atom selection
, Atom target
);
424 typedef struct WMBrowserDelegate
{
427 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
428 WMBrowser
*sender
, int column
, WMList
*list
);
430 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
433 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
435 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
439 typedef struct WMTextFieldDelegate
{
442 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
443 WMNotification
*notif
);
445 void (*didChange
)(struct WMTextFieldDelegate
*self
,
446 WMNotification
*notif
);
448 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
449 WMNotification
*notif
);
451 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
454 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
456 } WMTextFieldDelegate
;
460 typedef struct WMTabViewDelegate
{
463 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
466 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
467 WMTabViewItem
*item
);
469 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
470 WMTabViewItem
*item
);
472 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
473 WMTabViewItem
*item
);
478 /* ...................................................................... */
481 WMRange
wmkrange(int start
, int count
);
483 WMPoint
wmkpoint(int x
, int y
);
485 WMSize
wmksize(unsigned int width
, unsigned int height
);
488 /* ....................................................................... */
492 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
494 void WMSetResourcePath(char *path
);
496 /* don't free the returned string */
497 char *WMGetApplicationName();
499 /* Try to locate resource file. ext may be NULL */
500 char *WMPathForResourceOfType(char *resource
, char *ext
);
502 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
505 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
507 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
509 void WMScreenMainLoop(WMScreen
*scr
);
512 RContext
*WMScreenRContext(WMScreen
*scr
);
514 Display
*WMScreenDisplay(WMScreen
*scr
);
516 int WMScreenDepth(WMScreen
*scr
);
520 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
522 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
524 void WMSetFocusToWidget(WMWidget
*widget
);
526 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
528 int WMHandleEvent(XEvent
*event
);
530 Bool
WMScreenPending(WMScreen
*scr
);
532 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
533 WMEventProc
*eventProc
, void *clientData
);
535 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
536 WMEventProc
*eventProc
, void *clientData
);
538 int WMIsDoubleClick(XEvent
*event
);
540 void WMNextEvent(Display
*dpy
, XEvent
*event
);
542 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
544 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
547 void WMDeleteTimerWithClientData(void *cdata
);
549 void WMDeleteTimerHandler(WMHandlerID handlerID
);
551 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
553 void WMDeleteIdleHandler(WMHandlerID handlerID
);
555 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
558 void WMDeleteInputHandler(WMHandlerID handlerID
);
560 Bool
WMCreateSelectionHandler(WMWidget
*w
, Atom selection
, Time timestamp
,
561 WMConvertSelectionProc
*convProc
,
562 WMLoseSelectionProc
*loseProc
,
563 WMSelectionDoneProc
*doneProc
);
565 void WMDeleteSelectionHandler(WMWidget
*widget
, Atom selection
);
568 /* ....................................................................... */
570 void WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation,
571 WMSize mouseOffset, XEvent *event, Bool slideBack);
575 /* ....................................................................... */
577 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
579 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
581 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
583 WMFont
*WMRetainFont(WMFont
*font
);
585 void WMReleaseFont(WMFont
*font
);
587 unsigned int WMFontHeight(WMFont
*font
);
590 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
592 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
595 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
597 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
599 XFontSet
WMGetFontFontSet(WMFont
*font
);
601 /* ....................................................................... */
603 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
605 void WMReleasePixmap(WMPixmap
*pixmap
);
607 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
610 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
611 Pixmap mask
, int width
, int height
,
614 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
617 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
619 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
621 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
623 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
626 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
628 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
630 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
632 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
634 /* ....................................................................... */
637 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
639 WMColor
*WMGrayColor(WMScreen
*scr
);
641 WMColor
*WMBlackColor(WMScreen
*scr
);
643 WMColor
*WMWhiteColor(WMScreen
*scr
);
645 void WMSetColorInGC(WMColor
*color
, GC gc
);
647 GC
WMColorGC(WMColor
*color
);
649 WMPixel
WMColorPixel(WMColor
*color
);
651 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
652 unsigned int width
, unsigned int height
);
654 void WMReleaseColor(WMColor
*color
);
656 WMColor
*WMRetainColor(WMColor
*color
);
658 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
659 unsigned short green
, unsigned short blue
,
662 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
664 unsigned short WMRedComponentOfColor(WMColor
*color
);
666 unsigned short WMGreenComponentOfColor(WMColor
*color
);
668 unsigned short WMBlueComponentOfColor(WMColor
*color
);
670 char *WMGetColorRGBDescription(WMColor
*color
);
672 /* ....................................................................... */
675 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
676 int y
, char *text
, int length
);
678 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
679 int y
, char *text
, int length
);
681 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
685 /* ....................................................................... */
687 WMScreen
*WMWidgetScreen(WMWidget
*w
);
689 unsigned int WMScreenWidth(WMScreen
*scr
);
691 unsigned int WMScreenHeight(WMScreen
*scr
);
693 void WMUnmapWidget(WMWidget
*w
);
695 void WMMapWidget(WMWidget
*w
);
697 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
699 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
701 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
703 void WMMapSubwidgets(WMWidget
*w
);
705 void WMUnmapSubwidgets(WMWidget
*w
);
707 void WMRealizeWidget(WMWidget
*w
);
709 void WMDestroyWidget(WMWidget
*widget
);
711 void WMHangData(WMWidget
*widget
, void *data
);
713 void *WMGetHangedData(WMWidget
*widget
);
715 unsigned int WMWidgetWidth(WMWidget
*w
);
717 unsigned int WMWidgetHeight(WMWidget
*w
);
719 Window
WMWidgetXID(WMWidget
*w
);
721 Window
WMViewXID(WMView
*view
);
723 void WMRedisplayWidget(WMWidget
*w
);
725 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
727 WMSize
WMGetViewSize(WMView
*view
);
729 WMPoint
WMGetViewPosition(WMView
*view
);
731 WMWidget
*WMWidgetOfView(WMView
*view
);
734 extern char *WMViewSizeDidChangeNotification
;
736 extern char *WMViewRealizedNotification
;
739 /* ....................................................................... */
741 void WMSetBalloonTextForView(char *text
, WMView
*view
);
743 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
745 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
747 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
749 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
751 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
754 /* ....................................................................... */
756 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
758 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
760 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
763 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
765 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
767 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
769 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
771 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
773 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
775 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
777 void WMSetWindowInitialSize(WMWindow
*win
, unsigned width
, unsigned height
);
779 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
781 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
783 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
785 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
787 void WMSetWindowLevel(WMWindow
*win
, int level
);
789 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
791 void WMCloseWindow(WMWindow
*win
);
793 /* ....................................................................... */
795 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
797 #define WMCreateCommandButton(parent) \
798 WMCreateCustomButton((parent), WBBSpringLoadedMask\
803 #define WMCreateRadioButton(parent) \
804 WMCreateButton((parent), WBTRadio)
806 #define WMCreateSwitchButton(parent) \
807 WMCreateButton((parent), WBTSwitch)
809 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
811 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
813 void WMSetButtonImageDefault(WMButton
*bPtr
);
815 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
817 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
819 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
821 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
823 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
825 void WMSetButtonText(WMButton
*bPtr
, char *text
);
827 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
829 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
831 int WMGetButtonSelected(WMButton
*bPtr
);
833 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
835 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
837 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
839 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
841 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
843 void WMPerformButtonClick(WMButton
*bPtr
);
845 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
847 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
849 /* ....................................................................... */
851 WMLabel
*WMCreateLabel(WMWidget
*parent
);
853 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
855 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
857 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
859 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
861 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
863 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
865 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
867 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
869 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
871 /* ....................................................................... */
873 WMFrame
*WMCreateFrame(WMWidget
*parent
);
875 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
877 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
879 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
881 /* ....................................................................... */
883 WMTextField
*WMCreateTextField(WMWidget
*parent
);
885 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
887 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
889 /* you can free the returned string */
890 char *WMGetTextFieldText(WMTextField
*tPtr
);
892 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
894 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
896 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
898 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
900 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
902 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
904 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
906 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
908 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
910 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
912 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
914 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
916 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
918 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
921 extern char *WMTextDidChangeNotification
;
922 extern char *WMTextDidBeginEditingNotification
;
923 extern char *WMTextDidEndEditingNotification
;
925 /* ....................................................................... */
927 WMScroller
*WMCreateScroller(WMWidget
*parent
);
929 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
930 float knobProportion
);
932 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
934 float WMGetScrollerValue(WMScroller
*sPtr
);
936 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
938 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
940 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
941 WMScrollArrowPosition position
);
943 /* ....................................................................... */
945 WMList
*WMCreateList(WMWidget
*parent
);
947 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
949 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
951 void WMSortListItems(WMList
*lPtr
);
953 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
955 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
957 WMBag
*WMGetListItems(WMList
*lPtr
);
960 void WMRemoveListItem(WMList
*lPtr
, int row
);
962 void WMSelectListItem(WMList
*lPtr
, int row
);
964 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
966 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
968 int WMGetListItemHeight(WMList
*lPtr
);
970 /* don't free the returned data */
971 WMListItem
*WMGetListSelectedItem(WMList
*lPtr
);
973 int WMGetListSelectedItemRow(WMList
*lPtr
);
975 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
977 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
979 void WMClearList(WMList
*lPtr
);
981 int WMGetListNumberOfRows(WMList
*lPtr
);
983 void WMSetListPosition(WMList
*lPtr
, int row
);
985 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
987 int WMGetListPosition(WMList
*lPtr
);
989 extern char *WMListDidScrollNotification
;
990 extern char *WMListSelectionDidChangeNotification
;
992 /* ....................................................................... */
994 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
996 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
998 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1000 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1002 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1004 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1006 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1008 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1010 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1012 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1014 /* Don't free the returned string. */
1015 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1017 /* you can free the returned string */
1018 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1019 /* you can free the returned string */
1020 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1022 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1024 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1027 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1029 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1031 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1033 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1035 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1037 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1039 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1041 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1043 /* ....................................................................... */
1045 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1047 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1050 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1052 void WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1054 void WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
, char *title
);
1056 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1058 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1060 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1062 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1064 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1066 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1068 /* don't free the returned data */
1069 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1071 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1073 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1075 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1077 /* ....................................................................... */
1079 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1081 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1083 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1085 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1087 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1089 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1091 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1094 /* ....................................................................... */
1096 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1098 void WMFreeColorPanel(WMColorPanel
*panel
);
1100 void WMShowColorPanel(WMColorPanel
*panel
);
1102 void WMCloseColorPanel(WMColorPanel
*panel
);
1104 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1106 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1108 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1110 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1112 extern char *WMColorPanelColorChangedNotification
;
1114 /* ....................................................................... */
1116 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1118 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1120 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1122 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1125 extern char *WMColorWellDidChangeNotification
;
1128 /* ...................................................................... */
1130 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1132 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1133 unsigned int height
);
1135 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1137 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1139 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1141 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1143 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1145 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1147 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1149 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1151 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1153 /* ....................................................................... */
1155 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1157 int WMGetSliderMinValue(WMSlider
*slider
);
1159 int WMGetSliderMaxValue(WMSlider
*slider
);
1161 int WMGetSliderValue(WMSlider
*slider
);
1163 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1165 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1167 void WMSetSliderValue(WMSlider
*slider
, int value
);
1169 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1171 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1173 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1175 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1177 /* ....................................................................... */
1179 /* only supports 2 subviews */
1180 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1182 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1184 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1186 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1187 WMSplitViewConstrainProc
*proc
);
1190 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1191 WMSplitViewResizeSubviewsProc *proc);
1194 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1197 /* ....................................................................... */
1200 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1202 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1204 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1206 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1208 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1210 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1212 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1214 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1216 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1218 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1220 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1222 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1224 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1226 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1229 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1231 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1233 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1235 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1237 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1239 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1241 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1243 /* ....................................................................... */
1245 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1246 char *defaultButton
, char *alternateButton
,
1249 /* you can free the returned string */
1250 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1251 char *defaultText
, char *okButton
, char *cancelButton
);
1253 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1254 char *msg
, char *defaultButton
,
1255 char *alternateButton
, char *otherButton
);
1257 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1258 char *msg
, char *defaultText
, char *okButton
,
1259 char *cancelButton
);
1261 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1263 void WMDestroyInputPanel(WMInputPanel
*panel
);
1265 /* ....................................................................... */
1267 /* only 1 instance per WMScreen */
1268 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1270 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1272 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1274 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1276 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1278 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1280 /* you can free the returned string */
1281 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1283 void WMFreeFilePanel(WMFilePanel
*panel
);
1285 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1286 char *path
, char *name
, char **fileTypes
);
1288 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1290 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1293 /* ...................................................................... */
1295 /* only 1 instance per WMScreen */
1296 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1298 void WMShowFontPanel(WMFontPanel
*panel
);
1300 void WMHideFontPanel(WMFontPanel
*panel
);
1302 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1304 /* you can free the returned string */
1305 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1307 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1311 #endif /* __cplusplus */