3 * Copyright (c) 1998 scottc
4 * Copyright (c) 1999-2004 Dan Pascu
5 * Copyright (c) 1999-2001 Alfredo K. Kojima
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include <WINGs/WUtil.h>
29 #define WINGS_H_VERSION 20230226
34 #endif /* __cplusplus */
40 #ifdef __STDC_VERSION__
41 # if __STDC_VERSION__ >= 201112L
43 * Ideally, we would like to include the proper header to have 'noreturn' properly
44 * defined (that's what is done for the rest of the code)
45 * However, as we're a public API file we can't do that in a portable fashion, so
46 * we just stick to plain STD C11 keyword
48 # define _wings_noreturn _Noreturn
50 # define _wings_noreturn /**/
53 #define _wings_noreturn /**/
56 typedef unsigned long WMPixel
;
78 #define ClientMessageMask (1L<<30)
81 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
82 #define _DEFINED_GNUSTEP_WINDOW_INFO
84 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
85 * NSDesktopWindowLevel intended to be the level at which things
86 * on the desktop sit ... so you should be able
87 * to put a desktop background just below it.
89 * Applications are actually permitted to use any value in the
90 * range INT_MIN+1 to INT_MAX
93 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
94 WMNormalWindowLevel
= 0,
95 WMFloatingWindowLevel
= 3,
96 WMSubmenuWindowLevel
= 3,
97 WMTornOffMenuWindowLevel
= 3,
98 WMMainMenuWindowLevel
= 20,
99 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
100 WMStatusWindowLevel
= 21,
101 WMModalPanelWindowLevel
= 100,
102 WMPopUpMenuWindowLevel
= 101,
103 WMScreenSaverWindowLevel
= 1000
107 /* window attributes */
109 WMBorderlessWindowMask
= 0,
110 WMTitledWindowMask
= 1,
111 WMClosableWindowMask
= 2,
112 WMMiniaturizableWindowMask
= 4,
113 WMResizableWindowMask
= 8,
114 WMIconWindowMask
= 64,
115 WMMiniWindowMask
= 128
122 /* 0 is reserved for internal use */
123 WBTMomentaryPush
= 1,
124 WBTPushOnPushOff
= 2,
128 WBTMomentaryChange
= 6,
130 WBTMomentaryLight
= 8,
134 /* button behaviour masks */
136 WBBSpringLoadedMask
= (1 << 0),
137 WBBPushInMask
= (1 << 1),
138 WBBPushChangeMask
= (1 << 2),
139 WBBPushLightMask
= (1 << 3),
140 WBBStateLightMask
= (1 << 5),
141 WBBStateChangeMask
= (1 << 6),
142 WBBStatePushMask
= (1 << 7)
146 /* frame title positions */
170 /* alignment types */
175 WAJustified
/* not valid for textfields */
191 /* scroller arrow position */
196 } WMScrollArrowPosition
;
211 /* usable scroller parts */
216 } WMUsableScrollerParts
;
228 WTTopTabsBevelBorder
,
235 /* text movement types */
237 WMIllegalTextMovement
,
238 WMReturnTextMovement
,
239 WMEscapeTextMovement
,
241 WMBacktabTextMovement
,
248 /* text field special events */
256 WLNotFound
= -1 /* element was not found in WMList */
260 /* drag operations */
268 } WMDragOperationType
;
272 WMGrayModeColorPanel
= 1,
273 WMRGBModeColorPanel
= 2,
274 WMCMYKModeColorPanel
= 3,
275 WMHSBModeColorPanel
= 4,
276 WMCustomPaletteModeColorPanel
= 5,
277 WMColorListModeColorPanel
= 6,
278 WMWheelModeColorPanel
= 7
284 #define WSIReturnArrow 1
285 #define WSIHighlightedReturnArrow 2
286 #define WSIScrollerDimple 3
287 #define WSIArrowLeft 4
288 #define WSIHighlightedArrowLeft 5
289 #define WSIArrowRight 6
290 #define WSIHighlightedArrowRight 7
292 #define WSIHighlightedArrowUp 9
293 #define WSIArrowDown 10
294 #define WSIHighlightedArrowDown 11
295 #define WSICheckMark 12
298 WLDSSelected
= (1 << 16),
299 WLDSDisabled
= (1 << 17),
300 WLDSFocused
= (1 << 18),
301 WLDSIsBranch
= (1 << 19)
304 /* alert panel return values */
314 /* types of input observers */
316 WIReadMask
= (1 << 0),
317 WIWriteMask
= (1 << 1),
318 WIExceptMask
= (1 << 2)
338 WC_Matrix
= 12, /* not ready */
341 WC_ProgressIndicator
= 15,
348 /* All widgets must start with the following structure
349 * in that order. Used for typecasting to get some generic data */
350 typedef struct W_WidgetType
{
357 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
358 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
363 typedef void WMWidget
;
365 typedef struct W_Pixmap WMPixmap
;
366 typedef struct W_Font WMFont
;
367 typedef struct W_Color WMColor
;
369 typedef struct W_Screen WMScreen
;
371 typedef struct W_View WMView
;
373 typedef struct W_Window WMWindow
;
374 typedef struct W_Frame WMFrame
;
375 typedef struct W_Button WMButton
;
376 typedef struct W_Label WMLabel
;
377 typedef struct W_TextField WMTextField
;
378 typedef struct W_Scroller WMScroller
;
379 typedef struct W_ScrollView WMScrollView
;
380 typedef struct W_List WMList
;
381 typedef struct W_Browser WMBrowser
;
382 typedef struct W_PopUpButton WMPopUpButton
;
383 typedef struct W_ProgressIndicator WMProgressIndicator
;
384 typedef struct W_ColorWell WMColorWell
;
385 typedef struct W_Slider WMSlider
;
386 typedef struct W_Matrix WMMatrix
; /* not ready */
387 typedef struct W_SplitView WMSplitView
;
388 typedef struct W_TabView WMTabView
;
389 typedef struct W_Ruler WMRuler
;
390 typedef struct W_Text WMText
;
391 typedef struct W_Box WMBox
;
395 typedef struct W_TabViewItem WMTabViewItem
;
396 typedef struct W_MenuItem WMMenuItem
;
399 typedef struct W_FilePanel WMFilePanel
;
400 typedef WMFilePanel WMOpenPanel
;
401 typedef WMFilePanel WMSavePanel
;
403 typedef struct W_FontPanel WMFontPanel
;
405 typedef struct W_ColorPanel WMColorPanel
;
408 /* item for WMList */
409 typedef struct WMListItem
{
411 void *clientData
; /* ptr for user clientdata. */
413 unsigned int uflags
:16; /* flags for the user */
414 unsigned int selected
:1;
415 unsigned int disabled
:1;
416 unsigned int isBranch
:1;
417 unsigned int loaded
:1;
420 /* struct for message panel */
421 typedef struct WMAlertPanel
{
422 WMWindow
*win
; /* window */
425 WMButton
*defBtn
; /* default button */
426 WMButton
*altBtn
; /* alternative button */
427 WMButton
*othBtn
; /* other button */
428 WMLabel
*iLbl
; /* icon label */
429 WMLabel
*tLbl
; /* title label */
430 WMLabel
*mLbl
; /* message label */
431 WMFrame
*line
; /* separator */
432 short result
; /* button that was pushed */
436 typedef struct WMGenericPanel
{
455 typedef struct WMInputPanel
{
456 WMWindow
*win
; /* window */
457 WMButton
*defBtn
; /* default button */
458 WMButton
*altBtn
; /* alternative button */
459 WMLabel
*tLbl
; /* title label */
460 WMLabel
*mLbl
; /* message label */
461 WMTextField
*text
; /* text field */
462 short result
; /* button that was pushed */
466 /* Basic font styles. Used to easily get one style from another */
467 typedef enum WMFontStyle
{
477 WMArray
*tabs
; /* a growable array of tabstops */
478 unsigned short left
; /* left margin marker */
479 unsigned short right
; /* right margin marker */
480 unsigned short first
; /* indentation marker for first line only */
481 unsigned short body
; /* body indentation marker */
482 unsigned short retainCount
;
484 /* All indentation and tab markers are _relative_ to the left margin marker */
487 typedef void WMEventProc(XEvent
*event
, void *clientData
);
489 typedef void WMEventHook(XEvent
*event
);
491 /* self is set to the widget from where the callback is being called and
492 * clientData to the data set to with WMSetClientData() */
493 typedef void WMAction(WMWidget
*self
, void *clientData
);
495 /* same as WMAction, but for stuff that arent widgets */
496 typedef void WMAction2(void *self
, void *clientData
);
499 /* delegate method like stuff */
500 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
501 int state
, WMRect
*rect
);
505 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
506 unsigned int oldWidth,
507 unsigned int oldHeight);
510 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
511 int *minSize
, int *maxSize
);
513 typedef WMWidget
* WMMatrixCreateCellProc(WMMatrix
*mPtr
);
518 typedef struct WMBrowserDelegate
{
521 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
522 WMBrowser
*sender
, int column
, WMList
*list
);
524 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
527 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
529 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
533 typedef struct WMTextFieldDelegate
{
536 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
537 WMNotification
*notif
);
539 void (*didChange
)(struct WMTextFieldDelegate
*self
,
540 WMNotification
*notif
);
542 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
543 WMNotification
*notif
);
545 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
548 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
550 } WMTextFieldDelegate
;
553 typedef struct WMTextDelegate
{
556 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
563 typedef struct WMTabViewDelegate
{
566 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
569 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
570 WMTabViewItem
*item
);
572 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
573 WMTabViewItem
*item
);
575 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
576 WMTabViewItem
*item
);
582 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
583 Time timestamp
, void *cdata
, WMData
*data
);
586 typedef struct WMSelectionProcs
{
587 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
588 void *cdata
, Atom
*type
);
589 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
590 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
595 typedef struct W_DraggingInfo WMDraggingInfo
;
598 /* links a label to a dnd operation. */
599 typedef struct W_DragOperationtItem WMDragOperationItem
;
602 typedef struct W_DragSourceProcs
{
603 WMArray
* (*dropDataTypes
)(WMView
*self
);
604 WMDragOperationType (*wantedDropOperation
)(WMView
*self
);
605 WMArray
* (*askedOperations
)(WMView
*self
);
606 Bool (*acceptDropOperation
)(WMView
*self
, WMDragOperationType operation
);
607 void (*beganDrag
)(WMView
*self
, WMPoint
*point
);
608 void (*endedDrag
)(WMView
*self
, WMPoint
*point
, Bool deposited
);
609 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
610 /*Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
615 typedef struct W_DragDestinationProcs
{
616 void (*prepareForDragOperation
)(WMView
*self
);
617 WMArray
* (*requiredDataTypes
)(WMView
*self
, WMDragOperationType request
,
618 WMArray
*sourceDataTypes
);
619 WMDragOperationType (*allowedOperation
)(WMView
*self
,
620 WMDragOperationType request
,
621 WMArray
*sourceDataTypes
);
622 Bool (*inspectDropData
)(WMView
*self
, WMArray
*dropData
);
623 void (*performDragOperation
)(WMView
*self
, WMArray
*dropData
,
624 WMArray
*operations
, WMPoint
*dropLocation
);
625 void (*concludeDragOperation
)(WMView
*self
);
626 } WMDragDestinationProcs
;
629 /* ---[ WINGs/wmisc.c ]--------------------------------------------------- */
632 WMPoint
wmkpoint(int x
, int y
);
634 WMSize
wmksize(unsigned int width
, unsigned int height
);
636 WMRect
wmkrect(int x
, int y
, unsigned int width
, unsigned int height
);
638 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
639 #define wmksize(width, height) (WMSize){(width), (height)}
640 #define wmkpoint(x, y) (WMPoint){(x), (y)}
643 /* ---[ WINGs/wapplication.c ]-------------------------------------------- */
646 void WMInitializeApplication(const char *applicationName
, int *argc
, char **argv
);
648 /* You're supposed to call this funtion before exiting so WINGs can terminate properly */
649 void WMReleaseApplication(void);
651 void WMSetResourcePath(const char *path
);
653 /* don't free the returned string */
654 char* WMGetApplicationName(void);
656 /* Try to locate resource file. ext may be NULL */
657 char* WMPathForResourceOfType(const char *resource
, const char *ext
);
659 /* ---[ WINGs/widgets.c ]------------------------------------------------- */
661 WMScreen
* WMOpenScreen(const char *display
);
663 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
666 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
668 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
670 _wings_noreturn
void WMScreenMainLoop(WMScreen
*scr
);
672 void WMBreakModalLoop(WMScreen
*scr
);
674 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
676 RContext
* WMScreenRContext(WMScreen
*scr
);
678 Display
* WMScreenDisplay(WMScreen
*scr
);
680 int WMScreenDepth(WMScreen
*scr
);
682 void WMSetFocusToWidget(WMWidget
*widget
);
684 /* ---[ WINGs/wappresource.c ]-------------------------------------------- */
686 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
688 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
690 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
692 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
694 /* If color==NULL it will use the default color for panels: ae/aa/ae */
695 WMPixmap
* WMCreateApplicationIconBlendedPixmap(WMScreen
*scr
, const RColor
*color
);
697 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
699 /* ---[ WINGs/wevent.c ]-------------------------------------------------- */
701 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
703 int WMHandleEvent(XEvent
*event
);
705 Bool
WMScreenPending(WMScreen
*scr
);
707 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
708 WMEventProc
*eventProc
, void *clientData
);
710 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
711 WMEventProc
*eventProc
, void *clientData
);
713 int WMIsDoubleClick(XEvent
*event
);
715 /*int WMIsTripleClick(XEvent *event);*/
717 void WMNextEvent(Display
*dpy
, XEvent
*event
);
719 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
721 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
723 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
726 /* ---[ WINGs/selection.c ]----------------------------------------------- */
729 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
730 WMSelectionProcs
*procs
, void *cdata
);
732 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
734 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
735 Time timestamp
, WMSelectionCallback
*callback
,
739 extern const char *WMSelectionOwnerDidChangeNotification
;
741 /* ---[ WINGs/dragcommon.c ]---------------------------------------------- */
743 WMArray
* WMCreateDragOperationArray(int initialSize
);
745 WMDragOperationItem
* WMCreateDragOperationItem(WMDragOperationType type
,
748 WMDragOperationType
WMGetDragOperationItemType(WMDragOperationItem
* item
);
750 char* WMGetDragOperationItemText(WMDragOperationItem
* item
);
752 /* ---[ WINGs/dragsource.c ]---------------------------------------------- */
754 void WMSetViewDragImage(WMView
* view
, WMPixmap
*dragImage
);
756 void WMReleaseViewDragImage(WMView
* view
);
758 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
760 Bool
WMIsDraggingFromView(WMView
*view
);
762 void WMDragImageFromView(WMView
*view
, XEvent
*event
);
764 /* Create a drag handler, associating drag event masks with dragEventProc */
765 void WMCreateDragHandler(WMView
*view
, WMEventProc
*dragEventProc
, void *clientData
);
767 void WMDeleteDragHandler(WMView
*view
, WMEventProc
*dragEventProc
, void *clientData
);
769 /* set default drag handler for view */
770 void WMSetViewDraggable(WMView
*view
, WMDragSourceProcs
*procs
, WMPixmap
*dragImage
);
772 void WMUnsetViewDraggable(WMView
*view
);
774 /* ---[ WINGs/dragdestination.c ]----------------------------------------- */
776 void WMRegisterViewForDraggedTypes(WMView
*view
, WMArray
*acceptedTypes
);
778 void WMUnregisterViewDraggedTypes(WMView
*view
);
780 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
782 /* ---[ WINGs/wfont.c ]--------------------------------------------------- */
784 Bool
WMIsAntialiasingEnabled(WMScreen
*scrPtr
);
786 WMFont
* WMCreateFont(WMScreen
*scrPtr
, const char *fontName
);
788 WMFont
* WMCopyFontWithStyle(WMScreen
*scrPtr
, WMFont
*font
, WMFontStyle style
);
790 WMFont
* WMRetainFont(WMFont
*font
);
792 void WMReleaseFont(WMFont
*font
);
794 char* WMGetFontName(WMFont
*font
);
796 unsigned int WMFontHeight(WMFont
*font
);
798 void WMGetScaleBaseFromSystemFont(WMScreen
*scrPtr
, int *alphabetWidth
, int *fontHeight
);
800 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
802 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
804 WMFont
* WMDefaultSystemFont(WMScreen
*scrPtr
);
806 WMFont
* WMDefaultBoldSystemFont(WMScreen
*scrPtr
);
808 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
810 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
812 void WMDrawString(WMScreen
*scr
, Drawable d
, WMColor
*color
, WMFont
*font
,
813 int x
, int y
, const char *text
, int length
);
815 void WMDrawImageString(WMScreen
*scr
, Drawable d
, WMColor
*color
,
816 WMColor
*background
, WMFont
*font
, int x
, int y
,
817 const char *text
, int length
);
819 int WMWidthOfString(WMFont
*font
, const char *text
, int length
);
821 /* ---[ WINGs/wpixmap.c ]------------------------------------------------- */
823 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
825 void WMReleasePixmap(WMPixmap
*pixmap
);
827 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
830 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
831 Pixmap mask
, int width
, int height
,
834 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
837 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
839 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
841 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, const char *fileName
);
843 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
844 const RColor
*color
);
846 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, const char *fileName
,
847 const RColor
*color
);
849 WMPixmap
* WMCreateScaledBlendedPixmapFromFile(WMScreen
*scrPtr
, const char *fileName
,
852 unsigned int height
);
854 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
856 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
858 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
860 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
862 /* ---[ WINGs/wcolor.c ]-------------------------------------------------- */
865 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
867 WMColor
* WMGrayColor(WMScreen
*scr
);
869 WMColor
* WMBlackColor(WMScreen
*scr
);
871 WMColor
* WMWhiteColor(WMScreen
*scr
);
873 void WMSetColorInGC(WMColor
*color
, GC gc
);
875 GC
WMColorGC(WMColor
*color
);
877 WMPixel
WMColorPixel(WMColor
*color
);
879 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
880 unsigned int width
, unsigned int height
);
882 void WMReleaseColor(WMColor
*color
);
884 WMColor
* WMRetainColor(WMColor
*color
);
886 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
887 unsigned short green
, unsigned short blue
,
890 WMColor
* WMCreateRGBAColor(WMScreen
*scr
, unsigned short red
,
891 unsigned short green
, unsigned short blue
,
892 unsigned short alpha
, Bool exact
);
894 WMColor
* WMCreateNamedColor(WMScreen
*scr
, const char *name
, Bool exact
);
896 RColor
WMGetRColorFromColor(WMColor
*color
);
898 void WMSetColorAlpha(WMColor
*color
, unsigned short alpha
);
900 unsigned short WMRedComponentOfColor(WMColor
*color
);
902 unsigned short WMGreenComponentOfColor(WMColor
*color
);
904 unsigned short WMBlueComponentOfColor(WMColor
*color
);
906 unsigned short WMGetColorAlpha(WMColor
*color
);
908 char* WMGetColorRGBDescription(WMColor
*color
);
910 /* ---[ WINGs/widgets.c ]------------------------------------------------- */
912 WMScreen
* WMWidgetScreen(WMWidget
*w
);
914 unsigned int WMScreenWidth(WMScreen
*scr
);
916 unsigned int WMScreenHeight(WMScreen
*scr
);
918 void WMUnmapWidget(WMWidget
*w
);
920 void WMMapWidget(WMWidget
*w
);
922 Bool
WMWidgetIsMapped(WMWidget
*w
);
924 void WMRaiseWidget(WMWidget
*w
);
926 void WMLowerWidget(WMWidget
*w
);
928 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
930 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
932 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
934 WMColor
* WMGetWidgetBackgroundColor(WMWidget
*w
);
936 void WMSetWidgetBackgroundPixmap(WMWidget
*w
, WMPixmap
*pix
);
938 WMPixmap
*WMGetWidgetBackgroundPixmap(WMWidget
*w
);
940 void WMMapSubwidgets(WMWidget
*w
);
942 void WMUnmapSubwidgets(WMWidget
*w
);
944 void WMRealizeWidget(WMWidget
*w
);
946 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
948 void WMDestroyWidget(WMWidget
*widget
);
950 void WMHangData(WMWidget
*widget
, void *data
);
952 void* WMGetHangedData(WMWidget
*widget
);
954 unsigned int WMWidgetWidth(WMWidget
*w
);
956 unsigned int WMWidgetHeight(WMWidget
*w
);
958 Window
WMWidgetXID(WMWidget
*w
);
960 void WMRedisplayWidget(WMWidget
*w
);
962 /* ---[ WINGs/wview.c ]--------------------------------------------------- */
964 Window
WMViewXID(WMView
*view
);
966 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
968 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
969 int rightOffs
, int bottomOffs
);
971 WMSize
WMGetViewSize(WMView
*view
);
973 WMPoint
WMGetViewPosition(WMView
*view
);
975 WMPoint
WMGetViewScreenPosition(WMView
*view
);
977 WMWidget
* WMWidgetOfView(WMView
*view
);
980 extern const char *WMViewSizeDidChangeNotification
;
982 extern const char *WMViewFocusDidChangeNotification
;
984 extern const char *WMViewRealizedNotification
;
986 /* ---[ WINGs/wballoon.c ]------------------------------------------------ */
988 void WMSetBalloonTextForView(const char *text
, WMView
*view
);
990 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
992 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
994 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
996 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
998 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
1001 /* ---[ WINGs/wwindow.c ]------------------------------------------------- */
1003 WMWindow
* WMCreateWindow(WMScreen
*screen
, const char *name
);
1005 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, const char *name
, int style
);
1007 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, const char *name
,
1010 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, const char *name
);
1012 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
1014 void WMSetWindowTitle(WMWindow
*wPtr
, const char *title
);
1016 void WMSetWindowMiniwindowTitle(WMWindow
*win
, const char *title
);
1018 void WMSetWindowMiniwindowImage(WMWindow
*win
, RImage
*image
);
1020 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
1022 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
1024 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
1026 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
1028 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
1029 int maxX
, int maxY
);
1031 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
1033 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
1035 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
1037 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
1039 void WMSetWindowLevel(WMWindow
*win
, int level
);
1041 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
1043 void WMCloseWindow(WMWindow
*win
);
1045 /* ---[ WINGs/wbutton.c ]------------------------------------------------- */
1047 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
1049 #define WMCreateCommandButton(parent) \
1050 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1055 #define WMCreateRadioButton(parent) \
1056 WMCreateButton((parent), WBTRadio)
1058 #define WMCreateSwitchButton(parent) \
1059 WMCreateButton((parent), WBTSwitch)
1061 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
1063 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
1065 void WMSetButtonImageDefault(WMButton
*bPtr
);
1067 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
1069 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
1071 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
1073 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
1075 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
1077 void WMSetButtonText(WMButton
*bPtr
, const char *text
);
1079 /* Returns direct pointer to internal data, do not modify! */
1080 const char *WMGetButtonText(WMButton
*bPtr
);
1082 void WMSetButtonAltText(WMButton
*bPtr
, const char *text
);
1084 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
1086 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1088 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1090 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1092 int WMGetButtonSelected(WMButton
*bPtr
);
1094 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1096 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1098 int WMGetButtonEnabled(WMButton
*bPtr
);
1100 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1102 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1104 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1106 void WMPerformButtonClick(WMButton
*bPtr
);
1108 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1110 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1112 /* ---[ WINGs/wlabel.c ]-------------------------------------------------- */
1114 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1116 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1118 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1120 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1122 char* WMGetLabelText(WMLabel
*lPtr
);
1124 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1126 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1128 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1130 void WMSetLabelText(WMLabel
*lPtr
, const char *text
);
1132 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1134 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1136 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1138 /* ---[ WINGs/wframe.c ]-------------------------------------------------- */
1140 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1142 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1144 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1146 void WMSetFrameTitle(WMFrame
*fPtr
, const char *title
);
1148 void WMSetFrameTitleColor(WMFrame
*fPtr
, WMColor
*color
);
1150 /* ---[ WINGs/wtextfield.c ]---------------------------------------------- */
1152 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1154 void WMInsertTextFieldText(WMTextField
*tPtr
, const char *text
, int position
);
1156 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1158 /* you can free the returned string */
1159 char* WMGetTextFieldText(WMTextField
*tPtr
);
1161 void WMSetTextFieldText(WMTextField
*tPtr
, const char *text
);
1163 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1165 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1167 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1169 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1171 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1173 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1175 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1177 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1179 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1181 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1183 unsigned WMGetTextFieldCursorPosition(WMTextField
*tPtr
);
1185 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1187 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1189 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1191 WMTextFieldDelegate
* WMGetTextFieldDelegate(WMTextField
*tPtr
);
1193 extern const char *WMTextDidChangeNotification
;
1194 extern const char *WMTextDidBeginEditingNotification
;
1195 extern const char *WMTextDidEndEditingNotification
;
1197 /* ---[ WINGs/wscroller.c ]----------------------------------------------- */
1199 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1201 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1202 float knobProportion
);
1204 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1206 float WMGetScrollerValue(WMScroller
*sPtr
);
1208 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1210 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1212 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1213 WMScrollArrowPosition position
);
1215 extern const char *WMScrollerDidScrollNotification
;
1217 /* ---[ WINGs/wlist.c ]--------------------------------------------------- */
1219 WMList
* WMCreateList(WMWidget
*parent
);
1221 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1223 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1225 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1227 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, const char *text
);
1229 void WMSortListItems(WMList
*lPtr
);
1231 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1233 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, const char *title
);
1235 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1237 WMArray
* WMGetListItems(WMList
*lPtr
);
1239 void WMRemoveListItem(WMList
*lPtr
, int row
);
1241 void WMSelectListItem(WMList
*lPtr
, int row
);
1243 void WMUnselectListItem(WMList
*lPtr
, int row
);
1245 /* This will select all items in range, and deselect all the others */
1246 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1248 /* This will select all items in range, leaving the others as they are */
1249 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1251 void WMSelectAllListItems(WMList
*lPtr
);
1253 void WMUnselectAllListItems(WMList
*lPtr
);
1255 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1257 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1259 int WMGetListItemHeight(WMList
*lPtr
);
1261 /* don't free the returned data */
1262 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1265 * For the following 2 functions, in case WMList allows multiple selection,
1266 * the first item in the list of selected items, respective its row number,
1270 /* don't free the returned data */
1271 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1273 int WMGetListSelectedItemRow(WMList
*lPtr
);
1275 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1277 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1279 void WMClearList(WMList
*lPtr
);
1281 int WMGetListNumberOfRows(WMList
*lPtr
);
1283 void WMSetListPosition(WMList
*lPtr
, int row
);
1285 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1287 int WMGetListPosition(WMList
*lPtr
);
1289 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1291 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1294 extern const char *WMListDidScrollNotification
;
1295 extern const char *WMListSelectionDidChangeNotification
;
1297 /* ---[ WINGs/wbrowser.c ]------------------------------------------------ */
1299 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1301 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1303 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1305 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, const char *separator
);
1307 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1309 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1311 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1313 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1315 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1317 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, const char *title
);
1319 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, const char *text
, Bool isBranch
);
1321 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1323 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1324 WMCompareDataProc
*func
);
1326 /* Don't free the returned string. */
1327 const char* WMSetBrowserPath(WMBrowser
*bPtr
, const char *path
);
1329 /* free the returned string */
1330 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1332 /* free the returned string */
1333 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1335 /* free the returned array */
1336 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1338 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1340 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1343 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1345 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1347 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1349 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1351 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1353 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1355 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1357 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1359 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1361 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1363 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1365 /* ---[ WINGs/wmenuitem.c ]----------------------------------------------- */
1368 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1370 WMMenuItem
* WMCreateMenuItem(void);
1372 void WMDestroyMenuItem(WMMenuItem
*item
);
1374 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1376 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1378 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1380 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1382 void WMSetMenuItemShortcut(WMMenuItem
*item
, const char *shortcut
);
1384 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1386 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1388 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1390 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1392 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1394 void* WMGetMenuItemData(WMMenuItem
*item
);
1396 void WMSetMenuItemTitle(WMMenuItem
*item
, const char *title
);
1398 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1400 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1402 int WMGetMenuItemState(WMMenuItem
*item
);
1404 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1406 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1408 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1410 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1412 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1414 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1416 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1418 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1420 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1423 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1425 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1428 /* ---[ WINGs/wpopupbutton.c ]-------------------------------------------- */
1430 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1432 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1435 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1437 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, const char *title
);
1439 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1442 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1444 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1446 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1448 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1450 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1452 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, const char *text
);
1454 /* don't free the returned data */
1455 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1457 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1459 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1461 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1463 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1465 /* ---[ WINGs/wprogressindicator.c ]------------------------------------- */
1467 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1469 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1471 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1473 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1475 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1477 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1479 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1481 /* ---[ WINGs/wcolorpanel.c ]--------------------------------------------- */
1483 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1485 void WMFreeColorPanel(WMColorPanel
*panel
);
1487 void WMShowColorPanel(WMColorPanel
*panel
);
1489 void WMCloseColorPanel(WMColorPanel
*panel
);
1491 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1493 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1495 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1497 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1499 extern const char *WMColorPanelColorChangedNotification
;
1501 /* ---[ WINGs/wcolorwell.c ]---------------------------------------------- */
1503 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1505 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1507 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1509 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1512 extern const char *WMColorWellDidChangeNotification
;
1515 /* ---[ WINGs/wscrollview.c ]--------------------------------------------- */
1517 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1519 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1520 unsigned int height
);
1522 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1524 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1526 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1528 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1530 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1532 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1534 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1536 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1538 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1540 /* ---[ WINGs/wslider.c ]------------------------------------------------- */
1542 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1544 int WMGetSliderMinValue(WMSlider
*slider
);
1546 int WMGetSliderMaxValue(WMSlider
*slider
);
1548 int WMGetSliderValue(WMSlider
*slider
);
1550 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1552 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1554 void WMSetSliderValue(WMSlider
*slider
, int value
);
1556 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1558 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1560 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1562 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1564 /* ---[ WINGs/wsplitview.c ]---------------------------------------------- */
1567 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1569 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1571 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1573 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1575 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1577 /* remove the first subview == view */
1578 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1580 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1583 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1585 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1587 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1588 WMSplitViewConstrainProc
*proc
);
1591 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1592 WMSplitViewResizeSubviewsProc *proc);
1595 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1597 /* ...................................................................... */
1599 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1601 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1603 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1605 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1607 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1609 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1611 int WMGetRulerOffset(WMRuler
*rPtr
);
1613 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1615 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1617 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1619 /* ....................................................................... */
1622 #define WMCreateText(parent) WMCreateTextForDocumentType \
1623 ((parent), (NULL), (NULL))
1625 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1628 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1630 void WMFreezeText(WMText
*tPtr
);
1632 #define WMRefreshText(tPtr) WMThawText((tPtr))
1634 void WMThawText(WMText
*tPtr
);
1636 int WMScrollText(WMText
*tPtr
, int amount
);
1638 int WMPageText(WMText
*tPtr
, Bool direction
);
1640 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1642 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1644 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1646 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1648 int WMGetTextRulerShown(WMText
*tPtr
);
1650 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1652 int WMGetTextEditable(WMText
*tPtr
);
1654 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1656 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1658 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1660 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1662 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1664 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1666 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1668 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1670 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1672 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1674 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1676 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1678 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1680 void WMPrependTextStream(WMText
*tPtr
, const char *text
);
1682 void WMAppendTextStream(WMText
*tPtr
, const char *text
);
1684 #define WMClearText(tPtr) WMAppendTextStream \
1688 char* WMGetTextStream(WMText
*tPtr
);
1691 char* WMGetTextSelectedStream(WMText
*tPtr
);
1693 /* destroy the array */
1694 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1696 /* destroy the array */
1697 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1699 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1701 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1703 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1705 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1707 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1709 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1711 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1713 Bool
WMFindInTextStream(WMText
*tPtr
, const char *needle
, Bool direction
,
1714 Bool caseSensitive
);
1716 /* Warning: replacement can be modified by the function */
1717 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1720 /* parser related stuff... use only if implementing a new parser */
1722 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, const char *description
,
1723 WMColor
*color
, unsigned short first
,
1724 unsigned short extraInfo
);
1726 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, const char *description
,
1727 WMColor
*color
, unsigned short first
,
1728 unsigned short extraInfo
);
1730 void* WMCreateTextBlockWithText(WMText
*tPtr
, const char *text
, WMFont
*font
,
1731 WMColor
*color
, unsigned short first
,
1732 unsigned short length
);
1734 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1735 unsigned int kanji
, unsigned int underlined
,
1736 int script
, WMRulerMargins
*margins
);
1738 /* do NOT free the margins */
1739 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1740 unsigned int *kanji
, unsigned int *underlined
,
1741 int *script
, WMRulerMargins
*margins
);
1743 int WMGetTextInsertType(WMText
*tPtr
);
1745 /*int WMGetTextBlocks(WMText *tPtr);
1747 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1749 int WMGetCurrentTextBlock(WMText *tPtr);*/
1751 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1753 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1755 void* WMRemoveTextBlock(WMText
*tPtr
);
1757 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1759 /* ---[ WINGs/wtabview.c ]------------------------------------------------ */
1761 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1763 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1765 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1767 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1769 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1771 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1773 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1775 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1776 int identifier
, const char *label
);
1778 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1780 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1782 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1784 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1786 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1788 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1790 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1792 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1794 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1797 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1799 void WMSetTabViewItemEnabled(WMTabViewItem
*tPtr
, Bool flag
);
1801 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1803 void WMSetTabViewItemLabel(WMTabViewItem
*item
, const char *label
);
1805 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1807 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1809 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1811 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1814 /* ---[ WINGs/wbox.c ]---------------------------------------------------- */
1816 WMBox
* WMCreateBox(WMWidget
*parent
);
1818 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1820 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1821 int minSize
, int maxSize
, int space
);
1823 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1824 int minSize
, int maxSize
, int space
);
1826 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1828 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1830 /* ---[ WINGs/wpanel.c ]-------------------------------------------------- */
1832 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
, const char *msg
,
1833 const char *defaultButton
, const char *alternateButton
,
1834 const char *otherButton
);
1836 /* you can free the returned string */
1837 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
, const char *msg
,
1838 const char *defaultText
, const char *okButton
, const char *cancelButton
);
1840 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1841 const char *msg
, const char *defaultButton
,
1842 const char *alternateButton
, const char *otherButton
);
1844 WMAlertPanel
* WMCreateScaledAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1845 const char *msg
, const char *defaultButton
,
1846 const char *alternateButton
, const char *otherButton
);
1848 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1849 const char *msg
, const char *defaultText
, const char *okButton
,
1850 const char *cancelButton
);
1852 WMInputPanel
* WMCreateScaledInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1853 const char *msg
, const char *defaultText
, const char *okButton
,
1854 const char *cancelButton
);
1856 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1857 const char *title
, const char *defaultButton
,
1858 const char *alternateButton
);
1860 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1862 void WMDestroyInputPanel(WMInputPanel
*panel
);
1864 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1866 /* ---[ WINGs/wfilepanel.c ]---------------------------------------------- */
1868 /* only 1 instance per WMScreen */
1869 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1871 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1873 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1875 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1877 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1879 void WMSetFilePanelDirectory(WMFilePanel
*panel
, const char *path
);
1881 /* you can free the returned string */
1882 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1884 void WMFreeFilePanel(WMFilePanel
*panel
);
1886 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1887 const char *path
, const char *name
, char **fileTypes
);
1889 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1891 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1894 /* ---[ WINGs/wfontpanel.c ]---------------------------------------------- */
1896 /* only 1 instance per WMScreen */
1897 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1899 void WMShowFontPanel(WMFontPanel
*panel
);
1901 void WMHideFontPanel(WMFontPanel
*panel
);
1903 void WMFreeFontPanel(WMFontPanel
*panel
);
1905 void WMSetFontPanelAction(WMFontPanel
*panel
, WMAction2
*action
, void *data
);
1907 void WMSetFontPanelFont(WMFontPanel
*panel
, const char *fontName
);
1909 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1911 /* ---[ WINGs/configuration.c ]------------------------------------------- */
1912 unsigned W_getconf_mouseWheelUp(void);
1913 unsigned W_getconf_mouseWheelDown(void);
1914 void W_setconf_doubleClickDelay(int value
);
1918 #endif /* __cplusplus */
1921 /* These definitions are not meant to be seen outside this file */
1922 #undef _wings_noreturn