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,
272 /* All widgets must start with the following structure
273 * in that order. Used for typecasting to get some generic data */
274 typedef struct W_WidgetType
{
281 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
282 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
287 typedef void WMWidget
;
289 typedef struct W_Pixmap WMPixmap
;
290 typedef struct W_Font WMFont
;
291 typedef struct W_Color WMColor
;
293 typedef struct W_Screen WMScreen
;
295 typedef struct W_View WMView
;
297 typedef struct W_Window WMWindow
;
298 typedef struct W_Frame WMFrame
;
299 typedef struct W_Button WMButton
;
300 typedef struct W_Label WMLabel
;
301 typedef struct W_TextField WMTextField
;
302 typedef struct W_Scroller WMScroller
;
303 typedef struct W_ScrollView WMScrollView
;
304 typedef struct W_List WMList
;
305 typedef struct W_Browser WMBrowser
;
306 typedef struct W_PopUpButton WMPopUpButton
;
307 typedef struct W_ProgressIndicator WMProgressIndicator
;
308 typedef struct W_ColorWell WMColorWell
;
309 typedef struct W_Slider WMSlider
;
310 typedef struct W_Matrix WMMatrix
; /* not ready */
311 typedef struct W_SplitView WMSplitView
;
312 typedef struct W_TabView WMTabView
;
315 typedef struct W_TabViewItem WMTabViewItem
;
316 typedef struct W_MenuItem WMMenuItem
;
319 typedef struct W_FilePanel WMFilePanel
;
320 typedef WMFilePanel WMOpenPanel
;
321 typedef WMFilePanel WMSavePanel
;
323 typedef struct W_FontPanel WMFontPanel
;
325 typedef struct W_ColorPanel WMColorPanel
;
328 /* item for WMList */
329 typedef struct WMListItem
{
331 void *clientData
; /* ptr for user clientdata. */
333 unsigned int uflags
:16; /* flags for the user */
334 unsigned int selected
:1;
335 unsigned int disabled
:1;
336 unsigned int isBranch
:1;
337 unsigned int loaded
:1;
340 /* struct for message panel */
341 typedef struct WMAlertPanel
{
342 WMWindow
*win
; /* window */
343 WMButton
*defBtn
; /* default button */
344 WMButton
*altBtn
; /* alternative button */
345 WMButton
*othBtn
; /* other button */
346 WMLabel
*iLbl
; /* icon label */
347 WMLabel
*tLbl
; /* title label */
348 WMLabel
*mLbl
; /* message label */
349 WMFrame
*line
; /* separator */
350 short result
; /* button that was pushed */
358 typedef struct WMInputPanel
{
359 WMWindow
*win
; /* window */
360 WMButton
*defBtn
; /* default button */
361 WMButton
*altBtn
; /* alternative button */
362 WMLabel
*tLbl
; /* title label */
363 WMLabel
*mLbl
; /* message label */
364 WMTextField
*text
; /* text field */
365 short result
; /* button that was pushed */
378 typedef void *WMHandlerID
;
380 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
382 typedef void WMEventProc(XEvent
*event
, void *clientData
);
384 typedef void WMEventHook(XEvent
*event
);
386 /* self is set to the widget from where the callback is being called and
387 * clientData to the data set to with WMSetClientData() */
388 typedef void WMAction(WMWidget
*self
, void *clientData
);
390 /* same as WMAction, but for stuff that arent widgets */
391 typedef void WMAction2(void *self
, void *clientData
);
394 typedef void WMCallback(void *data
);
397 /* delegate method like stuff */
398 typedef void WMFreeDataProc(void *data
);
400 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
401 int state
, WMRect
*rect
);
404 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
405 unsigned int oldWidth,
406 unsigned int oldHeight);
409 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
410 int *minSize
, int *maxSize
);
412 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
415 typedef Bool
WMConvertSelectionProc(WMWidget
*w
, Atom selection
, Atom target
,
416 Atom
*type
, void **value
, unsigned *length
,
419 typedef void WMLoseSelectionProc(WMWidget
*w
, Atom selection
);
421 typedef void WMSelectionDoneProc(WMWidget
*w
, Atom selection
, Atom target
);
426 typedef struct WMBrowserDelegate
{
429 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
430 WMBrowser
*sender
, int column
, WMList
*list
);
432 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
435 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
437 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
441 typedef struct WMTextFieldDelegate
{
444 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
445 WMNotification
*notif
);
447 void (*didChange
)(struct WMTextFieldDelegate
*self
,
448 WMNotification
*notif
);
450 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
451 WMNotification
*notif
);
453 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
456 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
458 } WMTextFieldDelegate
;
462 typedef struct WMTabViewDelegate
{
465 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
468 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
469 WMTabViewItem
*item
);
471 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
472 WMTabViewItem
*item
);
474 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
475 WMTabViewItem
*item
);
480 /* ...................................................................... */
483 WMRange
wmkrange(int start
, int count
);
485 WMPoint
wmkpoint(int x
, int y
);
487 WMSize
wmksize(unsigned int width
, unsigned int height
);
490 /* ....................................................................... */
494 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
496 void WMSetResourcePath(char *path
);
498 /* don't free the returned string */
499 char *WMGetApplicationName();
501 /* Try to locate resource file. ext may be NULL */
502 char *WMPathForResourceOfType(char *resource
, char *ext
);
504 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
507 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
509 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
511 void WMScreenMainLoop(WMScreen
*scr
);
514 RContext
*WMScreenRContext(WMScreen
*scr
);
516 Display
*WMScreenDisplay(WMScreen
*scr
);
518 int WMScreenDepth(WMScreen
*scr
);
522 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
524 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
526 void WMSetFocusToWidget(WMWidget
*widget
);
528 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
530 int WMHandleEvent(XEvent
*event
);
532 Bool
WMScreenPending(WMScreen
*scr
);
534 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
535 WMEventProc
*eventProc
, void *clientData
);
537 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
538 WMEventProc
*eventProc
, void *clientData
);
540 int WMIsDoubleClick(XEvent
*event
);
542 void WMNextEvent(Display
*dpy
, XEvent
*event
);
544 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
546 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
549 void WMDeleteTimerWithClientData(void *cdata
);
551 void WMDeleteTimerHandler(WMHandlerID handlerID
);
553 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
555 void WMDeleteIdleHandler(WMHandlerID handlerID
);
557 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
560 void WMDeleteInputHandler(WMHandlerID handlerID
);
562 Bool
WMCreateSelectionHandler(WMWidget
*w
, Atom selection
, Time timestamp
,
563 WMConvertSelectionProc
*convProc
,
564 WMLoseSelectionProc
*loseProc
,
565 WMSelectionDoneProc
*doneProc
);
567 void WMDeleteSelectionHandler(WMWidget
*widget
, Atom selection
);
570 /* ....................................................................... */
572 void WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation,
573 WMSize mouseOffset, XEvent *event, Bool slideBack);
577 /* ....................................................................... */
579 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
581 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
583 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
585 WMFont
*WMRetainFont(WMFont
*font
);
587 void WMReleaseFont(WMFont
*font
);
589 unsigned int WMFontHeight(WMFont
*font
);
592 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
594 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
597 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
599 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
601 XFontSet
WMGetFontFontSet(WMFont
*font
);
603 /* ....................................................................... */
605 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
607 void WMReleasePixmap(WMPixmap
*pixmap
);
609 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
612 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
613 Pixmap mask
, int width
, int height
,
616 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
619 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
621 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
623 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
625 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
628 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
630 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
632 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
634 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
636 /* ....................................................................... */
639 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
641 WMColor
*WMGrayColor(WMScreen
*scr
);
643 WMColor
*WMBlackColor(WMScreen
*scr
);
645 WMColor
*WMWhiteColor(WMScreen
*scr
);
647 void WMSetColorInGC(WMColor
*color
, GC gc
);
649 GC
WMColorGC(WMColor
*color
);
651 WMPixel
WMColorPixel(WMColor
*color
);
653 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
654 unsigned int width
, unsigned int height
);
656 void WMReleaseColor(WMColor
*color
);
658 WMColor
*WMRetainColor(WMColor
*color
);
660 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
661 unsigned short green
, unsigned short blue
,
664 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
666 unsigned short WMRedComponentOfColor(WMColor
*color
);
668 unsigned short WMGreenComponentOfColor(WMColor
*color
);
670 unsigned short WMBlueComponentOfColor(WMColor
*color
);
672 char *WMGetColorRGBDescription(WMColor
*color
);
674 /* ....................................................................... */
677 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
678 int y
, char *text
, int length
);
680 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
681 int y
, char *text
, int length
);
683 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
687 /* ....................................................................... */
689 WMScreen
*WMWidgetScreen(WMWidget
*w
);
691 unsigned int WMScreenWidth(WMScreen
*scr
);
693 unsigned int WMScreenHeight(WMScreen
*scr
);
695 void WMUnmapWidget(WMWidget
*w
);
697 void WMMapWidget(WMWidget
*w
);
699 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
701 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
703 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
705 void WMMapSubwidgets(WMWidget
*w
);
707 void WMUnmapSubwidgets(WMWidget
*w
);
709 void WMRealizeWidget(WMWidget
*w
);
711 void WMDestroyWidget(WMWidget
*widget
);
713 void WMHangData(WMWidget
*widget
, void *data
);
715 void *WMGetHangedData(WMWidget
*widget
);
717 unsigned int WMWidgetWidth(WMWidget
*w
);
719 unsigned int WMWidgetHeight(WMWidget
*w
);
721 Window
WMWidgetXID(WMWidget
*w
);
723 Window
WMViewXID(WMView
*view
);
725 void WMRedisplayWidget(WMWidget
*w
);
727 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
729 WMSize
WMGetViewSize(WMView
*view
);
731 WMPoint
WMGetViewPosition(WMView
*view
);
733 WMWidget
*WMWidgetOfView(WMView
*view
);
736 extern char *WMViewSizeDidChangeNotification
;
738 extern char *WMViewRealizedNotification
;
741 /* ....................................................................... */
743 void WMSetBalloonTextForView(char *text
, WMView
*view
);
745 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
747 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
749 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
751 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
753 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
756 /* ....................................................................... */
758 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
760 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
762 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
765 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
767 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
769 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
771 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
773 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
775 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
777 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
779 void WMSetWindowInitialSize(WMWindow
*win
, unsigned width
, unsigned height
);
781 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
783 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
785 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
787 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
789 void WMSetWindowLevel(WMWindow
*win
, int level
);
791 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
793 void WMCloseWindow(WMWindow
*win
);
795 /* ....................................................................... */
797 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
799 #define WMCreateCommandButton(parent) \
800 WMCreateCustomButton((parent), WBBSpringLoadedMask\
805 #define WMCreateRadioButton(parent) \
806 WMCreateButton((parent), WBTRadio)
808 #define WMCreateSwitchButton(parent) \
809 WMCreateButton((parent), WBTSwitch)
811 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
813 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
815 void WMSetButtonImageDefault(WMButton
*bPtr
);
817 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
819 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
821 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
823 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
825 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
827 void WMSetButtonText(WMButton
*bPtr
, char *text
);
829 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
831 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
833 int WMGetButtonSelected(WMButton
*bPtr
);
835 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
837 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
839 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
841 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
843 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
845 void WMPerformButtonClick(WMButton
*bPtr
);
847 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
849 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
851 /* ....................................................................... */
853 WMLabel
*WMCreateLabel(WMWidget
*parent
);
855 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
857 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
859 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
861 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
863 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
865 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
867 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
869 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
871 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
873 /* ....................................................................... */
875 WMFrame
*WMCreateFrame(WMWidget
*parent
);
877 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
879 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
881 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
883 /* ....................................................................... */
885 WMTextField
*WMCreateTextField(WMWidget
*parent
);
887 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
889 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
891 /* you can free the returned string */
892 char *WMGetTextFieldText(WMTextField
*tPtr
);
894 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
896 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
898 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
900 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
902 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
904 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
906 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
908 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
910 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
912 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
914 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
916 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
918 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
920 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
923 extern char *WMTextDidChangeNotification
;
924 extern char *WMTextDidBeginEditingNotification
;
925 extern char *WMTextDidEndEditingNotification
;
927 /* ....................................................................... */
929 WMScroller
*WMCreateScroller(WMWidget
*parent
);
931 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
932 float knobProportion
);
934 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
936 float WMGetScrollerValue(WMScroller
*sPtr
);
938 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
940 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
942 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
943 WMScrollArrowPosition position
);
945 /* ....................................................................... */
947 WMList
*WMCreateList(WMWidget
*parent
);
949 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
951 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
953 void WMSortListItems(WMList
*lPtr
);
955 void WMSortListItemsWithComparer(WMList
*lPtr
,
956 int (f
)(const void*, const void*));
958 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
960 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
962 WMBag
*WMGetListItems(WMList
*lPtr
);
965 void WMRemoveListItem(WMList
*lPtr
, int row
);
967 void WMSelectListItem(WMList
*lPtr
, int row
);
969 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
971 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
973 int WMGetListItemHeight(WMList
*lPtr
);
975 /* don't free the returned data */
976 WMListItem
*WMGetListSelectedItem(WMList
*lPtr
);
978 int WMGetListSelectedItemRow(WMList
*lPtr
);
980 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
982 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
984 void WMClearList(WMList
*lPtr
);
986 int WMGetListNumberOfRows(WMList
*lPtr
);
988 void WMSetListPosition(WMList
*lPtr
, int row
);
990 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
992 int WMGetListPosition(WMList
*lPtr
);
994 extern char *WMListDidScrollNotification
;
995 extern char *WMListSelectionDidChangeNotification
;
997 /* ....................................................................... */
999 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1001 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1003 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1005 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1007 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1009 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1011 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1013 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1015 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1017 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1019 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1020 int (f
)(const void*, const void*));
1022 /* Don't free the returned string. */
1023 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1025 /* you can free the returned string */
1026 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1027 /* you can free the returned string */
1028 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1030 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1032 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1035 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1037 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1039 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1041 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1043 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1045 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1047 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1049 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1051 /* ....................................................................... */
1054 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1056 WMMenuItem
*WMCreateMenuItem(void);
1058 void WMDestroyMenuItem(WMMenuItem
*item
);
1060 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1062 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1064 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1066 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1068 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1070 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1072 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1074 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1076 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1078 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1080 void *WMGetMenuItemData(WMMenuItem
*item
);
1082 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1084 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1086 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1088 int WMGetMenuItemState(WMMenuItem
*item
);
1090 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1092 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1094 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1096 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1098 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1100 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1102 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1104 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1106 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1109 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1111 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1114 /* ....................................................................... */
1116 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1118 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1121 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1123 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1125 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1128 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1130 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1132 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1134 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1136 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1138 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1140 /* don't free the returned data */
1141 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1143 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1146 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1148 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1150 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1152 /* ....................................................................... */
1154 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1156 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1158 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1160 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1162 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1164 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1166 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1169 /* ....................................................................... */
1171 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1173 void WMFreeColorPanel(WMColorPanel
*panel
);
1175 void WMShowColorPanel(WMColorPanel
*panel
);
1177 void WMCloseColorPanel(WMColorPanel
*panel
);
1179 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1181 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1183 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1185 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1187 extern char *WMColorPanelColorChangedNotification
;
1189 /* ....................................................................... */
1191 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1193 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1195 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1197 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1200 extern char *WMColorWellDidChangeNotification
;
1203 /* ...................................................................... */
1205 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1207 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1208 unsigned int height
);
1210 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1212 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1214 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1216 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1218 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1220 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1222 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1224 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1226 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1228 /* ....................................................................... */
1230 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1232 int WMGetSliderMinValue(WMSlider
*slider
);
1234 int WMGetSliderMaxValue(WMSlider
*slider
);
1236 int WMGetSliderValue(WMSlider
*slider
);
1238 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1240 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1242 void WMSetSliderValue(WMSlider
*slider
, int value
);
1244 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1246 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1248 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1250 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1252 /* ....................................................................... */
1255 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1256 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1257 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1259 int WMGetSplitViewSubViewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1261 WMView
*WMGetSplitViewSubViewAt(WMSplitView
*sPtr
, int index
);
1263 /* remove the first subview == view */
1264 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1266 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1269 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1271 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1273 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1274 WMSplitViewConstrainProc
*proc
);
1277 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1278 WMSplitViewResizeSubviewsProc *proc);
1281 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1284 /* ....................................................................... */
1287 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1289 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1291 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1293 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1295 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1297 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1299 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1301 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1303 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1305 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1307 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1309 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1311 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1313 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1316 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1318 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1320 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1322 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1324 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1326 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1328 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1330 /* ....................................................................... */
1332 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1333 char *defaultButton
, char *alternateButton
,
1336 /* you can free the returned string */
1337 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1338 char *defaultText
, char *okButton
, char *cancelButton
);
1340 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1341 char *msg
, char *defaultButton
,
1342 char *alternateButton
, char *otherButton
);
1344 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1345 char *msg
, char *defaultText
, char *okButton
,
1346 char *cancelButton
);
1348 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1350 void WMDestroyInputPanel(WMInputPanel
*panel
);
1352 /* ....................................................................... */
1354 /* only 1 instance per WMScreen */
1355 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1357 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1359 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1361 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1363 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1365 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1367 /* you can free the returned string */
1368 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1370 void WMFreeFilePanel(WMFilePanel
*panel
);
1372 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1373 char *path
, char *name
, char **fileTypes
);
1375 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1377 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1380 /* ...................................................................... */
1382 /* only 1 instance per WMScreen */
1383 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1385 void WMShowFontPanel(WMFontPanel
*panel
);
1387 void WMHideFontPanel(WMFontPanel
*panel
);
1389 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1391 /* you can free the returned string */
1392 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1394 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1398 #endif /* __cplusplus */