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 */
399 typedef struct WMGenericPanel
{
421 typedef struct WMInputPanel
{
422 WMWindow
*win
; /* window */
423 WMButton
*defBtn
; /* default button */
424 WMButton
*altBtn
; /* alternative button */
425 WMLabel
*tLbl
; /* title label */
426 WMLabel
*mLbl
; /* message label */
427 WMTextField
*text
; /* text field */
428 short result
; /* button that was pushed */
435 WMArray
*tabs
; /* a growable array of tabstops */
436 unsigned short left
; /* left margin marker */
437 unsigned short right
; /* right margin marker */
438 unsigned short first
; /* indentation marker for first line only */
439 unsigned short body
; /* body indentation marker */
440 unsigned short retainCount
;
442 /* All indentation and tab markers are _relative_ to the left margin marker */
445 typedef void *WMHandlerID
;
447 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
449 typedef void WMEventProc(XEvent
*event
, void *clientData
);
451 typedef void WMEventHook(XEvent
*event
);
453 /* self is set to the widget from where the callback is being called and
454 * clientData to the data set to with WMSetClientData() */
455 typedef void WMAction(WMWidget
*self
, void *clientData
);
457 /* same as WMAction, but for stuff that arent widgets */
458 typedef void WMAction2(void *self
, void *clientData
);
461 typedef void WMCallback(void *data
);
463 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
465 /* delegate method like stuff */
466 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
467 int state
, WMRect
*rect
);
470 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
471 unsigned int oldWidth,
472 unsigned int oldHeight);
475 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
476 int *minSize
, int *maxSize
);
478 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
483 typedef struct WMBrowserDelegate
{
486 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
487 WMBrowser
*sender
, int column
, WMList
*list
);
489 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
492 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
494 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
498 typedef struct WMTextFieldDelegate
{
501 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
502 WMNotification
*notif
);
504 void (*didChange
)(struct WMTextFieldDelegate
*self
,
505 WMNotification
*notif
);
507 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
508 WMNotification
*notif
);
510 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
513 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
515 } WMTextFieldDelegate
;
518 typedef struct WMTextDelegate
{
521 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
528 typedef struct WMTabViewDelegate
{
531 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
534 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
535 WMTabViewItem
*item
);
537 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
538 WMTabViewItem
*item
);
540 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
541 WMTabViewItem
*item
);
547 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
548 Time timestamp
, void *cdata
, WMData
*data
);
551 typedef struct WMSelectionProcs
{
552 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
553 void *cdata
, Atom
*type
);
554 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
555 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
560 typedef struct W_DraggingInfo WMDraggingInfo
;
563 typedef struct W_DragSourceProcs
{
564 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
565 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
566 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
568 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
569 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
574 typedef struct W_DragDestinationProcs
{
575 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
576 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
577 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
578 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
579 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
580 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
581 } WMDragDestinationProcs
;
585 /* ...................................................................... */
588 WMRange
wmkrange(int start
, int count
);
590 WMPoint
wmkpoint(int x
, int y
);
592 WMSize
wmksize(unsigned int width
, unsigned int height
);
595 /* ....................................................................... */
599 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
601 void WMSetResourcePath(char *path
);
603 /* don't free the returned string */
604 char *WMGetApplicationName();
606 /* Try to locate resource file. ext may be NULL */
607 char *WMPathForResourceOfType(char *resource
, char *ext
);
610 WMScreen
*WMOpenScreen();
612 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
615 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
617 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
619 void WMScreenMainLoop(WMScreen
*scr
);
621 void WMBreakModalLoop(WMScreen
*scr
);
623 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
625 RContext
*WMScreenRContext(WMScreen
*scr
);
627 Display
*WMScreenDisplay(WMScreen
*scr
);
629 int WMScreenDepth(WMScreen
*scr
);
633 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
635 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
637 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
639 void WMSetFocusToWidget(WMWidget
*widget
);
641 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
643 int WMHandleEvent(XEvent
*event
);
645 Bool
WMScreenPending(WMScreen
*scr
);
647 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
648 WMEventProc
*eventProc
, void *clientData
);
650 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
651 WMEventProc
*eventProc
, void *clientData
);
653 int WMIsDoubleClick(XEvent
*event
);
655 int WMIsTripleClick(XEvent
*event
);
657 void WMNextEvent(Display
*dpy
, XEvent
*event
);
659 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
661 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
664 void WMDeleteTimerWithClientData(void *cdata
);
666 void WMDeleteTimerHandler(WMHandlerID handlerID
);
668 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
670 void WMDeleteIdleHandler(WMHandlerID handlerID
);
672 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
675 void WMDeleteInputHandler(WMHandlerID handlerID
);
679 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
680 WMSelectionProcs
*procs
, void *cdata
);
682 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
684 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
685 Time timestamp
, WMSelectionCallback
*callback
,
689 /* ....................................................................... */
691 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
693 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
694 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
697 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
699 void WMUnregisterViewDraggedTypes(WMView
*view
);
701 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
704 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
706 /* ....................................................................... */
708 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
710 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
712 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
714 WMFont
*WMRetainFont(WMFont
*font
);
716 void WMReleaseFont(WMFont
*font
);
718 unsigned int WMFontHeight(WMFont
*font
);
721 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
723 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
727 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
729 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
731 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
733 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
735 XFontSet
WMGetFontFontSet(WMFont
*font
);
737 WMFont
*WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
739 WMFont
*WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
741 WMFont
*WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
743 WMFont
*WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
745 WMFont
*WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
747 WMFont
*WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
749 /* ....................................................................... */
751 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
753 void WMReleasePixmap(WMPixmap
*pixmap
);
755 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
758 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
759 Pixmap mask
, int width
, int height
,
762 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
765 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
767 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
769 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
771 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
774 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
776 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
778 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
780 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
782 /* ....................................................................... */
785 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
787 WMColor
*WMGrayColor(WMScreen
*scr
);
789 WMColor
*WMBlackColor(WMScreen
*scr
);
791 WMColor
*WMWhiteColor(WMScreen
*scr
);
793 void WMSetColorInGC(WMColor
*color
, GC gc
);
795 GC
WMColorGC(WMColor
*color
);
797 WMPixel
WMColorPixel(WMColor
*color
);
799 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
800 unsigned int width
, unsigned int height
);
802 void WMReleaseColor(WMColor
*color
);
804 WMColor
*WMRetainColor(WMColor
*color
);
806 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
807 unsigned short green
, unsigned short blue
,
810 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
812 unsigned short WMRedComponentOfColor(WMColor
*color
);
814 unsigned short WMGreenComponentOfColor(WMColor
*color
);
816 unsigned short WMBlueComponentOfColor(WMColor
*color
);
818 char *WMGetColorRGBDescription(WMColor
*color
);
820 /* ....................................................................... */
823 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
824 int y
, char *text
, int length
);
826 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
827 int y
, char *text
, int length
);
829 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
833 /* ....................................................................... */
835 WMScreen
*WMWidgetScreen(WMWidget
*w
);
837 unsigned int WMScreenWidth(WMScreen
*scr
);
839 unsigned int WMScreenHeight(WMScreen
*scr
);
841 void WMUnmapWidget(WMWidget
*w
);
843 void WMMapWidget(WMWidget
*w
);
845 Bool
WMWidgetIsMapped(WMWidget
*w
);
847 void WMRaiseWidget(WMWidget
*w
);
849 void WMLowerWidget(WMWidget
*w
);
851 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
853 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
855 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
857 void WMMapSubwidgets(WMWidget
*w
);
859 void WMUnmapSubwidgets(WMWidget
*w
);
861 void WMRealizeWidget(WMWidget
*w
);
863 void WMDestroyWidget(WMWidget
*widget
);
865 void WMHangData(WMWidget
*widget
, void *data
);
867 void *WMGetHangedData(WMWidget
*widget
);
869 unsigned int WMWidgetWidth(WMWidget
*w
);
871 unsigned int WMWidgetHeight(WMWidget
*w
);
873 Window
WMWidgetXID(WMWidget
*w
);
875 Window
WMViewXID(WMView
*view
);
877 void WMRedisplayWidget(WMWidget
*w
);
879 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
881 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
882 int rightOffs
, int bottomOffs
);
884 WMSize
WMGetViewSize(WMView
*view
);
886 WMPoint
WMGetViewPosition(WMView
*view
);
888 WMPoint
WMGetViewScreenPosition(WMView
*view
);
890 WMWidget
*WMWidgetOfView(WMView
*view
);
892 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
894 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
897 extern char *WMViewSizeDidChangeNotification
;
899 extern char *WMViewRealizedNotification
;
901 extern char *WMFontPanelDidChangeNotification
;
904 /* ....................................................................... */
906 void WMSetBalloonTextForView(char *text
, WMView
*view
);
908 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
910 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
912 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
914 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
916 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
919 /* ....................................................................... */
921 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
923 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
925 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
928 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
930 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
932 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
934 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
936 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
938 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
940 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
942 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
944 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
947 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
949 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
951 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
953 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
955 void WMSetWindowLevel(WMWindow
*win
, int level
);
957 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
959 void WMCloseWindow(WMWindow
*win
);
961 /* ....................................................................... */
963 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
965 #define WMCreateCommandButton(parent) \
966 WMCreateCustomButton((parent), WBBSpringLoadedMask\
971 #define WMCreateRadioButton(parent) \
972 WMCreateButton((parent), WBTRadio)
974 #define WMCreateSwitchButton(parent) \
975 WMCreateButton((parent), WBTSwitch)
977 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
979 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
981 void WMSetButtonImageDefault(WMButton
*bPtr
);
983 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
985 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
987 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
989 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
991 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
993 void WMSetButtonText(WMButton
*bPtr
, char *text
);
995 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
997 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
999 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1001 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1003 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1005 int WMGetButtonSelected(WMButton
*bPtr
);
1007 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1009 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1011 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1013 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1015 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1017 void WMPerformButtonClick(WMButton
*bPtr
);
1019 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1021 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1023 /* ....................................................................... */
1025 WMLabel
*WMCreateLabel(WMWidget
*parent
);
1027 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1029 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1031 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
1033 char *WMGetLabelText(WMLabel
*lPtr
);
1035 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1037 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1039 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1041 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1043 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1045 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1047 /* ....................................................................... */
1049 WMFrame
*WMCreateFrame(WMWidget
*parent
);
1051 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1053 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1055 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1057 /* ....................................................................... */
1059 WMTextField
*WMCreateTextField(WMWidget
*parent
);
1061 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1063 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1065 /* you can free the returned string */
1066 char *WMGetTextFieldText(WMTextField
*tPtr
);
1068 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1070 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1072 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1074 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
1076 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1078 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1080 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1082 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1084 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1086 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1088 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1090 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1092 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1094 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1097 extern char *WMTextDidChangeNotification
;
1098 extern char *WMTextDidBeginEditingNotification
;
1099 extern char *WMTextDidEndEditingNotification
;
1101 /* ....................................................................... */
1103 WMScroller
*WMCreateScroller(WMWidget
*parent
);
1105 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1106 float knobProportion
);
1108 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1110 float WMGetScrollerValue(WMScroller
*sPtr
);
1112 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1114 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1116 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1117 WMScrollArrowPosition position
);
1119 extern char *WMScrollerDidScrollNotification
;
1121 /* ....................................................................... */
1123 WMList
*WMCreateList(WMWidget
*parent
);
1125 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1127 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1129 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1131 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1133 void WMSortListItems(WMList
*lPtr
);
1135 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1137 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1139 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
1141 WMArray
*WMGetListItems(WMList
*lPtr
);
1143 void WMRemoveListItem(WMList
*lPtr
, int row
);
1145 void WMSelectListItem(WMList
*lPtr
, int row
);
1147 void WMUnselectListItem(WMList
*lPtr
, int row
);
1149 /* This will select all items in range, and deselect all the others */
1150 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1152 /* This will select all items in range, leaving the others as they are */
1153 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1155 void WMSelectAllListItems(WMList
*lPtr
);
1157 void WMUnselectAllListItems(WMList
*lPtr
);
1159 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1161 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1163 int WMGetListItemHeight(WMList
*lPtr
);
1165 /* don't free the returned data */
1166 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1169 * For the following 2 functions, in case WMList allows multiple selection,
1170 * the first item in the list of selected items, respective its row number,
1174 /* don't free the returned data */
1175 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1177 int WMGetListSelectedItemRow(WMList
*lPtr
);
1179 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1181 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1183 void WMClearList(WMList
*lPtr
);
1185 int WMGetListNumberOfRows(WMList
*lPtr
);
1187 void WMSetListPosition(WMList
*lPtr
, int row
);
1189 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1191 int WMGetListPosition(WMList
*lPtr
);
1193 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1195 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1198 extern char *WMListDidScrollNotification
;
1199 extern char *WMListSelectionDidChangeNotification
;
1201 /* ....................................................................... */
1203 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1205 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1207 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1209 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1211 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1213 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1215 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1217 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1219 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1221 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1223 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1225 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1227 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1228 WMCompareDataProc
*func
);
1230 /* Don't free the returned string. */
1231 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1233 /* free the returned string */
1234 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1236 /* free the returned string */
1237 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1239 /* free the returned array */
1240 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1242 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1244 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1247 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1249 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1251 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1253 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1255 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1257 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1259 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1261 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1263 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1265 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1267 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1269 /* ....................................................................... */
1272 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1274 WMMenuItem
*WMCreateMenuItem(void);
1276 void WMDestroyMenuItem(WMMenuItem
*item
);
1278 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1280 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1282 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1284 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1286 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1288 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1290 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1292 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1294 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1296 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1298 void *WMGetMenuItemData(WMMenuItem
*item
);
1300 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1302 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1304 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1306 int WMGetMenuItemState(WMMenuItem
*item
);
1308 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1310 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1312 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1314 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1316 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1318 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1320 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1322 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1324 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1327 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1329 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1332 /* ....................................................................... */
1334 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1336 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1339 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1341 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1343 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1346 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1348 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1350 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1352 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1354 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1356 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1358 /* don't free the returned data */
1359 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1361 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1364 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1366 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1368 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1370 /* ....................................................................... */
1372 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1374 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1376 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1378 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1380 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1382 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1384 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1387 /* ....................................................................... */
1389 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1391 void WMFreeColorPanel(WMColorPanel
*panel
);
1393 void WMShowColorPanel(WMColorPanel
*panel
);
1395 void WMCloseColorPanel(WMColorPanel
*panel
);
1397 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1399 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1401 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1403 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1405 extern char *WMColorPanelColorChangedNotification
;
1407 /* ....................................................................... */
1409 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1411 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1413 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1415 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1418 extern char *WMColorWellDidChangeNotification
;
1421 /* ...................................................................... */
1423 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1425 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1426 unsigned int height
);
1428 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1430 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1432 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1434 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1436 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1438 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1440 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1442 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1444 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1446 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1448 /* ....................................................................... */
1450 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1452 int WMGetSliderMinValue(WMSlider
*slider
);
1454 int WMGetSliderMaxValue(WMSlider
*slider
);
1456 int WMGetSliderValue(WMSlider
*slider
);
1458 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1460 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1462 void WMSetSliderValue(WMSlider
*slider
, int value
);
1464 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1466 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1468 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1470 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1472 /* ....................................................................... */
1475 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1476 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1477 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1479 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1481 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1483 /* remove the first subview == view */
1484 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1486 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1489 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1491 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1493 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1494 WMSplitViewConstrainProc
*proc
);
1497 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1498 WMSplitViewResizeSubviewsProc *proc);
1501 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1503 /* ...................................................................... */
1505 WMRuler
*WMCreateRuler (WMWidget
*parent
);
1507 WMRulerMargins
*WMGetRulerMargins(WMRuler
*rPtr
);
1509 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1511 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
,
1512 WMRulerMargins
*anotherMargin
);
1514 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1516 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1518 int WMGetRulerOffset(WMRuler
*rPtr
);
1520 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1522 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1524 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1526 /* ....................................................................... */
1529 #define WMCreateText(parent) WMCreateTextForDocumentType \
1530 ((parent), (NULL), (NULL))
1532 WMText
*WMCreateTextForDocumentType(WMWidget
*parent
,
1533 WMAction
*parser
, WMAction
*writer
);
1535 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1537 void WMFreezeText(WMText
*tPtr
);
1539 #define WMRefreshText(tPtr) WMThawText((tPtr))
1541 void WMThawText(WMText
*tPtr
);
1543 int WMScrollText(WMText
*tPtr
, int amount
);
1545 int WMPageText(WMText
*tPtr
, Bool direction
);
1547 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1549 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1551 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1553 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1555 int WMGetTextRulerShown(WMText
*tPtr
);
1557 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1559 int WMGetTextEditable(WMText
*tPtr
);
1561 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1563 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1565 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1567 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1569 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1571 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1573 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1575 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1577 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1579 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1581 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1583 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1585 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1587 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1589 void WMAppendTextStream(WMText
*tPtr
, char *text
);
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 */