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 */
269 /* All widgets must start with the following structure
270 * in that order. Used for typecasting to get some generic data */
271 typedef struct W_WidgetType
{
278 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
279 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
284 typedef void WMWidget
;
286 typedef struct W_Pixmap WMPixmap
;
287 typedef struct W_Font WMFont
;
288 typedef struct W_Color WMColor
;
290 typedef struct W_Screen WMScreen
;
292 typedef struct W_View WMView
;
294 typedef struct W_Window WMWindow
;
295 typedef struct W_Frame WMFrame
;
296 typedef struct W_Button WMButton
;
297 typedef struct W_Label WMLabel
;
298 typedef struct W_TextField WMTextField
;
299 typedef struct W_Scroller WMScroller
;
300 typedef struct W_ScrollView WMScrollView
;
301 typedef struct W_List WMList
;
302 typedef struct W_Browser WMBrowser
;
303 typedef struct W_PopUpButton WMPopUpButton
;
304 typedef struct W_ColorWell WMColorWell
;
305 typedef struct W_Slider WMSlider
;
306 typedef struct W_Matrix WMMatrix
; /* not ready */
307 typedef struct W_SplitView WMSplitView
;
308 typedef struct W_TabView WMTabView
;
311 typedef struct W_TabViewItem WMTabViewItem
;
314 typedef struct W_FilePanel WMFilePanel
;
315 typedef WMFilePanel WMOpenPanel
;
316 typedef WMFilePanel WMSavePanel
;
318 typedef struct W_FontPanel WMFontPanel
;
320 typedef struct W_ColorPanel WMColorPanel
;
323 /* item for WMList */
324 typedef struct WMListItem
{
326 void *clientData
; /* ptr for user clientdata. */
328 struct WMListItem
*nextPtr
;
330 unsigned int uflags
:16; /* flags for the user */
331 unsigned int selected
:1;
332 unsigned int disabled
:1;
333 unsigned int isBranch
:1;
334 unsigned int loaded
:1;
337 /* struct for message panel */
338 typedef struct WMAlertPanel
{
339 WMWindow
*win
; /* window */
340 WMButton
*defBtn
; /* default button */
341 WMButton
*altBtn
; /* alternative button */
342 WMButton
*othBtn
; /* other button */
343 WMLabel
*iLbl
; /* icon label */
344 WMLabel
*tLbl
; /* title label */
345 WMLabel
*mLbl
; /* message label */
346 WMFrame
*line
; /* separator */
347 short result
; /* button that was pushed */
354 typedef struct WMInputPanel
{
355 WMWindow
*win
; /* window */
356 WMButton
*defBtn
; /* default button */
357 WMButton
*altBtn
; /* alternative button */
358 WMLabel
*tLbl
; /* title label */
359 WMLabel
*mLbl
; /* message label */
360 WMTextField
*text
; /* text field */
361 short result
; /* button that was pushed */
373 typedef void *WMHandlerID
;
375 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
377 typedef void WMEventProc(XEvent
*event
, void *clientData
);
379 typedef void WMEventHook(XEvent
*event
);
381 /* self is set to the widget from where the callback is being called and
382 * clientData to the data set to with WMSetClientData() */
383 typedef void WMAction(WMWidget
*self
, void *clientData
);
385 /* same as WMAction, but for stuff that arent widgets */
386 typedef void WMAction2(void *self
, void *clientData
);
388 typedef void WMCallback(void *data
);
391 /* delegate method like stuff */
392 typedef void WMFreeDataProc(void *data
);
394 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
395 int state
, WMRect
*rect
);
398 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
399 unsigned int oldWidth,
400 unsigned int oldHeight);
403 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
404 int *minCoordinate
, int *maxCoordinate
);
406 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
409 typedef Bool
WMConvertSelectionProc(WMWidget
*w
, Atom selection
, Atom target
,
410 Atom
*type
, void **value
, unsigned *length
,
413 typedef void WMLoseSelectionProc(WMWidget
*w
, Atom selection
);
415 typedef void WMSelectionDoneProc(WMWidget
*w
, Atom selection
, Atom target
);
420 typedef struct WMBrowserDelegate
{
423 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
424 WMBrowser
*sender
, int column
, WMList
*list
);
426 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
429 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
431 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
435 typedef struct WMTextFieldDelegate
{
438 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
439 WMNotification
*notif
);
441 void (*didChange
)(struct WMTextFieldDelegate
*self
,
442 WMNotification
*notif
);
444 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
445 WMNotification
*notif
);
447 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
450 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
452 } WMTextFieldDelegate
;
456 typedef struct WMTabViewDelegate
{
459 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
462 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
463 WMTabViewItem
*item
);
465 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
466 WMTabViewItem
*item
);
468 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
469 WMTabViewItem
*item
);
474 /* ....................................................................... */
478 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
480 void WMSetApplicationDataPath(char *path
);
482 /* don't free the returned string */
483 char *WMGetApplicationName();
485 /* Try to locate resource file. ext may be NULL */
486 char *WMPathForResourceOfType(char *resource
, char *ext
);
488 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
491 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
493 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
495 void WMScreenMainLoop(WMScreen
*scr
);
498 RContext
*WMScreenRContext(WMScreen
*scr
);
500 Display
*WMScreenDisplay(WMScreen
*scr
);
502 int WMScreenDepth(WMScreen
*scr
);
506 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
508 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
510 void WMSetFocusToWidget(WMWidget
*widget
);
512 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
514 int WMHandleEvent(XEvent
*event
);
516 Bool
WMScreenPending(WMScreen
*scr
);
518 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
519 WMEventProc
*eventProc
, void *clientData
);
521 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
522 WMEventProc
*eventProc
, void *clientData
);
524 int WMIsDoubleClick(XEvent
*event
);
526 void WMNextEvent(Display
*dpy
, XEvent
*event
);
528 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
530 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
533 void WMDeleteTimerWithClientData(void *cdata
);
535 void WMDeleteTimerHandler(WMHandlerID handlerID
);
537 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
539 void WMDeleteIdleHandler(WMHandlerID handlerID
);
541 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
544 void WMDeleteInputHandler(WMHandlerID handlerID
);
546 /* ....................................................................... */
548 void WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation,
549 WMSize mouseOffset, XEvent *event, Bool slideBack);
553 /* ....................................................................... */
555 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
557 WMFont
*WMCreateFontInDefaultEncoding(WMScreen
*scrPtr
, char *fontName
);
559 WMFont
*WMRetainFont(WMFont
*font
);
561 void WMReleaseFont(WMFont
*font
);
563 unsigned int WMFontHeight(WMFont
*font
);
566 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
568 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
571 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
573 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
575 XFontSet
WMGetFontFontSet(WMFont
*font
);
577 /* ....................................................................... */
579 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
581 void WMReleasePixmap(WMPixmap
*pixmap
);
583 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
586 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
587 Pixmap mask
, int width
, int height
,
590 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
593 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
595 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
597 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
599 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
602 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
604 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
606 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
608 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
610 /* ....................................................................... */
613 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
615 WMColor
*WMGrayColor(WMScreen
*scr
);
617 WMColor
*WMBlackColor(WMScreen
*scr
);
619 WMColor
*WMWhiteColor(WMScreen
*scr
);
621 void WMSetColorInGC(WMColor
*color
, GC gc
);
623 GC
WMColorGC(WMColor
*color
);
625 WMPixel
WMColorPixel(WMColor
*color
);
627 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
628 unsigned int width
, unsigned int height
);
630 void WMReleaseColor(WMColor
*color
);
632 WMColor
*WMRetainColor(WMColor
*color
);
634 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
635 unsigned short green
, unsigned short blue
,
638 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
640 unsigned short WMRedComponentOfColor(WMColor
*color
);
642 unsigned short WMGreenComponentOfColor(WMColor
*color
);
644 unsigned short WMBlueComponentOfColor(WMColor
*color
);
646 char *WMGetColorRGBDescription(WMColor
*color
);
648 /* ....................................................................... */
651 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
652 int y
, char *text
, int length
);
654 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
655 int y
, char *text
, int length
);
657 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
661 /* ....................................................................... */
663 WMScreen
*WMWidgetScreen(WMWidget
*w
);
665 void WMUnmapWidget(WMWidget
*w
);
667 void WMMapWidget(WMWidget
*w
);
669 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
671 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
673 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
675 void WMMapSubwidgets(WMWidget
*w
);
677 void WMUnmapSubwidgets(WMWidget
*w
);
679 void WMRealizeWidget(WMWidget
*w
);
681 void WMDestroyWidget(WMWidget
*widget
);
683 void WMHangData(WMWidget
*widget
, void *data
);
685 void *WMGetHangedData(WMWidget
*widget
);
687 unsigned int WMWidgetWidth(WMWidget
*w
);
689 unsigned int WMWidgetHeight(WMWidget
*w
);
691 Window
WMWidgetXID(WMWidget
*w
);
693 Window
WMViewXID(WMView
*view
);
695 void WMRedisplayWidget(WMWidget
*w
);
697 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
699 WMSize
WMGetViewSize(WMView
*view
);
701 WMPoint
WMGetViewPosition(WMView
*view
);
703 WMWidget
*WMWidgetOfView(WMView
*view
);
706 extern char *WMViewSizeDidChangeNotification
;
708 extern char *WMViewRealizedNotification
;
711 /* ....................................................................... */
713 void WMSetBalloonTextForView(char *text
, WMView
*view
);
715 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
717 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
719 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
721 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
723 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
726 /* ....................................................................... */
728 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
730 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
732 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
735 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
737 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
739 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
741 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
743 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
745 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
747 void WMSetWindowUPosition(WMWindow
*win
, int x
, int y
);
749 void WMSetWindowUSize(WMWindow
*win
, unsigned width
, unsigned height
);
751 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
753 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
755 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
757 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
759 void WMSetWindowLevel(WMWindow
*win
, int level
);
761 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
763 void WMCloseWindow(WMWindow
*win
);
765 /* ....................................................................... */
767 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
769 #define WMCreateCommandButton(parent) \
770 WMCreateCustomButton((parent), WBBSpringLoadedMask\
775 #define WMCreateRadioButton(parent) \
776 WMCreateButton((parent), WBTRadio)
778 #define WMCreateSwitchButton(parent) \
779 WMCreateButton((parent), WBTSwitch)
781 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
783 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
785 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
787 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
789 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
791 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
793 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
795 void WMSetButtonText(WMButton
*bPtr
, char *text
);
797 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
799 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
801 int WMGetButtonSelected(WMButton
*bPtr
);
803 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
805 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
807 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
809 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
811 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
813 void WMPerformButtonClick(WMButton
*bPtr
);
815 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
817 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
819 /* ....................................................................... */
821 WMLabel
*WMCreateLabel(WMWidget
*parent
);
823 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
825 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
827 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
829 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
831 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
833 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
835 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
837 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
839 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
841 /* ....................................................................... */
843 WMFrame
*WMCreateFrame(WMWidget
*parent
);
845 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
847 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
849 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
851 /* ....................................................................... */
853 WMTextField
*WMCreateTextField(WMWidget
*parent
);
855 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
857 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
859 /* you can free the returned string */
860 char *WMGetTextFieldText(WMTextField
*tPtr
);
862 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
864 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
866 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
868 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
870 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
872 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
874 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
876 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
878 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
880 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
882 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
884 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
887 extern char *WMTextDidChangeNotification
;
888 extern char *WMTextDidBeginEditingNotification
;
889 extern char *WMTextDidEndEditingNotification
;
891 /* ....................................................................... */
893 WMScroller
*WMCreateScroller(WMWidget
*parent
);
895 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
896 float knobProportion
);
898 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
900 float WMGetScrollerValue(WMScroller
*sPtr
);
902 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
904 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
906 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
907 WMScrollArrowPosition position
);
909 /* ....................................................................... */
911 WMList
*WMCreateList(WMWidget
*parent
);
913 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
915 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
917 WMListItem
*WMAddSortedListItem(WMList
*lPtr
, char *text
);
919 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
921 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
923 void WMRemoveListItem(WMList
*lPtr
, int row
);
925 void WMSelectListItem(WMList
*lPtr
, int row
);
927 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
929 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
931 int WMGetListItemHeight(WMList
*lPtr
);
933 /* don't free the returned data */
934 WMListItem
*WMGetListSelectedItem(WMList
*lPtr
);
936 int WMGetListSelectedItemRow(WMList
*lPtr
);
938 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
940 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
942 void WMClearList(WMList
*lPtr
);
944 int WMGetListNumberOfRows(WMList
*lPtr
);
946 void WMSetListPosition(WMList
*lPtr
, int row
);
948 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
950 int WMGetListPosition(WMList
*lPtr
);
952 extern char *WMListDidScrollNotification
;
953 extern char *WMListSelectionDidChangeNotification
;
955 /* ....................................................................... */
957 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
959 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
961 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
963 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
965 int WMAddBrowserColumn(WMBrowser
*bPtr
);
967 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
969 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
971 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
973 WMListItem
*WMAddSortedBrowserItem(WMBrowser
*bPtr
, int column
, char *text
, Bool isBranch
);
975 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
977 /* Don't free the returned string. */
978 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
980 /* you can free the returned string */
981 char *WMGetBrowserPath(WMBrowser
*bPtr
);
982 /* you can free the returned string */
983 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
985 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
987 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
990 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
992 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
994 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
996 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
998 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1000 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1002 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1004 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1006 /* ....................................................................... */
1008 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1010 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1013 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1015 void WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1017 void WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
, char *title
);
1019 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1021 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1023 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1025 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1027 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1029 /* don't free the returned data */
1030 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1032 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1034 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1036 /* ....................................................................... */
1038 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1040 void WMFreeColorPanel(WMColorPanel
*panel
);
1042 void WMShowColorPanel(WMColorPanel
*panel
);
1044 void WMCloseColorPanel(WMColorPanel
*panel
);
1046 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1048 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1050 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1052 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1054 extern char *WMColorPanelColorChangedNotification
;
1056 /* ....................................................................... */
1058 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1060 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1062 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1064 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1067 extern char *WMColorWellDidChangeNotification
;
1070 /* ...................................................................... */
1072 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1074 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1075 unsigned int height
);
1077 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1079 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1081 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1083 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1085 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1087 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1089 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1091 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1093 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1095 /* ....................................................................... */
1097 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1099 int WMGetSliderMinValue(WMSlider
*slider
);
1101 int WMGetSliderMaxValue(WMSlider
*slider
);
1103 int WMGetSliderValue(WMSlider
*slider
);
1105 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1107 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1109 void WMSetSliderValue(WMSlider
*slider
, int value
);
1111 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1113 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1115 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1117 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1119 /* ....................................................................... */
1121 /* only supports 2 subviews */
1122 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1124 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1126 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1128 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1129 WMSplitViewConstrainProc
*proc
);
1132 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1133 WMSplitViewResizeSubviewsProc *proc);
1136 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1139 /* ....................................................................... */
1142 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1144 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1146 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1148 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1150 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1152 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1154 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1156 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1158 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1160 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1162 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1164 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1166 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1168 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1171 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1173 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1175 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1177 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1179 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1181 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1183 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1185 /* ....................................................................... */
1187 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1188 char *defaultButton
, char *alternateButton
,
1191 /* you can free the returned string */
1192 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1193 char *defaultText
, char *okButton
, char *cancelButton
);
1195 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1196 char *msg
, char *defaultButton
,
1197 char *alternateButton
, char *otherButton
);
1199 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1200 char *msg
, char *defaultText
, char *okButton
,
1201 char *cancelButton
);
1203 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1205 void WMDestroyInputPanel(WMInputPanel
*panel
);
1207 /* ....................................................................... */
1209 /* only 1 instance per WMScreen */
1210 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1212 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1214 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1216 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1218 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1220 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1222 /* you can free the returned string */
1223 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1225 void WMFreeFilePanel(WMFilePanel
*panel
);
1227 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1228 char *path
, char *name
, char **fileTypes
);
1230 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1232 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1235 /* ...................................................................... */
1237 /* only 1 instance per WMScreen */
1238 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1240 void WMShowFontPanel(WMFontPanel
*panel
);
1242 void WMHideFontPanel(WMFontPanel
*panel
);
1244 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1246 /* you can free the returned string */
1247 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1249 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1253 #endif /* __cplusplus */