10 #define WINGS_H_VERSION 991003
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 WMGrayModeColorPanel
,
198 WMCMYKModeColorPanel
,
200 WMCustomPaletteModeColorPanel
,
201 WMColorListModeColorPanel
,
202 WMWheelModeColorPanel
208 #define WSIReturnArrow 1
209 #define WSIHighlightedReturnArrow 2
210 #define WSIScrollerDimple 3
211 #define WSIArrowLeft 4
212 #define WSIHighlightedArrowLeft 5
213 #define WSIArrowRight 6
214 #define WSIHighlightedArrowRight 7
216 #define WSIHighlightedArrowUp 9
217 #define WSIArrowDown 10
218 #define WSIHighlightedArrowDown 11
219 #define WSICheckMark 12
222 WLDSSelected
= (1 << 16),
223 WLDSDisabled
= (1 << 17),
224 WLDSFocused
= (1 << 18),
225 WLDSIsBranch
= (1 << 19)
228 /* alert panel return values */
238 /* types of input observers */
240 WIReadMask
= (1 << 0),
241 WIWriteMask
= (1 << 1),
242 WIExceptMask
= (1 << 2)
262 WC_Matrix
= 12, /* not ready */
265 WC_ProgressIndicator
= 15,
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_ProgressIndicator WMProgressIndicator
;
305 typedef struct W_ColorWell WMColorWell
;
306 typedef struct W_Slider WMSlider
;
307 typedef struct W_Matrix WMMatrix
; /* not ready */
308 typedef struct W_SplitView WMSplitView
;
309 typedef struct W_TabView WMTabView
;
312 typedef struct W_TabViewItem WMTabViewItem
;
313 typedef struct W_MenuItem WMMenuItem
;
316 typedef struct W_FilePanel WMFilePanel
;
317 typedef WMFilePanel WMOpenPanel
;
318 typedef WMFilePanel WMSavePanel
;
320 typedef struct W_FontPanel WMFontPanel
;
322 typedef struct W_ColorPanel WMColorPanel
;
325 /* item for WMList */
326 typedef struct WMListItem
{
328 void *clientData
; /* ptr for user clientdata. */
330 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 */
355 typedef struct WMInputPanel
{
356 WMWindow
*win
; /* window */
357 WMButton
*defBtn
; /* default button */
358 WMButton
*altBtn
; /* alternative button */
359 WMLabel
*tLbl
; /* title label */
360 WMLabel
*mLbl
; /* message label */
361 WMTextField
*text
; /* text field */
362 short result
; /* button that was pushed */
375 typedef void *WMHandlerID
;
377 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
379 typedef void WMEventProc(XEvent
*event
, void *clientData
);
381 typedef void WMEventHook(XEvent
*event
);
383 /* self is set to the widget from where the callback is being called and
384 * clientData to the data set to with WMSetClientData() */
385 typedef void WMAction(WMWidget
*self
, void *clientData
);
387 /* same as WMAction, but for stuff that arent widgets */
388 typedef void WMAction2(void *self
, void *clientData
);
391 typedef void WMCallback(void *data
);
394 /* delegate method like stuff */
395 typedef void WMFreeDataProc(void *data
);
397 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
398 int state
, WMRect
*rect
);
401 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
402 unsigned int oldWidth,
403 unsigned int oldHeight);
406 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
407 int *minSize
, int *maxSize
);
409 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
412 typedef Bool
WMConvertSelectionProc(WMWidget
*w
, Atom selection
, Atom target
,
413 Atom
*type
, void **value
, unsigned *length
,
416 typedef void WMLoseSelectionProc(WMWidget
*w
, Atom selection
);
418 typedef void WMSelectionDoneProc(WMWidget
*w
, Atom selection
, Atom target
);
423 typedef struct WMBrowserDelegate
{
426 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
427 WMBrowser
*sender
, int column
, WMList
*list
);
429 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
432 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
434 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
438 typedef struct WMTextFieldDelegate
{
441 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
442 WMNotification
*notif
);
444 void (*didChange
)(struct WMTextFieldDelegate
*self
,
445 WMNotification
*notif
);
447 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
448 WMNotification
*notif
);
450 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
453 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
455 } WMTextFieldDelegate
;
459 typedef struct WMTabViewDelegate
{
462 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
465 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
466 WMTabViewItem
*item
);
468 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
469 WMTabViewItem
*item
);
471 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
472 WMTabViewItem
*item
);
477 /* ...................................................................... */
480 WMRange
wmkrange(int start
, int count
);
482 WMPoint
wmkpoint(int x
, int y
);
484 WMSize
wmksize(unsigned int width
, unsigned int height
);
487 /* ....................................................................... */
491 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
493 void WMSetResourcePath(char *path
);
495 /* don't free the returned string */
496 char *WMGetApplicationName();
498 /* Try to locate resource file. ext may be NULL */
499 char *WMPathForResourceOfType(char *resource
, char *ext
);
501 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
504 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
506 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
508 void WMScreenMainLoop(WMScreen
*scr
);
511 RContext
*WMScreenRContext(WMScreen
*scr
);
513 Display
*WMScreenDisplay(WMScreen
*scr
);
515 int WMScreenDepth(WMScreen
*scr
);
519 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
521 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
523 void WMSetFocusToWidget(WMWidget
*widget
);
525 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
527 int WMHandleEvent(XEvent
*event
);
529 Bool
WMScreenPending(WMScreen
*scr
);
531 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
532 WMEventProc
*eventProc
, void *clientData
);
534 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
535 WMEventProc
*eventProc
, void *clientData
);
537 int WMIsDoubleClick(XEvent
*event
);
539 void WMNextEvent(Display
*dpy
, XEvent
*event
);
541 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
543 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
546 void WMDeleteTimerWithClientData(void *cdata
);
548 void WMDeleteTimerHandler(WMHandlerID handlerID
);
550 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
552 void WMDeleteIdleHandler(WMHandlerID handlerID
);
554 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
557 void WMDeleteInputHandler(WMHandlerID handlerID
);
559 Bool
WMCreateSelectionHandler(WMWidget
*w
, Atom selection
, Time timestamp
,
560 WMConvertSelectionProc
*convProc
,
561 WMLoseSelectionProc
*loseProc
,
562 WMSelectionDoneProc
*doneProc
);
564 void WMDeleteSelectionHandler(WMWidget
*widget
, Atom selection
);
567 /* ....................................................................... */
569 void WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation,
570 WMSize mouseOffset, XEvent *event, Bool slideBack);
574 /* ....................................................................... */
576 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
578 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
580 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
582 WMFont
*WMRetainFont(WMFont
*font
);
584 void WMReleaseFont(WMFont
*font
);
586 unsigned int WMFontHeight(WMFont
*font
);
589 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
591 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
594 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
596 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
598 XFontSet
WMGetFontFontSet(WMFont
*font
);
600 /* ....................................................................... */
602 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
604 void WMReleasePixmap(WMPixmap
*pixmap
);
606 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
609 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
610 Pixmap mask
, int width
, int height
,
613 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
616 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
618 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
620 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
622 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
625 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
627 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
629 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
631 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
633 /* ....................................................................... */
636 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
638 WMColor
*WMGrayColor(WMScreen
*scr
);
640 WMColor
*WMBlackColor(WMScreen
*scr
);
642 WMColor
*WMWhiteColor(WMScreen
*scr
);
644 void WMSetColorInGC(WMColor
*color
, GC gc
);
646 GC
WMColorGC(WMColor
*color
);
648 WMPixel
WMColorPixel(WMColor
*color
);
650 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
651 unsigned int width
, unsigned int height
);
653 void WMReleaseColor(WMColor
*color
);
655 WMColor
*WMRetainColor(WMColor
*color
);
657 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
658 unsigned short green
, unsigned short blue
,
661 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
663 unsigned short WMRedComponentOfColor(WMColor
*color
);
665 unsigned short WMGreenComponentOfColor(WMColor
*color
);
667 unsigned short WMBlueComponentOfColor(WMColor
*color
);
669 char *WMGetColorRGBDescription(WMColor
*color
);
671 /* ....................................................................... */
674 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
675 int y
, char *text
, int length
);
677 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
678 int y
, char *text
, int length
);
680 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
684 /* ....................................................................... */
686 WMScreen
*WMWidgetScreen(WMWidget
*w
);
688 unsigned int WMScreenWidth(WMScreen
*scr
);
690 unsigned int WMScreenHeight(WMScreen
*scr
);
692 void WMUnmapWidget(WMWidget
*w
);
694 void WMMapWidget(WMWidget
*w
);
696 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
698 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
700 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
702 void WMMapSubwidgets(WMWidget
*w
);
704 void WMUnmapSubwidgets(WMWidget
*w
);
706 void WMRealizeWidget(WMWidget
*w
);
708 void WMDestroyWidget(WMWidget
*widget
);
710 void WMHangData(WMWidget
*widget
, void *data
);
712 void *WMGetHangedData(WMWidget
*widget
);
714 unsigned int WMWidgetWidth(WMWidget
*w
);
716 unsigned int WMWidgetHeight(WMWidget
*w
);
718 Window
WMWidgetXID(WMWidget
*w
);
720 Window
WMViewXID(WMView
*view
);
722 void WMRedisplayWidget(WMWidget
*w
);
724 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
726 WMSize
WMGetViewSize(WMView
*view
);
728 WMPoint
WMGetViewPosition(WMView
*view
);
730 WMWidget
*WMWidgetOfView(WMView
*view
);
733 extern char *WMViewSizeDidChangeNotification
;
735 extern char *WMViewRealizedNotification
;
738 /* ....................................................................... */
740 void WMSetBalloonTextForView(char *text
, WMView
*view
);
742 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
744 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
746 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
748 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
750 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
753 /* ....................................................................... */
755 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
757 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
759 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
762 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
764 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
766 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
768 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
770 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
772 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
774 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
776 void WMSetWindowInitialSize(WMWindow
*win
, unsigned width
, unsigned height
);
778 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
780 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
782 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
784 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
786 void WMSetWindowLevel(WMWindow
*win
, int level
);
788 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
790 void WMCloseWindow(WMWindow
*win
);
792 /* ....................................................................... */
794 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
796 #define WMCreateCommandButton(parent) \
797 WMCreateCustomButton((parent), WBBSpringLoadedMask\
802 #define WMCreateRadioButton(parent) \
803 WMCreateButton((parent), WBTRadio)
805 #define WMCreateSwitchButton(parent) \
806 WMCreateButton((parent), WBTSwitch)
808 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
810 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
812 void WMSetButtonImageDefault(WMButton
*bPtr
);
814 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
816 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
818 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
820 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
822 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
824 void WMSetButtonText(WMButton
*bPtr
, char *text
);
826 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
828 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
830 int WMGetButtonSelected(WMButton
*bPtr
);
832 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
834 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
836 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
838 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
840 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
842 void WMPerformButtonClick(WMButton
*bPtr
);
844 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
846 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
848 /* ....................................................................... */
850 WMLabel
*WMCreateLabel(WMWidget
*parent
);
852 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
854 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
856 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
858 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
860 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
862 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
864 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
866 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
868 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
870 /* ....................................................................... */
872 WMFrame
*WMCreateFrame(WMWidget
*parent
);
874 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
876 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
878 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
880 /* ....................................................................... */
882 WMTextField
*WMCreateTextField(WMWidget
*parent
);
884 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
886 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
888 /* you can free the returned string */
889 char *WMGetTextFieldText(WMTextField
*tPtr
);
891 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
893 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
895 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
897 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
899 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
901 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
903 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
905 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
907 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
909 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
911 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
913 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
915 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
917 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
920 extern char *WMTextDidChangeNotification
;
921 extern char *WMTextDidBeginEditingNotification
;
922 extern char *WMTextDidEndEditingNotification
;
924 /* ....................................................................... */
926 WMScroller
*WMCreateScroller(WMWidget
*parent
);
928 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
929 float knobProportion
);
931 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
933 float WMGetScrollerValue(WMScroller
*sPtr
);
935 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
937 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
939 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
940 WMScrollArrowPosition position
);
942 /* ....................................................................... */
944 WMList
*WMCreateList(WMWidget
*parent
);
946 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
948 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
950 void WMSortListItems(WMList
*lPtr
);
952 void WMSortListItemsWithComparer(WMList
*lPtr
,
953 int (f
)(const void*, const void*));
955 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
957 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
959 WMBag
*WMGetListItems(WMList
*lPtr
);
962 void WMRemoveListItem(WMList
*lPtr
, int row
);
964 void WMSelectListItem(WMList
*lPtr
, int row
);
966 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
968 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
970 int WMGetListItemHeight(WMList
*lPtr
);
972 /* don't free the returned data */
973 WMListItem
*WMGetListSelectedItem(WMList
*lPtr
);
975 int WMGetListSelectedItemRow(WMList
*lPtr
);
977 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
979 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
981 void WMClearList(WMList
*lPtr
);
983 int WMGetListNumberOfRows(WMList
*lPtr
);
985 void WMSetListPosition(WMList
*lPtr
, int row
);
987 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
989 int WMGetListPosition(WMList
*lPtr
);
991 extern char *WMListDidScrollNotification
;
992 extern char *WMListSelectionDidChangeNotification
;
994 /* ....................................................................... */
996 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
998 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1000 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1002 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1004 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1006 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1008 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1010 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1012 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1014 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1016 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1017 int (f
)(const void*, const void*));
1019 /* Don't free the returned string. */
1020 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1022 /* you can free the returned string */
1023 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1024 /* you can free the returned string */
1025 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1027 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1029 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1032 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1034 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1036 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1038 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1040 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1042 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1044 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1046 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1048 /* ....................................................................... */
1051 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1053 WMMenuItem
*WMCreateMenuItem(void);
1055 void WMDestroyMenuItem(WMMenuItem
*item
);
1057 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1059 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1061 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1063 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1065 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1067 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1069 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1071 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1073 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1075 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1077 void *WMGetMenuItemData(WMMenuItem
*item
);
1079 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1081 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1083 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1085 int WMGetMenuItemState(WMMenuItem
*item
);
1087 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1089 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1091 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1093 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1095 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1097 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1099 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1101 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1103 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1106 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1108 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1111 /* ....................................................................... */
1113 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1115 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1118 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1120 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1122 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1125 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1127 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1129 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1131 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1133 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1135 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1137 /* don't free the returned data */
1138 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1140 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1143 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1145 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1147 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1149 /* ....................................................................... */
1151 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1153 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1155 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1157 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1159 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1161 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1163 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1166 /* ....................................................................... */
1168 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1170 void WMFreeColorPanel(WMColorPanel
*panel
);
1172 void WMShowColorPanel(WMColorPanel
*panel
);
1174 void WMCloseColorPanel(WMColorPanel
*panel
);
1176 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1178 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1180 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1182 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1184 extern char *WMColorPanelColorChangedNotification
;
1186 /* ....................................................................... */
1188 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1190 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1192 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1194 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1197 extern char *WMColorWellDidChangeNotification
;
1200 /* ...................................................................... */
1202 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1204 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1205 unsigned int height
);
1207 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1209 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1211 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1213 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1215 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1217 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1219 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1221 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1223 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1225 /* ....................................................................... */
1227 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1229 int WMGetSliderMinValue(WMSlider
*slider
);
1231 int WMGetSliderMaxValue(WMSlider
*slider
);
1233 int WMGetSliderValue(WMSlider
*slider
);
1235 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1237 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1239 void WMSetSliderValue(WMSlider
*slider
, int value
);
1241 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1243 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1245 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1247 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1249 /* ....................................................................... */
1252 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1253 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1254 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1256 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1258 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1260 /* remove the first subview == view */
1261 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1263 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1266 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1268 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1270 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1271 WMSplitViewConstrainProc
*proc
);
1274 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1275 WMSplitViewResizeSubviewsProc *proc);
1278 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1281 /* ....................................................................... */
1284 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1286 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1288 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1290 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1292 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1294 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1296 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1298 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1300 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1302 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1304 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1306 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1308 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1310 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1313 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1315 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1317 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1319 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1321 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1323 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1325 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1327 /* ....................................................................... */
1329 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1330 char *defaultButton
, char *alternateButton
,
1333 /* you can free the returned string */
1334 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1335 char *defaultText
, char *okButton
, char *cancelButton
);
1337 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1338 char *msg
, char *defaultButton
,
1339 char *alternateButton
, char *otherButton
);
1341 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1342 char *msg
, char *defaultText
, char *okButton
,
1343 char *cancelButton
);
1345 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1347 void WMDestroyInputPanel(WMInputPanel
*panel
);
1349 /* ....................................................................... */
1351 /* only 1 instance per WMScreen */
1352 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1354 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1356 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1358 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1360 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1362 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1364 /* you can free the returned string */
1365 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1367 void WMFreeFilePanel(WMFilePanel
*panel
);
1369 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1370 char *path
, char *name
, char **fileTypes
);
1372 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1374 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1377 /* ...................................................................... */
1379 /* only 1 instance per WMScreen */
1380 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1382 void WMShowFontPanel(WMFontPanel
*panel
);
1384 void WMHideFontPanel(WMFontPanel
*panel
);
1386 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1388 /* you can free the returned string */
1389 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1391 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1395 #endif /* __cplusplus */