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
);
406 /* delegate method like stuff */
407 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
408 int state
, WMRect
*rect
);
411 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
412 unsigned int oldWidth,
413 unsigned int oldHeight);
416 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
417 int *minSize
, int *maxSize
);
419 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
424 typedef struct WMBrowserDelegate
{
427 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
428 WMBrowser
*sender
, int column
, WMList
*list
);
430 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
433 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
435 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
439 typedef struct WMTextFieldDelegate
{
442 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
443 WMNotification
*notif
);
445 void (*didChange
)(struct WMTextFieldDelegate
*self
,
446 WMNotification
*notif
);
448 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
449 WMNotification
*notif
);
451 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
454 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
456 } WMTextFieldDelegate
;
460 typedef struct WMTabViewDelegate
{
463 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
466 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
467 WMTabViewItem
*item
);
469 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
470 WMTabViewItem
*item
);
472 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
473 WMTabViewItem
*item
);
479 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
480 Time timestamp
, void *cdata
, WMData
*data
);
483 typedef struct WMSelectionProcs
{
484 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
485 void *cdata
, Atom
*type
);
486 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
487 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
494 typedef struct W_DraggingInfo WMDraggingInfo
;
497 typedef struct W_DragSourceProcs
{
498 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
499 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
500 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
502 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
503 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
508 typedef struct W_DragDestinationProcs
{
509 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
510 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
511 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
512 char *(*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
513 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 WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation,
617 WMSize mouseOffset, XEvent *event, Bool slideBack);
621 /* ....................................................................... */
623 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
625 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
627 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
629 WMFont
*WMRetainFont(WMFont
*font
);
631 void WMReleaseFont(WMFont
*font
);
633 unsigned int WMFontHeight(WMFont
*font
);
636 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
638 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
641 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
643 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
645 XFontSet
WMGetFontFontSet(WMFont
*font
);
647 /* ....................................................................... */
649 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
651 void WMReleasePixmap(WMPixmap
*pixmap
);
653 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
656 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
657 Pixmap mask
, int width
, int height
,
660 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
663 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
665 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
667 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
669 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
672 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
674 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
676 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
678 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
680 /* ....................................................................... */
683 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
685 WMColor
*WMGrayColor(WMScreen
*scr
);
687 WMColor
*WMBlackColor(WMScreen
*scr
);
689 WMColor
*WMWhiteColor(WMScreen
*scr
);
691 void WMSetColorInGC(WMColor
*color
, GC gc
);
693 GC
WMColorGC(WMColor
*color
);
695 WMPixel
WMColorPixel(WMColor
*color
);
697 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
698 unsigned int width
, unsigned int height
);
700 void WMReleaseColor(WMColor
*color
);
702 WMColor
*WMRetainColor(WMColor
*color
);
704 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
705 unsigned short green
, unsigned short blue
,
708 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
710 unsigned short WMRedComponentOfColor(WMColor
*color
);
712 unsigned short WMGreenComponentOfColor(WMColor
*color
);
714 unsigned short WMBlueComponentOfColor(WMColor
*color
);
716 char *WMGetColorRGBDescription(WMColor
*color
);
718 /* ....................................................................... */
721 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
722 int y
, char *text
, int length
);
724 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
725 int y
, char *text
, int length
);
727 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
731 /* ....................................................................... */
733 WMScreen
*WMWidgetScreen(WMWidget
*w
);
735 unsigned int WMScreenWidth(WMScreen
*scr
);
737 unsigned int WMScreenHeight(WMScreen
*scr
);
739 void WMUnmapWidget(WMWidget
*w
);
741 void WMMapWidget(WMWidget
*w
);
743 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
745 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
747 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
749 void WMMapSubwidgets(WMWidget
*w
);
751 void WMUnmapSubwidgets(WMWidget
*w
);
753 void WMRealizeWidget(WMWidget
*w
);
755 void WMDestroyWidget(WMWidget
*widget
);
757 void WMHangData(WMWidget
*widget
, void *data
);
759 void *WMGetHangedData(WMWidget
*widget
);
761 unsigned int WMWidgetWidth(WMWidget
*w
);
763 unsigned int WMWidgetHeight(WMWidget
*w
);
765 Window
WMWidgetXID(WMWidget
*w
);
767 Window
WMViewXID(WMView
*view
);
769 void WMRedisplayWidget(WMWidget
*w
);
771 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
773 WMSize
WMGetViewSize(WMView
*view
);
775 WMPoint
WMGetViewPosition(WMView
*view
);
777 WMPoint
WMGetViewScreenPosition(WMView
*view
);
779 WMWidget
*WMWidgetOfView(WMView
*view
);
782 extern char *WMViewSizeDidChangeNotification
;
784 extern char *WMViewRealizedNotification
;
787 /* ....................................................................... */
789 void WMSetBalloonTextForView(char *text
, WMView
*view
);
791 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
793 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
795 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
797 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
799 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
802 /* ....................................................................... */
804 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
806 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
808 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
811 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
813 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
815 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
817 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
819 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
821 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
823 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
825 void WMSetWindowInitialSize(WMWindow
*win
, unsigned width
, unsigned height
);
827 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
829 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
831 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
833 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
835 void WMSetWindowLevel(WMWindow
*win
, int level
);
837 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
839 void WMCloseWindow(WMWindow
*win
);
841 /* ....................................................................... */
843 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
845 #define WMCreateCommandButton(parent) \
846 WMCreateCustomButton((parent), WBBSpringLoadedMask\
851 #define WMCreateRadioButton(parent) \
852 WMCreateButton((parent), WBTRadio)
854 #define WMCreateSwitchButton(parent) \
855 WMCreateButton((parent), WBTSwitch)
857 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
859 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
861 void WMSetButtonImageDefault(WMButton
*bPtr
);
863 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
865 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
867 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
869 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
871 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
873 void WMSetButtonText(WMButton
*bPtr
, char *text
);
875 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
877 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
879 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
881 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
883 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
885 int WMGetButtonSelected(WMButton
*bPtr
);
887 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
889 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
891 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
893 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
895 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
897 void WMPerformButtonClick(WMButton
*bPtr
);
899 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
901 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
903 /* ....................................................................... */
905 WMLabel
*WMCreateLabel(WMWidget
*parent
);
907 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
909 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
911 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
913 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
915 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
917 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
919 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
921 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
923 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
925 /* ....................................................................... */
927 WMFrame
*WMCreateFrame(WMWidget
*parent
);
929 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
931 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
933 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
935 /* ....................................................................... */
937 WMTextField
*WMCreateTextField(WMWidget
*parent
);
939 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
941 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
943 /* you can free the returned string */
944 char *WMGetTextFieldText(WMTextField
*tPtr
);
946 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
948 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
950 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
952 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
954 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
956 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
958 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
960 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
962 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
964 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
966 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
968 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
970 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
972 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
975 extern char *WMTextDidChangeNotification
;
976 extern char *WMTextDidBeginEditingNotification
;
977 extern char *WMTextDidEndEditingNotification
;
979 /* ....................................................................... */
981 WMScroller
*WMCreateScroller(WMWidget
*parent
);
983 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
984 float knobProportion
);
986 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
988 float WMGetScrollerValue(WMScroller
*sPtr
);
990 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
992 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
994 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
995 WMScrollArrowPosition position
);
997 /* ....................................................................... */
999 WMList
*WMCreateList(WMWidget
*parent
);
1001 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1003 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1005 void WMSortListItems(WMList
*lPtr
);
1007 void WMSortListItemsWithComparer(WMList
*lPtr
,
1008 int (f
)(const void*, const void*));
1010 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1012 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
1014 WMBag
*WMGetListItems(WMList
*lPtr
);
1017 void WMRemoveListItem(WMList
*lPtr
, int row
);
1019 void WMSelectListItem(WMList
*lPtr
, int row
);
1021 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1023 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1025 int WMGetListItemHeight(WMList
*lPtr
);
1027 /* don't free the returned data */
1028 WMListItem
*WMGetListSelectedItem(WMList
*lPtr
);
1030 int WMGetListSelectedItemRow(WMList
*lPtr
);
1032 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1034 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1036 void WMClearList(WMList
*lPtr
);
1038 int WMGetListNumberOfRows(WMList
*lPtr
);
1040 void WMSetListPosition(WMList
*lPtr
, int row
);
1042 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1044 int WMGetListPosition(WMList
*lPtr
);
1046 extern char *WMListDidScrollNotification
;
1047 extern char *WMListSelectionDidChangeNotification
;
1049 /* ....................................................................... */
1051 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1053 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1055 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1057 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1059 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1061 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1063 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1065 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1067 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1069 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1071 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1072 int (f
)(const void*, const void*));
1074 /* Don't free the returned string. */
1075 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1077 /* you can free the returned string */
1078 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1079 /* you can free the returned string */
1080 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1082 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1084 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1087 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1089 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1091 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1093 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1095 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1097 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1099 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1101 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1103 /* ....................................................................... */
1106 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1108 WMMenuItem
*WMCreateMenuItem(void);
1110 void WMDestroyMenuItem(WMMenuItem
*item
);
1112 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1114 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1116 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1118 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1120 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1122 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1124 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1126 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1128 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1130 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1132 void *WMGetMenuItemData(WMMenuItem
*item
);
1134 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1136 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1138 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1140 int WMGetMenuItemState(WMMenuItem
*item
);
1142 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1144 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1146 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1148 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1150 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1152 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1154 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1156 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1158 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1161 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1163 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1166 /* ....................................................................... */
1168 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1170 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1173 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1175 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1177 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1180 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1182 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1184 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1186 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1188 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1190 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1192 /* don't free the returned data */
1193 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1195 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1198 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1200 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1202 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1204 /* ....................................................................... */
1206 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1208 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1210 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1212 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1214 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1216 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1218 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1221 /* ....................................................................... */
1223 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1225 void WMFreeColorPanel(WMColorPanel
*panel
);
1227 void WMShowColorPanel(WMColorPanel
*panel
);
1229 void WMCloseColorPanel(WMColorPanel
*panel
);
1231 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1233 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1235 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1237 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1239 extern char *WMColorPanelColorChangedNotification
;
1241 /* ....................................................................... */
1243 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1245 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1247 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1249 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1252 extern char *WMColorWellDidChangeNotification
;
1255 /* ...................................................................... */
1257 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1259 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1260 unsigned int height
);
1262 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1264 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1266 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1268 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1270 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1272 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1274 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1276 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1278 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1280 /* ....................................................................... */
1282 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1284 int WMGetSliderMinValue(WMSlider
*slider
);
1286 int WMGetSliderMaxValue(WMSlider
*slider
);
1288 int WMGetSliderValue(WMSlider
*slider
);
1290 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1292 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1294 void WMSetSliderValue(WMSlider
*slider
, int value
);
1296 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1298 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1300 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1302 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1304 /* ....................................................................... */
1307 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1308 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1309 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1311 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1313 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1315 /* remove the first subview == view */
1316 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1318 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1321 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1323 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1325 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1326 WMSplitViewConstrainProc
*proc
);
1329 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1330 WMSplitViewResizeSubviewsProc *proc);
1333 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1336 /* ....................................................................... */
1339 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1341 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1343 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1345 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1347 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1349 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1351 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1353 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1355 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1357 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1359 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1361 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1363 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1365 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1368 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1370 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1372 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1374 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1376 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1378 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1380 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1382 /* ....................................................................... */
1384 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1385 char *defaultButton
, char *alternateButton
,
1388 /* you can free the returned string */
1389 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1390 char *defaultText
, char *okButton
, char *cancelButton
);
1392 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1393 char *msg
, char *defaultButton
,
1394 char *alternateButton
, char *otherButton
);
1396 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1397 char *msg
, char *defaultText
, char *okButton
,
1398 char *cancelButton
);
1400 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1402 void WMDestroyInputPanel(WMInputPanel
*panel
);
1404 /* ....................................................................... */
1406 /* only 1 instance per WMScreen */
1407 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1409 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1411 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1413 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1415 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1417 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1419 /* you can free the returned string */
1420 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1422 void WMFreeFilePanel(WMFilePanel
*panel
);
1424 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1425 char *path
, char *name
, char **fileTypes
);
1427 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1429 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1432 /* ...................................................................... */
1434 /* only 1 instance per WMScreen */
1435 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1437 void WMShowFontPanel(WMFontPanel
*panel
);
1439 void WMHideFontPanel(WMFontPanel
*panel
);
1441 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1443 /* you can free the returned string */
1444 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1446 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1450 #endif /* __cplusplus */