7 #include <WINGs/WUtil.h>
10 #define WINGS_H_VERSION 20010117
15 #endif /* __cplusplus */
21 typedef unsigned long WMPixel
;
43 #define ClientMessageMask (1L<<30)
46 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
47 #define _DEFINED_GNUSTEP_WINDOW_INFO
49 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
50 * NSDesktopWindowLevel intended to be the level at which things
51 * on the desktop sit ... so you should be able
52 * to put a desktop background just below it.
54 * Applications are actually permitted to use any value in the
55 * range INT_MIN+1 to INT_MAX
58 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
59 WMNormalWindowLevel
= 0,
60 WMFloatingWindowLevel
= 3,
61 WMSubmenuWindowLevel
= 3,
62 WMTornOffMenuWindowLevel
= 3,
63 WMMainMenuWindowLevel
= 20,
64 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
65 WMStatusWindowLevel
= 21,
66 WMModalPanelWindowLevel
= 100,
67 WMPopUpMenuWindowLevel
= 101,
68 WMScreenSaverWindowLevel
= 1000
72 /* window attributes */
74 WMBorderlessWindowMask
= 0,
75 WMTitledWindowMask
= 1,
76 WMClosableWindowMask
= 2,
77 WMMiniaturizableWindowMask
= 4,
78 WMResizableWindowMask
= 8,
79 WMIconWindowMask
= 64,
80 WMMiniWindowMask
= 128
87 /* 0 is reserved for internal use */
93 WBTMomentaryChange
= 6,
98 /* button behaviour masks */
100 WBBSpringLoadedMask
= (1 << 0),
101 WBBPushInMask
= (1 << 1),
102 WBBPushChangeMask
= (1 << 2),
103 WBBPushLightMask
= (1 << 3),
104 WBBStateLightMask
= (1 << 5),
105 WBBStateChangeMask
= (1 << 6),
106 WBBStatePushMask
= (1 << 7)
110 /* frame title positions */
134 /* alignment types */
139 WAJustified
/* not valid for textfields */
155 /* scroller arrow position */
160 } WMScrollArrowPosition
;
175 /* usable scroller parts */
180 } WMUsableScrollerParts
;
192 WTTopTabsBevelBorder
,
199 /* text movement types */
201 WMIllegalTextMovement
,
202 WMReturnTextMovement
,
203 WMEscapeTextMovement
,
205 WMBacktabTextMovement
,
212 /* text field special events */
220 WLNotFound
= -1 /* element was not found in WMList */
224 /* drag operations */
232 } WMDragOperationType
;
236 WMGrayModeColorPanel
= 1,
237 WMRGBModeColorPanel
= 2,
238 WMCMYKModeColorPanel
= 3,
239 WMHSBModeColorPanel
= 4,
240 WMCustomPaletteModeColorPanel
= 5,
241 WMColorListModeColorPanel
= 6,
242 WMWheelModeColorPanel
= 7
248 #define WSIReturnArrow 1
249 #define WSIHighlightedReturnArrow 2
250 #define WSIScrollerDimple 3
251 #define WSIArrowLeft 4
252 #define WSIHighlightedArrowLeft 5
253 #define WSIArrowRight 6
254 #define WSIHighlightedArrowRight 7
256 #define WSIHighlightedArrowUp 9
257 #define WSIArrowDown 10
258 #define WSIHighlightedArrowDown 11
259 #define WSICheckMark 12
262 WLDSSelected
= (1 << 16),
263 WLDSDisabled
= (1 << 17),
264 WLDSFocused
= (1 << 18),
265 WLDSIsBranch
= (1 << 19)
268 /* alert panel return values */
278 /* types of input observers */
280 WIReadMask
= (1 << 0),
281 WIWriteMask
= (1 << 1),
282 WIExceptMask
= (1 << 2)
302 WC_Matrix
= 12, /* not ready */
305 WC_ProgressIndicator
= 15,
312 /* All widgets must start with the following structure
313 * in that order. Used for typecasting to get some generic data */
314 typedef struct W_WidgetType
{
321 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
322 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
327 typedef void WMWidget
;
329 typedef struct W_Pixmap WMPixmap
;
330 typedef struct W_Font WMFont
;
331 typedef struct W_Color WMColor
;
333 typedef struct W_Screen WMScreen
;
335 typedef struct W_View WMView
;
337 typedef struct W_Window WMWindow
;
338 typedef struct W_Frame WMFrame
;
339 typedef struct W_Button WMButton
;
340 typedef struct W_Label WMLabel
;
341 typedef struct W_TextField WMTextField
;
342 typedef struct W_Scroller WMScroller
;
343 typedef struct W_ScrollView WMScrollView
;
344 typedef struct W_List WMList
;
345 typedef struct W_Browser WMBrowser
;
346 typedef struct W_PopUpButton WMPopUpButton
;
347 typedef struct W_ProgressIndicator WMProgressIndicator
;
348 typedef struct W_ColorWell WMColorWell
;
349 typedef struct W_Slider WMSlider
;
350 typedef struct W_Matrix WMMatrix
; /* not ready */
351 typedef struct W_SplitView WMSplitView
;
352 typedef struct W_TabView WMTabView
;
353 typedef struct W_Ruler WMRuler
;
354 typedef struct W_Text WMText
;
355 typedef struct W_Box WMBox
;
359 typedef struct W_TabViewItem WMTabViewItem
;
360 typedef struct W_MenuItem WMMenuItem
;
363 typedef struct W_FilePanel WMFilePanel
;
364 typedef WMFilePanel WMOpenPanel
;
365 typedef WMFilePanel WMSavePanel
;
367 typedef struct W_FontPanel WMFontPanel
;
369 typedef struct W_ColorPanel WMColorPanel
;
372 /* item for WMList */
373 typedef struct WMListItem
{
375 void *clientData
; /* ptr for user clientdata. */
377 unsigned int uflags
:16; /* flags for the user */
378 unsigned int selected
:1;
379 unsigned int disabled
:1;
380 unsigned int isBranch
:1;
381 unsigned int loaded
:1;
384 /* struct for message panel */
385 typedef struct WMAlertPanel
{
386 WMWindow
*win
; /* window */
388 WMButton
*defBtn
; /* default button */
389 WMButton
*altBtn
; /* alternative button */
390 WMButton
*othBtn
; /* other button */
391 WMLabel
*iLbl
; /* icon label */
392 WMLabel
*tLbl
; /* title label */
393 WMLabel
*mLbl
; /* message label */
394 WMFrame
*line
; /* separator */
395 short result
; /* button that was pushed */
399 typedef struct WMGenericPanel
{
420 typedef struct WMInputPanel
{
421 WMWindow
*win
; /* window */
422 WMButton
*defBtn
; /* default button */
423 WMButton
*altBtn
; /* alternative button */
424 WMLabel
*tLbl
; /* title label */
425 WMLabel
*mLbl
; /* message label */
426 WMTextField
*text
; /* text field */
427 short result
; /* button that was pushed */
433 WMArray
*tabs
; /* a growable array of tabstops */
434 unsigned short left
; /* left margin marker */
435 unsigned short right
; /* right margin marker */
436 unsigned short first
; /* indentation marker for first line only */
437 unsigned short body
; /* body indentation marker */
438 unsigned short retainCount
;
440 /* All indentation and tab markers are _relative_ to the left margin marker */
443 typedef void WMEventProc(XEvent
*event
, void *clientData
);
445 typedef void WMEventHook(XEvent
*event
);
447 /* self is set to the widget from where the callback is being called and
448 * clientData to the data set to with WMSetClientData() */
449 typedef void WMAction(WMWidget
*self
, void *clientData
);
451 /* same as WMAction, but for stuff that arent widgets */
452 typedef void WMAction2(void *self
, void *clientData
);
455 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
457 /* delegate method like stuff */
458 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
459 int state
, WMRect
*rect
);
462 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
463 unsigned int oldWidth,
464 unsigned int oldHeight);
467 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
468 int *minSize
, int *maxSize
);
470 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
475 typedef struct WMBrowserDelegate
{
478 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
479 WMBrowser
*sender
, int column
, WMList
*list
);
481 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
484 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
486 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
490 typedef struct WMTextFieldDelegate
{
493 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
494 WMNotification
*notif
);
496 void (*didChange
)(struct WMTextFieldDelegate
*self
,
497 WMNotification
*notif
);
499 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
500 WMNotification
*notif
);
502 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
505 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
507 } WMTextFieldDelegate
;
510 typedef struct WMTextDelegate
{
513 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
520 typedef struct WMTabViewDelegate
{
523 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
526 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
527 WMTabViewItem
*item
);
529 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
530 WMTabViewItem
*item
);
532 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
533 WMTabViewItem
*item
);
539 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
540 Time timestamp
, void *cdata
, WMData
*data
);
543 typedef struct WMSelectionProcs
{
544 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
545 void *cdata
, Atom
*type
);
546 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
547 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
552 typedef struct W_DraggingInfo WMDraggingInfo
;
555 typedef struct W_DragSourceProcs
{
556 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
557 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
558 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
560 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
561 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
566 typedef struct W_DragDestinationProcs
{
567 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
568 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
569 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
570 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
571 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
572 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
573 } WMDragDestinationProcs
;
577 /* ...................................................................... */
580 WMPoint
wmkpoint(int x
, int y
);
582 WMSize
wmksize(unsigned int width
, unsigned int height
);
584 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
585 #define wmksize(width, height) (WMSize){(width), (height)}
586 #define wmkpoint(x, y) (WMPoint){(x), (y)}
589 /* ....................................................................... */
593 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
595 void WMSetResourcePath(char *path
);
597 /* don't free the returned string */
598 char *WMGetApplicationName();
600 /* Try to locate resource file. ext may be NULL */
601 char *WMPathForResourceOfType(char *resource
, char *ext
);
604 WMScreen
*WMOpenScreen(const char *display
);
606 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
609 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
611 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
613 void WMScreenMainLoop(WMScreen
*scr
);
615 void WMBreakModalLoop(WMScreen
*scr
);
617 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
619 RContext
*WMScreenRContext(WMScreen
*scr
);
621 Display
*WMScreenDisplay(WMScreen
*scr
);
623 int WMScreenDepth(WMScreen
*scr
);
627 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
629 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
631 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
633 void WMSetFocusToWidget(WMWidget
*widget
);
635 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
637 int WMHandleEvent(XEvent
*event
);
639 Bool
WMScreenPending(WMScreen
*scr
);
641 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
642 WMEventProc
*eventProc
, void *clientData
);
644 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
645 WMEventProc
*eventProc
, void *clientData
);
647 int WMIsDoubleClick(XEvent
*event
);
649 int WMIsTripleClick(XEvent
*event
);
651 void WMNextEvent(Display
*dpy
, XEvent
*event
);
653 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
656 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
657 WMSelectionProcs
*procs
, void *cdata
);
659 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
661 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
662 Time timestamp
, WMSelectionCallback
*callback
,
666 /* ....................................................................... */
668 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
670 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
671 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
674 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
676 void WMUnregisterViewDraggedTypes(WMView
*view
);
678 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
681 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
683 /* ....................................................................... */
685 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
687 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
689 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
691 WMFont
*WMRetainFont(WMFont
*font
);
693 void WMReleaseFont(WMFont
*font
);
695 unsigned int WMFontHeight(WMFont
*font
);
698 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
700 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
704 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
706 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
708 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
710 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
712 XFontSet
WMGetFontFontSet(WMFont
*font
);
714 WMFont
*WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
716 WMFont
*WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
718 WMFont
*WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
720 WMFont
*WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
722 WMFont
*WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
724 WMFont
*WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
726 /* ....................................................................... */
728 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
730 void WMReleasePixmap(WMPixmap
*pixmap
);
732 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
735 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
736 Pixmap mask
, int width
, int height
,
739 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
742 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
744 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
746 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
748 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
751 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
754 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
756 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
758 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
760 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
762 /* ....................................................................... */
765 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
767 WMColor
*WMGrayColor(WMScreen
*scr
);
769 WMColor
*WMBlackColor(WMScreen
*scr
);
771 WMColor
*WMWhiteColor(WMScreen
*scr
);
773 void WMSetColorInGC(WMColor
*color
, GC gc
);
775 GC
WMColorGC(WMColor
*color
);
777 WMPixel
WMColorPixel(WMColor
*color
);
779 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
780 unsigned int width
, unsigned int height
);
782 void WMReleaseColor(WMColor
*color
);
784 WMColor
*WMRetainColor(WMColor
*color
);
786 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
787 unsigned short green
, unsigned short blue
,
790 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
792 unsigned short WMRedComponentOfColor(WMColor
*color
);
794 unsigned short WMGreenComponentOfColor(WMColor
*color
);
796 unsigned short WMBlueComponentOfColor(WMColor
*color
);
798 char *WMGetColorRGBDescription(WMColor
*color
);
800 /* ....................................................................... */
803 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
804 int y
, char *text
, int length
);
806 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
807 int y
, char *text
, int length
);
809 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
813 /* ....................................................................... */
815 WMScreen
*WMWidgetScreen(WMWidget
*w
);
817 unsigned int WMScreenWidth(WMScreen
*scr
);
819 unsigned int WMScreenHeight(WMScreen
*scr
);
821 void WMUnmapWidget(WMWidget
*w
);
823 void WMMapWidget(WMWidget
*w
);
825 Bool
WMWidgetIsMapped(WMWidget
*w
);
827 void WMRaiseWidget(WMWidget
*w
);
829 void WMLowerWidget(WMWidget
*w
);
831 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
833 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
835 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
837 void WMMapSubwidgets(WMWidget
*w
);
839 void WMUnmapSubwidgets(WMWidget
*w
);
841 void WMRealizeWidget(WMWidget
*w
);
843 void WMDestroyWidget(WMWidget
*widget
);
845 void WMHangData(WMWidget
*widget
, void *data
);
847 void *WMGetHangedData(WMWidget
*widget
);
849 unsigned int WMWidgetWidth(WMWidget
*w
);
851 unsigned int WMWidgetHeight(WMWidget
*w
);
853 Window
WMWidgetXID(WMWidget
*w
);
855 Window
WMViewXID(WMView
*view
);
857 void WMRedisplayWidget(WMWidget
*w
);
859 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
861 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
862 int rightOffs
, int bottomOffs
);
864 WMSize
WMGetViewSize(WMView
*view
);
866 WMPoint
WMGetViewPosition(WMView
*view
);
868 WMPoint
WMGetViewScreenPosition(WMView
*view
);
870 WMWidget
*WMWidgetOfView(WMView
*view
);
872 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
874 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
877 extern char *WMViewSizeDidChangeNotification
;
879 extern char *WMViewRealizedNotification
;
881 extern char *WMFontPanelDidChangeNotification
;
884 /* ....................................................................... */
886 void WMSetBalloonTextForView(char *text
, WMView
*view
);
888 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
890 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
892 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
894 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
896 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
899 /* ....................................................................... */
901 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
903 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
905 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
908 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
910 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
912 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
914 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
916 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
918 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
920 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
922 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
924 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
927 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
929 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
931 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
933 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
935 void WMSetWindowLevel(WMWindow
*win
, int level
);
937 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
939 void WMCloseWindow(WMWindow
*win
);
941 /* ....................................................................... */
943 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
945 #define WMCreateCommandButton(parent) \
946 WMCreateCustomButton((parent), WBBSpringLoadedMask\
951 #define WMCreateRadioButton(parent) \
952 WMCreateButton((parent), WBTRadio)
954 #define WMCreateSwitchButton(parent) \
955 WMCreateButton((parent), WBTSwitch)
957 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
959 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
961 void WMSetButtonImageDefault(WMButton
*bPtr
);
963 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
965 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
967 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
969 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
971 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
973 void WMSetButtonText(WMButton
*bPtr
, char *text
);
975 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
977 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
979 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
981 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
983 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
985 int WMGetButtonSelected(WMButton
*bPtr
);
987 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
989 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
991 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
993 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
995 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
997 void WMPerformButtonClick(WMButton
*bPtr
);
999 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1001 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1003 /* ....................................................................... */
1005 WMLabel
*WMCreateLabel(WMWidget
*parent
);
1007 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1009 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1011 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
1013 char *WMGetLabelText(WMLabel
*lPtr
);
1015 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1017 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1019 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1021 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1023 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1025 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1027 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1029 /* ....................................................................... */
1031 WMFrame
*WMCreateFrame(WMWidget
*parent
);
1033 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1035 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1037 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1039 /* ....................................................................... */
1041 WMTextField
*WMCreateTextField(WMWidget
*parent
);
1043 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1045 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1047 /* you can free the returned string */
1048 char *WMGetTextFieldText(WMTextField
*tPtr
);
1050 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1052 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1054 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1056 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
1058 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1060 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1062 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1064 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1066 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1068 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1070 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1072 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1074 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1076 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1079 extern char *WMTextDidChangeNotification
;
1080 extern char *WMTextDidBeginEditingNotification
;
1081 extern char *WMTextDidEndEditingNotification
;
1083 /* ....................................................................... */
1085 WMScroller
*WMCreateScroller(WMWidget
*parent
);
1087 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1088 float knobProportion
);
1090 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1092 float WMGetScrollerValue(WMScroller
*sPtr
);
1094 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1096 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1098 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1099 WMScrollArrowPosition position
);
1101 extern char *WMScrollerDidScrollNotification
;
1103 /* ....................................................................... */
1105 WMList
*WMCreateList(WMWidget
*parent
);
1107 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1109 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1111 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1113 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1115 void WMSortListItems(WMList
*lPtr
);
1117 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1119 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1121 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
1123 WMArray
*WMGetListItems(WMList
*lPtr
);
1125 void WMRemoveListItem(WMList
*lPtr
, int row
);
1127 void WMSelectListItem(WMList
*lPtr
, int row
);
1129 void WMUnselectListItem(WMList
*lPtr
, int row
);
1131 /* This will select all items in range, and deselect all the others */
1132 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1134 /* This will select all items in range, leaving the others as they are */
1135 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1137 void WMSelectAllListItems(WMList
*lPtr
);
1139 void WMUnselectAllListItems(WMList
*lPtr
);
1141 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1143 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1145 int WMGetListItemHeight(WMList
*lPtr
);
1147 /* don't free the returned data */
1148 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1151 * For the following 2 functions, in case WMList allows multiple selection,
1152 * the first item in the list of selected items, respective its row number,
1156 /* don't free the returned data */
1157 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1159 int WMGetListSelectedItemRow(WMList
*lPtr
);
1161 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1163 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1165 void WMClearList(WMList
*lPtr
);
1167 int WMGetListNumberOfRows(WMList
*lPtr
);
1169 void WMSetListPosition(WMList
*lPtr
, int row
);
1171 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1173 int WMGetListPosition(WMList
*lPtr
);
1175 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1177 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1180 extern char *WMListDidScrollNotification
;
1181 extern char *WMListSelectionDidChangeNotification
;
1183 /* ....................................................................... */
1185 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1187 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1189 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1191 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1193 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1195 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1197 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1199 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1201 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1203 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1205 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1207 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1209 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1210 WMCompareDataProc
*func
);
1212 /* Don't free the returned string. */
1213 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1215 /* free the returned string */
1216 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1218 /* free the returned string */
1219 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1221 /* free the returned array */
1222 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1224 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1226 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1229 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1231 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1233 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1235 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1237 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1239 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1241 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1243 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1245 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1247 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1249 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1251 /* ....................................................................... */
1254 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1256 WMMenuItem
*WMCreateMenuItem(void);
1258 void WMDestroyMenuItem(WMMenuItem
*item
);
1260 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1262 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1264 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1266 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1268 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1270 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1272 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1274 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1276 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1278 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1280 void *WMGetMenuItemData(WMMenuItem
*item
);
1282 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1284 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1286 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1288 int WMGetMenuItemState(WMMenuItem
*item
);
1290 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1292 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1294 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1296 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1298 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1300 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1302 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1304 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1306 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1309 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1311 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1314 /* ....................................................................... */
1316 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1318 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1321 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1323 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1325 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1328 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1330 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1332 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1334 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1336 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1338 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1340 /* don't free the returned data */
1341 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1343 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1346 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1348 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1350 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1352 /* ....................................................................... */
1354 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1356 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1358 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1360 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1362 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1364 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1366 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1369 /* ....................................................................... */
1371 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1373 void WMFreeColorPanel(WMColorPanel
*panel
);
1375 void WMShowColorPanel(WMColorPanel
*panel
);
1377 void WMCloseColorPanel(WMColorPanel
*panel
);
1379 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1381 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1383 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1385 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1387 extern char *WMColorPanelColorChangedNotification
;
1389 /* ....................................................................... */
1391 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1393 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1395 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1397 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1400 extern char *WMColorWellDidChangeNotification
;
1403 /* ...................................................................... */
1405 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1407 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1408 unsigned int height
);
1410 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1412 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1414 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1416 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1418 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1420 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1422 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1424 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1426 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1428 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1430 /* ....................................................................... */
1432 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1434 int WMGetSliderMinValue(WMSlider
*slider
);
1436 int WMGetSliderMaxValue(WMSlider
*slider
);
1438 int WMGetSliderValue(WMSlider
*slider
);
1440 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1442 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1444 void WMSetSliderValue(WMSlider
*slider
, int value
);
1446 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1448 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1450 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1452 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1454 /* ....................................................................... */
1457 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1458 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1459 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1461 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1463 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1465 /* remove the first subview == view */
1466 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1468 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1471 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1473 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1475 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1476 WMSplitViewConstrainProc
*proc
);
1479 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1480 WMSplitViewResizeSubviewsProc *proc);
1483 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1485 /* ...................................................................... */
1487 WMRuler
*WMCreateRuler (WMWidget
*parent
);
1489 WMRulerMargins
*WMGetRulerMargins(WMRuler
*rPtr
);
1491 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1493 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
,
1494 WMRulerMargins
*anotherMargin
);
1496 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1498 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1500 int WMGetRulerOffset(WMRuler
*rPtr
);
1502 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1504 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1506 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1508 /* ....................................................................... */
1511 #define WMCreateText(parent) WMCreateTextForDocumentType \
1512 ((parent), (NULL), (NULL))
1514 WMText
*WMCreateTextForDocumentType(WMWidget
*parent
,
1515 WMAction
*parser
, WMAction
*writer
);
1517 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1519 void WMFreezeText(WMText
*tPtr
);
1521 #define WMRefreshText(tPtr) WMThawText((tPtr))
1523 void WMThawText(WMText
*tPtr
);
1525 int WMScrollText(WMText
*tPtr
, int amount
);
1527 int WMPageText(WMText
*tPtr
, Bool direction
);
1529 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1531 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1533 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1535 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1537 int WMGetTextRulerShown(WMText
*tPtr
);
1539 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1541 int WMGetTextEditable(WMText
*tPtr
);
1543 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1545 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1547 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1549 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1551 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1553 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1555 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1557 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1559 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1561 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1563 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1565 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1567 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1569 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1571 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1573 #define WMClearText(tPtr) WMAppendTextStream \
1577 char * WMGetTextStream(WMText
*tPtr
);
1580 char * WMGetTextSelectedStream(WMText
*tPtr
);
1582 /* destroy the array */
1583 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1585 /* destroy the array */
1586 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1588 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1590 WMColor
*WMGetTextSelectionColor(WMText
*tPtr
);
1592 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1594 WMFont
*WMGetTextSelectionFont(WMText
*tPtr
);
1596 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1598 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1600 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1602 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1603 Bool caseSensitive
);
1605 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1608 /* parser related stuff... use only if implementing a new parser */
1610 void *WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1611 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1613 void *WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1614 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1616 void *WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1617 WMColor
*color
, unsigned short first
, unsigned short length
);
1619 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1620 unsigned int kanji
, unsigned int underlined
, int script
,
1621 WMRulerMargins
*margins
);
1623 /* do NOT free the margins */
1624 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1625 unsigned int *kanji
, unsigned int *underlined
, int *script
,
1626 WMRulerMargins
*margins
);
1628 int WMGetTextInsertType(WMText
*tPtr
);
1630 int WMGetTextBlocks(WMText
*tPtr
);
1632 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1634 int WMGetCurrentTextBlock(WMText
*tPtr
);
1636 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1638 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1640 void *WMRemoveTextBlock(WMText
*tPtr
);
1642 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1644 /* ....................................................................... */
1647 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1649 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1651 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1653 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1655 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1657 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1659 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1661 WMTabViewItem
*WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1662 int identifier
, char *label
);
1664 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1666 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1668 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1670 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1672 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1674 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1676 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1678 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1680 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1683 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1685 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1687 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1689 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1691 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1693 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1695 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1698 /* ....................................................................... */
1700 WMBox
*WMCreateBox(WMWidget
*parent
);
1702 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1704 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1705 int minSize
, int maxSize
, int space
);
1707 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1708 int minSize
, int maxSize
, int space
);
1710 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1712 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1714 /* ....................................................................... */
1716 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1717 char *defaultButton
, char *alternateButton
,
1720 /* you can free the returned string */
1721 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1722 char *defaultText
, char *okButton
, char *cancelButton
);
1724 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1725 char *msg
, char *defaultButton
,
1726 char *alternateButton
, char *otherButton
);
1728 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1729 char *msg
, char *defaultText
, char *okButton
,
1730 char *cancelButton
);
1733 WMGenericPanel
*WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1734 char *title
, char *defaultButton
,
1735 char *alternateButton
);
1737 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1739 void WMDestroyInputPanel(WMInputPanel
*panel
);
1741 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1743 /* ....................................................................... */
1745 /* only 1 instance per WMScreen */
1746 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1748 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1750 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1752 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1754 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1756 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1758 /* you can free the returned string */
1759 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1761 void WMFreeFilePanel(WMFilePanel
*panel
);
1763 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1764 char *path
, char *name
, char **fileTypes
);
1766 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1768 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1771 /* ...................................................................... */
1773 /* only 1 instance per WMScreen */
1774 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1776 void WMShowFontPanel(WMFontPanel
*panel
);
1778 void WMHideFontPanel(WMFontPanel
*panel
);
1780 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1782 /* you can free the returned string */
1783 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1785 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1789 #endif /* __cplusplus */