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 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
629 #define wmksize(width, height) (WMSize){(width), (height)}
630 #define wmkpoint(x, y) (WMPoint){(x), (y)}
633 /* ....................................................................... */
637 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
639 void WMSetResourcePath(char *path
);
641 /* don't free the returned string */
642 char* WMGetApplicationName();
644 /* Try to locate resource file. ext may be NULL */
645 char* WMPathForResourceOfType(char *resource
, char *ext
);
648 WMScreen
* WMOpenScreen(const char *display
);
650 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
653 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
655 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
657 void WMScreenMainLoop(WMScreen
*scr
);
659 void WMBreakModalLoop(WMScreen
*scr
);
661 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
663 RContext
* WMScreenRContext(WMScreen
*scr
);
665 Display
* WMScreenDisplay(WMScreen
*scr
);
667 int WMScreenDepth(WMScreen
*scr
);
671 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
673 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
675 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
677 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
679 /* If color==NULL it will use the default color for panels: ae/aa/ae */
680 WMPixmap
* WMCreateApplicationIconBlendedPixmap(WMScreen
*scr
, RColor
*color
);
682 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
684 void WMSetFocusToWidget(WMWidget
*widget
);
686 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
688 int WMHandleEvent(XEvent
*event
);
690 Bool
WMScreenPending(WMScreen
*scr
);
692 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
693 WMEventProc
*eventProc
, void *clientData
);
695 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
696 WMEventProc
*eventProc
, void *clientData
);
698 int WMIsDoubleClick(XEvent
*event
);
700 /*int WMIsTripleClick(XEvent *event);*/
702 void WMNextEvent(Display
*dpy
, XEvent
*event
);
704 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
707 /* ....................................................................... */
710 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
711 WMSelectionProcs
*procs
, void *cdata
);
713 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
715 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
716 Time timestamp
, WMSelectionCallback
*callback
,
720 extern char *WMSelectionOwnerDidChangeNotification
;
722 /* ....................................................................... */
724 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
726 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
727 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
730 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
732 void WMUnregisterViewDraggedTypes(WMView
*view
);
734 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
737 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
739 /* ....................................................................... */
741 Bool
WMHasAntialiasingSupport(WMScreen
*scrPtr
);
743 Bool
WMIsAntialiasingEnabled(WMScreen
*scrPtr
);
745 /* ....................................................................... */
747 WMFont
* WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
749 WMFont
* WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
751 WMFont
* WMCreateAntialiasedFont(WMScreen
*scrPtr
, char *fontName
);
753 WMFont
* WMCreateAntialiasedFontSet(WMScreen
*scrPtr
, char *fontName
);
755 WMFont
* WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
757 WMFont
* WMCreateFontWithFlags(WMScreen
*scrPtr
, char *fontName
,
760 WMFont
* WMCopyFontWithChanges(WMScreen
*scrPtr
, WMFont
*font
,
761 const WMFontAttributes
*changes
);
763 WMFont
* WMRetainFont(WMFont
*font
);
765 void WMReleaseFont(WMFont
*font
);
767 char* WMGetFontName(WMFont
*font
);
769 unsigned int WMFontHeight(WMFont
*font
);
771 Bool
WMIsAntialiasedFont(WMFont
*font
);
774 WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
776 WMFont* WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
780 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
782 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
784 WMFont
* WMDefaultSystemFont(WMScreen
*scrPtr
);
786 WMFont
* WMDefaultBoldSystemFont(WMScreen
*scrPtr
);
788 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
790 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
792 XFontSet
WMGetFontFontSet(WMFont
*font
);
794 /* ....................................................................... */
796 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
798 void WMReleasePixmap(WMPixmap
*pixmap
);
800 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
803 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
804 Pixmap mask
, int width
, int height
,
807 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
810 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
812 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
814 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
816 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
819 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
822 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
824 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
826 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
828 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
830 /* ....................................................................... */
833 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
835 WMColor
* WMGrayColor(WMScreen
*scr
);
837 WMColor
* WMBlackColor(WMScreen
*scr
);
839 WMColor
* WMWhiteColor(WMScreen
*scr
);
841 void WMSetColorInGC(WMColor
*color
, GC gc
);
843 GC
WMColorGC(WMColor
*color
);
845 WMPixel
WMColorPixel(WMColor
*color
);
847 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
848 unsigned int width
, unsigned int height
);
850 void WMReleaseColor(WMColor
*color
);
852 WMColor
* WMRetainColor(WMColor
*color
);
854 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
855 unsigned short green
, unsigned short blue
,
858 WMColor
* WMCreateRGBAColor(WMScreen
*scr
, unsigned short red
,
859 unsigned short green
, unsigned short blue
,
860 unsigned short alpha
, Bool exact
);
862 WMColor
* WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
864 void WMSetColorAlpha(WMColor
*color
, unsigned short alpha
);
866 unsigned short WMRedComponentOfColor(WMColor
*color
);
868 unsigned short WMGreenComponentOfColor(WMColor
*color
);
870 unsigned short WMBlueComponentOfColor(WMColor
*color
);
872 unsigned short WMGetColorAlpha(WMColor
*color
);
874 char* WMGetColorRGBDescription(WMColor
*color
);
876 /* ....................................................................... */
879 void WMDrawString(WMScreen
*scr
, Drawable d
, WMColor
*color
, WMFont
*font
,
880 int x
, int y
, char *text
, int length
);
882 void WMDrawImageString(WMScreen
*scr
, Drawable d
, WMColor
*color
,
883 WMColor
*background
, WMFont
*font
, int x
, int y
,
884 char *text
, int length
);
886 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
890 /* ....................................................................... */
892 WMScreen
* WMWidgetScreen(WMWidget
*w
);
894 unsigned int WMScreenWidth(WMScreen
*scr
);
896 unsigned int WMScreenHeight(WMScreen
*scr
);
898 void WMUnmapWidget(WMWidget
*w
);
900 void WMMapWidget(WMWidget
*w
);
902 Bool
WMWidgetIsMapped(WMWidget
*w
);
904 void WMRaiseWidget(WMWidget
*w
);
906 void WMLowerWidget(WMWidget
*w
);
908 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
910 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
912 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
914 WMColor
* WMGetWidgetBackgroundColor(WMWidget
*w
);
916 void WMMapSubwidgets(WMWidget
*w
);
918 void WMUnmapSubwidgets(WMWidget
*w
);
920 void WMRealizeWidget(WMWidget
*w
);
922 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
924 void WMDestroyWidget(WMWidget
*widget
);
926 void WMHangData(WMWidget
*widget
, void *data
);
928 void* WMGetHangedData(WMWidget
*widget
);
930 unsigned int WMWidgetWidth(WMWidget
*w
);
932 unsigned int WMWidgetHeight(WMWidget
*w
);
934 Window
WMWidgetXID(WMWidget
*w
);
936 Window
WMViewXID(WMView
*view
);
938 void WMRedisplayWidget(WMWidget
*w
);
940 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
942 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
943 int rightOffs
, int bottomOffs
);
945 WMSize
WMGetViewSize(WMView
*view
);
947 WMPoint
WMGetViewPosition(WMView
*view
);
949 WMPoint
WMGetViewScreenPosition(WMView
*view
);
951 WMWidget
* WMWidgetOfView(WMView
*view
);
953 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
955 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
958 extern char *WMViewSizeDidChangeNotification
;
960 extern char *WMViewFocusDidChangeNotification
;
962 extern char *WMViewRealizedNotification
;
965 /* ....................................................................... */
967 void WMSetBalloonTextForView(char *text
, WMView
*view
);
969 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
971 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
973 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
975 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
977 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
980 /* ....................................................................... */
982 WMWindow
* WMCreateWindow(WMScreen
*screen
, char *name
);
984 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
986 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
989 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
991 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
993 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
995 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
997 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
999 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
1001 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
1003 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
1005 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
1006 int maxX
, int maxY
);
1008 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
1010 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
1012 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
1014 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
1016 void WMSetWindowLevel(WMWindow
*win
, int level
);
1018 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
1020 void WMCloseWindow(WMWindow
*win
);
1022 /* ....................................................................... */
1024 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
1026 #define WMCreateCommandButton(parent) \
1027 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1032 #define WMCreateRadioButton(parent) \
1033 WMCreateButton((parent), WBTRadio)
1035 #define WMCreateSwitchButton(parent) \
1036 WMCreateButton((parent), WBTSwitch)
1038 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
1040 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
1042 void WMSetButtonImageDefault(WMButton
*bPtr
);
1044 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
1046 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
1048 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
1050 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
1052 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
1054 void WMSetButtonText(WMButton
*bPtr
, char *text
);
1056 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
1058 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
1060 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1062 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1064 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1066 int WMGetButtonSelected(WMButton
*bPtr
);
1068 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1070 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1072 int WMGetButtonEnabled(WMButton
*bPtr
);
1074 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1076 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1078 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1080 void WMPerformButtonClick(WMButton
*bPtr
);
1082 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1084 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1086 /* ....................................................................... */
1088 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1090 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1092 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1094 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1096 char* WMGetLabelText(WMLabel
*lPtr
);
1098 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1100 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1102 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1104 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1106 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1108 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1110 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1112 /* ....................................................................... */
1114 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1116 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1118 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1120 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1122 /* ....................................................................... */
1124 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1126 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1128 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1130 /* you can free the returned string */
1131 char* WMGetTextFieldText(WMTextField
*tPtr
);
1133 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1135 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1137 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1139 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1141 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1143 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1145 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1147 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1149 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1151 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1153 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1155 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1157 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1159 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1161 WMTextFieldDelegate
* WMGetTextFieldDelegate(WMTextField
*tPtr
);
1163 extern char *WMTextDidChangeNotification
;
1164 extern char *WMTextDidBeginEditingNotification
;
1165 extern char *WMTextDidEndEditingNotification
;
1167 /* ....................................................................... */
1169 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1171 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1172 float knobProportion
);
1174 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1176 float WMGetScrollerValue(WMScroller
*sPtr
);
1178 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1180 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1182 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1183 WMScrollArrowPosition position
);
1185 extern char *WMScrollerDidScrollNotification
;
1187 /* ....................................................................... */
1189 WMList
* WMCreateList(WMWidget
*parent
);
1191 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1193 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1195 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1197 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1199 void WMSortListItems(WMList
*lPtr
);
1201 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1203 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1205 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1207 WMArray
* WMGetListItems(WMList
*lPtr
);
1209 void WMRemoveListItem(WMList
*lPtr
, int row
);
1211 void WMSelectListItem(WMList
*lPtr
, int row
);
1213 void WMUnselectListItem(WMList
*lPtr
, int row
);
1215 /* This will select all items in range, and deselect all the others */
1216 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1218 /* This will select all items in range, leaving the others as they are */
1219 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1221 void WMSelectAllListItems(WMList
*lPtr
);
1223 void WMUnselectAllListItems(WMList
*lPtr
);
1225 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1227 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1229 int WMGetListItemHeight(WMList
*lPtr
);
1231 /* don't free the returned data */
1232 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1235 * For the following 2 functions, in case WMList allows multiple selection,
1236 * the first item in the list of selected items, respective its row number,
1240 /* don't free the returned data */
1241 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1243 int WMGetListSelectedItemRow(WMList
*lPtr
);
1245 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1247 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1249 void WMClearList(WMList
*lPtr
);
1251 int WMGetListNumberOfRows(WMList
*lPtr
);
1253 void WMSetListPosition(WMList
*lPtr
, int row
);
1255 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1257 int WMGetListPosition(WMList
*lPtr
);
1259 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1261 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1264 extern char *WMListDidScrollNotification
;
1265 extern char *WMListSelectionDidChangeNotification
;
1267 /* ....................................................................... */
1269 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1271 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1273 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1275 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1277 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1279 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1281 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1283 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1285 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1287 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1289 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1291 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1293 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1294 WMCompareDataProc
*func
);
1296 /* Don't free the returned string. */
1297 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1299 /* free the returned string */
1300 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1302 /* free the returned string */
1303 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1305 /* free the returned array */
1306 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1308 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1310 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1313 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1315 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1317 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1319 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1321 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1323 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1325 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1327 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1329 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1331 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1333 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1335 /* ....................................................................... */
1338 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1340 WMMenuItem
* WMCreateMenuItem(void);
1342 void WMDestroyMenuItem(WMMenuItem
*item
);
1344 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1346 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1348 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1350 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1352 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1354 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1356 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1358 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1360 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1362 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1364 void* WMGetMenuItemData(WMMenuItem
*item
);
1366 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1368 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1370 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1372 int WMGetMenuItemState(WMMenuItem
*item
);
1374 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1376 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1378 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1380 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1382 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1384 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1386 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1388 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1390 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1393 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1395 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1398 /* ....................................................................... */
1400 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1402 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1405 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1407 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1409 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1412 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1414 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1416 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1418 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1420 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1422 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1424 /* don't free the returned data */
1425 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1427 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1430 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1432 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1434 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1436 /* ....................................................................... */
1438 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1440 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1442 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1444 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1446 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1448 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1450 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1453 /* ....................................................................... */
1455 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1457 void WMFreeColorPanel(WMColorPanel
*panel
);
1459 void WMShowColorPanel(WMColorPanel
*panel
);
1461 void WMCloseColorPanel(WMColorPanel
*panel
);
1463 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1465 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1467 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1469 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1471 extern char *WMColorPanelColorChangedNotification
;
1473 /* ....................................................................... */
1475 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1477 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1479 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1481 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1484 extern char *WMColorWellDidChangeNotification
;
1487 /* ...................................................................... */
1489 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1491 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1492 unsigned int height
);
1494 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1496 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1498 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1500 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1502 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1504 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1506 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1508 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1510 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1512 /* ....................................................................... */
1514 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1516 int WMGetSliderMinValue(WMSlider
*slider
);
1518 int WMGetSliderMaxValue(WMSlider
*slider
);
1520 int WMGetSliderValue(WMSlider
*slider
);
1522 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1524 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1526 void WMSetSliderValue(WMSlider
*slider
, int value
);
1528 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1530 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1532 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1534 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1536 /* ....................................................................... */
1539 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1541 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1543 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1545 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1547 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1549 /* remove the first subview == view */
1550 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1552 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1555 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1557 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1559 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1560 WMSplitViewConstrainProc
*proc
);
1563 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1564 WMSplitViewResizeSubviewsProc *proc);
1567 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1569 /* ...................................................................... */
1571 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1573 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1575 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1577 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1579 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1581 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1583 int WMGetRulerOffset(WMRuler
*rPtr
);
1585 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1587 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1589 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1591 /* ....................................................................... */
1594 #define WMCreateText(parent) WMCreateTextForDocumentType \
1595 ((parent), (NULL), (NULL))
1597 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1600 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1602 void WMFreezeText(WMText
*tPtr
);
1604 #define WMRefreshText(tPtr) WMThawText((tPtr))
1606 void WMThawText(WMText
*tPtr
);
1608 int WMScrollText(WMText
*tPtr
, int amount
);
1610 int WMPageText(WMText
*tPtr
, Bool direction
);
1612 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1614 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1616 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1618 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1620 int WMGetTextRulerShown(WMText
*tPtr
);
1622 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1624 int WMGetTextEditable(WMText
*tPtr
);
1626 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1628 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1630 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1632 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1634 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1636 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1638 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1640 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1642 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1644 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1646 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1648 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1650 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1652 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1654 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1656 #define WMClearText(tPtr) WMAppendTextStream \
1660 char* WMGetTextStream(WMText
*tPtr
);
1663 char* WMGetTextSelectedStream(WMText
*tPtr
);
1665 /* destroy the array */
1666 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1668 /* destroy the array */
1669 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1671 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1673 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1675 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1677 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1679 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1681 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1683 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1685 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1686 Bool caseSensitive
);
1688 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1691 /* parser related stuff... use only if implementing a new parser */
1693 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1694 WMColor
*color
, unsigned short first
,
1695 unsigned short extraInfo
);
1697 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1698 WMColor
*color
, unsigned short first
,
1699 unsigned short extraInfo
);
1701 void* WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1702 WMColor
*color
, unsigned short first
,
1703 unsigned short length
);
1705 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1706 unsigned int kanji
, unsigned int underlined
,
1707 int script
, WMRulerMargins
*margins
);
1709 /* do NOT free the margins */
1710 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1711 unsigned int *kanji
, unsigned int *underlined
,
1712 int *script
, WMRulerMargins
*margins
);
1714 int WMGetTextInsertType(WMText
*tPtr
);
1716 /*int WMGetTextBlocks(WMText *tPtr);
1718 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1720 int WMGetCurrentTextBlock(WMText *tPtr);*/
1722 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1724 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1726 void* WMRemoveTextBlock(WMText
*tPtr
);
1728 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1730 /* ....................................................................... */
1733 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1735 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1737 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1739 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1741 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1743 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1745 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1747 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1748 int identifier
, char *label
);
1750 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1752 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1754 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1756 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1758 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1760 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1762 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1764 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1766 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1769 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1771 void WMSetTabViewItemEnabled(WMTabViewItem
*tPtr
, Bool flag
);
1773 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1775 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1777 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1779 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1781 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1783 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1786 /* ....................................................................... */
1788 WMBox
* WMCreateBox(WMWidget
*parent
);
1790 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1792 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1793 int minSize
, int maxSize
, int space
);
1795 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1796 int minSize
, int maxSize
, int space
);
1798 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1800 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1802 /* ....................................................................... */
1804 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1805 char *defaultButton
, char *alternateButton
,
1808 /* you can free the returned string */
1809 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1810 char *defaultText
, char *okButton
, char *cancelButton
);
1812 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1813 char *msg
, char *defaultButton
,
1814 char *alternateButton
, char *otherButton
);
1816 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1817 char *msg
, char *defaultText
, char *okButton
,
1818 char *cancelButton
);
1821 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1822 char *title
, char *defaultButton
,
1823 char *alternateButton
);
1825 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1827 void WMDestroyInputPanel(WMInputPanel
*panel
);
1829 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1831 /* ....................................................................... */
1833 /* only 1 instance per WMScreen */
1834 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1836 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1838 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1840 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1842 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1844 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1846 /* you can free the returned string */
1847 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1849 void WMFreeFilePanel(WMFilePanel
*panel
);
1851 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1852 char *path
, char *name
, char **fileTypes
);
1854 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1856 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1859 /* ...................................................................... */
1861 /* only 1 instance per WMScreen */
1862 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1864 void WMShowFontPanel(WMFontPanel
*panel
);
1866 void WMHideFontPanel(WMFontPanel
*panel
);
1868 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1870 /* you can free the returned string */
1871 char* WMGetFontPanelFontName(WMFontPanel
*panel
);
1873 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1877 #endif /* __cplusplus */