7 #include <WINGs/WUtil.h>
10 #define WINGS_H_VERSION 20010117
15 #endif /* __cplusplus */
21 typedef unsigned long WMPixel
;
40 /* WMRange was moved in WUtil.h */
42 #define ClientMessageMask (1L<<30)
45 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
46 #define _DEFINED_GNUSTEP_WINDOW_INFO
48 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
49 * NSDesktopWindowLevel intended to be the level at which things
50 * on the desktop sit ... so you should be able
51 * to put a desktop background just below it.
53 * Applications are actually permitted to use any value in the
54 * range INT_MIN+1 to INT_MAX
57 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
58 WMNormalWindowLevel
= 0,
59 WMFloatingWindowLevel
= 3,
60 WMSubmenuWindowLevel
= 3,
61 WMTornOffMenuWindowLevel
= 3,
62 WMMainMenuWindowLevel
= 20,
63 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
64 WMStatusWindowLevel
= 21,
65 WMModalPanelWindowLevel
= 100,
66 WMPopUpMenuWindowLevel
= 101,
67 WMScreenSaverWindowLevel
= 1000
71 /* window attributes */
73 WMBorderlessWindowMask
= 0,
74 WMTitledWindowMask
= 1,
75 WMClosableWindowMask
= 2,
76 WMMiniaturizableWindowMask
= 4,
77 WMResizableWindowMask
= 8,
78 WMIconWindowMask
= 64,
79 WMMiniWindowMask
= 128
86 /* 0 is reserved for internal use */
92 WBTMomentaryChange
= 6,
97 /* button behaviour masks */
99 WBBSpringLoadedMask
= (1 << 0),
100 WBBPushInMask
= (1 << 1),
101 WBBPushChangeMask
= (1 << 2),
102 WBBPushLightMask
= (1 << 3),
103 WBBStateLightMask
= (1 << 5),
104 WBBStateChangeMask
= (1 << 6),
105 WBBStatePushMask
= (1 << 7)
109 /* frame title positions */
133 /* alignment types */
138 WAJustified
/* not valid for textfields */
154 /* scroller arrow position */
159 } WMScrollArrowPosition
;
174 /* usable scroller parts */
179 } WMUsableScrollerParts
;
191 WTTopTabsBevelBorder
,
198 /* text movement types */
200 WMIllegalTextMovement
,
201 WMReturnTextMovement
,
202 WMEscapeTextMovement
,
204 WMBacktabTextMovement
,
211 /* text field special events */
219 WLNotFound
= -1 /* element was not found in WMList */
223 /* drag operations */
231 } WMDragOperationType
;
235 WMGrayModeColorPanel
= 1,
236 WMRGBModeColorPanel
= 2,
237 WMCMYKModeColorPanel
= 3,
238 WMHSBModeColorPanel
= 4,
239 WMCustomPaletteModeColorPanel
= 5,
240 WMColorListModeColorPanel
= 6,
241 WMWheelModeColorPanel
= 7
247 #define WSIReturnArrow 1
248 #define WSIHighlightedReturnArrow 2
249 #define WSIScrollerDimple 3
250 #define WSIArrowLeft 4
251 #define WSIHighlightedArrowLeft 5
252 #define WSIArrowRight 6
253 #define WSIHighlightedArrowRight 7
255 #define WSIHighlightedArrowUp 9
256 #define WSIArrowDown 10
257 #define WSIHighlightedArrowDown 11
258 #define WSICheckMark 12
261 WLDSSelected
= (1 << 16),
262 WLDSDisabled
= (1 << 17),
263 WLDSFocused
= (1 << 18),
264 WLDSIsBranch
= (1 << 19)
267 /* alert panel return values */
277 /* types of input observers */
279 WIReadMask
= (1 << 0),
280 WIWriteMask
= (1 << 1),
281 WIExceptMask
= (1 << 2)
301 WC_Matrix
= 12, /* not ready */
304 WC_ProgressIndicator
= 15,
311 /* All widgets must start with the following structure
312 * in that order. Used for typecasting to get some generic data */
313 typedef struct W_WidgetType
{
320 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
321 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
326 typedef void WMWidget
;
328 typedef struct W_Pixmap WMPixmap
;
329 typedef struct W_Font WMFont
;
330 typedef struct W_Color WMColor
;
332 typedef struct W_Screen WMScreen
;
334 typedef struct W_View WMView
;
336 typedef struct W_Window WMWindow
;
337 typedef struct W_Frame WMFrame
;
338 typedef struct W_Button WMButton
;
339 typedef struct W_Label WMLabel
;
340 typedef struct W_TextField WMTextField
;
341 typedef struct W_Scroller WMScroller
;
342 typedef struct W_ScrollView WMScrollView
;
343 typedef struct W_List WMList
;
344 typedef struct W_Browser WMBrowser
;
345 typedef struct W_PopUpButton WMPopUpButton
;
346 typedef struct W_ProgressIndicator WMProgressIndicator
;
347 typedef struct W_ColorWell WMColorWell
;
348 typedef struct W_Slider WMSlider
;
349 typedef struct W_Matrix WMMatrix
; /* not ready */
350 typedef struct W_SplitView WMSplitView
;
351 typedef struct W_TabView WMTabView
;
352 typedef struct W_Ruler WMRuler
;
353 typedef struct W_Text WMText
;
354 typedef struct W_Box WMBox
;
358 typedef struct W_TabViewItem WMTabViewItem
;
359 typedef struct W_MenuItem WMMenuItem
;
362 typedef struct W_FilePanel WMFilePanel
;
363 typedef WMFilePanel WMOpenPanel
;
364 typedef WMFilePanel WMSavePanel
;
366 typedef struct W_FontPanel WMFontPanel
;
368 typedef struct W_ColorPanel WMColorPanel
;
371 /* item for WMList */
372 typedef struct WMListItem
{
374 void *clientData
; /* ptr for user clientdata. */
376 unsigned int uflags
:16; /* flags for the user */
377 unsigned int selected
:1;
378 unsigned int disabled
:1;
379 unsigned int isBranch
:1;
380 unsigned int loaded
:1;
383 /* struct for message panel */
384 typedef struct WMAlertPanel
{
385 WMWindow
*win
; /* window */
387 WMButton
*defBtn
; /* default button */
388 WMButton
*altBtn
; /* alternative button */
389 WMButton
*othBtn
; /* other button */
390 WMLabel
*iLbl
; /* icon label */
391 WMLabel
*tLbl
; /* title label */
392 WMLabel
*mLbl
; /* message label */
393 WMFrame
*line
; /* separator */
394 short result
; /* button that was pushed */
398 typedef struct WMGenericPanel
{
419 typedef struct WMInputPanel
{
420 WMWindow
*win
; /* window */
421 WMButton
*defBtn
; /* default button */
422 WMButton
*altBtn
; /* alternative button */
423 WMLabel
*tLbl
; /* title label */
424 WMLabel
*mLbl
; /* message label */
425 WMTextField
*text
; /* text field */
426 short result
; /* button that was pushed */
432 WMArray
*tabs
; /* a growable array of tabstops */
433 unsigned short left
; /* left margin marker */
434 unsigned short right
; /* right margin marker */
435 unsigned short first
; /* indentation marker for first line only */
436 unsigned short body
; /* body indentation marker */
437 unsigned short retainCount
;
439 /* All indentation and tab markers are _relative_ to the left margin marker */
442 typedef void *WMHandlerID
;
444 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
446 typedef void WMEventProc(XEvent
*event
, void *clientData
);
448 typedef void WMEventHook(XEvent
*event
);
450 /* self is set to the widget from where the callback is being called and
451 * clientData to the data set to with WMSetClientData() */
452 typedef void WMAction(WMWidget
*self
, void *clientData
);
454 /* same as WMAction, but for stuff that arent widgets */
455 typedef void WMAction2(void *self
, void *clientData
);
458 typedef void WMCallback(void *data
);
460 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
462 /* delegate method like stuff */
463 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
464 int state
, WMRect
*rect
);
467 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
468 unsigned int oldWidth,
469 unsigned int oldHeight);
472 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
473 int *minSize
, int *maxSize
);
475 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
480 typedef struct WMBrowserDelegate
{
483 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
484 WMBrowser
*sender
, int column
, WMList
*list
);
486 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
489 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
491 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
495 typedef struct WMTextFieldDelegate
{
498 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
499 WMNotification
*notif
);
501 void (*didChange
)(struct WMTextFieldDelegate
*self
,
502 WMNotification
*notif
);
504 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
505 WMNotification
*notif
);
507 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
510 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
512 } WMTextFieldDelegate
;
515 typedef struct WMTextDelegate
{
518 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
525 typedef struct WMTabViewDelegate
{
528 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
531 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
532 WMTabViewItem
*item
);
534 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
535 WMTabViewItem
*item
);
537 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
538 WMTabViewItem
*item
);
544 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
545 Time timestamp
, void *cdata
, WMData
*data
);
548 typedef struct WMSelectionProcs
{
549 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
550 void *cdata
, Atom
*type
);
551 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
552 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
557 typedef struct W_DraggingInfo WMDraggingInfo
;
560 typedef struct W_DragSourceProcs
{
561 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
562 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
563 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
565 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
566 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
571 typedef struct W_DragDestinationProcs
{
572 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
573 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
574 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
575 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
576 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
577 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
578 } WMDragDestinationProcs
;
582 /* ...................................................................... */
585 WMRange
wmkrange(int start
, int count
);
587 WMPoint
wmkpoint(int x
, int y
);
589 WMSize
wmksize(unsigned int width
, unsigned int height
);
592 /* ....................................................................... */
596 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
598 void WMSetResourcePath(char *path
);
600 /* don't free the returned string */
601 char *WMGetApplicationName();
603 /* Try to locate resource file. ext may be NULL */
604 char *WMPathForResourceOfType(char *resource
, char *ext
);
607 WMScreen
*WMOpenScreen();
609 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
612 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
614 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
616 void WMScreenMainLoop(WMScreen
*scr
);
618 void WMBreakModalLoop(WMScreen
*scr
);
620 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
622 RContext
*WMScreenRContext(WMScreen
*scr
);
624 Display
*WMScreenDisplay(WMScreen
*scr
);
626 int WMScreenDepth(WMScreen
*scr
);
630 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
632 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
634 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
636 void WMSetFocusToWidget(WMWidget
*widget
);
638 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
640 int WMHandleEvent(XEvent
*event
);
642 Bool
WMScreenPending(WMScreen
*scr
);
644 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
645 WMEventProc
*eventProc
, void *clientData
);
647 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
648 WMEventProc
*eventProc
, void *clientData
);
650 int WMIsDoubleClick(XEvent
*event
);
652 int WMIsTripleClick(XEvent
*event
);
654 void WMNextEvent(Display
*dpy
, XEvent
*event
);
656 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
658 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
661 void WMDeleteTimerWithClientData(void *cdata
);
663 void WMDeleteTimerHandler(WMHandlerID handlerID
);
665 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
667 void WMDeleteIdleHandler(WMHandlerID handlerID
);
669 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
672 void WMDeleteInputHandler(WMHandlerID handlerID
);
676 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
677 WMSelectionProcs
*procs
, void *cdata
);
679 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
681 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
682 Time timestamp
, WMSelectionCallback
*callback
,
686 /* ....................................................................... */
688 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
690 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
691 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
694 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
696 void WMUnregisterViewDraggedTypes(WMView
*view
);
698 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
701 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
703 /* ....................................................................... */
705 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
707 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
709 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
711 WMFont
*WMRetainFont(WMFont
*font
);
713 void WMReleaseFont(WMFont
*font
);
715 unsigned int WMFontHeight(WMFont
*font
);
718 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
720 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
724 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
726 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
728 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
730 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
732 XFontSet
WMGetFontFontSet(WMFont
*font
);
734 WMFont
*WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
736 WMFont
*WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
738 WMFont
*WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
740 WMFont
*WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
742 WMFont
*WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
744 WMFont
*WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
746 /* ....................................................................... */
748 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
750 void WMReleasePixmap(WMPixmap
*pixmap
);
752 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
755 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
756 Pixmap mask
, int width
, int height
,
759 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
762 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
764 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
766 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
768 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
771 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
773 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
775 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
777 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
779 /* ....................................................................... */
782 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
784 WMColor
*WMGrayColor(WMScreen
*scr
);
786 WMColor
*WMBlackColor(WMScreen
*scr
);
788 WMColor
*WMWhiteColor(WMScreen
*scr
);
790 void WMSetColorInGC(WMColor
*color
, GC gc
);
792 GC
WMColorGC(WMColor
*color
);
794 WMPixel
WMColorPixel(WMColor
*color
);
796 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
797 unsigned int width
, unsigned int height
);
799 void WMReleaseColor(WMColor
*color
);
801 WMColor
*WMRetainColor(WMColor
*color
);
803 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
804 unsigned short green
, unsigned short blue
,
807 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
809 unsigned short WMRedComponentOfColor(WMColor
*color
);
811 unsigned short WMGreenComponentOfColor(WMColor
*color
);
813 unsigned short WMBlueComponentOfColor(WMColor
*color
);
815 char *WMGetColorRGBDescription(WMColor
*color
);
817 /* ....................................................................... */
820 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
821 int y
, char *text
, int length
);
823 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
824 int y
, char *text
, int length
);
826 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
830 /* ....................................................................... */
832 WMScreen
*WMWidgetScreen(WMWidget
*w
);
834 unsigned int WMScreenWidth(WMScreen
*scr
);
836 unsigned int WMScreenHeight(WMScreen
*scr
);
838 void WMUnmapWidget(WMWidget
*w
);
840 void WMMapWidget(WMWidget
*w
);
842 Bool
WMWidgetIsMapped(WMWidget
*w
);
844 void WMRaiseWidget(WMWidget
*w
);
846 void WMLowerWidget(WMWidget
*w
);
848 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
850 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
852 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
854 void WMMapSubwidgets(WMWidget
*w
);
856 void WMUnmapSubwidgets(WMWidget
*w
);
858 void WMRealizeWidget(WMWidget
*w
);
860 void WMDestroyWidget(WMWidget
*widget
);
862 void WMHangData(WMWidget
*widget
, void *data
);
864 void *WMGetHangedData(WMWidget
*widget
);
866 unsigned int WMWidgetWidth(WMWidget
*w
);
868 unsigned int WMWidgetHeight(WMWidget
*w
);
870 Window
WMWidgetXID(WMWidget
*w
);
872 Window
WMViewXID(WMView
*view
);
874 void WMRedisplayWidget(WMWidget
*w
);
876 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
878 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
879 int rightOffs
, int bottomOffs
);
881 WMSize
WMGetViewSize(WMView
*view
);
883 WMPoint
WMGetViewPosition(WMView
*view
);
885 WMPoint
WMGetViewScreenPosition(WMView
*view
);
887 WMWidget
*WMWidgetOfView(WMView
*view
);
889 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
891 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
894 extern char *WMViewSizeDidChangeNotification
;
896 extern char *WMViewRealizedNotification
;
898 extern char *WMFontPanelDidChangeNotification
;
901 /* ....................................................................... */
903 void WMSetBalloonTextForView(char *text
, WMView
*view
);
905 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
907 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
909 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
911 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
913 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
916 /* ....................................................................... */
918 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
920 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
922 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
925 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
927 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
929 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
931 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
933 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
935 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
937 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
939 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
941 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
944 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
946 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
948 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
950 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
952 void WMSetWindowLevel(WMWindow
*win
, int level
);
954 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
956 void WMCloseWindow(WMWindow
*win
);
958 /* ....................................................................... */
960 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
962 #define WMCreateCommandButton(parent) \
963 WMCreateCustomButton((parent), WBBSpringLoadedMask\
968 #define WMCreateRadioButton(parent) \
969 WMCreateButton((parent), WBTRadio)
971 #define WMCreateSwitchButton(parent) \
972 WMCreateButton((parent), WBTSwitch)
974 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
976 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
978 void WMSetButtonImageDefault(WMButton
*bPtr
);
980 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
982 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
984 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
986 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
988 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
990 void WMSetButtonText(WMButton
*bPtr
, char *text
);
992 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
994 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
996 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
998 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1000 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1002 int WMGetButtonSelected(WMButton
*bPtr
);
1004 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1006 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1008 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1010 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1012 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1014 void WMPerformButtonClick(WMButton
*bPtr
);
1016 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1018 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1020 /* ....................................................................... */
1022 WMLabel
*WMCreateLabel(WMWidget
*parent
);
1024 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1026 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1028 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
1030 char *WMGetLabelText(WMLabel
*lPtr
);
1032 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1034 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1036 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1038 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1040 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1042 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1044 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1046 /* ....................................................................... */
1048 WMFrame
*WMCreateFrame(WMWidget
*parent
);
1050 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1052 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1054 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1056 /* ....................................................................... */
1058 WMTextField
*WMCreateTextField(WMWidget
*parent
);
1060 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1062 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1064 /* you can free the returned string */
1065 char *WMGetTextFieldText(WMTextField
*tPtr
);
1067 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1069 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1071 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1073 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
1075 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1077 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1079 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1081 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1083 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1085 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1087 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1089 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1091 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1093 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1096 extern char *WMTextDidChangeNotification
;
1097 extern char *WMTextDidBeginEditingNotification
;
1098 extern char *WMTextDidEndEditingNotification
;
1100 /* ....................................................................... */
1102 WMScroller
*WMCreateScroller(WMWidget
*parent
);
1104 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1105 float knobProportion
);
1107 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1109 float WMGetScrollerValue(WMScroller
*sPtr
);
1111 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1113 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1115 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1116 WMScrollArrowPosition position
);
1118 extern char *WMScrollerDidScrollNotification
;
1120 /* ....................................................................... */
1122 WMList
*WMCreateList(WMWidget
*parent
);
1124 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1126 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1128 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1130 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1132 void WMSortListItems(WMList
*lPtr
);
1134 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1136 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1138 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
1140 WMArray
*WMGetListItems(WMList
*lPtr
);
1142 void WMRemoveListItem(WMList
*lPtr
, int row
);
1144 void WMSelectListItem(WMList
*lPtr
, int row
);
1146 void WMUnselectListItem(WMList
*lPtr
, int row
);
1148 /* This will select all items in range, and deselect all the others */
1149 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1151 /* This will select all items in range, leaving the others as they are */
1152 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1154 void WMSelectAllListItems(WMList
*lPtr
);
1156 void WMUnselectAllListItems(WMList
*lPtr
);
1158 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1160 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1162 int WMGetListItemHeight(WMList
*lPtr
);
1164 /* don't free the returned data */
1165 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1168 * For the following 2 functions, in case WMList allows multiple selection,
1169 * the first item in the list of selected items, respective its row number,
1173 /* don't free the returned data */
1174 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1176 int WMGetListSelectedItemRow(WMList
*lPtr
);
1178 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1180 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1182 void WMClearList(WMList
*lPtr
);
1184 int WMGetListNumberOfRows(WMList
*lPtr
);
1186 void WMSetListPosition(WMList
*lPtr
, int row
);
1188 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1190 int WMGetListPosition(WMList
*lPtr
);
1192 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1194 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1197 extern char *WMListDidScrollNotification
;
1198 extern char *WMListSelectionDidChangeNotification
;
1200 /* ....................................................................... */
1202 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1204 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1206 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1208 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1210 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1212 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1214 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1216 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1218 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1220 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1222 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1224 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1226 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1227 WMCompareDataProc
*func
);
1229 /* Don't free the returned string. */
1230 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1232 /* free the returned string */
1233 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1235 /* free the returned string */
1236 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1238 /* free the returned array */
1239 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1241 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1243 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1246 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1248 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1250 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1252 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1254 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1256 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1258 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1260 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1262 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1264 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1266 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1268 /* ....................................................................... */
1271 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1273 WMMenuItem
*WMCreateMenuItem(void);
1275 void WMDestroyMenuItem(WMMenuItem
*item
);
1277 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1279 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1281 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1283 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1285 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1287 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1289 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1291 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1293 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1295 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1297 void *WMGetMenuItemData(WMMenuItem
*item
);
1299 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1301 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1303 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1305 int WMGetMenuItemState(WMMenuItem
*item
);
1307 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1309 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1311 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1313 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1315 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1317 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1319 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1321 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1323 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1326 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1328 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1331 /* ....................................................................... */
1333 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1335 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1338 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1340 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1342 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1345 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1347 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1349 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1351 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1353 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1355 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1357 /* don't free the returned data */
1358 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1360 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1363 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1365 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1367 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1369 /* ....................................................................... */
1371 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1373 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1375 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1377 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1379 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1381 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1383 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1386 /* ....................................................................... */
1388 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1390 void WMFreeColorPanel(WMColorPanel
*panel
);
1392 void WMShowColorPanel(WMColorPanel
*panel
);
1394 void WMCloseColorPanel(WMColorPanel
*panel
);
1396 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1398 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1400 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1402 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1404 extern char *WMColorPanelColorChangedNotification
;
1406 /* ....................................................................... */
1408 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1410 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1412 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1414 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1417 extern char *WMColorWellDidChangeNotification
;
1420 /* ...................................................................... */
1422 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1424 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1425 unsigned int height
);
1427 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1429 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1431 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1433 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1435 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1437 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1439 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1441 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1443 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1445 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1447 /* ....................................................................... */
1449 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1451 int WMGetSliderMinValue(WMSlider
*slider
);
1453 int WMGetSliderMaxValue(WMSlider
*slider
);
1455 int WMGetSliderValue(WMSlider
*slider
);
1457 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1459 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1461 void WMSetSliderValue(WMSlider
*slider
, int value
);
1463 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1465 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1467 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1469 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1471 /* ....................................................................... */
1474 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1475 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1476 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1478 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1480 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1482 /* remove the first subview == view */
1483 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1485 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1488 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1490 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1492 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1493 WMSplitViewConstrainProc
*proc
);
1496 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1497 WMSplitViewResizeSubviewsProc *proc);
1500 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1502 /* ...................................................................... */
1504 WMRuler
*WMCreateRuler (WMWidget
*parent
);
1506 WMRulerMargins
*WMGetRulerMargins(WMRuler
*rPtr
);
1508 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1510 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
,
1511 WMRulerMargins
*anotherMargin
);
1513 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1515 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1517 int WMGetRulerOffset(WMRuler
*rPtr
);
1519 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1521 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1523 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1525 /* ....................................................................... */
1528 #define WMCreateText(parent) WMCreateTextForDocumentType \
1529 ((parent), (NULL), (NULL))
1531 WMText
*WMCreateTextForDocumentType(WMWidget
*parent
,
1532 WMAction
*parser
, WMAction
*writer
);
1534 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1536 void WMFreezeText(WMText
*tPtr
);
1538 #define WMRefreshText(tPtr) WMThawText((tPtr))
1540 void WMThawText(WMText
*tPtr
);
1542 int WMScrollText(WMText
*tPtr
, int amount
);
1544 int WMPageText(WMText
*tPtr
, Bool direction
);
1546 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1548 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1550 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1552 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1554 int WMGetTextRulerShown(WMText
*tPtr
);
1556 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1558 int WMGetTextEditable(WMText
*tPtr
);
1560 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1562 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1564 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1566 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1568 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1570 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1572 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1574 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1576 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1578 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1580 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1582 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1584 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1586 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1588 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1590 #define WMClearText(tPtr) WMAppendTextStream \
1594 char * WMGetTextStream(WMText
*tPtr
);
1597 char * WMGetTextSelectedStream(WMText
*tPtr
);
1599 /* destroy the array */
1600 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1602 /* destroy the array */
1603 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1605 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1607 WMColor
*WMGetTextSelectionColor(WMText
*tPtr
);
1609 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1611 WMFont
*WMGetTextSelectionFont(WMText
*tPtr
);
1613 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1615 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1617 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1619 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1620 Bool caseSensitive
);
1622 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1625 /* parser related stuff... use only if implementing a new parser */
1627 void *WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1628 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1630 void *WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1631 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1633 void *WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1634 WMColor
*color
, unsigned short first
, unsigned short length
);
1636 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1637 unsigned int kanji
, unsigned int underlined
, int script
,
1638 WMRulerMargins
*margins
);
1640 /* do NOT free the margins */
1641 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1642 unsigned int *kanji
, unsigned int *underlined
, int *script
,
1643 WMRulerMargins
*margins
);
1645 int WMGetTextInsertType(WMText
*tPtr
);
1647 int WMGetTextBlocks(WMText
*tPtr
);
1649 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1651 int WMGetCurrentTextBlock(WMText
*tPtr
);
1653 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1655 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1657 void *WMRemoveTextBlock(WMText
*tPtr
);
1659 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1661 /* ....................................................................... */
1664 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1666 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1668 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1670 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1672 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1674 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1676 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1678 WMTabViewItem
*WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1679 int identifier
, char *label
);
1681 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1683 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1685 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1687 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1689 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1691 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1693 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1695 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1697 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1700 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1702 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1704 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1706 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1708 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1710 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1712 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1715 /* ....................................................................... */
1717 WMBox
*WMCreateBox(WMWidget
*parent
);
1719 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1721 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1722 int minSize
, int maxSize
, int space
);
1724 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1725 int minSize
, int maxSize
, int space
);
1727 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1729 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1731 /* ....................................................................... */
1733 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1734 char *defaultButton
, char *alternateButton
,
1737 /* you can free the returned string */
1738 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1739 char *defaultText
, char *okButton
, char *cancelButton
);
1741 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1742 char *msg
, char *defaultButton
,
1743 char *alternateButton
, char *otherButton
);
1745 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1746 char *msg
, char *defaultText
, char *okButton
,
1747 char *cancelButton
);
1750 WMGenericPanel
*WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1751 char *title
, char *defaultButton
,
1752 char *alternateButton
);
1754 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1756 void WMDestroyInputPanel(WMInputPanel
*panel
);
1758 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1760 /* ....................................................................... */
1762 /* only 1 instance per WMScreen */
1763 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1765 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1767 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1769 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1771 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1773 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1775 /* you can free the returned string */
1776 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1778 void WMFreeFilePanel(WMFilePanel
*panel
);
1780 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1781 char *path
, char *name
, char **fileTypes
);
1783 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1785 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1788 /* ...................................................................... */
1790 /* only 1 instance per WMScreen */
1791 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1793 void WMShowFontPanel(WMFontPanel
*panel
);
1795 void WMHideFontPanel(WMFontPanel
*panel
);
1797 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1799 /* you can free the returned string */
1800 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1802 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1806 #endif /* __cplusplus */