7 #include <WINGs/WUtil.h>
10 #define WINGS_H_VERSION 20021008
15 #endif /* __cplusplus */
21 typedef unsigned long WMPixel
;
43 #define ClientMessageMask (1L<<30)
46 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
47 #define _DEFINED_GNUSTEP_WINDOW_INFO
49 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
50 * NSDesktopWindowLevel intended to be the level at which things
51 * on the desktop sit ... so you should be able
52 * to put a desktop background just below it.
54 * Applications are actually permitted to use any value in the
55 * range INT_MIN+1 to INT_MAX
58 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
59 WMNormalWindowLevel
= 0,
60 WMFloatingWindowLevel
= 3,
61 WMSubmenuWindowLevel
= 3,
62 WMTornOffMenuWindowLevel
= 3,
63 WMMainMenuWindowLevel
= 20,
64 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
65 WMStatusWindowLevel
= 21,
66 WMModalPanelWindowLevel
= 100,
67 WMPopUpMenuWindowLevel
= 101,
68 WMScreenSaverWindowLevel
= 1000
72 /* window attributes */
74 WMBorderlessWindowMask
= 0,
75 WMTitledWindowMask
= 1,
76 WMClosableWindowMask
= 2,
77 WMMiniaturizableWindowMask
= 4,
78 WMResizableWindowMask
= 8,
79 WMIconWindowMask
= 64,
80 WMMiniWindowMask
= 128
87 /* 0 is reserved for internal use */
93 WBTMomentaryChange
= 6,
98 /* button behaviour masks */
100 WBBSpringLoadedMask
= (1 << 0),
101 WBBPushInMask
= (1 << 1),
102 WBBPushChangeMask
= (1 << 2),
103 WBBPushLightMask
= (1 << 3),
104 WBBStateLightMask
= (1 << 5),
105 WBBStateChangeMask
= (1 << 6),
106 WBBStatePushMask
= (1 << 7)
110 /* frame title positions */
134 /* alignment types */
139 WAJustified
/* not valid for textfields */
155 /* scroller arrow position */
160 } WMScrollArrowPosition
;
175 /* usable scroller parts */
180 } WMUsableScrollerParts
;
192 WTTopTabsBevelBorder
,
199 /* text movement types */
201 WMIllegalTextMovement
,
202 WMReturnTextMovement
,
203 WMEscapeTextMovement
,
205 WMBacktabTextMovement
,
212 /* text field special events */
220 WLNotFound
= -1 /* element was not found in WMList */
224 /* drag operations */
232 } WMDragOperationType
;
236 WMGrayModeColorPanel
= 1,
237 WMRGBModeColorPanel
= 2,
238 WMCMYKModeColorPanel
= 3,
239 WMHSBModeColorPanel
= 4,
240 WMCustomPaletteModeColorPanel
= 5,
241 WMColorListModeColorPanel
= 6,
242 WMWheelModeColorPanel
= 7
248 #define WSIReturnArrow 1
249 #define WSIHighlightedReturnArrow 2
250 #define WSIScrollerDimple 3
251 #define WSIArrowLeft 4
252 #define WSIHighlightedArrowLeft 5
253 #define WSIArrowRight 6
254 #define WSIHighlightedArrowRight 7
256 #define WSIHighlightedArrowUp 9
257 #define WSIArrowDown 10
258 #define WSIHighlightedArrowDown 11
259 #define WSICheckMark 12
262 WLDSSelected
= (1 << 16),
263 WLDSDisabled
= (1 << 17),
264 WLDSFocused
= (1 << 18),
265 WLDSIsBranch
= (1 << 19)
268 /* alert panel return values */
278 /* types of input observers */
280 WIReadMask
= (1 << 0),
281 WIWriteMask
= (1 << 1),
282 WIExceptMask
= (1 << 2)
302 WC_Matrix
= 12, /* not ready */
305 WC_ProgressIndicator
= 15,
312 /* All widgets must start with the following structure
313 * in that order. Used for typecasting to get some generic data */
314 typedef struct W_WidgetType
{
321 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
322 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
327 typedef void WMWidget
;
329 typedef struct W_Pixmap WMPixmap
;
330 typedef struct W_Font WMFont
;
331 typedef struct W_Color WMColor
;
333 typedef struct W_Screen WMScreen
;
335 typedef struct W_View WMView
;
337 typedef struct W_Window WMWindow
;
338 typedef struct W_Frame WMFrame
;
339 typedef struct W_Button WMButton
;
340 typedef struct W_Label WMLabel
;
341 typedef struct W_TextField WMTextField
;
342 typedef struct W_Scroller WMScroller
;
343 typedef struct W_ScrollView WMScrollView
;
344 typedef struct W_List WMList
;
345 typedef struct W_Browser WMBrowser
;
346 typedef struct W_PopUpButton WMPopUpButton
;
347 typedef struct W_ProgressIndicator WMProgressIndicator
;
348 typedef struct W_ColorWell WMColorWell
;
349 typedef struct W_Slider WMSlider
;
350 typedef struct W_Matrix WMMatrix
; /* not ready */
351 typedef struct W_SplitView WMSplitView
;
352 typedef struct W_TabView WMTabView
;
353 typedef struct W_Ruler WMRuler
;
354 typedef struct W_Text WMText
;
355 typedef struct W_Box WMBox
;
359 typedef struct W_TabViewItem WMTabViewItem
;
360 typedef struct W_MenuItem WMMenuItem
;
363 typedef struct W_FilePanel WMFilePanel
;
364 typedef WMFilePanel WMOpenPanel
;
365 typedef WMFilePanel WMSavePanel
;
367 typedef struct W_FontPanel WMFontPanel
;
369 typedef struct W_ColorPanel WMColorPanel
;
372 /* item for WMList */
373 typedef struct WMListItem
{
375 void *clientData
; /* ptr for user clientdata. */
377 unsigned int uflags
:16; /* flags for the user */
378 unsigned int selected
:1;
379 unsigned int disabled
:1;
380 unsigned int isBranch
:1;
381 unsigned int loaded
:1;
384 /* struct for message panel */
385 typedef struct WMAlertPanel
{
386 WMWindow
*win
; /* window */
389 WMButton
*defBtn
; /* default button */
390 WMButton
*altBtn
; /* alternative button */
391 WMButton
*othBtn
; /* other button */
392 WMLabel
*iLbl
; /* icon label */
393 WMLabel
*tLbl
; /* title label */
394 WMLabel
*mLbl
; /* message label */
395 WMFrame
*line
; /* separator */
396 short result
; /* button that was pushed */
400 typedef struct WMGenericPanel
{
421 typedef struct WMInputPanel
{
422 WMWindow
*win
; /* window */
423 WMButton
*defBtn
; /* default button */
424 WMButton
*altBtn
; /* alternative button */
425 WMLabel
*tLbl
; /* title label */
426 WMLabel
*mLbl
; /* message label */
427 WMTextField
*text
; /* text field */
428 short result
; /* button that was pushed */
434 WMArray
*tabs
; /* a growable array of tabstops */
435 unsigned short left
; /* left margin marker */
436 unsigned short right
; /* right margin marker */
437 unsigned short first
; /* indentation marker for first line only */
438 unsigned short body
; /* body indentation marker */
439 unsigned short retainCount
;
441 /* All indentation and tab markers are _relative_ to the left margin marker */
444 typedef void WMEventProc(XEvent
*event
, void *clientData
);
446 typedef void WMEventHook(XEvent
*event
);
448 /* self is set to the widget from where the callback is being called and
449 * clientData to the data set to with WMSetClientData() */
450 typedef void WMAction(WMWidget
*self
, void *clientData
);
452 /* same as WMAction, but for stuff that arent widgets */
453 typedef void WMAction2(void *self
, void *clientData
);
456 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
458 /* delegate method like stuff */
459 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
460 int state
, WMRect
*rect
);
463 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
464 unsigned int oldWidth,
465 unsigned int oldHeight);
468 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
469 int *minSize
, int *maxSize
);
471 typedef WMWidget
* WMMatrixCreateCellProc(WMMatrix
*mPtr
);
476 typedef struct WMBrowserDelegate
{
479 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
480 WMBrowser
*sender
, int column
, WMList
*list
);
482 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
485 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
487 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
491 typedef struct WMTextFieldDelegate
{
494 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
495 WMNotification
*notif
);
497 void (*didChange
)(struct WMTextFieldDelegate
*self
,
498 WMNotification
*notif
);
500 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
501 WMNotification
*notif
);
503 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
506 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
508 } WMTextFieldDelegate
;
511 typedef struct WMTextDelegate
{
514 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
521 typedef struct WMTabViewDelegate
{
524 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
527 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
528 WMTabViewItem
*item
);
530 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
531 WMTabViewItem
*item
);
533 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
534 WMTabViewItem
*item
);
540 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
541 Time timestamp
, void *cdata
, WMData
*data
);
544 typedef struct WMSelectionProcs
{
545 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
546 void *cdata
, Atom
*type
);
547 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
548 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
553 typedef struct W_DraggingInfo WMDraggingInfo
;
556 typedef struct W_DragSourceProcs
{
557 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
558 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
559 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
561 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
562 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
567 typedef struct W_DragDestinationProcs
{
568 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
569 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
570 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
571 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
572 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
573 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
574 } WMDragDestinationProcs
;
578 /* ...................................................................... */
581 WMPoint
wmkpoint(int x
, int y
);
583 WMSize
wmksize(unsigned int width
, unsigned int height
);
585 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
586 #define wmksize(width, height) (WMSize){(width), (height)}
587 #define wmkpoint(x, y) (WMPoint){(x), (y)}
590 /* ....................................................................... */
594 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
596 void WMSetResourcePath(char *path
);
598 /* don't free the returned string */
599 char* WMGetApplicationName();
601 /* Try to locate resource file. ext may be NULL */
602 char* WMPathForResourceOfType(char *resource
, char *ext
);
605 WMScreen
* WMOpenScreen(const char *display
);
607 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
610 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
612 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
614 void WMScreenMainLoop(WMScreen
*scr
);
616 void WMBreakModalLoop(WMScreen
*scr
);
618 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
620 RContext
* WMScreenRContext(WMScreen
*scr
);
622 Display
* WMScreenDisplay(WMScreen
*scr
);
624 int WMScreenDepth(WMScreen
*scr
);
628 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
630 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
632 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
634 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
636 /* If color==NULL it will use the default color for panels: ae/aa/ae */
637 WMPixmap
* WMCreateApplicationIconBlendedPixmap(WMScreen
*scr
, RColor
*color
);
639 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
641 void WMSetFocusToWidget(WMWidget
*widget
);
643 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
645 int WMHandleEvent(XEvent
*event
);
647 Bool
WMScreenPending(WMScreen
*scr
);
649 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
650 WMEventProc
*eventProc
, void *clientData
);
652 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
653 WMEventProc
*eventProc
, void *clientData
);
655 int WMIsDoubleClick(XEvent
*event
);
657 /*int WMIsTripleClick(XEvent *event);*/
659 void WMNextEvent(Display
*dpy
, XEvent
*event
);
661 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
664 /* ....................................................................... */
667 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
668 WMSelectionProcs
*procs
, void *cdata
);
670 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
672 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
673 Time timestamp
, WMSelectionCallback
*callback
,
677 extern char *WMSelectionOwnerDidChangeNotification
;
679 /* ....................................................................... */
681 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
683 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
684 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
687 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
689 void WMUnregisterViewDraggedTypes(WMView
*view
);
691 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
694 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
696 /* ....................................................................... */
698 WMFont
* WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
700 WMFont
* WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
702 WMFont
* WMCreateAAFont(WMScreen
*scrPtr
, char *fontName
);
704 WMFont
* WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
706 WMFont
* WMRetainFont(WMFont
*font
);
708 void WMReleaseFont(WMFont
*font
);
710 unsigned int WMFontHeight(WMFont
*font
);
712 Bool
WMIsAAFont(WMFont
*font
);
715 WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
717 WMFont* WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
721 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
723 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
725 WMFont
* WMDefaultSystemFont(WMScreen
*scrPtr
);
727 WMFont
* WMDefaultBoldSystemFont(WMScreen
*scrPtr
);
729 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
731 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
733 XFontSet
WMGetFontFontSet(WMFont
*font
);
735 WMFont
* WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
737 WMFont
* WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
739 WMFont
* WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
741 WMFont
* WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
743 WMFont
* WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
745 WMFont
* WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
747 /* ....................................................................... */
749 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
751 void WMReleasePixmap(WMPixmap
*pixmap
);
753 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
756 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
757 Pixmap mask
, int width
, int height
,
760 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
763 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
765 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
767 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
769 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
772 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
775 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
777 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
779 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
781 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
783 /* ....................................................................... */
786 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
788 WMColor
* WMGrayColor(WMScreen
*scr
);
790 WMColor
* WMBlackColor(WMScreen
*scr
);
792 WMColor
* WMWhiteColor(WMScreen
*scr
);
794 void WMSetColorInGC(WMColor
*color
, GC gc
);
796 GC
WMColorGC(WMColor
*color
);
798 WMPixel
WMColorPixel(WMColor
*color
);
800 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
801 unsigned int width
, unsigned int height
);
803 void WMReleaseColor(WMColor
*color
);
805 WMColor
* WMRetainColor(WMColor
*color
);
807 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
808 unsigned short green
, unsigned short blue
,
811 WMColor
* WMCreateRGBAColor(WMScreen
*scr
, unsigned short red
,
812 unsigned short green
, unsigned short blue
,
813 unsigned short alpha
, Bool exact
);
815 WMColor
* WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
817 void WMSetColorAlpha(WMColor
*color
, unsigned short alpha
);
819 unsigned short WMRedComponentOfColor(WMColor
*color
);
821 unsigned short WMGreenComponentOfColor(WMColor
*color
);
823 unsigned short WMBlueComponentOfColor(WMColor
*color
);
825 unsigned short WMGetColorAlpha(WMColor
*color
);
827 char* WMGetColorRGBDescription(WMColor
*color
);
829 /* ....................................................................... */
832 void WMDrawString(WMScreen
*scr
, Drawable d
, WMColor
*color
, WMFont
*font
,
833 int x
, int y
, char *text
, int length
);
835 void WMDrawImageString(WMScreen
*scr
, Drawable d
, WMColor
*color
,
836 WMColor
*background
, WMFont
*font
, int x
, int y
,
837 char *text
, int length
);
839 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
843 /* ....................................................................... */
845 WMScreen
* WMWidgetScreen(WMWidget
*w
);
847 unsigned int WMScreenWidth(WMScreen
*scr
);
849 unsigned int WMScreenHeight(WMScreen
*scr
);
851 void WMUnmapWidget(WMWidget
*w
);
853 void WMMapWidget(WMWidget
*w
);
855 Bool
WMWidgetIsMapped(WMWidget
*w
);
857 void WMRaiseWidget(WMWidget
*w
);
859 void WMLowerWidget(WMWidget
*w
);
861 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
863 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
865 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
867 void WMMapSubwidgets(WMWidget
*w
);
869 void WMUnmapSubwidgets(WMWidget
*w
);
871 void WMRealizeWidget(WMWidget
*w
);
873 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
875 void WMDestroyWidget(WMWidget
*widget
);
877 void WMHangData(WMWidget
*widget
, void *data
);
879 void* WMGetHangedData(WMWidget
*widget
);
881 unsigned int WMWidgetWidth(WMWidget
*w
);
883 unsigned int WMWidgetHeight(WMWidget
*w
);
885 Window
WMWidgetXID(WMWidget
*w
);
887 Window
WMViewXID(WMView
*view
);
889 void WMRedisplayWidget(WMWidget
*w
);
891 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
893 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
894 int rightOffs
, int bottomOffs
);
896 WMSize
WMGetViewSize(WMView
*view
);
898 WMPoint
WMGetViewPosition(WMView
*view
);
900 WMPoint
WMGetViewScreenPosition(WMView
*view
);
902 WMWidget
* WMWidgetOfView(WMView
*view
);
904 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
906 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
909 extern char *WMViewSizeDidChangeNotification
;
911 extern char *WMViewFocusDidChangeNotification
;
913 extern char *WMViewRealizedNotification
;
916 /* ....................................................................... */
918 void WMSetBalloonTextForView(char *text
, WMView
*view
);
920 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
922 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
924 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
926 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
928 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
931 /* ....................................................................... */
933 WMWindow
* WMCreateWindow(WMScreen
*screen
, char *name
);
935 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
937 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
940 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
942 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
944 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
946 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
948 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
950 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
952 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
954 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
956 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
959 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
961 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
963 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
965 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
967 void WMSetWindowLevel(WMWindow
*win
, int level
);
969 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
971 void WMCloseWindow(WMWindow
*win
);
973 /* ....................................................................... */
975 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
977 #define WMCreateCommandButton(parent) \
978 WMCreateCustomButton((parent), WBBSpringLoadedMask\
983 #define WMCreateRadioButton(parent) \
984 WMCreateButton((parent), WBTRadio)
986 #define WMCreateSwitchButton(parent) \
987 WMCreateButton((parent), WBTSwitch)
989 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
991 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
993 void WMSetButtonImageDefault(WMButton
*bPtr
);
995 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
997 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
999 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
1001 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
1003 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
1005 void WMSetButtonText(WMButton
*bPtr
, char *text
);
1007 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
1009 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
1011 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1013 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1015 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1017 int WMGetButtonSelected(WMButton
*bPtr
);
1019 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1021 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1023 int WMGetButtonEnabled(WMButton
*bPtr
);
1025 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1027 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1029 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1031 void WMPerformButtonClick(WMButton
*bPtr
);
1033 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1035 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1037 /* ....................................................................... */
1039 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1041 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1043 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1045 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1047 char* WMGetLabelText(WMLabel
*lPtr
);
1049 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1051 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1053 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1055 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1057 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1059 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1061 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1063 /* ....................................................................... */
1065 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1067 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1069 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1071 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1073 /* ....................................................................... */
1075 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1077 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1079 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1081 /* you can free the returned string */
1082 char* WMGetTextFieldText(WMTextField
*tPtr
);
1084 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1086 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1088 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1090 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1092 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1094 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1096 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1098 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1100 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1102 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1104 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1106 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1108 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1110 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1112 WMTextFieldDelegate
* WMGetTextFieldDelegate(WMTextField
*tPtr
);
1114 extern char *WMTextDidChangeNotification
;
1115 extern char *WMTextDidBeginEditingNotification
;
1116 extern char *WMTextDidEndEditingNotification
;
1118 /* ....................................................................... */
1120 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1122 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1123 float knobProportion
);
1125 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1127 float WMGetScrollerValue(WMScroller
*sPtr
);
1129 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1131 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1133 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1134 WMScrollArrowPosition position
);
1136 extern char *WMScrollerDidScrollNotification
;
1138 /* ....................................................................... */
1140 WMList
* WMCreateList(WMWidget
*parent
);
1142 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1144 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1146 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1148 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1150 void WMSortListItems(WMList
*lPtr
);
1152 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1154 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1156 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1158 WMArray
* WMGetListItems(WMList
*lPtr
);
1160 void WMRemoveListItem(WMList
*lPtr
, int row
);
1162 void WMSelectListItem(WMList
*lPtr
, int row
);
1164 void WMUnselectListItem(WMList
*lPtr
, int row
);
1166 /* This will select all items in range, and deselect all the others */
1167 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1169 /* This will select all items in range, leaving the others as they are */
1170 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1172 void WMSelectAllListItems(WMList
*lPtr
);
1174 void WMUnselectAllListItems(WMList
*lPtr
);
1176 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1178 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1180 int WMGetListItemHeight(WMList
*lPtr
);
1182 /* don't free the returned data */
1183 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1186 * For the following 2 functions, in case WMList allows multiple selection,
1187 * the first item in the list of selected items, respective its row number,
1191 /* don't free the returned data */
1192 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1194 int WMGetListSelectedItemRow(WMList
*lPtr
);
1196 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1198 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1200 void WMClearList(WMList
*lPtr
);
1202 int WMGetListNumberOfRows(WMList
*lPtr
);
1204 void WMSetListPosition(WMList
*lPtr
, int row
);
1206 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1208 int WMGetListPosition(WMList
*lPtr
);
1210 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1212 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1215 extern char *WMListDidScrollNotification
;
1216 extern char *WMListSelectionDidChangeNotification
;
1218 /* ....................................................................... */
1220 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1222 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1224 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1226 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1228 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1230 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1232 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1234 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1236 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1238 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1240 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1242 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1244 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1245 WMCompareDataProc
*func
);
1247 /* Don't free the returned string. */
1248 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1250 /* free the returned string */
1251 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1253 /* free the returned string */
1254 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1256 /* free the returned array */
1257 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1259 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1261 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1264 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1266 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1268 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1270 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1272 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1274 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1276 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1278 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1280 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1282 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1284 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1286 /* ....................................................................... */
1289 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1291 WMMenuItem
* WMCreateMenuItem(void);
1293 void WMDestroyMenuItem(WMMenuItem
*item
);
1295 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1297 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1299 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1301 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1303 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1305 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1307 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1309 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1311 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1313 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1315 void* WMGetMenuItemData(WMMenuItem
*item
);
1317 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1319 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1321 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1323 int WMGetMenuItemState(WMMenuItem
*item
);
1325 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1327 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1329 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1331 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1333 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1335 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1337 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1339 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1341 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1344 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1346 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1349 /* ....................................................................... */
1351 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1353 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1356 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1358 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1360 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1363 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1365 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1367 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1369 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1371 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1373 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1375 /* don't free the returned data */
1376 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1378 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1381 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1383 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1385 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1387 /* ....................................................................... */
1389 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1391 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1393 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1395 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1397 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1399 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1401 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1404 /* ....................................................................... */
1406 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1408 void WMFreeColorPanel(WMColorPanel
*panel
);
1410 void WMShowColorPanel(WMColorPanel
*panel
);
1412 void WMCloseColorPanel(WMColorPanel
*panel
);
1414 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1416 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1418 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1420 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1422 extern char *WMColorPanelColorChangedNotification
;
1424 /* ....................................................................... */
1426 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1428 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1430 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1432 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1435 extern char *WMColorWellDidChangeNotification
;
1438 /* ...................................................................... */
1440 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1442 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1443 unsigned int height
);
1445 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1447 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1449 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1451 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1453 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1455 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1457 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1459 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1461 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1463 /* ....................................................................... */
1465 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1467 int WMGetSliderMinValue(WMSlider
*slider
);
1469 int WMGetSliderMaxValue(WMSlider
*slider
);
1471 int WMGetSliderValue(WMSlider
*slider
);
1473 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1475 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1477 void WMSetSliderValue(WMSlider
*slider
, int value
);
1479 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1481 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1483 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1485 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1487 /* ....................................................................... */
1490 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1492 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1494 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1496 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1498 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1500 /* remove the first subview == view */
1501 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1503 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1506 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1508 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1510 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1511 WMSplitViewConstrainProc
*proc
);
1514 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1515 WMSplitViewResizeSubviewsProc *proc);
1518 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1520 /* ...................................................................... */
1522 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1524 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1526 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1528 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1530 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1532 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1534 int WMGetRulerOffset(WMRuler
*rPtr
);
1536 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1538 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1540 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1542 /* ....................................................................... */
1545 #define WMCreateText(parent) WMCreateTextForDocumentType \
1546 ((parent), (NULL), (NULL))
1548 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1551 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1553 void WMFreezeText(WMText
*tPtr
);
1555 #define WMRefreshText(tPtr) WMThawText((tPtr))
1557 void WMThawText(WMText
*tPtr
);
1559 int WMScrollText(WMText
*tPtr
, int amount
);
1561 int WMPageText(WMText
*tPtr
, Bool direction
);
1563 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1565 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1567 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1569 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1571 int WMGetTextRulerShown(WMText
*tPtr
);
1573 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1575 int WMGetTextEditable(WMText
*tPtr
);
1577 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1579 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1581 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1583 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1585 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1587 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1589 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1591 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1593 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1595 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1597 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1599 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1601 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1603 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1605 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1607 #define WMClearText(tPtr) WMAppendTextStream \
1611 char* WMGetTextStream(WMText
*tPtr
);
1614 char* WMGetTextSelectedStream(WMText
*tPtr
);
1616 /* destroy the array */
1617 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1619 /* destroy the array */
1620 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1622 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1624 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1626 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1628 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1630 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1632 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1634 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1636 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1637 Bool caseSensitive
);
1639 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1642 /* parser related stuff... use only if implementing a new parser */
1644 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1645 WMColor
*color
, unsigned short first
,
1646 unsigned short extraInfo
);
1648 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1649 WMColor
*color
, unsigned short first
,
1650 unsigned short extraInfo
);
1652 void* WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1653 WMColor
*color
, unsigned short first
,
1654 unsigned short length
);
1656 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1657 unsigned int kanji
, unsigned int underlined
,
1658 int script
, WMRulerMargins
*margins
);
1660 /* do NOT free the margins */
1661 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1662 unsigned int *kanji
, unsigned int *underlined
,
1663 int *script
, WMRulerMargins
*margins
);
1665 int WMGetTextInsertType(WMText
*tPtr
);
1667 /*int WMGetTextBlocks(WMText *tPtr);
1669 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1671 int WMGetCurrentTextBlock(WMText *tPtr);*/
1673 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1675 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1677 void* WMRemoveTextBlock(WMText
*tPtr
);
1679 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1681 /* ....................................................................... */
1684 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1686 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1688 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1690 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1692 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1694 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1696 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1698 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1699 int identifier
, char *label
);
1701 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1703 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1705 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1707 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1709 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1711 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1713 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1715 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1717 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1720 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1722 void WMSetTabViewItemEnabled(WMTabViewItem
*tPtr
, Bool flag
);
1724 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1726 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1728 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1730 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1732 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1734 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1737 /* ....................................................................... */
1739 WMBox
* WMCreateBox(WMWidget
*parent
);
1741 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1743 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1744 int minSize
, int maxSize
, int space
);
1746 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1747 int minSize
, int maxSize
, int space
);
1749 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1751 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1753 /* ....................................................................... */
1755 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1756 char *defaultButton
, char *alternateButton
,
1759 /* you can free the returned string */
1760 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1761 char *defaultText
, char *okButton
, char *cancelButton
);
1763 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1764 char *msg
, char *defaultButton
,
1765 char *alternateButton
, char *otherButton
);
1767 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1768 char *msg
, char *defaultText
, char *okButton
,
1769 char *cancelButton
);
1772 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1773 char *title
, char *defaultButton
,
1774 char *alternateButton
);
1776 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1778 void WMDestroyInputPanel(WMInputPanel
*panel
);
1780 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1782 /* ....................................................................... */
1784 /* only 1 instance per WMScreen */
1785 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1787 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1789 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1791 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1793 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1795 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1797 /* you can free the returned string */
1798 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1800 void WMFreeFilePanel(WMFilePanel
*panel
);
1802 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1803 char *path
, char *name
, char **fileTypes
);
1805 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1807 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1810 /* ...................................................................... */
1812 /* only 1 instance per WMScreen */
1813 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1815 void WMShowFontPanel(WMFontPanel
*panel
);
1817 void WMHideFontPanel(WMFontPanel
*panel
);
1819 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1821 /* you can free the returned string */
1822 char* WMGetFontPanelFontName(WMFontPanel
*panel
);
1824 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1828 #endif /* __cplusplus */