7 #include <WINGs/WUtil.h>
10 #define WINGS_H_VERSION 20041030
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 */
389 WMButton
*defBtn
; /* default button */
390 WMButton
*altBtn
; /* alternative button */
391 WMButton
*othBtn
; /* other button */
392 WMLabel
*iLbl
; /* icon label */
393 WMLabel
*tLbl
; /* title label */
394 WMLabel
*mLbl
; /* message label */
395 WMFrame
*line
; /* separator */
396 short result
; /* button that was pushed */
400 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 */
430 /* Basic font styles. Used to easily get one style from another */
431 typedef enum WMFontStyle
{
441 WMArray
*tabs
; /* a growable array of tabstops */
442 unsigned short left
; /* left margin marker */
443 unsigned short right
; /* right margin marker */
444 unsigned short first
; /* indentation marker for first line only */
445 unsigned short body
; /* body indentation marker */
446 unsigned short retainCount
;
448 /* All indentation and tab markers are _relative_ to the left margin marker */
451 typedef void WMEventProc(XEvent
*event
, void *clientData
);
453 typedef void WMEventHook(XEvent
*event
);
455 /* self is set to the widget from where the callback is being called and
456 * clientData to the data set to with WMSetClientData() */
457 typedef void WMAction(WMWidget
*self
, void *clientData
);
459 /* same as WMAction, but for stuff that arent widgets */
460 typedef void WMAction2(void *self
, void *clientData
);
463 /* delegate method like stuff */
464 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
465 int state
, WMRect
*rect
);
469 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
470 unsigned int oldWidth,
471 unsigned int oldHeight);
474 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
475 int *minSize
, int *maxSize
);
477 typedef WMWidget
* WMMatrixCreateCellProc(WMMatrix
*mPtr
);
482 typedef struct WMBrowserDelegate
{
485 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
486 WMBrowser
*sender
, int column
, WMList
*list
);
488 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
491 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
493 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
497 typedef struct WMTextFieldDelegate
{
500 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
501 WMNotification
*notif
);
503 void (*didChange
)(struct WMTextFieldDelegate
*self
,
504 WMNotification
*notif
);
506 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
507 WMNotification
*notif
);
509 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
512 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
514 } WMTextFieldDelegate
;
517 typedef struct WMTextDelegate
{
520 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
527 typedef struct WMTabViewDelegate
{
530 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
533 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
534 WMTabViewItem
*item
);
536 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
537 WMTabViewItem
*item
);
539 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
540 WMTabViewItem
*item
);
546 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
547 Time timestamp
, void *cdata
, WMData
*data
);
550 typedef struct WMSelectionProcs
{
551 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
552 void *cdata
, Atom
*type
);
553 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
554 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
559 typedef struct W_DraggingInfo WMDraggingInfo
;
562 /* links a label to a dnd operation. */
563 typedef struct W_DragOperationtItem WMDragOperationItem
;
566 typedef struct W_DragSourceProcs
{
567 WMArray
* (*dropDataTypes
)(WMView
*self
);
568 WMDragOperationType (*wantedDropOperation
)(WMView
*self
);
569 WMArray
* (*askedOperations
)(WMView
*self
);
570 Bool (*acceptDropOperation
)(WMView
*self
, WMDragOperationType operation
);
571 void (*beganDrag
)(WMView
*self
, WMPoint
*point
);
572 void (*endedDrag
)(WMView
*self
, WMPoint
*point
, Bool deposited
);
573 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
574 /*Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
579 typedef struct W_DragDestinationProcs
{
580 void (*prepareForDragOperation
)(WMView
*self
);
581 WMArray
* (*requiredDataTypes
)(WMView
*self
, WMDragOperationType request
,
582 WMArray
*sourceDataTypes
);
583 WMDragOperationType (*allowedOperation
)(WMView
*self
,
584 WMDragOperationType request
,
585 WMArray
*sourceDataTypes
);
586 Bool (*inspectDropData
)(WMView
*self
, WMArray
*dropData
);
587 void (*performDragOperation
)(WMView
*self
, WMArray
*dropData
,
588 WMArray
*operations
, WMPoint
*dropLocation
);
589 void (*concludeDragOperation
)(WMView
*self
);
590 } WMDragDestinationProcs
;
593 /* ---[ WINGs/wmisc.c ]--------------------------------------------------- */
596 WMPoint
wmkpoint(int x
, int y
);
598 WMSize
wmksize(unsigned int width
, unsigned int height
);
600 WMRect
wmkrect(int x
, int y
, unsigned int width
, unsigned int height
);
602 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
603 #define wmksize(width, height) (WMSize){(width), (height)}
604 #define wmkpoint(x, y) (WMPoint){(x), (y)}
607 /* ---[ WINGs/wapplication.c ]-------------------------------------------- */
611 void WMInitializeApplication(char *applicationName
, int *argc
, char **argv
);
613 void WMSetResourcePath(char *path
);
615 /* don't free the returned string */
616 char* WMGetApplicationName(void);
618 /* Try to locate resource file. ext may be NULL */
619 char* WMPathForResourceOfType(char *resource
, char *ext
);
621 /* ---[ WINGs/widgets.c ]------------------------------------------------- */
623 WMScreen
* WMOpenScreen(const char *display
);
625 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
628 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
630 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
632 void WMScreenMainLoop(WMScreen
*scr
);
634 void WMBreakModalLoop(WMScreen
*scr
);
636 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
638 RContext
* WMScreenRContext(WMScreen
*scr
);
640 Display
* WMScreenDisplay(WMScreen
*scr
);
642 int WMScreenDepth(WMScreen
*scr
);
644 void WMSetFocusToWidget(WMWidget
*widget
);
646 /* ---[ WINGs/wappresource.c ]-------------------------------------------- */
648 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
650 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
652 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
654 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
656 /* If color==NULL it will use the default color for panels: ae/aa/ae */
657 WMPixmap
* WMCreateApplicationIconBlendedPixmap(WMScreen
*scr
, RColor
*color
);
659 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
661 /* ---[ WINGs/wevent.c ]-------------------------------------------------- */
663 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
665 int WMHandleEvent(XEvent
*event
);
667 Bool
WMScreenPending(WMScreen
*scr
);
669 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
670 WMEventProc
*eventProc
, void *clientData
);
672 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
673 WMEventProc
*eventProc
, void *clientData
);
675 int WMIsDoubleClick(XEvent
*event
);
677 /*int WMIsTripleClick(XEvent *event);*/
679 void WMNextEvent(Display
*dpy
, XEvent
*event
);
681 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
683 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
685 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
688 /* ---[ WINGs/selection.c ]----------------------------------------------- */
691 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
692 WMSelectionProcs
*procs
, void *cdata
);
694 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
696 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
697 Time timestamp
, WMSelectionCallback
*callback
,
701 extern char *WMSelectionOwnerDidChangeNotification
;
703 /* ---[ WINGs/dragcommon.c ]---------------------------------------------- */
705 WMArray
* WMCreateDragOperationArray(int initialSize
);
707 WMDragOperationItem
* WMCreateDragOperationItem(WMDragOperationType type
,
710 WMDragOperationType
WMGetDragOperationItemType(WMDragOperationItem
* item
);
712 char* WMGetDragOperationItemText(WMDragOperationItem
* item
);
714 /* ---[ WINGs/dragsource.c ]---------------------------------------------- */
716 void WMSetViewDragImage(WMView
* view
, WMPixmap
*dragImage
);
718 void WMReleaseViewDragImage(WMView
* view
);
720 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
722 Bool
WMIsDraggingFromView(WMView
*view
);
724 void WMDragImageFromView(WMView
*view
, XEvent
*event
);
726 /* Create a drag handler, associating drag event masks with dragEventProc */
727 void WMCreateDragHandler(WMView
*view
, WMEventProc
*dragEventProc
, void *clientData
);
729 void WMDeleteDragHandler(WMView
*view
, WMEventProc
*dragEventProc
, void *clientData
);
731 /* set default drag handler for view */
732 void WMSetViewDraggable(WMView
*view
, WMDragSourceProcs
*procs
, WMPixmap
*dragImage
);
734 void WMUnsetViewDraggable(WMView
*view
);
736 /* ---[ WINGs/dragdestination.c ]----------------------------------------- */
738 void WMRegisterViewForDraggedTypes(WMView
*view
, WMArray
*acceptedTypes
);
740 void WMUnregisterViewDraggedTypes(WMView
*view
);
742 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
744 /* ---[ WINGs/wfont.c ]--------------------------------------------------- */
746 Bool
WMIsAntialiasingEnabled(WMScreen
*scrPtr
);
748 WMFont
* WMCreateFont(WMScreen
*scrPtr
, char *fontName
);
750 WMFont
* WMCopyFontWithStyle(WMScreen
*scrPtr
, WMFont
*font
, WMFontStyle style
);
752 WMFont
* WMRetainFont(WMFont
*font
);
754 void WMReleaseFont(WMFont
*font
);
756 char* WMGetFontName(WMFont
*font
);
758 unsigned int WMFontHeight(WMFont
*font
);
760 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
762 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
764 WMFont
* WMDefaultSystemFont(WMScreen
*scrPtr
);
766 WMFont
* WMDefaultBoldSystemFont(WMScreen
*scrPtr
);
768 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
770 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
772 void WMDrawString(WMScreen
*scr
, Drawable d
, WMColor
*color
, WMFont
*font
,
773 int x
, int y
, char *text
, int length
);
775 void WMDrawImageString(WMScreen
*scr
, Drawable d
, WMColor
*color
,
776 WMColor
*background
, WMFont
*font
, int x
, int y
,
777 char *text
, int length
);
779 int WMWidthOfString(WMFont
*font
, char *text
, int length
);
781 /* ---[ WINGs/wpixmap.c ]------------------------------------------------- */
783 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
785 void WMReleasePixmap(WMPixmap
*pixmap
);
787 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
790 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
791 Pixmap mask
, int width
, int height
,
794 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
797 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
799 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
801 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, char *fileName
);
803 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
806 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, char *fileName
,
809 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
811 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
813 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
815 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
817 /* ---[ WINGs/wcolor.c ]-------------------------------------------------- */
820 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
822 WMColor
* WMGrayColor(WMScreen
*scr
);
824 WMColor
* WMBlackColor(WMScreen
*scr
);
826 WMColor
* WMWhiteColor(WMScreen
*scr
);
828 void WMSetColorInGC(WMColor
*color
, GC gc
);
830 GC
WMColorGC(WMColor
*color
);
832 WMPixel
WMColorPixel(WMColor
*color
);
834 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
835 unsigned int width
, unsigned int height
);
837 void WMReleaseColor(WMColor
*color
);
839 WMColor
* WMRetainColor(WMColor
*color
);
841 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
842 unsigned short green
, unsigned short blue
,
845 WMColor
* WMCreateRGBAColor(WMScreen
*scr
, unsigned short red
,
846 unsigned short green
, unsigned short blue
,
847 unsigned short alpha
, Bool exact
);
849 WMColor
* WMCreateNamedColor(WMScreen
*scr
, char *name
, Bool exact
);
851 RColor
WMGetRColorFromColor(WMColor
*color
);
853 void WMSetColorAlpha(WMColor
*color
, unsigned short alpha
);
855 unsigned short WMRedComponentOfColor(WMColor
*color
);
857 unsigned short WMGreenComponentOfColor(WMColor
*color
);
859 unsigned short WMBlueComponentOfColor(WMColor
*color
);
861 unsigned short WMGetColorAlpha(WMColor
*color
);
863 char* WMGetColorRGBDescription(WMColor
*color
);
865 /* ---[ WINGs/widgets.c ]------------------------------------------------- */
867 WMScreen
* WMWidgetScreen(WMWidget
*w
);
869 unsigned int WMScreenWidth(WMScreen
*scr
);
871 unsigned int WMScreenHeight(WMScreen
*scr
);
873 void WMUnmapWidget(WMWidget
*w
);
875 void WMMapWidget(WMWidget
*w
);
877 Bool
WMWidgetIsMapped(WMWidget
*w
);
879 void WMRaiseWidget(WMWidget
*w
);
881 void WMLowerWidget(WMWidget
*w
);
883 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
885 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
887 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
889 WMColor
* WMGetWidgetBackgroundColor(WMWidget
*w
);
891 void WMMapSubwidgets(WMWidget
*w
);
893 void WMUnmapSubwidgets(WMWidget
*w
);
895 void WMRealizeWidget(WMWidget
*w
);
897 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
899 void WMDestroyWidget(WMWidget
*widget
);
901 void WMHangData(WMWidget
*widget
, void *data
);
903 void* WMGetHangedData(WMWidget
*widget
);
905 unsigned int WMWidgetWidth(WMWidget
*w
);
907 unsigned int WMWidgetHeight(WMWidget
*w
);
909 Window
WMWidgetXID(WMWidget
*w
);
911 void WMRedisplayWidget(WMWidget
*w
);
913 /* ---[ WINGs/wview.c ]--------------------------------------------------- */
915 Window
WMViewXID(WMView
*view
);
917 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
919 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
920 int rightOffs
, int bottomOffs
);
922 WMSize
WMGetViewSize(WMView
*view
);
924 WMPoint
WMGetViewPosition(WMView
*view
);
926 WMPoint
WMGetViewScreenPosition(WMView
*view
);
928 WMWidget
* WMWidgetOfView(WMView
*view
);
931 extern char *WMViewSizeDidChangeNotification
;
933 extern char *WMViewFocusDidChangeNotification
;
935 extern char *WMViewRealizedNotification
;
937 /* ---[ WINGs/wballoon.c ]------------------------------------------------ */
939 void WMSetBalloonTextForView(char *text
, WMView
*view
);
941 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
943 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
945 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
947 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
949 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
952 /* ---[ WINGs/wwindow.c ]------------------------------------------------- */
954 WMWindow
* WMCreateWindow(WMScreen
*screen
, char *name
);
956 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, char *name
, int style
);
958 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, char *name
,
961 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, char *name
);
963 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
965 void WMSetWindowTitle(WMWindow
*wPtr
, char *title
);
967 void WMSetWindowMiniwindowTitle(WMWindow
*win
, char *title
);
969 void WMSetWindowMiniwindowImage(WMWindow
*win
, RImage
*image
);
971 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
973 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
975 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
977 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
979 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
982 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
984 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
986 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
988 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
990 void WMSetWindowLevel(WMWindow
*win
, int level
);
992 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
994 void WMCloseWindow(WMWindow
*win
);
996 /* ---[ WINGs/wbutton.c ]------------------------------------------------- */
998 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
1000 #define WMCreateCommandButton(parent) \
1001 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1006 #define WMCreateRadioButton(parent) \
1007 WMCreateButton((parent), WBTRadio)
1009 #define WMCreateSwitchButton(parent) \
1010 WMCreateButton((parent), WBTSwitch)
1012 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
1014 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
1016 void WMSetButtonImageDefault(WMButton
*bPtr
);
1018 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
1020 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
1022 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
1024 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
1026 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
1028 void WMSetButtonText(WMButton
*bPtr
, char *text
);
1030 void WMSetButtonAltText(WMButton
*bPtr
, char *text
);
1032 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
1034 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1036 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1038 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1040 int WMGetButtonSelected(WMButton
*bPtr
);
1042 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1044 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1046 int WMGetButtonEnabled(WMButton
*bPtr
);
1048 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1050 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1052 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1054 void WMPerformButtonClick(WMButton
*bPtr
);
1056 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1058 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1060 /* ---[ WINGs/wlabel.c ]-------------------------------------------------- */
1062 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1064 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1066 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1068 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1070 char* WMGetLabelText(WMLabel
*lPtr
);
1072 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1074 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1076 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1078 void WMSetLabelText(WMLabel
*lPtr
, char *text
);
1080 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1082 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1084 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1086 /* ---[ WINGs/wframe.c ]-------------------------------------------------- */
1088 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1090 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1092 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1094 void WMSetFrameTitle(WMFrame
*fPtr
, char *title
);
1096 /* ---[ WINGs/wtextfield.c ]---------------------------------------------- */
1098 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1100 void WMInsertTextFieldText(WMTextField
*tPtr
, char *text
, int position
);
1102 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1104 /* you can free the returned string */
1105 char* WMGetTextFieldText(WMTextField
*tPtr
);
1107 void WMSetTextFieldText(WMTextField
*tPtr
, char *text
);
1109 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1111 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1113 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1115 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1117 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1119 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1121 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1123 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1125 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1127 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1129 unsigned WMGetTextFieldCursorPosition(WMTextField
*tPtr
);
1131 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1133 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1135 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1137 WMTextFieldDelegate
* WMGetTextFieldDelegate(WMTextField
*tPtr
);
1139 extern char *WMTextDidChangeNotification
;
1140 extern char *WMTextDidBeginEditingNotification
;
1141 extern char *WMTextDidEndEditingNotification
;
1143 /* ---[ WINGs/wscroller.c ]----------------------------------------------- */
1145 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1147 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1148 float knobProportion
);
1150 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1152 float WMGetScrollerValue(WMScroller
*sPtr
);
1154 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1156 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1158 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1159 WMScrollArrowPosition position
);
1161 extern char *WMScrollerDidScrollNotification
;
1163 /* ---[ WINGs/wlist.c ]--------------------------------------------------- */
1165 WMList
* WMCreateList(WMWidget
*parent
);
1167 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1169 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1171 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1173 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, char *text
);
1175 void WMSortListItems(WMList
*lPtr
);
1177 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1179 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, char *title
);
1181 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1183 WMArray
* WMGetListItems(WMList
*lPtr
);
1185 void WMRemoveListItem(WMList
*lPtr
, int row
);
1187 void WMSelectListItem(WMList
*lPtr
, int row
);
1189 void WMUnselectListItem(WMList
*lPtr
, int row
);
1191 /* This will select all items in range, and deselect all the others */
1192 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1194 /* This will select all items in range, leaving the others as they are */
1195 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1197 void WMSelectAllListItems(WMList
*lPtr
);
1199 void WMUnselectAllListItems(WMList
*lPtr
);
1201 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1203 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1205 int WMGetListItemHeight(WMList
*lPtr
);
1207 /* don't free the returned data */
1208 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1211 * For the following 2 functions, in case WMList allows multiple selection,
1212 * the first item in the list of selected items, respective its row number,
1216 /* don't free the returned data */
1217 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1219 int WMGetListSelectedItemRow(WMList
*lPtr
);
1221 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1223 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1225 void WMClearList(WMList
*lPtr
);
1227 int WMGetListNumberOfRows(WMList
*lPtr
);
1229 void WMSetListPosition(WMList
*lPtr
, int row
);
1231 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1233 int WMGetListPosition(WMList
*lPtr
);
1235 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1237 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1240 extern char *WMListDidScrollNotification
;
1241 extern char *WMListSelectionDidChangeNotification
;
1243 /* ---[ WINGs/wbrowser.c ]------------------------------------------------ */
1245 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1247 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1249 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1251 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, char *separator
);
1253 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1255 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1257 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1259 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1261 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1263 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, char *title
);
1265 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, char *text
, Bool isBranch
);
1267 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1269 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1270 WMCompareDataProc
*func
);
1272 /* Don't free the returned string. */
1273 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1275 /* free the returned string */
1276 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1278 /* free the returned string */
1279 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1281 /* free the returned array */
1282 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1284 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1286 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1289 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1291 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1293 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1295 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1297 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1299 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1301 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1303 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1305 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1307 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1309 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1311 /* ---[ WINGs/wmenuitem.c ]----------------------------------------------- */
1314 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1316 WMMenuItem
* WMCreateMenuItem(void);
1318 void WMDestroyMenuItem(WMMenuItem
*item
);
1320 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1322 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1324 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1326 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1328 void WMSetMenuItemShortcut(WMMenuItem
*item
, char *shortcut
);
1330 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1332 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1334 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1336 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1338 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1340 void* WMGetMenuItemData(WMMenuItem
*item
);
1342 void WMSetMenuItemTitle(WMMenuItem
*item
, char *title
);
1344 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1346 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1348 int WMGetMenuItemState(WMMenuItem
*item
);
1350 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1352 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1354 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1356 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1358 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1360 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1362 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1364 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1366 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1369 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1371 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1374 /* ---[ WINGs/wpopupbutton.c ]-------------------------------------------- */
1376 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1378 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1381 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1383 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, char *title
);
1385 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1388 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1390 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1392 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1394 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1396 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1398 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, char *text
);
1400 /* don't free the returned data */
1401 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1403 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1405 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1407 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1409 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1411 /* ---[ WINGs/wcolorpanel.c ]--------------------------------------------- */
1413 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1415 void WMFreeColorPanel(WMColorPanel
*panel
);
1417 void WMShowColorPanel(WMColorPanel
*panel
);
1419 void WMCloseColorPanel(WMColorPanel
*panel
);
1421 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1423 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1425 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1427 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1429 extern char *WMColorPanelColorChangedNotification
;
1431 /* ---[ WINGs/wcolorwell.c ]---------------------------------------------- */
1433 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1435 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1437 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1439 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1442 extern char *WMColorWellDidChangeNotification
;
1445 /* ---[ WINGs/wscrollview.c ]--------------------------------------------- */
1447 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1449 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1450 unsigned int height
);
1452 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1454 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1456 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1458 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1460 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1462 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1464 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1466 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1468 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1470 /* ---[ WINGs/wslider.c ]------------------------------------------------- */
1472 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1474 int WMGetSliderMinValue(WMSlider
*slider
);
1476 int WMGetSliderMaxValue(WMSlider
*slider
);
1478 int WMGetSliderValue(WMSlider
*slider
);
1480 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1482 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1484 void WMSetSliderValue(WMSlider
*slider
, int value
);
1486 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1488 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1490 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1492 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1494 /* ---[ WINGs/wsplitview.c ]---------------------------------------------- */
1497 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1499 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1501 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1503 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1505 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1507 /* remove the first subview == view */
1508 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1510 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1513 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1515 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1517 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1518 WMSplitViewConstrainProc
*proc
);
1521 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1522 WMSplitViewResizeSubviewsProc *proc);
1525 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1527 /* ...................................................................... */
1529 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1531 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1533 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1535 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1537 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1539 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1541 int WMGetRulerOffset(WMRuler
*rPtr
);
1543 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1545 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1547 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1549 /* ....................................................................... */
1552 #define WMCreateText(parent) WMCreateTextForDocumentType \
1553 ((parent), (NULL), (NULL))
1555 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1558 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1560 void WMFreezeText(WMText
*tPtr
);
1562 #define WMRefreshText(tPtr) WMThawText((tPtr))
1564 void WMThawText(WMText
*tPtr
);
1566 int WMScrollText(WMText
*tPtr
, int amount
);
1568 int WMPageText(WMText
*tPtr
, Bool direction
);
1570 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1572 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1574 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1576 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1578 int WMGetTextRulerShown(WMText
*tPtr
);
1580 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1582 int WMGetTextEditable(WMText
*tPtr
);
1584 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1586 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1588 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1590 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1592 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1594 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1596 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1598 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1600 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1602 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1604 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1606 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1608 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1610 void WMPrependTextStream(WMText
*tPtr
, char *text
);
1612 void WMAppendTextStream(WMText
*tPtr
, char *text
);
1614 #define WMClearText(tPtr) WMAppendTextStream \
1618 char* WMGetTextStream(WMText
*tPtr
);
1621 char* WMGetTextSelectedStream(WMText
*tPtr
);
1623 /* destroy the array */
1624 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1626 /* destroy the array */
1627 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1629 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1631 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1633 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1635 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1637 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1639 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1641 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1643 Bool
WMFindInTextStream(WMText
*tPtr
, char *needle
, Bool direction
,
1644 Bool caseSensitive
);
1646 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1649 /* parser related stuff... use only if implementing a new parser */
1651 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, char *description
,
1652 WMColor
*color
, unsigned short first
,
1653 unsigned short extraInfo
);
1655 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, char *description
,
1656 WMColor
*color
, unsigned short first
,
1657 unsigned short extraInfo
);
1659 void* WMCreateTextBlockWithText(WMText
*tPtr
, char *text
, WMFont
*font
,
1660 WMColor
*color
, unsigned short first
,
1661 unsigned short length
);
1663 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1664 unsigned int kanji
, unsigned int underlined
,
1665 int script
, WMRulerMargins
*margins
);
1667 /* do NOT free the margins */
1668 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1669 unsigned int *kanji
, unsigned int *underlined
,
1670 int *script
, WMRulerMargins
*margins
);
1672 int WMGetTextInsertType(WMText
*tPtr
);
1674 /*int WMGetTextBlocks(WMText *tPtr);
1676 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1678 int WMGetCurrentTextBlock(WMText *tPtr);*/
1680 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1682 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1684 void* WMRemoveTextBlock(WMText
*tPtr
);
1686 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1688 /* ---[ WINGs/wtabview.c ]------------------------------------------------ */
1690 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1692 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1694 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1696 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1698 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1700 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1702 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1704 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1705 int identifier
, char *label
);
1707 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1709 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1711 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1713 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1715 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1717 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1719 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1721 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1723 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1726 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1728 void WMSetTabViewItemEnabled(WMTabViewItem
*tPtr
, Bool flag
);
1730 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1732 void WMSetTabViewItemLabel(WMTabViewItem
*item
, char *label
);
1734 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1736 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1738 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1740 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1743 /* ---[ WINGs/wbox.c ]---------------------------------------------------- */
1745 WMBox
* WMCreateBox(WMWidget
*parent
);
1747 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1749 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1750 int minSize
, int maxSize
, int space
);
1752 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1753 int minSize
, int maxSize
, int space
);
1755 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1757 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1759 /* ---[ WINGs/wpanel.c ]-------------------------------------------------- */
1761 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1762 char *defaultButton
, char *alternateButton
,
1765 /* you can free the returned string */
1766 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
, char *msg
,
1767 char *defaultText
, char *okButton
, char *cancelButton
);
1769 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1770 char *msg
, char *defaultButton
,
1771 char *alternateButton
, char *otherButton
);
1773 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, char *title
,
1774 char *msg
, char *defaultText
, char *okButton
,
1775 char *cancelButton
);
1778 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1779 char *title
, char *defaultButton
,
1780 char *alternateButton
);
1782 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1784 void WMDestroyInputPanel(WMInputPanel
*panel
);
1786 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1788 /* ---[ WINGs/wfilepanel.c ]---------------------------------------------- */
1790 /* only 1 instance per WMScreen */
1791 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1793 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1795 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1797 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1799 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1801 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1803 /* you can free the returned string */
1804 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1806 void WMFreeFilePanel(WMFilePanel
*panel
);
1808 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1809 char *path
, char *name
, char **fileTypes
);
1811 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1813 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1816 /* ---[ WINGs/wfontpanel.c ]---------------------------------------------- */
1818 /* only 1 instance per WMScreen */
1819 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1821 void WMShowFontPanel(WMFontPanel
*panel
);
1823 void WMHideFontPanel(WMFontPanel
*panel
);
1825 void WMFreeFontPanel(WMFontPanel
*panel
);
1827 void WMSetFontPanelAction(WMFontPanel
*panel
, WMAction2
*action
, void *data
);
1829 void WMSetFontPanelFont(WMFontPanel
*panel
, char *fontName
);
1831 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1835 #endif /* __cplusplus */