10 #define WINGS_H_VERSION 990516
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
,
184 WMBacktabTextMovement
,
191 /* text field special events */
198 WMGrayModeColorPanel
,
200 WMCMYKModeColorPanel
,
202 WMCustomPaletteModeColorPanel
,
203 WMColorListModeColorPanel
,
204 WMWheelModeColorPanel
210 #define WSIReturnArrow 1
211 #define WSIHighlightedReturnArrow 2
212 #define WSIScrollerDimple 3
213 #define WSIArrowLeft 4
214 #define WSIHighlightedArrowLeft 5
215 #define WSIArrowRight 6
216 #define WSIHighlightedArrowRight 7
218 #define WSIHighlightedArrowUp 9
219 #define WSIArrowDown 10
220 #define WSIHighlightedArrowDown 11
221 #define WSICheckMark 12
224 WLDSSelected
= (1 << 16),
225 WLDSDisabled
= (1 << 17),
226 WLDSFocused
= (1 << 18),
227 WLDSIsBranch
= (1 << 19)
230 /* alert panel return values */
240 /* types of input observers */
242 WIReadMask
= (1 << 0),
243 WIWriteMask
= (1 << 1),
244 WIExceptMask
= (1 << 2)
264 WC_Matrix
= 12, /* not ready */
267 WC_ProgressIndicator
= 15
270 /* All widgets must start with the following structure
271 * in that order. Used for typecasting to get some generic data */
272 typedef struct W_WidgetType
{
279 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
280 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
285 typedef void WMWidget
;
287 typedef struct W_Pixmap WMPixmap
;
288 typedef struct W_Font WMFont
;
289 typedef struct W_Color WMColor
;
291 typedef struct W_Screen WMScreen
;
293 typedef struct W_View WMView
;
295 typedef struct W_Window WMWindow
;
296 typedef struct W_Frame WMFrame
;
297 typedef struct W_Button WMButton
;
298 typedef struct W_Label WMLabel
;
299 typedef struct W_TextField WMTextField
;
300 typedef struct W_Scroller WMScroller
;
301 typedef struct W_ScrollView WMScrollView
;
302 typedef struct W_List WMList
;
303 typedef struct W_Browser WMBrowser
;
304 typedef struct W_PopUpButton WMPopUpButton
;
305 typedef struct W_ProgressIndicator WMProgressIndicator
;
306 typedef struct W_ColorWell WMColorWell
;
307 typedef struct W_Slider WMSlider
;
308 typedef struct W_Matrix WMMatrix
; /* not ready */
309 typedef struct W_SplitView WMSplitView
;
310 typedef struct W_TabView WMTabView
;
313 typedef struct W_TabViewItem WMTabViewItem
;
316 typedef struct W_FilePanel WMFilePanel
;
317 typedef WMFilePanel WMOpenPanel
;
318 typedef WMFilePanel WMSavePanel
;
320 typedef struct W_FontPanel WMFontPanel
;
322 typedef struct W_ColorPanel WMColorPanel
;
325 /* item for WMList */
326 typedef struct WMListItem
{
328 void *clientData
; /* ptr for user clientdata. */
330 struct WMListItem
*nextPtr
;
332 unsigned int uflags
:16; /* flags for the user */
333 unsigned int selected
:1;
334 unsigned int disabled
:1;
335 unsigned int isBranch
:1;
336 unsigned int loaded
:1;
339 /* struct for message panel */
340 typedef struct WMAlertPanel
{
341 WMWindow
*win
; /* window */
342 WMButton
*defBtn
; /* default button */
343 WMButton
*altBtn
; /* alternative button */
344 WMButton
*othBtn
; /* other button */
345 WMLabel
*iLbl
; /* icon label */
346 WMLabel
*tLbl
; /* title label */
347 WMLabel
*mLbl
; /* message label */
348 WMFrame
*line
; /* separator */
349 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 */
375 typedef void *WMHandlerID
;
377 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
379 typedef void WMEventProc(XEvent
*event
, void *clientData
);
381 typedef void WMEventHook(XEvent
*event
);
383 /* self is set to the widget from where the callback is being called and
384 * clientData to the data set to with WMSetClientData() */
385 typedef void WMAction(WMWidget
*self
, void *clientData
);
387 /* same as WMAction, but for stuff that arent widgets */
388 typedef void WMAction2(void *self
, void *clientData
);
391 typedef void WMCallback(void *data
);
394 /* delegate method like stuff */
395 typedef void WMFreeDataProc(void *data
);
397 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
398 int state
, WMRect
*rect
);
401 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
402 unsigned int oldWidth,
403 unsigned int oldHeight);
406 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
407 int *minCoordinate
, int *maxCoordinate
);
409 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
412 typedef Bool
WMConvertSelectionProc(WMWidget
*w
, Atom selection
, Atom target
,
413 Atom
*type
, void **value
, unsigned *length
,
416 typedef void WMLoseSelectionProc(WMWidget
*w
, Atom selection
);
418 typedef void WMSelectionDoneProc(WMWidget
*w
, Atom selection
, Atom target
);
423 typedef struct WMBrowserDelegate
{
426 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
427 WMBrowser
*sender
, int column
, WMList
*list
);
429 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
432 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
434 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
438 typedef struct WMTextFieldDelegate
{
441 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
442 WMNotification
*notif
);
444 void (*didChange
)(struct WMTextFieldDelegate
*self
,
445 WMNotification
*notif
);
447 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
448 WMNotification
*notif
);
450 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
453 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
455 } WMTextFieldDelegate
;
459 typedef struct WMTabViewDelegate
{
462 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
465 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
466 WMTabViewItem
*item
);
468 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
469 WMTabViewItem
*item
);
471 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
472 WMTabViewItem
*item
);
477 /* ....................................................................... */
481 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
483 void WMSetResourcePath(char *path
);
485 /* don't free the returned string */
486 char *WMGetApplicationName();
488 /* Try to locate resource file. ext may be NULL */
489 char *WMPathForResourceOfType(char *resource
, char *ext
);
491 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
494 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
496 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
498 void WMScreenMainLoop(WMScreen
*scr
);
501 RContext
*WMScreenRContext(WMScreen
*scr
);
503 Display
*WMScreenDisplay(WMScreen
*scr
);
505 int WMScreenDepth(WMScreen
*scr
);
509 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
511 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
513 void WMSetFocusToWidget(WMWidget
*widget
);
515 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
517 int WMHandleEvent(XEvent
*event
);
519 Bool
WMScreenPending(WMScreen
*scr
);
521 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
522 WMEventProc
*eventProc
, void *clientData
);
524 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
525 WMEventProc
*eventProc
, void *clientData
);
527 int WMIsDoubleClick(XEvent
*event
);
529 void WMNextEvent(Display
*dpy
, XEvent
*event
);
531 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
533 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
536 void WMDeleteTimerWithClientData(void *cdata
);
538 void WMDeleteTimerHandler(WMHandlerID handlerID
);
540 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
542 void WMDeleteIdleHandler(WMHandlerID handlerID
);
544 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
547 void WMDeleteInputHandler(WMHandlerID handlerID
);
549 Bool
WMCreateSelectionHandler(WMWidget
*w
, Atom selection
, Time timestamp
,
550 WMConvertSelectionProc
*convProc
,
551 WMLoseSelectionProc
*loseProc
,
552 WMSelectionDoneProc
*doneProc
);
554 void WMDeleteSelectionHandler(WMWidget
*widget
, Atom selection
);
557 /* ....................................................................... */
559 void WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation,
560 WMSize mouseOffset, XEvent *event, Bool slideBack);
564 /* ....................................................................... */
566 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
568 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
570 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
572 WMFont
*WMRetainFont(WMFont
*font
);
574 void WMReleaseFont(WMFont
*font
);
576 unsigned int WMFontHeight(WMFont
*font
);
579 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
581 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
584 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
586 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
588 XFontSet
WMGetFontFontSet(WMFont
*font
);
590 /* ....................................................................... */
592 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
594 void WMReleasePixmap(WMPixmap
*pixmap
);
596 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
599 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
600 Pixmap mask
, int width
, int height
,
603 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
606 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
608 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
610 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
612 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
615 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
617 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
619 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
621 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
623 /* ....................................................................... */
626 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
628 WMColor
*WMGrayColor(WMScreen
*scr
);
630 WMColor
*WMBlackColor(WMScreen
*scr
);
632 WMColor
*WMWhiteColor(WMScreen
*scr
);
634 void WMSetColorInGC(WMColor
*color
, GC gc
);
636 GC
WMColorGC(WMColor
*color
);
638 WMPixel
WMColorPixel(WMColor
*color
);
640 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
641 unsigned int width
, unsigned int height
);
643 void WMReleaseColor(WMColor
*color
);
645 WMColor
*WMRetainColor(WMColor
*color
);
647 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
648 unsigned short green
, unsigned short blue
,
651 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
653 unsigned short WMRedComponentOfColor(WMColor
*color
);
655 unsigned short WMGreenComponentOfColor(WMColor
*color
);
657 unsigned short WMBlueComponentOfColor(WMColor
*color
);
659 char *WMGetColorRGBDescription(WMColor
*color
);
661 /* ....................................................................... */
664 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
665 int y
, char *text
, int length
);
667 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
668 int y
, char *text
, int length
);
670 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
674 /* ....................................................................... */
676 WMScreen
*WMWidgetScreen(WMWidget
*w
);
678 unsigned int WMScreenWidth(WMScreen
*scr
);
680 unsigned int WMScreenHeight(WMScreen
*scr
);
682 void WMUnmapWidget(WMWidget
*w
);
684 void WMMapWidget(WMWidget
*w
);
686 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
688 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
690 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
692 void WMMapSubwidgets(WMWidget
*w
);
694 void WMUnmapSubwidgets(WMWidget
*w
);
696 void WMRealizeWidget(WMWidget
*w
);
698 void WMDestroyWidget(WMWidget
*widget
);
700 void WMHangData(WMWidget
*widget
, void *data
);
702 void *WMGetHangedData(WMWidget
*widget
);
704 unsigned int WMWidgetWidth(WMWidget
*w
);
706 unsigned int WMWidgetHeight(WMWidget
*w
);
708 Window
WMWidgetXID(WMWidget
*w
);
710 Window
WMViewXID(WMView
*view
);
712 void WMRedisplayWidget(WMWidget
*w
);
714 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
716 WMSize
WMGetViewSize(WMView
*view
);
718 WMPoint
WMGetViewPosition(WMView
*view
);
720 WMWidget
*WMWidgetOfView(WMView
*view
);
723 extern char *WMViewSizeDidChangeNotification
;
725 extern char *WMViewRealizedNotification
;
728 /* ....................................................................... */
730 void WMSetBalloonTextForView(char *text
, WMView
*view
);
732 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
734 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
736 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
738 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
740 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
743 /* ....................................................................... */
745 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
747 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
749 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
752 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
754 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
756 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
758 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
760 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
762 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
764 void WMSetWindowUPosition(WMWindow
*win
, int x
, int y
);
766 void WMSetWindowUSize(WMWindow
*win
, unsigned width
, unsigned height
);
768 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
770 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
772 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
774 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
776 void WMSetWindowLevel(WMWindow
*win
, int level
);
778 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
780 void WMCloseWindow(WMWindow
*win
);
782 /* ....................................................................... */
784 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
786 #define WMCreateCommandButton(parent) \
787 WMCreateCustomButton((parent), WBBSpringLoadedMask\
792 #define WMCreateRadioButton(parent) \
793 WMCreateButton((parent), WBTRadio)
795 #define WMCreateSwitchButton(parent) \
796 WMCreateButton((parent), WBTSwitch)
798 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
800 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
802 void WMSetButtonImageDefault(WMButton
*bPtr
);
804 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
806 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
808 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
810 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
812 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
814 void WMSetButtonText(WMButton
*bPtr
, char *text
);
816 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
818 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
820 int WMGetButtonSelected(WMButton
*bPtr
);
822 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
824 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
826 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
828 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
830 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
832 void WMPerformButtonClick(WMButton
*bPtr
);
834 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
836 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
838 /* ....................................................................... */
840 WMLabel
*WMCreateLabel(WMWidget
*parent
);
842 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
844 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
846 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
848 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
850 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
852 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
854 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
856 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
858 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
860 /* ....................................................................... */
862 WMFrame
*WMCreateFrame(WMWidget
*parent
);
864 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
866 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
868 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
870 /* ....................................................................... */
872 WMTextField
*WMCreateTextField(WMWidget
*parent
);
874 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
876 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
878 /* you can free the returned string */
879 char *WMGetTextFieldText(WMTextField
*tPtr
);
881 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
883 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
885 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
887 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
889 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
891 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
893 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
895 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
897 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
899 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
901 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
903 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
906 extern char *WMTextDidChangeNotification
;
907 extern char *WMTextDidBeginEditingNotification
;
908 extern char *WMTextDidEndEditingNotification
;
910 /* ....................................................................... */
912 WMScroller
*WMCreateScroller(WMWidget
*parent
);
914 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
915 float knobProportion
);
917 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
919 float WMGetScrollerValue(WMScroller
*sPtr
);
921 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
923 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
925 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
926 WMScrollArrowPosition position
);
928 /* ....................................................................... */
930 WMList
*WMCreateList(WMWidget
*parent
);
932 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
934 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
936 WMListItem
*WMAddSortedListItem(WMList
*lPtr
, char *text
);
938 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
940 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
942 void WMRemoveListItem(WMList
*lPtr
, int row
);
944 void WMSelectListItem(WMList
*lPtr
, int row
);
946 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
948 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
950 int WMGetListItemHeight(WMList
*lPtr
);
952 /* don't free the returned data */
953 WMListItem
*WMGetListSelectedItem(WMList
*lPtr
);
955 int WMGetListSelectedItemRow(WMList
*lPtr
);
957 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
959 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
961 void WMClearList(WMList
*lPtr
);
963 int WMGetListNumberOfRows(WMList
*lPtr
);
965 void WMSetListPosition(WMList
*lPtr
, int row
);
967 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
969 int WMGetListPosition(WMList
*lPtr
);
971 extern char *WMListDidScrollNotification
;
972 extern char *WMListSelectionDidChangeNotification
;
974 /* ....................................................................... */
976 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
978 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
980 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
982 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
984 int WMAddBrowserColumn(WMBrowser
*bPtr
);
986 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
988 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
990 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
992 WMListItem
*WMAddSortedBrowserItem(WMBrowser
*bPtr
, int column
, char *text
, Bool isBranch
);
994 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
996 /* Don't free the returned string. */
997 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
999 /* you can free the returned string */
1000 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1001 /* you can free the returned string */
1002 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1004 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1006 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1009 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1011 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1013 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1015 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1017 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1019 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1021 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1023 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1025 /* ....................................................................... */
1027 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1029 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1032 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1034 void WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1036 void WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
, char *title
);
1038 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1040 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1042 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1044 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1046 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1048 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1050 /* don't free the returned data */
1051 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1053 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1055 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1057 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1059 /* ....................................................................... */
1061 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1063 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1065 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1067 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1069 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1071 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1073 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1076 /* ....................................................................... */
1078 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1080 void WMFreeColorPanel(WMColorPanel
*panel
);
1082 void WMShowColorPanel(WMColorPanel
*panel
);
1084 void WMCloseColorPanel(WMColorPanel
*panel
);
1086 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1088 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1090 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1092 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1094 extern char *WMColorPanelColorChangedNotification
;
1096 /* ....................................................................... */
1098 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1100 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1102 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1104 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1107 extern char *WMColorWellDidChangeNotification
;
1110 /* ...................................................................... */
1112 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1114 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1115 unsigned int height
);
1117 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1119 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1121 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1123 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1125 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1127 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1129 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1131 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1133 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1135 /* ....................................................................... */
1137 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1139 int WMGetSliderMinValue(WMSlider
*slider
);
1141 int WMGetSliderMaxValue(WMSlider
*slider
);
1143 int WMGetSliderValue(WMSlider
*slider
);
1145 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1147 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1149 void WMSetSliderValue(WMSlider
*slider
, int value
);
1151 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1153 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1155 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1157 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1159 /* ....................................................................... */
1161 /* only supports 2 subviews */
1162 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1164 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1166 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1168 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1169 WMSplitViewConstrainProc
*proc
);
1172 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1173 WMSplitViewResizeSubviewsProc *proc);
1176 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1179 /* ....................................................................... */
1182 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1184 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1186 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1188 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1190 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1192 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1194 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1196 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1198 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1200 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1202 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1204 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1206 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1208 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1211 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1213 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1215 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1217 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1219 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1221 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1223 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1225 /* ....................................................................... */
1227 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1228 char *defaultButton
, char *alternateButton
,
1231 /* you can free the returned string */
1232 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1233 char *defaultText
, char *okButton
, char *cancelButton
);
1235 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1236 char *msg
, char *defaultButton
,
1237 char *alternateButton
, char *otherButton
);
1239 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1240 char *msg
, char *defaultText
, char *okButton
,
1241 char *cancelButton
);
1243 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1245 void WMDestroyInputPanel(WMInputPanel
*panel
);
1247 /* ....................................................................... */
1249 /* only 1 instance per WMScreen */
1250 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1252 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1254 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1256 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1258 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1260 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1262 /* you can free the returned string */
1263 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1265 void WMFreeFilePanel(WMFilePanel
*panel
);
1267 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1268 char *path
, char *name
, char **fileTypes
);
1270 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1272 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1275 /* ...................................................................... */
1277 /* only 1 instance per WMScreen */
1278 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1280 void WMShowFontPanel(WMFontPanel
*panel
);
1282 void WMHideFontPanel(WMFontPanel
*panel
);
1284 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1286 /* you can free the returned string */
1287 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1289 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1293 #endif /* __cplusplus */