7 #include <WINGs/WUtil.h>
10 #define WINGS_H_VERSION 20010117
15 #endif /* __cplusplus */
21 typedef unsigned long WMPixel
;
40 /* WMRange was moved in WUtil.h */
42 #define ClientMessageMask (1L<<30)
45 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
46 #define _DEFINED_GNUSTEP_WINDOW_INFO
48 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
49 * NSDesktopWindowLevel intended to be the level at which things
50 * on the desktop sit ... so you should be able
51 * to put a desktop background just below it.
53 * Applications are actually permitted to use any value in the
54 * range INT_MIN+1 to INT_MAX
57 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
58 WMNormalWindowLevel
= 0,
59 WMFloatingWindowLevel
= 3,
60 WMSubmenuWindowLevel
= 3,
61 WMTornOffMenuWindowLevel
= 3,
62 WMMainMenuWindowLevel
= 20,
63 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
64 WMStatusWindowLevel
= 21,
65 WMModalPanelWindowLevel
= 100,
66 WMPopUpMenuWindowLevel
= 101,
67 WMScreenSaverWindowLevel
= 1000
71 /* window attributes */
73 WMBorderlessWindowMask
= 0,
74 WMTitledWindowMask
= 1,
75 WMClosableWindowMask
= 2,
76 WMMiniaturizableWindowMask
= 4,
77 WMResizableWindowMask
= 8,
78 WMIconWindowMask
= 64,
79 WMMiniWindowMask
= 128
86 /* 0 is reserved for internal use */
92 WBTMomentaryChange
= 6,
97 /* button behaviour masks */
99 WBBSpringLoadedMask
= (1 << 0),
100 WBBPushInMask
= (1 << 1),
101 WBBPushChangeMask
= (1 << 2),
102 WBBPushLightMask
= (1 << 3),
103 WBBStateLightMask
= (1 << 5),
104 WBBStateChangeMask
= (1 << 6),
105 WBBStatePushMask
= (1 << 7)
109 /* frame title positions */
133 /* alignment types */
138 WAJustified
/* not valid for textfields */
154 /* scroller arrow position */
159 } WMScrollArrowPosition
;
174 /* usable scroller parts */
179 } WMUsableScrollerParts
;
191 WTTopTabsBevelBorder
,
198 /* text movement types */
200 WMIllegalTextMovement
,
201 WMReturnTextMovement
,
202 WMEscapeTextMovement
,
204 WMBacktabTextMovement
,
211 /* text field special events */
219 WLNotFound
= -1 /* element was not found in WMList */
223 /* drag operations */
231 } WMDragOperationType
;
235 WMGrayModeColorPanel
= 1,
236 WMRGBModeColorPanel
= 2,
237 WMCMYKModeColorPanel
= 3,
238 WMHSBModeColorPanel
= 4,
239 WMCustomPaletteModeColorPanel
= 5,
240 WMColorListModeColorPanel
= 6,
241 WMWheelModeColorPanel
= 7
247 #define WSIReturnArrow 1
248 #define WSIHighlightedReturnArrow 2
249 #define WSIScrollerDimple 3
250 #define WSIArrowLeft 4
251 #define WSIHighlightedArrowLeft 5
252 #define WSIArrowRight 6
253 #define WSIHighlightedArrowRight 7
255 #define WSIHighlightedArrowUp 9
256 #define WSIArrowDown 10
257 #define WSIHighlightedArrowDown 11
258 #define WSICheckMark 12
261 WLDSSelected
= (1 << 16),
262 WLDSDisabled
= (1 << 17),
263 WLDSFocused
= (1 << 18),
264 WLDSIsBranch
= (1 << 19)
267 /* alert panel return values */
277 /* types of input observers */
279 WIReadMask
= (1 << 0),
280 WIWriteMask
= (1 << 1),
281 WIExceptMask
= (1 << 2)
301 WC_Matrix
= 12, /* not ready */
304 WC_ProgressIndicator
= 15,
311 /* All widgets must start with the following structure
312 * in that order. Used for typecasting to get some generic data */
313 typedef struct W_WidgetType
{
320 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
321 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
326 typedef void WMWidget
;
328 typedef struct W_Pixmap WMPixmap
;
329 typedef struct W_Font WMFont
;
330 typedef struct W_Color WMColor
;
332 typedef struct W_Screen WMScreen
;
334 typedef struct W_View WMView
;
336 typedef struct W_Window WMWindow
;
337 typedef struct W_Frame WMFrame
;
338 typedef struct W_Button WMButton
;
339 typedef struct W_Label WMLabel
;
340 typedef struct W_TextField WMTextField
;
341 typedef struct W_Scroller WMScroller
;
342 typedef struct W_ScrollView WMScrollView
;
343 typedef struct W_List WMList
;
344 typedef struct W_Browser WMBrowser
;
345 typedef struct W_PopUpButton WMPopUpButton
;
346 typedef struct W_ProgressIndicator WMProgressIndicator
;
347 typedef struct W_ColorWell WMColorWell
;
348 typedef struct W_Slider WMSlider
;
349 typedef struct W_Matrix WMMatrix
; /* not ready */
350 typedef struct W_SplitView WMSplitView
;
351 typedef struct W_TabView WMTabView
;
352 typedef struct W_Ruler WMRuler
;
353 typedef struct W_Text WMText
;
354 typedef struct W_Box WMBox
;
358 typedef struct W_TabViewItem WMTabViewItem
;
359 typedef struct W_MenuItem WMMenuItem
;
362 typedef struct W_FilePanel WMFilePanel
;
363 typedef WMFilePanel WMOpenPanel
;
364 typedef WMFilePanel WMSavePanel
;
366 typedef struct W_FontPanel WMFontPanel
;
368 typedef struct W_ColorPanel WMColorPanel
;
371 /* item for WMList */
372 typedef struct WMListItem
{
374 void *clientData
; /* ptr for user clientdata. */
376 unsigned int uflags
:16; /* flags for the user */
377 unsigned int selected
:1;
378 unsigned int disabled
:1;
379 unsigned int isBranch
:1;
380 unsigned int loaded
:1;
383 /* struct for message panel */
384 typedef struct WMAlertPanel
{
385 WMWindow
*win
; /* window */
387 WMButton
*defBtn
; /* default button */
388 WMButton
*altBtn
; /* alternative button */
389 WMButton
*othBtn
; /* other button */
390 WMLabel
*iLbl
; /* icon label */
391 WMLabel
*tLbl
; /* title label */
392 WMLabel
*mLbl
; /* message label */
393 WMFrame
*line
; /* separator */
394 short result
; /* button that was pushed */
398 typedef struct WMGenericPanel
{
419 typedef struct WMInputPanel
{
420 WMWindow
*win
; /* window */
421 WMButton
*defBtn
; /* default button */
422 WMButton
*altBtn
; /* alternative button */
423 WMLabel
*tLbl
; /* title label */
424 WMLabel
*mLbl
; /* message label */
425 WMTextField
*text
; /* text field */
426 short result
; /* button that was pushed */
432 WMArray
*tabs
; /* a growable array of tabstops */
433 unsigned short left
; /* left margin marker */
434 unsigned short right
; /* right margin marker */
435 unsigned short first
; /* indentation marker for first line only */
436 unsigned short body
; /* body indentation marker */
437 unsigned short retainCount
;
439 /* All indentation and tab markers are _relative_ to the left margin marker */
442 typedef void *WMHandlerID
;
444 typedef void WMInputProc(int fd
, int mask
, void *clientData
);
446 typedef void WMEventProc(XEvent
*event
, void *clientData
);
448 typedef void WMEventHook(XEvent
*event
);
450 /* self is set to the widget from where the callback is being called and
451 * clientData to the data set to with WMSetClientData() */
452 typedef void WMAction(WMWidget
*self
, void *clientData
);
454 /* same as WMAction, but for stuff that arent widgets */
455 typedef void WMAction2(void *self
, void *clientData
);
458 typedef void WMCallback(void *data
);
460 typedef void WMDropDataCallback(WMView
*view
, WMData
*data
);
462 /* delegate method like stuff */
463 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
464 int state
, WMRect
*rect
);
467 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
468 unsigned int oldWidth,
469 unsigned int oldHeight);
472 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
473 int *minSize
, int *maxSize
);
475 typedef WMWidget
*WMMatrixCreateCellProc(WMMatrix
*mPtr
);
480 typedef struct WMBrowserDelegate
{
483 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
484 WMBrowser
*sender
, int column
, WMList
*list
);
486 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
489 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
491 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
495 typedef struct WMTextFieldDelegate
{
498 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
499 WMNotification
*notif
);
501 void (*didChange
)(struct WMTextFieldDelegate
*self
,
502 WMNotification
*notif
);
504 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
505 WMNotification
*notif
);
507 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
510 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
512 } WMTextFieldDelegate
;
515 typedef struct WMTextDelegate
{
518 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
525 typedef struct WMTabViewDelegate
{
528 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
531 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
532 WMTabViewItem
*item
);
534 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
535 WMTabViewItem
*item
);
537 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
538 WMTabViewItem
*item
);
544 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
545 Time timestamp
, void *cdata
, WMData
*data
);
548 typedef struct WMSelectionProcs
{
549 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
550 void *cdata
, Atom
*type
);
551 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
552 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
557 typedef struct W_DraggingInfo WMDraggingInfo
;
560 typedef struct W_DragSourceProcs
{
561 unsigned (*draggingSourceOperation
)(WMView
*self
, Bool local
);
562 void (*beganDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
);
563 void (*endedDragImage
)(WMView
*self
, WMPixmap
*image
, WMPoint point
,
565 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
566 /* Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
571 typedef struct W_DragDestinationProcs
{
572 unsigned (*draggingEntered
)(WMView
*self
, WMDraggingInfo
*info
);
573 unsigned (*draggingUpdated
)(WMView
*self
, WMDraggingInfo
*info
);
574 void (*draggingExited
)(WMView
*self
, WMDraggingInfo
*info
);
575 Bool (*prepareForDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
576 Bool (*performDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
577 void (*concludeDragOperation
)(WMView
*self
, WMDraggingInfo
*info
);
578 } WMDragDestinationProcs
;
582 /* ...................................................................... */
585 WMRange
wmkrange(int start
, int count
);
587 WMPoint
wmkpoint(int x
, int y
);
589 WMSize
wmksize(unsigned int width
, unsigned int height
);
592 /* ....................................................................... */
596 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
598 void WMSetResourcePath(char *path
);
600 /* don't free the returned string */
601 char *WMGetApplicationName();
603 /* Try to locate resource file. ext may be NULL */
604 char *WMPathForResourceOfType(char *resource
, char *ext
);
607 WMScreen
*WMOpenScreen(const char *display
);
609 WMScreen
*WMCreateScreenWithRContext(Display
*display
, int screen
,
612 WMScreen
*WMCreateScreen(Display
*display
, int screen
);
614 WMScreen
*WMCreateSimpleApplicationScreen(Display
*display
);
616 void WMScreenMainLoop(WMScreen
*scr
);
618 void WMBreakModalLoop(WMScreen
*scr
);
620 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
622 RContext
*WMScreenRContext(WMScreen
*scr
);
624 Display
*WMScreenDisplay(WMScreen
*scr
);
626 int WMScreenDepth(WMScreen
*scr
);
630 void WMSetApplicationIconImage(WMScreen
*app
, WMPixmap
*icon
);
632 WMPixmap
*WMGetApplicationIconImage(WMScreen
*app
);
634 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
636 void WMSetFocusToWidget(WMWidget
*widget
);
638 WMEventHook
*WMHookEventHandler(WMEventHook
*handler
);
640 int WMHandleEvent(XEvent
*event
);
642 Bool
WMScreenPending(WMScreen
*scr
);
644 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
645 WMEventProc
*eventProc
, void *clientData
);
647 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
648 WMEventProc
*eventProc
, void *clientData
);
650 int WMIsDoubleClick(XEvent
*event
);
652 int WMIsTripleClick(XEvent
*event
);
654 void WMNextEvent(Display
*dpy
, XEvent
*event
);
656 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
658 WMHandlerID
WMAddTimerHandler(int milliseconds
, WMCallback
*callback
,
661 WMHandlerID
WMAddPersistentTimerHandler(int milliseconds
, WMCallback
*callback
,
664 void WMDeleteTimerWithClientData(void *cdata
);
666 void WMDeleteTimerHandler(WMHandlerID handlerID
);
668 WMHandlerID
WMAddIdleHandler(WMCallback
*callback
, void *cdata
);
670 void WMDeleteIdleHandler(WMHandlerID handlerID
);
672 WMHandlerID
WMAddInputHandler(int fd
, int condition
, WMInputProc
*proc
,
675 void WMDeleteInputHandler(WMHandlerID handlerID
);
679 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
680 WMSelectionProcs
*procs
, void *cdata
);
682 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
684 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
685 Time timestamp
, WMSelectionCallback
*callback
,
689 /* ....................................................................... */
691 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
693 void WMDragImageFromView(WMView
*view
, WMPixmap
*image
, char *dataTypes
[],
694 WMPoint atLocation
, WMSize mouseOffset
, XEvent
*event
,
697 void WMRegisterViewForDraggedTypes(WMView
*view
, char *acceptedTypes
[]);
699 void WMUnregisterViewDraggedTypes(WMView
*view
);
701 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
704 WMPoint
WMGetDraggingInfoImageLocation(WMDraggingInfo
*info
);
706 /* ....................................................................... */
708 WMFont
*WMCreateFontSet(WMScreen
*scrPtr
, char *fontName
);
710 WMFont
*WMCreateNormalFont(WMScreen
*scrPtr
, char *fontName
);
712 WMFont
*WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
714 WMFont
*WMRetainFont(WMFont
*font
);
716 void WMReleaseFont(WMFont
*font
);
718 unsigned int WMFontHeight(WMFont
*font
);
721 WMFont *WMUserFontOfSize(WMScreen *scrPtr, int size);
723 WMFont *WMUserFixedPitchFontOfSize(WMScreen *scrPtr, int size);
727 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
729 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
731 WMFont
*WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
733 WMFont
*WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
735 XFontSet
WMGetFontFontSet(WMFont
*font
);
737 WMFont
*WMNormalizeFont(WMScreen
*scr
, WMFont
*font
);
739 WMFont
*WMStrengthenFont(WMScreen
*scr
, WMFont
*font
);
741 WMFont
*WMUnstrengthenFont(WMScreen
*scr
, WMFont
*font
);
743 WMFont
*WMEmphasizeFont(WMScreen
*scr
, WMFont
*font
);
745 WMFont
*WMUnemphasizeFont(WMScreen
*scr
, WMFont
*font
);
747 WMFont
*WMGetFontOfSize(WMScreen
*scr
, WMFont
*font
, int size
);
749 /* ....................................................................... */
751 WMPixmap
*WMRetainPixmap(WMPixmap
*pixmap
);
753 void WMReleasePixmap(WMPixmap
*pixmap
);
755 WMPixmap
*WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
758 WMPixmap
*WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
759 Pixmap mask
, int width
, int height
,
762 WMPixmap
*WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
765 WMPixmap
*WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
767 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
769 WMPixmap
*WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
771 WMPixmap
*WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
774 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
776 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
778 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
780 WMPixmap
*WMGetSystemPixmap(WMScreen
*scr
, int image
);
782 /* ....................................................................... */
785 WMColor
*WMDarkGrayColor(WMScreen
*scr
);
787 WMColor
*WMGrayColor(WMScreen
*scr
);
789 WMColor
*WMBlackColor(WMScreen
*scr
);
791 WMColor
*WMWhiteColor(WMScreen
*scr
);
793 void WMSetColorInGC(WMColor
*color
, GC gc
);
795 GC
WMColorGC(WMColor
*color
);
797 WMPixel
WMColorPixel(WMColor
*color
);
799 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
800 unsigned int width
, unsigned int height
);
802 void WMReleaseColor(WMColor
*color
);
804 WMColor
*WMRetainColor(WMColor
*color
);
806 WMColor
*WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
807 unsigned short green
, unsigned short blue
,
810 WMColor
*WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
812 unsigned short WMRedComponentOfColor(WMColor
*color
);
814 unsigned short WMGreenComponentOfColor(WMColor
*color
);
816 unsigned short WMBlueComponentOfColor(WMColor
*color
);
818 char *WMGetColorRGBDescription(WMColor
*color
);
820 /* ....................................................................... */
823 void WMDrawString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
824 int y
, char *text
, int length
);
826 void WMDrawImageString(WMScreen
*scr
, Drawable d
, GC gc
, WMFont
*font
, int x
,
827 int y
, char *text
, int length
);
829 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
833 /* ....................................................................... */
835 WMScreen
*WMWidgetScreen(WMWidget
*w
);
837 unsigned int WMScreenWidth(WMScreen
*scr
);
839 unsigned int WMScreenHeight(WMScreen
*scr
);
841 void WMUnmapWidget(WMWidget
*w
);
843 void WMMapWidget(WMWidget
*w
);
845 Bool
WMWidgetIsMapped(WMWidget
*w
);
847 void WMRaiseWidget(WMWidget
*w
);
849 void WMLowerWidget(WMWidget
*w
);
851 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
853 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
855 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
857 void WMMapSubwidgets(WMWidget
*w
);
859 void WMUnmapSubwidgets(WMWidget
*w
);
861 void WMRealizeWidget(WMWidget
*w
);
863 void WMDestroyWidget(WMWidget
*widget
);
865 void WMHangData(WMWidget
*widget
, void *data
);
867 void *WMGetHangedData(WMWidget
*widget
);
869 unsigned int WMWidgetWidth(WMWidget
*w
);
871 unsigned int WMWidgetHeight(WMWidget
*w
);
873 Window
WMWidgetXID(WMWidget
*w
);
875 Window
WMViewXID(WMView
*view
);
877 void WMRedisplayWidget(WMWidget
*w
);
879 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
881 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
882 int rightOffs
, int bottomOffs
);
884 WMSize
WMGetViewSize(WMView
*view
);
886 WMPoint
WMGetViewPosition(WMView
*view
);
888 WMPoint
WMGetViewScreenPosition(WMView
*view
);
890 WMWidget
*WMWidgetOfView(WMView
*view
);
892 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
894 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
897 extern char *WMViewSizeDidChangeNotification
;
899 extern char *WMViewRealizedNotification
;
901 extern char *WMFontPanelDidChangeNotification
;
904 /* ....................................................................... */
906 void WMSetBalloonTextForView(char *text
, WMView
*view
);
908 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
910 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
912 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
914 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
916 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
919 /* ....................................................................... */
921 WMWindow
*WMCreateWindow(WMScreen
*screen
, char *name
);
923 WMWindow
*WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
925 WMWindow
*WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
928 WMWindow
*WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
930 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
932 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
934 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
936 void WMSetWindowMiniwindowImage(WMWindow
*win
, WMPixmap
*pixmap
);
938 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
940 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
942 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
944 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
947 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
949 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
951 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
953 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
955 void WMSetWindowLevel(WMWindow
*win
, int level
);
957 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
959 void WMCloseWindow(WMWindow
*win
);
961 /* ....................................................................... */
963 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
965 #define WMCreateCommandButton(parent) \
966 WMCreateCustomButton((parent), WBBSpringLoadedMask\
971 #define WMCreateRadioButton(parent) \
972 WMCreateButton((parent), WBTRadio)
974 #define WMCreateSwitchButton(parent) \
975 WMCreateButton((parent), WBTSwitch)
977 WMButton
*WMCreateButton(WMWidget
*parent
, WMButtonType type
);
979 WMButton
*WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
981 void WMSetButtonImageDefault(WMButton
*bPtr
);
983 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
985 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
987 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
989 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
991 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
993 void WMSetButtonText(WMButton
*bPtr
, char *text
);
995 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
997 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
999 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1001 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1003 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1005 int WMGetButtonSelected(WMButton
*bPtr
);
1007 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1009 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1011 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1013 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1015 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1017 void WMPerformButtonClick(WMButton
*bPtr
);
1019 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1021 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1023 /* ....................................................................... */
1025 WMLabel
*WMCreateLabel(WMWidget
*parent
);
1027 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1029 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1031 WMPixmap
*WMGetLabelImage(WMLabel
*lPtr
);
1033 char *WMGetLabelText(WMLabel
*lPtr
);
1035 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1037 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1039 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1041 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1043 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1045 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1047 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1049 /* ....................................................................... */
1051 WMFrame
*WMCreateFrame(WMWidget
*parent
);
1053 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1055 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1057 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1059 /* ....................................................................... */
1061 WMTextField
*WMCreateTextField(WMWidget
*parent
);
1063 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1065 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1067 /* you can free the returned string */
1068 char *WMGetTextFieldText(WMTextField
*tPtr
);
1070 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1072 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1074 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1076 WMFont
*WMGetTextFieldFont(WMTextField
*tPtr
);
1078 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1080 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1082 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1084 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1086 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1088 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1090 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1092 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1094 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1096 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1099 extern char *WMTextDidChangeNotification
;
1100 extern char *WMTextDidBeginEditingNotification
;
1101 extern char *WMTextDidEndEditingNotification
;
1103 /* ....................................................................... */
1105 WMScroller
*WMCreateScroller(WMWidget
*parent
);
1107 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1108 float knobProportion
);
1110 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1112 float WMGetScrollerValue(WMScroller
*sPtr
);
1114 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1116 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1118 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1119 WMScrollArrowPosition position
);
1121 extern char *WMScrollerDidScrollNotification
;
1123 /* ....................................................................... */
1125 WMList
*WMCreateList(WMWidget
*parent
);
1127 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1129 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1131 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1133 WMListItem
*WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1135 void WMSortListItems(WMList
*lPtr
);
1137 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1139 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1141 WMListItem
*WMGetListItem(WMList
*lPtr
, int row
);
1143 WMArray
*WMGetListItems(WMList
*lPtr
);
1145 void WMRemoveListItem(WMList
*lPtr
, int row
);
1147 void WMSelectListItem(WMList
*lPtr
, int row
);
1149 void WMUnselectListItem(WMList
*lPtr
, int row
);
1151 /* This will select all items in range, and deselect all the others */
1152 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1154 /* This will select all items in range, leaving the others as they are */
1155 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1157 void WMSelectAllListItems(WMList
*lPtr
);
1159 void WMUnselectAllListItems(WMList
*lPtr
);
1161 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1163 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1165 int WMGetListItemHeight(WMList
*lPtr
);
1167 /* don't free the returned data */
1168 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1171 * For the following 2 functions, in case WMList allows multiple selection,
1172 * the first item in the list of selected items, respective its row number,
1176 /* don't free the returned data */
1177 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1179 int WMGetListSelectedItemRow(WMList
*lPtr
);
1181 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1183 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1185 void WMClearList(WMList
*lPtr
);
1187 int WMGetListNumberOfRows(WMList
*lPtr
);
1189 void WMSetListPosition(WMList
*lPtr
, int row
);
1191 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1193 int WMGetListPosition(WMList
*lPtr
);
1195 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1197 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1200 extern char *WMListDidScrollNotification
;
1201 extern char *WMListSelectionDidChangeNotification
;
1203 /* ....................................................................... */
1205 WMBrowser
*WMCreateBrowser(WMWidget
*parent
);
1207 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1209 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1211 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1213 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1215 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1217 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1219 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1221 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1223 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1225 WMListItem
*WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1227 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1229 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1230 WMCompareDataProc
*func
);
1232 /* Don't free the returned string. */
1233 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1235 /* free the returned string */
1236 char *WMGetBrowserPath(WMBrowser
*bPtr
);
1238 /* free the returned string */
1239 char *WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1241 /* free the returned array */
1242 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1244 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1246 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1249 WMListItem
*WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1251 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1253 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1255 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1257 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1259 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1261 WMList
*WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1263 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1265 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1267 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1269 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1271 /* ....................................................................... */
1274 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1276 WMMenuItem
*WMCreateMenuItem(void);
1278 void WMDestroyMenuItem(WMMenuItem
*item
);
1280 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1282 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1284 char *WMGetMenuItemShortcut(WMMenuItem
*item
);
1286 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1288 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1290 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1292 void *WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1294 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1296 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1298 WMAction
*WMGetMenuItemAction(WMMenuItem
*item
);
1300 void *WMGetMenuItemData(WMMenuItem
*item
);
1302 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1304 char *WMGetMenuItemTitle(WMMenuItem
*item
);
1306 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1308 int WMGetMenuItemState(WMMenuItem
*item
);
1310 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1312 WMPixmap
*WMGetMenuItemPixmap(WMMenuItem
*item
);
1314 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1316 WMPixmap
*WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1318 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1320 WMPixmap
*WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1322 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1324 WMPixmap
*WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1326 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1329 WMMenu *WMGetMenuItemSubmenu(WMMenuItem *item);
1331 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1334 /* ....................................................................... */
1336 WMPopUpButton
*WMCreatePopUpButton(WMWidget
*parent
);
1338 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1341 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1343 WMMenuItem
*WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1345 WMMenuItem
*WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1348 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1350 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1352 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1354 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1356 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1358 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1360 /* don't free the returned data */
1361 char *WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1363 WMMenuItem
*WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1366 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1368 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1370 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1372 /* ....................................................................... */
1374 WMProgressIndicator
*WMCreateProgressIndicator(WMWidget
*parent
);
1376 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1378 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1380 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1382 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1384 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1386 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1389 /* ....................................................................... */
1391 WMColorPanel
*WMGetColorPanel(WMScreen
*scrPtr
);
1393 void WMFreeColorPanel(WMColorPanel
*panel
);
1395 void WMShowColorPanel(WMColorPanel
*panel
);
1397 void WMCloseColorPanel(WMColorPanel
*panel
);
1399 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1401 WMColor
*WMGetColorPanelColor(WMColorPanel
*panel
);
1403 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1405 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1407 extern char *WMColorPanelColorChangedNotification
;
1409 /* ....................................................................... */
1411 WMColorWell
*WMCreateColorWell(WMWidget
*parent
);
1413 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1415 WMColor
*WMGetColorWellColor(WMColorWell
*cPtr
);
1417 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1420 extern char *WMColorWellDidChangeNotification
;
1423 /* ...................................................................... */
1425 WMScrollView
*WMCreateScrollView(WMWidget
*parent
);
1427 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1428 unsigned int height
);
1430 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1432 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1434 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1436 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1438 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1440 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1442 WMScroller
*WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1444 WMScroller
*WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1446 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1448 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1450 /* ....................................................................... */
1452 WMSlider
*WMCreateSlider(WMWidget
*parent
);
1454 int WMGetSliderMinValue(WMSlider
*slider
);
1456 int WMGetSliderMaxValue(WMSlider
*slider
);
1458 int WMGetSliderValue(WMSlider
*slider
);
1460 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1462 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1464 void WMSetSliderValue(WMSlider
*slider
, int value
);
1466 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1468 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1470 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1472 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1474 /* ....................................................................... */
1477 WMSplitView
*WMCreateSplitView(WMWidget
*parent
);
1478 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1479 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1481 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1483 WMView
*WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1485 /* remove the first subview == view */
1486 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1488 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1491 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1493 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1495 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1496 WMSplitViewConstrainProc
*proc
);
1499 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1500 WMSplitViewResizeSubviewsProc *proc);
1503 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1505 /* ...................................................................... */
1507 WMRuler
*WMCreateRuler (WMWidget
*parent
);
1509 WMRulerMargins
*WMGetRulerMargins(WMRuler
*rPtr
);
1511 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1513 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
,
1514 WMRulerMargins
*anotherMargin
);
1516 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1518 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1520 int WMGetRulerOffset(WMRuler
*rPtr
);
1522 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1524 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1526 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1528 /* ....................................................................... */
1531 #define WMCreateText(parent) WMCreateTextForDocumentType \
1532 ((parent), (NULL), (NULL))
1534 WMText
*WMCreateTextForDocumentType(WMWidget
*parent
,
1535 WMAction
*parser
, WMAction
*writer
);
1537 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1539 void WMFreezeText(WMText
*tPtr
);
1541 #define WMRefreshText(tPtr) WMThawText((tPtr))
1543 void WMThawText(WMText
*tPtr
);
1545 int WMScrollText(WMText
*tPtr
, int amount
);
1547 int WMPageText(WMText
*tPtr
, Bool direction
);
1549 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1551 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1553 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1555 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1557 int WMGetTextRulerShown(WMText
*tPtr
);
1559 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1561 int WMGetTextEditable(WMText
*tPtr
);
1563 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1565 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1567 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1569 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1571 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1573 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1575 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1577 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1579 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1581 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1583 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1585 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1587 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1589 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1591 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1593 #define WMClearText(tPtr) WMAppendTextStream \
1597 char * WMGetTextStream(WMText
*tPtr
);
1600 char * WMGetTextSelectedStream(WMText
*tPtr
);
1602 /* destroy the array */
1603 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1605 /* destroy the array */
1606 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1608 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1610 WMColor
*WMGetTextSelectionColor(WMText
*tPtr
);
1612 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1614 WMFont
*WMGetTextSelectionFont(WMText
*tPtr
);
1616 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1618 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1620 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1622 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1623 Bool caseSensitive
);
1625 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1628 /* parser related stuff... use only if implementing a new parser */
1630 void *WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1631 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1633 void *WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1634 WMColor
*color
, unsigned short first
, unsigned short extraInfo
);
1636 void *WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1637 WMColor
*color
, unsigned short first
, unsigned short length
);
1639 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1640 unsigned int kanji
, unsigned int underlined
, int script
,
1641 WMRulerMargins
*margins
);
1643 /* do NOT free the margins */
1644 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1645 unsigned int *kanji
, unsigned int *underlined
, int *script
,
1646 WMRulerMargins
*margins
);
1648 int WMGetTextInsertType(WMText
*tPtr
);
1650 int WMGetTextBlocks(WMText
*tPtr
);
1652 void WMSetCurrentTextBlock(WMText
*tPtr
, int current
);
1654 int WMGetCurrentTextBlock(WMText
*tPtr
);
1656 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1658 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1660 void *WMRemoveTextBlock(WMText
*tPtr
);
1662 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1664 /* ....................................................................... */
1667 WMTabView
*WMCreateTabView(WMWidget
*parent
);
1669 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1671 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1673 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1675 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1677 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1679 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1681 WMTabViewItem
*WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1682 int identifier
, char *label
);
1684 WMTabViewItem
*WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1686 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1688 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1690 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1692 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1694 WMTabViewItem
*WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1696 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1698 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1700 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1703 WMTabViewItem
*WMCreateTabViewItemWithIdentifier(int identifier
);
1705 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1707 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1709 char *WMGetTabViewItemLabel(WMTabViewItem
*item
);
1711 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1713 WMView
*WMGetTabViewItemView(WMTabViewItem
*item
);
1715 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1718 /* ....................................................................... */
1720 WMBox
*WMCreateBox(WMWidget
*parent
);
1722 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1724 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1725 int minSize
, int maxSize
, int space
);
1727 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1728 int minSize
, int maxSize
, int space
);
1730 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1732 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1734 /* ....................................................................... */
1736 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1737 char *defaultButton
, char *alternateButton
,
1740 /* you can free the returned string */
1741 char *WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1742 char *defaultText
, char *okButton
, char *cancelButton
);
1744 WMAlertPanel
*WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1745 char *msg
, char *defaultButton
,
1746 char *alternateButton
, char *otherButton
);
1748 WMInputPanel
*WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1749 char *msg
, char *defaultText
, char *okButton
,
1750 char *cancelButton
);
1753 WMGenericPanel
*WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1754 char *title
, char *defaultButton
,
1755 char *alternateButton
);
1757 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1759 void WMDestroyInputPanel(WMInputPanel
*panel
);
1761 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1763 /* ....................................................................... */
1765 /* only 1 instance per WMScreen */
1766 WMOpenPanel
*WMGetOpenPanel(WMScreen
*scrPtr
);
1768 WMSavePanel
*WMGetSavePanel(WMScreen
*scrPtr
);
1770 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1772 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1774 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1776 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1778 /* you can free the returned string */
1779 char *WMGetFilePanelFileName(WMFilePanel
*panel
);
1781 void WMFreeFilePanel(WMFilePanel
*panel
);
1783 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1784 char *path
, char *name
, char **fileTypes
);
1786 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1788 WMView
*WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1791 /* ...................................................................... */
1793 /* only 1 instance per WMScreen */
1794 WMFontPanel
*WMGetFontPanel(WMScreen
*scr
);
1796 void WMShowFontPanel(WMFontPanel
*panel
);
1798 void WMHideFontPanel(WMFontPanel
*panel
);
1800 void WMSetFontPanelFont(WMFontPanel
*panel
, WMFont
*font
);
1802 /* you can free the returned string */
1803 char *WMGetFontPanelFontName(WMFontPanel
*panel
);
1805 WMFont
*WMGetFontPanelFont(WMFontPanel
*panel
);
1809 #endif /* __cplusplus */