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
= 1,
197 WMRGBModeColorPanel
= 2,
198 WMCMYKModeColorPanel
= 3,
199 WMHSBModeColorPanel
= 4,
200 WMCustomPaletteModeColorPanel
= 5,
201 WMColorListModeColorPanel
= 6,
202 WMWheelModeColorPanel
= 7
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 typedef struct W_DraggingInfo WMDraggingInfo
;
480 typedef struct W_DragSourceProcs
{
481 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
482 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
483 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
485 WMData
* (*fetchDragData
)(WMView
*self
, char *type
, Bool local
);
486 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
491 typedef struct W_DragDestinationProcs
{
492 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
493 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
494 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
495 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
496 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
497 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
498 } WMDragDestinationProcs
;
502 /* ...................................................................... */
505 WMRange
wmkrange(int start
, int count
);
507 WMPoint
wmkpoint(int x
, int y
);
509 WMSize
wmksize(unsigned int width
, unsigned int height
);
512 /* ....................................................................... */
516 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
518 void WMSetResourcePath(char *path
);
520 /* don't free the returned string */
521 char *WMGetApplicationName();
523 /* Try to locate resource file. ext may be NULL */
524 char *WMPathForResourceOfType(char *resource
, char *ext
);
526 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
529 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
531 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
533 void WMScreenMainLoop(WMScreen
*scr
);
536 RContext
*WMScreenRContext(WMScreen
*scr
);
538 Display
*WMScreenDisplay(WMScreen
*scr
);
540 int WMScreenDepth(WMScreen
*scr
);
544 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
546 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
548 void WMSetFocusToWidget(WMWidget
*widget
);
550 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
552 int WMHandleEvent(XEvent
*event
);
554 Bool
WMScreenPending(WMScreen
*scr
);
556 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
557 WMEventProc
*eventProc
, void *clientData
);
559 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
560 WMEventProc
*eventProc
, void *clientData
);
562 int WMIsDoubleClick(XEvent
*event
);
564 void WMNextEvent(Display
*dpy
, XEvent
*event
);
566 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
568 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
571 void WMDeleteTimerWithClientData(void *cdata
);
573 void WMDeleteTimerHandler(WMHandlerID handlerID
);
575 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
577 void WMDeleteIdleHandler(WMHandlerID handlerID
);
579 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
582 void WMDeleteInputHandler(WMHandlerID handlerID
);
584 Bool
WMCreateSelectionHandler(WMWidget
*w
, Atom selection
, Time timestamp
,
585 WMConvertSelectionProc
*convProc
,
586 WMLoseSelectionProc
*loseProc
,
587 WMSelectionDoneProc
*doneProc
);
589 void WMDeleteSelectionHandler(WMWidget
*widget
, Atom selection
);
592 /* ....................................................................... */
594 void WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation,
595 WMSize mouseOffset, XEvent *event, Bool slideBack);
599 /* ....................................................................... */
601 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
603 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
605 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
607 WMFont
*WMRetainFont(WMFont
*font
);
609 void WMReleaseFont(WMFont
*font
);
611 unsigned int WMFontHeight(WMFont
*font
);
614 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
616 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
619 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
621 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
623 XFontSet
WMGetFontFontSet(WMFont
*font
);
625 /* ....................................................................... */
627 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
629 void WMReleasePixmap(WMPixmap
*pixmap
);
631 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
634 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
635 Pixmap mask
, int width
, int height
,
638 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
641 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
643 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
645 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
647 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
650 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
652 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
654 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
656 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
658 /* ....................................................................... */
661 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
663 WMColor
*WMGrayColor(WMScreen
*scr
);
665 WMColor
*WMBlackColor(WMScreen
*scr
);
667 WMColor
*WMWhiteColor(WMScreen
*scr
);
669 void WMSetColorInGC(WMColor
*color
, GC gc
);
671 GC
WMColorGC(WMColor
*color
);
673 WMPixel
WMColorPixel(WMColor
*color
);
675 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
676 unsigned int width
, unsigned int height
);
678 void WMReleaseColor(WMColor
*color
);
680 WMColor
*WMRetainColor(WMColor
*color
);
682 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
683 unsigned short green
, unsigned short blue
,
686 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
688 unsigned short WMRedComponentOfColor(WMColor
*color
);
690 unsigned short WMGreenComponentOfColor(WMColor
*color
);
692 unsigned short WMBlueComponentOfColor(WMColor
*color
);
694 char *WMGetColorRGBDescription(WMColor
*color
);
696 /* ....................................................................... */
699 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
700 int y
, char *text
, int length
);
702 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
703 int y
, char *text
, int length
);
705 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
709 /* ....................................................................... */
711 WMScreen
*WMWidgetScreen(WMWidget
*w
);
713 unsigned int WMScreenWidth(WMScreen
*scr
);
715 unsigned int WMScreenHeight(WMScreen
*scr
);
717 void WMUnmapWidget(WMWidget
*w
);
719 void WMMapWidget(WMWidget
*w
);
721 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
723 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
725 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
727 void WMMapSubwidgets(WMWidget
*w
);
729 void WMUnmapSubwidgets(WMWidget
*w
);
731 void WMRealizeWidget(WMWidget
*w
);
733 void WMDestroyWidget(WMWidget
*widget
);
735 void WMHangData(WMWidget
*widget
, void *data
);
737 void *WMGetHangedData(WMWidget
*widget
);
739 unsigned int WMWidgetWidth(WMWidget
*w
);
741 unsigned int WMWidgetHeight(WMWidget
*w
);
743 Window
WMWidgetXID(WMWidget
*w
);
745 Window
WMViewXID(WMView
*view
);
747 void WMRedisplayWidget(WMWidget
*w
);
749 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
751 WMSize
WMGetViewSize(WMView
*view
);
753 WMPoint
WMGetViewPosition(WMView
*view
);
755 WMPoint
WMGetViewScreenPosition(WMView
*view
);
757 WMWidget
*WMWidgetOfView(WMView
*view
);
760 extern char *WMViewSizeDidChangeNotification
;
762 extern char *WMViewRealizedNotification
;
765 /* ....................................................................... */
767 void WMSetBalloonTextForView(char *text
, WMView
*view
);
769 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
771 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
773 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
775 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
777 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
780 /* ....................................................................... */
782 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
784 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
786 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
789 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
791 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
793 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
795 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
797 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
799 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
801 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
803 void WMSetWindowInitialSize(WMWindow
*win
, unsigned width
, unsigned height
);
805 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
807 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
809 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
811 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
813 void WMSetWindowLevel(WMWindow
*win
, int level
);
815 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
817 void WMCloseWindow(WMWindow
*win
);
819 /* ....................................................................... */
821 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
823 #define WMCreateCommandButton(parent) \
824 WMCreateCustomButton((parent), WBBSpringLoadedMask\
829 #define WMCreateRadioButton(parent) \
830 WMCreateButton((parent), WBTRadio)
832 #define WMCreateSwitchButton(parent) \
833 WMCreateButton((parent), WBTSwitch)
835 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
837 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
839 void WMSetButtonImageDefault(WMButton
*bPtr
);
841 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
843 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
845 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
847 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
849 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
851 void WMSetButtonText(WMButton
*bPtr
, char *text
);
853 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
855 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
857 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
859 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
861 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
863 int WMGetButtonSelected(WMButton
*bPtr
);
865 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
867 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
869 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
871 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
873 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
875 void WMPerformButtonClick(WMButton
*bPtr
);
877 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
879 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
881 /* ....................................................................... */
883 WMLabel
*WMCreateLabel(WMWidget
*parent
);
885 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
887 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
889 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
891 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
893 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
895 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
897 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
899 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
901 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
903 /* ....................................................................... */
905 WMFrame
*WMCreateFrame(WMWidget
*parent
);
907 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
909 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
911 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
913 /* ....................................................................... */
915 WMTextField
*WMCreateTextField(WMWidget
*parent
);
917 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
919 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
921 /* you can free the returned string */
922 char *WMGetTextFieldText(WMTextField
*tPtr
);
924 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
926 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
928 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
930 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
932 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
934 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
936 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
938 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
940 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
942 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
944 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
946 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
948 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
950 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
953 extern char *WMTextDidChangeNotification
;
954 extern char *WMTextDidBeginEditingNotification
;
955 extern char *WMTextDidEndEditingNotification
;
957 /* ....................................................................... */
959 WMScroller
*WMCreateScroller(WMWidget
*parent
);
961 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
962 float knobProportion
);
964 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
966 float WMGetScrollerValue(WMScroller
*sPtr
);
968 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
970 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
972 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
973 WMScrollArrowPosition position
);
975 /* ....................................................................... */
977 WMList
*WMCreateList(WMWidget
*parent
);
979 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
981 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
983 void WMSortListItems(WMList
*lPtr
);
985 void WMSortListItemsWithComparer(WMList
*lPtr
,
986 int (f
)(const void*, const void*));
988 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
990 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
992 WMBag
*WMGetListItems(WMList
*lPtr
);
995 void WMRemoveListItem(WMList
*lPtr
, int row
);
997 void WMSelectListItem(WMList
*lPtr
, int row
);
999 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1001 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1003 int WMGetListItemHeight(WMList
*lPtr
);
1005 /* don't free the returned data */
1006 WMListItem
*WMGetListSelectedItem(WMList
*lPtr
);
1008 int WMGetListSelectedItemRow(WMList
*lPtr
);
1010 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1012 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1014 void WMClearList(WMList
*lPtr
);
1016 int WMGetListNumberOfRows(WMList
*lPtr
);
1018 void WMSetListPosition(WMList
*lPtr
, int row
);
1020 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1022 int WMGetListPosition(WMList
*lPtr
);
1024 extern char *WMListDidScrollNotification
;
1025 extern char *WMListSelectionDidChangeNotification
;
1027 /* ....................................................................... */
1029 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1031 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1033 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1035 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1037 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1039 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1041 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1043 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1045 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1047 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1049 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1050 int (f
)(const void*, const void*));
1052 /* Don't free the returned string. */
1053 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1055 /* you can free the returned string */
1056 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1057 /* you can free the returned string */
1058 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1060 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1062 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1065 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1067 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1069 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1071 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1073 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1075 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1077 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1079 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1081 /* ....................................................................... */
1084 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1086 WMMenuItem
*WMCreateMenuItem(void);
1088 void WMDestroyMenuItem(WMMenuItem
*item
);
1090 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1092 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1094 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1096 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1098 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1100 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1102 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1104 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1106 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1108 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1110 void *WMGetMenuItemData(WMMenuItem
*item
);
1112 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1114 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1116 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1118 int WMGetMenuItemState(WMMenuItem
*item
);
1120 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1122 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1124 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1126 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1128 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1130 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1132 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1134 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1136 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1139 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1141 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1144 /* ....................................................................... */
1146 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1148 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1151 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1153 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1155 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1158 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1160 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1162 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1164 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1166 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1168 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1170 /* don't free the returned data */
1171 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1173 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1176 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1178 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1180 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1182 /* ....................................................................... */
1184 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1186 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1188 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1190 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1192 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1194 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1196 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1199 /* ....................................................................... */
1201 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1203 void WMFreeColorPanel(WMColorPanel
*panel
);
1205 void WMShowColorPanel(WMColorPanel
*panel
);
1207 void WMCloseColorPanel(WMColorPanel
*panel
);
1209 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1211 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1213 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1215 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1217 extern char *WMColorPanelColorChangedNotification
;
1219 /* ....................................................................... */
1221 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1223 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1225 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1227 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1230 extern char *WMColorWellDidChangeNotification
;
1233 /* ...................................................................... */
1235 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1237 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1238 unsigned int height
);
1240 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1242 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1244 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1246 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1248 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1250 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1252 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1254 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1256 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1258 /* ....................................................................... */
1260 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1262 int WMGetSliderMinValue(WMSlider
*slider
);
1264 int WMGetSliderMaxValue(WMSlider
*slider
);
1266 int WMGetSliderValue(WMSlider
*slider
);
1268 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1270 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1272 void WMSetSliderValue(WMSlider
*slider
, int value
);
1274 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1276 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1278 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1280 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1282 /* ....................................................................... */
1285 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1286 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1287 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1289 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1291 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1293 /* remove the first subview == view */
1294 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1296 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1299 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1301 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1303 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1304 WMSplitViewConstrainProc
*proc
);
1307 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1308 WMSplitViewResizeSubviewsProc *proc);
1311 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1314 /* ....................................................................... */
1317 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1319 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1321 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1323 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1325 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1327 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1329 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1331 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1333 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1335 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1337 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1339 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1341 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1343 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1346 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1348 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1350 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1352 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1354 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1356 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1358 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1360 /* ....................................................................... */
1362 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1363 char *defaultButton
, char *alternateButton
,
1366 /* you can free the returned string */
1367 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1368 char *defaultText
, char *okButton
, char *cancelButton
);
1370 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1371 char *msg
, char *defaultButton
,
1372 char *alternateButton
, char *otherButton
);
1374 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1375 char *msg
, char *defaultText
, char *okButton
,
1376 char *cancelButton
);
1378 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1380 void WMDestroyInputPanel(WMInputPanel
*panel
);
1382 /* ....................................................................... */
1384 /* only 1 instance per WMScreen */
1385 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1387 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1389 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1391 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1393 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1395 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1397 /* you can free the returned string */
1398 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1400 void WMFreeFilePanel(WMFilePanel
*panel
);
1402 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1403 char *path
, char *name
, char **fileTypes
);
1405 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1407 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1410 /* ...................................................................... */
1412 /* only 1 instance per WMScreen */
1413 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1415 void WMShowFontPanel(WMFontPanel
*panel
);
1417 void WMHideFontPanel(WMFontPanel
*panel
);
1419 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1421 /* you can free the returned string */
1422 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1424 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1428 #endif /* __cplusplus */