7 #include <WINGs/WUtil.h>
10 #define WINGS_H_VERSION 20010117
15 #endif /* __cplusplus */
21 typedef unsigned long WMPixel
;
43 #define ClientMessageMask (1L<<30)
46 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
47 #define _DEFINED_GNUSTEP_WINDOW_INFO
49 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
50 * NSDesktopWindowLevel intended to be the level at which things
51 * on the desktop sit ... so you should be able
52 * to put a desktop background just below it.
54 * Applications are actually permitted to use any value in the
55 * range INT_MIN+1 to INT_MAX
58 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
59 WMNormalWindowLevel
= 0,
60 WMFloatingWindowLevel
= 3,
61 WMSubmenuWindowLevel
= 3,
62 WMTornOffMenuWindowLevel
= 3,
63 WMMainMenuWindowLevel
= 20,
64 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
65 WMStatusWindowLevel
= 21,
66 WMModalPanelWindowLevel
= 100,
67 WMPopUpMenuWindowLevel
= 101,
68 WMScreenSaverWindowLevel
= 1000
72 /* window attributes */
74 WMBorderlessWindowMask
= 0,
75 WMTitledWindowMask
= 1,
76 WMClosableWindowMask
= 2,
77 WMMiniaturizableWindowMask
= 4,
78 WMResizableWindowMask
= 8,
79 WMIconWindowMask
= 64,
80 WMMiniWindowMask
= 128
87 /* 0 is reserved for internal use */
93 WBTMomentaryChange
= 6,
98 /* button behaviour masks */
100 WBBSpringLoadedMask
= (1 << 0),
101 WBBPushInMask
= (1 << 1),
102 WBBPushChangeMask
= (1 << 2),
103 WBBPushLightMask
= (1 << 3),
104 WBBStateLightMask
= (1 << 5),
105 WBBStateChangeMask
= (1 << 6),
106 WBBStatePushMask
= (1 << 7)
110 /* frame title positions */
134 /* alignment types */
139 WAJustified
/* not valid for textfields */
155 /* scroller arrow position */
160 } WMScrollArrowPosition
;
175 /* usable scroller parts */
180 } WMUsableScrollerParts
;
192 WTTopTabsBevelBorder
,
199 /* text movement types */
201 WMIllegalTextMovement
,
202 WMReturnTextMovement
,
203 WMEscapeTextMovement
,
205 WMBacktabTextMovement
,
212 /* text field special events */
220 WLNotFound
= -1 /* element was not found in WMList */
224 /* drag operations */
232 } WMDragOperationType
;
236 WMGrayModeColorPanel
= 1,
237 WMRGBModeColorPanel
= 2,
238 WMCMYKModeColorPanel
= 3,
239 WMHSBModeColorPanel
= 4,
240 WMCustomPaletteModeColorPanel
= 5,
241 WMColorListModeColorPanel
= 6,
242 WMWheelModeColorPanel
= 7
248 #define WSIReturnArrow 1
249 #define WSIHighlightedReturnArrow 2
250 #define WSIScrollerDimple 3
251 #define WSIArrowLeft 4
252 #define WSIHighlightedArrowLeft 5
253 #define WSIArrowRight 6
254 #define WSIHighlightedArrowRight 7
256 #define WSIHighlightedArrowUp 9
257 #define WSIArrowDown 10
258 #define WSIHighlightedArrowDown 11
259 #define WSICheckMark 12
262 WLDSSelected
= (1 << 16),
263 WLDSDisabled
= (1 << 17),
264 WLDSFocused
= (1 << 18),
265 WLDSIsBranch
= (1 << 19)
268 /* alert panel return values */
278 /* types of input observers */
280 WIReadMask
= (1 << 0),
281 WIWriteMask
= (1 << 1),
282 WIExceptMask
= (1 << 2)
302 WC_Matrix
= 12, /* not ready */
305 WC_ProgressIndicator
= 15,
312 /* All widgets must start with the following structure
313 * in that order. Used for typecasting to get some generic data */
314 typedef struct W_WidgetType
{
321 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
322 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
327 typedef void WMWidget
;
329 typedef struct W_Pixmap WMPixmap
;
330 typedef struct W_Font WMFont
;
331 typedef struct W_Color WMColor
;
333 typedef struct W_Screen WMScreen
;
335 typedef struct W_View WMView
;
337 typedef struct W_Window WMWindow
;
338 typedef struct W_Frame WMFrame
;
339 typedef struct W_Button WMButton
;
340 typedef struct W_Label WMLabel
;
341 typedef struct W_TextField WMTextField
;
342 typedef struct W_Scroller WMScroller
;
343 typedef struct W_ScrollView WMScrollView
;
344 typedef struct W_List WMList
;
345 typedef struct W_Browser WMBrowser
;
346 typedef struct W_PopUpButton WMPopUpButton
;
347 typedef struct W_ProgressIndicator WMProgressIndicator
;
348 typedef struct W_ColorWell WMColorWell
;
349 typedef struct W_Slider WMSlider
;
350 typedef struct W_Matrix WMMatrix
; /* not ready */
351 typedef struct W_SplitView WMSplitView
;
352 typedef struct W_TabView WMTabView
;
353 typedef struct W_Ruler WMRuler
;
354 typedef struct W_Text WMText
;
355 typedef struct W_Box WMBox
;
359 typedef struct W_TabViewItem WMTabViewItem
;
360 typedef struct W_MenuItem WMMenuItem
;
363 typedef struct W_FilePanel WMFilePanel
;
364 typedef WMFilePanel WMOpenPanel
;
365 typedef WMFilePanel WMSavePanel
;
367 typedef struct W_FontPanel WMFontPanel
;
369 typedef struct W_ColorPanel WMColorPanel
;
372 /* item for WMList */
373 typedef struct WMListItem
{
375 void *clientData
; /* ptr for user clientdata. */
377 unsigned int uflags
:16; /* flags for the user */
378 unsigned int selected
:1;
379 unsigned int disabled
:1;
380 unsigned int isBranch
:1;
381 unsigned int loaded
:1;
384 /* struct for message panel */
385 typedef struct WMAlertPanel
{
386 WMWindow
*win
; /* window */
388 WMButton
*defBtn
; /* default button */
389 WMButton
*altBtn
; /* alternative button */
390 WMButton
*othBtn
; /* other button */
391 WMLabel
*iLbl
; /* icon label */
392 WMLabel
*tLbl
; /* title label */
393 WMLabel
*mLbl
; /* message label */
394 WMFrame
*line
; /* separator */
395 short result
; /* button that was pushed */
399 typedef struct WMGenericPanel
{
420 typedef struct WMInputPanel
{
421 WMWindow
*win
; /* window */
422 WMButton
*defBtn
; /* default button */
423 WMButton
*altBtn
; /* alternative button */
424 WMLabel
*tLbl
; /* title label */
425 WMLabel
*mLbl
; /* message label */
426 WMTextField
*text
; /* text field */
427 short result
; /* button that was pushed */
433 WMArray
*tabs
; /* a growable array of tabstops */
434 unsigned short left
; /* left margin marker */
435 unsigned short right
; /* right margin marker */
436 unsigned short first
; /* indentation marker for first line only */
437 unsigned short body
; /* body indentation marker */
438 unsigned short retainCount
;
440 /* All indentation and tab markers are _relative_ to the left margin marker */
443 typedef void WMEventProc(XEvent
*event
, void *clientData
);
445 typedef void WMEventHook(XEvent
*event
);
447 /* self is set to the widget from where the callback is being called and
448 * clientData to the data set to with WMSetClientData() */
449 typedef void WMAction(WMWidget
*self
, void *clientData
);
451 /* same as WMAction, but for stuff that arent widgets */
452 typedef void WMAction2(void *self
, void *clientData
);
455 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
457 /* delegate method like stuff */
458 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
459 int state
, WMRect
*rect
);
462 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
463 unsigned int oldWidth,
464 unsigned int oldHeight);
467 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
468 int *minSize
, int *maxSize
);
470 typedef WMWidget
* WMMatrixCreateCellProc(WMMatrix
*mPtr
);
475 typedef struct WMBrowserDelegate
{
478 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
479 WMBrowser
*sender
, int column
, WMList
*list
);
481 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
484 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
486 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
490 typedef struct WMTextFieldDelegate
{
493 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
494 WMNotification
*notif
);
496 void (*didChange
)(struct WMTextFieldDelegate
*self
,
497 WMNotification
*notif
);
499 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
500 WMNotification
*notif
);
502 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
505 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
507 } WMTextFieldDelegate
;
510 typedef struct WMTextDelegate
{
513 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
520 typedef struct WMTabViewDelegate
{
523 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
526 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
527 WMTabViewItem
*item
);
529 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
530 WMTabViewItem
*item
);
532 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
533 WMTabViewItem
*item
);
539 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
540 Time timestamp
, void *cdata
, WMData
*data
);
543 typedef struct WMSelectionProcs
{
544 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
545 void *cdata
, Atom
*type
);
546 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
547 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
552 typedef struct W_DraggingInfo WMDraggingInfo
;
555 typedef struct W_DragSourceProcs
{
556 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
557 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
558 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
560 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
561 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
566 typedef struct W_DragDestinationProcs
{
567 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
568 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
569 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
570 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
571 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
572 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
573 } WMDragDestinationProcs
;
577 /* ...................................................................... */
580 WMPoint
wmkpoint(int x
, int y
);
582 WMSize
wmksize(unsigned int width
, unsigned int height
);
584 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
585 #define wmksize(width, height) (WMSize){(width), (height)}
586 #define wmkpoint(x, y) (WMPoint){(x), (y)}
589 /* ....................................................................... */
593 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
595 void WMSetResourcePath(char *path
);
597 /* don't free the returned string */
598 char* WMGetApplicationName();
600 /* Try to locate resource file. ext may be NULL */
601 char* WMPathForResourceOfType(char *resource
, char *ext
);
604 WMScreen
* WMOpenScreen(const char *display
);
606 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
609 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
611 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
613 void WMScreenMainLoop(WMScreen
*scr
);
615 void WMBreakModalLoop(WMScreen
*scr
);
617 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
619 RContext
* WMScreenRContext(WMScreen
*scr
);
621 Display
* WMScreenDisplay(WMScreen
*scr
);
623 int WMScreenDepth(WMScreen
*scr
);
627 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
629 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
631 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
633 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
635 /* If color==NULL it will use the default color for panels: ae/aa/ae */
636 WMPixmap
* WMGetApplicationIconBlendedPixmap(WMScreen
*scr
, RColor
*color
);
638 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
640 void WMSetFocusToWidget(WMWidget
*widget
);
642 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
644 int WMHandleEvent(XEvent
*event
);
646 Bool
WMScreenPending(WMScreen
*scr
);
648 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
649 WMEventProc
*eventProc
, void *clientData
);
651 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
652 WMEventProc
*eventProc
, void *clientData
);
654 int WMIsDoubleClick(XEvent
*event
);
656 int WMIsTripleClick(XEvent
*event
);
658 void WMNextEvent(Display
*dpy
, XEvent
*event
);
660 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
663 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
664 WMSelectionProcs
*procs
, void *cdata
);
666 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
668 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
669 Time timestamp
, WMSelectionCallback
*callback
,
673 /* ....................................................................... */
675 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
677 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
678 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
681 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
683 void WMUnregisterViewDraggedTypes(WMView
*view
);
685 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
688 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
690 /* ....................................................................... */
692 WMFont
* WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
694 WMFont
* WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
696 WMFont
* WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
698 WMFont
* WMRetainFont(WMFont
*font
);
700 void WMReleaseFont(WMFont
*font
);
702 unsigned int WMFontHeight(WMFont
*font
);
705 WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
707 WMFont* WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
711 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
713 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
715 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
717 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
719 XFontSet
WMGetFontFontSet(WMFont
*font
);
721 WMFont
* WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
723 WMFont
* WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
725 WMFont
* WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
727 WMFont
* WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
729 WMFont
* WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
731 WMFont
* WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
733 /* ....................................................................... */
735 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
737 void WMReleasePixmap(WMPixmap
*pixmap
);
739 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
742 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
743 Pixmap mask
, int width
, int height
,
746 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
749 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
751 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
753 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
755 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
758 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
761 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
763 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
765 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
767 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
769 /* ....................................................................... */
772 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
774 WMColor
* WMGrayColor(WMScreen
*scr
);
776 WMColor
* WMBlackColor(WMScreen
*scr
);
778 WMColor
* WMWhiteColor(WMScreen
*scr
);
780 void WMSetColorInGC(WMColor
*color
, GC gc
);
782 GC
WMColorGC(WMColor
*color
);
784 WMPixel
WMColorPixel(WMColor
*color
);
786 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
787 unsigned int width
, unsigned int height
);
789 void WMReleaseColor(WMColor
*color
);
791 WMColor
* WMRetainColor(WMColor
*color
);
793 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
794 unsigned short green
, unsigned short blue
,
797 WMColor
* WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
799 unsigned short WMRedComponentOfColor(WMColor
*color
);
801 unsigned short WMGreenComponentOfColor(WMColor
*color
);
803 unsigned short WMBlueComponentOfColor(WMColor
*color
);
805 char* WMGetColorRGBDescription(WMColor
*color
);
807 /* ....................................................................... */
810 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
811 int y
, char *text
, int length
);
813 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
814 int y
, char *text
, int length
);
816 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
820 /* ....................................................................... */
822 WMScreen
* WMWidgetScreen(WMWidget
*w
);
824 unsigned int WMScreenWidth(WMScreen
*scr
);
826 unsigned int WMScreenHeight(WMScreen
*scr
);
828 void WMUnmapWidget(WMWidget
*w
);
830 void WMMapWidget(WMWidget
*w
);
832 Bool
WMWidgetIsMapped(WMWidget
*w
);
834 void WMRaiseWidget(WMWidget
*w
);
836 void WMLowerWidget(WMWidget
*w
);
838 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
840 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
842 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
844 void WMMapSubwidgets(WMWidget
*w
);
846 void WMUnmapSubwidgets(WMWidget
*w
);
848 void WMRealizeWidget(WMWidget
*w
);
850 void WMDestroyWidget(WMWidget
*widget
);
852 void WMHangData(WMWidget
*widget
, void *data
);
854 void* WMGetHangedData(WMWidget
*widget
);
856 unsigned int WMWidgetWidth(WMWidget
*w
);
858 unsigned int WMWidgetHeight(WMWidget
*w
);
860 Window
WMWidgetXID(WMWidget
*w
);
862 Window
WMViewXID(WMView
*view
);
864 void WMRedisplayWidget(WMWidget
*w
);
866 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
868 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
869 int rightOffs
, int bottomOffs
);
871 WMSize
WMGetViewSize(WMView
*view
);
873 WMPoint
WMGetViewPosition(WMView
*view
);
875 WMPoint
WMGetViewScreenPosition(WMView
*view
);
877 WMWidget
* WMWidgetOfView(WMView
*view
);
879 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
881 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
884 extern char *WMViewSizeDidChangeNotification
;
886 extern char *WMViewRealizedNotification
;
888 extern char *WMFontPanelDidChangeNotification
;
891 /* ....................................................................... */
893 void WMSetBalloonTextForView(char *text
, WMView
*view
);
895 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
897 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
899 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
901 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
903 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
906 /* ....................................................................... */
908 WMWindow
* WMCreateWindow(WMScreen
*screen
, char *name
);
910 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
912 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
915 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
917 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
919 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
921 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
923 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
925 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
927 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
929 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
931 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
934 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
936 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
938 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
940 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
942 void WMSetWindowLevel(WMWindow
*win
, int level
);
944 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
946 void WMCloseWindow(WMWindow
*win
);
948 /* ....................................................................... */
950 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
952 #define WMCreateCommandButton(parent) \
953 WMCreateCustomButton((parent), WBBSpringLoadedMask\
958 #define WMCreateRadioButton(parent) \
959 WMCreateButton((parent), WBTRadio)
961 #define WMCreateSwitchButton(parent) \
962 WMCreateButton((parent), WBTSwitch)
964 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
966 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
968 void WMSetButtonImageDefault(WMButton
*bPtr
);
970 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
972 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
974 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
976 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
978 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
980 void WMSetButtonText(WMButton
*bPtr
, char *text
);
982 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
984 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
986 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
988 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
990 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
992 int WMGetButtonSelected(WMButton
*bPtr
);
994 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
996 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
998 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1000 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1002 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1004 void WMPerformButtonClick(WMButton
*bPtr
);
1006 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1008 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1010 /* ....................................................................... */
1012 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1014 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1016 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1018 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1020 char* WMGetLabelText(WMLabel
*lPtr
);
1022 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1024 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1026 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1028 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1030 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1032 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1034 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1036 /* ....................................................................... */
1038 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1040 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1042 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1044 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1046 /* ....................................................................... */
1048 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1050 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1052 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1054 /* you can free the returned string */
1055 char* WMGetTextFieldText(WMTextField
*tPtr
);
1057 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1059 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1061 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1063 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1065 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1067 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1069 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1071 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1073 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1075 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1077 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1079 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1081 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1083 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1086 extern char *WMTextDidChangeNotification
;
1087 extern char *WMTextDidBeginEditingNotification
;
1088 extern char *WMTextDidEndEditingNotification
;
1090 /* ....................................................................... */
1092 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1094 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1095 float knobProportion
);
1097 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1099 float WMGetScrollerValue(WMScroller
*sPtr
);
1101 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1103 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1105 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1106 WMScrollArrowPosition position
);
1108 extern char *WMScrollerDidScrollNotification
;
1110 /* ....................................................................... */
1112 WMList
* WMCreateList(WMWidget
*parent
);
1114 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1116 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1118 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1120 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1122 void WMSortListItems(WMList
*lPtr
);
1124 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1126 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1128 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1130 WMArray
* WMGetListItems(WMList
*lPtr
);
1132 void WMRemoveListItem(WMList
*lPtr
, int row
);
1134 void WMSelectListItem(WMList
*lPtr
, int row
);
1136 void WMUnselectListItem(WMList
*lPtr
, int row
);
1138 /* This will select all items in range, and deselect all the others */
1139 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1141 /* This will select all items in range, leaving the others as they are */
1142 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1144 void WMSelectAllListItems(WMList
*lPtr
);
1146 void WMUnselectAllListItems(WMList
*lPtr
);
1148 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1150 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1152 int WMGetListItemHeight(WMList
*lPtr
);
1154 /* don't free the returned data */
1155 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1158 * For the following 2 functions, in case WMList allows multiple selection,
1159 * the first item in the list of selected items, respective its row number,
1163 /* don't free the returned data */
1164 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1166 int WMGetListSelectedItemRow(WMList
*lPtr
);
1168 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1170 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1172 void WMClearList(WMList
*lPtr
);
1174 int WMGetListNumberOfRows(WMList
*lPtr
);
1176 void WMSetListPosition(WMList
*lPtr
, int row
);
1178 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1180 int WMGetListPosition(WMList
*lPtr
);
1182 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1184 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1187 extern char *WMListDidScrollNotification
;
1188 extern char *WMListSelectionDidChangeNotification
;
1190 /* ....................................................................... */
1192 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1194 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1196 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1198 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1200 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1202 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1204 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1206 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1208 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1210 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1212 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1214 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1216 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1217 WMCompareDataProc
*func
);
1219 /* Don't free the returned string. */
1220 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1222 /* free the returned string */
1223 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1225 /* free the returned string */
1226 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1228 /* free the returned array */
1229 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1231 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1233 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1236 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1238 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1240 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1242 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1244 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1246 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1248 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1250 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1252 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1254 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1256 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1258 /* ....................................................................... */
1261 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1263 WMMenuItem
* WMCreateMenuItem(void);
1265 void WMDestroyMenuItem(WMMenuItem
*item
);
1267 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1269 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1271 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1273 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1275 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1277 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1279 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1281 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1283 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1285 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1287 void* WMGetMenuItemData(WMMenuItem
*item
);
1289 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1291 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1293 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1295 int WMGetMenuItemState(WMMenuItem
*item
);
1297 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1299 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1301 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1303 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1305 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1307 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1309 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1311 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1313 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1316 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1318 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1321 /* ....................................................................... */
1323 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1325 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1328 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1330 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1332 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1335 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1337 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1339 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1341 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1343 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1345 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1347 /* don't free the returned data */
1348 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1350 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1353 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1355 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1357 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1359 /* ....................................................................... */
1361 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1363 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1365 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1367 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1369 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1371 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1373 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1376 /* ....................................................................... */
1378 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1380 void WMFreeColorPanel(WMColorPanel
*panel
);
1382 void WMShowColorPanel(WMColorPanel
*panel
);
1384 void WMCloseColorPanel(WMColorPanel
*panel
);
1386 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1388 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1390 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1392 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1394 extern char *WMColorPanelColorChangedNotification
;
1396 /* ....................................................................... */
1398 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1400 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1402 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1404 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1407 extern char *WMColorWellDidChangeNotification
;
1410 /* ...................................................................... */
1412 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1414 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1415 unsigned int height
);
1417 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1419 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1421 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1423 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1425 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1427 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1429 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1431 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1433 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1435 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1437 /* ....................................................................... */
1439 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1441 int WMGetSliderMinValue(WMSlider
*slider
);
1443 int WMGetSliderMaxValue(WMSlider
*slider
);
1445 int WMGetSliderValue(WMSlider
*slider
);
1447 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1449 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1451 void WMSetSliderValue(WMSlider
*slider
, int value
);
1453 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1455 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1457 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1459 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1461 /* ....................................................................... */
1464 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1466 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1468 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1470 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1472 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1474 /* remove the first subview == view */
1475 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1477 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1480 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1482 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1484 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1485 WMSplitViewConstrainProc
*proc
);
1488 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1489 WMSplitViewResizeSubviewsProc *proc);
1492 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1494 /* ...................................................................... */
1496 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1498 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1500 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1502 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1504 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1506 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1508 int WMGetRulerOffset(WMRuler
*rPtr
);
1510 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1512 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1514 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1516 /* ....................................................................... */
1519 #define WMCreateText(parent) WMCreateTextForDocumentType \
1520 ((parent), (NULL), (NULL))
1522 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1525 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1527 void WMFreezeText(WMText
*tPtr
);
1529 #define WMRefreshText(tPtr) WMThawText((tPtr))
1531 void WMThawText(WMText
*tPtr
);
1533 int WMScrollText(WMText
*tPtr
, int amount
);
1535 int WMPageText(WMText
*tPtr
, Bool direction
);
1537 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1539 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1541 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1543 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1545 int WMGetTextRulerShown(WMText
*tPtr
);
1547 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1549 int WMGetTextEditable(WMText
*tPtr
);
1551 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1553 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1555 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1557 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1559 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1561 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1563 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1565 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1567 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1569 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1571 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1573 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1575 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1577 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1579 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1581 #define WMClearText(tPtr) WMAppendTextStream \
1585 char* WMGetTextStream(WMText
*tPtr
);
1588 char* WMGetTextSelectedStream(WMText
*tPtr
);
1590 /* destroy the array */
1591 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1593 /* destroy the array */
1594 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1596 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1598 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1600 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1602 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1604 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1606 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1608 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1610 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1611 Bool caseSensitive
);
1613 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1616 /* parser related stuff... use only if implementing a new parser */
1618 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1619 WMColor
*color
, unsigned short first
,
1620 unsigned short extraInfo
);
1622 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1623 WMColor
*color
, unsigned short first
,
1624 unsigned short extraInfo
);
1626 void* WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1627 WMColor
*color
, unsigned short first
,
1628 unsigned short length
);
1630 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1631 unsigned int kanji
, unsigned int underlined
,
1632 int script
, WMRulerMargins
*margins
);
1634 /* do NOT free the margins */
1635 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1636 unsigned int *kanji
, unsigned int *underlined
,
1637 int *script
, WMRulerMargins
*margins
);
1639 int WMGetTextInsertType(WMText
*tPtr
);
1641 int WMGetTextBlocks(WMText
*tPtr
);
1643 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1645 int WMGetCurrentTextBlock(WMText
*tPtr
);
1647 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1649 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1651 void* WMRemoveTextBlock(WMText
*tPtr
);
1653 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1655 /* ....................................................................... */
1658 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1660 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1662 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1664 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1666 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1668 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1670 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1672 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1673 int identifier
, char *label
);
1675 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1677 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1679 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1681 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1683 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1685 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1687 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1689 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1691 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1694 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1696 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1698 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1700 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1702 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1704 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1706 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1709 /* ....................................................................... */
1711 WMBox
* WMCreateBox(WMWidget
*parent
);
1713 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1715 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1716 int minSize
, int maxSize
, int space
);
1718 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1719 int minSize
, int maxSize
, int space
);
1721 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1723 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1725 /* ....................................................................... */
1727 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1728 char *defaultButton
, char *alternateButton
,
1731 /* you can free the returned string */
1732 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1733 char *defaultText
, char *okButton
, char *cancelButton
);
1735 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1736 char *msg
, char *defaultButton
,
1737 char *alternateButton
, char *otherButton
);
1739 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1740 char *msg
, char *defaultText
, char *okButton
,
1741 char *cancelButton
);
1744 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1745 char *title
, char *defaultButton
,
1746 char *alternateButton
);
1748 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1750 void WMDestroyInputPanel(WMInputPanel
*panel
);
1752 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1754 /* ....................................................................... */
1756 /* only 1 instance per WMScreen */
1757 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1759 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1761 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1763 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1765 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1767 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1769 /* you can free the returned string */
1770 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1772 void WMFreeFilePanel(WMFilePanel
*panel
);
1774 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1775 char *path
, char *name
, char **fileTypes
);
1777 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1779 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1782 /* ...................................................................... */
1784 /* only 1 instance per WMScreen */
1785 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1787 void WMShowFontPanel(WMFontPanel
*panel
);
1789 void WMHideFontPanel(WMFontPanel
*panel
);
1791 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1793 /* you can free the returned string */
1794 char* WMGetFontPanelFontName(WMFontPanel
*panel
);
1796 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1800 #endif /* __cplusplus */