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)
46 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
47 * NSDesktopWindowLevel intended to be the level at which things
48 * on the desktop sit ... so you should be able
49 * to put a desktop background just below it.
51 * Applications are actually permitted to use any value in the
52 * range INT_MIN+1 to INT_MAX
55 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
56 WMNormalWindowLevel
= 0,
57 WMFloatingWindowLevel
= 3,
58 WMSubmenuWindowLevel
= 3,
59 WMTornOffMenuWindowLevel
= 3,
60 WMMainMenuWindowLevel
= 20,
61 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
62 WMStatusWindowLevel
= 21,
63 WMModalPanelWindowLevel
= 100,
64 WMPopUpMenuWindowLevel
= 101,
65 WMScreenSaverWindowLevel
= 1000
69 /* window attributes */
71 WMBorderlessWindowMask
= 0,
72 WMTitledWindowMask
= 1,
73 WMClosableWindowMask
= 2,
74 WMMiniaturizableWindowMask
= 4,
75 WMResizableWindowMask
= 8,
76 WMIconWindowMask
= 64,
77 WMMiniWindowMask
= 128
82 /* 0 is reserved for internal use */
88 WBTMomentaryChange
= 6,
93 /* button behaviour masks */
95 WBBSpringLoadedMask
= (1 << 0),
96 WBBPushInMask
= (1 << 1),
97 WBBPushChangeMask
= (1 << 2),
98 WBBPushLightMask
= (1 << 3),
99 WBBStateLightMask
= (1 << 5),
100 WBBStateChangeMask
= (1 << 6),
101 WBBStatePushMask
= (1 << 7)
105 /* frame title positions */
129 /* alignment types */
134 WAJustified
/* not valid for textfields */
150 /* scroller arrow position */
155 } WMScrollArrowPosition
;
170 /* usable scroller parts */
175 } WMUsableScrollerParts
;
187 WTTopTabsBevelBorder
,
194 /* text movement types */
196 WMIllegalTextMovement
,
197 WMReturnTextMovement
,
198 WMEscapeTextMovement
,
200 WMBacktabTextMovement
,
207 /* text field special events */
215 WLNotFound
= -1 /* element was not found in WMList */
219 /* drag operations */
227 } WMDragOperationType
;
231 WMGrayModeColorPanel
= 1,
232 WMRGBModeColorPanel
= 2,
233 WMCMYKModeColorPanel
= 3,
234 WMHSBModeColorPanel
= 4,
235 WMCustomPaletteModeColorPanel
= 5,
236 WMColorListModeColorPanel
= 6,
237 WMWheelModeColorPanel
= 7
243 #define WSIReturnArrow 1
244 #define WSIHighlightedReturnArrow 2
245 #define WSIScrollerDimple 3
246 #define WSIArrowLeft 4
247 #define WSIHighlightedArrowLeft 5
248 #define WSIArrowRight 6
249 #define WSIHighlightedArrowRight 7
251 #define WSIHighlightedArrowUp 9
252 #define WSIArrowDown 10
253 #define WSIHighlightedArrowDown 11
254 #define WSICheckMark 12
257 WLDSSelected
= (1 << 16),
258 WLDSDisabled
= (1 << 17),
259 WLDSFocused
= (1 << 18),
260 WLDSIsBranch
= (1 << 19)
263 /* alert panel return values */
273 /* types of input observers */
275 WIReadMask
= (1 << 0),
276 WIWriteMask
= (1 << 1),
277 WIExceptMask
= (1 << 2)
297 WC_Matrix
= 12, /* not ready */
300 WC_ProgressIndicator
= 15,
307 /* All widgets must start with the following structure
308 * in that order. Used for typecasting to get some generic data */
309 typedef struct W_WidgetType
{
316 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
317 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
322 typedef void WMWidget
;
324 typedef struct W_Pixmap WMPixmap
;
325 typedef struct W_Font WMFont
;
326 typedef struct W_Color WMColor
;
328 typedef struct W_Screen WMScreen
;
330 typedef struct W_View WMView
;
332 typedef struct W_Window WMWindow
;
333 typedef struct W_Frame WMFrame
;
334 typedef struct W_Button WMButton
;
335 typedef struct W_Label WMLabel
;
336 typedef struct W_TextField WMTextField
;
337 typedef struct W_Scroller WMScroller
;
338 typedef struct W_ScrollView WMScrollView
;
339 typedef struct W_List WMList
;
340 typedef struct W_Browser WMBrowser
;
341 typedef struct W_PopUpButton WMPopUpButton
;
342 typedef struct W_ProgressIndicator WMProgressIndicator
;
343 typedef struct W_ColorWell WMColorWell
;
344 typedef struct W_Slider WMSlider
;
345 typedef struct W_Matrix WMMatrix
; /* not ready */
346 typedef struct W_SplitView WMSplitView
;
347 typedef struct W_TabView WMTabView
;
348 typedef struct W_Ruler WMRuler
;
349 typedef struct W_Text WMText
;
350 typedef struct W_Box WMBox
;
354 typedef struct W_TabViewItem WMTabViewItem
;
355 typedef struct W_MenuItem WMMenuItem
;
358 typedef struct W_FilePanel WMFilePanel
;
359 typedef WMFilePanel WMOpenPanel
;
360 typedef WMFilePanel WMSavePanel
;
362 typedef struct W_FontPanel WMFontPanel
;
364 typedef struct W_ColorPanel WMColorPanel
;
367 /* item for WMList */
368 typedef struct WMListItem
{
370 void *clientData
; /* ptr for user clientdata. */
372 unsigned int uflags
:16; /* flags for the user */
373 unsigned int selected
:1;
374 unsigned int disabled
:1;
375 unsigned int isBranch
:1;
376 unsigned int loaded
:1;
379 /* struct for message panel */
380 typedef struct WMAlertPanel
{
381 WMWindow
*win
; /* window */
383 WMButton
*defBtn
; /* default button */
384 WMButton
*altBtn
; /* alternative button */
385 WMButton
*othBtn
; /* other button */
386 WMLabel
*iLbl
; /* icon label */
387 WMLabel
*tLbl
; /* title label */
388 WMLabel
*mLbl
; /* message label */
389 WMFrame
*line
; /* separator */
390 short result
; /* button that was pushed */
398 typedef struct WMInputPanel
{
399 WMWindow
*win
; /* window */
400 WMButton
*defBtn
; /* default button */
401 WMButton
*altBtn
; /* alternative button */
402 WMLabel
*tLbl
; /* title label */
403 WMLabel
*mLbl
; /* message label */
404 WMTextField
*text
; /* text field */
405 short result
; /* button that was pushed */
417 WMArray
*tabs
; /* a growable array of tabstops */
418 unsigned short left
; /* left margin marker */
419 unsigned short right
; /* right margin marker */
420 unsigned short first
; /* indentation marker for first line only */
421 unsigned short body
; /* body indentation marker */
422 unsigned short retainCount
;
424 /* All indentation and tab markers are _relative_ to the left margin marker */
427 typedef void *WMHandlerID
;
429 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
431 typedef void WMEventProc(XEvent
*event
, void *clientData
);
433 typedef void WMEventHook(XEvent
*event
);
435 /* self is set to the widget from where the callback is being called and
436 * clientData to the data set to with WMSetClientData() */
437 typedef void WMAction(WMWidget
*self
, void *clientData
);
439 /* same as WMAction, but for stuff that arent widgets */
440 typedef void WMAction2(void *self
, void *clientData
);
443 typedef void WMCallback(void *data
);
445 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
447 /* delegate method like stuff */
448 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
449 int state
, WMRect
*rect
);
452 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
453 unsigned int oldWidth,
454 unsigned int oldHeight);
457 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
458 int *minSize
, int *maxSize
);
460 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
465 typedef struct WMBrowserDelegate
{
468 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
469 WMBrowser
*sender
, int column
, WMList
*list
);
471 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
474 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
476 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
480 typedef struct WMTextFieldDelegate
{
483 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
484 WMNotification
*notif
);
486 void (*didChange
)(struct WMTextFieldDelegate
*self
,
487 WMNotification
*notif
);
489 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
490 WMNotification
*notif
);
492 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
495 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
497 } WMTextFieldDelegate
;
500 typedef struct WMTextDelegate
{
503 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
510 typedef struct WMTabViewDelegate
{
513 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
516 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
517 WMTabViewItem
*item
);
519 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
520 WMTabViewItem
*item
);
522 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
523 WMTabViewItem
*item
);
529 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
530 Time timestamp
, void *cdata
, WMData
*data
);
533 typedef struct WMSelectionProcs
{
534 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
535 void *cdata
, Atom
*type
);
536 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
537 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
542 typedef struct W_DraggingInfo WMDraggingInfo
;
545 typedef struct W_DragSourceProcs
{
546 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
547 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
548 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
550 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
551 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
556 typedef struct W_DragDestinationProcs
{
557 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
558 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
559 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
560 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
561 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
562 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
563 } WMDragDestinationProcs
;
567 /* ...................................................................... */
570 WMRange
wmkrange(int start
, int count
);
572 WMPoint
wmkpoint(int x
, int y
);
574 WMSize
wmksize(unsigned int width
, unsigned int height
);
577 /* ....................................................................... */
581 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
583 void WMSetResourcePath(char *path
);
585 /* don't free the returned string */
586 char *WMGetApplicationName();
588 /* Try to locate resource file. ext may be NULL */
589 char *WMPathForResourceOfType(char *resource
, char *ext
);
591 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
594 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
596 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
598 void WMScreenMainLoop(WMScreen
*scr
);
600 void WMBreakModalLoop(WMScreen
*scr
);
602 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
604 RContext
*WMScreenRContext(WMScreen
*scr
);
606 Display
*WMScreenDisplay(WMScreen
*scr
);
608 int WMScreenDepth(WMScreen
*scr
);
612 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
614 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
616 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
618 void WMSetFocusToWidget(WMWidget
*widget
);
620 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
622 int WMHandleEvent(XEvent
*event
);
624 Bool
WMScreenPending(WMScreen
*scr
);
626 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
627 WMEventProc
*eventProc
, void *clientData
);
629 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
630 WMEventProc
*eventProc
, void *clientData
);
632 int WMIsDoubleClick(XEvent
*event
);
634 int WMIsTripleClick(XEvent
*event
);
636 void WMNextEvent(Display
*dpy
, XEvent
*event
);
638 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
640 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
643 void WMDeleteTimerWithClientData(void *cdata
);
645 void WMDeleteTimerHandler(WMHandlerID handlerID
);
647 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
649 void WMDeleteIdleHandler(WMHandlerID handlerID
);
651 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
654 void WMDeleteInputHandler(WMHandlerID handlerID
);
658 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
659 WMSelectionProcs
*procs
, void *cdata
);
661 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
663 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
664 Time timestamp
, WMSelectionCallback
*callback
,
668 /* ....................................................................... */
670 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
672 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
673 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
676 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
678 void WMUnregisterViewDraggedTypes(WMView
*view
);
680 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
683 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
685 /* ....................................................................... */
687 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
689 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
691 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
693 WMFont
*WMRetainFont(WMFont
*font
);
695 void WMReleaseFont(WMFont
*font
);
697 unsigned int WMFontHeight(WMFont
*font
);
700 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
702 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
706 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
708 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
710 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
712 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
714 XFontSet
WMGetFontFontSet(WMFont
*font
);
716 WMFont
* WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
718 WMFont
* WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
720 WMFont
* WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
722 WMFont
* WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
724 WMFont
* WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
726 WMFont
* WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
728 /* ....................................................................... */
730 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
732 void WMReleasePixmap(WMPixmap
*pixmap
);
734 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
737 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
738 Pixmap mask
, int width
, int height
,
741 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
744 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
746 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
748 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
750 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
753 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
755 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
757 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
759 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
761 /* ....................................................................... */
764 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
766 WMColor
*WMGrayColor(WMScreen
*scr
);
768 WMColor
*WMBlackColor(WMScreen
*scr
);
770 WMColor
*WMWhiteColor(WMScreen
*scr
);
772 void WMSetColorInGC(WMColor
*color
, GC gc
);
774 GC
WMColorGC(WMColor
*color
);
776 WMPixel
WMColorPixel(WMColor
*color
);
778 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
779 unsigned int width
, unsigned int height
);
781 void WMReleaseColor(WMColor
*color
);
783 WMColor
*WMRetainColor(WMColor
*color
);
785 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
786 unsigned short green
, unsigned short blue
,
789 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
791 unsigned short WMRedComponentOfColor(WMColor
*color
);
793 unsigned short WMGreenComponentOfColor(WMColor
*color
);
795 unsigned short WMBlueComponentOfColor(WMColor
*color
);
797 char *WMGetColorRGBDescription(WMColor
*color
);
799 /* ....................................................................... */
802 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
803 int y
, char *text
, int length
);
805 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
806 int y
, char *text
, int length
);
808 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
812 /* ....................................................................... */
814 WMScreen
*WMWidgetScreen(WMWidget
*w
);
816 unsigned int WMScreenWidth(WMScreen
*scr
);
818 unsigned int WMScreenHeight(WMScreen
*scr
);
820 void WMUnmapWidget(WMWidget
*w
);
822 void WMMapWidget(WMWidget
*w
);
824 Bool
WMWidgetIsMapped(WMWidget
*w
);
826 void WMRaiseWidget(WMWidget
*w
);
828 void WMLowerWidget(WMWidget
*w
);
830 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
832 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
834 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
836 void WMMapSubwidgets(WMWidget
*w
);
838 void WMUnmapSubwidgets(WMWidget
*w
);
840 void WMRealizeWidget(WMWidget
*w
);
842 void WMDestroyWidget(WMWidget
*widget
);
844 void WMHangData(WMWidget
*widget
, void *data
);
846 void *WMGetHangedData(WMWidget
*widget
);
848 unsigned int WMWidgetWidth(WMWidget
*w
);
850 unsigned int WMWidgetHeight(WMWidget
*w
);
852 Window
WMWidgetXID(WMWidget
*w
);
854 Window
WMViewXID(WMView
*view
);
856 void WMRedisplayWidget(WMWidget
*w
);
858 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
860 WMSize
WMGetViewSize(WMView
*view
);
862 WMPoint
WMGetViewPosition(WMView
*view
);
864 WMPoint
WMGetViewScreenPosition(WMView
*view
);
866 WMWidget
*WMWidgetOfView(WMView
*view
);
868 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
870 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
873 extern char *WMViewSizeDidChangeNotification
;
875 extern char *WMViewRealizedNotification
;
877 extern char *WMFontPanelDidChangeNotification
;
880 /* ....................................................................... */
882 void WMSetBalloonTextForView(char *text
, WMView
*view
);
884 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
886 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
888 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
890 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
892 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
895 /* ....................................................................... */
897 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
899 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
901 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
904 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
906 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
908 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
910 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
912 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
914 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
916 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
918 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
920 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
923 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
925 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
927 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
929 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
931 void WMSetWindowLevel(WMWindow
*win
, int level
);
933 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
935 void WMCloseWindow(WMWindow
*win
);
937 /* ....................................................................... */
939 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
941 #define WMCreateCommandButton(parent) \
942 WMCreateCustomButton((parent), WBBSpringLoadedMask\
947 #define WMCreateRadioButton(parent) \
948 WMCreateButton((parent), WBTRadio)
950 #define WMCreateSwitchButton(parent) \
951 WMCreateButton((parent), WBTSwitch)
953 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
955 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
957 void WMSetButtonImageDefault(WMButton
*bPtr
);
959 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
961 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
963 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
965 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
967 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
969 void WMSetButtonText(WMButton
*bPtr
, char *text
);
971 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
973 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
975 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
977 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
979 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
981 int WMGetButtonSelected(WMButton
*bPtr
);
983 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
985 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
987 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
989 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
991 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
993 void WMPerformButtonClick(WMButton
*bPtr
);
995 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
997 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
999 /* ....................................................................... */
1001 WMLabel
*WMCreateLabel(WMWidget
*parent
);
1003 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1005 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1007 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
1009 char *WMGetLabelText(WMLabel
*lPtr
);
1011 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1013 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1015 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1017 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1019 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1021 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1023 /* ....................................................................... */
1025 WMFrame
*WMCreateFrame(WMWidget
*parent
);
1027 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1029 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1031 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1033 /* ....................................................................... */
1035 WMTextField
*WMCreateTextField(WMWidget
*parent
);
1037 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1039 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1041 /* you can free the returned string */
1042 char *WMGetTextFieldText(WMTextField
*tPtr
);
1044 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1046 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1048 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1050 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
1052 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1054 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1056 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1058 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1060 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1062 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1064 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1066 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1068 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1070 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1073 extern char *WMTextDidChangeNotification
;
1074 extern char *WMTextDidBeginEditingNotification
;
1075 extern char *WMTextDidEndEditingNotification
;
1077 /* ....................................................................... */
1079 WMScroller
*WMCreateScroller(WMWidget
*parent
);
1081 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1082 float knobProportion
);
1084 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1086 float WMGetScrollerValue(WMScroller
*sPtr
);
1088 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1090 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1092 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1093 WMScrollArrowPosition position
);
1095 extern char *WMScrollerDidScrollNotification
;
1097 /* ....................................................................... */
1099 WMList
*WMCreateList(WMWidget
*parent
);
1101 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1103 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1105 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1107 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1109 void WMSortListItems(WMList
*lPtr
);
1111 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1113 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1115 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
1117 WMArray
*WMGetListItems(WMList
*lPtr
);
1119 void WMRemoveListItem(WMList
*lPtr
, int row
);
1121 void WMSelectListItem(WMList
*lPtr
, int row
);
1123 void WMUnselectListItem(WMList
*lPtr
, int row
);
1125 /* This will select all items in range, and deselect all the others */
1126 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1128 /* This will select all items in range, leaving the others as they are */
1129 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1131 void WMSelectAllListItems(WMList
*lPtr
);
1133 void WMUnselectAllListItems(WMList
*lPtr
);
1135 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1137 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1139 int WMGetListItemHeight(WMList
*lPtr
);
1141 /* don't free the returned data */
1142 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1145 * For the following 2 functions, in case WMList allows multiple selection,
1146 * the first item in the list of selected items, respective its row number,
1150 /* don't free the returned data */
1151 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1153 int WMGetListSelectedItemRow(WMList
*lPtr
);
1155 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1157 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1159 void WMClearList(WMList
*lPtr
);
1161 int WMGetListNumberOfRows(WMList
*lPtr
);
1163 void WMSetListPosition(WMList
*lPtr
, int row
);
1165 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1167 int WMGetListPosition(WMList
*lPtr
);
1169 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1171 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1174 extern char *WMListDidScrollNotification
;
1175 extern char *WMListSelectionDidChangeNotification
;
1177 /* ....................................................................... */
1179 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1181 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1183 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1185 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1187 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1189 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1191 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1193 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1195 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1197 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1199 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1201 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1203 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1204 WMCompareDataProc
*func
);
1206 /* Don't free the returned string. */
1207 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1209 /* free the returned string */
1210 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1212 /* free the returned string */
1213 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1215 /* free the returned array */
1216 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1218 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1220 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1223 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1225 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1227 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1229 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1231 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1233 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1235 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1237 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1239 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1241 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1243 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1245 /* ....................................................................... */
1248 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1250 WMMenuItem
*WMCreateMenuItem(void);
1252 void WMDestroyMenuItem(WMMenuItem
*item
);
1254 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1256 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1258 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1260 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1262 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1264 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1266 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1268 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1270 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1272 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1274 void *WMGetMenuItemData(WMMenuItem
*item
);
1276 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1278 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1280 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1282 int WMGetMenuItemState(WMMenuItem
*item
);
1284 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1286 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1288 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1290 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1292 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1294 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1296 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1298 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1300 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1303 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1305 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1308 /* ....................................................................... */
1310 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1312 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1315 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1317 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1319 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1322 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1324 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1326 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1328 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1330 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1332 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1334 /* don't free the returned data */
1335 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1337 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1340 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1342 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1344 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1346 /* ....................................................................... */
1348 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1350 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1352 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1354 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1356 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1358 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1360 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1363 /* ....................................................................... */
1365 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1367 void WMFreeColorPanel(WMColorPanel
*panel
);
1369 void WMShowColorPanel(WMColorPanel
*panel
);
1371 void WMCloseColorPanel(WMColorPanel
*panel
);
1373 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1375 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1377 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1379 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1381 extern char *WMColorPanelColorChangedNotification
;
1383 /* ....................................................................... */
1385 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1387 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1389 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1391 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1394 extern char *WMColorWellDidChangeNotification
;
1397 /* ...................................................................... */
1399 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1401 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1402 unsigned int height
);
1404 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1406 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1408 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1410 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1412 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1414 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1416 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1418 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1420 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1422 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1424 /* ....................................................................... */
1426 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1428 int WMGetSliderMinValue(WMSlider
*slider
);
1430 int WMGetSliderMaxValue(WMSlider
*slider
);
1432 int WMGetSliderValue(WMSlider
*slider
);
1434 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1436 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1438 void WMSetSliderValue(WMSlider
*slider
, int value
);
1440 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1442 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1444 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1446 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1448 /* ....................................................................... */
1451 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1452 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1453 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1455 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1457 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1459 /* remove the first subview == view */
1460 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1462 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1465 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1467 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1469 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1470 WMSplitViewConstrainProc
*proc
);
1473 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1474 WMSplitViewResizeSubviewsProc *proc);
1477 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1479 /* ...................................................................... */
1481 WMRuler
*WMCreateRuler (WMWidget
*parent
);
1483 WMRulerMargins
*WMGetRulerMargins(WMRuler
*rPtr
);
1485 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1487 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
,
1488 WMRulerMargins
*anotherMargin
);
1490 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1492 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1494 int WMGetRulerOffset(WMRuler
*rPtr
);
1496 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1498 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1500 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1502 /* ....................................................................... */
1505 #define WMCreateText(parent) WMCreateTextForDocumentType \
1506 ((parent), (NULL), (NULL))
1508 WMText
*WMCreateTextForDocumentType(WMWidget
*parent
,
1509 WMAction
*parser
, WMAction
*writer
);
1511 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1513 void WMFreezeText(WMText
*tPtr
);
1515 #define WMRefreshText(tPtr) WMThawText((tPtr))
1517 void WMThawText(WMText
*tPtr
);
1519 int WMScrollText(WMText
*tPtr
, int amount
);
1521 int WMPageText(WMText
*tPtr
, Bool direction
);
1523 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1525 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1527 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1529 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1531 int WMGetTextRulerShown(WMText
*tPtr
);
1533 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1535 int WMGetTextEditable(WMText
*tPtr
);
1537 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1539 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1541 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1543 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1545 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1547 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1549 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1551 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1553 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1555 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1557 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1559 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1561 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1563 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1565 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1568 char * WMGetTextStream(WMText
*tPtr
);
1571 char * WMGetTextSelectedStream(WMText
*tPtr
);
1573 /* destroy the array */
1574 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1576 /* destroy the array */
1577 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1579 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1581 WMColor
*WMGetTextSelectionColor(WMText
*tPtr
);
1583 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1585 WMFont
*WMGetTextSelectionFont(WMText
*tPtr
);
1587 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1589 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1591 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1593 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1594 Bool caseSensitive
);
1596 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1599 /* parser related stuff... use only if implementing a new parser */
1601 void *WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1602 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1604 void *WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1605 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1607 void *WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1608 WMColor
*color
, unsigned short first
, unsigned short length
);
1610 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1611 unsigned int kanji
, unsigned int underlined
, int script
,
1612 WMRulerMargins
*margins
);
1614 /* do NOT free the margins */
1615 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1616 unsigned int *kanji
, unsigned int *underlined
, int *script
,
1617 WMRulerMargins
*margins
);
1619 int WMGetTextInsertType(WMText
*tPtr
);
1621 int WMGetTextBlocks(WMText
*tPtr
);
1623 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1625 int WMGetCurrentTextBlock(WMText
*tPtr
);
1627 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1629 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1631 void *WMRemoveTextBlock(WMText
*tPtr
);
1633 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1635 /* ....................................................................... */
1638 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1640 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1642 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1644 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1646 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1648 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1650 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1652 WMTabViewItem
*WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1653 int identifier
, char *label
);
1655 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1657 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1659 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1661 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1663 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1665 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1667 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1669 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1671 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1674 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1676 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1678 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1680 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1682 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1684 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1686 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1689 /* ....................................................................... */
1691 WMBox
*WMCreateBox(WMWidget
*parent
);
1693 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1695 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1696 int minSize
, int maxSize
, int space
);
1698 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1699 int minSize
, int maxSize
, int space
);
1701 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1703 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1705 void WMSetBoxExpandsToParent(WMBox
*box
, int topOffs
, int bottomOffs
,
1706 int leftOffs
, int rightOffs
);
1708 /* ....................................................................... */
1710 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1711 char *defaultButton
, char *alternateButton
,
1714 /* you can free the returned string */
1715 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1716 char *defaultText
, char *okButton
, char *cancelButton
);
1718 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1719 char *msg
, char *defaultButton
,
1720 char *alternateButton
, char *otherButton
);
1722 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1723 char *msg
, char *defaultText
, char *okButton
,
1724 char *cancelButton
);
1726 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1728 void WMDestroyInputPanel(WMInputPanel
*panel
);
1730 /* ....................................................................... */
1732 /* only 1 instance per WMScreen */
1733 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1735 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1737 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1739 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1741 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1743 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1745 /* you can free the returned string */
1746 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1748 void WMFreeFilePanel(WMFilePanel
*panel
);
1750 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1751 char *path
, char *name
, char **fileTypes
);
1753 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1755 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1758 /* ...................................................................... */
1760 /* only 1 instance per WMScreen */
1761 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1763 void WMShowFontPanel(WMFontPanel
*panel
);
1765 void WMHideFontPanel(WMFontPanel
*panel
);
1767 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1769 /* you can free the returned string */
1770 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1772 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1776 #endif /* __cplusplus */