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 */
389 WMButton
*defBtn
; /* default button */
390 WMButton
*altBtn
; /* alternative button */
391 WMButton
*othBtn
; /* other button */
392 WMLabel
*iLbl
; /* icon label */
393 WMLabel
*tLbl
; /* title label */
394 WMLabel
*mLbl
; /* message label */
395 WMFrame
*line
; /* separator */
396 short result
; /* button that was pushed */
400 typedef struct WMGenericPanel
{
421 typedef struct WMInputPanel
{
422 WMWindow
*win
; /* window */
423 WMButton
*defBtn
; /* default button */
424 WMButton
*altBtn
; /* alternative button */
425 WMLabel
*tLbl
; /* title label */
426 WMLabel
*mLbl
; /* message label */
427 WMTextField
*text
; /* text field */
428 short result
; /* button that was pushed */
434 WMArray
*tabs
; /* a growable array of tabstops */
435 unsigned short left
; /* left margin marker */
436 unsigned short right
; /* right margin marker */
437 unsigned short first
; /* indentation marker for first line only */
438 unsigned short body
; /* body indentation marker */
439 unsigned short retainCount
;
441 /* All indentation and tab markers are _relative_ to the left margin marker */
444 typedef void WMEventProc(XEvent
*event
, void *clientData
);
446 typedef void WMEventHook(XEvent
*event
);
448 /* self is set to the widget from where the callback is being called and
449 * clientData to the data set to with WMSetClientData() */
450 typedef void WMAction(WMWidget
*self
, void *clientData
);
452 /* same as WMAction, but for stuff that arent widgets */
453 typedef void WMAction2(void *self
, void *clientData
);
456 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
458 /* delegate method like stuff */
459 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
460 int state
, WMRect
*rect
);
463 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
464 unsigned int oldWidth,
465 unsigned int oldHeight);
468 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
469 int *minSize
, int *maxSize
);
471 typedef WMWidget
* WMMatrixCreateCellProc(WMMatrix
*mPtr
);
476 typedef struct WMBrowserDelegate
{
479 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
480 WMBrowser
*sender
, int column
, WMList
*list
);
482 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
485 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
487 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
491 typedef struct WMTextFieldDelegate
{
494 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
495 WMNotification
*notif
);
497 void (*didChange
)(struct WMTextFieldDelegate
*self
,
498 WMNotification
*notif
);
500 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
501 WMNotification
*notif
);
503 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
506 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
508 } WMTextFieldDelegate
;
511 typedef struct WMTextDelegate
{
514 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
521 typedef struct WMTabViewDelegate
{
524 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
527 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
528 WMTabViewItem
*item
);
530 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
531 WMTabViewItem
*item
);
533 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
534 WMTabViewItem
*item
);
540 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
541 Time timestamp
, void *cdata
, WMData
*data
);
544 typedef struct WMSelectionProcs
{
545 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
546 void *cdata
, Atom
*type
);
547 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
548 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
553 typedef struct W_DraggingInfo WMDraggingInfo
;
556 typedef struct W_DragSourceProcs
{
557 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
558 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
559 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
561 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
562 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
567 typedef struct W_DragDestinationProcs
{
568 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
569 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
570 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
571 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
572 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
573 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
574 } WMDragDestinationProcs
;
578 /* ...................................................................... */
581 WMPoint
wmkpoint(int x
, int y
);
583 WMSize
wmksize(unsigned int width
, unsigned int height
);
585 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
586 #define wmksize(width, height) (WMSize){(width), (height)}
587 #define wmkpoint(x, y) (WMPoint){(x), (y)}
590 /* ....................................................................... */
594 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
596 void WMSetResourcePath(char *path
);
598 /* don't free the returned string */
599 char* WMGetApplicationName();
601 /* Try to locate resource file. ext may be NULL */
602 char* WMPathForResourceOfType(char *resource
, char *ext
);
605 WMScreen
* WMOpenScreen(const char *display
);
607 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
610 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
612 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
614 void WMScreenMainLoop(WMScreen
*scr
);
616 void WMBreakModalLoop(WMScreen
*scr
);
618 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
620 RContext
* WMScreenRContext(WMScreen
*scr
);
622 Display
* WMScreenDisplay(WMScreen
*scr
);
624 int WMScreenDepth(WMScreen
*scr
);
628 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
630 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
632 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
634 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
636 /* If color==NULL it will use the default color for panels: ae/aa/ae */
637 WMPixmap
* WMCreateApplicationIconBlendedPixmap(WMScreen
*scr
, RColor
*color
);
639 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
641 void WMSetFocusToWidget(WMWidget
*widget
);
643 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
645 int WMHandleEvent(XEvent
*event
);
647 Bool
WMScreenPending(WMScreen
*scr
);
649 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
650 WMEventProc
*eventProc
, void *clientData
);
652 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
653 WMEventProc
*eventProc
, void *clientData
);
655 int WMIsDoubleClick(XEvent
*event
);
657 int WMIsTripleClick(XEvent
*event
);
659 void WMNextEvent(Display
*dpy
, XEvent
*event
);
661 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
664 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
665 WMSelectionProcs
*procs
, void *cdata
);
667 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
669 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
670 Time timestamp
, WMSelectionCallback
*callback
,
674 /* ....................................................................... */
676 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
678 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
679 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
682 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
684 void WMUnregisterViewDraggedTypes(WMView
*view
);
686 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
689 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
691 /* ....................................................................... */
693 WMFont
* WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
695 WMFont
* WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
697 WMFont
* WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
699 WMFont
* WMRetainFont(WMFont
*font
);
701 void WMReleaseFont(WMFont
*font
);
703 unsigned int WMFontHeight(WMFont
*font
);
706 WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
708 WMFont* WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
712 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
714 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
716 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
718 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
720 XFontSet
WMGetFontFontSet(WMFont
*font
);
722 WMFont
* WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
724 WMFont
* WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
726 WMFont
* WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
728 WMFont
* WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
730 WMFont
* WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
732 WMFont
* WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
734 /* ....................................................................... */
736 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
738 void WMReleasePixmap(WMPixmap
*pixmap
);
740 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
743 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
744 Pixmap mask
, int width
, int height
,
747 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
750 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
752 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
754 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
756 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
759 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
762 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
764 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
766 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
768 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
770 /* ....................................................................... */
773 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
775 WMColor
* WMGrayColor(WMScreen
*scr
);
777 WMColor
* WMBlackColor(WMScreen
*scr
);
779 WMColor
* WMWhiteColor(WMScreen
*scr
);
781 void WMSetColorInGC(WMColor
*color
, GC gc
);
783 GC
WMColorGC(WMColor
*color
);
785 WMPixel
WMColorPixel(WMColor
*color
);
787 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
788 unsigned int width
, unsigned int height
);
790 void WMReleaseColor(WMColor
*color
);
792 WMColor
* WMRetainColor(WMColor
*color
);
794 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
795 unsigned short green
, unsigned short blue
,
798 WMColor
* WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
800 unsigned short WMRedComponentOfColor(WMColor
*color
);
802 unsigned short WMGreenComponentOfColor(WMColor
*color
);
804 unsigned short WMBlueComponentOfColor(WMColor
*color
);
806 char* WMGetColorRGBDescription(WMColor
*color
);
808 /* ....................................................................... */
811 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
812 int y
, char *text
, int length
);
814 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
815 int y
, char *text
, int length
);
817 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
821 /* ....................................................................... */
823 WMScreen
* WMWidgetScreen(WMWidget
*w
);
825 unsigned int WMScreenWidth(WMScreen
*scr
);
827 unsigned int WMScreenHeight(WMScreen
*scr
);
829 void WMUnmapWidget(WMWidget
*w
);
831 void WMMapWidget(WMWidget
*w
);
833 Bool
WMWidgetIsMapped(WMWidget
*w
);
835 void WMRaiseWidget(WMWidget
*w
);
837 void WMLowerWidget(WMWidget
*w
);
839 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
841 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
843 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
845 void WMMapSubwidgets(WMWidget
*w
);
847 void WMUnmapSubwidgets(WMWidget
*w
);
849 void WMRealizeWidget(WMWidget
*w
);
851 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
853 void WMDestroyWidget(WMWidget
*widget
);
855 void WMHangData(WMWidget
*widget
, void *data
);
857 void* WMGetHangedData(WMWidget
*widget
);
859 unsigned int WMWidgetWidth(WMWidget
*w
);
861 unsigned int WMWidgetHeight(WMWidget
*w
);
863 Window
WMWidgetXID(WMWidget
*w
);
865 Window
WMViewXID(WMView
*view
);
867 void WMRedisplayWidget(WMWidget
*w
);
869 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
871 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
872 int rightOffs
, int bottomOffs
);
874 WMSize
WMGetViewSize(WMView
*view
);
876 WMPoint
WMGetViewPosition(WMView
*view
);
878 WMPoint
WMGetViewScreenPosition(WMView
*view
);
880 WMWidget
* WMWidgetOfView(WMView
*view
);
882 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
884 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
887 extern char *WMViewSizeDidChangeNotification
;
889 extern char *WMViewRealizedNotification
;
891 extern char *WMFontPanelDidChangeNotification
;
894 /* ....................................................................... */
896 void WMSetBalloonTextForView(char *text
, WMView
*view
);
898 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
900 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
902 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
904 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
906 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
909 /* ....................................................................... */
911 WMWindow
* WMCreateWindow(WMScreen
*screen
, char *name
);
913 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
915 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
918 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
920 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
922 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
924 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
926 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
928 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
930 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
932 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
934 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
937 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
939 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
941 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
943 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
945 void WMSetWindowLevel(WMWindow
*win
, int level
);
947 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
949 void WMCloseWindow(WMWindow
*win
);
951 /* ....................................................................... */
953 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
955 #define WMCreateCommandButton(parent) \
956 WMCreateCustomButton((parent), WBBSpringLoadedMask\
961 #define WMCreateRadioButton(parent) \
962 WMCreateButton((parent), WBTRadio)
964 #define WMCreateSwitchButton(parent) \
965 WMCreateButton((parent), WBTSwitch)
967 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
969 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
971 void WMSetButtonImageDefault(WMButton
*bPtr
);
973 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
975 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
977 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
979 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
981 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
983 void WMSetButtonText(WMButton
*bPtr
, char *text
);
985 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
987 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
989 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
991 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
993 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
995 int WMGetButtonSelected(WMButton
*bPtr
);
997 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
999 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1001 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1003 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1005 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1007 void WMPerformButtonClick(WMButton
*bPtr
);
1009 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1011 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1013 /* ....................................................................... */
1015 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1017 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1019 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1021 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1023 char* WMGetLabelText(WMLabel
*lPtr
);
1025 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1027 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1029 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1031 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1033 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1035 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1037 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1039 /* ....................................................................... */
1041 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1043 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1045 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1047 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1049 /* ....................................................................... */
1051 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1053 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1055 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1057 /* you can free the returned string */
1058 char* WMGetTextFieldText(WMTextField
*tPtr
);
1060 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1062 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1064 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1066 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1068 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1070 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1072 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1074 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1076 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1078 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1080 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1082 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1084 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1086 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1089 extern char *WMTextDidChangeNotification
;
1090 extern char *WMTextDidBeginEditingNotification
;
1091 extern char *WMTextDidEndEditingNotification
;
1093 /* ....................................................................... */
1095 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1097 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1098 float knobProportion
);
1100 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1102 float WMGetScrollerValue(WMScroller
*sPtr
);
1104 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1106 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1108 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1109 WMScrollArrowPosition position
);
1111 extern char *WMScrollerDidScrollNotification
;
1113 /* ....................................................................... */
1115 WMList
* WMCreateList(WMWidget
*parent
);
1117 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1119 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1121 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1123 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1125 void WMSortListItems(WMList
*lPtr
);
1127 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1129 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1131 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1133 WMArray
* WMGetListItems(WMList
*lPtr
);
1135 void WMRemoveListItem(WMList
*lPtr
, int row
);
1137 void WMSelectListItem(WMList
*lPtr
, int row
);
1139 void WMUnselectListItem(WMList
*lPtr
, int row
);
1141 /* This will select all items in range, and deselect all the others */
1142 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1144 /* This will select all items in range, leaving the others as they are */
1145 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1147 void WMSelectAllListItems(WMList
*lPtr
);
1149 void WMUnselectAllListItems(WMList
*lPtr
);
1151 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1153 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1155 int WMGetListItemHeight(WMList
*lPtr
);
1157 /* don't free the returned data */
1158 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1161 * For the following 2 functions, in case WMList allows multiple selection,
1162 * the first item in the list of selected items, respective its row number,
1166 /* don't free the returned data */
1167 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1169 int WMGetListSelectedItemRow(WMList
*lPtr
);
1171 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1173 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1175 void WMClearList(WMList
*lPtr
);
1177 int WMGetListNumberOfRows(WMList
*lPtr
);
1179 void WMSetListPosition(WMList
*lPtr
, int row
);
1181 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1183 int WMGetListPosition(WMList
*lPtr
);
1185 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1187 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1190 extern char *WMListDidScrollNotification
;
1191 extern char *WMListSelectionDidChangeNotification
;
1193 /* ....................................................................... */
1195 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1197 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1199 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1201 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1203 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1205 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1207 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1209 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1211 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1213 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1215 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1217 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1219 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1220 WMCompareDataProc
*func
);
1222 /* Don't free the returned string. */
1223 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1225 /* free the returned string */
1226 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1228 /* free the returned string */
1229 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1231 /* free the returned array */
1232 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1234 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1236 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1239 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1241 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1243 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1245 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1247 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1249 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1251 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1253 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1255 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1257 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1259 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1261 /* ....................................................................... */
1264 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1266 WMMenuItem
* WMCreateMenuItem(void);
1268 void WMDestroyMenuItem(WMMenuItem
*item
);
1270 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1272 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1274 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1276 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1278 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1280 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1282 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1284 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1286 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1288 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1290 void* WMGetMenuItemData(WMMenuItem
*item
);
1292 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1294 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1296 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1298 int WMGetMenuItemState(WMMenuItem
*item
);
1300 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1302 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1304 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1306 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1308 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1310 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1312 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1314 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1316 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1319 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1321 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1324 /* ....................................................................... */
1326 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1328 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1331 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1333 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1335 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1338 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1340 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1342 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1344 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1346 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1348 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1350 /* don't free the returned data */
1351 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1353 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1356 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1358 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1360 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1362 /* ....................................................................... */
1364 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1366 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1368 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1370 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1372 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1374 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1376 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1379 /* ....................................................................... */
1381 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1383 void WMFreeColorPanel(WMColorPanel
*panel
);
1385 void WMShowColorPanel(WMColorPanel
*panel
);
1387 void WMCloseColorPanel(WMColorPanel
*panel
);
1389 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1391 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1393 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1395 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1397 extern char *WMColorPanelColorChangedNotification
;
1399 /* ....................................................................... */
1401 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1403 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1405 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1407 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1410 extern char *WMColorWellDidChangeNotification
;
1413 /* ...................................................................... */
1415 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1417 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1418 unsigned int height
);
1420 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1422 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1424 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1426 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1428 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1430 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1432 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1434 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1436 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1438 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1440 /* ....................................................................... */
1442 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1444 int WMGetSliderMinValue(WMSlider
*slider
);
1446 int WMGetSliderMaxValue(WMSlider
*slider
);
1448 int WMGetSliderValue(WMSlider
*slider
);
1450 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1452 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1454 void WMSetSliderValue(WMSlider
*slider
, int value
);
1456 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1458 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1460 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1462 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1464 /* ....................................................................... */
1467 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1469 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1471 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1473 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1475 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1477 /* remove the first subview == view */
1478 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1480 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1483 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1485 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1487 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1488 WMSplitViewConstrainProc
*proc
);
1491 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1492 WMSplitViewResizeSubviewsProc *proc);
1495 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1497 /* ...................................................................... */
1499 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1501 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1503 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1505 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1507 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1509 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1511 int WMGetRulerOffset(WMRuler
*rPtr
);
1513 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1515 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1517 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1519 /* ....................................................................... */
1522 #define WMCreateText(parent) WMCreateTextForDocumentType \
1523 ((parent), (NULL), (NULL))
1525 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1528 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1530 void WMFreezeText(WMText
*tPtr
);
1532 #define WMRefreshText(tPtr) WMThawText((tPtr))
1534 void WMThawText(WMText
*tPtr
);
1536 int WMScrollText(WMText
*tPtr
, int amount
);
1538 int WMPageText(WMText
*tPtr
, Bool direction
);
1540 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1542 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1544 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1546 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1548 int WMGetTextRulerShown(WMText
*tPtr
);
1550 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1552 int WMGetTextEditable(WMText
*tPtr
);
1554 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1556 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1558 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1560 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1562 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1564 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1566 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1568 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1570 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1572 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1574 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1576 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1578 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1580 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1582 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1584 #define WMClearText(tPtr) WMAppendTextStream \
1588 char* WMGetTextStream(WMText
*tPtr
);
1591 char* WMGetTextSelectedStream(WMText
*tPtr
);
1593 /* destroy the array */
1594 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1596 /* destroy the array */
1597 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1599 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1601 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1603 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1605 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1607 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1609 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1611 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1613 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1614 Bool caseSensitive
);
1616 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1619 /* parser related stuff... use only if implementing a new parser */
1621 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1622 WMColor
*color
, unsigned short first
,
1623 unsigned short extraInfo
);
1625 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1626 WMColor
*color
, unsigned short first
,
1627 unsigned short extraInfo
);
1629 void* WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1630 WMColor
*color
, unsigned short first
,
1631 unsigned short length
);
1633 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1634 unsigned int kanji
, unsigned int underlined
,
1635 int script
, WMRulerMargins
*margins
);
1637 /* do NOT free the margins */
1638 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1639 unsigned int *kanji
, unsigned int *underlined
,
1640 int *script
, WMRulerMargins
*margins
);
1642 int WMGetTextInsertType(WMText
*tPtr
);
1644 int WMGetTextBlocks(WMText
*tPtr
);
1646 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1648 int WMGetCurrentTextBlock(WMText
*tPtr
);
1650 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1652 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1654 void* WMRemoveTextBlock(WMText
*tPtr
);
1656 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1658 /* ....................................................................... */
1661 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1663 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1665 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1667 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1669 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1671 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1673 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1675 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1676 int identifier
, char *label
);
1678 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1680 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1682 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1684 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1686 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1688 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1690 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1692 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1694 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1697 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1699 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1701 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1703 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1705 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1707 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1709 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1712 /* ....................................................................... */
1714 WMBox
* WMCreateBox(WMWidget
*parent
);
1716 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1718 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1719 int minSize
, int maxSize
, int space
);
1721 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1722 int minSize
, int maxSize
, int space
);
1724 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1726 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1728 /* ....................................................................... */
1730 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1731 char *defaultButton
, char *alternateButton
,
1734 /* you can free the returned string */
1735 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1736 char *defaultText
, char *okButton
, char *cancelButton
);
1738 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1739 char *msg
, char *defaultButton
,
1740 char *alternateButton
, char *otherButton
);
1742 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1743 char *msg
, char *defaultText
, char *okButton
,
1744 char *cancelButton
);
1747 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1748 char *title
, char *defaultButton
,
1749 char *alternateButton
);
1751 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1753 void WMDestroyInputPanel(WMInputPanel
*panel
);
1755 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1757 /* ....................................................................... */
1759 /* only 1 instance per WMScreen */
1760 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1762 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1764 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1766 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1768 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1770 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1772 /* you can free the returned string */
1773 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1775 void WMFreeFilePanel(WMFilePanel
*panel
);
1777 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1778 char *path
, char *name
, char **fileTypes
);
1780 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1782 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1785 /* ...................................................................... */
1787 /* only 1 instance per WMScreen */
1788 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1790 void WMShowFontPanel(WMFontPanel
*panel
);
1792 void WMHideFontPanel(WMFontPanel
*panel
);
1794 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1796 /* you can free the returned string */
1797 char* WMGetFontPanelFontName(WMFontPanel
*panel
);
1799 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1803 #endif /* __cplusplus */