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 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1042 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1044 /* ....................................................................... */
1046 WMFrame
*WMCreateFrame(WMWidget
*parent
);
1048 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1050 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1052 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1054 /* ....................................................................... */
1056 WMTextField
*WMCreateTextField(WMWidget
*parent
);
1058 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1060 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1062 /* you can free the returned string */
1063 char *WMGetTextFieldText(WMTextField
*tPtr
);
1065 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1067 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1069 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1071 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
1073 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1075 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1077 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1079 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1081 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1083 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1085 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1087 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1089 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1091 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1094 extern char *WMTextDidChangeNotification
;
1095 extern char *WMTextDidBeginEditingNotification
;
1096 extern char *WMTextDidEndEditingNotification
;
1098 /* ....................................................................... */
1100 WMScroller
*WMCreateScroller(WMWidget
*parent
);
1102 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1103 float knobProportion
);
1105 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1107 float WMGetScrollerValue(WMScroller
*sPtr
);
1109 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1111 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1113 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1114 WMScrollArrowPosition position
);
1116 extern char *WMScrollerDidScrollNotification
;
1118 /* ....................................................................... */
1120 WMList
*WMCreateList(WMWidget
*parent
);
1122 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1124 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1126 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1128 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1130 void WMSortListItems(WMList
*lPtr
);
1132 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1134 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1136 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
1138 WMArray
*WMGetListItems(WMList
*lPtr
);
1140 void WMRemoveListItem(WMList
*lPtr
, int row
);
1142 void WMSelectListItem(WMList
*lPtr
, int row
);
1144 void WMUnselectListItem(WMList
*lPtr
, int row
);
1146 /* This will select all items in range, and deselect all the others */
1147 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1149 /* This will select all items in range, leaving the others as they are */
1150 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1152 void WMSelectAllListItems(WMList
*lPtr
);
1154 void WMUnselectAllListItems(WMList
*lPtr
);
1156 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1158 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1160 int WMGetListItemHeight(WMList
*lPtr
);
1162 /* don't free the returned data */
1163 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1166 * For the following 2 functions, in case WMList allows multiple selection,
1167 * the first item in the list of selected items, respective its row number,
1171 /* don't free the returned data */
1172 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1174 int WMGetListSelectedItemRow(WMList
*lPtr
);
1176 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1178 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1180 void WMClearList(WMList
*lPtr
);
1182 int WMGetListNumberOfRows(WMList
*lPtr
);
1184 void WMSetListPosition(WMList
*lPtr
, int row
);
1186 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1188 int WMGetListPosition(WMList
*lPtr
);
1190 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1192 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1195 extern char *WMListDidScrollNotification
;
1196 extern char *WMListSelectionDidChangeNotification
;
1198 /* ....................................................................... */
1200 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1202 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1204 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1206 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1208 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1210 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1212 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1214 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1216 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1218 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1220 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1222 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1224 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1225 WMCompareDataProc
*func
);
1227 /* Don't free the returned string. */
1228 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1230 /* free the returned string */
1231 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1233 /* free the returned string */
1234 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1236 /* free the returned array */
1237 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1239 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1241 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1244 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1246 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1248 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1250 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1252 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1254 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1256 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1258 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1260 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1262 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1264 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1266 /* ....................................................................... */
1269 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1271 WMMenuItem
*WMCreateMenuItem(void);
1273 void WMDestroyMenuItem(WMMenuItem
*item
);
1275 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1277 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1279 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1281 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1283 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1285 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1287 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1289 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1291 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1293 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1295 void *WMGetMenuItemData(WMMenuItem
*item
);
1297 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1299 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1301 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1303 int WMGetMenuItemState(WMMenuItem
*item
);
1305 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1307 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1309 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1311 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1313 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1315 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1317 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1319 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1321 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1324 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1326 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1329 /* ....................................................................... */
1331 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1333 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1336 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1338 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1340 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1343 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1345 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1347 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1349 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1351 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1353 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1355 /* don't free the returned data */
1356 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1358 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1361 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1363 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1365 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1367 /* ....................................................................... */
1369 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1371 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1373 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1375 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1377 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1379 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1381 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1384 /* ....................................................................... */
1386 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1388 void WMFreeColorPanel(WMColorPanel
*panel
);
1390 void WMShowColorPanel(WMColorPanel
*panel
);
1392 void WMCloseColorPanel(WMColorPanel
*panel
);
1394 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1396 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1398 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1400 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1402 extern char *WMColorPanelColorChangedNotification
;
1404 /* ....................................................................... */
1406 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1408 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1410 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1412 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1415 extern char *WMColorWellDidChangeNotification
;
1418 /* ...................................................................... */
1420 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1422 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1423 unsigned int height
);
1425 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1427 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1429 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1431 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1433 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1435 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1437 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1439 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1441 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1443 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1445 /* ....................................................................... */
1447 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1449 int WMGetSliderMinValue(WMSlider
*slider
);
1451 int WMGetSliderMaxValue(WMSlider
*slider
);
1453 int WMGetSliderValue(WMSlider
*slider
);
1455 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1457 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1459 void WMSetSliderValue(WMSlider
*slider
, int value
);
1461 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1463 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1465 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1467 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1469 /* ....................................................................... */
1472 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1473 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1474 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1476 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1478 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1480 /* remove the first subview == view */
1481 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1483 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1486 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1488 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1490 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1491 WMSplitViewConstrainProc
*proc
);
1494 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1495 WMSplitViewResizeSubviewsProc *proc);
1498 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1500 /* ...................................................................... */
1502 WMRuler
*WMCreateRuler (WMWidget
*parent
);
1504 WMRulerMargins
*WMGetRulerMargins(WMRuler
*rPtr
);
1506 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1508 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
,
1509 WMRulerMargins
*anotherMargin
);
1511 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1513 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1515 int WMGetRulerOffset(WMRuler
*rPtr
);
1517 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1519 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1521 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1523 /* ....................................................................... */
1526 #define WMCreateText(parent) WMCreateTextForDocumentType \
1527 ((parent), (NULL), (NULL))
1529 WMText
*WMCreateTextForDocumentType(WMWidget
*parent
,
1530 WMAction
*parser
, WMAction
*writer
);
1532 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1534 void WMFreezeText(WMText
*tPtr
);
1536 #define WMRefreshText(tPtr) WMThawText((tPtr))
1538 void WMThawText(WMText
*tPtr
);
1540 int WMScrollText(WMText
*tPtr
, int amount
);
1542 int WMPageText(WMText
*tPtr
, Bool direction
);
1544 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1546 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1548 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1550 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1552 int WMGetTextRulerShown(WMText
*tPtr
);
1554 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1556 int WMGetTextEditable(WMText
*tPtr
);
1558 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1560 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1562 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1564 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1566 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1568 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1570 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1572 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1574 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1576 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1578 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1580 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1582 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1584 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1586 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1588 #define WMClearText(tPtr) WMAppendTextStream \
1592 char * WMGetTextStream(WMText
*tPtr
);
1595 char * WMGetTextSelectedStream(WMText
*tPtr
);
1597 /* destroy the array */
1598 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1600 /* destroy the array */
1601 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1603 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1605 WMColor
*WMGetTextSelectionColor(WMText
*tPtr
);
1607 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1609 WMFont
*WMGetTextSelectionFont(WMText
*tPtr
);
1611 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1613 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1615 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1617 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1618 Bool caseSensitive
);
1620 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1623 /* parser related stuff... use only if implementing a new parser */
1625 void *WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1626 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1628 void *WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1629 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1631 void *WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1632 WMColor
*color
, unsigned short first
, unsigned short length
);
1634 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1635 unsigned int kanji
, unsigned int underlined
, int script
,
1636 WMRulerMargins
*margins
);
1638 /* do NOT free the margins */
1639 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1640 unsigned int *kanji
, unsigned int *underlined
, int *script
,
1641 WMRulerMargins
*margins
);
1643 int WMGetTextInsertType(WMText
*tPtr
);
1645 int WMGetTextBlocks(WMText
*tPtr
);
1647 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1649 int WMGetCurrentTextBlock(WMText
*tPtr
);
1651 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1653 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1655 void *WMRemoveTextBlock(WMText
*tPtr
);
1657 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1659 /* ....................................................................... */
1662 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1664 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1666 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1668 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1670 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1672 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1674 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1676 WMTabViewItem
*WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1677 int identifier
, char *label
);
1679 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1681 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1683 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1685 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1687 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1689 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1691 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1693 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1695 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1698 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1700 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1702 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1704 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1706 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1708 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1710 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1713 /* ....................................................................... */
1715 WMBox
*WMCreateBox(WMWidget
*parent
);
1717 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1719 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1720 int minSize
, int maxSize
, int space
);
1722 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1723 int minSize
, int maxSize
, int space
);
1725 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1727 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1729 /* ....................................................................... */
1731 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1732 char *defaultButton
, char *alternateButton
,
1735 /* you can free the returned string */
1736 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1737 char *defaultText
, char *okButton
, char *cancelButton
);
1739 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1740 char *msg
, char *defaultButton
,
1741 char *alternateButton
, char *otherButton
);
1743 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1744 char *msg
, char *defaultText
, char *okButton
,
1745 char *cancelButton
);
1748 WMGenericPanel
*WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1749 char *title
, char *defaultButton
,
1750 char *alternateButton
);
1752 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1754 void WMDestroyInputPanel(WMInputPanel
*panel
);
1756 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1758 /* ....................................................................... */
1760 /* only 1 instance per WMScreen */
1761 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1763 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1765 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1767 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1769 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1771 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1773 /* you can free the returned string */
1774 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1776 void WMFreeFilePanel(WMFilePanel
*panel
);
1778 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1779 char *path
, char *name
, char **fileTypes
);
1781 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1783 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1786 /* ...................................................................... */
1788 /* only 1 instance per WMScreen */
1789 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1791 void WMShowFontPanel(WMFontPanel
*panel
);
1793 void WMHideFontPanel(WMFontPanel
*panel
);
1795 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1797 /* you can free the returned string */
1798 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1800 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1804 #endif /* __cplusplus */