7 #include <WINGs/WUtil.h>
10 #define WINGS_H_VERSION 20021124
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)
113 WFNormalFont
= (1<<0),
115 WFAntialiased
= (1<<2),
116 WFNotAntialiased
= (1<<3)
120 /* Use default system font size in system font name */
126 /* frame title positions */
150 /* alignment types */
155 WAJustified
/* not valid for textfields */
171 /* scroller arrow position */
176 } WMScrollArrowPosition
;
191 /* usable scroller parts */
196 } WMUsableScrollerParts
;
208 WTTopTabsBevelBorder
,
215 /* text movement types */
217 WMIllegalTextMovement
,
218 WMReturnTextMovement
,
219 WMEscapeTextMovement
,
221 WMBacktabTextMovement
,
228 /* text field special events */
236 WLNotFound
= -1 /* element was not found in WMList */
240 /* drag operations */
248 } WMDragOperationType
;
252 WMGrayModeColorPanel
= 1,
253 WMRGBModeColorPanel
= 2,
254 WMCMYKModeColorPanel
= 3,
255 WMHSBModeColorPanel
= 4,
256 WMCustomPaletteModeColorPanel
= 5,
257 WMColorListModeColorPanel
= 6,
258 WMWheelModeColorPanel
= 7
264 #define WSIReturnArrow 1
265 #define WSIHighlightedReturnArrow 2
266 #define WSIScrollerDimple 3
267 #define WSIArrowLeft 4
268 #define WSIHighlightedArrowLeft 5
269 #define WSIArrowRight 6
270 #define WSIHighlightedArrowRight 7
272 #define WSIHighlightedArrowUp 9
273 #define WSIArrowDown 10
274 #define WSIHighlightedArrowDown 11
275 #define WSICheckMark 12
278 WLDSSelected
= (1 << 16),
279 WLDSDisabled
= (1 << 17),
280 WLDSFocused
= (1 << 18),
281 WLDSIsBranch
= (1 << 19)
284 /* alert panel return values */
294 /* types of input observers */
296 WIReadMask
= (1 << 0),
297 WIWriteMask
= (1 << 1),
298 WIExceptMask
= (1 << 2)
318 WC_Matrix
= 12, /* not ready */
321 WC_ProgressIndicator
= 15,
328 /* All widgets must start with the following structure
329 * in that order. Used for typecasting to get some generic data */
330 typedef struct W_WidgetType
{
337 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
338 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
343 typedef void WMWidget
;
345 typedef struct W_Pixmap WMPixmap
;
346 typedef struct W_Font WMFont
;
347 typedef struct W_Color WMColor
;
349 typedef struct W_Screen WMScreen
;
351 typedef struct W_View WMView
;
353 typedef struct W_Window WMWindow
;
354 typedef struct W_Frame WMFrame
;
355 typedef struct W_Button WMButton
;
356 typedef struct W_Label WMLabel
;
357 typedef struct W_TextField WMTextField
;
358 typedef struct W_Scroller WMScroller
;
359 typedef struct W_ScrollView WMScrollView
;
360 typedef struct W_List WMList
;
361 typedef struct W_Browser WMBrowser
;
362 typedef struct W_PopUpButton WMPopUpButton
;
363 typedef struct W_ProgressIndicator WMProgressIndicator
;
364 typedef struct W_ColorWell WMColorWell
;
365 typedef struct W_Slider WMSlider
;
366 typedef struct W_Matrix WMMatrix
; /* not ready */
367 typedef struct W_SplitView WMSplitView
;
368 typedef struct W_TabView WMTabView
;
369 typedef struct W_Ruler WMRuler
;
370 typedef struct W_Text WMText
;
371 typedef struct W_Box WMBox
;
375 typedef struct W_TabViewItem WMTabViewItem
;
376 typedef struct W_MenuItem WMMenuItem
;
379 typedef struct W_FilePanel WMFilePanel
;
380 typedef WMFilePanel WMOpenPanel
;
381 typedef WMFilePanel WMSavePanel
;
383 typedef struct W_FontPanel WMFontPanel
;
385 typedef struct W_ColorPanel WMColorPanel
;
388 /* item for WMList */
389 typedef struct WMListItem
{
391 void *clientData
; /* ptr for user clientdata. */
393 unsigned int uflags
:16; /* flags for the user */
394 unsigned int selected
:1;
395 unsigned int disabled
:1;
396 unsigned int isBranch
:1;
397 unsigned int loaded
:1;
400 /* struct for message panel */
401 typedef struct WMAlertPanel
{
402 WMWindow
*win
; /* window */
405 WMButton
*defBtn
; /* default button */
406 WMButton
*altBtn
; /* alternative button */
407 WMButton
*othBtn
; /* other button */
408 WMLabel
*iLbl
; /* icon label */
409 WMLabel
*tLbl
; /* title label */
410 WMLabel
*mLbl
; /* message label */
411 WMFrame
*line
; /* separator */
412 short result
; /* button that was pushed */
416 typedef struct WMGenericPanel
{
435 typedef struct WMInputPanel
{
436 WMWindow
*win
; /* window */
437 WMButton
*defBtn
; /* default button */
438 WMButton
*altBtn
; /* alternative button */
439 WMLabel
*tLbl
; /* title label */
440 WMLabel
*mLbl
; /* message label */
441 WMTextField
*text
; /* text field */
442 short result
; /* button that was pushed */
447 #define WFAUnchanged (NULL)
448 /* Struct for font change operations */
449 typedef struct WMFontAttributes
{
466 /* A few useful constant font attributes masks */
467 extern const WMFontAttributes
*WFANormal
;
468 extern const WMFontAttributes
*WFABold
;
469 extern const WMFontAttributes
*WFANotBold
;
470 extern const WMFontAttributes
*WFAEmphasized
;
471 extern const WMFontAttributes
*WFANotEmphasized
;
472 extern const WMFontAttributes
*WFABoldEmphasized
;
477 WMArray
*tabs
; /* a growable array of tabstops */
478 unsigned short left
; /* left margin marker */
479 unsigned short right
; /* right margin marker */
480 unsigned short first
; /* indentation marker for first line only */
481 unsigned short body
; /* body indentation marker */
482 unsigned short retainCount
;
484 /* All indentation and tab markers are _relative_ to the left margin marker */
487 typedef void WMEventProc(XEvent
*event
, void *clientData
);
489 typedef void WMEventHook(XEvent
*event
);
491 /* self is set to the widget from where the callback is being called and
492 * clientData to the data set to with WMSetClientData() */
493 typedef void WMAction(WMWidget
*self
, void *clientData
);
495 /* same as WMAction, but for stuff that arent widgets */
496 typedef void WMAction2(void *self
, void *clientData
);
499 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
501 /* delegate method like stuff */
502 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
503 int state
, WMRect
*rect
);
506 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
507 unsigned int oldWidth,
508 unsigned int oldHeight);
511 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
512 int *minSize
, int *maxSize
);
514 typedef WMWidget
* WMMatrixCreateCellProc(WMMatrix
*mPtr
);
519 typedef struct WMBrowserDelegate
{
522 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
523 WMBrowser
*sender
, int column
, WMList
*list
);
525 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
528 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
530 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
534 typedef struct WMTextFieldDelegate
{
537 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
538 WMNotification
*notif
);
540 void (*didChange
)(struct WMTextFieldDelegate
*self
,
541 WMNotification
*notif
);
543 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
544 WMNotification
*notif
);
546 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
549 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
551 } WMTextFieldDelegate
;
554 typedef struct WMTextDelegate
{
557 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
564 typedef struct WMTabViewDelegate
{
567 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
570 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
571 WMTabViewItem
*item
);
573 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
574 WMTabViewItem
*item
);
576 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
577 WMTabViewItem
*item
);
583 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
584 Time timestamp
, void *cdata
, WMData
*data
);
587 typedef struct WMSelectionProcs
{
588 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
589 void *cdata
, Atom
*type
);
590 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
591 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
596 typedef struct W_DraggingInfo WMDraggingInfo
;
599 typedef struct W_DragSourceProcs
{
600 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
601 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
602 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
604 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
605 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
610 typedef struct W_DragDestinationProcs
{
611 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
612 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
613 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
614 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
615 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
616 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
617 } WMDragDestinationProcs
;
621 /* ...................................................................... */
624 WMPoint
wmkpoint(int x
, int y
);
626 WMSize
wmksize(unsigned int width
, unsigned int height
);
628 WMRect
wmkrect(int x
, int y
, unsigned int width
, unsigned int height
);
630 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
631 #define wmksize(width, height) (WMSize){(width), (height)}
632 #define wmkpoint(x, y) (WMPoint){(x), (y)}
635 /* ....................................................................... */
639 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
641 void WMSetResourcePath(char *path
);
643 /* don't free the returned string */
644 char* WMGetApplicationName();
646 /* Try to locate resource file. ext may be NULL */
647 char* WMPathForResourceOfType(char *resource
, char *ext
);
650 WMScreen
* WMOpenScreen(const char *display
);
652 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
655 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
657 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
659 void WMScreenMainLoop(WMScreen
*scr
);
661 void WMBreakModalLoop(WMScreen
*scr
);
663 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
665 RContext
* WMScreenRContext(WMScreen
*scr
);
667 Display
* WMScreenDisplay(WMScreen
*scr
);
669 int WMScreenDepth(WMScreen
*scr
);
673 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
675 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
677 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
679 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
681 /* If color==NULL it will use the default color for panels: ae/aa/ae */
682 WMPixmap
* WMCreateApplicationIconBlendedPixmap(WMScreen
*scr
, RColor
*color
);
684 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
686 void WMSetFocusToWidget(WMWidget
*widget
);
688 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
690 int WMHandleEvent(XEvent
*event
);
692 Bool
WMScreenPending(WMScreen
*scr
);
694 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
695 WMEventProc
*eventProc
, void *clientData
);
697 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
698 WMEventProc
*eventProc
, void *clientData
);
700 int WMIsDoubleClick(XEvent
*event
);
702 /*int WMIsTripleClick(XEvent *event);*/
704 void WMNextEvent(Display
*dpy
, XEvent
*event
);
706 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
709 /* ....................................................................... */
712 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
713 WMSelectionProcs
*procs
, void *cdata
);
715 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
717 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
718 Time timestamp
, WMSelectionCallback
*callback
,
722 extern char *WMSelectionOwnerDidChangeNotification
;
724 /* ....................................................................... */
726 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
728 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
729 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
732 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
734 void WMUnregisterViewDraggedTypes(WMView
*view
);
736 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
739 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
741 /* ....................................................................... */
743 Bool
WMHasAntialiasingSupport(WMScreen
*scrPtr
);
745 Bool
WMIsAntialiasingEnabled(WMScreen
*scrPtr
);
747 /* ....................................................................... */
749 WMFont
* WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
751 WMFont
* WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
753 WMFont
* WMCreateAntialiasedFont(WMScreen
*scrPtr
, char *fontName
);
755 WMFont
* WMCreateAntialiasedFontSet(WMScreen
*scrPtr
, char *fontName
);
757 WMFont
* WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
759 WMFont
* WMCreateFontWithFlags(WMScreen
*scrPtr
, char *fontName
,
762 WMFont
* WMCopyFontWithChanges(WMScreen
*scrPtr
, WMFont
*font
,
763 const WMFontAttributes
*changes
);
765 WMFont
* WMRetainFont(WMFont
*font
);
767 void WMReleaseFont(WMFont
*font
);
769 char* WMGetFontName(WMFont
*font
);
771 unsigned int WMFontHeight(WMFont
*font
);
773 Bool
WMIsAntialiasedFont(WMFont
*font
);
776 WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
778 WMFont* WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
782 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
784 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
786 WMFont
* WMDefaultSystemFont(WMScreen
*scrPtr
);
788 WMFont
* WMDefaultBoldSystemFont(WMScreen
*scrPtr
);
790 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
792 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
794 XFontSet
WMGetFontFontSet(WMFont
*font
);
796 /* ....................................................................... */
798 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
800 void WMReleasePixmap(WMPixmap
*pixmap
);
802 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
805 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
806 Pixmap mask
, int width
, int height
,
809 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
812 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
814 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
816 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
818 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
821 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
824 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
826 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
828 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
830 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
832 /* ....................................................................... */
835 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
837 WMColor
* WMGrayColor(WMScreen
*scr
);
839 WMColor
* WMBlackColor(WMScreen
*scr
);
841 WMColor
* WMWhiteColor(WMScreen
*scr
);
843 void WMSetColorInGC(WMColor
*color
, GC gc
);
845 GC
WMColorGC(WMColor
*color
);
847 WMPixel
WMColorPixel(WMColor
*color
);
849 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
850 unsigned int width
, unsigned int height
);
852 void WMReleaseColor(WMColor
*color
);
854 WMColor
* WMRetainColor(WMColor
*color
);
856 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
857 unsigned short green
, unsigned short blue
,
860 WMColor
* WMCreateRGBAColor(WMScreen
*scr
, unsigned short red
,
861 unsigned short green
, unsigned short blue
,
862 unsigned short alpha
, Bool exact
);
864 WMColor
* WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
866 void WMSetColorAlpha(WMColor
*color
, unsigned short alpha
);
868 unsigned short WMRedComponentOfColor(WMColor
*color
);
870 unsigned short WMGreenComponentOfColor(WMColor
*color
);
872 unsigned short WMBlueComponentOfColor(WMColor
*color
);
874 unsigned short WMGetColorAlpha(WMColor
*color
);
876 char* WMGetColorRGBDescription(WMColor
*color
);
878 /* ....................................................................... */
881 void WMDrawString(WMScreen
*scr
, Drawable d
, WMColor
*color
, WMFont
*font
,
882 int x
, int y
, char *text
, int length
);
884 void WMDrawImageString(WMScreen
*scr
, Drawable d
, WMColor
*color
,
885 WMColor
*background
, WMFont
*font
, int x
, int y
,
886 char *text
, int length
);
888 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
892 /* ....................................................................... */
894 WMScreen
* WMWidgetScreen(WMWidget
*w
);
896 unsigned int WMScreenWidth(WMScreen
*scr
);
898 unsigned int WMScreenHeight(WMScreen
*scr
);
900 void WMUnmapWidget(WMWidget
*w
);
902 void WMMapWidget(WMWidget
*w
);
904 Bool
WMWidgetIsMapped(WMWidget
*w
);
906 void WMRaiseWidget(WMWidget
*w
);
908 void WMLowerWidget(WMWidget
*w
);
910 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
912 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
914 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
916 WMColor
* WMGetWidgetBackgroundColor(WMWidget
*w
);
918 void WMMapSubwidgets(WMWidget
*w
);
920 void WMUnmapSubwidgets(WMWidget
*w
);
922 void WMRealizeWidget(WMWidget
*w
);
924 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
926 void WMDestroyWidget(WMWidget
*widget
);
928 void WMHangData(WMWidget
*widget
, void *data
);
930 void* WMGetHangedData(WMWidget
*widget
);
932 unsigned int WMWidgetWidth(WMWidget
*w
);
934 unsigned int WMWidgetHeight(WMWidget
*w
);
936 Window
WMWidgetXID(WMWidget
*w
);
938 Window
WMViewXID(WMView
*view
);
940 void WMRedisplayWidget(WMWidget
*w
);
942 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
944 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
945 int rightOffs
, int bottomOffs
);
947 WMSize
WMGetViewSize(WMView
*view
);
949 WMPoint
WMGetViewPosition(WMView
*view
);
951 WMPoint
WMGetViewScreenPosition(WMView
*view
);
953 WMWidget
* WMWidgetOfView(WMView
*view
);
955 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
957 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
960 extern char *WMViewSizeDidChangeNotification
;
962 extern char *WMViewFocusDidChangeNotification
;
964 extern char *WMViewRealizedNotification
;
967 /* ....................................................................... */
969 void WMSetBalloonTextForView(char *text
, WMView
*view
);
971 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
973 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
975 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
977 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
979 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
982 /* ....................................................................... */
984 WMWindow
* WMCreateWindow(WMScreen
*screen
, char *name
);
986 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
988 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
991 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
993 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
995 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
997 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
999 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
1001 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
1003 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
1005 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
1007 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
1008 int maxX
, int maxY
);
1010 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
1012 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
1014 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
1016 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
1018 void WMSetWindowLevel(WMWindow
*win
, int level
);
1020 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
1022 void WMCloseWindow(WMWindow
*win
);
1024 /* ....................................................................... */
1026 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
1028 #define WMCreateCommandButton(parent) \
1029 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1034 #define WMCreateRadioButton(parent) \
1035 WMCreateButton((parent), WBTRadio)
1037 #define WMCreateSwitchButton(parent) \
1038 WMCreateButton((parent), WBTSwitch)
1040 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
1042 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
1044 void WMSetButtonImageDefault(WMButton
*bPtr
);
1046 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
1048 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
1050 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
1052 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
1054 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
1056 void WMSetButtonText(WMButton
*bPtr
, char *text
);
1058 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
1060 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
1062 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1064 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1066 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1068 int WMGetButtonSelected(WMButton
*bPtr
);
1070 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1072 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1074 int WMGetButtonEnabled(WMButton
*bPtr
);
1076 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1078 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1080 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1082 void WMPerformButtonClick(WMButton
*bPtr
);
1084 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1086 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1088 /* ....................................................................... */
1090 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1092 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1094 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1096 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1098 char* WMGetLabelText(WMLabel
*lPtr
);
1100 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1102 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1104 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1106 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1108 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1110 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1112 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1114 /* ....................................................................... */
1116 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1118 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1120 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1122 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1124 /* ....................................................................... */
1126 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1128 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1130 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1132 /* you can free the returned string */
1133 char* WMGetTextFieldText(WMTextField
*tPtr
);
1135 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1137 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1139 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1141 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1143 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1145 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1147 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1149 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1151 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1153 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1155 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1157 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1159 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1161 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1163 WMTextFieldDelegate
* WMGetTextFieldDelegate(WMTextField
*tPtr
);
1165 extern char *WMTextDidChangeNotification
;
1166 extern char *WMTextDidBeginEditingNotification
;
1167 extern char *WMTextDidEndEditingNotification
;
1169 /* ....................................................................... */
1171 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1173 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1174 float knobProportion
);
1176 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1178 float WMGetScrollerValue(WMScroller
*sPtr
);
1180 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1182 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1184 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1185 WMScrollArrowPosition position
);
1187 extern char *WMScrollerDidScrollNotification
;
1189 /* ....................................................................... */
1191 WMList
* WMCreateList(WMWidget
*parent
);
1193 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1195 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1197 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1199 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1201 void WMSortListItems(WMList
*lPtr
);
1203 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1205 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1207 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1209 WMArray
* WMGetListItems(WMList
*lPtr
);
1211 void WMRemoveListItem(WMList
*lPtr
, int row
);
1213 void WMSelectListItem(WMList
*lPtr
, int row
);
1215 void WMUnselectListItem(WMList
*lPtr
, int row
);
1217 /* This will select all items in range, and deselect all the others */
1218 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1220 /* This will select all items in range, leaving the others as they are */
1221 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1223 void WMSelectAllListItems(WMList
*lPtr
);
1225 void WMUnselectAllListItems(WMList
*lPtr
);
1227 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1229 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1231 int WMGetListItemHeight(WMList
*lPtr
);
1233 /* don't free the returned data */
1234 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1237 * For the following 2 functions, in case WMList allows multiple selection,
1238 * the first item in the list of selected items, respective its row number,
1242 /* don't free the returned data */
1243 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1245 int WMGetListSelectedItemRow(WMList
*lPtr
);
1247 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1249 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1251 void WMClearList(WMList
*lPtr
);
1253 int WMGetListNumberOfRows(WMList
*lPtr
);
1255 void WMSetListPosition(WMList
*lPtr
, int row
);
1257 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1259 int WMGetListPosition(WMList
*lPtr
);
1261 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1263 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1266 extern char *WMListDidScrollNotification
;
1267 extern char *WMListSelectionDidChangeNotification
;
1269 /* ....................................................................... */
1271 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1273 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1275 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1277 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1279 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1281 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1283 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1285 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1287 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1289 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1291 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1293 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1295 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1296 WMCompareDataProc
*func
);
1298 /* Don't free the returned string. */
1299 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1301 /* free the returned string */
1302 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1304 /* free the returned string */
1305 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1307 /* free the returned array */
1308 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1310 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1312 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1315 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1317 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1319 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1321 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1323 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1325 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1327 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1329 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1331 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1333 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1335 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1337 /* ....................................................................... */
1340 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1342 WMMenuItem
* WMCreateMenuItem(void);
1344 void WMDestroyMenuItem(WMMenuItem
*item
);
1346 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1348 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1350 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1352 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1354 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1356 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1358 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1360 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1362 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1364 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1366 void* WMGetMenuItemData(WMMenuItem
*item
);
1368 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1370 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1372 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1374 int WMGetMenuItemState(WMMenuItem
*item
);
1376 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1378 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1380 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1382 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1384 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1386 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1388 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1390 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1392 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1395 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1397 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1400 /* ....................................................................... */
1402 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1404 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1407 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1409 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1411 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1414 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1416 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1418 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1420 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1422 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1424 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1426 /* don't free the returned data */
1427 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1429 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1432 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1434 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1436 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1438 /* ....................................................................... */
1440 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1442 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1444 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1446 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1448 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1450 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1452 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1455 /* ....................................................................... */
1457 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1459 void WMFreeColorPanel(WMColorPanel
*panel
);
1461 void WMShowColorPanel(WMColorPanel
*panel
);
1463 void WMCloseColorPanel(WMColorPanel
*panel
);
1465 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1467 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1469 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1471 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1473 extern char *WMColorPanelColorChangedNotification
;
1475 /* ....................................................................... */
1477 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1479 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1481 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1483 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1486 extern char *WMColorWellDidChangeNotification
;
1489 /* ...................................................................... */
1491 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1493 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1494 unsigned int height
);
1496 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1498 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1500 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1502 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1504 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1506 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1508 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1510 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1512 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1514 /* ....................................................................... */
1516 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1518 int WMGetSliderMinValue(WMSlider
*slider
);
1520 int WMGetSliderMaxValue(WMSlider
*slider
);
1522 int WMGetSliderValue(WMSlider
*slider
);
1524 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1526 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1528 void WMSetSliderValue(WMSlider
*slider
, int value
);
1530 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1532 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1534 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1536 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1538 /* ....................................................................... */
1541 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1543 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1545 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1547 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1549 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1551 /* remove the first subview == view */
1552 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1554 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1557 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1559 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1561 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1562 WMSplitViewConstrainProc
*proc
);
1565 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1566 WMSplitViewResizeSubviewsProc *proc);
1569 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1571 /* ...................................................................... */
1573 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1575 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1577 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1579 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1581 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1583 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1585 int WMGetRulerOffset(WMRuler
*rPtr
);
1587 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1589 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1591 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1593 /* ....................................................................... */
1596 #define WMCreateText(parent) WMCreateTextForDocumentType \
1597 ((parent), (NULL), (NULL))
1599 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1602 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1604 void WMFreezeText(WMText
*tPtr
);
1606 #define WMRefreshText(tPtr) WMThawText((tPtr))
1608 void WMThawText(WMText
*tPtr
);
1610 int WMScrollText(WMText
*tPtr
, int amount
);
1612 int WMPageText(WMText
*tPtr
, Bool direction
);
1614 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1616 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1618 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1620 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1622 int WMGetTextRulerShown(WMText
*tPtr
);
1624 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1626 int WMGetTextEditable(WMText
*tPtr
);
1628 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1630 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1632 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1634 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1636 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1638 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1640 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1642 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1644 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1646 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1648 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1650 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1652 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1654 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1656 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1658 #define WMClearText(tPtr) WMAppendTextStream \
1662 char* WMGetTextStream(WMText
*tPtr
);
1665 char* WMGetTextSelectedStream(WMText
*tPtr
);
1667 /* destroy the array */
1668 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1670 /* destroy the array */
1671 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1673 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1675 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1677 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1679 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1681 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1683 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1685 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1687 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1688 Bool caseSensitive
);
1690 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1693 /* parser related stuff... use only if implementing a new parser */
1695 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1696 WMColor
*color
, unsigned short first
,
1697 unsigned short extraInfo
);
1699 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1700 WMColor
*color
, unsigned short first
,
1701 unsigned short extraInfo
);
1703 void* WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1704 WMColor
*color
, unsigned short first
,
1705 unsigned short length
);
1707 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1708 unsigned int kanji
, unsigned int underlined
,
1709 int script
, WMRulerMargins
*margins
);
1711 /* do NOT free the margins */
1712 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1713 unsigned int *kanji
, unsigned int *underlined
,
1714 int *script
, WMRulerMargins
*margins
);
1716 int WMGetTextInsertType(WMText
*tPtr
);
1718 /*int WMGetTextBlocks(WMText *tPtr);
1720 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1722 int WMGetCurrentTextBlock(WMText *tPtr);*/
1724 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1726 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1728 void* WMRemoveTextBlock(WMText
*tPtr
);
1730 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1732 /* ....................................................................... */
1735 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1737 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1739 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1741 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1743 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1745 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1747 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1749 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1750 int identifier
, char *label
);
1752 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1754 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1756 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1758 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1760 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1762 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1764 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1766 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1768 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1771 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1773 void WMSetTabViewItemEnabled(WMTabViewItem
*tPtr
, Bool flag
);
1775 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1777 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1779 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1781 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1783 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1785 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1788 /* ....................................................................... */
1790 WMBox
* WMCreateBox(WMWidget
*parent
);
1792 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1794 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1795 int minSize
, int maxSize
, int space
);
1797 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1798 int minSize
, int maxSize
, int space
);
1800 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1802 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1804 /* ....................................................................... */
1806 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1807 char *defaultButton
, char *alternateButton
,
1810 /* you can free the returned string */
1811 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1812 char *defaultText
, char *okButton
, char *cancelButton
);
1814 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1815 char *msg
, char *defaultButton
,
1816 char *alternateButton
, char *otherButton
);
1818 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1819 char *msg
, char *defaultText
, char *okButton
,
1820 char *cancelButton
);
1823 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1824 char *title
, char *defaultButton
,
1825 char *alternateButton
);
1827 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1829 void WMDestroyInputPanel(WMInputPanel
*panel
);
1831 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1833 /* ....................................................................... */
1835 /* only 1 instance per WMScreen */
1836 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1838 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1840 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1842 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1844 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1846 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1848 /* you can free the returned string */
1849 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1851 void WMFreeFilePanel(WMFilePanel
*panel
);
1853 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1854 char *path
, char *name
, char **fileTypes
);
1856 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1858 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1861 /* ...................................................................... */
1863 /* only 1 instance per WMScreen */
1864 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1866 void WMShowFontPanel(WMFontPanel
*panel
);
1868 void WMHideFontPanel(WMFontPanel
*panel
);
1870 void WMSetFontPanelAction(WMFontPanel
*panel
, WMAction2
*action
, void *data
);
1872 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1874 /* you can free the returned string */
1875 char* WMGetFontPanelFontName(WMFontPanel
*panel
);
1877 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1881 #endif /* __cplusplus */