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 20150508
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 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 WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
800 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
802 WMFont
* WMDefaultSystemFont(WMScreen
*scrPtr
);
804 WMFont
* WMDefaultBoldSystemFont(WMScreen
*scrPtr
);
806 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
808 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
810 void WMDrawString(WMScreen
*scr
, Drawable d
, WMColor
*color
, WMFont
*font
,
811 int x
, int y
, const char *text
, int length
);
813 void WMDrawImageString(WMScreen
*scr
, Drawable d
, WMColor
*color
,
814 WMColor
*background
, WMFont
*font
, int x
, int y
,
815 const char *text
, int length
);
817 int WMWidthOfString(WMFont
*font
, const char *text
, int length
);
819 /* ---[ WINGs/wpixmap.c ]------------------------------------------------- */
821 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
823 void WMReleasePixmap(WMPixmap
*pixmap
);
825 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
828 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
829 Pixmap mask
, int width
, int height
,
832 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
835 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
837 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
839 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, const char *fileName
);
841 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
842 const RColor
*color
);
844 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, const char *fileName
,
845 const RColor
*color
);
847 WMPixmap
* WMCreateScaledBlendedPixmapFromFile(WMScreen
*scrPtr
, const char *fileName
,
850 unsigned int height
);
852 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
854 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
856 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
858 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
860 /* ---[ WINGs/wcolor.c ]-------------------------------------------------- */
863 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
865 WMColor
* WMGrayColor(WMScreen
*scr
);
867 WMColor
* WMBlackColor(WMScreen
*scr
);
869 WMColor
* WMWhiteColor(WMScreen
*scr
);
871 void WMSetColorInGC(WMColor
*color
, GC gc
);
873 GC
WMColorGC(WMColor
*color
);
875 WMPixel
WMColorPixel(WMColor
*color
);
877 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
878 unsigned int width
, unsigned int height
);
880 void WMReleaseColor(WMColor
*color
);
882 WMColor
* WMRetainColor(WMColor
*color
);
884 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
885 unsigned short green
, unsigned short blue
,
888 WMColor
* WMCreateRGBAColor(WMScreen
*scr
, unsigned short red
,
889 unsigned short green
, unsigned short blue
,
890 unsigned short alpha
, Bool exact
);
892 WMColor
* WMCreateNamedColor(WMScreen
*scr
, const char *name
, Bool exact
);
894 RColor
WMGetRColorFromColor(WMColor
*color
);
896 void WMSetColorAlpha(WMColor
*color
, unsigned short alpha
);
898 unsigned short WMRedComponentOfColor(WMColor
*color
);
900 unsigned short WMGreenComponentOfColor(WMColor
*color
);
902 unsigned short WMBlueComponentOfColor(WMColor
*color
);
904 unsigned short WMGetColorAlpha(WMColor
*color
);
906 char* WMGetColorRGBDescription(WMColor
*color
);
908 /* ---[ WINGs/widgets.c ]------------------------------------------------- */
910 WMScreen
* WMWidgetScreen(WMWidget
*w
);
912 unsigned int WMScreenWidth(WMScreen
*scr
);
914 unsigned int WMScreenHeight(WMScreen
*scr
);
916 void WMUnmapWidget(WMWidget
*w
);
918 void WMMapWidget(WMWidget
*w
);
920 Bool
WMWidgetIsMapped(WMWidget
*w
);
922 void WMRaiseWidget(WMWidget
*w
);
924 void WMLowerWidget(WMWidget
*w
);
926 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
928 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
930 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
932 WMColor
* WMGetWidgetBackgroundColor(WMWidget
*w
);
934 void WMSetWidgetBackgroundPixmap(WMWidget
*w
, WMPixmap
*pix
);
936 WMPixmap
*WMGetWidgetBackgroundPixmap(WMWidget
*w
);
938 void WMMapSubwidgets(WMWidget
*w
);
940 void WMUnmapSubwidgets(WMWidget
*w
);
942 void WMRealizeWidget(WMWidget
*w
);
944 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
946 void WMDestroyWidget(WMWidget
*widget
);
948 void WMHangData(WMWidget
*widget
, void *data
);
950 void* WMGetHangedData(WMWidget
*widget
);
952 unsigned int WMWidgetWidth(WMWidget
*w
);
954 unsigned int WMWidgetHeight(WMWidget
*w
);
956 Window
WMWidgetXID(WMWidget
*w
);
958 void WMRedisplayWidget(WMWidget
*w
);
960 /* ---[ WINGs/wview.c ]--------------------------------------------------- */
962 Window
WMViewXID(WMView
*view
);
964 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
966 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
967 int rightOffs
, int bottomOffs
);
969 WMSize
WMGetViewSize(WMView
*view
);
971 WMPoint
WMGetViewPosition(WMView
*view
);
973 WMPoint
WMGetViewScreenPosition(WMView
*view
);
975 WMWidget
* WMWidgetOfView(WMView
*view
);
978 extern char *WMViewSizeDidChangeNotification
;
980 extern char *WMViewFocusDidChangeNotification
;
982 extern char *WMViewRealizedNotification
;
984 /* ---[ WINGs/wballoon.c ]------------------------------------------------ */
986 void WMSetBalloonTextForView(const char *text
, WMView
*view
);
988 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
990 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
992 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
994 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
996 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
999 /* ---[ WINGs/wwindow.c ]------------------------------------------------- */
1001 WMWindow
* WMCreateWindow(WMScreen
*screen
, const char *name
);
1003 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, const char *name
, int style
);
1005 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, const char *name
,
1008 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, const char *name
);
1010 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
1012 void WMSetWindowTitle(WMWindow
*wPtr
, const char *title
);
1014 void WMSetWindowMiniwindowTitle(WMWindow
*win
, const char *title
);
1016 void WMSetWindowMiniwindowImage(WMWindow
*win
, RImage
*image
);
1018 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
1020 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
1022 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
1024 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
1026 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
1027 int maxX
, int maxY
);
1029 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
1031 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
1033 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
1035 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
1037 void WMSetWindowLevel(WMWindow
*win
, int level
);
1039 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
1041 void WMCloseWindow(WMWindow
*win
);
1043 /* ---[ WINGs/wbutton.c ]------------------------------------------------- */
1045 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
1047 #define WMCreateCommandButton(parent) \
1048 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1053 #define WMCreateRadioButton(parent) \
1054 WMCreateButton((parent), WBTRadio)
1056 #define WMCreateSwitchButton(parent) \
1057 WMCreateButton((parent), WBTSwitch)
1059 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
1061 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
1063 void WMSetButtonImageDefault(WMButton
*bPtr
);
1065 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
1067 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
1069 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
1071 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
1073 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
1075 void WMSetButtonText(WMButton
*bPtr
, const char *text
);
1077 /* Returns direct pointer to internal data, do not modify! */
1078 const char *WMGetButtonText(WMButton
*bPtr
);
1080 void WMSetButtonAltText(WMButton
*bPtr
, const char *text
);
1082 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
1084 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1086 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1088 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1090 int WMGetButtonSelected(WMButton
*bPtr
);
1092 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1094 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1096 int WMGetButtonEnabled(WMButton
*bPtr
);
1098 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1100 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1102 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1104 void WMPerformButtonClick(WMButton
*bPtr
);
1106 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1108 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1110 /* ---[ WINGs/wlabel.c ]-------------------------------------------------- */
1112 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1114 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1116 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1118 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1120 char* WMGetLabelText(WMLabel
*lPtr
);
1122 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1124 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1126 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1128 void WMSetLabelText(WMLabel
*lPtr
, const char *text
);
1130 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1132 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1134 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1136 /* ---[ WINGs/wframe.c ]-------------------------------------------------- */
1138 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1140 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1142 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1144 void WMSetFrameTitle(WMFrame
*fPtr
, const char *title
);
1146 void WMSetFrameTitleColor(WMFrame
*fPtr
, WMColor
*color
);
1148 /* ---[ WINGs/wtextfield.c ]---------------------------------------------- */
1150 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1152 void WMInsertTextFieldText(WMTextField
*tPtr
, const char *text
, int position
);
1154 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1156 /* you can free the returned string */
1157 char* WMGetTextFieldText(WMTextField
*tPtr
);
1159 void WMSetTextFieldText(WMTextField
*tPtr
, const char *text
);
1161 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1163 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1165 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1167 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1169 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1171 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1173 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1175 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1177 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1179 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1181 unsigned WMGetTextFieldCursorPosition(WMTextField
*tPtr
);
1183 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1185 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1187 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1189 WMTextFieldDelegate
* WMGetTextFieldDelegate(WMTextField
*tPtr
);
1191 extern char *WMTextDidChangeNotification
;
1192 extern char *WMTextDidBeginEditingNotification
;
1193 extern char *WMTextDidEndEditingNotification
;
1195 /* ---[ WINGs/wscroller.c ]----------------------------------------------- */
1197 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1199 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1200 float knobProportion
);
1202 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1204 float WMGetScrollerValue(WMScroller
*sPtr
);
1206 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1208 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1210 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1211 WMScrollArrowPosition position
);
1213 extern char *WMScrollerDidScrollNotification
;
1215 /* ---[ WINGs/wlist.c ]--------------------------------------------------- */
1217 WMList
* WMCreateList(WMWidget
*parent
);
1219 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1221 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1223 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1225 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, const char *text
);
1227 void WMSortListItems(WMList
*lPtr
);
1229 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1231 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, const char *title
);
1233 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1235 WMArray
* WMGetListItems(WMList
*lPtr
);
1237 void WMRemoveListItem(WMList
*lPtr
, int row
);
1239 void WMSelectListItem(WMList
*lPtr
, int row
);
1241 void WMUnselectListItem(WMList
*lPtr
, int row
);
1243 /* This will select all items in range, and deselect all the others */
1244 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1246 /* This will select all items in range, leaving the others as they are */
1247 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1249 void WMSelectAllListItems(WMList
*lPtr
);
1251 void WMUnselectAllListItems(WMList
*lPtr
);
1253 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1255 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1257 int WMGetListItemHeight(WMList
*lPtr
);
1259 /* don't free the returned data */
1260 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1263 * For the following 2 functions, in case WMList allows multiple selection,
1264 * the first item in the list of selected items, respective its row number,
1268 /* don't free the returned data */
1269 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1271 int WMGetListSelectedItemRow(WMList
*lPtr
);
1273 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1275 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1277 void WMClearList(WMList
*lPtr
);
1279 int WMGetListNumberOfRows(WMList
*lPtr
);
1281 void WMSetListPosition(WMList
*lPtr
, int row
);
1283 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1285 int WMGetListPosition(WMList
*lPtr
);
1287 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1289 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1292 extern char *WMListDidScrollNotification
;
1293 extern char *WMListSelectionDidChangeNotification
;
1295 /* ---[ WINGs/wbrowser.c ]------------------------------------------------ */
1297 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1299 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1301 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1303 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, const char *separator
);
1305 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1307 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1309 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1311 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1313 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1315 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, const char *title
);
1317 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, const char *text
, Bool isBranch
);
1319 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1321 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1322 WMCompareDataProc
*func
);
1324 /* Don't free the returned string. */
1325 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1327 /* free the returned string */
1328 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1330 /* free the returned string */
1331 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1333 /* free the returned array */
1334 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1336 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1338 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1341 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1343 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1345 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1347 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1349 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1351 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1353 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1355 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1357 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1359 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1361 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1363 /* ---[ WINGs/wmenuitem.c ]----------------------------------------------- */
1366 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1368 WMMenuItem
* WMCreateMenuItem(void);
1370 void WMDestroyMenuItem(WMMenuItem
*item
);
1372 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1374 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1376 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1378 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1380 void WMSetMenuItemShortcut(WMMenuItem
*item
, const char *shortcut
);
1382 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1384 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1386 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1388 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1390 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1392 void* WMGetMenuItemData(WMMenuItem
*item
);
1394 void WMSetMenuItemTitle(WMMenuItem
*item
, const char *title
);
1396 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1398 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1400 int WMGetMenuItemState(WMMenuItem
*item
);
1402 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1404 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1406 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1408 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1410 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1412 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1414 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1416 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1418 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1421 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1423 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1426 /* ---[ WINGs/wpopupbutton.c ]-------------------------------------------- */
1428 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1430 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1433 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1435 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, const char *title
);
1437 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1440 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1442 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1444 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1446 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1448 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1450 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, const char *text
);
1452 /* don't free the returned data */
1453 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1455 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1457 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1459 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1461 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1463 /* ---[ WINGs/wprogressindicator.c ]------------------------------------- */
1465 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1467 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1469 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1471 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1473 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1475 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1477 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1479 /* ---[ WINGs/wcolorpanel.c ]--------------------------------------------- */
1481 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1483 void WMFreeColorPanel(WMColorPanel
*panel
);
1485 void WMShowColorPanel(WMColorPanel
*panel
);
1487 void WMCloseColorPanel(WMColorPanel
*panel
);
1489 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1491 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1493 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1495 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1497 extern char *WMColorPanelColorChangedNotification
;
1499 /* ---[ WINGs/wcolorwell.c ]---------------------------------------------- */
1501 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1503 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1505 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1507 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1510 extern char *WMColorWellDidChangeNotification
;
1513 /* ---[ WINGs/wscrollview.c ]--------------------------------------------- */
1515 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1517 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1518 unsigned int height
);
1520 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1522 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1524 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1526 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1528 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1530 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1532 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1534 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1536 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1538 /* ---[ WINGs/wslider.c ]------------------------------------------------- */
1540 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1542 int WMGetSliderMinValue(WMSlider
*slider
);
1544 int WMGetSliderMaxValue(WMSlider
*slider
);
1546 int WMGetSliderValue(WMSlider
*slider
);
1548 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1550 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1552 void WMSetSliderValue(WMSlider
*slider
, int value
);
1554 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1556 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1558 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1560 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1562 /* ---[ WINGs/wsplitview.c ]---------------------------------------------- */
1565 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1567 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1569 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1571 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1573 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1575 /* remove the first subview == view */
1576 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1578 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1581 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1583 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1585 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1586 WMSplitViewConstrainProc
*proc
);
1589 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1590 WMSplitViewResizeSubviewsProc *proc);
1593 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1595 /* ...................................................................... */
1597 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1599 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1601 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1603 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1605 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1607 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1609 int WMGetRulerOffset(WMRuler
*rPtr
);
1611 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1613 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1615 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1617 /* ....................................................................... */
1620 #define WMCreateText(parent) WMCreateTextForDocumentType \
1621 ((parent), (NULL), (NULL))
1623 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1626 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1628 void WMFreezeText(WMText
*tPtr
);
1630 #define WMRefreshText(tPtr) WMThawText((tPtr))
1632 void WMThawText(WMText
*tPtr
);
1634 int WMScrollText(WMText
*tPtr
, int amount
);
1636 int WMPageText(WMText
*tPtr
, Bool direction
);
1638 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1640 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1642 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1644 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1646 int WMGetTextRulerShown(WMText
*tPtr
);
1648 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1650 int WMGetTextEditable(WMText
*tPtr
);
1652 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1654 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1656 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1658 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1660 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1662 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1664 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1666 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1668 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1670 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1672 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1674 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1676 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1678 void WMPrependTextStream(WMText
*tPtr
, const char *text
);
1680 void WMAppendTextStream(WMText
*tPtr
, const char *text
);
1682 #define WMClearText(tPtr) WMAppendTextStream \
1686 char* WMGetTextStream(WMText
*tPtr
);
1689 char* WMGetTextSelectedStream(WMText
*tPtr
);
1691 /* destroy the array */
1692 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1694 /* destroy the array */
1695 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1697 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1699 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1701 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1703 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1705 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1707 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1709 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1711 Bool
WMFindInTextStream(WMText
*tPtr
, const char *needle
, Bool direction
,
1712 Bool caseSensitive
);
1714 /* Warning: replacement can be modified by the function */
1715 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1718 /* parser related stuff... use only if implementing a new parser */
1720 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, const char *description
,
1721 WMColor
*color
, unsigned short first
,
1722 unsigned short extraInfo
);
1724 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, const char *description
,
1725 WMColor
*color
, unsigned short first
,
1726 unsigned short extraInfo
);
1728 void* WMCreateTextBlockWithText(WMText
*tPtr
, const char *text
, WMFont
*font
,
1729 WMColor
*color
, unsigned short first
,
1730 unsigned short length
);
1732 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1733 unsigned int kanji
, unsigned int underlined
,
1734 int script
, WMRulerMargins
*margins
);
1736 /* do NOT free the margins */
1737 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1738 unsigned int *kanji
, unsigned int *underlined
,
1739 int *script
, WMRulerMargins
*margins
);
1741 int WMGetTextInsertType(WMText
*tPtr
);
1743 /*int WMGetTextBlocks(WMText *tPtr);
1745 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1747 int WMGetCurrentTextBlock(WMText *tPtr);*/
1749 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1751 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1753 void* WMRemoveTextBlock(WMText
*tPtr
);
1755 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1757 /* ---[ WINGs/wtabview.c ]------------------------------------------------ */
1759 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1761 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1763 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1765 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1767 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1769 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1771 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1773 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1774 int identifier
, const char *label
);
1776 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1778 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1780 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1782 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1784 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1786 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1788 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1790 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1792 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1795 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1797 void WMSetTabViewItemEnabled(WMTabViewItem
*tPtr
, Bool flag
);
1799 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1801 void WMSetTabViewItemLabel(WMTabViewItem
*item
, const char *label
);
1803 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1805 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1807 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1809 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1812 /* ---[ WINGs/wbox.c ]---------------------------------------------------- */
1814 WMBox
* WMCreateBox(WMWidget
*parent
);
1816 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1818 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1819 int minSize
, int maxSize
, int space
);
1821 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1822 int minSize
, int maxSize
, int space
);
1824 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1826 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1828 /* ---[ WINGs/wpanel.c ]-------------------------------------------------- */
1830 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
, const char *msg
,
1831 const char *defaultButton
, const char *alternateButton
,
1832 const char *otherButton
);
1834 /* you can free the returned string */
1835 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
, const char *msg
,
1836 const char *defaultText
, const char *okButton
, const char *cancelButton
);
1838 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1839 const char *msg
, const char *defaultButton
,
1840 const char *alternateButton
, const char *otherButton
);
1842 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1843 const char *msg
, const char *defaultText
, const char *okButton
,
1844 const char *cancelButton
);
1847 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1848 const char *title
, const char *defaultButton
,
1849 const char *alternateButton
);
1851 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1853 void WMDestroyInputPanel(WMInputPanel
*panel
);
1855 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1857 /* ---[ WINGs/wfilepanel.c ]---------------------------------------------- */
1859 /* only 1 instance per WMScreen */
1860 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1862 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1864 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1866 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1868 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1870 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1872 /* you can free the returned string */
1873 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1875 void WMFreeFilePanel(WMFilePanel
*panel
);
1877 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1878 char *path
, const char *name
, char **fileTypes
);
1880 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1882 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1885 /* ---[ WINGs/wfontpanel.c ]---------------------------------------------- */
1887 /* only 1 instance per WMScreen */
1888 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1890 void WMShowFontPanel(WMFontPanel
*panel
);
1892 void WMHideFontPanel(WMFontPanel
*panel
);
1894 void WMFreeFontPanel(WMFontPanel
*panel
);
1896 void WMSetFontPanelAction(WMFontPanel
*panel
, WMAction2
*action
, void *data
);
1898 void WMSetFontPanelFont(WMFontPanel
*panel
, const char *fontName
);
1900 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1902 /* ---[ WINGs/configuration.c ]------------------------------------------- */
1903 unsigned W_getconf_mouseWheelUp(void);
1904 unsigned W_getconf_mouseWheelDown(void);
1905 void W_setconf_doubleClickDelay(int value
);
1909 #endif /* __cplusplus */
1912 /* These definitions are not meant to be seen outside this file */
1913 #undef _wings_noreturn