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 /* ....................................................................... */
460 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
462 void WMSetApplicationDataPath(char *path
);
464 /* don't free the returned string */
465 char *WMGetApplicationName();
467 /* Try to locate resource file. ext may be NULL */
468 char *WMPathForResourceOfType(char *resource
, char *ext
);
470 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
473 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
475 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
477 void WMScreenMainLoop(WMScreen
*scr
);
480 RContext
*WMScreenRContext(WMScreen
*scr
);
482 Display
*WMScreenDisplay(WMScreen
*scr
);
484 int WMScreenDepth(WMScreen
*scr
);
488 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
490 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
492 void WMSetFocusToWidget(WMWidget
*widget
);
494 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
496 int WMHandleEvent(XEvent
*event
);
498 Bool
WMScreenPending(WMScreen
*scr
);
500 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
501 WMEventProc
*eventProc
, void *clientData
);
503 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
504 WMEventProc
*eventProc
, void *clientData
);
506 int WMIsDoubleClick(XEvent
*event
);
508 void WMNextEvent(Display
*dpy
, XEvent
*event
);
510 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
512 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
515 void WMDeleteTimerWithClientData(void *cdata
);
517 void WMDeleteTimerHandler(WMHandlerID handlerID
);
519 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
521 void WMDeleteIdleHandler(WMHandlerID handlerID
);
523 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
526 void WMDeleteInputHandler(WMHandlerID handlerID
);
528 /* ....................................................................... */
530 void WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation,
531 WMSize mouseOffset, XEvent *event, Bool slideBack);
535 /* ....................................................................... */
537 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
539 WMFont
*WMCreateFontInDefaultEncoding(WMScreen
*scrPtr
, char *fontName
);
541 WMFont
*WMRetainFont(WMFont
*font
);
543 void WMReleaseFont(WMFont
*font
);
545 unsigned int WMFontHeight(WMFont
*font
);
548 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
550 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
553 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
555 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
557 XFontSet
WMGetFontFontSet(WMFont
*font
);
559 /* ....................................................................... */
561 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
563 void WMReleasePixmap(WMPixmap
*pixmap
);
565 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
568 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
569 Pixmap mask
, int width
, int height
,
572 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
575 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
577 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
579 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
581 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
584 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
586 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
588 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
590 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
592 /* ....................................................................... */
595 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
597 WMColor
*WMGrayColor(WMScreen
*scr
);
599 WMColor
*WMBlackColor(WMScreen
*scr
);
601 WMColor
*WMWhiteColor(WMScreen
*scr
);
603 void WMSetColorInGC(WMColor
*color
, GC gc
);
605 GC
WMColorGC(WMColor
*color
);
607 WMPixel
WMColorPixel(WMColor
*color
);
609 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
610 unsigned int width
, unsigned int height
);
612 void WMReleaseColor(WMColor
*color
);
614 WMColor
*WMRetainColor(WMColor
*color
);
616 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
617 unsigned short green
, unsigned short blue
,
620 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
622 unsigned short WMRedComponentOfColor(WMColor
*color
);
624 unsigned short WMGreenComponentOfColor(WMColor
*color
);
626 unsigned short WMBlueComponentOfColor(WMColor
*color
);
628 char *WMGetColorRGBDescription(WMColor
*color
);
630 /* ....................................................................... */
633 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
634 int y
, char *text
, int length
);
636 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
637 int y
, char *text
, int length
);
639 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
643 /* ....................................................................... */
645 WMScreen
*WMWidgetScreen(WMWidget
*w
);
647 void WMUnmapWidget(WMWidget
*w
);
649 void WMMapWidget(WMWidget
*w
);
651 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
653 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
655 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
657 void WMMapSubwidgets(WMWidget
*w
);
659 void WMUnmapSubwidgets(WMWidget
*w
);
661 void WMRealizeWidget(WMWidget
*w
);
663 void WMDestroyWidget(WMWidget
*widget
);
665 void WMHangData(WMWidget
*widget
, void *data
);
667 void *WMGetHangedData(WMWidget
*widget
);
669 unsigned int WMWidgetWidth(WMWidget
*w
);
671 unsigned int WMWidgetHeight(WMWidget
*w
);
673 Window
WMWidgetXID(WMWidget
*w
);
675 Window
WMViewXID(WMView
*view
);
677 void WMRedisplayWidget(WMWidget
*w
);
679 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
681 WMSize
WMGetViewSize(WMView
*view
);
683 WMPoint
WMGetViewPosition(WMView
*view
);
685 WMWidget
*WMWidgetOfView(WMView
*view
);
688 extern char *WMViewSizeDidChangeNotification
;
690 extern char *WMViewRealizedNotification
;
693 /* ....................................................................... */
695 void WMSetBalloonTextForView(char *text
, WMView
*view
);
697 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
699 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
701 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
703 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
705 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
708 /* ....................................................................... */
710 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
712 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
714 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
717 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
719 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
721 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
723 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
725 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
727 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
729 void WMSetWindowUPosition(WMWindow
*win
, int x
, int y
);
731 void WMSetWindowUSize(WMWindow
*win
, unsigned width
, unsigned height
);
733 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
735 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
737 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
739 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
741 void WMSetWindowLevel(WMWindow
*win
, int level
);
743 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
745 void WMCloseWindow(WMWindow
*win
);
747 /* ....................................................................... */
749 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
751 #define WMCreateCommandButton(parent) \
752 WMCreateCustomButton((parent), WBBSpringLoadedMask\
757 #define WMCreateRadioButton(parent) \
758 WMCreateButton((parent), WBTRadio)
760 #define WMCreateSwitchButton(parent) \
761 WMCreateButton((parent), WBTSwitch)
763 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
765 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
767 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
769 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
771 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
773 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
775 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
777 void WMSetButtonText(WMButton
*bPtr
, char *text
);
779 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
781 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
783 int WMGetButtonSelected(WMButton
*bPtr
);
785 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
787 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
789 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
791 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
793 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
795 void WMPerformButtonClick(WMButton
*bPtr
);
797 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
799 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
801 /* ....................................................................... */
803 WMLabel
*WMCreateLabel(WMWidget
*parent
);
805 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
807 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
809 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
811 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
813 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
815 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
817 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
819 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
821 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
823 /* ....................................................................... */
825 WMFrame
*WMCreateFrame(WMWidget
*parent
);
827 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
829 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
831 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
833 /* ....................................................................... */
835 WMTextField
*WMCreateTextField(WMWidget
*parent
);
837 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
839 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
841 /* you can free the returned string */
842 char *WMGetTextFieldText(WMTextField
*tPtr
);
844 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
846 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
848 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
850 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
852 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
854 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
856 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
858 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
860 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
862 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
864 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
867 extern char *WMTextDidChangeNotification
;
868 extern char *WMTextDidBeginEditingNotification
;
869 extern char *WMTextDidEndEditingNotification
;
871 /* ....................................................................... */
873 WMScroller
*WMCreateScroller(WMWidget
*parent
);
875 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
876 float knobProportion
);
878 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
880 float WMGetScrollerValue(WMScroller
*sPtr
);
882 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
884 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
886 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
887 WMScrollArrowPosition position
);
889 /* ....................................................................... */
891 WMList
*WMCreateList(WMWidget
*parent
);
893 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
895 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
897 WMListItem
*WMAddSortedListItem(WMList
*lPtr
, char *text
);
899 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
901 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
903 void WMRemoveListItem(WMList
*lPtr
, int row
);
905 void WMSelectListItem(WMList
*lPtr
, int row
);
907 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
909 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
911 int WMGetListItemHeight(WMList
*lPtr
);
913 /* don't free the returned data */
914 WMListItem
*WMGetListSelectedItem(WMList
*lPtr
);
916 int WMGetListSelectedItemRow(WMList
*lPtr
);
918 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
920 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
922 void WMClearList(WMList
*lPtr
);
924 int WMGetListNumberOfRows(WMList
*lPtr
);
926 void WMSetListPosition(WMList
*lPtr
, int row
);
928 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
930 int WMGetListPosition(WMList
*lPtr
);
932 extern char *WMListDidScrollNotification
;
933 extern char *WMListSelectionDidChangeNotification
;
935 /* ....................................................................... */
937 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
939 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
941 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
943 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
945 int WMAddBrowserColumn(WMBrowser
*bPtr
);
947 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
949 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
951 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
953 WMListItem
*WMAddSortedBrowserItem(WMBrowser
*bPtr
, int column
, char *text
, Bool isBranch
);
955 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
957 /* Don't free the returned string. */
958 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
960 /* you can free the returned string */
961 char *WMGetBrowserPath(WMBrowser
*bPtr
);
962 /* you can free the returned string */
963 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
965 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
967 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
970 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
972 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
974 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
976 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
978 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
980 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
982 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
984 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
986 /* ....................................................................... */
988 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
990 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
993 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
995 void WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
997 void WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
, char *title
);
999 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1001 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1003 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1005 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1007 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1009 /* don't free the returned data */
1010 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1012 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1014 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1016 /* ....................................................................... */
1018 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1020 void WMFreeColorPanel(WMColorPanel
*panel
);
1022 void WMShowColorPanel(WMColorPanel
*panel
);
1024 void WMCloseColorPanel(WMColorPanel
*panel
);
1026 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1028 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1030 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1032 extern char *WMColorPanelColorChangedNotification
;
1034 /* ....................................................................... */
1036 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1038 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1040 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1042 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1045 extern char *WMColorWellDidChangeNotification
;
1048 /* ...................................................................... */
1050 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1052 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1053 unsigned int height
);
1055 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1057 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1059 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1061 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1063 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1065 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1067 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1069 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1071 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1073 /* ....................................................................... */
1075 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1077 int WMGetSliderMinValue(WMSlider
*slider
);
1079 int WMGetSliderMaxValue(WMSlider
*slider
);
1081 int WMGetSliderValue(WMSlider
*slider
);
1083 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1085 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1087 void WMSetSliderValue(WMSlider
*slider
, int value
);
1089 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1091 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1093 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1095 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1097 /* ....................................................................... */
1099 /* only supports 2 subviews */
1100 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1102 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1104 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1106 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1107 WMSplitViewConstrainProc
*proc
);
1110 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1111 WMSplitViewResizeSubviewsProc *proc);
1114 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1117 /* ....................................................................... */
1120 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1122 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1124 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1126 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1128 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1130 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1132 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1134 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1136 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1138 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1140 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1142 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1144 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1148 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1150 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1152 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1154 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1156 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1158 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1160 /* ....................................................................... */
1162 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1163 char *defaultButton
, char *alternateButton
,
1166 /* you can free the returned string */
1167 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1168 char *defaultText
, char *okButton
, char *cancelButton
);
1170 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1171 char *msg
, char *defaultButton
,
1172 char *alternateButton
, char *otherButton
);
1174 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1175 char *msg
, char *defaultText
, char *okButton
,
1176 char *cancelButton
);
1178 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1180 void WMDestroyInputPanel(WMInputPanel
*panel
);
1182 /* ....................................................................... */
1184 /* only 1 instance per WMScreen */
1185 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1187 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1189 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1191 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1193 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1195 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1197 /* you can free the returned string */
1198 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1200 void WMFreeFilePanel(WMFilePanel
*panel
);
1202 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1203 char *path
, char *name
, char **fileTypes
);
1205 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1207 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1210 /* ...................................................................... */
1212 /* only 1 instance per WMScreen */
1213 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1215 void WMShowFontPanel(WMFontPanel
*panel
);
1217 void WMHideFontPanel(WMFontPanel
*panel
);
1219 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1221 /* you can free the returned string */
1222 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1224 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1228 #endif /* __cplusplus */