10 #define WINGS_H_VERSION 20000402
15 #endif /* __cplusplus */
21 typedef unsigned long WMPixel
;
40 /* WMRange was moved in WUtil.h */
42 #define ClientMessageMask (1L<<30)
45 /* window stacking level */
47 WMNormalWindowLevel
= 0,
48 WMFloatingWindowLevel
= 3,
49 WMDockWindowLevel
= 5,
50 WMSubmenuWindowLevel
= 10,
51 WMMainMenuWindowLevel
= 20
54 /* window attributes */
56 WMBorderlessWindowMask
= 0,
57 WMTitledWindowMask
= 1,
58 WMClosableWindowMask
= 2,
59 WMMiniaturizableWindowMask
= 4,
60 WMResizableWindowMask
= 8
66 /* 0 is reserved for internal use */
72 WBTMomentaryChange
= 6,
77 /* button behaviour masks */
79 WBBSpringLoadedMask
= (1 << 0),
80 WBBPushInMask
= (1 << 1),
81 WBBPushChangeMask
= (1 << 2),
82 WBBPushLightMask
= (1 << 3),
83 WBBStateLightMask
= (1 << 5),
84 WBBStateChangeMask
= (1 << 6),
85 WBBStatePushMask
= (1 << 7)
89 /* frame title positions */
113 /* alignment types */
118 WAJustified
/* not valid for textfields */
134 /* scroller arrow position */
139 } WMScrollArrowPosition
;
152 /* usable scroller parts */
157 } WMUsableScrollerParts
;
169 WTTopTabsBevelBorder
,
176 /* text movement types */
178 WMIllegalTextMovement
,
179 WMReturnTextMovement
,
180 WMEscapeTextMovement
,
182 WMBacktabTextMovement
,
189 /* text field special events */
196 /* drag operations */
204 } WMDragOperationType
;
208 WMGrayModeColorPanel
= 1,
209 WMRGBModeColorPanel
= 2,
210 WMCMYKModeColorPanel
= 3,
211 WMHSBModeColorPanel
= 4,
212 WMCustomPaletteModeColorPanel
= 5,
213 WMColorListModeColorPanel
= 6,
214 WMWheelModeColorPanel
= 7
220 #define WSIReturnArrow 1
221 #define WSIHighlightedReturnArrow 2
222 #define WSIScrollerDimple 3
223 #define WSIArrowLeft 4
224 #define WSIHighlightedArrowLeft 5
225 #define WSIArrowRight 6
226 #define WSIHighlightedArrowRight 7
228 #define WSIHighlightedArrowUp 9
229 #define WSIArrowDown 10
230 #define WSIHighlightedArrowDown 11
231 #define WSICheckMark 12
234 WLDSSelected
= (1 << 16),
235 WLDSDisabled
= (1 << 17),
236 WLDSFocused
= (1 << 18),
237 WLDSIsBranch
= (1 << 19)
240 /* alert panel return values */
250 /* types of input observers */
252 WIReadMask
= (1 << 0),
253 WIWriteMask
= (1 << 1),
254 WIExceptMask
= (1 << 2)
274 WC_Matrix
= 12, /* not ready */
277 WC_ProgressIndicator
= 15,
281 /* All widgets must start with the following structure
282 * in that order. Used for typecasting to get some generic data */
283 typedef struct W_WidgetType
{
290 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
291 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
296 typedef void WMWidget
;
298 typedef struct W_Pixmap WMPixmap
;
299 typedef struct W_Font WMFont
;
300 typedef struct W_Color WMColor
;
302 typedef struct W_Screen WMScreen
;
304 typedef struct W_View WMView
;
306 typedef struct W_Window WMWindow
;
307 typedef struct W_Frame WMFrame
;
308 typedef struct W_Button WMButton
;
309 typedef struct W_Label WMLabel
;
310 typedef struct W_TextField WMTextField
;
311 typedef struct W_Scroller WMScroller
;
312 typedef struct W_ScrollView WMScrollView
;
313 typedef struct W_List WMList
;
314 typedef struct W_Browser WMBrowser
;
315 typedef struct W_PopUpButton WMPopUpButton
;
316 typedef struct W_ProgressIndicator WMProgressIndicator
;
317 typedef struct W_ColorWell WMColorWell
;
318 typedef struct W_Slider WMSlider
;
319 typedef struct W_Matrix WMMatrix
; /* not ready */
320 typedef struct W_SplitView WMSplitView
;
321 typedef struct W_TabView WMTabView
;
324 typedef struct W_TabViewItem WMTabViewItem
;
325 typedef struct W_MenuItem WMMenuItem
;
328 typedef struct W_FilePanel WMFilePanel
;
329 typedef WMFilePanel WMOpenPanel
;
330 typedef WMFilePanel WMSavePanel
;
332 typedef struct W_FontPanel WMFontPanel
;
334 typedef struct W_ColorPanel WMColorPanel
;
337 /* item for WMList */
338 typedef struct WMListItem
{
340 void *clientData
; /* ptr for user clientdata. */
342 unsigned int uflags
:16; /* flags for the user */
343 unsigned int selected
:1;
344 unsigned int disabled
:1;
345 unsigned int isBranch
:1;
346 unsigned int loaded
:1;
349 /* struct for message panel */
350 typedef struct WMAlertPanel
{
351 WMWindow
*win
; /* window */
352 WMButton
*defBtn
; /* default button */
353 WMButton
*altBtn
; /* alternative button */
354 WMButton
*othBtn
; /* other button */
355 WMLabel
*iLbl
; /* icon label */
356 WMLabel
*tLbl
; /* title label */
357 WMLabel
*mLbl
; /* message label */
358 WMFrame
*line
; /* separator */
359 short result
; /* button that was pushed */
367 typedef struct WMInputPanel
{
368 WMWindow
*win
; /* window */
369 WMButton
*defBtn
; /* default button */
370 WMButton
*altBtn
; /* alternative button */
371 WMLabel
*tLbl
; /* title label */
372 WMLabel
*mLbl
; /* message label */
373 WMTextField
*text
; /* text field */
374 short result
; /* button that was pushed */
387 typedef void *WMHandlerID
;
389 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
391 typedef void WMEventProc(XEvent
*event
, void *clientData
);
393 typedef void WMEventHook(XEvent
*event
);
395 /* self is set to the widget from where the callback is being called and
396 * clientData to the data set to with WMSetClientData() */
397 typedef void WMAction(WMWidget
*self
, void *clientData
);
399 /* same as WMAction, but for stuff that arent widgets */
400 typedef void WMAction2(void *self
, void *clientData
);
403 typedef void WMCallback(void *data
);
405 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
407 /* delegate method like stuff */
408 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
409 int state
, WMRect
*rect
);
412 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
413 unsigned int oldWidth,
414 unsigned int oldHeight);
417 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
418 int *minSize
, int *maxSize
);
420 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
425 typedef struct WMBrowserDelegate
{
428 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
429 WMBrowser
*sender
, int column
, WMList
*list
);
431 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
434 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
436 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
440 typedef struct WMTextFieldDelegate
{
443 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
444 WMNotification
*notif
);
446 void (*didChange
)(struct WMTextFieldDelegate
*self
,
447 WMNotification
*notif
);
449 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
450 WMNotification
*notif
);
452 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
455 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
457 } WMTextFieldDelegate
;
461 typedef struct WMTabViewDelegate
{
464 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
467 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
468 WMTabViewItem
*item
);
470 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
471 WMTabViewItem
*item
);
473 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
474 WMTabViewItem
*item
);
480 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
481 Time timestamp
, void *cdata
, WMData
*data
);
484 typedef struct WMSelectionProcs
{
485 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
486 void *cdata
, Atom
*type
);
487 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
488 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
495 typedef struct W_DraggingInfo WMDraggingInfo
;
498 typedef struct W_DragSourceProcs
{
499 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
500 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
501 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
503 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
504 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
509 typedef struct W_DragDestinationProcs
{
510 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
511 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
512 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
513 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
514 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
515 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
516 } WMDragDestinationProcs
;
520 /* ...................................................................... */
523 WMRange
wmkrange(int start
, int count
);
525 WMPoint
wmkpoint(int x
, int y
);
527 WMSize
wmksize(unsigned int width
, unsigned int height
);
530 /* ....................................................................... */
534 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
536 void WMSetResourcePath(char *path
);
538 /* don't free the returned string */
539 char *WMGetApplicationName();
541 /* Try to locate resource file. ext may be NULL */
542 char *WMPathForResourceOfType(char *resource
, char *ext
);
544 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
547 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
549 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
551 void WMScreenMainLoop(WMScreen
*scr
);
554 RContext
*WMScreenRContext(WMScreen
*scr
);
556 Display
*WMScreenDisplay(WMScreen
*scr
);
558 int WMScreenDepth(WMScreen
*scr
);
562 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
564 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
566 void WMSetFocusToWidget(WMWidget
*widget
);
568 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
570 int WMHandleEvent(XEvent
*event
);
572 Bool
WMScreenPending(WMScreen
*scr
);
574 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
575 WMEventProc
*eventProc
, void *clientData
);
577 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
578 WMEventProc
*eventProc
, void *clientData
);
580 int WMIsDoubleClick(XEvent
*event
);
582 void WMNextEvent(Display
*dpy
, XEvent
*event
);
584 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
586 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
589 void WMDeleteTimerWithClientData(void *cdata
);
591 void WMDeleteTimerHandler(WMHandlerID handlerID
);
593 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
595 void WMDeleteIdleHandler(WMHandlerID handlerID
);
597 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
600 void WMDeleteInputHandler(WMHandlerID handlerID
);
604 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
605 WMSelectionProcs
*procs
, void *cdata
);
607 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
609 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
610 Time timestamp
, WMSelectionCallback
*callback
,
614 /* ....................................................................... */
616 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
618 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
619 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
622 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
624 void WMUnregisterViewDraggedTypes(WMView
*view
);
626 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
629 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
631 /* ....................................................................... */
633 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
635 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
637 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
639 WMFont
*WMRetainFont(WMFont
*font
);
641 void WMReleaseFont(WMFont
*font
);
643 unsigned int WMFontHeight(WMFont
*font
);
646 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
648 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
651 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
653 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
655 XFontSet
WMGetFontFontSet(WMFont
*font
);
657 /* ....................................................................... */
659 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
661 void WMReleasePixmap(WMPixmap
*pixmap
);
663 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
666 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
667 Pixmap mask
, int width
, int height
,
670 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
673 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
675 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
677 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
679 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
682 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
684 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
686 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
688 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
690 /* ....................................................................... */
693 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
695 WMColor
*WMGrayColor(WMScreen
*scr
);
697 WMColor
*WMBlackColor(WMScreen
*scr
);
699 WMColor
*WMWhiteColor(WMScreen
*scr
);
701 void WMSetColorInGC(WMColor
*color
, GC gc
);
703 GC
WMColorGC(WMColor
*color
);
705 WMPixel
WMColorPixel(WMColor
*color
);
707 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
708 unsigned int width
, unsigned int height
);
710 void WMReleaseColor(WMColor
*color
);
712 WMColor
*WMRetainColor(WMColor
*color
);
714 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
715 unsigned short green
, unsigned short blue
,
718 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
720 unsigned short WMRedComponentOfColor(WMColor
*color
);
722 unsigned short WMGreenComponentOfColor(WMColor
*color
);
724 unsigned short WMBlueComponentOfColor(WMColor
*color
);
726 char *WMGetColorRGBDescription(WMColor
*color
);
728 /* ....................................................................... */
731 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
732 int y
, char *text
, int length
);
734 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
735 int y
, char *text
, int length
);
737 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
741 /* ....................................................................... */
743 WMScreen
*WMWidgetScreen(WMWidget
*w
);
745 unsigned int WMScreenWidth(WMScreen
*scr
);
747 unsigned int WMScreenHeight(WMScreen
*scr
);
749 void WMUnmapWidget(WMWidget
*w
);
751 void WMMapWidget(WMWidget
*w
);
753 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
755 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
757 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
759 void WMMapSubwidgets(WMWidget
*w
);
761 void WMUnmapSubwidgets(WMWidget
*w
);
763 void WMRealizeWidget(WMWidget
*w
);
765 void WMDestroyWidget(WMWidget
*widget
);
767 void WMHangData(WMWidget
*widget
, void *data
);
769 void *WMGetHangedData(WMWidget
*widget
);
771 unsigned int WMWidgetWidth(WMWidget
*w
);
773 unsigned int WMWidgetHeight(WMWidget
*w
);
775 Window
WMWidgetXID(WMWidget
*w
);
777 Window
WMViewXID(WMView
*view
);
779 void WMRedisplayWidget(WMWidget
*w
);
781 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
783 WMSize
WMGetViewSize(WMView
*view
);
785 WMPoint
WMGetViewPosition(WMView
*view
);
787 WMPoint
WMGetViewScreenPosition(WMView
*view
);
789 WMWidget
*WMWidgetOfView(WMView
*view
);
792 extern char *WMViewSizeDidChangeNotification
;
794 extern char *WMViewRealizedNotification
;
797 /* ....................................................................... */
799 void WMSetBalloonTextForView(char *text
, WMView
*view
);
801 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
803 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
805 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
807 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
809 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
812 /* ....................................................................... */
814 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
816 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
818 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
821 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
823 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
825 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
827 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
829 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
831 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
833 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
835 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
838 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
840 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
842 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
844 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
846 void WMSetWindowLevel(WMWindow
*win
, int level
);
848 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
850 void WMCloseWindow(WMWindow
*win
);
852 /* ....................................................................... */
854 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
856 #define WMCreateCommandButton(parent) \
857 WMCreateCustomButton((parent), WBBSpringLoadedMask\
862 #define WMCreateRadioButton(parent) \
863 WMCreateButton((parent), WBTRadio)
865 #define WMCreateSwitchButton(parent) \
866 WMCreateButton((parent), WBTSwitch)
868 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
870 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
872 void WMSetButtonImageDefault(WMButton
*bPtr
);
874 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
876 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
878 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
880 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
882 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
884 void WMSetButtonText(WMButton
*bPtr
, char *text
);
886 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
888 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
890 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
892 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
894 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
896 int WMGetButtonSelected(WMButton
*bPtr
);
898 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
900 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
902 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
904 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
906 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
908 void WMPerformButtonClick(WMButton
*bPtr
);
910 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
912 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
914 /* ....................................................................... */
916 WMLabel
*WMCreateLabel(WMWidget
*parent
);
918 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
920 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
922 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
924 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
926 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
928 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
930 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
932 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
934 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
936 /* ....................................................................... */
938 WMFrame
*WMCreateFrame(WMWidget
*parent
);
940 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
942 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
944 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
946 /* ....................................................................... */
948 WMTextField
*WMCreateTextField(WMWidget
*parent
);
950 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
952 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
954 /* you can free the returned string */
955 char *WMGetTextFieldText(WMTextField
*tPtr
);
957 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
959 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
961 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
963 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
965 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
967 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
969 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
971 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
973 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
975 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
977 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
979 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
981 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
983 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
986 extern char *WMTextDidChangeNotification
;
987 extern char *WMTextDidBeginEditingNotification
;
988 extern char *WMTextDidEndEditingNotification
;
990 /* ....................................................................... */
992 WMScroller
*WMCreateScroller(WMWidget
*parent
);
994 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
995 float knobProportion
);
997 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
999 float WMGetScrollerValue(WMScroller
*sPtr
);
1001 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1003 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1005 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1006 WMScrollArrowPosition position
);
1008 /* ....................................................................... */
1010 WMList
*WMCreateList(WMWidget
*parent
);
1012 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1014 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1016 void WMSortListItems(WMList
*lPtr
);
1018 void WMSortListItemsWithComparer(WMList
*lPtr
,
1019 int (f
)(const void*, const void*));
1021 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1023 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
1025 WMBag
*WMGetListItems(WMList
*lPtr
);
1028 void WMRemoveListItem(WMList
*lPtr
, int row
);
1030 void WMSelectListItem(WMList
*lPtr
, int row
);
1032 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1034 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1036 int WMGetListItemHeight(WMList
*lPtr
);
1038 /* don't free the returned data */
1039 WMListItem
*WMGetListSelectedItem(WMList
*lPtr
);
1041 int WMGetListSelectedItemRow(WMList
*lPtr
);
1043 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1045 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1047 void WMClearList(WMList
*lPtr
);
1049 int WMGetListNumberOfRows(WMList
*lPtr
);
1051 void WMSetListPosition(WMList
*lPtr
, int row
);
1053 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1055 int WMGetListPosition(WMList
*lPtr
);
1057 extern char *WMListDidScrollNotification
;
1058 extern char *WMListSelectionDidChangeNotification
;
1060 /* ....................................................................... */
1062 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1064 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1066 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1068 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1070 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1072 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1074 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1076 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1078 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1080 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1082 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1083 int (f
)(const void*, const void*));
1085 /* Don't free the returned string. */
1086 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1088 /* you can free the returned string */
1089 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1090 /* you can free the returned string */
1091 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1093 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1095 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1098 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1100 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1102 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1104 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1106 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1108 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1110 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1112 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1114 /* ....................................................................... */
1117 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1119 WMMenuItem
*WMCreateMenuItem(void);
1121 void WMDestroyMenuItem(WMMenuItem
*item
);
1123 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1125 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1127 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1129 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1131 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1133 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1135 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1137 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1139 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1141 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1143 void *WMGetMenuItemData(WMMenuItem
*item
);
1145 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1147 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1149 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1151 int WMGetMenuItemState(WMMenuItem
*item
);
1153 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1155 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1157 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1159 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1161 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1163 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1165 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1167 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1169 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1172 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1174 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1177 /* ....................................................................... */
1179 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1181 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1184 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1186 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1188 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1191 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1193 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1195 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1197 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1199 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1201 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1203 /* don't free the returned data */
1204 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1206 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1209 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1211 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1213 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1215 /* ....................................................................... */
1217 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1219 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1221 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1223 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1225 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1227 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1229 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1232 /* ....................................................................... */
1234 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1236 void WMFreeColorPanel(WMColorPanel
*panel
);
1238 void WMShowColorPanel(WMColorPanel
*panel
);
1240 void WMCloseColorPanel(WMColorPanel
*panel
);
1242 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1244 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1246 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1248 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1250 extern char *WMColorPanelColorChangedNotification
;
1252 /* ....................................................................... */
1254 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1256 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1258 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1260 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1263 extern char *WMColorWellDidChangeNotification
;
1266 /* ...................................................................... */
1268 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1270 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1271 unsigned int height
);
1273 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1275 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1277 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1279 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1281 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1283 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1285 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1287 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1289 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1291 /* ....................................................................... */
1293 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1295 int WMGetSliderMinValue(WMSlider
*slider
);
1297 int WMGetSliderMaxValue(WMSlider
*slider
);
1299 int WMGetSliderValue(WMSlider
*slider
);
1301 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1303 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1305 void WMSetSliderValue(WMSlider
*slider
, int value
);
1307 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1309 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1311 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1313 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1315 /* ....................................................................... */
1318 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1319 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1320 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1322 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1324 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1326 /* remove the first subview == view */
1327 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1329 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1332 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1334 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1336 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1337 WMSplitViewConstrainProc
*proc
);
1340 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1341 WMSplitViewResizeSubviewsProc *proc);
1344 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1347 /* ....................................................................... */
1350 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1352 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1354 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1356 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1358 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1360 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1362 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1364 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1366 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1368 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1370 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1372 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1374 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1376 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1379 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1381 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1383 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1385 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1387 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1389 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1391 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1393 /* ....................................................................... */
1395 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1396 char *defaultButton
, char *alternateButton
,
1399 /* you can free the returned string */
1400 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1401 char *defaultText
, char *okButton
, char *cancelButton
);
1403 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1404 char *msg
, char *defaultButton
,
1405 char *alternateButton
, char *otherButton
);
1407 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1408 char *msg
, char *defaultText
, char *okButton
,
1409 char *cancelButton
);
1411 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1413 void WMDestroyInputPanel(WMInputPanel
*panel
);
1415 /* ....................................................................... */
1417 /* only 1 instance per WMScreen */
1418 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1420 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1422 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1424 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1426 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1428 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1430 /* you can free the returned string */
1431 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1433 void WMFreeFilePanel(WMFilePanel
*panel
);
1435 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1436 char *path
, char *name
, char **fileTypes
);
1438 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1440 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1443 /* ...................................................................... */
1445 /* only 1 instance per WMScreen */
1446 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1448 void WMShowFontPanel(WMFontPanel
*panel
);
1450 void WMHideFontPanel(WMFontPanel
*panel
);
1452 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1454 /* you can free the returned string */
1455 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1457 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1461 #endif /* __cplusplus */