7 #include <WINGs/WUtil.h>
10 #define WINGS_H_VERSION 20010117
15 #endif /* __cplusplus */
21 typedef unsigned long WMPixel
;
43 #define ClientMessageMask (1L<<30)
46 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
47 #define _DEFINED_GNUSTEP_WINDOW_INFO
49 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
50 * NSDesktopWindowLevel intended to be the level at which things
51 * on the desktop sit ... so you should be able
52 * to put a desktop background just below it.
54 * Applications are actually permitted to use any value in the
55 * range INT_MIN+1 to INT_MAX
58 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
59 WMNormalWindowLevel
= 0,
60 WMFloatingWindowLevel
= 3,
61 WMSubmenuWindowLevel
= 3,
62 WMTornOffMenuWindowLevel
= 3,
63 WMMainMenuWindowLevel
= 20,
64 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
65 WMStatusWindowLevel
= 21,
66 WMModalPanelWindowLevel
= 100,
67 WMPopUpMenuWindowLevel
= 101,
68 WMScreenSaverWindowLevel
= 1000
72 /* window attributes */
74 WMBorderlessWindowMask
= 0,
75 WMTitledWindowMask
= 1,
76 WMClosableWindowMask
= 2,
77 WMMiniaturizableWindowMask
= 4,
78 WMResizableWindowMask
= 8,
79 WMIconWindowMask
= 64,
80 WMMiniWindowMask
= 128
87 /* 0 is reserved for internal use */
93 WBTMomentaryChange
= 6,
98 /* button behaviour masks */
100 WBBSpringLoadedMask
= (1 << 0),
101 WBBPushInMask
= (1 << 1),
102 WBBPushChangeMask
= (1 << 2),
103 WBBPushLightMask
= (1 << 3),
104 WBBStateLightMask
= (1 << 5),
105 WBBStateChangeMask
= (1 << 6),
106 WBBStatePushMask
= (1 << 7)
110 /* frame title positions */
134 /* alignment types */
139 WAJustified
/* not valid for textfields */
155 /* scroller arrow position */
160 } WMScrollArrowPosition
;
175 /* usable scroller parts */
180 } WMUsableScrollerParts
;
192 WTTopTabsBevelBorder
,
199 /* text movement types */
201 WMIllegalTextMovement
,
202 WMReturnTextMovement
,
203 WMEscapeTextMovement
,
205 WMBacktabTextMovement
,
212 /* text field special events */
220 WLNotFound
= -1 /* element was not found in WMList */
224 /* drag operations */
232 } WMDragOperationType
;
236 WMGrayModeColorPanel
= 1,
237 WMRGBModeColorPanel
= 2,
238 WMCMYKModeColorPanel
= 3,
239 WMHSBModeColorPanel
= 4,
240 WMCustomPaletteModeColorPanel
= 5,
241 WMColorListModeColorPanel
= 6,
242 WMWheelModeColorPanel
= 7
248 #define WSIReturnArrow 1
249 #define WSIHighlightedReturnArrow 2
250 #define WSIScrollerDimple 3
251 #define WSIArrowLeft 4
252 #define WSIHighlightedArrowLeft 5
253 #define WSIArrowRight 6
254 #define WSIHighlightedArrowRight 7
256 #define WSIHighlightedArrowUp 9
257 #define WSIArrowDown 10
258 #define WSIHighlightedArrowDown 11
259 #define WSICheckMark 12
262 WLDSSelected
= (1 << 16),
263 WLDSDisabled
= (1 << 17),
264 WLDSFocused
= (1 << 18),
265 WLDSIsBranch
= (1 << 19)
268 /* alert panel return values */
278 /* types of input observers */
280 WIReadMask
= (1 << 0),
281 WIWriteMask
= (1 << 1),
282 WIExceptMask
= (1 << 2)
302 WC_Matrix
= 12, /* not ready */
305 WC_ProgressIndicator
= 15,
312 /* All widgets must start with the following structure
313 * in that order. Used for typecasting to get some generic data */
314 typedef struct W_WidgetType
{
321 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
322 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
327 typedef void WMWidget
;
329 typedef struct W_Pixmap WMPixmap
;
330 typedef struct W_Font WMFont
;
331 typedef struct W_Color WMColor
;
333 typedef struct W_Screen WMScreen
;
335 typedef struct W_View WMView
;
337 typedef struct W_Window WMWindow
;
338 typedef struct W_Frame WMFrame
;
339 typedef struct W_Button WMButton
;
340 typedef struct W_Label WMLabel
;
341 typedef struct W_TextField WMTextField
;
342 typedef struct W_Scroller WMScroller
;
343 typedef struct W_ScrollView WMScrollView
;
344 typedef struct W_List WMList
;
345 typedef struct W_Browser WMBrowser
;
346 typedef struct W_PopUpButton WMPopUpButton
;
347 typedef struct W_ProgressIndicator WMProgressIndicator
;
348 typedef struct W_ColorWell WMColorWell
;
349 typedef struct W_Slider WMSlider
;
350 typedef struct W_Matrix WMMatrix
; /* not ready */
351 typedef struct W_SplitView WMSplitView
;
352 typedef struct W_TabView WMTabView
;
353 typedef struct W_Ruler WMRuler
;
354 typedef struct W_Text WMText
;
355 typedef struct W_Box WMBox
;
359 typedef struct W_TabViewItem WMTabViewItem
;
360 typedef struct W_MenuItem WMMenuItem
;
363 typedef struct W_FilePanel WMFilePanel
;
364 typedef WMFilePanel WMOpenPanel
;
365 typedef WMFilePanel WMSavePanel
;
367 typedef struct W_FontPanel WMFontPanel
;
369 typedef struct W_ColorPanel WMColorPanel
;
372 /* item for WMList */
373 typedef struct WMListItem
{
375 void *clientData
; /* ptr for user clientdata. */
377 unsigned int uflags
:16; /* flags for the user */
378 unsigned int selected
:1;
379 unsigned int disabled
:1;
380 unsigned int isBranch
:1;
381 unsigned int loaded
:1;
384 /* struct for message panel */
385 typedef struct WMAlertPanel
{
386 WMWindow
*win
; /* window */
388 WMButton
*defBtn
; /* default button */
389 WMButton
*altBtn
; /* alternative button */
390 WMButton
*othBtn
; /* other button */
391 WMLabel
*iLbl
; /* icon label */
392 WMLabel
*tLbl
; /* title label */
393 WMLabel
*mLbl
; /* message label */
394 WMFrame
*line
; /* separator */
395 short result
; /* button that was pushed */
399 typedef struct WMGenericPanel
{
420 typedef struct WMInputPanel
{
421 WMWindow
*win
; /* window */
422 WMButton
*defBtn
; /* default button */
423 WMButton
*altBtn
; /* alternative button */
424 WMLabel
*tLbl
; /* title label */
425 WMLabel
*mLbl
; /* message label */
426 WMTextField
*text
; /* text field */
427 short result
; /* button that was pushed */
433 WMArray
*tabs
; /* a growable array of tabstops */
434 unsigned short left
; /* left margin marker */
435 unsigned short right
; /* right margin marker */
436 unsigned short first
; /* indentation marker for first line only */
437 unsigned short body
; /* body indentation marker */
438 unsigned short retainCount
;
440 /* All indentation and tab markers are _relative_ to the left margin marker */
443 typedef void WMEventProc(XEvent
*event
, void *clientData
);
445 typedef void WMEventHook(XEvent
*event
);
447 /* self is set to the widget from where the callback is being called and
448 * clientData to the data set to with WMSetClientData() */
449 typedef void WMAction(WMWidget
*self
, void *clientData
);
451 /* same as WMAction, but for stuff that arent widgets */
452 typedef void WMAction2(void *self
, void *clientData
);
455 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
457 /* delegate method like stuff */
458 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
459 int state
, WMRect
*rect
);
462 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
463 unsigned int oldWidth,
464 unsigned int oldHeight);
467 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
468 int *minSize
, int *maxSize
);
470 typedef WMWidget
* WMMatrixCreateCellProc(WMMatrix
*mPtr
);
475 typedef struct WMBrowserDelegate
{
478 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
479 WMBrowser
*sender
, int column
, WMList
*list
);
481 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
484 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
486 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
490 typedef struct WMTextFieldDelegate
{
493 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
494 WMNotification
*notif
);
496 void (*didChange
)(struct WMTextFieldDelegate
*self
,
497 WMNotification
*notif
);
499 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
500 WMNotification
*notif
);
502 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
505 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
507 } WMTextFieldDelegate
;
510 typedef struct WMTextDelegate
{
513 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
520 typedef struct WMTabViewDelegate
{
523 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
526 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
527 WMTabViewItem
*item
);
529 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
530 WMTabViewItem
*item
);
532 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
533 WMTabViewItem
*item
);
539 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
540 Time timestamp
, void *cdata
, WMData
*data
);
543 typedef struct WMSelectionProcs
{
544 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
545 void *cdata
, Atom
*type
);
546 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
547 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
552 typedef struct W_DraggingInfo WMDraggingInfo
;
555 typedef struct W_DragSourceProcs
{
556 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
557 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
558 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
560 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
561 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
566 typedef struct W_DragDestinationProcs
{
567 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
568 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
569 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
570 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
571 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
572 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
573 } WMDragDestinationProcs
;
577 /* ...................................................................... */
580 WMPoint
wmkpoint(int x
, int y
);
582 WMSize
wmksize(unsigned int width
, unsigned int height
);
584 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
585 #define wmksize(width, height) (WMSize){(width), (height)}
586 #define wmkpoint(x, y) (WMPoint){(x), (y)}
589 /* ....................................................................... */
593 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
595 void WMSetResourcePath(char *path
);
597 /* don't free the returned string */
598 char* WMGetApplicationName();
600 /* Try to locate resource file. ext may be NULL */
601 char* WMPathForResourceOfType(char *resource
, char *ext
);
604 WMScreen
* WMOpenScreen(const char *display
);
606 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
609 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
611 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
613 void WMScreenMainLoop(WMScreen
*scr
);
615 void WMBreakModalLoop(WMScreen
*scr
);
617 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
619 RContext
* WMScreenRContext(WMScreen
*scr
);
621 Display
* WMScreenDisplay(WMScreen
*scr
);
623 int WMScreenDepth(WMScreen
*scr
);
627 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
629 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
631 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
633 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
635 /* If color==NULL it will use the default color for panels: ae/aa/ae */
636 WMPixmap
* WMCreateApplicationIconBlendedPixmap(WMScreen
*scr
, RColor
*color
);
638 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
640 void WMSetFocusToWidget(WMWidget
*widget
);
642 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
644 int WMHandleEvent(XEvent
*event
);
646 Bool
WMScreenPending(WMScreen
*scr
);
648 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
649 WMEventProc
*eventProc
, void *clientData
);
651 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
652 WMEventProc
*eventProc
, void *clientData
);
654 int WMIsDoubleClick(XEvent
*event
);
656 int WMIsTripleClick(XEvent
*event
);
658 void WMNextEvent(Display
*dpy
, XEvent
*event
);
660 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
663 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
664 WMSelectionProcs
*procs
, void *cdata
);
666 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
668 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
669 Time timestamp
, WMSelectionCallback
*callback
,
673 /* ....................................................................... */
675 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
677 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
678 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
681 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
683 void WMUnregisterViewDraggedTypes(WMView
*view
);
685 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
688 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
690 /* ....................................................................... */
692 WMFont
* WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
694 WMFont
* WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
696 WMFont
* WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
698 WMFont
* WMRetainFont(WMFont
*font
);
700 void WMReleaseFont(WMFont
*font
);
702 unsigned int WMFontHeight(WMFont
*font
);
705 WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
707 WMFont* WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
711 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
713 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
715 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
717 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
719 XFontSet
WMGetFontFontSet(WMFont
*font
);
721 WMFont
* WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
723 WMFont
* WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
725 WMFont
* WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
727 WMFont
* WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
729 WMFont
* WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
731 WMFont
* WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
733 /* ....................................................................... */
735 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
737 void WMReleasePixmap(WMPixmap
*pixmap
);
739 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
742 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
743 Pixmap mask
, int width
, int height
,
746 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
749 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
751 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
753 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
755 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
758 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
761 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
763 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
765 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
767 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
769 /* ....................................................................... */
772 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
774 WMColor
* WMGrayColor(WMScreen
*scr
);
776 WMColor
* WMBlackColor(WMScreen
*scr
);
778 WMColor
* WMWhiteColor(WMScreen
*scr
);
780 void WMSetColorInGC(WMColor
*color
, GC gc
);
782 GC
WMColorGC(WMColor
*color
);
784 WMPixel
WMColorPixel(WMColor
*color
);
786 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
787 unsigned int width
, unsigned int height
);
789 void WMReleaseColor(WMColor
*color
);
791 WMColor
* WMRetainColor(WMColor
*color
);
793 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
794 unsigned short green
, unsigned short blue
,
797 WMColor
* WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
799 unsigned short WMRedComponentOfColor(WMColor
*color
);
801 unsigned short WMGreenComponentOfColor(WMColor
*color
);
803 unsigned short WMBlueComponentOfColor(WMColor
*color
);
805 char* WMGetColorRGBDescription(WMColor
*color
);
807 /* ....................................................................... */
810 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
811 int y
, char *text
, int length
);
813 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
814 int y
, char *text
, int length
);
816 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
820 /* ....................................................................... */
822 WMScreen
* WMWidgetScreen(WMWidget
*w
);
824 unsigned int WMScreenWidth(WMScreen
*scr
);
826 unsigned int WMScreenHeight(WMScreen
*scr
);
828 void WMUnmapWidget(WMWidget
*w
);
830 void WMMapWidget(WMWidget
*w
);
832 Bool
WMWidgetIsMapped(WMWidget
*w
);
834 void WMRaiseWidget(WMWidget
*w
);
836 void WMLowerWidget(WMWidget
*w
);
838 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
840 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
842 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
844 void WMMapSubwidgets(WMWidget
*w
);
846 void WMUnmapSubwidgets(WMWidget
*w
);
848 void WMRealizeWidget(WMWidget
*w
);
850 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
852 void WMDestroyWidget(WMWidget
*widget
);
854 void WMHangData(WMWidget
*widget
, void *data
);
856 void* WMGetHangedData(WMWidget
*widget
);
858 unsigned int WMWidgetWidth(WMWidget
*w
);
860 unsigned int WMWidgetHeight(WMWidget
*w
);
862 Window
WMWidgetXID(WMWidget
*w
);
864 Window
WMViewXID(WMView
*view
);
866 void WMRedisplayWidget(WMWidget
*w
);
868 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
870 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
871 int rightOffs
, int bottomOffs
);
873 WMSize
WMGetViewSize(WMView
*view
);
875 WMPoint
WMGetViewPosition(WMView
*view
);
877 WMPoint
WMGetViewScreenPosition(WMView
*view
);
879 WMWidget
* WMWidgetOfView(WMView
*view
);
881 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
883 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
886 extern char *WMViewSizeDidChangeNotification
;
888 extern char *WMViewRealizedNotification
;
890 extern char *WMFontPanelDidChangeNotification
;
893 /* ....................................................................... */
895 void WMSetBalloonTextForView(char *text
, WMView
*view
);
897 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
899 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
901 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
903 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
905 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
908 /* ....................................................................... */
910 WMWindow
* WMCreateWindow(WMScreen
*screen
, char *name
);
912 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
914 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
917 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
919 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
921 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
923 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
925 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
927 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
929 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
931 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
933 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
936 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
938 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
940 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
942 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
944 void WMSetWindowLevel(WMWindow
*win
, int level
);
946 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
948 void WMCloseWindow(WMWindow
*win
);
950 /* ....................................................................... */
952 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
954 #define WMCreateCommandButton(parent) \
955 WMCreateCustomButton((parent), WBBSpringLoadedMask\
960 #define WMCreateRadioButton(parent) \
961 WMCreateButton((parent), WBTRadio)
963 #define WMCreateSwitchButton(parent) \
964 WMCreateButton((parent), WBTSwitch)
966 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
968 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
970 void WMSetButtonImageDefault(WMButton
*bPtr
);
972 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
974 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
976 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
978 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
980 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
982 void WMSetButtonText(WMButton
*bPtr
, char *text
);
984 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
986 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
988 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
990 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
992 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
994 int WMGetButtonSelected(WMButton
*bPtr
);
996 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
998 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1000 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1002 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1004 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1006 void WMPerformButtonClick(WMButton
*bPtr
);
1008 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1010 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1012 /* ....................................................................... */
1014 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1016 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1018 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1020 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1022 char* WMGetLabelText(WMLabel
*lPtr
);
1024 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1026 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1028 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1030 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1032 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1034 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1036 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1038 /* ....................................................................... */
1040 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1042 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1044 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1046 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1048 /* ....................................................................... */
1050 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1052 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1054 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1056 /* you can free the returned string */
1057 char* WMGetTextFieldText(WMTextField
*tPtr
);
1059 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1061 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1063 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1065 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1067 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1069 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1071 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1073 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1075 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1077 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1079 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1081 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1083 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1085 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1088 extern char *WMTextDidChangeNotification
;
1089 extern char *WMTextDidBeginEditingNotification
;
1090 extern char *WMTextDidEndEditingNotification
;
1092 /* ....................................................................... */
1094 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1096 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1097 float knobProportion
);
1099 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1101 float WMGetScrollerValue(WMScroller
*sPtr
);
1103 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1105 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1107 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1108 WMScrollArrowPosition position
);
1110 extern char *WMScrollerDidScrollNotification
;
1112 /* ....................................................................... */
1114 WMList
* WMCreateList(WMWidget
*parent
);
1116 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1118 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1120 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1122 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1124 void WMSortListItems(WMList
*lPtr
);
1126 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1128 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1130 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1132 WMArray
* WMGetListItems(WMList
*lPtr
);
1134 void WMRemoveListItem(WMList
*lPtr
, int row
);
1136 void WMSelectListItem(WMList
*lPtr
, int row
);
1138 void WMUnselectListItem(WMList
*lPtr
, int row
);
1140 /* This will select all items in range, and deselect all the others */
1141 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1143 /* This will select all items in range, leaving the others as they are */
1144 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1146 void WMSelectAllListItems(WMList
*lPtr
);
1148 void WMUnselectAllListItems(WMList
*lPtr
);
1150 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1152 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1154 int WMGetListItemHeight(WMList
*lPtr
);
1156 /* don't free the returned data */
1157 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1160 * For the following 2 functions, in case WMList allows multiple selection,
1161 * the first item in the list of selected items, respective its row number,
1165 /* don't free the returned data */
1166 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1168 int WMGetListSelectedItemRow(WMList
*lPtr
);
1170 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1172 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1174 void WMClearList(WMList
*lPtr
);
1176 int WMGetListNumberOfRows(WMList
*lPtr
);
1178 void WMSetListPosition(WMList
*lPtr
, int row
);
1180 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1182 int WMGetListPosition(WMList
*lPtr
);
1184 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1186 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1189 extern char *WMListDidScrollNotification
;
1190 extern char *WMListSelectionDidChangeNotification
;
1192 /* ....................................................................... */
1194 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1196 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1198 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1200 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1202 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1204 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1206 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1208 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1210 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1212 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1214 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1216 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1218 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1219 WMCompareDataProc
*func
);
1221 /* Don't free the returned string. */
1222 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1224 /* free the returned string */
1225 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1227 /* free the returned string */
1228 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1230 /* free the returned array */
1231 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1233 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1235 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1238 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1240 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1242 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1244 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1246 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1248 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1250 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1252 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1254 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1256 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1258 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1260 /* ....................................................................... */
1263 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1265 WMMenuItem
* WMCreateMenuItem(void);
1267 void WMDestroyMenuItem(WMMenuItem
*item
);
1269 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1271 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1273 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1275 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1277 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1279 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1281 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1283 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1285 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1287 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1289 void* WMGetMenuItemData(WMMenuItem
*item
);
1291 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1293 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1295 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1297 int WMGetMenuItemState(WMMenuItem
*item
);
1299 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1301 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1303 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1305 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1307 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1309 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1311 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1313 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1315 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1318 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1320 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1323 /* ....................................................................... */
1325 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1327 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1330 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1332 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1334 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1337 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1339 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1341 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1343 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1345 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1347 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1349 /* don't free the returned data */
1350 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1352 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1355 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1357 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1359 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1361 /* ....................................................................... */
1363 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1365 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1367 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1369 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1371 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1373 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1375 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1378 /* ....................................................................... */
1380 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1382 void WMFreeColorPanel(WMColorPanel
*panel
);
1384 void WMShowColorPanel(WMColorPanel
*panel
);
1386 void WMCloseColorPanel(WMColorPanel
*panel
);
1388 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1390 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1392 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1394 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1396 extern char *WMColorPanelColorChangedNotification
;
1398 /* ....................................................................... */
1400 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1402 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1404 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1406 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1409 extern char *WMColorWellDidChangeNotification
;
1412 /* ...................................................................... */
1414 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1416 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1417 unsigned int height
);
1419 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1421 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1423 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1425 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1427 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1429 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1431 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1433 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1435 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1437 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1439 /* ....................................................................... */
1441 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1443 int WMGetSliderMinValue(WMSlider
*slider
);
1445 int WMGetSliderMaxValue(WMSlider
*slider
);
1447 int WMGetSliderValue(WMSlider
*slider
);
1449 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1451 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1453 void WMSetSliderValue(WMSlider
*slider
, int value
);
1455 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1457 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1459 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1461 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1463 /* ....................................................................... */
1466 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1468 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1470 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1472 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1474 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1476 /* remove the first subview == view */
1477 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1479 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1482 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1484 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1486 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1487 WMSplitViewConstrainProc
*proc
);
1490 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1491 WMSplitViewResizeSubviewsProc *proc);
1494 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1496 /* ...................................................................... */
1498 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1500 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1502 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1504 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1506 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1508 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1510 int WMGetRulerOffset(WMRuler
*rPtr
);
1512 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1514 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1516 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1518 /* ....................................................................... */
1521 #define WMCreateText(parent) WMCreateTextForDocumentType \
1522 ((parent), (NULL), (NULL))
1524 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1527 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1529 void WMFreezeText(WMText
*tPtr
);
1531 #define WMRefreshText(tPtr) WMThawText((tPtr))
1533 void WMThawText(WMText
*tPtr
);
1535 int WMScrollText(WMText
*tPtr
, int amount
);
1537 int WMPageText(WMText
*tPtr
, Bool direction
);
1539 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1541 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1543 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1545 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1547 int WMGetTextRulerShown(WMText
*tPtr
);
1549 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1551 int WMGetTextEditable(WMText
*tPtr
);
1553 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1555 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1557 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1559 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1561 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1563 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1565 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1567 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1569 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1571 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1573 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1575 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1577 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1579 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1581 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1583 #define WMClearText(tPtr) WMAppendTextStream \
1587 char* WMGetTextStream(WMText
*tPtr
);
1590 char* WMGetTextSelectedStream(WMText
*tPtr
);
1592 /* destroy the array */
1593 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1595 /* destroy the array */
1596 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1598 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1600 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1602 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1604 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1606 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1608 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1610 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1612 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1613 Bool caseSensitive
);
1615 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1618 /* parser related stuff... use only if implementing a new parser */
1620 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1621 WMColor
*color
, unsigned short first
,
1622 unsigned short extraInfo
);
1624 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1625 WMColor
*color
, unsigned short first
,
1626 unsigned short extraInfo
);
1628 void* WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1629 WMColor
*color
, unsigned short first
,
1630 unsigned short length
);
1632 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1633 unsigned int kanji
, unsigned int underlined
,
1634 int script
, WMRulerMargins
*margins
);
1636 /* do NOT free the margins */
1637 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1638 unsigned int *kanji
, unsigned int *underlined
,
1639 int *script
, WMRulerMargins
*margins
);
1641 int WMGetTextInsertType(WMText
*tPtr
);
1643 int WMGetTextBlocks(WMText
*tPtr
);
1645 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1647 int WMGetCurrentTextBlock(WMText
*tPtr
);
1649 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1651 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1653 void* WMRemoveTextBlock(WMText
*tPtr
);
1655 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1657 /* ....................................................................... */
1660 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1662 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1664 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1666 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1668 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1670 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1672 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1674 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1675 int identifier
, char *label
);
1677 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1679 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1681 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1683 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1685 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1687 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1689 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1691 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1693 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1696 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1698 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1700 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1702 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1704 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1706 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1708 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1711 /* ....................................................................... */
1713 WMBox
* WMCreateBox(WMWidget
*parent
);
1715 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1717 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1718 int minSize
, int maxSize
, int space
);
1720 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1721 int minSize
, int maxSize
, int space
);
1723 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1725 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1727 /* ....................................................................... */
1729 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1730 char *defaultButton
, char *alternateButton
,
1733 /* you can free the returned string */
1734 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1735 char *defaultText
, char *okButton
, char *cancelButton
);
1737 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1738 char *msg
, char *defaultButton
,
1739 char *alternateButton
, char *otherButton
);
1741 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1742 char *msg
, char *defaultText
, char *okButton
,
1743 char *cancelButton
);
1746 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1747 char *title
, char *defaultButton
,
1748 char *alternateButton
);
1750 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1752 void WMDestroyInputPanel(WMInputPanel
*panel
);
1754 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1756 /* ....................................................................... */
1758 /* only 1 instance per WMScreen */
1759 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1761 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1763 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1765 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1767 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1769 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1771 /* you can free the returned string */
1772 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1774 void WMFreeFilePanel(WMFilePanel
*panel
);
1776 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1777 char *path
, char *name
, char **fileTypes
);
1779 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1781 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1784 /* ...................................................................... */
1786 /* only 1 instance per WMScreen */
1787 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1789 void WMShowFontPanel(WMFontPanel
*panel
);
1791 void WMHideFontPanel(WMFontPanel
*panel
);
1793 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1795 /* you can free the returned string */
1796 char* WMGetFontPanelFontName(WMFontPanel
*panel
);
1798 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1802 #endif /* __cplusplus */