7 #include <WINGs/WUtil.h>
10 #define WINGS_H_VERSION 20010117
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
;
154 /* usable scroller parts */
159 } WMUsableScrollerParts
;
171 WTTopTabsBevelBorder
,
178 /* text movement types */
180 WMIllegalTextMovement
,
181 WMReturnTextMovement
,
182 WMEscapeTextMovement
,
184 WMBacktabTextMovement
,
191 /* text field special events */
199 WLNotFound
= -1 /* element was not found in WMList */
203 /* drag operations */
211 } WMDragOperationType
;
215 WMGrayModeColorPanel
= 1,
216 WMRGBModeColorPanel
= 2,
217 WMCMYKModeColorPanel
= 3,
218 WMHSBModeColorPanel
= 4,
219 WMCustomPaletteModeColorPanel
= 5,
220 WMColorListModeColorPanel
= 6,
221 WMWheelModeColorPanel
= 7
227 #define WSIReturnArrow 1
228 #define WSIHighlightedReturnArrow 2
229 #define WSIScrollerDimple 3
230 #define WSIArrowLeft 4
231 #define WSIHighlightedArrowLeft 5
232 #define WSIArrowRight 6
233 #define WSIHighlightedArrowRight 7
235 #define WSIHighlightedArrowUp 9
236 #define WSIArrowDown 10
237 #define WSIHighlightedArrowDown 11
238 #define WSICheckMark 12
241 WLDSSelected
= (1 << 16),
242 WLDSDisabled
= (1 << 17),
243 WLDSFocused
= (1 << 18),
244 WLDSIsBranch
= (1 << 19)
247 /* alert panel return values */
257 /* types of input observers */
259 WIReadMask
= (1 << 0),
260 WIWriteMask
= (1 << 1),
261 WIExceptMask
= (1 << 2)
281 WC_Matrix
= 12, /* not ready */
284 WC_ProgressIndicator
= 15,
291 /* All widgets must start with the following structure
292 * in that order. Used for typecasting to get some generic data */
293 typedef struct W_WidgetType
{
300 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
301 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
306 typedef void WMWidget
;
308 typedef struct W_Pixmap WMPixmap
;
309 typedef struct W_Font WMFont
;
310 typedef struct W_Color WMColor
;
312 typedef struct W_Screen WMScreen
;
314 typedef struct W_View WMView
;
316 typedef struct W_Window WMWindow
;
317 typedef struct W_Frame WMFrame
;
318 typedef struct W_Button WMButton
;
319 typedef struct W_Label WMLabel
;
320 typedef struct W_TextField WMTextField
;
321 typedef struct W_Scroller WMScroller
;
322 typedef struct W_ScrollView WMScrollView
;
323 typedef struct W_List WMList
;
324 typedef struct W_Browser WMBrowser
;
325 typedef struct W_PopUpButton WMPopUpButton
;
326 typedef struct W_ProgressIndicator WMProgressIndicator
;
327 typedef struct W_ColorWell WMColorWell
;
328 typedef struct W_Slider WMSlider
;
329 typedef struct W_Matrix WMMatrix
; /* not ready */
330 typedef struct W_SplitView WMSplitView
;
331 typedef struct W_TabView WMTabView
;
332 typedef struct W_Ruler WMRuler
;
333 typedef struct W_Text WMText
;
334 typedef struct W_Box WMBox
;
338 typedef struct W_TabViewItem WMTabViewItem
;
339 typedef struct W_MenuItem WMMenuItem
;
342 typedef struct W_FilePanel WMFilePanel
;
343 typedef WMFilePanel WMOpenPanel
;
344 typedef WMFilePanel WMSavePanel
;
346 typedef struct W_FontPanel WMFontPanel
;
348 typedef struct W_ColorPanel WMColorPanel
;
351 /* item for WMList */
352 typedef struct WMListItem
{
354 void *clientData
; /* ptr for user clientdata. */
356 unsigned int uflags
:16; /* flags for the user */
357 unsigned int selected
:1;
358 unsigned int disabled
:1;
359 unsigned int isBranch
:1;
360 unsigned int loaded
:1;
363 /* struct for message panel */
364 typedef struct WMAlertPanel
{
365 WMWindow
*win
; /* window */
367 WMButton
*defBtn
; /* default button */
368 WMButton
*altBtn
; /* alternative button */
369 WMButton
*othBtn
; /* other button */
370 WMLabel
*iLbl
; /* icon label */
371 WMLabel
*tLbl
; /* title label */
372 WMLabel
*mLbl
; /* message label */
373 WMFrame
*line
; /* separator */
374 short result
; /* button that was pushed */
382 typedef struct WMInputPanel
{
383 WMWindow
*win
; /* window */
384 WMButton
*defBtn
; /* default button */
385 WMButton
*altBtn
; /* alternative button */
386 WMLabel
*tLbl
; /* title label */
387 WMLabel
*mLbl
; /* message label */
388 WMTextField
*text
; /* text field */
389 short result
; /* button that was pushed */
401 WMArray
*tabs
; /* a growable array of tabstops */
402 unsigned short left
; /* left margin marker */
403 unsigned short right
; /* right margin marker */
404 unsigned short first
; /* indentation marker for first line only */
405 unsigned short body
; /* body indentation marker */
406 unsigned short retainCount
;
408 /* All indentation and tab markers are _relative_ to the left margin marker */
411 typedef void *WMHandlerID
;
413 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
415 typedef void WMEventProc(XEvent
*event
, void *clientData
);
417 typedef void WMEventHook(XEvent
*event
);
419 /* self is set to the widget from where the callback is being called and
420 * clientData to the data set to with WMSetClientData() */
421 typedef void WMAction(WMWidget
*self
, void *clientData
);
423 /* same as WMAction, but for stuff that arent widgets */
424 typedef void WMAction2(void *self
, void *clientData
);
427 typedef void WMCallback(void *data
);
429 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
431 /* delegate method like stuff */
432 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
433 int state
, WMRect
*rect
);
436 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
437 unsigned int oldWidth,
438 unsigned int oldHeight);
441 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
442 int *minSize
, int *maxSize
);
444 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
449 typedef struct WMBrowserDelegate
{
452 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
453 WMBrowser
*sender
, int column
, WMList
*list
);
455 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
458 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
460 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
464 typedef struct WMTextFieldDelegate
{
467 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
468 WMNotification
*notif
);
470 void (*didChange
)(struct WMTextFieldDelegate
*self
,
471 WMNotification
*notif
);
473 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
474 WMNotification
*notif
);
476 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
479 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
481 } WMTextFieldDelegate
;
484 typedef struct WMTextDelegate
{
487 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
494 typedef struct WMTabViewDelegate
{
497 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
500 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
501 WMTabViewItem
*item
);
503 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
504 WMTabViewItem
*item
);
506 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
507 WMTabViewItem
*item
);
513 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
514 Time timestamp
, void *cdata
, WMData
*data
);
517 typedef struct WMSelectionProcs
{
518 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
519 void *cdata
, Atom
*type
);
520 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
521 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
526 typedef struct W_DraggingInfo WMDraggingInfo
;
529 typedef struct W_DragSourceProcs
{
530 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
531 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
532 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
534 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
535 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
540 typedef struct W_DragDestinationProcs
{
541 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
542 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
543 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
544 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
545 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
546 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
547 } WMDragDestinationProcs
;
551 /* ...................................................................... */
554 WMRange
wmkrange(int start
, int count
);
556 WMPoint
wmkpoint(int x
, int y
);
558 WMSize
wmksize(unsigned int width
, unsigned int height
);
561 /* ....................................................................... */
565 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
567 void WMSetResourcePath(char *path
);
569 /* don't free the returned string */
570 char *WMGetApplicationName();
572 /* Try to locate resource file. ext may be NULL */
573 char *WMPathForResourceOfType(char *resource
, char *ext
);
575 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
578 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
580 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
582 void WMScreenMainLoop(WMScreen
*scr
);
584 void WMBreakModalLoop(WMScreen
*scr
);
586 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
588 RContext
*WMScreenRContext(WMScreen
*scr
);
590 Display
*WMScreenDisplay(WMScreen
*scr
);
592 int WMScreenDepth(WMScreen
*scr
);
596 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
598 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
600 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
602 void WMSetFocusToWidget(WMWidget
*widget
);
604 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
606 int WMHandleEvent(XEvent
*event
);
608 Bool
WMScreenPending(WMScreen
*scr
);
610 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
611 WMEventProc
*eventProc
, void *clientData
);
613 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
614 WMEventProc
*eventProc
, void *clientData
);
616 int WMIsDoubleClick(XEvent
*event
);
618 int WMIsTripleClick(XEvent
*event
);
620 void WMNextEvent(Display
*dpy
, XEvent
*event
);
622 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
624 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
627 void WMDeleteTimerWithClientData(void *cdata
);
629 void WMDeleteTimerHandler(WMHandlerID handlerID
);
631 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
633 void WMDeleteIdleHandler(WMHandlerID handlerID
);
635 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
638 void WMDeleteInputHandler(WMHandlerID handlerID
);
642 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
643 WMSelectionProcs
*procs
, void *cdata
);
645 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
647 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
648 Time timestamp
, WMSelectionCallback
*callback
,
652 /* ....................................................................... */
654 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
656 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
657 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
660 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
662 void WMUnregisterViewDraggedTypes(WMView
*view
);
664 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
667 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
669 /* ....................................................................... */
671 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
673 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
675 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
677 WMFont
*WMRetainFont(WMFont
*font
);
679 void WMReleaseFont(WMFont
*font
);
681 unsigned int WMFontHeight(WMFont
*font
);
684 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
686 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
690 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
692 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
694 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
696 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
698 XFontSet
WMGetFontFontSet(WMFont
*font
);
700 WMFont
* WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
702 WMFont
* WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
704 WMFont
* WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
706 WMFont
* WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
708 WMFont
* WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
710 WMFont
* WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
712 /* ....................................................................... */
714 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
716 void WMReleasePixmap(WMPixmap
*pixmap
);
718 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
721 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
722 Pixmap mask
, int width
, int height
,
725 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
728 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
730 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
732 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
734 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
737 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
739 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
741 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
743 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
745 /* ....................................................................... */
748 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
750 WMColor
*WMGrayColor(WMScreen
*scr
);
752 WMColor
*WMBlackColor(WMScreen
*scr
);
754 WMColor
*WMWhiteColor(WMScreen
*scr
);
756 void WMSetColorInGC(WMColor
*color
, GC gc
);
758 GC
WMColorGC(WMColor
*color
);
760 WMPixel
WMColorPixel(WMColor
*color
);
762 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
763 unsigned int width
, unsigned int height
);
765 void WMReleaseColor(WMColor
*color
);
767 WMColor
*WMRetainColor(WMColor
*color
);
769 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
770 unsigned short green
, unsigned short blue
,
773 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
775 unsigned short WMRedComponentOfColor(WMColor
*color
);
777 unsigned short WMGreenComponentOfColor(WMColor
*color
);
779 unsigned short WMBlueComponentOfColor(WMColor
*color
);
781 char *WMGetColorRGBDescription(WMColor
*color
);
783 /* ....................................................................... */
786 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
787 int y
, char *text
, int length
);
789 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
790 int y
, char *text
, int length
);
792 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
796 /* ....................................................................... */
798 WMScreen
*WMWidgetScreen(WMWidget
*w
);
800 unsigned int WMScreenWidth(WMScreen
*scr
);
802 unsigned int WMScreenHeight(WMScreen
*scr
);
804 void WMUnmapWidget(WMWidget
*w
);
806 void WMMapWidget(WMWidget
*w
);
808 Bool
WMWidgetIsMapped(WMWidget
*w
);
810 void WMRaiseWidget(WMWidget
*w
);
812 void WMLowerWidget(WMWidget
*w
);
814 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
816 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
818 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
820 void WMMapSubwidgets(WMWidget
*w
);
822 void WMUnmapSubwidgets(WMWidget
*w
);
824 void WMRealizeWidget(WMWidget
*w
);
826 void WMDestroyWidget(WMWidget
*widget
);
828 void WMHangData(WMWidget
*widget
, void *data
);
830 void *WMGetHangedData(WMWidget
*widget
);
832 unsigned int WMWidgetWidth(WMWidget
*w
);
834 unsigned int WMWidgetHeight(WMWidget
*w
);
836 Window
WMWidgetXID(WMWidget
*w
);
838 Window
WMViewXID(WMView
*view
);
840 void WMRedisplayWidget(WMWidget
*w
);
842 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
844 WMSize
WMGetViewSize(WMView
*view
);
846 WMPoint
WMGetViewPosition(WMView
*view
);
848 WMPoint
WMGetViewScreenPosition(WMView
*view
);
850 WMWidget
*WMWidgetOfView(WMView
*view
);
852 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
854 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
857 extern char *WMViewSizeDidChangeNotification
;
859 extern char *WMViewRealizedNotification
;
861 extern char *WMFontPanelDidChangeNotification
;
864 /* ....................................................................... */
866 void WMSetBalloonTextForView(char *text
, WMView
*view
);
868 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
870 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
872 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
874 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
876 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
879 /* ....................................................................... */
881 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
883 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
885 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
888 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
890 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
892 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
894 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
896 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
898 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
900 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
902 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
904 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
907 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
909 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
911 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
913 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
915 void WMSetWindowLevel(WMWindow
*win
, int level
);
917 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
919 void WMCloseWindow(WMWindow
*win
);
921 /* ....................................................................... */
923 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
925 #define WMCreateCommandButton(parent) \
926 WMCreateCustomButton((parent), WBBSpringLoadedMask\
931 #define WMCreateRadioButton(parent) \
932 WMCreateButton((parent), WBTRadio)
934 #define WMCreateSwitchButton(parent) \
935 WMCreateButton((parent), WBTSwitch)
937 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
939 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
941 void WMSetButtonImageDefault(WMButton
*bPtr
);
943 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
945 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
947 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
949 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
951 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
953 void WMSetButtonText(WMButton
*bPtr
, char *text
);
955 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
957 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
959 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
961 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
963 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
965 int WMGetButtonSelected(WMButton
*bPtr
);
967 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
969 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
971 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
973 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
975 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
977 void WMPerformButtonClick(WMButton
*bPtr
);
979 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
981 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
983 /* ....................................................................... */
985 WMLabel
*WMCreateLabel(WMWidget
*parent
);
987 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
989 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
991 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
993 char *WMGetLabelText(WMLabel
*lPtr
);
995 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
997 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
999 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1001 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1003 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1005 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1007 /* ....................................................................... */
1009 WMFrame
*WMCreateFrame(WMWidget
*parent
);
1011 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1013 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1015 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1017 /* ....................................................................... */
1019 WMTextField
*WMCreateTextField(WMWidget
*parent
);
1021 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1023 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1025 /* you can free the returned string */
1026 char *WMGetTextFieldText(WMTextField
*tPtr
);
1028 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1030 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1032 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1034 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
1036 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1038 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1040 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1042 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1044 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1046 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1048 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1050 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1052 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1054 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1057 extern char *WMTextDidChangeNotification
;
1058 extern char *WMTextDidBeginEditingNotification
;
1059 extern char *WMTextDidEndEditingNotification
;
1061 /* ....................................................................... */
1063 WMScroller
*WMCreateScroller(WMWidget
*parent
);
1065 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1066 float knobProportion
);
1068 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1070 float WMGetScrollerValue(WMScroller
*sPtr
);
1072 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1074 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1076 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1077 WMScrollArrowPosition position
);
1079 extern char *WMScrollerDidScrollNotification
;
1081 /* ....................................................................... */
1083 WMList
*WMCreateList(WMWidget
*parent
);
1085 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1087 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1089 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1091 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1093 void WMSortListItems(WMList
*lPtr
);
1095 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1097 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1099 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
1101 WMArray
*WMGetListItems(WMList
*lPtr
);
1103 void WMRemoveListItem(WMList
*lPtr
, int row
);
1105 void WMSelectListItem(WMList
*lPtr
, int row
);
1107 void WMUnselectListItem(WMList
*lPtr
, int row
);
1109 /* This will select all items in range, and deselect all the others */
1110 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1112 /* This will select all items in range, leaving the others as they are */
1113 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1115 void WMSelectAllListItems(WMList
*lPtr
);
1117 void WMUnselectAllListItems(WMList
*lPtr
);
1119 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1121 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1123 int WMGetListItemHeight(WMList
*lPtr
);
1125 /* don't free the returned data */
1126 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1129 * For the following 2 functions, in case WMList allows multiple selection,
1130 * the first item in the list of selected items, respective its row number,
1134 /* don't free the returned data */
1135 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1137 int WMGetListSelectedItemRow(WMList
*lPtr
);
1139 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1141 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1143 void WMClearList(WMList
*lPtr
);
1145 int WMGetListNumberOfRows(WMList
*lPtr
);
1147 void WMSetListPosition(WMList
*lPtr
, int row
);
1149 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1151 int WMGetListPosition(WMList
*lPtr
);
1153 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1155 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1158 extern char *WMListDidScrollNotification
;
1159 extern char *WMListSelectionDidChangeNotification
;
1161 /* ....................................................................... */
1163 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1165 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1167 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1169 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1171 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1173 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1175 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1177 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1179 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1181 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1183 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1185 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1187 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1188 WMCompareDataProc
*func
);
1190 /* Don't free the returned string. */
1191 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1193 /* free the returned string */
1194 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1196 /* free the returned string */
1197 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1199 /* free the returned array */
1200 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1202 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1204 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1207 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1209 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1211 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1213 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1215 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1217 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1219 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1221 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1223 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1225 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1227 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1229 /* ....................................................................... */
1232 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1234 WMMenuItem
*WMCreateMenuItem(void);
1236 void WMDestroyMenuItem(WMMenuItem
*item
);
1238 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1240 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1242 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1244 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1246 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1248 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1250 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1252 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1254 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1256 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1258 void *WMGetMenuItemData(WMMenuItem
*item
);
1260 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1262 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1264 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1266 int WMGetMenuItemState(WMMenuItem
*item
);
1268 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1270 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1272 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1274 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1276 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1278 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1280 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1282 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1284 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1287 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1289 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1292 /* ....................................................................... */
1294 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1296 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1299 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1301 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1303 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1306 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1308 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1310 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1312 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1314 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1316 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1318 /* don't free the returned data */
1319 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1321 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1324 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1326 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1328 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1330 /* ....................................................................... */
1332 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1334 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1336 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1338 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1340 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1342 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1344 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1347 /* ....................................................................... */
1349 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1351 void WMFreeColorPanel(WMColorPanel
*panel
);
1353 void WMShowColorPanel(WMColorPanel
*panel
);
1355 void WMCloseColorPanel(WMColorPanel
*panel
);
1357 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1359 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1361 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1363 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1365 extern char *WMColorPanelColorChangedNotification
;
1367 /* ....................................................................... */
1369 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1371 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1373 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1375 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1378 extern char *WMColorWellDidChangeNotification
;
1381 /* ...................................................................... */
1383 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1385 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1386 unsigned int height
);
1388 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1390 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1392 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1394 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1396 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1398 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1400 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1402 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1404 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1406 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1408 /* ....................................................................... */
1410 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1412 int WMGetSliderMinValue(WMSlider
*slider
);
1414 int WMGetSliderMaxValue(WMSlider
*slider
);
1416 int WMGetSliderValue(WMSlider
*slider
);
1418 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1420 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1422 void WMSetSliderValue(WMSlider
*slider
, int value
);
1424 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1426 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1428 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1430 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1432 /* ....................................................................... */
1435 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1436 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1437 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1439 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1441 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1443 /* remove the first subview == view */
1444 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1446 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1449 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1451 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1453 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1454 WMSplitViewConstrainProc
*proc
);
1457 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1458 WMSplitViewResizeSubviewsProc *proc);
1461 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1463 /* ...................................................................... */
1465 WMRuler
*WMCreateRuler (WMWidget
*parent
);
1467 WMRulerMargins
*WMGetRulerMargins(WMRuler
*rPtr
);
1469 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1471 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
,
1472 WMRulerMargins
*anotherMargin
);
1474 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1476 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1478 int WMGetRulerOffset(WMRuler
*rPtr
);
1480 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1482 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1484 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1486 /* ....................................................................... */
1489 #define WMCreateText(parent) WMCreateTextForDocumentType \
1490 ((parent), (NULL), (NULL))
1492 WMText
*WMCreateTextForDocumentType(WMWidget
*parent
,
1493 WMAction
*parser
, WMAction
*writer
);
1495 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1497 void WMFreezeText(WMText
*tPtr
);
1499 #define WMRefreshText(tPtr) WMThawText((tPtr))
1501 void WMThawText(WMText
*tPtr
);
1503 int WMScrollText(WMText
*tPtr
, int amount
);
1505 int WMPageText(WMText
*tPtr
, Bool direction
);
1507 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1509 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1511 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1513 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1515 int WMGetTextRulerShown(WMText
*tPtr
);
1517 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1519 int WMGetTextEditable(WMText
*tPtr
);
1521 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1523 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1525 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1527 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1529 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1531 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1533 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1535 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1537 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1539 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1541 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1543 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1545 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1547 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1549 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1552 char * WMGetTextStream(WMText
*tPtr
);
1555 char * WMGetTextSelectedStream(WMText
*tPtr
);
1557 /* destroy the array */
1558 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1560 /* destroy the array */
1561 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1563 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1565 WMColor
*WMGetTextSelectionColor(WMText
*tPtr
);
1567 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1569 WMFont
*WMGetTextSelectionFont(WMText
*tPtr
);
1571 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1573 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1575 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1577 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1578 Bool caseSensitive
);
1580 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1583 /* parser related stuff... use only if implementing a new parser */
1585 void *WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1586 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1588 void *WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1589 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1591 void *WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1592 WMColor
*color
, unsigned short first
, unsigned short length
);
1594 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1595 unsigned int kanji
, unsigned int underlined
, int script
,
1596 WMRulerMargins
*margins
);
1598 /* do NOT free the margins */
1599 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1600 unsigned int *kanji
, unsigned int *underlined
, int *script
,
1601 WMRulerMargins
*margins
);
1603 int WMGetTextInsertType(WMText
*tPtr
);
1605 int WMGetTextBlocks(WMText
*tPtr
);
1607 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1609 int WMGetCurrentTextBlock(WMText
*tPtr
);
1611 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1613 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1615 void *WMRemoveTextBlock(WMText
*tPtr
);
1617 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1619 /* ....................................................................... */
1622 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1624 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1626 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1628 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1630 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1632 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1634 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1636 WMTabViewItem
*WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1637 int identifier
, char *label
);
1639 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1641 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1643 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1645 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1647 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1649 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1651 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1653 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1655 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1658 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1660 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1662 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1664 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1666 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1668 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1670 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1673 /* ....................................................................... */
1675 WMBox
*WMCreateBox(WMWidget
*parent
);
1677 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1679 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1680 int minSize
, int maxSize
, int space
);
1682 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1683 int minSize
, int maxSize
, int space
);
1685 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1687 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1689 void WMSetBoxExpandsToParent(WMBox
*box
, int topOffs
, int bottomOffs
,
1690 int leftOffs
, int rightOffs
);
1692 /* ....................................................................... */
1694 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1695 char *defaultButton
, char *alternateButton
,
1698 /* you can free the returned string */
1699 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1700 char *defaultText
, char *okButton
, char *cancelButton
);
1702 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1703 char *msg
, char *defaultButton
,
1704 char *alternateButton
, char *otherButton
);
1706 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1707 char *msg
, char *defaultText
, char *okButton
,
1708 char *cancelButton
);
1710 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1712 void WMDestroyInputPanel(WMInputPanel
*panel
);
1714 /* ....................................................................... */
1716 /* only 1 instance per WMScreen */
1717 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1719 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1721 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1723 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1725 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1727 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1729 /* you can free the returned string */
1730 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1732 void WMFreeFilePanel(WMFilePanel
*panel
);
1734 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1735 char *path
, char *name
, char **fileTypes
);
1737 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1739 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1742 /* ...................................................................... */
1744 /* only 1 instance per WMScreen */
1745 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1747 void WMShowFontPanel(WMFontPanel
*panel
);
1749 void WMHideFontPanel(WMFontPanel
*panel
);
1751 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1753 /* you can free the returned string */
1754 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1756 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1760 #endif /* __cplusplus */