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 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
46 #define _DEFINED_GNUSTEP_WINDOW_INFO
48 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
49 * NSDesktopWindowLevel intended to be the level at which things
50 * on the desktop sit ... so you should be able
51 * to put a desktop background just below it.
53 * Applications are actually permitted to use any value in the
54 * range INT_MIN+1 to INT_MAX
57 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
58 WMNormalWindowLevel
= 0,
59 WMFloatingWindowLevel
= 3,
60 WMSubmenuWindowLevel
= 3,
61 WMTornOffMenuWindowLevel
= 3,
62 WMMainMenuWindowLevel
= 20,
63 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
64 WMStatusWindowLevel
= 21,
65 WMModalPanelWindowLevel
= 100,
66 WMPopUpMenuWindowLevel
= 101,
67 WMScreenSaverWindowLevel
= 1000
71 /* window attributes */
73 WMBorderlessWindowMask
= 0,
74 WMTitledWindowMask
= 1,
75 WMClosableWindowMask
= 2,
76 WMMiniaturizableWindowMask
= 4,
77 WMResizableWindowMask
= 8,
78 WMIconWindowMask
= 64,
79 WMMiniWindowMask
= 128
86 /* 0 is reserved for internal use */
92 WBTMomentaryChange
= 6,
97 /* button behaviour masks */
99 WBBSpringLoadedMask
= (1 << 0),
100 WBBPushInMask
= (1 << 1),
101 WBBPushChangeMask
= (1 << 2),
102 WBBPushLightMask
= (1 << 3),
103 WBBStateLightMask
= (1 << 5),
104 WBBStateChangeMask
= (1 << 6),
105 WBBStatePushMask
= (1 << 7)
109 /* frame title positions */
133 /* alignment types */
138 WAJustified
/* not valid for textfields */
154 /* scroller arrow position */
159 } WMScrollArrowPosition
;
174 /* usable scroller parts */
179 } WMUsableScrollerParts
;
191 WTTopTabsBevelBorder
,
198 /* text movement types */
200 WMIllegalTextMovement
,
201 WMReturnTextMovement
,
202 WMEscapeTextMovement
,
204 WMBacktabTextMovement
,
211 /* text field special events */
219 WLNotFound
= -1 /* element was not found in WMList */
223 /* drag operations */
231 } WMDragOperationType
;
235 WMGrayModeColorPanel
= 1,
236 WMRGBModeColorPanel
= 2,
237 WMCMYKModeColorPanel
= 3,
238 WMHSBModeColorPanel
= 4,
239 WMCustomPaletteModeColorPanel
= 5,
240 WMColorListModeColorPanel
= 6,
241 WMWheelModeColorPanel
= 7
247 #define WSIReturnArrow 1
248 #define WSIHighlightedReturnArrow 2
249 #define WSIScrollerDimple 3
250 #define WSIArrowLeft 4
251 #define WSIHighlightedArrowLeft 5
252 #define WSIArrowRight 6
253 #define WSIHighlightedArrowRight 7
255 #define WSIHighlightedArrowUp 9
256 #define WSIArrowDown 10
257 #define WSIHighlightedArrowDown 11
258 #define WSICheckMark 12
261 WLDSSelected
= (1 << 16),
262 WLDSDisabled
= (1 << 17),
263 WLDSFocused
= (1 << 18),
264 WLDSIsBranch
= (1 << 19)
267 /* alert panel return values */
277 /* types of input observers */
279 WIReadMask
= (1 << 0),
280 WIWriteMask
= (1 << 1),
281 WIExceptMask
= (1 << 2)
301 WC_Matrix
= 12, /* not ready */
304 WC_ProgressIndicator
= 15,
311 /* All widgets must start with the following structure
312 * in that order. Used for typecasting to get some generic data */
313 typedef struct W_WidgetType
{
320 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
321 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
326 typedef void WMWidget
;
328 typedef struct W_Pixmap WMPixmap
;
329 typedef struct W_Font WMFont
;
330 typedef struct W_Color WMColor
;
332 typedef struct W_Screen WMScreen
;
334 typedef struct W_View WMView
;
336 typedef struct W_Window WMWindow
;
337 typedef struct W_Frame WMFrame
;
338 typedef struct W_Button WMButton
;
339 typedef struct W_Label WMLabel
;
340 typedef struct W_TextField WMTextField
;
341 typedef struct W_Scroller WMScroller
;
342 typedef struct W_ScrollView WMScrollView
;
343 typedef struct W_List WMList
;
344 typedef struct W_Browser WMBrowser
;
345 typedef struct W_PopUpButton WMPopUpButton
;
346 typedef struct W_ProgressIndicator WMProgressIndicator
;
347 typedef struct W_ColorWell WMColorWell
;
348 typedef struct W_Slider WMSlider
;
349 typedef struct W_Matrix WMMatrix
; /* not ready */
350 typedef struct W_SplitView WMSplitView
;
351 typedef struct W_TabView WMTabView
;
352 typedef struct W_Ruler WMRuler
;
353 typedef struct W_Text WMText
;
354 typedef struct W_Box WMBox
;
358 typedef struct W_TabViewItem WMTabViewItem
;
359 typedef struct W_MenuItem WMMenuItem
;
362 typedef struct W_FilePanel WMFilePanel
;
363 typedef WMFilePanel WMOpenPanel
;
364 typedef WMFilePanel WMSavePanel
;
366 typedef struct W_FontPanel WMFontPanel
;
368 typedef struct W_ColorPanel WMColorPanel
;
371 /* item for WMList */
372 typedef struct WMListItem
{
374 void *clientData
; /* ptr for user clientdata. */
376 unsigned int uflags
:16; /* flags for the user */
377 unsigned int selected
:1;
378 unsigned int disabled
:1;
379 unsigned int isBranch
:1;
380 unsigned int loaded
:1;
383 /* struct for message panel */
384 typedef struct WMAlertPanel
{
385 WMWindow
*win
; /* window */
387 WMButton
*defBtn
; /* default button */
388 WMButton
*altBtn
; /* alternative button */
389 WMButton
*othBtn
; /* other button */
390 WMLabel
*iLbl
; /* icon label */
391 WMLabel
*tLbl
; /* title label */
392 WMLabel
*mLbl
; /* message label */
393 WMFrame
*line
; /* separator */
394 short result
; /* button that was pushed */
398 typedef struct WMGenericPanel
{
419 typedef struct WMInputPanel
{
420 WMWindow
*win
; /* window */
421 WMButton
*defBtn
; /* default button */
422 WMButton
*altBtn
; /* alternative button */
423 WMLabel
*tLbl
; /* title label */
424 WMLabel
*mLbl
; /* message label */
425 WMTextField
*text
; /* text field */
426 short result
; /* button that was pushed */
432 WMArray
*tabs
; /* a growable array of tabstops */
433 unsigned short left
; /* left margin marker */
434 unsigned short right
; /* right margin marker */
435 unsigned short first
; /* indentation marker for first line only */
436 unsigned short body
; /* body indentation marker */
437 unsigned short retainCount
;
439 /* All indentation and tab markers are _relative_ to the left margin marker */
442 typedef void WMEventProc(XEvent
*event
, void *clientData
);
444 typedef void WMEventHook(XEvent
*event
);
446 /* self is set to the widget from where the callback is being called and
447 * clientData to the data set to with WMSetClientData() */
448 typedef void WMAction(WMWidget
*self
, void *clientData
);
450 /* same as WMAction, but for stuff that arent widgets */
451 typedef void WMAction2(void *self
, void *clientData
);
454 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
456 /* delegate method like stuff */
457 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
458 int state
, WMRect
*rect
);
461 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
462 unsigned int oldWidth,
463 unsigned int oldHeight);
466 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
467 int *minSize
, int *maxSize
);
469 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
474 typedef struct WMBrowserDelegate
{
477 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
478 WMBrowser
*sender
, int column
, WMList
*list
);
480 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
483 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
485 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
489 typedef struct WMTextFieldDelegate
{
492 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
493 WMNotification
*notif
);
495 void (*didChange
)(struct WMTextFieldDelegate
*self
,
496 WMNotification
*notif
);
498 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
499 WMNotification
*notif
);
501 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
504 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
506 } WMTextFieldDelegate
;
509 typedef struct WMTextDelegate
{
512 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
519 typedef struct WMTabViewDelegate
{
522 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
525 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
526 WMTabViewItem
*item
);
528 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
529 WMTabViewItem
*item
);
531 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
532 WMTabViewItem
*item
);
538 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
539 Time timestamp
, void *cdata
, WMData
*data
);
542 typedef struct WMSelectionProcs
{
543 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
544 void *cdata
, Atom
*type
);
545 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
546 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
551 typedef struct W_DraggingInfo WMDraggingInfo
;
554 typedef struct W_DragSourceProcs
{
555 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
556 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
557 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
559 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
560 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
565 typedef struct W_DragDestinationProcs
{
566 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
567 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
568 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
569 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
570 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
571 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
572 } WMDragDestinationProcs
;
576 /* ...................................................................... */
579 WMRange
wmkrange(int start
, int count
);
581 WMPoint
wmkpoint(int x
, int y
);
583 WMSize
wmksize(unsigned int width
, unsigned int height
);
586 /* ....................................................................... */
590 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
592 void WMSetResourcePath(char *path
);
594 /* don't free the returned string */
595 char *WMGetApplicationName();
597 /* Try to locate resource file. ext may be NULL */
598 char *WMPathForResourceOfType(char *resource
, char *ext
);
601 WMScreen
*WMOpenScreen(const char *display
);
603 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
606 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
608 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
610 void WMScreenMainLoop(WMScreen
*scr
);
612 void WMBreakModalLoop(WMScreen
*scr
);
614 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
616 RContext
*WMScreenRContext(WMScreen
*scr
);
618 Display
*WMScreenDisplay(WMScreen
*scr
);
620 int WMScreenDepth(WMScreen
*scr
);
624 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
626 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
628 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
630 void WMSetFocusToWidget(WMWidget
*widget
);
632 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
634 int WMHandleEvent(XEvent
*event
);
636 Bool
WMScreenPending(WMScreen
*scr
);
638 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
639 WMEventProc
*eventProc
, void *clientData
);
641 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
642 WMEventProc
*eventProc
, void *clientData
);
644 int WMIsDoubleClick(XEvent
*event
);
646 int WMIsTripleClick(XEvent
*event
);
648 void WMNextEvent(Display
*dpy
, XEvent
*event
);
650 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
653 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
654 WMSelectionProcs
*procs
, void *cdata
);
656 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
658 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
659 Time timestamp
, WMSelectionCallback
*callback
,
663 /* ....................................................................... */
665 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
667 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
668 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
671 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
673 void WMUnregisterViewDraggedTypes(WMView
*view
);
675 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
678 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
680 /* ....................................................................... */
682 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
684 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
686 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
688 WMFont
*WMRetainFont(WMFont
*font
);
690 void WMReleaseFont(WMFont
*font
);
692 unsigned int WMFontHeight(WMFont
*font
);
695 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
697 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
701 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
703 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
705 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
707 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
709 XFontSet
WMGetFontFontSet(WMFont
*font
);
711 WMFont
*WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
713 WMFont
*WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
715 WMFont
*WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
717 WMFont
*WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
719 WMFont
*WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
721 WMFont
*WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
723 /* ....................................................................... */
725 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
727 void WMReleasePixmap(WMPixmap
*pixmap
);
729 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
732 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
733 Pixmap mask
, int width
, int height
,
736 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
739 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
741 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
743 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
745 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
748 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
750 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
752 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
754 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
756 /* ....................................................................... */
759 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
761 WMColor
*WMGrayColor(WMScreen
*scr
);
763 WMColor
*WMBlackColor(WMScreen
*scr
);
765 WMColor
*WMWhiteColor(WMScreen
*scr
);
767 void WMSetColorInGC(WMColor
*color
, GC gc
);
769 GC
WMColorGC(WMColor
*color
);
771 WMPixel
WMColorPixel(WMColor
*color
);
773 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
774 unsigned int width
, unsigned int height
);
776 void WMReleaseColor(WMColor
*color
);
778 WMColor
*WMRetainColor(WMColor
*color
);
780 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
781 unsigned short green
, unsigned short blue
,
784 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
786 unsigned short WMRedComponentOfColor(WMColor
*color
);
788 unsigned short WMGreenComponentOfColor(WMColor
*color
);
790 unsigned short WMBlueComponentOfColor(WMColor
*color
);
792 char *WMGetColorRGBDescription(WMColor
*color
);
794 /* ....................................................................... */
797 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
798 int y
, char *text
, int length
);
800 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
801 int y
, char *text
, int length
);
803 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
807 /* ....................................................................... */
809 WMScreen
*WMWidgetScreen(WMWidget
*w
);
811 unsigned int WMScreenWidth(WMScreen
*scr
);
813 unsigned int WMScreenHeight(WMScreen
*scr
);
815 void WMUnmapWidget(WMWidget
*w
);
817 void WMMapWidget(WMWidget
*w
);
819 Bool
WMWidgetIsMapped(WMWidget
*w
);
821 void WMRaiseWidget(WMWidget
*w
);
823 void WMLowerWidget(WMWidget
*w
);
825 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
827 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
829 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
831 void WMMapSubwidgets(WMWidget
*w
);
833 void WMUnmapSubwidgets(WMWidget
*w
);
835 void WMRealizeWidget(WMWidget
*w
);
837 void WMDestroyWidget(WMWidget
*widget
);
839 void WMHangData(WMWidget
*widget
, void *data
);
841 void *WMGetHangedData(WMWidget
*widget
);
843 unsigned int WMWidgetWidth(WMWidget
*w
);
845 unsigned int WMWidgetHeight(WMWidget
*w
);
847 Window
WMWidgetXID(WMWidget
*w
);
849 Window
WMViewXID(WMView
*view
);
851 void WMRedisplayWidget(WMWidget
*w
);
853 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
855 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
856 int rightOffs
, int bottomOffs
);
858 WMSize
WMGetViewSize(WMView
*view
);
860 WMPoint
WMGetViewPosition(WMView
*view
);
862 WMPoint
WMGetViewScreenPosition(WMView
*view
);
864 WMWidget
*WMWidgetOfView(WMView
*view
);
866 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
868 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
871 extern char *WMViewSizeDidChangeNotification
;
873 extern char *WMViewRealizedNotification
;
875 extern char *WMFontPanelDidChangeNotification
;
878 /* ....................................................................... */
880 void WMSetBalloonTextForView(char *text
, WMView
*view
);
882 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
884 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
886 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
888 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
890 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
893 /* ....................................................................... */
895 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
897 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
899 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
902 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
904 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
906 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
908 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
910 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
912 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
914 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
916 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
918 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
921 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
923 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
925 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
927 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
929 void WMSetWindowLevel(WMWindow
*win
, int level
);
931 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
933 void WMCloseWindow(WMWindow
*win
);
935 /* ....................................................................... */
937 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
939 #define WMCreateCommandButton(parent) \
940 WMCreateCustomButton((parent), WBBSpringLoadedMask\
945 #define WMCreateRadioButton(parent) \
946 WMCreateButton((parent), WBTRadio)
948 #define WMCreateSwitchButton(parent) \
949 WMCreateButton((parent), WBTSwitch)
951 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
953 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
955 void WMSetButtonImageDefault(WMButton
*bPtr
);
957 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
959 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
961 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
963 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
965 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
967 void WMSetButtonText(WMButton
*bPtr
, char *text
);
969 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
971 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
973 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
975 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
977 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
979 int WMGetButtonSelected(WMButton
*bPtr
);
981 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
983 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
985 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
987 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
989 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
991 void WMPerformButtonClick(WMButton
*bPtr
);
993 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
995 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
997 /* ....................................................................... */
999 WMLabel
*WMCreateLabel(WMWidget
*parent
);
1001 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1003 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1005 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
1007 char *WMGetLabelText(WMLabel
*lPtr
);
1009 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1011 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1013 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1015 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1017 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
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
);
1567 #define WMClearText(tPtr) WMAppendTextStream \
1571 char * WMGetTextStream(WMText
*tPtr
);
1574 char * WMGetTextSelectedStream(WMText
*tPtr
);
1576 /* destroy the array */
1577 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1579 /* destroy the array */
1580 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1582 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1584 WMColor
*WMGetTextSelectionColor(WMText
*tPtr
);
1586 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1588 WMFont
*WMGetTextSelectionFont(WMText
*tPtr
);
1590 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1592 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1594 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1596 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1597 Bool caseSensitive
);
1599 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1602 /* parser related stuff... use only if implementing a new parser */
1604 void *WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1605 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1607 void *WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1608 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1610 void *WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1611 WMColor
*color
, unsigned short first
, unsigned short length
);
1613 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1614 unsigned int kanji
, unsigned int underlined
, int script
,
1615 WMRulerMargins
*margins
);
1617 /* do NOT free the margins */
1618 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1619 unsigned int *kanji
, unsigned int *underlined
, int *script
,
1620 WMRulerMargins
*margins
);
1622 int WMGetTextInsertType(WMText
*tPtr
);
1624 int WMGetTextBlocks(WMText
*tPtr
);
1626 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1628 int WMGetCurrentTextBlock(WMText
*tPtr
);
1630 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1632 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1634 void *WMRemoveTextBlock(WMText
*tPtr
);
1636 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1638 /* ....................................................................... */
1641 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1643 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1645 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1647 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1649 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1651 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1653 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1655 WMTabViewItem
*WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1656 int identifier
, char *label
);
1658 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1660 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1662 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1664 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1666 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1668 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1670 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1672 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1674 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1677 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1679 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1681 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1683 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1685 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1687 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1689 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1692 /* ....................................................................... */
1694 WMBox
*WMCreateBox(WMWidget
*parent
);
1696 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1698 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1699 int minSize
, int maxSize
, int space
);
1701 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1702 int minSize
, int maxSize
, int space
);
1704 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1706 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
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
);
1727 WMGenericPanel
*WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1728 char *title
, char *defaultButton
,
1729 char *alternateButton
);
1731 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1733 void WMDestroyInputPanel(WMInputPanel
*panel
);
1735 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1737 /* ....................................................................... */
1739 /* only 1 instance per WMScreen */
1740 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1742 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1744 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1746 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1748 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1750 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1752 /* you can free the returned string */
1753 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1755 void WMFreeFilePanel(WMFilePanel
*panel
);
1757 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1758 char *path
, char *name
, char **fileTypes
);
1760 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1762 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1765 /* ...................................................................... */
1767 /* only 1 instance per WMScreen */
1768 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1770 void WMShowFontPanel(WMFontPanel
*panel
);
1772 void WMHideFontPanel(WMFontPanel
*panel
);
1774 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1776 /* you can free the returned string */
1777 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1779 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1783 #endif /* __cplusplus */