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 20141205
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 WMSetWidgetBackgroundPixmap(WMWidget
*w
, WMPixmap
*pix
);
935 WMPixmap
*WMGetWidgetBackgroundPixmap(WMWidget
*w
);
937 void WMMapSubwidgets(WMWidget
*w
);
939 void WMUnmapSubwidgets(WMWidget
*w
);
941 void WMRealizeWidget(WMWidget
*w
);
943 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
945 void WMDestroyWidget(WMWidget
*widget
);
947 void WMHangData(WMWidget
*widget
, void *data
);
949 void* WMGetHangedData(WMWidget
*widget
);
951 unsigned int WMWidgetWidth(WMWidget
*w
);
953 unsigned int WMWidgetHeight(WMWidget
*w
);
955 Window
WMWidgetXID(WMWidget
*w
);
957 void WMRedisplayWidget(WMWidget
*w
);
959 /* ---[ WINGs/wview.c ]--------------------------------------------------- */
961 Window
WMViewXID(WMView
*view
);
963 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
965 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
966 int rightOffs
, int bottomOffs
);
968 WMSize
WMGetViewSize(WMView
*view
);
970 WMPoint
WMGetViewPosition(WMView
*view
);
972 WMPoint
WMGetViewScreenPosition(WMView
*view
);
974 WMWidget
* WMWidgetOfView(WMView
*view
);
977 extern char *WMViewSizeDidChangeNotification
;
979 extern char *WMViewFocusDidChangeNotification
;
981 extern char *WMViewRealizedNotification
;
983 /* ---[ WINGs/wballoon.c ]------------------------------------------------ */
985 void WMSetBalloonTextForView(const char *text
, WMView
*view
);
987 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
989 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
991 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
993 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
995 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
998 /* ---[ WINGs/wwindow.c ]------------------------------------------------- */
1000 WMWindow
* WMCreateWindow(WMScreen
*screen
, const char *name
);
1002 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, const char *name
, int style
);
1004 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, const char *name
,
1007 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, const char *name
);
1009 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
1011 void WMSetWindowTitle(WMWindow
*wPtr
, const char *title
);
1013 void WMSetWindowMiniwindowTitle(WMWindow
*win
, const char *title
);
1015 void WMSetWindowMiniwindowImage(WMWindow
*win
, RImage
*image
);
1017 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
1019 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
1021 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
1023 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
1025 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
1026 int maxX
, int maxY
);
1028 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
1030 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
1032 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
1034 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
1036 void WMSetWindowLevel(WMWindow
*win
, int level
);
1038 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
1040 void WMCloseWindow(WMWindow
*win
);
1042 /* ---[ WINGs/wbutton.c ]------------------------------------------------- */
1044 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
1046 #define WMCreateCommandButton(parent) \
1047 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1052 #define WMCreateRadioButton(parent) \
1053 WMCreateButton((parent), WBTRadio)
1055 #define WMCreateSwitchButton(parent) \
1056 WMCreateButton((parent), WBTSwitch)
1058 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
1060 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
1062 void WMSetButtonImageDefault(WMButton
*bPtr
);
1064 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
1066 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
1068 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
1070 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
1072 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
1074 void WMSetButtonText(WMButton
*bPtr
, const char *text
);
1076 /* Returns direct pointer to internal data, do not modify! */
1077 const char *WMGetButtonText(WMButton
*bPtr
);
1079 void WMSetButtonAltText(WMButton
*bPtr
, const char *text
);
1081 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
1083 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1085 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1087 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1089 int WMGetButtonSelected(WMButton
*bPtr
);
1091 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1093 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1095 int WMGetButtonEnabled(WMButton
*bPtr
);
1097 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1099 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1101 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1103 void WMPerformButtonClick(WMButton
*bPtr
);
1105 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1107 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1109 /* ---[ WINGs/wlabel.c ]-------------------------------------------------- */
1111 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1113 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1115 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1117 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1119 char* WMGetLabelText(WMLabel
*lPtr
);
1121 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1123 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1125 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1127 void WMSetLabelText(WMLabel
*lPtr
, const char *text
);
1129 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1131 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1133 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1135 /* ---[ WINGs/wframe.c ]-------------------------------------------------- */
1137 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1139 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1141 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1143 void WMSetFrameTitle(WMFrame
*fPtr
, const char *title
);
1145 void WMSetFrameTitleColor(WMFrame
*fPtr
, WMColor
*color
);
1147 /* ---[ WINGs/wtextfield.c ]---------------------------------------------- */
1149 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1151 void WMInsertTextFieldText(WMTextField
*tPtr
, const char *text
, int position
);
1153 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1155 /* you can free the returned string */
1156 char* WMGetTextFieldText(WMTextField
*tPtr
);
1158 void WMSetTextFieldText(WMTextField
*tPtr
, const char *text
);
1160 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1162 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1164 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1166 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1168 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1170 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1172 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1174 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1176 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1178 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1180 unsigned WMGetTextFieldCursorPosition(WMTextField
*tPtr
);
1182 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1184 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1186 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1188 WMTextFieldDelegate
* WMGetTextFieldDelegate(WMTextField
*tPtr
);
1190 extern char *WMTextDidChangeNotification
;
1191 extern char *WMTextDidBeginEditingNotification
;
1192 extern char *WMTextDidEndEditingNotification
;
1194 /* ---[ WINGs/wscroller.c ]----------------------------------------------- */
1196 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1198 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1199 float knobProportion
);
1201 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1203 float WMGetScrollerValue(WMScroller
*sPtr
);
1205 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1207 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1209 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1210 WMScrollArrowPosition position
);
1212 extern char *WMScrollerDidScrollNotification
;
1214 /* ---[ WINGs/wlist.c ]--------------------------------------------------- */
1216 WMList
* WMCreateList(WMWidget
*parent
);
1218 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1220 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1222 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1224 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, const char *text
);
1226 void WMSortListItems(WMList
*lPtr
);
1228 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1230 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, const char *title
);
1232 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1234 WMArray
* WMGetListItems(WMList
*lPtr
);
1236 void WMRemoveListItem(WMList
*lPtr
, int row
);
1238 void WMSelectListItem(WMList
*lPtr
, int row
);
1240 void WMUnselectListItem(WMList
*lPtr
, int row
);
1242 /* This will select all items in range, and deselect all the others */
1243 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1245 /* This will select all items in range, leaving the others as they are */
1246 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1248 void WMSelectAllListItems(WMList
*lPtr
);
1250 void WMUnselectAllListItems(WMList
*lPtr
);
1252 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1254 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1256 int WMGetListItemHeight(WMList
*lPtr
);
1258 /* don't free the returned data */
1259 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1262 * For the following 2 functions, in case WMList allows multiple selection,
1263 * the first item in the list of selected items, respective its row number,
1267 /* don't free the returned data */
1268 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1270 int WMGetListSelectedItemRow(WMList
*lPtr
);
1272 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1274 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1276 void WMClearList(WMList
*lPtr
);
1278 int WMGetListNumberOfRows(WMList
*lPtr
);
1280 void WMSetListPosition(WMList
*lPtr
, int row
);
1282 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1284 int WMGetListPosition(WMList
*lPtr
);
1286 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1288 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1291 extern char *WMListDidScrollNotification
;
1292 extern char *WMListSelectionDidChangeNotification
;
1294 /* ---[ WINGs/wbrowser.c ]------------------------------------------------ */
1296 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1298 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1300 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1302 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, const char *separator
);
1304 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1306 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1308 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1310 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1312 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1314 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, const char *title
);
1316 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, const char *text
, Bool isBranch
);
1318 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1320 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1321 WMCompareDataProc
*func
);
1323 /* Don't free the returned string. */
1324 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1326 /* free the returned string */
1327 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1329 /* free the returned string */
1330 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1332 /* free the returned array */
1333 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1335 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1337 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1340 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1342 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1344 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1346 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1348 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1350 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1352 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1354 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1356 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1358 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1360 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1362 /* ---[ WINGs/wmenuitem.c ]----------------------------------------------- */
1365 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1367 WMMenuItem
* WMCreateMenuItem(void);
1369 void WMDestroyMenuItem(WMMenuItem
*item
);
1371 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1373 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1375 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1377 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1379 void WMSetMenuItemShortcut(WMMenuItem
*item
, const char *shortcut
);
1381 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1383 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1385 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1387 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1389 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1391 void* WMGetMenuItemData(WMMenuItem
*item
);
1393 void WMSetMenuItemTitle(WMMenuItem
*item
, const char *title
);
1395 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1397 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1399 int WMGetMenuItemState(WMMenuItem
*item
);
1401 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1403 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1405 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1407 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1409 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1411 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1413 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1415 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1417 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1420 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1422 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1425 /* ---[ WINGs/wpopupbutton.c ]-------------------------------------------- */
1427 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1429 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1432 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1434 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, const char *title
);
1436 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1439 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1441 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1443 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1445 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1447 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1449 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, const char *text
);
1451 /* don't free the returned data */
1452 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1454 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1456 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1458 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1460 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1462 /* ---[ WINGs/wprogressindicator.c ]------------------------------------- */
1464 WMProgressIndicator
* WMCreateProgressIndicator(WMWidget
*parent
);
1466 void WMSetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
, int value
);
1468 void WMSetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
, int value
);
1470 void WMSetProgressIndicatorValue(WMProgressIndicator
*progressindicator
, int value
);
1472 int WMGetProgressIndicatorMinValue(WMProgressIndicator
*progressindicator
);
1474 int WMGetProgressIndicatorMaxValue(WMProgressIndicator
*progressindicator
);
1476 int WMGetProgressIndicatorValue(WMProgressIndicator
*progressindicator
);
1478 /* ---[ WINGs/wcolorpanel.c ]--------------------------------------------- */
1480 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1482 void WMFreeColorPanel(WMColorPanel
*panel
);
1484 void WMShowColorPanel(WMColorPanel
*panel
);
1486 void WMCloseColorPanel(WMColorPanel
*panel
);
1488 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1490 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1492 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1494 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1496 extern char *WMColorPanelColorChangedNotification
;
1498 /* ---[ WINGs/wcolorwell.c ]---------------------------------------------- */
1500 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1502 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1504 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1506 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1509 extern char *WMColorWellDidChangeNotification
;
1512 /* ---[ WINGs/wscrollview.c ]--------------------------------------------- */
1514 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1516 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1517 unsigned int height
);
1519 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1521 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1523 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1525 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1527 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1529 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1531 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1533 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1535 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1537 /* ---[ WINGs/wslider.c ]------------------------------------------------- */
1539 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1541 int WMGetSliderMinValue(WMSlider
*slider
);
1543 int WMGetSliderMaxValue(WMSlider
*slider
);
1545 int WMGetSliderValue(WMSlider
*slider
);
1547 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1549 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1551 void WMSetSliderValue(WMSlider
*slider
, int value
);
1553 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1555 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1557 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1559 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1561 /* ---[ WINGs/wsplitview.c ]---------------------------------------------- */
1564 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1566 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1568 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1570 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1572 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1574 /* remove the first subview == view */
1575 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1577 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1580 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1582 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1584 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1585 WMSplitViewConstrainProc
*proc
);
1588 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1589 WMSplitViewResizeSubviewsProc *proc);
1592 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1594 /* ...................................................................... */
1596 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1598 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1600 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1602 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1604 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1606 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1608 int WMGetRulerOffset(WMRuler
*rPtr
);
1610 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1612 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1614 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1616 /* ....................................................................... */
1619 #define WMCreateText(parent) WMCreateTextForDocumentType \
1620 ((parent), (NULL), (NULL))
1622 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1625 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1627 void WMFreezeText(WMText
*tPtr
);
1629 #define WMRefreshText(tPtr) WMThawText((tPtr))
1631 void WMThawText(WMText
*tPtr
);
1633 int WMScrollText(WMText
*tPtr
, int amount
);
1635 int WMPageText(WMText
*tPtr
, Bool direction
);
1637 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1639 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1641 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1643 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1645 int WMGetTextRulerShown(WMText
*tPtr
);
1647 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1649 int WMGetTextEditable(WMText
*tPtr
);
1651 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1653 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1655 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1657 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1659 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1661 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1663 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1665 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1667 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1669 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1671 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1673 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1675 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1677 void WMPrependTextStream(WMText
*tPtr
, const char *text
);
1679 void WMAppendTextStream(WMText
*tPtr
, const char *text
);
1681 #define WMClearText(tPtr) WMAppendTextStream \
1685 char* WMGetTextStream(WMText
*tPtr
);
1688 char* WMGetTextSelectedStream(WMText
*tPtr
);
1690 /* destroy the array */
1691 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1693 /* destroy the array */
1694 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1696 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1698 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1700 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1702 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1704 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1706 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1708 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1710 Bool
WMFindInTextStream(WMText
*tPtr
, const char *needle
, Bool direction
,
1711 Bool caseSensitive
);
1713 /* Warning: replacement can be modified by the function */
1714 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1717 /* parser related stuff... use only if implementing a new parser */
1719 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, const char *description
,
1720 WMColor
*color
, unsigned short first
,
1721 unsigned short extraInfo
);
1723 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, const char *description
,
1724 WMColor
*color
, unsigned short first
,
1725 unsigned short extraInfo
);
1727 void* WMCreateTextBlockWithText(WMText
*tPtr
, const char *text
, WMFont
*font
,
1728 WMColor
*color
, unsigned short first
,
1729 unsigned short length
);
1731 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1732 unsigned int kanji
, unsigned int underlined
,
1733 int script
, WMRulerMargins
*margins
);
1735 /* do NOT free the margins */
1736 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1737 unsigned int *kanji
, unsigned int *underlined
,
1738 int *script
, WMRulerMargins
*margins
);
1740 int WMGetTextInsertType(WMText
*tPtr
);
1742 /*int WMGetTextBlocks(WMText *tPtr);
1744 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1746 int WMGetCurrentTextBlock(WMText *tPtr);*/
1748 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1750 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1752 void* WMRemoveTextBlock(WMText
*tPtr
);
1754 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1756 /* ---[ WINGs/wtabview.c ]------------------------------------------------ */
1758 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1760 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1762 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1764 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1766 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1768 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1770 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1772 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1773 int identifier
, const char *label
);
1775 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1777 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1779 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1781 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1783 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1785 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1787 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1789 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1791 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1794 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1796 void WMSetTabViewItemEnabled(WMTabViewItem
*tPtr
, Bool flag
);
1798 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1800 void WMSetTabViewItemLabel(WMTabViewItem
*item
, const char *label
);
1802 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1804 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1806 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1808 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1811 /* ---[ WINGs/wbox.c ]---------------------------------------------------- */
1813 WMBox
* WMCreateBox(WMWidget
*parent
);
1815 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1817 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1818 int minSize
, int maxSize
, int space
);
1820 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1821 int minSize
, int maxSize
, int space
);
1823 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1825 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1827 /* ---[ WINGs/wpanel.c ]-------------------------------------------------- */
1829 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
, const char *msg
,
1830 const char *defaultButton
, const char *alternateButton
,
1831 const char *otherButton
);
1833 /* you can free the returned string */
1834 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
, const char *msg
,
1835 const char *defaultText
, const char *okButton
, const char *cancelButton
);
1837 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1838 const char *msg
, const char *defaultButton
,
1839 const char *alternateButton
, const char *otherButton
);
1841 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1842 const char *msg
, const char *defaultText
, const char *okButton
,
1843 const char *cancelButton
);
1846 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1847 const char *title
, const char *defaultButton
,
1848 const char *alternateButton
);
1850 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1852 void WMDestroyInputPanel(WMInputPanel
*panel
);
1854 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1856 /* ---[ WINGs/wfilepanel.c ]---------------------------------------------- */
1858 /* only 1 instance per WMScreen */
1859 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1861 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1863 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1865 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1867 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1869 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1871 /* you can free the returned string */
1872 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1874 void WMFreeFilePanel(WMFilePanel
*panel
);
1876 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1877 char *path
, const char *name
, char **fileTypes
);
1879 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1881 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1884 /* ---[ WINGs/wfontpanel.c ]---------------------------------------------- */
1886 /* only 1 instance per WMScreen */
1887 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1889 void WMShowFontPanel(WMFontPanel
*panel
);
1891 void WMHideFontPanel(WMFontPanel
*panel
);
1893 void WMFreeFontPanel(WMFontPanel
*panel
);
1895 void WMSetFontPanelAction(WMFontPanel
*panel
, WMAction2
*action
, void *data
);
1897 void WMSetFontPanelFont(WMFontPanel
*panel
, const char *fontName
);
1899 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1901 /* ---[ WINGs/configuration.c ]------------------------------------------- */
1902 unsigned W_getconf_mouseWheelUp(void);
1903 unsigned W_getconf_mouseWheelDown(void);
1904 void W_setconf_doubleClickDelay(int value
);
1908 #endif /* __cplusplus */
1911 /* These definitions are not meant to be seen outside this file */
1912 #undef _wings_noreturn