7 #include <WINGs/WUtil.h>
10 #define WINGS_H_VERSION 20021008
15 #endif /* __cplusplus */
21 typedef unsigned long WMPixel
;
43 #define ClientMessageMask (1L<<30)
46 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
47 #define _DEFINED_GNUSTEP_WINDOW_INFO
49 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
50 * NSDesktopWindowLevel intended to be the level at which things
51 * on the desktop sit ... so you should be able
52 * to put a desktop background just below it.
54 * Applications are actually permitted to use any value in the
55 * range INT_MIN+1 to INT_MAX
58 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
59 WMNormalWindowLevel
= 0,
60 WMFloatingWindowLevel
= 3,
61 WMSubmenuWindowLevel
= 3,
62 WMTornOffMenuWindowLevel
= 3,
63 WMMainMenuWindowLevel
= 20,
64 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
65 WMStatusWindowLevel
= 21,
66 WMModalPanelWindowLevel
= 100,
67 WMPopUpMenuWindowLevel
= 101,
68 WMScreenSaverWindowLevel
= 1000
72 /* window attributes */
74 WMBorderlessWindowMask
= 0,
75 WMTitledWindowMask
= 1,
76 WMClosableWindowMask
= 2,
77 WMMiniaturizableWindowMask
= 4,
78 WMResizableWindowMask
= 8,
79 WMIconWindowMask
= 64,
80 WMMiniWindowMask
= 128
87 /* 0 is reserved for internal use */
93 WBTMomentaryChange
= 6,
98 /* button behaviour masks */
100 WBBSpringLoadedMask
= (1 << 0),
101 WBBPushInMask
= (1 << 1),
102 WBBPushChangeMask
= (1 << 2),
103 WBBPushLightMask
= (1 << 3),
104 WBBStateLightMask
= (1 << 5),
105 WBBStateChangeMask
= (1 << 6),
106 WBBStatePushMask
= (1 << 7)
113 WFNormalFont
= (1<<0),
115 WFAntialiased
= (1<<2),
116 WFNotAntialiased
= (1<<3)
120 /* Font copy masks */
129 /* Use default system font size in system font name */
135 /* frame title positions */
159 /* alignment types */
164 WAJustified
/* not valid for textfields */
180 /* scroller arrow position */
185 } WMScrollArrowPosition
;
200 /* usable scroller parts */
205 } WMUsableScrollerParts
;
217 WTTopTabsBevelBorder
,
224 /* text movement types */
226 WMIllegalTextMovement
,
227 WMReturnTextMovement
,
228 WMEscapeTextMovement
,
230 WMBacktabTextMovement
,
237 /* text field special events */
245 WLNotFound
= -1 /* element was not found in WMList */
249 /* drag operations */
257 } WMDragOperationType
;
261 WMGrayModeColorPanel
= 1,
262 WMRGBModeColorPanel
= 2,
263 WMCMYKModeColorPanel
= 3,
264 WMHSBModeColorPanel
= 4,
265 WMCustomPaletteModeColorPanel
= 5,
266 WMColorListModeColorPanel
= 6,
267 WMWheelModeColorPanel
= 7
273 #define WSIReturnArrow 1
274 #define WSIHighlightedReturnArrow 2
275 #define WSIScrollerDimple 3
276 #define WSIArrowLeft 4
277 #define WSIHighlightedArrowLeft 5
278 #define WSIArrowRight 6
279 #define WSIHighlightedArrowRight 7
281 #define WSIHighlightedArrowUp 9
282 #define WSIArrowDown 10
283 #define WSIHighlightedArrowDown 11
284 #define WSICheckMark 12
287 WLDSSelected
= (1 << 16),
288 WLDSDisabled
= (1 << 17),
289 WLDSFocused
= (1 << 18),
290 WLDSIsBranch
= (1 << 19)
293 /* alert panel return values */
303 /* types of input observers */
305 WIReadMask
= (1 << 0),
306 WIWriteMask
= (1 << 1),
307 WIExceptMask
= (1 << 2)
327 WC_Matrix
= 12, /* not ready */
330 WC_ProgressIndicator
= 15,
337 /* All widgets must start with the following structure
338 * in that order. Used for typecasting to get some generic data */
339 typedef struct W_WidgetType
{
346 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
347 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
352 typedef void WMWidget
;
354 typedef struct W_Pixmap WMPixmap
;
355 typedef struct W_Font WMFont
;
356 typedef struct W_Color WMColor
;
358 typedef struct W_Screen WMScreen
;
360 typedef struct W_View WMView
;
362 typedef struct W_Window WMWindow
;
363 typedef struct W_Frame WMFrame
;
364 typedef struct W_Button WMButton
;
365 typedef struct W_Label WMLabel
;
366 typedef struct W_TextField WMTextField
;
367 typedef struct W_Scroller WMScroller
;
368 typedef struct W_ScrollView WMScrollView
;
369 typedef struct W_List WMList
;
370 typedef struct W_Browser WMBrowser
;
371 typedef struct W_PopUpButton WMPopUpButton
;
372 typedef struct W_ProgressIndicator WMProgressIndicator
;
373 typedef struct W_ColorWell WMColorWell
;
374 typedef struct W_Slider WMSlider
;
375 typedef struct W_Matrix WMMatrix
; /* not ready */
376 typedef struct W_SplitView WMSplitView
;
377 typedef struct W_TabView WMTabView
;
378 typedef struct W_Ruler WMRuler
;
379 typedef struct W_Text WMText
;
380 typedef struct W_Box WMBox
;
384 typedef struct W_TabViewItem WMTabViewItem
;
385 typedef struct W_MenuItem WMMenuItem
;
388 typedef struct W_FilePanel WMFilePanel
;
389 typedef WMFilePanel WMOpenPanel
;
390 typedef WMFilePanel WMSavePanel
;
392 typedef struct W_FontPanel WMFontPanel
;
394 typedef struct W_ColorPanel WMColorPanel
;
397 /* item for WMList */
398 typedef struct WMListItem
{
400 void *clientData
; /* ptr for user clientdata. */
402 unsigned int uflags
:16; /* flags for the user */
403 unsigned int selected
:1;
404 unsigned int disabled
:1;
405 unsigned int isBranch
:1;
406 unsigned int loaded
:1;
409 /* struct for message panel */
410 typedef struct WMAlertPanel
{
411 WMWindow
*win
; /* window */
414 WMButton
*defBtn
; /* default button */
415 WMButton
*altBtn
; /* alternative button */
416 WMButton
*othBtn
; /* other button */
417 WMLabel
*iLbl
; /* icon label */
418 WMLabel
*tLbl
; /* title label */
419 WMLabel
*mLbl
; /* message label */
420 WMFrame
*line
; /* separator */
421 short result
; /* button that was pushed */
425 typedef struct WMGenericPanel
{
446 typedef struct WMInputPanel
{
447 WMWindow
*win
; /* window */
448 WMButton
*defBtn
; /* default button */
449 WMButton
*altBtn
; /* alternative button */
450 WMLabel
*tLbl
; /* title label */
451 WMLabel
*mLbl
; /* message label */
452 WMTextField
*text
; /* text field */
453 short result
; /* button that was pushed */
459 WMArray
*tabs
; /* a growable array of tabstops */
460 unsigned short left
; /* left margin marker */
461 unsigned short right
; /* right margin marker */
462 unsigned short first
; /* indentation marker for first line only */
463 unsigned short body
; /* body indentation marker */
464 unsigned short retainCount
;
466 /* All indentation and tab markers are _relative_ to the left margin marker */
469 typedef void WMEventProc(XEvent
*event
, void *clientData
);
471 typedef void WMEventHook(XEvent
*event
);
473 /* self is set to the widget from where the callback is being called and
474 * clientData to the data set to with WMSetClientData() */
475 typedef void WMAction(WMWidget
*self
, void *clientData
);
477 /* same as WMAction, but for stuff that arent widgets */
478 typedef void WMAction2(void *self
, void *clientData
);
481 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
483 /* delegate method like stuff */
484 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
485 int state
, WMRect
*rect
);
488 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
489 unsigned int oldWidth,
490 unsigned int oldHeight);
493 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
494 int *minSize
, int *maxSize
);
496 typedef WMWidget
* WMMatrixCreateCellProc(WMMatrix
*mPtr
);
501 typedef struct WMBrowserDelegate
{
504 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
505 WMBrowser
*sender
, int column
, WMList
*list
);
507 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
510 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
512 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
516 typedef struct WMTextFieldDelegate
{
519 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
520 WMNotification
*notif
);
522 void (*didChange
)(struct WMTextFieldDelegate
*self
,
523 WMNotification
*notif
);
525 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
526 WMNotification
*notif
);
528 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
531 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
533 } WMTextFieldDelegate
;
536 typedef struct WMTextDelegate
{
539 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
546 typedef struct WMTabViewDelegate
{
549 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
552 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
553 WMTabViewItem
*item
);
555 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
556 WMTabViewItem
*item
);
558 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
559 WMTabViewItem
*item
);
565 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
566 Time timestamp
, void *cdata
, WMData
*data
);
569 typedef struct WMSelectionProcs
{
570 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
571 void *cdata
, Atom
*type
);
572 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
573 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
578 typedef struct W_DraggingInfo WMDraggingInfo
;
581 typedef struct W_DragSourceProcs
{
582 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
583 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
584 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
586 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
587 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
592 typedef struct W_DragDestinationProcs
{
593 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
594 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
595 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
596 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
597 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
598 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
599 } WMDragDestinationProcs
;
603 /* ...................................................................... */
606 WMPoint
wmkpoint(int x
, int y
);
608 WMSize
wmksize(unsigned int width
, unsigned int height
);
610 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
611 #define wmksize(width, height) (WMSize){(width), (height)}
612 #define wmkpoint(x, y) (WMPoint){(x), (y)}
615 /* ....................................................................... */
619 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
621 void WMSetResourcePath(char *path
);
623 /* don't free the returned string */
624 char* WMGetApplicationName();
626 /* Try to locate resource file. ext may be NULL */
627 char* WMPathForResourceOfType(char *resource
, char *ext
);
630 WMScreen
* WMOpenScreen(const char *display
);
632 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
635 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
637 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
639 void WMScreenMainLoop(WMScreen
*scr
);
641 void WMBreakModalLoop(WMScreen
*scr
);
643 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
645 RContext
* WMScreenRContext(WMScreen
*scr
);
647 Display
* WMScreenDisplay(WMScreen
*scr
);
649 int WMScreenDepth(WMScreen
*scr
);
653 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
655 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
657 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
659 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
661 /* If color==NULL it will use the default color for panels: ae/aa/ae */
662 WMPixmap
* WMCreateApplicationIconBlendedPixmap(WMScreen
*scr
, RColor
*color
);
664 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
666 void WMSetFocusToWidget(WMWidget
*widget
);
668 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
670 int WMHandleEvent(XEvent
*event
);
672 Bool
WMScreenPending(WMScreen
*scr
);
674 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
675 WMEventProc
*eventProc
, void *clientData
);
677 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
678 WMEventProc
*eventProc
, void *clientData
);
680 int WMIsDoubleClick(XEvent
*event
);
682 /*int WMIsTripleClick(XEvent *event);*/
684 void WMNextEvent(Display
*dpy
, XEvent
*event
);
686 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
689 /* ....................................................................... */
692 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
693 WMSelectionProcs
*procs
, void *cdata
);
695 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
697 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
698 Time timestamp
, WMSelectionCallback
*callback
,
702 extern char *WMSelectionOwnerDidChangeNotification
;
704 /* ....................................................................... */
706 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
708 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
709 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
712 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
714 void WMUnregisterViewDraggedTypes(WMView
*view
);
716 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
719 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
721 /* ....................................................................... */
723 Bool
WMHasAntialiasingSupport(WMScreen
*scrPtr
);
725 Bool
WMIsAntialiasingEnabled(WMScreen
*scrPtr
);
727 /* ....................................................................... */
729 WMFont
* WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
731 WMFont
* WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
733 WMFont
* WMCreateAntialiasedFont(WMScreen
*scrPtr
, char *fontName
);
735 WMFont
* WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
737 WMFont
* WMCreateFontWithFlags(WMScreen
*scrPtr
, char *fontName
, WMFontFlags flags
);
739 WMFont
* WMRetainFont(WMFont
*font
);
741 void WMReleaseFont(WMFont
*font
);
743 unsigned int WMFontHeight(WMFont
*font
);
745 Bool
WMIsAntialiasedFont(WMFont
*font
);
748 WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
750 WMFont* WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
754 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
756 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
758 WMFont
* WMDefaultSystemFont(WMScreen
*scrPtr
);
760 WMFont
* WMDefaultBoldSystemFont(WMScreen
*scrPtr
);
762 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
764 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
766 XFontSet
WMGetFontFontSet(WMFont
*font
);
768 WMFont
* WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
770 WMFont
* WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
772 WMFont
* WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
774 WMFont
* WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
776 WMFont
* WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
778 /* ....................................................................... */
780 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
782 void WMReleasePixmap(WMPixmap
*pixmap
);
784 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
787 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
788 Pixmap mask
, int width
, int height
,
791 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
794 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
796 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
798 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
800 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
803 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
806 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
808 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
810 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
812 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
814 /* ....................................................................... */
817 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
819 WMColor
* WMGrayColor(WMScreen
*scr
);
821 WMColor
* WMBlackColor(WMScreen
*scr
);
823 WMColor
* WMWhiteColor(WMScreen
*scr
);
825 void WMSetColorInGC(WMColor
*color
, GC gc
);
827 GC
WMColorGC(WMColor
*color
);
829 WMPixel
WMColorPixel(WMColor
*color
);
831 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
832 unsigned int width
, unsigned int height
);
834 void WMReleaseColor(WMColor
*color
);
836 WMColor
* WMRetainColor(WMColor
*color
);
838 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
839 unsigned short green
, unsigned short blue
,
842 WMColor
* WMCreateRGBAColor(WMScreen
*scr
, unsigned short red
,
843 unsigned short green
, unsigned short blue
,
844 unsigned short alpha
, Bool exact
);
846 WMColor
* WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
848 void WMSetColorAlpha(WMColor
*color
, unsigned short alpha
);
850 unsigned short WMRedComponentOfColor(WMColor
*color
);
852 unsigned short WMGreenComponentOfColor(WMColor
*color
);
854 unsigned short WMBlueComponentOfColor(WMColor
*color
);
856 unsigned short WMGetColorAlpha(WMColor
*color
);
858 char* WMGetColorRGBDescription(WMColor
*color
);
860 /* ....................................................................... */
863 void WMDrawString(WMScreen
*scr
, Drawable d
, WMColor
*color
, WMFont
*font
,
864 int x
, int y
, char *text
, int length
);
866 void WMDrawImageString(WMScreen
*scr
, Drawable d
, WMColor
*color
,
867 WMColor
*background
, WMFont
*font
, int x
, int y
,
868 char *text
, int length
);
870 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
874 /* ....................................................................... */
876 WMScreen
* WMWidgetScreen(WMWidget
*w
);
878 unsigned int WMScreenWidth(WMScreen
*scr
);
880 unsigned int WMScreenHeight(WMScreen
*scr
);
882 void WMUnmapWidget(WMWidget
*w
);
884 void WMMapWidget(WMWidget
*w
);
886 Bool
WMWidgetIsMapped(WMWidget
*w
);
888 void WMRaiseWidget(WMWidget
*w
);
890 void WMLowerWidget(WMWidget
*w
);
892 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
894 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
896 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
898 void WMMapSubwidgets(WMWidget
*w
);
900 void WMUnmapSubwidgets(WMWidget
*w
);
902 void WMRealizeWidget(WMWidget
*w
);
904 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
906 void WMDestroyWidget(WMWidget
*widget
);
908 void WMHangData(WMWidget
*widget
, void *data
);
910 void* WMGetHangedData(WMWidget
*widget
);
912 unsigned int WMWidgetWidth(WMWidget
*w
);
914 unsigned int WMWidgetHeight(WMWidget
*w
);
916 Window
WMWidgetXID(WMWidget
*w
);
918 Window
WMViewXID(WMView
*view
);
920 void WMRedisplayWidget(WMWidget
*w
);
922 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
924 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
925 int rightOffs
, int bottomOffs
);
927 WMSize
WMGetViewSize(WMView
*view
);
929 WMPoint
WMGetViewPosition(WMView
*view
);
931 WMPoint
WMGetViewScreenPosition(WMView
*view
);
933 WMWidget
* WMWidgetOfView(WMView
*view
);
935 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
937 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
940 extern char *WMViewSizeDidChangeNotification
;
942 extern char *WMViewFocusDidChangeNotification
;
944 extern char *WMViewRealizedNotification
;
947 /* ....................................................................... */
949 void WMSetBalloonTextForView(char *text
, WMView
*view
);
951 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
953 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
955 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
957 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
959 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
962 /* ....................................................................... */
964 WMWindow
* WMCreateWindow(WMScreen
*screen
, char *name
);
966 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
968 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
971 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
973 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
975 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
977 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
979 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
981 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
983 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
985 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
987 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
990 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
992 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
994 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
996 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
998 void WMSetWindowLevel(WMWindow
*win
, int level
);
1000 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
1002 void WMCloseWindow(WMWindow
*win
);
1004 /* ....................................................................... */
1006 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
1008 #define WMCreateCommandButton(parent) \
1009 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1014 #define WMCreateRadioButton(parent) \
1015 WMCreateButton((parent), WBTRadio)
1017 #define WMCreateSwitchButton(parent) \
1018 WMCreateButton((parent), WBTSwitch)
1020 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
1022 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
1024 void WMSetButtonImageDefault(WMButton
*bPtr
);
1026 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
1028 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
1030 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
1032 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
1034 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
1036 void WMSetButtonText(WMButton
*bPtr
, char *text
);
1038 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
1040 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
1042 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1044 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1046 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1048 int WMGetButtonSelected(WMButton
*bPtr
);
1050 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1052 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1054 int WMGetButtonEnabled(WMButton
*bPtr
);
1056 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1058 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1060 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1062 void WMPerformButtonClick(WMButton
*bPtr
);
1064 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1066 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1068 /* ....................................................................... */
1070 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1072 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1074 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1076 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1078 char* WMGetLabelText(WMLabel
*lPtr
);
1080 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1082 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1084 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1086 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1088 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1090 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1092 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1094 /* ....................................................................... */
1096 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1098 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1100 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1102 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1104 /* ....................................................................... */
1106 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1108 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1110 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1112 /* you can free the returned string */
1113 char* WMGetTextFieldText(WMTextField
*tPtr
);
1115 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1117 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1119 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1121 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1123 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1125 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1127 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1129 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1131 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1133 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1135 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1137 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1139 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1141 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1143 WMTextFieldDelegate
* WMGetTextFieldDelegate(WMTextField
*tPtr
);
1145 extern char *WMTextDidChangeNotification
;
1146 extern char *WMTextDidBeginEditingNotification
;
1147 extern char *WMTextDidEndEditingNotification
;
1149 /* ....................................................................... */
1151 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1153 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1154 float knobProportion
);
1156 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1158 float WMGetScrollerValue(WMScroller
*sPtr
);
1160 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1162 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1164 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1165 WMScrollArrowPosition position
);
1167 extern char *WMScrollerDidScrollNotification
;
1169 /* ....................................................................... */
1171 WMList
* WMCreateList(WMWidget
*parent
);
1173 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1175 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1177 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1179 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1181 void WMSortListItems(WMList
*lPtr
);
1183 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1185 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1187 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1189 WMArray
* WMGetListItems(WMList
*lPtr
);
1191 void WMRemoveListItem(WMList
*lPtr
, int row
);
1193 void WMSelectListItem(WMList
*lPtr
, int row
);
1195 void WMUnselectListItem(WMList
*lPtr
, int row
);
1197 /* This will select all items in range, and deselect all the others */
1198 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1200 /* This will select all items in range, leaving the others as they are */
1201 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1203 void WMSelectAllListItems(WMList
*lPtr
);
1205 void WMUnselectAllListItems(WMList
*lPtr
);
1207 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1209 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1211 int WMGetListItemHeight(WMList
*lPtr
);
1213 /* don't free the returned data */
1214 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1217 * For the following 2 functions, in case WMList allows multiple selection,
1218 * the first item in the list of selected items, respective its row number,
1222 /* don't free the returned data */
1223 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1225 int WMGetListSelectedItemRow(WMList
*lPtr
);
1227 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1229 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1231 void WMClearList(WMList
*lPtr
);
1233 int WMGetListNumberOfRows(WMList
*lPtr
);
1235 void WMSetListPosition(WMList
*lPtr
, int row
);
1237 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1239 int WMGetListPosition(WMList
*lPtr
);
1241 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1243 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1246 extern char *WMListDidScrollNotification
;
1247 extern char *WMListSelectionDidChangeNotification
;
1249 /* ....................................................................... */
1251 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1253 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1255 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1257 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1259 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1261 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1263 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1265 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1267 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1269 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1271 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1273 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1275 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1276 WMCompareDataProc
*func
);
1278 /* Don't free the returned string. */
1279 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1281 /* free the returned string */
1282 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1284 /* free the returned string */
1285 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1287 /* free the returned array */
1288 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1290 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1292 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1295 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1297 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1299 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1301 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1303 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1305 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1307 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1309 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1311 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1313 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1315 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1317 /* ....................................................................... */
1320 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1322 WMMenuItem
* WMCreateMenuItem(void);
1324 void WMDestroyMenuItem(WMMenuItem
*item
);
1326 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1328 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1330 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1332 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1334 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1336 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1338 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1340 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1342 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1344 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1346 void* WMGetMenuItemData(WMMenuItem
*item
);
1348 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1350 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1352 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1354 int WMGetMenuItemState(WMMenuItem
*item
);
1356 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1358 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1360 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1362 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1364 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1366 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1368 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1370 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1372 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1375 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1377 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1380 /* ....................................................................... */
1382 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1384 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1387 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1389 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1391 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1394 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1396 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1398 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1400 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1402 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1404 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1406 /* don't free the returned data */
1407 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1409 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1412 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1414 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1416 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1418 /* ....................................................................... */
1420 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1422 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1424 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1426 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1428 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1430 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1432 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1435 /* ....................................................................... */
1437 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1439 void WMFreeColorPanel(WMColorPanel
*panel
);
1441 void WMShowColorPanel(WMColorPanel
*panel
);
1443 void WMCloseColorPanel(WMColorPanel
*panel
);
1445 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1447 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1449 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1451 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1453 extern char *WMColorPanelColorChangedNotification
;
1455 /* ....................................................................... */
1457 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1459 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1461 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1463 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1466 extern char *WMColorWellDidChangeNotification
;
1469 /* ...................................................................... */
1471 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1473 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1474 unsigned int height
);
1476 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1478 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1480 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1482 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1484 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1486 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1488 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1490 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1492 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1494 /* ....................................................................... */
1496 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1498 int WMGetSliderMinValue(WMSlider
*slider
);
1500 int WMGetSliderMaxValue(WMSlider
*slider
);
1502 int WMGetSliderValue(WMSlider
*slider
);
1504 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1506 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1508 void WMSetSliderValue(WMSlider
*slider
, int value
);
1510 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1512 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1514 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1516 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1518 /* ....................................................................... */
1521 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1523 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1525 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1527 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1529 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1531 /* remove the first subview == view */
1532 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1534 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1537 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1539 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1541 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1542 WMSplitViewConstrainProc
*proc
);
1545 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1546 WMSplitViewResizeSubviewsProc *proc);
1549 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1551 /* ...................................................................... */
1553 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1555 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1557 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1559 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1561 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1563 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1565 int WMGetRulerOffset(WMRuler
*rPtr
);
1567 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1569 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1571 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1573 /* ....................................................................... */
1576 #define WMCreateText(parent) WMCreateTextForDocumentType \
1577 ((parent), (NULL), (NULL))
1579 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1582 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1584 void WMFreezeText(WMText
*tPtr
);
1586 #define WMRefreshText(tPtr) WMThawText((tPtr))
1588 void WMThawText(WMText
*tPtr
);
1590 int WMScrollText(WMText
*tPtr
, int amount
);
1592 int WMPageText(WMText
*tPtr
, Bool direction
);
1594 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1596 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1598 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1600 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1602 int WMGetTextRulerShown(WMText
*tPtr
);
1604 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1606 int WMGetTextEditable(WMText
*tPtr
);
1608 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1610 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1612 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1614 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1616 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1618 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1620 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1622 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1624 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1626 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1628 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1630 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1632 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1634 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1636 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1638 #define WMClearText(tPtr) WMAppendTextStream \
1642 char* WMGetTextStream(WMText
*tPtr
);
1645 char* WMGetTextSelectedStream(WMText
*tPtr
);
1647 /* destroy the array */
1648 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1650 /* destroy the array */
1651 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1653 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1655 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1657 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1659 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1661 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1663 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1665 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1667 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1668 Bool caseSensitive
);
1670 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1673 /* parser related stuff... use only if implementing a new parser */
1675 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1676 WMColor
*color
, unsigned short first
,
1677 unsigned short extraInfo
);
1679 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1680 WMColor
*color
, unsigned short first
,
1681 unsigned short extraInfo
);
1683 void* WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1684 WMColor
*color
, unsigned short first
,
1685 unsigned short length
);
1687 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1688 unsigned int kanji
, unsigned int underlined
,
1689 int script
, WMRulerMargins
*margins
);
1691 /* do NOT free the margins */
1692 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1693 unsigned int *kanji
, unsigned int *underlined
,
1694 int *script
, WMRulerMargins
*margins
);
1696 int WMGetTextInsertType(WMText
*tPtr
);
1698 /*int WMGetTextBlocks(WMText *tPtr);
1700 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1702 int WMGetCurrentTextBlock(WMText *tPtr);*/
1704 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1706 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1708 void* WMRemoveTextBlock(WMText
*tPtr
);
1710 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1712 /* ....................................................................... */
1715 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1717 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1719 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1721 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1723 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1725 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1727 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1729 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1730 int identifier
, char *label
);
1732 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1734 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1736 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1738 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1740 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1742 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1744 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1746 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1748 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1751 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1753 void WMSetTabViewItemEnabled(WMTabViewItem
*tPtr
, Bool flag
);
1755 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1757 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1759 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1761 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1763 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1765 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1768 /* ....................................................................... */
1770 WMBox
* WMCreateBox(WMWidget
*parent
);
1772 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1774 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1775 int minSize
, int maxSize
, int space
);
1777 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1778 int minSize
, int maxSize
, int space
);
1780 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1782 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1784 /* ....................................................................... */
1786 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1787 char *defaultButton
, char *alternateButton
,
1790 /* you can free the returned string */
1791 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1792 char *defaultText
, char *okButton
, char *cancelButton
);
1794 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1795 char *msg
, char *defaultButton
,
1796 char *alternateButton
, char *otherButton
);
1798 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1799 char *msg
, char *defaultText
, char *okButton
,
1800 char *cancelButton
);
1803 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1804 char *title
, char *defaultButton
,
1805 char *alternateButton
);
1807 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1809 void WMDestroyInputPanel(WMInputPanel
*panel
);
1811 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1813 /* ....................................................................... */
1815 /* only 1 instance per WMScreen */
1816 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1818 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1820 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1822 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1824 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1826 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1828 /* you can free the returned string */
1829 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1831 void WMFreeFilePanel(WMFilePanel
*panel
);
1833 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1834 char *path
, char *name
, char **fileTypes
);
1836 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1838 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1841 /* ...................................................................... */
1843 /* only 1 instance per WMScreen */
1844 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1846 void WMShowFontPanel(WMFontPanel
*panel
);
1848 void WMHideFontPanel(WMFontPanel
*panel
);
1850 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1852 /* you can free the returned string */
1853 char* WMGetFontPanelFontName(WMFontPanel
*panel
);
1855 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1859 #endif /* __cplusplus */