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 20140612
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
133 /* button behaviour masks */
135 WBBSpringLoadedMask
= (1 << 0),
136 WBBPushInMask
= (1 << 1),
137 WBBPushChangeMask
= (1 << 2),
138 WBBPushLightMask
= (1 << 3),
139 WBBStateLightMask
= (1 << 5),
140 WBBStateChangeMask
= (1 << 6),
141 WBBStatePushMask
= (1 << 7)
145 /* frame title positions */
169 /* alignment types */
174 WAJustified
/* not valid for textfields */
190 /* scroller arrow position */
195 } WMScrollArrowPosition
;
210 /* usable scroller parts */
215 } WMUsableScrollerParts
;
227 WTTopTabsBevelBorder
,
234 /* text movement types */
236 WMIllegalTextMovement
,
237 WMReturnTextMovement
,
238 WMEscapeTextMovement
,
240 WMBacktabTextMovement
,
247 /* text field special events */
255 WLNotFound
= -1 /* element was not found in WMList */
259 /* drag operations */
267 } WMDragOperationType
;
271 WMGrayModeColorPanel
= 1,
272 WMRGBModeColorPanel
= 2,
273 WMCMYKModeColorPanel
= 3,
274 WMHSBModeColorPanel
= 4,
275 WMCustomPaletteModeColorPanel
= 5,
276 WMColorListModeColorPanel
= 6,
277 WMWheelModeColorPanel
= 7
283 #define WSIReturnArrow 1
284 #define WSIHighlightedReturnArrow 2
285 #define WSIScrollerDimple 3
286 #define WSIArrowLeft 4
287 #define WSIHighlightedArrowLeft 5
288 #define WSIArrowRight 6
289 #define WSIHighlightedArrowRight 7
291 #define WSIHighlightedArrowUp 9
292 #define WSIArrowDown 10
293 #define WSIHighlightedArrowDown 11
294 #define WSICheckMark 12
297 WLDSSelected
= (1 << 16),
298 WLDSDisabled
= (1 << 17),
299 WLDSFocused
= (1 << 18),
300 WLDSIsBranch
= (1 << 19)
303 /* alert panel return values */
313 /* types of input observers */
315 WIReadMask
= (1 << 0),
316 WIWriteMask
= (1 << 1),
317 WIExceptMask
= (1 << 2)
337 WC_Matrix
= 12, /* not ready */
340 WC_ProgressIndicator
= 15,
347 /* All widgets must start with the following structure
348 * in that order. Used for typecasting to get some generic data */
349 typedef struct W_WidgetType
{
356 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
357 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
362 typedef void WMWidget
;
364 typedef struct W_Pixmap WMPixmap
;
365 typedef struct W_Font WMFont
;
366 typedef struct W_Color WMColor
;
368 typedef struct W_Screen WMScreen
;
370 typedef struct W_View WMView
;
372 typedef struct W_Window WMWindow
;
373 typedef struct W_Frame WMFrame
;
374 typedef struct W_Button WMButton
;
375 typedef struct W_Label WMLabel
;
376 typedef struct W_TextField WMTextField
;
377 typedef struct W_Scroller WMScroller
;
378 typedef struct W_ScrollView WMScrollView
;
379 typedef struct W_List WMList
;
380 typedef struct W_Browser WMBrowser
;
381 typedef struct W_PopUpButton WMPopUpButton
;
382 typedef struct W_ProgressIndicator WMProgressIndicator
;
383 typedef struct W_ColorWell WMColorWell
;
384 typedef struct W_Slider WMSlider
;
385 typedef struct W_Matrix WMMatrix
; /* not ready */
386 typedef struct W_SplitView WMSplitView
;
387 typedef struct W_TabView WMTabView
;
388 typedef struct W_Ruler WMRuler
;
389 typedef struct W_Text WMText
;
390 typedef struct W_Box WMBox
;
394 typedef struct W_TabViewItem WMTabViewItem
;
395 typedef struct W_MenuItem WMMenuItem
;
398 typedef struct W_FilePanel WMFilePanel
;
399 typedef WMFilePanel WMOpenPanel
;
400 typedef WMFilePanel WMSavePanel
;
402 typedef struct W_FontPanel WMFontPanel
;
404 typedef struct W_ColorPanel WMColorPanel
;
407 /* item for WMList */
408 typedef struct WMListItem
{
410 void *clientData
; /* ptr for user clientdata. */
412 unsigned int uflags
:16; /* flags for the user */
413 unsigned int selected
:1;
414 unsigned int disabled
:1;
415 unsigned int isBranch
:1;
416 unsigned int loaded
:1;
419 /* struct for message panel */
420 typedef struct WMAlertPanel
{
421 WMWindow
*win
; /* window */
424 WMButton
*defBtn
; /* default button */
425 WMButton
*altBtn
; /* alternative button */
426 WMButton
*othBtn
; /* other button */
427 WMLabel
*iLbl
; /* icon label */
428 WMLabel
*tLbl
; /* title label */
429 WMLabel
*mLbl
; /* message label */
430 WMFrame
*line
; /* separator */
431 short result
; /* button that was pushed */
435 typedef struct WMGenericPanel
{
454 typedef struct WMInputPanel
{
455 WMWindow
*win
; /* window */
456 WMButton
*defBtn
; /* default button */
457 WMButton
*altBtn
; /* alternative button */
458 WMLabel
*tLbl
; /* title label */
459 WMLabel
*mLbl
; /* message label */
460 WMTextField
*text
; /* text field */
461 short result
; /* button that was pushed */
465 /* Basic font styles. Used to easily get one style from another */
466 typedef enum WMFontStyle
{
476 WMArray
*tabs
; /* a growable array of tabstops */
477 unsigned short left
; /* left margin marker */
478 unsigned short right
; /* right margin marker */
479 unsigned short first
; /* indentation marker for first line only */
480 unsigned short body
; /* body indentation marker */
481 unsigned short retainCount
;
483 /* All indentation and tab markers are _relative_ to the left margin marker */
486 typedef void WMEventProc(XEvent
*event
, void *clientData
);
488 typedef void WMEventHook(XEvent
*event
);
490 /* self is set to the widget from where the callback is being called and
491 * clientData to the data set to with WMSetClientData() */
492 typedef void WMAction(WMWidget
*self
, void *clientData
);
494 /* same as WMAction, but for stuff that arent widgets */
495 typedef void WMAction2(void *self
, void *clientData
);
498 /* delegate method like stuff */
499 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
500 int state
, WMRect
*rect
);
504 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
505 unsigned int oldWidth,
506 unsigned int oldHeight);
509 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
510 int *minSize
, int *maxSize
);
512 typedef WMWidget
* WMMatrixCreateCellProc(WMMatrix
*mPtr
);
517 typedef struct WMBrowserDelegate
{
520 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
521 WMBrowser
*sender
, int column
, WMList
*list
);
523 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
526 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
528 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
532 typedef struct WMTextFieldDelegate
{
535 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
536 WMNotification
*notif
);
538 void (*didChange
)(struct WMTextFieldDelegate
*self
,
539 WMNotification
*notif
);
541 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
542 WMNotification
*notif
);
544 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
547 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
549 } WMTextFieldDelegate
;
552 typedef struct WMTextDelegate
{
555 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
562 typedef struct WMTabViewDelegate
{
565 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
568 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
569 WMTabViewItem
*item
);
571 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
572 WMTabViewItem
*item
);
574 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
575 WMTabViewItem
*item
);
581 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
582 Time timestamp
, void *cdata
, WMData
*data
);
585 typedef struct WMSelectionProcs
{
586 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
587 void *cdata
, Atom
*type
);
588 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
589 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
594 typedef struct W_DraggingInfo WMDraggingInfo
;
597 /* links a label to a dnd operation. */
598 typedef struct W_DragOperationtItem WMDragOperationItem
;
601 typedef struct W_DragSourceProcs
{
602 WMArray
* (*dropDataTypes
)(WMView
*self
);
603 WMDragOperationType (*wantedDropOperation
)(WMView
*self
);
604 WMArray
* (*askedOperations
)(WMView
*self
);
605 Bool (*acceptDropOperation
)(WMView
*self
, WMDragOperationType operation
);
606 void (*beganDrag
)(WMView
*self
, WMPoint
*point
);
607 void (*endedDrag
)(WMView
*self
, WMPoint
*point
, Bool deposited
);
608 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
609 /*Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
614 typedef struct W_DragDestinationProcs
{
615 void (*prepareForDragOperation
)(WMView
*self
);
616 WMArray
* (*requiredDataTypes
)(WMView
*self
, WMDragOperationType request
,
617 WMArray
*sourceDataTypes
);
618 WMDragOperationType (*allowedOperation
)(WMView
*self
,
619 WMDragOperationType request
,
620 WMArray
*sourceDataTypes
);
621 Bool (*inspectDropData
)(WMView
*self
, WMArray
*dropData
);
622 void (*performDragOperation
)(WMView
*self
, WMArray
*dropData
,
623 WMArray
*operations
, WMPoint
*dropLocation
);
624 void (*concludeDragOperation
)(WMView
*self
);
625 } WMDragDestinationProcs
;
628 /* ---[ WINGs/wmisc.c ]--------------------------------------------------- */
631 WMPoint
wmkpoint(int x
, int y
);
633 WMSize
wmksize(unsigned int width
, unsigned int height
);
635 WMRect
wmkrect(int x
, int y
, unsigned int width
, unsigned int height
);
637 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
638 #define wmksize(width, height) (WMSize){(width), (height)}
639 #define wmkpoint(x, y) (WMPoint){(x), (y)}
642 /* ---[ WINGs/wapplication.c ]-------------------------------------------- */
645 void WMInitializeApplication(const char *applicationName
, int *argc
, char **argv
);
647 /* You're supposed to call this funtion before exiting so WINGs can terminate properly */
648 void WMReleaseApplication(void);
650 void WMSetResourcePath(const char *path
);
652 /* don't free the returned string */
653 char* WMGetApplicationName(void);
655 /* Try to locate resource file. ext may be NULL */
656 char* WMPathForResourceOfType(const char *resource
, const char *ext
);
658 /* ---[ WINGs/widgets.c ]------------------------------------------------- */
660 WMScreen
* WMOpenScreen(const char *display
);
662 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
665 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
667 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
669 _wings_noreturn
void WMScreenMainLoop(WMScreen
*scr
);
671 void WMBreakModalLoop(WMScreen
*scr
);
673 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
675 RContext
* WMScreenRContext(WMScreen
*scr
);
677 Display
* WMScreenDisplay(WMScreen
*scr
);
679 int WMScreenDepth(WMScreen
*scr
);
681 void WMSetFocusToWidget(WMWidget
*widget
);
683 /* ---[ WINGs/wappresource.c ]-------------------------------------------- */
685 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
687 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
689 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
691 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
693 /* If color==NULL it will use the default color for panels: ae/aa/ae */
694 WMPixmap
* WMCreateApplicationIconBlendedPixmap(WMScreen
*scr
, const RColor
*color
);
696 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
698 /* ---[ WINGs/wevent.c ]-------------------------------------------------- */
700 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
702 int WMHandleEvent(XEvent
*event
);
704 Bool
WMScreenPending(WMScreen
*scr
);
706 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
707 WMEventProc
*eventProc
, void *clientData
);
709 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
710 WMEventProc
*eventProc
, void *clientData
);
712 int WMIsDoubleClick(XEvent
*event
);
714 /*int WMIsTripleClick(XEvent *event);*/
716 void WMNextEvent(Display
*dpy
, XEvent
*event
);
718 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
720 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
722 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
725 /* ---[ WINGs/selection.c ]----------------------------------------------- */
728 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
729 WMSelectionProcs
*procs
, void *cdata
);
731 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
733 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
734 Time timestamp
, WMSelectionCallback
*callback
,
738 extern char *WMSelectionOwnerDidChangeNotification
;
740 /* ---[ WINGs/dragcommon.c ]---------------------------------------------- */
742 WMArray
* WMCreateDragOperationArray(int initialSize
);
744 WMDragOperationItem
* WMCreateDragOperationItem(WMDragOperationType type
,
747 WMDragOperationType
WMGetDragOperationItemType(WMDragOperationItem
* item
);
749 char* WMGetDragOperationItemText(WMDragOperationItem
* item
);
751 /* ---[ WINGs/dragsource.c ]---------------------------------------------- */
753 void WMSetViewDragImage(WMView
* view
, WMPixmap
*dragImage
);
755 void WMReleaseViewDragImage(WMView
* view
);
757 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
759 Bool
WMIsDraggingFromView(WMView
*view
);
761 void WMDragImageFromView(WMView
*view
, XEvent
*event
);
763 /* Create a drag handler, associating drag event masks with dragEventProc */
764 void WMCreateDragHandler(WMView
*view
, WMEventProc
*dragEventProc
, void *clientData
);
766 void WMDeleteDragHandler(WMView
*view
, WMEventProc
*dragEventProc
, void *clientData
);
768 /* set default drag handler for view */
769 void WMSetViewDraggable(WMView
*view
, WMDragSourceProcs
*procs
, WMPixmap
*dragImage
);
771 void WMUnsetViewDraggable(WMView
*view
);
773 /* ---[ WINGs/dragdestination.c ]----------------------------------------- */
775 void WMRegisterViewForDraggedTypes(WMView
*view
, WMArray
*acceptedTypes
);
777 void WMUnregisterViewDraggedTypes(WMView
*view
);
779 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
781 /* ---[ WINGs/wfont.c ]--------------------------------------------------- */
783 Bool
WMIsAntialiasingEnabled(WMScreen
*scrPtr
);
785 WMFont
* WMCreateFont(WMScreen
*scrPtr
, const char *fontName
);
787 WMFont
* WMCopyFontWithStyle(WMScreen
*scrPtr
, WMFont
*font
, WMFontStyle style
);
789 WMFont
* WMRetainFont(WMFont
*font
);
791 void WMReleaseFont(WMFont
*font
);
793 char* WMGetFontName(WMFont
*font
);
795 unsigned int WMFontHeight(WMFont
*font
);
797 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
799 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
801 WMFont
* WMDefaultSystemFont(WMScreen
*scrPtr
);
803 WMFont
* WMDefaultBoldSystemFont(WMScreen
*scrPtr
);
805 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
807 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
809 void WMDrawString(WMScreen
*scr
, Drawable d
, WMColor
*color
, WMFont
*font
,
810 int x
, int y
, const char *text
, int length
);
812 void WMDrawImageString(WMScreen
*scr
, Drawable d
, WMColor
*color
,
813 WMColor
*background
, WMFont
*font
, int x
, int y
,
814 const char *text
, int length
);
816 int WMWidthOfString(WMFont
*font
, const char *text
, int length
);
818 /* ---[ WINGs/wpixmap.c ]------------------------------------------------- */
820 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
822 void WMReleasePixmap(WMPixmap
*pixmap
);
824 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
827 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
828 Pixmap mask
, int width
, int height
,
831 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
834 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
836 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
838 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, const char *fileName
);
840 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
841 const RColor
*color
);
843 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, const char *fileName
,
844 const RColor
*color
);
846 WMPixmap
* WMCreateScaledBlendedPixmapFromFile(WMScreen
*scrPtr
, const char *fileName
,
849 unsigned int height
);
851 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
853 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
855 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
857 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
859 /* ---[ WINGs/wcolor.c ]-------------------------------------------------- */
862 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
864 WMColor
* WMGrayColor(WMScreen
*scr
);
866 WMColor
* WMBlackColor(WMScreen
*scr
);
868 WMColor
* WMWhiteColor(WMScreen
*scr
);
870 void WMSetColorInGC(WMColor
*color
, GC gc
);
872 GC
WMColorGC(WMColor
*color
);
874 WMPixel
WMColorPixel(WMColor
*color
);
876 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
877 unsigned int width
, unsigned int height
);
879 void WMReleaseColor(WMColor
*color
);
881 WMColor
* WMRetainColor(WMColor
*color
);
883 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
884 unsigned short green
, unsigned short blue
,
887 WMColor
* WMCreateRGBAColor(WMScreen
*scr
, unsigned short red
,
888 unsigned short green
, unsigned short blue
,
889 unsigned short alpha
, Bool exact
);
891 WMColor
* WMCreateNamedColor(WMScreen
*scr
, const char *name
, Bool exact
);
893 RColor
WMGetRColorFromColor(WMColor
*color
);
895 void WMSetColorAlpha(WMColor
*color
, unsigned short alpha
);
897 unsigned short WMRedComponentOfColor(WMColor
*color
);
899 unsigned short WMGreenComponentOfColor(WMColor
*color
);
901 unsigned short WMBlueComponentOfColor(WMColor
*color
);
903 unsigned short WMGetColorAlpha(WMColor
*color
);
905 char* WMGetColorRGBDescription(WMColor
*color
);
907 /* ---[ WINGs/widgets.c ]------------------------------------------------- */
909 WMScreen
* WMWidgetScreen(WMWidget
*w
);
911 unsigned int WMScreenWidth(WMScreen
*scr
);
913 unsigned int WMScreenHeight(WMScreen
*scr
);
915 void WMUnmapWidget(WMWidget
*w
);
917 void WMMapWidget(WMWidget
*w
);
919 Bool
WMWidgetIsMapped(WMWidget
*w
);
921 void WMRaiseWidget(WMWidget
*w
);
923 void WMLowerWidget(WMWidget
*w
);
925 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
927 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
929 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
931 WMColor
* WMGetWidgetBackgroundColor(WMWidget
*w
);
933 void WMMapSubwidgets(WMWidget
*w
);
935 void WMUnmapSubwidgets(WMWidget
*w
);
937 void WMRealizeWidget(WMWidget
*w
);
939 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
941 void WMDestroyWidget(WMWidget
*widget
);
943 void WMHangData(WMWidget
*widget
, void *data
);
945 void* WMGetHangedData(WMWidget
*widget
);
947 unsigned int WMWidgetWidth(WMWidget
*w
);
949 unsigned int WMWidgetHeight(WMWidget
*w
);
951 Window
WMWidgetXID(WMWidget
*w
);
953 void WMRedisplayWidget(WMWidget
*w
);
955 /* ---[ WINGs/wview.c ]--------------------------------------------------- */
957 Window
WMViewXID(WMView
*view
);
959 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
961 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
962 int rightOffs
, int bottomOffs
);
964 WMSize
WMGetViewSize(WMView
*view
);
966 WMPoint
WMGetViewPosition(WMView
*view
);
968 WMPoint
WMGetViewScreenPosition(WMView
*view
);
970 WMWidget
* WMWidgetOfView(WMView
*view
);
973 extern char *WMViewSizeDidChangeNotification
;
975 extern char *WMViewFocusDidChangeNotification
;
977 extern char *WMViewRealizedNotification
;
979 /* ---[ WINGs/wballoon.c ]------------------------------------------------ */
981 void WMSetBalloonTextForView(const char *text
, WMView
*view
);
983 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
985 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
987 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
989 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
991 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
994 /* ---[ WINGs/wwindow.c ]------------------------------------------------- */
996 WMWindow
* WMCreateWindow(WMScreen
*screen
, const char *name
);
998 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, const char *name
, int style
);
1000 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, const char *name
,
1003 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, const char *name
);
1005 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
1007 void WMSetWindowTitle(WMWindow
*wPtr
, const char *title
);
1009 void WMSetWindowMiniwindowTitle(WMWindow
*win
, const char *title
);
1011 void WMSetWindowMiniwindowImage(WMWindow
*win
, RImage
*image
);
1013 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
1015 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
1017 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
1019 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
1021 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
1022 int maxX
, int maxY
);
1024 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
1026 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
1028 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
1030 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
1032 void WMSetWindowLevel(WMWindow
*win
, int level
);
1034 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
1036 void WMCloseWindow(WMWindow
*win
);
1038 /* ---[ WINGs/wbutton.c ]------------------------------------------------- */
1040 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
1042 #define WMCreateCommandButton(parent) \
1043 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1048 #define WMCreateRadioButton(parent) \
1049 WMCreateButton((parent), WBTRadio)
1051 #define WMCreateSwitchButton(parent) \
1052 WMCreateButton((parent), WBTSwitch)
1054 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
1056 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
1058 void WMSetButtonImageDefault(WMButton
*bPtr
);
1060 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
1062 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
1064 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
1066 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
1068 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
1070 void WMSetButtonText(WMButton
*bPtr
, const char *text
);
1072 void WMSetButtonAltText(WMButton
*bPtr
, const char *text
);
1074 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
1076 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1078 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1080 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1082 int WMGetButtonSelected(WMButton
*bPtr
);
1084 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1086 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1088 int WMGetButtonEnabled(WMButton
*bPtr
);
1090 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1092 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1094 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1096 void WMPerformButtonClick(WMButton
*bPtr
);
1098 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1100 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1102 /* ---[ WINGs/wlabel.c ]-------------------------------------------------- */
1104 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1106 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1108 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1110 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1112 char* WMGetLabelText(WMLabel
*lPtr
);
1114 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1116 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1118 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1120 void WMSetLabelText(WMLabel
*lPtr
, const char *text
);
1122 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1124 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1126 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1128 /* ---[ WINGs/wframe.c ]-------------------------------------------------- */
1130 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1132 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1134 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1136 void WMSetFrameTitle(WMFrame
*fPtr
, const char *title
);
1138 void WMSetFrameTitleColor(WMFrame
*fPtr
, WMColor
*color
);
1140 /* ---[ WINGs/wtextfield.c ]---------------------------------------------- */
1142 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1144 void WMInsertTextFieldText(WMTextField
*tPtr
, const char *text
, int position
);
1146 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1148 /* you can free the returned string */
1149 char* WMGetTextFieldText(WMTextField
*tPtr
);
1151 void WMSetTextFieldText(WMTextField
*tPtr
, const char *text
);
1153 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1155 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1157 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1159 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1161 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1163 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1165 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1167 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1169 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1171 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1173 unsigned WMGetTextFieldCursorPosition(WMTextField
*tPtr
);
1175 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1177 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1179 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1181 WMTextFieldDelegate
* WMGetTextFieldDelegate(WMTextField
*tPtr
);
1183 extern char *WMTextDidChangeNotification
;
1184 extern char *WMTextDidBeginEditingNotification
;
1185 extern char *WMTextDidEndEditingNotification
;
1187 /* ---[ WINGs/wscroller.c ]----------------------------------------------- */
1189 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1191 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1192 float knobProportion
);
1194 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1196 float WMGetScrollerValue(WMScroller
*sPtr
);
1198 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1200 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1202 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1203 WMScrollArrowPosition position
);
1205 extern char *WMScrollerDidScrollNotification
;
1207 /* ---[ WINGs/wlist.c ]--------------------------------------------------- */
1209 WMList
* WMCreateList(WMWidget
*parent
);
1211 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1213 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1215 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1217 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, const char *text
);
1219 void WMSortListItems(WMList
*lPtr
);
1221 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1223 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, const char *title
);
1225 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1227 WMArray
* WMGetListItems(WMList
*lPtr
);
1229 void WMRemoveListItem(WMList
*lPtr
, int row
);
1231 void WMSelectListItem(WMList
*lPtr
, int row
);
1233 void WMUnselectListItem(WMList
*lPtr
, int row
);
1235 /* This will select all items in range, and deselect all the others */
1236 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1238 /* This will select all items in range, leaving the others as they are */
1239 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1241 void WMSelectAllListItems(WMList
*lPtr
);
1243 void WMUnselectAllListItems(WMList
*lPtr
);
1245 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1247 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1249 int WMGetListItemHeight(WMList
*lPtr
);
1251 /* don't free the returned data */
1252 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1255 * For the following 2 functions, in case WMList allows multiple selection,
1256 * the first item in the list of selected items, respective its row number,
1260 /* don't free the returned data */
1261 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1263 int WMGetListSelectedItemRow(WMList
*lPtr
);
1265 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1267 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1269 void WMClearList(WMList
*lPtr
);
1271 int WMGetListNumberOfRows(WMList
*lPtr
);
1273 void WMSetListPosition(WMList
*lPtr
, int row
);
1275 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1277 int WMGetListPosition(WMList
*lPtr
);
1279 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1281 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1284 extern char *WMListDidScrollNotification
;
1285 extern char *WMListSelectionDidChangeNotification
;
1287 /* ---[ WINGs/wbrowser.c ]------------------------------------------------ */
1289 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1291 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1293 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1295 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, const char *separator
);
1297 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1299 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1301 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1303 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1305 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1307 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, const char *title
);
1309 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, const char *text
, Bool isBranch
);
1311 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1313 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1314 WMCompareDataProc
*func
);
1316 /* Don't free the returned string. */
1317 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1319 /* free the returned string */
1320 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1322 /* free the returned string */
1323 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1325 /* free the returned array */
1326 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1328 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1330 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1333 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1335 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1337 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1339 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1341 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1343 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1345 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1347 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1349 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1351 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1353 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1355 /* ---[ WINGs/wmenuitem.c ]----------------------------------------------- */
1358 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1360 WMMenuItem
* WMCreateMenuItem(void);
1362 void WMDestroyMenuItem(WMMenuItem
*item
);
1364 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1366 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1368 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1370 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1372 void WMSetMenuItemShortcut(WMMenuItem
*item
, const char *shortcut
);
1374 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1376 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1378 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1380 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1382 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1384 void* WMGetMenuItemData(WMMenuItem
*item
);
1386 void WMSetMenuItemTitle(WMMenuItem
*item
, const char *title
);
1388 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1390 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1392 int WMGetMenuItemState(WMMenuItem
*item
);
1394 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1396 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1398 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1400 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1402 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1404 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1406 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1408 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1410 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1413 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1415 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1418 /* ---[ WINGs/wpopupbutton.c ]-------------------------------------------- */
1420 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1422 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1425 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1427 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, const char *title
);
1429 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1432 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1434 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1436 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1438 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1440 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1442 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, const char *text
);
1444 /* don't free the returned data */
1445 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1447 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1449 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1451 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1453 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1455 /* ---[ WINGs/wprogressindicator.c ]------------------------------------- */
1457 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1459 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1461 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1463 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1465 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1467 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1469 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1471 /* ---[ WINGs/wcolorpanel.c ]--------------------------------------------- */
1473 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1475 void WMFreeColorPanel(WMColorPanel
*panel
);
1477 void WMShowColorPanel(WMColorPanel
*panel
);
1479 void WMCloseColorPanel(WMColorPanel
*panel
);
1481 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1483 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1485 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1487 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1489 extern char *WMColorPanelColorChangedNotification
;
1491 /* ---[ WINGs/wcolorwell.c ]---------------------------------------------- */
1493 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1495 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1497 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1499 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1502 extern char *WMColorWellDidChangeNotification
;
1505 /* ---[ WINGs/wscrollview.c ]--------------------------------------------- */
1507 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1509 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1510 unsigned int height
);
1512 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1514 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1516 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1518 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1520 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1522 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1524 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1526 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1528 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1530 /* ---[ WINGs/wslider.c ]------------------------------------------------- */
1532 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1534 int WMGetSliderMinValue(WMSlider
*slider
);
1536 int WMGetSliderMaxValue(WMSlider
*slider
);
1538 int WMGetSliderValue(WMSlider
*slider
);
1540 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1542 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1544 void WMSetSliderValue(WMSlider
*slider
, int value
);
1546 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1548 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1550 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1552 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1554 /* ---[ WINGs/wsplitview.c ]---------------------------------------------- */
1557 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1559 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1561 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1563 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1565 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1567 /* remove the first subview == view */
1568 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1570 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1573 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1575 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1577 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1578 WMSplitViewConstrainProc
*proc
);
1581 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1582 WMSplitViewResizeSubviewsProc *proc);
1585 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1587 /* ...................................................................... */
1589 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1591 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1593 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1595 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1597 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1599 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1601 int WMGetRulerOffset(WMRuler
*rPtr
);
1603 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1605 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1607 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1609 /* ....................................................................... */
1612 #define WMCreateText(parent) WMCreateTextForDocumentType \
1613 ((parent), (NULL), (NULL))
1615 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1618 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1620 void WMFreezeText(WMText
*tPtr
);
1622 #define WMRefreshText(tPtr) WMThawText((tPtr))
1624 void WMThawText(WMText
*tPtr
);
1626 int WMScrollText(WMText
*tPtr
, int amount
);
1628 int WMPageText(WMText
*tPtr
, Bool direction
);
1630 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1632 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1634 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1636 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1638 int WMGetTextRulerShown(WMText
*tPtr
);
1640 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1642 int WMGetTextEditable(WMText
*tPtr
);
1644 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1646 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1648 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1650 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1652 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1654 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1656 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1658 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1660 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1662 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1664 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1666 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1668 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1670 void WMPrependTextStream(WMText
*tPtr
, const char *text
);
1672 void WMAppendTextStream(WMText
*tPtr
, const char *text
);
1674 #define WMClearText(tPtr) WMAppendTextStream \
1678 char* WMGetTextStream(WMText
*tPtr
);
1681 char* WMGetTextSelectedStream(WMText
*tPtr
);
1683 /* destroy the array */
1684 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1686 /* destroy the array */
1687 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1689 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1691 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1693 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1695 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1697 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1699 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1701 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1703 Bool
WMFindInTextStream(WMText
*tPtr
, const char *needle
, Bool direction
,
1704 Bool caseSensitive
);
1706 /* Warning: replacement can be modified by the function */
1707 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1710 /* parser related stuff... use only if implementing a new parser */
1712 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, const char *description
,
1713 WMColor
*color
, unsigned short first
,
1714 unsigned short extraInfo
);
1716 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, const char *description
,
1717 WMColor
*color
, unsigned short first
,
1718 unsigned short extraInfo
);
1720 void* WMCreateTextBlockWithText(WMText
*tPtr
, const char *text
, WMFont
*font
,
1721 WMColor
*color
, unsigned short first
,
1722 unsigned short length
);
1724 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1725 unsigned int kanji
, unsigned int underlined
,
1726 int script
, WMRulerMargins
*margins
);
1728 /* do NOT free the margins */
1729 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1730 unsigned int *kanji
, unsigned int *underlined
,
1731 int *script
, WMRulerMargins
*margins
);
1733 int WMGetTextInsertType(WMText
*tPtr
);
1735 /*int WMGetTextBlocks(WMText *tPtr);
1737 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1739 int WMGetCurrentTextBlock(WMText *tPtr);*/
1741 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1743 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1745 void* WMRemoveTextBlock(WMText
*tPtr
);
1747 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1749 /* ---[ WINGs/wtabview.c ]------------------------------------------------ */
1751 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1753 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1755 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1757 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1759 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1761 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1763 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1765 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1766 int identifier
, const char *label
);
1768 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1770 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1772 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1774 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1776 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1778 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1780 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1782 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1784 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1787 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1789 void WMSetTabViewItemEnabled(WMTabViewItem
*tPtr
, Bool flag
);
1791 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1793 void WMSetTabViewItemLabel(WMTabViewItem
*item
, const char *label
);
1795 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1797 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1799 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1801 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1804 /* ---[ WINGs/wbox.c ]---------------------------------------------------- */
1806 WMBox
* WMCreateBox(WMWidget
*parent
);
1808 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1810 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1811 int minSize
, int maxSize
, int space
);
1813 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1814 int minSize
, int maxSize
, int space
);
1816 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1818 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1820 /* ---[ WINGs/wpanel.c ]-------------------------------------------------- */
1822 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
, const char *msg
,
1823 const char *defaultButton
, const char *alternateButton
,
1824 const char *otherButton
);
1826 /* you can free the returned string */
1827 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
, const char *msg
,
1828 const char *defaultText
, const char *okButton
, const char *cancelButton
);
1830 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1831 const char *msg
, const char *defaultButton
,
1832 const char *alternateButton
, const char *otherButton
);
1834 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1835 const char *msg
, const char *defaultText
, const char *okButton
,
1836 const char *cancelButton
);
1839 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1840 const char *title
, const char *defaultButton
,
1841 const char *alternateButton
);
1843 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1845 void WMDestroyInputPanel(WMInputPanel
*panel
);
1847 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1849 /* ---[ WINGs/wfilepanel.c ]---------------------------------------------- */
1851 /* only 1 instance per WMScreen */
1852 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1854 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1856 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1858 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1860 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1862 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1864 /* you can free the returned string */
1865 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1867 void WMFreeFilePanel(WMFilePanel
*panel
);
1869 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1870 char *path
, const char *name
, char **fileTypes
);
1872 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1874 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1877 /* ---[ WINGs/wfontpanel.c ]---------------------------------------------- */
1879 /* only 1 instance per WMScreen */
1880 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1882 void WMShowFontPanel(WMFontPanel
*panel
);
1884 void WMHideFontPanel(WMFontPanel
*panel
);
1886 void WMFreeFontPanel(WMFontPanel
*panel
);
1888 void WMSetFontPanelAction(WMFontPanel
*panel
, WMAction2
*action
, void *data
);
1890 void WMSetFontPanelFont(WMFontPanel
*panel
, const char *fontName
);
1892 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1894 /* ---[ WINGs/configuration.c ]------------------------------------------- */
1895 unsigned W_getconf_mouseWheelUp(void);
1896 unsigned W_getconf_mouseWheelDown(void);
1897 void W_setconf_doubleClickDelay(int value
);
1901 #endif /* __cplusplus */
1904 /* These definitions are not meant to be seen outside this file */
1905 #undef _wings_noreturn