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 20041030
34 #endif /* __cplusplus */
40 typedef unsigned long WMPixel
;
62 #define ClientMessageMask (1L<<30)
65 #ifndef _DEFINED_GNUSTEP_WINDOW_INFO
66 #define _DEFINED_GNUSTEP_WINDOW_INFO
68 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
69 * NSDesktopWindowLevel intended to be the level at which things
70 * on the desktop sit ... so you should be able
71 * to put a desktop background just below it.
73 * Applications are actually permitted to use any value in the
74 * range INT_MIN+1 to INT_MAX
77 WMDesktopWindowLevel
= -1000, /* GNUstep addition */
78 WMNormalWindowLevel
= 0,
79 WMFloatingWindowLevel
= 3,
80 WMSubmenuWindowLevel
= 3,
81 WMTornOffMenuWindowLevel
= 3,
82 WMMainMenuWindowLevel
= 20,
83 WMDockWindowLevel
= 21, /* Deprecated - use NSStatusWindowLevel */
84 WMStatusWindowLevel
= 21,
85 WMModalPanelWindowLevel
= 100,
86 WMPopUpMenuWindowLevel
= 101,
87 WMScreenSaverWindowLevel
= 1000
91 /* window attributes */
93 WMBorderlessWindowMask
= 0,
94 WMTitledWindowMask
= 1,
95 WMClosableWindowMask
= 2,
96 WMMiniaturizableWindowMask
= 4,
97 WMResizableWindowMask
= 8,
98 WMIconWindowMask
= 64,
99 WMMiniWindowMask
= 128
106 /* 0 is reserved for internal use */
107 WBTMomentaryPush
= 1,
108 WBTPushOnPushOff
= 2,
112 WBTMomentaryChange
= 6,
114 WBTMomentaryLight
= 8
117 /* button behaviour masks */
119 WBBSpringLoadedMask
= (1 << 0),
120 WBBPushInMask
= (1 << 1),
121 WBBPushChangeMask
= (1 << 2),
122 WBBPushLightMask
= (1 << 3),
123 WBBStateLightMask
= (1 << 5),
124 WBBStateChangeMask
= (1 << 6),
125 WBBStatePushMask
= (1 << 7)
129 /* frame title positions */
153 /* alignment types */
158 WAJustified
/* not valid for textfields */
174 /* scroller arrow position */
179 } WMScrollArrowPosition
;
194 /* usable scroller parts */
199 } WMUsableScrollerParts
;
211 WTTopTabsBevelBorder
,
218 /* text movement types */
220 WMIllegalTextMovement
,
221 WMReturnTextMovement
,
222 WMEscapeTextMovement
,
224 WMBacktabTextMovement
,
231 /* text field special events */
239 WLNotFound
= -1 /* element was not found in WMList */
243 /* drag operations */
251 } WMDragOperationType
;
255 WMGrayModeColorPanel
= 1,
256 WMRGBModeColorPanel
= 2,
257 WMCMYKModeColorPanel
= 3,
258 WMHSBModeColorPanel
= 4,
259 WMCustomPaletteModeColorPanel
= 5,
260 WMColorListModeColorPanel
= 6,
261 WMWheelModeColorPanel
= 7
267 #define WSIReturnArrow 1
268 #define WSIHighlightedReturnArrow 2
269 #define WSIScrollerDimple 3
270 #define WSIArrowLeft 4
271 #define WSIHighlightedArrowLeft 5
272 #define WSIArrowRight 6
273 #define WSIHighlightedArrowRight 7
275 #define WSIHighlightedArrowUp 9
276 #define WSIArrowDown 10
277 #define WSIHighlightedArrowDown 11
278 #define WSICheckMark 12
281 WLDSSelected
= (1 << 16),
282 WLDSDisabled
= (1 << 17),
283 WLDSFocused
= (1 << 18),
284 WLDSIsBranch
= (1 << 19)
287 /* alert panel return values */
297 /* types of input observers */
299 WIReadMask
= (1 << 0),
300 WIWriteMask
= (1 << 1),
301 WIExceptMask
= (1 << 2)
321 WC_Matrix
= 12, /* not ready */
324 WC_ProgressIndicator
= 15,
331 /* All widgets must start with the following structure
332 * in that order. Used for typecasting to get some generic data */
333 typedef struct W_WidgetType
{
340 #define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
341 #define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
346 typedef void WMWidget
;
348 typedef struct W_Pixmap WMPixmap
;
349 typedef struct W_Font WMFont
;
350 typedef struct W_Color WMColor
;
352 typedef struct W_Screen WMScreen
;
354 typedef struct W_View WMView
;
356 typedef struct W_Window WMWindow
;
357 typedef struct W_Frame WMFrame
;
358 typedef struct W_Button WMButton
;
359 typedef struct W_Label WMLabel
;
360 typedef struct W_TextField WMTextField
;
361 typedef struct W_Scroller WMScroller
;
362 typedef struct W_ScrollView WMScrollView
;
363 typedef struct W_List WMList
;
364 typedef struct W_Browser WMBrowser
;
365 typedef struct W_PopUpButton WMPopUpButton
;
366 typedef struct W_ProgressIndicator WMProgressIndicator
;
367 typedef struct W_ColorWell WMColorWell
;
368 typedef struct W_Slider WMSlider
;
369 typedef struct W_Matrix WMMatrix
; /* not ready */
370 typedef struct W_SplitView WMSplitView
;
371 typedef struct W_TabView WMTabView
;
372 typedef struct W_Ruler WMRuler
;
373 typedef struct W_Text WMText
;
374 typedef struct W_Box WMBox
;
378 typedef struct W_TabViewItem WMTabViewItem
;
379 typedef struct W_MenuItem WMMenuItem
;
382 typedef struct W_FilePanel WMFilePanel
;
383 typedef WMFilePanel WMOpenPanel
;
384 typedef WMFilePanel WMSavePanel
;
386 typedef struct W_FontPanel WMFontPanel
;
388 typedef struct W_ColorPanel WMColorPanel
;
391 /* item for WMList */
392 typedef struct WMListItem
{
394 void *clientData
; /* ptr for user clientdata. */
396 unsigned int uflags
:16; /* flags for the user */
397 unsigned int selected
:1;
398 unsigned int disabled
:1;
399 unsigned int isBranch
:1;
400 unsigned int loaded
:1;
403 /* struct for message panel */
404 typedef struct WMAlertPanel
{
405 WMWindow
*win
; /* window */
408 WMButton
*defBtn
; /* default button */
409 WMButton
*altBtn
; /* alternative button */
410 WMButton
*othBtn
; /* other button */
411 WMLabel
*iLbl
; /* icon label */
412 WMLabel
*tLbl
; /* title label */
413 WMLabel
*mLbl
; /* message label */
414 WMFrame
*line
; /* separator */
415 short result
; /* button that was pushed */
419 typedef struct WMGenericPanel
{
438 typedef struct WMInputPanel
{
439 WMWindow
*win
; /* window */
440 WMButton
*defBtn
; /* default button */
441 WMButton
*altBtn
; /* alternative button */
442 WMLabel
*tLbl
; /* title label */
443 WMLabel
*mLbl
; /* message label */
444 WMTextField
*text
; /* text field */
445 short result
; /* button that was pushed */
449 /* Basic font styles. Used to easily get one style from another */
450 typedef enum WMFontStyle
{
460 WMArray
*tabs
; /* a growable array of tabstops */
461 unsigned short left
; /* left margin marker */
462 unsigned short right
; /* right margin marker */
463 unsigned short first
; /* indentation marker for first line only */
464 unsigned short body
; /* body indentation marker */
465 unsigned short retainCount
;
467 /* All indentation and tab markers are _relative_ to the left margin marker */
470 typedef void WMEventProc(XEvent
*event
, void *clientData
);
472 typedef void WMEventHook(XEvent
*event
);
474 /* self is set to the widget from where the callback is being called and
475 * clientData to the data set to with WMSetClientData() */
476 typedef void WMAction(WMWidget
*self
, void *clientData
);
478 /* same as WMAction, but for stuff that arent widgets */
479 typedef void WMAction2(void *self
, void *clientData
);
482 /* delegate method like stuff */
483 typedef void WMListDrawProc(WMList
*lPtr
, int index
, Drawable d
, char *text
,
484 int state
, WMRect
*rect
);
488 typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
489 unsigned int oldWidth,
490 unsigned int oldHeight);
493 typedef void WMSplitViewConstrainProc(WMSplitView
*sPtr
, int dividerIndex
,
494 int *minSize
, int *maxSize
);
496 typedef WMWidget
* WMMatrixCreateCellProc(WMMatrix
*mPtr
);
501 typedef struct WMBrowserDelegate
{
504 void (*createRowsForColumn
)(struct WMBrowserDelegate
*self
,
505 WMBrowser
*sender
, int column
, WMList
*list
);
507 char* (*titleOfColumn
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
,
510 void (*didScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
512 void (*willScroll
)(struct WMBrowserDelegate
*self
, WMBrowser
*sender
);
516 typedef struct WMTextFieldDelegate
{
519 void (*didBeginEditing
)(struct WMTextFieldDelegate
*self
,
520 WMNotification
*notif
);
522 void (*didChange
)(struct WMTextFieldDelegate
*self
,
523 WMNotification
*notif
);
525 void (*didEndEditing
)(struct WMTextFieldDelegate
*self
,
526 WMNotification
*notif
);
528 Bool (*shouldBeginEditing
)(struct WMTextFieldDelegate
*self
,
531 Bool (*shouldEndEditing
)(struct WMTextFieldDelegate
*self
,
533 } WMTextFieldDelegate
;
536 typedef struct WMTextDelegate
{
539 Bool (*didDoubleClickOnPicture
)(struct WMTextDelegate
*self
,
546 typedef struct WMTabViewDelegate
{
549 void (*didChangeNumberOfItems
)(struct WMTabViewDelegate
*self
,
552 void (*didSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
553 WMTabViewItem
*item
);
555 Bool (*shouldSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
556 WMTabViewItem
*item
);
558 void (*willSelectItem
)(struct WMTabViewDelegate
*self
, WMTabView
*tabView
,
559 WMTabViewItem
*item
);
565 typedef void WMSelectionCallback(WMView
*view
, Atom selection
, Atom target
,
566 Time timestamp
, void *cdata
, WMData
*data
);
569 typedef struct WMSelectionProcs
{
570 WMData
* (*convertSelection
)(WMView
*view
, Atom selection
, Atom target
,
571 void *cdata
, Atom
*type
);
572 void (*selectionLost
)(WMView
*view
, Atom selection
, void *cdata
);
573 void (*selectionDone
)(WMView
*view
, Atom selection
, Atom target
,
578 typedef struct W_DraggingInfo WMDraggingInfo
;
581 /* links a label to a dnd operation. */
582 typedef struct W_DragOperationtItem WMDragOperationItem
;
585 typedef struct W_DragSourceProcs
{
586 WMArray
* (*dropDataTypes
)(WMView
*self
);
587 WMDragOperationType (*wantedDropOperation
)(WMView
*self
);
588 WMArray
* (*askedOperations
)(WMView
*self
);
589 Bool (*acceptDropOperation
)(WMView
*self
, WMDragOperationType operation
);
590 void (*beganDrag
)(WMView
*self
, WMPoint
*point
);
591 void (*endedDrag
)(WMView
*self
, WMPoint
*point
, Bool deposited
);
592 WMData
* (*fetchDragData
)(WMView
*self
, char *type
);
593 /*Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
598 typedef struct W_DragDestinationProcs
{
599 void (*prepareForDragOperation
)(WMView
*self
);
600 WMArray
* (*requiredDataTypes
)(WMView
*self
, WMDragOperationType request
,
601 WMArray
*sourceDataTypes
);
602 WMDragOperationType (*allowedOperation
)(WMView
*self
,
603 WMDragOperationType request
,
604 WMArray
*sourceDataTypes
);
605 Bool (*inspectDropData
)(WMView
*self
, WMArray
*dropData
);
606 void (*performDragOperation
)(WMView
*self
, WMArray
*dropData
,
607 WMArray
*operations
, WMPoint
*dropLocation
);
608 void (*concludeDragOperation
)(WMView
*self
);
609 } WMDragDestinationProcs
;
612 /* ---[ WINGs/wmisc.c ]--------------------------------------------------- */
615 WMPoint
wmkpoint(int x
, int y
);
617 WMSize
wmksize(unsigned int width
, unsigned int height
);
619 WMRect
wmkrect(int x
, int y
, unsigned int width
, unsigned int height
);
621 #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
622 #define wmksize(width, height) (WMSize){(width), (height)}
623 #define wmkpoint(x, y) (WMPoint){(x), (y)}
626 /* ---[ WINGs/wapplication.c ]-------------------------------------------- */
630 void WMInitializeApplication(const char *applicationName
, int *argc
, char **argv
);
632 void WMSetResourcePath(const char *path
);
634 /* don't free the returned string */
635 char* WMGetApplicationName(void);
637 /* Try to locate resource file. ext may be NULL */
638 char* WMPathForResourceOfType(const char *resource
, const char *ext
);
640 /* ---[ WINGs/widgets.c ]------------------------------------------------- */
642 WMScreen
* WMOpenScreen(const char *display
);
644 WMScreen
* WMCreateScreenWithRContext(Display
*display
, int screen
,
647 WMScreen
* WMCreateScreen(Display
*display
, int screen
);
649 WMScreen
* WMCreateSimpleApplicationScreen(Display
*display
);
651 void WMScreenMainLoop(WMScreen
*scr
);
653 void WMBreakModalLoop(WMScreen
*scr
);
655 void WMRunModalLoop(WMScreen
*scr
, WMView
*view
);
657 RContext
* WMScreenRContext(WMScreen
*scr
);
659 Display
* WMScreenDisplay(WMScreen
*scr
);
661 int WMScreenDepth(WMScreen
*scr
);
663 void WMSetFocusToWidget(WMWidget
*widget
);
665 /* ---[ WINGs/wappresource.c ]-------------------------------------------- */
667 void WMSetApplicationIconImage(WMScreen
*app
, RImage
*image
);
669 RImage
* WMGetApplicationIconImage(WMScreen
*app
);
671 void WMSetApplicationIconPixmap(WMScreen
*app
, WMPixmap
*icon
);
673 WMPixmap
* WMGetApplicationIconPixmap(WMScreen
*app
);
675 /* If color==NULL it will use the default color for panels: ae/aa/ae */
676 WMPixmap
* WMCreateApplicationIconBlendedPixmap(WMScreen
*scr
, const RColor
*color
);
678 void WMSetApplicationIconWindow(WMScreen
*scr
, Window window
);
680 /* ---[ WINGs/wevent.c ]-------------------------------------------------- */
682 WMEventHook
* WMHookEventHandler(WMEventHook
*handler
);
684 int WMHandleEvent(XEvent
*event
);
686 Bool
WMScreenPending(WMScreen
*scr
);
688 void WMCreateEventHandler(WMView
*view
, unsigned long mask
,
689 WMEventProc
*eventProc
, void *clientData
);
691 void WMDeleteEventHandler(WMView
*view
, unsigned long mask
,
692 WMEventProc
*eventProc
, void *clientData
);
694 int WMIsDoubleClick(XEvent
*event
);
696 /*int WMIsTripleClick(XEvent *event);*/
698 void WMNextEvent(Display
*dpy
, XEvent
*event
);
700 void WMMaskEvent(Display
*dpy
, long mask
, XEvent
*event
);
702 void WMSetViewNextResponder(WMView
*view
, WMView
*responder
);
704 void WMRelayToNextResponder(WMView
*view
, XEvent
*event
);
707 /* ---[ WINGs/selection.c ]----------------------------------------------- */
710 Bool
WMCreateSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
,
711 WMSelectionProcs
*procs
, void *cdata
);
713 void WMDeleteSelectionHandler(WMView
*view
, Atom selection
, Time timestamp
);
715 Bool
WMRequestSelection(WMView
*view
, Atom selection
, Atom target
,
716 Time timestamp
, WMSelectionCallback
*callback
,
720 extern char *WMSelectionOwnerDidChangeNotification
;
722 /* ---[ WINGs/dragcommon.c ]---------------------------------------------- */
724 WMArray
* WMCreateDragOperationArray(int initialSize
);
726 WMDragOperationItem
* WMCreateDragOperationItem(WMDragOperationType type
,
729 WMDragOperationType
WMGetDragOperationItemType(WMDragOperationItem
* item
);
731 char* WMGetDragOperationItemText(WMDragOperationItem
* item
);
733 /* ---[ WINGs/dragsource.c ]---------------------------------------------- */
735 void WMSetViewDragImage(WMView
* view
, WMPixmap
*dragImage
);
737 void WMReleaseViewDragImage(WMView
* view
);
739 void WMSetViewDragSourceProcs(WMView
*view
, WMDragSourceProcs
*procs
);
741 Bool
WMIsDraggingFromView(WMView
*view
);
743 void WMDragImageFromView(WMView
*view
, XEvent
*event
);
745 /* Create a drag handler, associating drag event masks with dragEventProc */
746 void WMCreateDragHandler(WMView
*view
, WMEventProc
*dragEventProc
, void *clientData
);
748 void WMDeleteDragHandler(WMView
*view
, WMEventProc
*dragEventProc
, void *clientData
);
750 /* set default drag handler for view */
751 void WMSetViewDraggable(WMView
*view
, WMDragSourceProcs
*procs
, WMPixmap
*dragImage
);
753 void WMUnsetViewDraggable(WMView
*view
);
755 /* ---[ WINGs/dragdestination.c ]----------------------------------------- */
757 void WMRegisterViewForDraggedTypes(WMView
*view
, WMArray
*acceptedTypes
);
759 void WMUnregisterViewDraggedTypes(WMView
*view
);
761 void WMSetViewDragDestinationProcs(WMView
*view
, WMDragDestinationProcs
*procs
);
763 /* ---[ WINGs/wfont.c ]--------------------------------------------------- */
765 Bool
WMIsAntialiasingEnabled(WMScreen
*scrPtr
);
767 WMFont
* WMCreateFont(WMScreen
*scrPtr
, const char *fontName
);
769 WMFont
* WMCopyFontWithStyle(WMScreen
*scrPtr
, WMFont
*font
, WMFontStyle style
);
771 WMFont
* WMRetainFont(WMFont
*font
);
773 void WMReleaseFont(WMFont
*font
);
775 char* WMGetFontName(WMFont
*font
);
777 unsigned int WMFontHeight(WMFont
*font
);
779 void WMSetWidgetDefaultFont(WMScreen
*scr
, WMFont
*font
);
781 void WMSetWidgetDefaultBoldFont(WMScreen
*scr
, WMFont
*font
);
783 WMFont
* WMDefaultSystemFont(WMScreen
*scrPtr
);
785 WMFont
* WMDefaultBoldSystemFont(WMScreen
*scrPtr
);
787 WMFont
* WMSystemFontOfSize(WMScreen
*scrPtr
, int size
);
789 WMFont
* WMBoldSystemFontOfSize(WMScreen
*scrPtr
, int size
);
791 void WMDrawString(WMScreen
*scr
, Drawable d
, WMColor
*color
, WMFont
*font
,
792 int x
, int y
, const char *text
, int length
);
794 void WMDrawImageString(WMScreen
*scr
, Drawable d
, WMColor
*color
,
795 WMColor
*background
, WMFont
*font
, int x
, int y
,
796 const char *text
, int length
);
798 int WMWidthOfString(WMFont
*font
, const char *text
, int length
);
800 /* ---[ WINGs/wpixmap.c ]------------------------------------------------- */
802 WMPixmap
* WMRetainPixmap(WMPixmap
*pixmap
);
804 void WMReleasePixmap(WMPixmap
*pixmap
);
806 WMPixmap
* WMCreatePixmap(WMScreen
*scrPtr
, int width
, int height
, int depth
,
809 WMPixmap
* WMCreatePixmapFromXPixmaps(WMScreen
*scrPtr
, Pixmap pixmap
,
810 Pixmap mask
, int width
, int height
,
813 WMPixmap
* WMCreatePixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
816 WMPixmap
* WMCreatePixmapFromXPMData(WMScreen
*scrPtr
, char **data
);
818 WMSize
WMGetPixmapSize(WMPixmap
*pixmap
);
820 WMPixmap
* WMCreatePixmapFromFile(WMScreen
*scrPtr
, const char *fileName
);
822 WMPixmap
* WMCreateBlendedPixmapFromRImage(WMScreen
*scrPtr
, RImage
*image
,
823 const RColor
*color
);
825 WMPixmap
* WMCreateBlendedPixmapFromFile(WMScreen
*scrPtr
, const char *fileName
,
826 const RColor
*color
);
828 void WMDrawPixmap(WMPixmap
*pixmap
, Drawable d
, int x
, int y
);
830 Pixmap
WMGetPixmapXID(WMPixmap
*pixmap
);
832 Pixmap
WMGetPixmapMaskXID(WMPixmap
*pixmap
);
834 WMPixmap
* WMGetSystemPixmap(WMScreen
*scr
, int image
);
836 /* ---[ WINGs/wcolor.c ]-------------------------------------------------- */
839 WMColor
* WMDarkGrayColor(WMScreen
*scr
);
841 WMColor
* WMGrayColor(WMScreen
*scr
);
843 WMColor
* WMBlackColor(WMScreen
*scr
);
845 WMColor
* WMWhiteColor(WMScreen
*scr
);
847 void WMSetColorInGC(WMColor
*color
, GC gc
);
849 GC
WMColorGC(WMColor
*color
);
851 WMPixel
WMColorPixel(WMColor
*color
);
853 void WMPaintColorSwatch(WMColor
*color
, Drawable d
, int x
, int y
,
854 unsigned int width
, unsigned int height
);
856 void WMReleaseColor(WMColor
*color
);
858 WMColor
* WMRetainColor(WMColor
*color
);
860 WMColor
* WMCreateRGBColor(WMScreen
*scr
, unsigned short red
,
861 unsigned short green
, unsigned short blue
,
864 WMColor
* WMCreateRGBAColor(WMScreen
*scr
, unsigned short red
,
865 unsigned short green
, unsigned short blue
,
866 unsigned short alpha
, Bool exact
);
868 WMColor
* WMCreateNamedColor(WMScreen
*scr
, const char *name
, Bool exact
);
870 RColor
WMGetRColorFromColor(WMColor
*color
);
872 void WMSetColorAlpha(WMColor
*color
, unsigned short alpha
);
874 unsigned short WMRedComponentOfColor(WMColor
*color
);
876 unsigned short WMGreenComponentOfColor(WMColor
*color
);
878 unsigned short WMBlueComponentOfColor(WMColor
*color
);
880 unsigned short WMGetColorAlpha(WMColor
*color
);
882 char* WMGetColorRGBDescription(WMColor
*color
);
884 /* ---[ WINGs/widgets.c ]------------------------------------------------- */
886 WMScreen
* WMWidgetScreen(WMWidget
*w
);
888 unsigned int WMScreenWidth(WMScreen
*scr
);
890 unsigned int WMScreenHeight(WMScreen
*scr
);
892 void WMUnmapWidget(WMWidget
*w
);
894 void WMMapWidget(WMWidget
*w
);
896 Bool
WMWidgetIsMapped(WMWidget
*w
);
898 void WMRaiseWidget(WMWidget
*w
);
900 void WMLowerWidget(WMWidget
*w
);
902 void WMMoveWidget(WMWidget
*w
, int x
, int y
);
904 void WMResizeWidget(WMWidget
*w
, unsigned int width
, unsigned int height
);
906 void WMSetWidgetBackgroundColor(WMWidget
*w
, WMColor
*color
);
908 WMColor
* WMGetWidgetBackgroundColor(WMWidget
*w
);
910 void WMMapSubwidgets(WMWidget
*w
);
912 void WMUnmapSubwidgets(WMWidget
*w
);
914 void WMRealizeWidget(WMWidget
*w
);
916 void WMReparentWidget(WMWidget
*w
, WMWidget
*newParent
, int x
, int y
);
918 void WMDestroyWidget(WMWidget
*widget
);
920 void WMHangData(WMWidget
*widget
, void *data
);
922 void* WMGetHangedData(WMWidget
*widget
);
924 unsigned int WMWidgetWidth(WMWidget
*w
);
926 unsigned int WMWidgetHeight(WMWidget
*w
);
928 Window
WMWidgetXID(WMWidget
*w
);
930 void WMRedisplayWidget(WMWidget
*w
);
932 /* ---[ WINGs/wview.c ]--------------------------------------------------- */
934 Window
WMViewXID(WMView
*view
);
936 void WMSetViewNotifySizeChanges(WMView
*view
, Bool flag
);
938 void WMSetViewExpandsToParent(WMView
*view
, int topOffs
, int leftOffs
,
939 int rightOffs
, int bottomOffs
);
941 WMSize
WMGetViewSize(WMView
*view
);
943 WMPoint
WMGetViewPosition(WMView
*view
);
945 WMPoint
WMGetViewScreenPosition(WMView
*view
);
947 WMWidget
* WMWidgetOfView(WMView
*view
);
950 extern char *WMViewSizeDidChangeNotification
;
952 extern char *WMViewFocusDidChangeNotification
;
954 extern char *WMViewRealizedNotification
;
956 /* ---[ WINGs/wballoon.c ]------------------------------------------------ */
958 void WMSetBalloonTextForView(const char *text
, WMView
*view
);
960 void WMSetBalloonTextAlignment(WMScreen
*scr
, WMAlignment alignment
);
962 void WMSetBalloonFont(WMScreen
*scr
, WMFont
*font
);
964 void WMSetBalloonTextColor(WMScreen
*scr
, WMColor
*color
);
966 void WMSetBalloonDelay(WMScreen
*scr
, int delay
);
968 void WMSetBalloonEnabled(WMScreen
*scr
, Bool flag
);
971 /* ---[ WINGs/wwindow.c ]------------------------------------------------- */
973 WMWindow
* WMCreateWindow(WMScreen
*screen
, const char *name
);
975 WMWindow
* WMCreateWindowWithStyle(WMScreen
*screen
, const char *name
, int style
);
977 WMWindow
* WMCreatePanelWithStyleForWindow(WMWindow
*owner
, const char *name
,
980 WMWindow
* WMCreatePanelForWindow(WMWindow
*owner
, const char *name
);
982 void WMChangePanelOwner(WMWindow
*win
, WMWindow
*newOwner
);
984 void WMSetWindowTitle(WMWindow
*wPtr
, const char *title
);
986 void WMSetWindowMiniwindowTitle(WMWindow
*win
, const char *title
);
988 void WMSetWindowMiniwindowImage(WMWindow
*win
, RImage
*image
);
990 void WMSetWindowMiniwindowPixmap(WMWindow
*win
, WMPixmap
*pixmap
);
992 void WMSetWindowCloseAction(WMWindow
*win
, WMAction
*action
, void *clientData
);
994 void WMSetWindowInitialPosition(WMWindow
*win
, int x
, int y
);
996 void WMSetWindowUserPosition(WMWindow
*win
, int x
, int y
);
998 void WMSetWindowAspectRatio(WMWindow
*win
, int minX
, int minY
,
1001 void WMSetWindowMaxSize(WMWindow
*win
, unsigned width
, unsigned height
);
1003 void WMSetWindowMinSize(WMWindow
*win
, unsigned width
, unsigned height
);
1005 void WMSetWindowBaseSize(WMWindow
*win
, unsigned width
, unsigned height
);
1007 void WMSetWindowResizeIncrements(WMWindow
*win
, unsigned wIncr
, unsigned hIncr
);
1009 void WMSetWindowLevel(WMWindow
*win
, int level
);
1011 void WMSetWindowDocumentEdited(WMWindow
*win
, Bool flag
);
1013 void WMCloseWindow(WMWindow
*win
);
1015 /* ---[ WINGs/wbutton.c ]------------------------------------------------- */
1017 void WMSetButtonAction(WMButton
*bPtr
, WMAction
*action
, void *clientData
);
1019 #define WMCreateCommandButton(parent) \
1020 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1025 #define WMCreateRadioButton(parent) \
1026 WMCreateButton((parent), WBTRadio)
1028 #define WMCreateSwitchButton(parent) \
1029 WMCreateButton((parent), WBTSwitch)
1031 WMButton
* WMCreateButton(WMWidget
*parent
, WMButtonType type
);
1033 WMButton
* WMCreateCustomButton(WMWidget
*parent
, int behaviourMask
);
1035 void WMSetButtonImageDefault(WMButton
*bPtr
);
1037 void WMSetButtonImage(WMButton
*bPtr
, WMPixmap
*image
);
1039 void WMSetButtonAltImage(WMButton
*bPtr
, WMPixmap
*image
);
1041 void WMSetButtonImagePosition(WMButton
*bPtr
, WMImagePosition position
);
1043 void WMSetButtonFont(WMButton
*bPtr
, WMFont
*font
);
1045 void WMSetButtonTextAlignment(WMButton
*bPtr
, WMAlignment alignment
);
1047 void WMSetButtonText(WMButton
*bPtr
, const char *text
);
1049 void WMSetButtonAltText(WMButton
*bPtr
, const char *text
);
1051 void WMSetButtonTextColor(WMButton
*bPtr
, WMColor
*color
);
1053 void WMSetButtonAltTextColor(WMButton
*bPtr
, WMColor
*color
);
1055 void WMSetButtonDisabledTextColor(WMButton
*bPtr
, WMColor
*color
);
1057 void WMSetButtonSelected(WMButton
*bPtr
, int isSelected
);
1059 int WMGetButtonSelected(WMButton
*bPtr
);
1061 void WMSetButtonBordered(WMButton
*bPtr
, int isBordered
);
1063 void WMSetButtonEnabled(WMButton
*bPtr
, Bool flag
);
1065 int WMGetButtonEnabled(WMButton
*bPtr
);
1067 void WMSetButtonImageDimsWhenDisabled(WMButton
*bPtr
, Bool flag
);
1069 void WMSetButtonTag(WMButton
*bPtr
, int tag
);
1071 void WMGroupButtons(WMButton
*bPtr
, WMButton
*newMember
);
1073 void WMPerformButtonClick(WMButton
*bPtr
);
1075 void WMSetButtonContinuous(WMButton
*bPtr
, Bool flag
);
1077 void WMSetButtonPeriodicDelay(WMButton
*bPtr
, float delay
, float interval
);
1079 /* ---[ WINGs/wlabel.c ]-------------------------------------------------- */
1081 WMLabel
* WMCreateLabel(WMWidget
*parent
);
1083 void WMSetLabelWraps(WMLabel
*lPtr
, Bool flag
);
1085 void WMSetLabelImage(WMLabel
*lPtr
, WMPixmap
*image
);
1087 WMPixmap
* WMGetLabelImage(WMLabel
*lPtr
);
1089 char* WMGetLabelText(WMLabel
*lPtr
);
1091 void WMSetLabelImagePosition(WMLabel
*lPtr
, WMImagePosition position
);
1093 void WMSetLabelTextAlignment(WMLabel
*lPtr
, WMAlignment alignment
);
1095 void WMSetLabelRelief(WMLabel
*lPtr
, WMReliefType relief
);
1097 void WMSetLabelText(WMLabel
*lPtr
, const char *text
);
1099 WMFont
* WMGetLabelFont(WMLabel
*lPtr
);
1101 void WMSetLabelFont(WMLabel
*lPtr
, WMFont
*font
);
1103 void WMSetLabelTextColor(WMLabel
*lPtr
, WMColor
*color
);
1105 /* ---[ WINGs/wframe.c ]-------------------------------------------------- */
1107 WMFrame
* WMCreateFrame(WMWidget
*parent
);
1109 void WMSetFrameTitlePosition(WMFrame
*fPtr
, WMTitlePosition position
);
1111 void WMSetFrameRelief(WMFrame
*fPtr
, WMReliefType relief
);
1113 void WMSetFrameTitle(WMFrame
*fPtr
, const char *title
);
1115 /* ---[ WINGs/wtextfield.c ]---------------------------------------------- */
1117 WMTextField
* WMCreateTextField(WMWidget
*parent
);
1119 void WMInsertTextFieldText(WMTextField
*tPtr
, const char *text
, int position
);
1121 void WMDeleteTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1123 /* you can free the returned string */
1124 char* WMGetTextFieldText(WMTextField
*tPtr
);
1126 void WMSetTextFieldText(WMTextField
*tPtr
, const char *text
);
1128 void WMSetTextFieldAlignment(WMTextField
*tPtr
, WMAlignment alignment
);
1130 void WMSetTextFieldFont(WMTextField
*tPtr
, WMFont
*font
);
1132 WMFont
* WMGetTextFieldFont(WMTextField
*tPtr
);
1134 void WMSetTextFieldBordered(WMTextField
*tPtr
, Bool bordered
);
1136 void WMSetTextFieldBeveled(WMTextField
*tPtr
, Bool flag
);
1138 Bool
WMGetTextFieldEditable(WMTextField
*tPtr
);
1140 void WMSetTextFieldEditable(WMTextField
*tPtr
, Bool flag
);
1142 void WMSetTextFieldSecure(WMTextField
*tPtr
, Bool flag
);
1144 void WMSelectTextFieldRange(WMTextField
*tPtr
, WMRange range
);
1146 void WMSetTextFieldCursorPosition(WMTextField
*tPtr
, unsigned int position
);
1148 unsigned WMGetTextFieldCursorPosition(WMTextField
*tPtr
);
1150 void WMSetTextFieldNextTextField(WMTextField
*tPtr
, WMTextField
*next
);
1152 void WMSetTextFieldPrevTextField(WMTextField
*tPtr
, WMTextField
*prev
);
1154 void WMSetTextFieldDelegate(WMTextField
*tPtr
, WMTextFieldDelegate
*delegate
);
1156 WMTextFieldDelegate
* WMGetTextFieldDelegate(WMTextField
*tPtr
);
1158 extern char *WMTextDidChangeNotification
;
1159 extern char *WMTextDidBeginEditingNotification
;
1160 extern char *WMTextDidEndEditingNotification
;
1162 /* ---[ WINGs/wscroller.c ]----------------------------------------------- */
1164 WMScroller
* WMCreateScroller(WMWidget
*parent
);
1166 void WMSetScrollerParameters(WMScroller
*sPtr
, float floatValue
,
1167 float knobProportion
);
1169 float WMGetScrollerKnobProportion(WMScroller
*sPtr
);
1171 float WMGetScrollerValue(WMScroller
*sPtr
);
1173 WMScrollerPart
WMGetScrollerHitPart(WMScroller
*sPtr
);
1175 void WMSetScrollerAction(WMScroller
*sPtr
, WMAction
*action
, void *clientData
);
1177 void WMSetScrollerArrowsPosition(WMScroller
*sPtr
,
1178 WMScrollArrowPosition position
);
1180 extern char *WMScrollerDidScrollNotification
;
1182 /* ---[ WINGs/wlist.c ]--------------------------------------------------- */
1184 WMList
* WMCreateList(WMWidget
*parent
);
1186 void WMSetListAllowMultipleSelection(WMList
*lPtr
, Bool flag
);
1188 void WMSetListAllowEmptySelection(WMList
*lPtr
, Bool flag
);
1190 #define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1192 WMListItem
* WMInsertListItem(WMList
*lPtr
, int row
, const char *text
);
1194 void WMSortListItems(WMList
*lPtr
);
1196 void WMSortListItemsWithComparer(WMList
*lPtr
, WMCompareDataProc
*func
);
1198 int WMFindRowOfListItemWithTitle(WMList
*lPtr
, const char *title
);
1200 WMListItem
* WMGetListItem(WMList
*lPtr
, int row
);
1202 WMArray
* WMGetListItems(WMList
*lPtr
);
1204 void WMRemoveListItem(WMList
*lPtr
, int row
);
1206 void WMSelectListItem(WMList
*lPtr
, int row
);
1208 void WMUnselectListItem(WMList
*lPtr
, int row
);
1210 /* This will select all items in range, and deselect all the others */
1211 void WMSetListSelectionToRange(WMList
*lPtr
, WMRange range
);
1213 /* This will select all items in range, leaving the others as they are */
1214 void WMSelectListItemsInRange(WMList
*lPtr
, WMRange range
);
1216 void WMSelectAllListItems(WMList
*lPtr
);
1218 void WMUnselectAllListItems(WMList
*lPtr
);
1220 void WMSetListUserDrawProc(WMList
*lPtr
, WMListDrawProc
*proc
);
1222 void WMSetListUserDrawItemHeight(WMList
*lPtr
, unsigned short height
);
1224 int WMGetListItemHeight(WMList
*lPtr
);
1226 /* don't free the returned data */
1227 WMArray
* WMGetListSelectedItems(WMList
*lPtr
);
1230 * For the following 2 functions, in case WMList allows multiple selection,
1231 * the first item in the list of selected items, respective its row number,
1235 /* don't free the returned data */
1236 WMListItem
* WMGetListSelectedItem(WMList
*lPtr
);
1238 int WMGetListSelectedItemRow(WMList
*lPtr
);
1240 void WMSetListAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1242 void WMSetListDoubleAction(WMList
*lPtr
, WMAction
*action
, void *clientData
);
1244 void WMClearList(WMList
*lPtr
);
1246 int WMGetListNumberOfRows(WMList
*lPtr
);
1248 void WMSetListPosition(WMList
*lPtr
, int row
);
1250 void WMSetListBottomPosition(WMList
*lPtr
, int row
);
1252 int WMGetListPosition(WMList
*lPtr
);
1254 Bool
WMListAllowsMultipleSelection(WMList
*lPtr
);
1256 Bool
WMListAllowsEmptySelection(WMList
*lPtr
);
1259 extern char *WMListDidScrollNotification
;
1260 extern char *WMListSelectionDidChangeNotification
;
1262 /* ---[ WINGs/wbrowser.c ]------------------------------------------------ */
1264 WMBrowser
* WMCreateBrowser(WMWidget
*parent
);
1266 void WMSetBrowserAllowMultipleSelection(WMBrowser
*bPtr
, Bool flag
);
1268 void WMSetBrowserAllowEmptySelection(WMBrowser
*bPtr
, Bool flag
);
1270 void WMSetBrowserPathSeparator(WMBrowser
*bPtr
, const char *separator
);
1272 void WMSetBrowserTitled(WMBrowser
*bPtr
, Bool flag
);
1274 void WMLoadBrowserColumnZero(WMBrowser
*bPtr
);
1276 int WMAddBrowserColumn(WMBrowser
*bPtr
);
1278 void WMRemoveBrowserItem(WMBrowser
*bPtr
, int column
, int row
);
1280 void WMSetBrowserMaxVisibleColumns(WMBrowser
*bPtr
, int columns
);
1282 void WMSetBrowserColumnTitle(WMBrowser
*bPtr
, int column
, const char *title
);
1284 WMListItem
* WMInsertBrowserItem(WMBrowser
*bPtr
, int column
, int row
, const char *text
, Bool isBranch
);
1286 void WMSortBrowserColumn(WMBrowser
*bPtr
, int column
);
1288 void WMSortBrowserColumnWithComparer(WMBrowser
*bPtr
, int column
,
1289 WMCompareDataProc
*func
);
1291 /* Don't free the returned string. */
1292 char* WMSetBrowserPath(WMBrowser
*bPtr
, char *path
);
1294 /* free the returned string */
1295 char* WMGetBrowserPath(WMBrowser
*bPtr
);
1297 /* free the returned string */
1298 char* WMGetBrowserPathToColumn(WMBrowser
*bPtr
, int column
);
1300 /* free the returned array */
1301 WMArray
* WMGetBrowserPaths(WMBrowser
*bPtr
);
1303 void WMSetBrowserAction(WMBrowser
*bPtr
, WMAction
*action
, void *clientData
);
1305 void WMSetBrowserDoubleAction(WMBrowser
*bPtr
, WMAction
*action
,
1308 WMListItem
* WMGetBrowserSelectedItemInColumn(WMBrowser
*bPtr
, int column
);
1310 int WMGetBrowserFirstVisibleColumn(WMBrowser
*bPtr
);
1312 int WMGetBrowserSelectedColumn(WMBrowser
*bPtr
);
1314 int WMGetBrowserSelectedRowInColumn(WMBrowser
*bPtr
, int column
);
1316 int WMGetBrowserNumberOfColumns(WMBrowser
*bPtr
);
1318 int WMGetBrowserMaxVisibleColumns(WMBrowser
*bPtr
);
1320 WMList
* WMGetBrowserListInColumn(WMBrowser
*bPtr
, int column
);
1322 void WMSetBrowserDelegate(WMBrowser
*bPtr
, WMBrowserDelegate
*delegate
);
1324 Bool
WMBrowserAllowsMultipleSelection(WMBrowser
*bPtr
);
1326 Bool
WMBrowserAllowsEmptySelection(WMBrowser
*bPtr
);
1328 void WMSetBrowserHasScroller(WMBrowser
*bPtr
, int hasScroller
);
1330 /* ---[ WINGs/wmenuitem.c ]----------------------------------------------- */
1333 Bool
WMMenuItemIsSeparator(WMMenuItem
*item
);
1335 WMMenuItem
* WMCreateMenuItem(void);
1337 void WMDestroyMenuItem(WMMenuItem
*item
);
1339 Bool
WMGetMenuItemEnabled(WMMenuItem
*item
);
1341 void WMSetMenuItemEnabled(WMMenuItem
*item
, Bool flag
);
1343 char* WMGetMenuItemShortcut(WMMenuItem
*item
);
1345 unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem
*item
);
1347 void WMSetMenuItemShortcut(WMMenuItem
*item
, const char *shortcut
);
1349 void WMSetMenuItemShortcutModifierMask(WMMenuItem
*item
, unsigned mask
);
1351 void* WMGetMenuItemRepresentedObject(WMMenuItem
*item
);
1353 void WMSetMenuItemRepresentedObject(WMMenuItem
*item
, void *object
);
1355 void WMSetMenuItemAction(WMMenuItem
*item
, WMAction
*action
, void *data
);
1357 WMAction
* WMGetMenuItemAction(WMMenuItem
*item
);
1359 void* WMGetMenuItemData(WMMenuItem
*item
);
1361 void WMSetMenuItemTitle(WMMenuItem
*item
, const char *title
);
1363 char* WMGetMenuItemTitle(WMMenuItem
*item
);
1365 void WMSetMenuItemState(WMMenuItem
*item
, int state
);
1367 int WMGetMenuItemState(WMMenuItem
*item
);
1369 void WMSetMenuItemPixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1371 WMPixmap
* WMGetMenuItemPixmap(WMMenuItem
*item
);
1373 void WMSetMenuItemOnStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1375 WMPixmap
* WMGetMenuItemOnStatePixmap(WMMenuItem
*item
);
1377 void WMSetMenuItemOffStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1379 WMPixmap
* WMGetMenuItemOffStatePixmap(WMMenuItem
*item
);
1381 void WMSetMenuItemMixedStatePixmap(WMMenuItem
*item
, WMPixmap
*pixmap
);
1383 WMPixmap
* WMGetMenuItemMixedStatePixmap(WMMenuItem
*item
);
1385 /*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
1388 WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
1390 Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
1393 /* ---[ WINGs/wpopupbutton.c ]-------------------------------------------- */
1395 WMPopUpButton
* WMCreatePopUpButton(WMWidget
*parent
);
1397 void WMSetPopUpButtonAction(WMPopUpButton
*sPtr
, WMAction
*action
,
1400 void WMSetPopUpButtonPullsDown(WMPopUpButton
*bPtr
, Bool flag
);
1402 WMMenuItem
* WMAddPopUpButtonItem(WMPopUpButton
*bPtr
, const char *title
);
1404 WMMenuItem
* WMInsertPopUpButtonItem(WMPopUpButton
*bPtr
, int index
,
1407 void WMRemovePopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1409 void WMSetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
, Bool flag
);
1411 Bool
WMGetPopUpButtonItemEnabled(WMPopUpButton
*bPtr
, int index
);
1413 void WMSetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
, int index
);
1415 int WMGetPopUpButtonSelectedItem(WMPopUpButton
*bPtr
);
1417 void WMSetPopUpButtonText(WMPopUpButton
*bPtr
, const char *text
);
1419 /* don't free the returned data */
1420 char* WMGetPopUpButtonItem(WMPopUpButton
*bPtr
, int index
);
1422 WMMenuItem
* WMGetPopUpButtonMenuItem(WMPopUpButton
*bPtr
, int index
);
1424 int WMGetPopUpButtonNumberOfItems(WMPopUpButton
*bPtr
);
1426 void WMSetPopUpButtonEnabled(WMPopUpButton
*bPtr
, Bool flag
);
1428 Bool
WMGetPopUpButtonEnabled(WMPopUpButton
*bPtr
);
1430 /* ---[ WINGs/wcolorpanel.c ]--------------------------------------------- */
1432 WMColorPanel
* WMGetColorPanel(WMScreen
*scrPtr
);
1434 void WMFreeColorPanel(WMColorPanel
*panel
);
1436 void WMShowColorPanel(WMColorPanel
*panel
);
1438 void WMCloseColorPanel(WMColorPanel
*panel
);
1440 void WMSetColorPanelColor(WMColorPanel
*panel
, WMColor
*color
);
1442 WMColor
* WMGetColorPanelColor(WMColorPanel
*panel
);
1444 void WMSetColorPanelPickerMode(WMColorPanel
*panel
, WMColorPanelMode mode
);
1446 void WMSetColorPanelAction(WMColorPanel
*panel
, WMAction2
*action
, void *data
);
1448 extern char *WMColorPanelColorChangedNotification
;
1450 /* ---[ WINGs/wcolorwell.c ]---------------------------------------------- */
1452 WMColorWell
* WMCreateColorWell(WMWidget
*parent
);
1454 void WMSetColorWellColor(WMColorWell
*cPtr
, WMColor
*color
);
1456 WMColor
* WMGetColorWellColor(WMColorWell
*cPtr
);
1458 void WSetColorWellBordered(WMColorWell
*cPtr
, Bool flag
);
1461 extern char *WMColorWellDidChangeNotification
;
1464 /* ---[ WINGs/wscrollview.c ]--------------------------------------------- */
1466 WMScrollView
* WMCreateScrollView(WMWidget
*parent
);
1468 void WMResizeScrollViewContent(WMScrollView
*sPtr
, unsigned int width
,
1469 unsigned int height
);
1471 void WMSetScrollViewHasHorizontalScroller(WMScrollView
*sPtr
, Bool flag
);
1473 void WMSetScrollViewHasVerticalScroller(WMScrollView
*sPtr
, Bool flag
);
1475 void WMSetScrollViewContentView(WMScrollView
*sPtr
, WMView
*view
);
1477 void WMSetScrollViewRelief(WMScrollView
*sPtr
, WMReliefType type
);
1479 WMRect
WMGetScrollViewVisibleRect(WMScrollView
*sPtr
);
1481 WMScroller
* WMGetScrollViewHorizontalScroller(WMScrollView
*sPtr
);
1483 WMScroller
* WMGetScrollViewVerticalScroller(WMScrollView
*sPtr
);
1485 void WMSetScrollViewLineScroll(WMScrollView
*sPtr
, int amount
);
1487 void WMSetScrollViewPageScroll(WMScrollView
*sPtr
, int amount
);
1489 /* ---[ WINGs/wslider.c ]------------------------------------------------- */
1491 WMSlider
* WMCreateSlider(WMWidget
*parent
);
1493 int WMGetSliderMinValue(WMSlider
*slider
);
1495 int WMGetSliderMaxValue(WMSlider
*slider
);
1497 int WMGetSliderValue(WMSlider
*slider
);
1499 void WMSetSliderMinValue(WMSlider
*slider
, int value
);
1501 void WMSetSliderMaxValue(WMSlider
*slider
, int value
);
1503 void WMSetSliderValue(WMSlider
*slider
, int value
);
1505 void WMSetSliderContinuous(WMSlider
*slider
, Bool flag
);
1507 void WMSetSliderAction(WMSlider
*slider
, WMAction
*action
, void *data
);
1509 void WMSetSliderKnobThickness(WMSlider
*sPtr
, int thickness
);
1511 void WMSetSliderImage(WMSlider
*sPtr
, WMPixmap
*pixmap
);
1513 /* ---[ WINGs/wsplitview.c ]---------------------------------------------- */
1516 WMSplitView
* WMCreateSplitView(WMWidget
*parent
);
1518 Bool
WMGetSplitViewVertical(WMSplitView
*sPtr
);
1520 void WMSetSplitViewVertical(WMSplitView
*sPtr
, Bool flag
);
1522 int WMGetSplitViewSubviewsCount(WMSplitView
*sPtr
); /* ??? remove ??? */
1524 WMView
* WMGetSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1526 /* remove the first subview == view */
1527 void WMRemoveSplitViewSubview(WMSplitView
*sPtr
, WMView
*view
);
1529 void WMRemoveSplitViewSubviewAt(WMSplitView
*sPtr
, int index
);
1532 void WMAddSplitViewSubview(WMSplitView
*sPtr
, WMView
*subview
);
1534 void WMAdjustSplitViewSubviews(WMSplitView
*sPtr
);
1536 void WMSetSplitViewConstrainProc(WMSplitView
*sPtr
,
1537 WMSplitViewConstrainProc
*proc
);
1540 void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1541 WMSplitViewResizeSubviewsProc *proc);
1544 int WMGetSplitViewDividerThickness(WMSplitView
*sPtr
);
1546 /* ...................................................................... */
1548 WMRuler
* WMCreateRuler (WMWidget
*parent
);
1550 WMRulerMargins
* WMGetRulerMargins(WMRuler
*rPtr
);
1552 void WMSetRulerMargins(WMRuler
*rPtr
, WMRulerMargins margins
);
1554 Bool
WMIsMarginEqualToMargin(WMRulerMargins
*aMargin
, WMRulerMargins
*anotherMargin
);
1556 int WMGetGrabbedRulerMargin(WMRuler
*rPtr
);
1558 int WMGetReleasedRulerMargin(WMRuler
*rPtr
);
1560 int WMGetRulerOffset(WMRuler
*rPtr
);
1562 void WMSetRulerOffset(WMRuler
*rPtr
, int pixels
);
1564 void WMSetRulerMoveAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1566 void WMSetRulerReleaseAction(WMRuler
*rPtr
, WMAction
*action
, void *clientData
);
1568 /* ....................................................................... */
1571 #define WMCreateText(parent) WMCreateTextForDocumentType \
1572 ((parent), (NULL), (NULL))
1574 WMText
* WMCreateTextForDocumentType(WMWidget
*parent
, WMAction
*parser
,
1577 void WMSetTextDelegate(WMText
*tPtr
, WMTextDelegate
*delegate
);
1579 void WMFreezeText(WMText
*tPtr
);
1581 #define WMRefreshText(tPtr) WMThawText((tPtr))
1583 void WMThawText(WMText
*tPtr
);
1585 int WMScrollText(WMText
*tPtr
, int amount
);
1587 int WMPageText(WMText
*tPtr
, Bool direction
);
1589 void WMSetTextHasHorizontalScroller(WMText
*tPtr
, Bool shouldhave
);
1591 void WMSetTextHasVerticalScroller(WMText
*tPtr
, Bool shouldhave
);
1593 void WMSetTextHasRuler(WMText
*tPtr
, Bool shouldhave
);
1595 void WMShowTextRuler(WMText
*tPtr
, Bool show
);
1597 int WMGetTextRulerShown(WMText
*tPtr
);
1599 void WMSetTextEditable(WMText
*tPtr
, Bool editable
);
1601 int WMGetTextEditable(WMText
*tPtr
);
1603 void WMSetTextUsesMonoFont(WMText
*tPtr
, Bool mono
);
1605 int WMGetTextUsesMonoFont(WMText
*tPtr
);
1607 void WMSetTextIndentNewLines(WMText
*tPtr
, Bool indent
);
1609 void WMSetTextIgnoresNewline(WMText
*tPtr
, Bool ignore
);
1611 int WMGetTextIgnoresNewline(WMText
*tPtr
);
1613 void WMSetTextDefaultFont(WMText
*tPtr
, WMFont
*font
);
1615 WMFont
* WMGetTextDefaultFont(WMText
*tPtr
);
1617 void WMSetTextDefaultColor(WMText
*tPtr
, WMColor
*color
);
1619 WMColor
* WMGetTextDefaultColor(WMText
*tPtr
);
1621 void WMSetTextRelief(WMText
*tPtr
, WMReliefType relief
);
1623 void WMSetTextForegroundColor(WMText
*tPtr
, WMColor
*color
);
1625 void WMSetTextBackgroundColor(WMText
*tPtr
, WMColor
*color
);
1627 void WMSetTextBackgroundPixmap(WMText
*tPtr
, WMPixmap
*pixmap
);
1629 void WMPrependTextStream(WMText
*tPtr
, const char *text
);
1631 void WMAppendTextStream(WMText
*tPtr
, const char *text
);
1633 #define WMClearText(tPtr) WMAppendTextStream \
1637 char* WMGetTextStream(WMText
*tPtr
);
1640 char* WMGetTextSelectedStream(WMText
*tPtr
);
1642 /* destroy the array */
1643 WMArray
* WMGetTextObjects(WMText
*tPtr
);
1645 /* destroy the array */
1646 WMArray
* WMGetTextSelectedObjects(WMText
*tPtr
);
1648 void WMSetTextSelectionColor(WMText
*tPtr
, WMColor
*color
);
1650 WMColor
* WMGetTextSelectionColor(WMText
*tPtr
);
1652 void WMSetTextSelectionFont(WMText
*tPtr
, WMFont
*font
);
1654 WMFont
* WMGetTextSelectionFont(WMText
*tPtr
);
1656 void WMSetTextSelectionUnderlined(WMText
*tPtr
, int underlined
);
1658 int WMGetTextSelectionUnderlined(WMText
*tPtr
);
1660 void WMSetTextAlignment(WMText
*tPtr
, WMAlignment alignment
);
1662 Bool
WMFindInTextStream(WMText
*tPtr
, const char *needle
, Bool direction
,
1663 Bool caseSensitive
);
1665 /* Warning: replacement can be modified by the function */
1666 Bool
WMReplaceTextSelection(WMText
*tPtr
, char *replacement
);
1669 /* parser related stuff... use only if implementing a new parser */
1671 void* WMCreateTextBlockWithObject(WMText
*tPtr
, WMWidget
*w
, const char *description
,
1672 WMColor
*color
, unsigned short first
,
1673 unsigned short extraInfo
);
1675 void* WMCreateTextBlockWithPixmap(WMText
*tPtr
, WMPixmap
*p
, const char *description
,
1676 WMColor
*color
, unsigned short first
,
1677 unsigned short extraInfo
);
1679 void* WMCreateTextBlockWithText(WMText
*tPtr
, const char *text
, WMFont
*font
,
1680 WMColor
*color
, unsigned short first
,
1681 unsigned short length
);
1683 void WMSetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int first
,
1684 unsigned int kanji
, unsigned int underlined
,
1685 int script
, WMRulerMargins
*margins
);
1687 /* do NOT free the margins */
1688 void WMGetTextBlockProperties(WMText
*tPtr
, void *vtb
, unsigned int *first
,
1689 unsigned int *kanji
, unsigned int *underlined
,
1690 int *script
, WMRulerMargins
*margins
);
1692 int WMGetTextInsertType(WMText
*tPtr
);
1694 /*int WMGetTextBlocks(WMText *tPtr);
1696 void WMSetCurrentTextBlock(WMText *tPtr, int current);
1698 int WMGetCurrentTextBlock(WMText *tPtr);*/
1700 void WMPrependTextBlock(WMText
*tPtr
, void *vtb
);
1702 void WMAppendTextBlock(WMText
*tPtr
, void *vtb
);
1704 void* WMRemoveTextBlock(WMText
*tPtr
);
1706 void WMDestroyTextBlock(WMText
*tPtr
, void *vtb
);
1708 /* ---[ WINGs/wtabview.c ]------------------------------------------------ */
1710 WMTabView
* WMCreateTabView(WMWidget
*parent
);
1712 void WMSetTabViewType(WMTabView
*tPtr
, WMTabViewType type
);
1714 void WMSetTabViewEnabled(WMTabView
*tPtr
, Bool flag
);
1716 void WMSetTabViewFont(WMTabView
*tPtr
, WMFont
*font
);
1718 void WMAddItemInTabView(WMTabView
*tPtr
, WMTabViewItem
*item
);
1720 void WMInsertItemInTabView(WMTabView
*tPtr
, int index
, WMTabViewItem
*item
);
1722 void WMRemoveTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1724 WMTabViewItem
* WMAddTabViewItemWithView(WMTabView
*tPtr
, WMView
*view
,
1725 int identifier
, const char *label
);
1727 WMTabViewItem
* WMTabViewItemAtPoint(WMTabView
*tPtr
, int x
, int y
);
1729 void WMSelectFirstTabViewItem(WMTabView
*tPtr
);
1731 void WMSelectLastTabViewItem(WMTabView
*tPtr
);
1733 void WMSelectNextTabViewItem(WMTabView
*tPtr
);
1735 void WMSelectPreviousTabViewItem(WMTabView
*tPtr
);
1737 WMTabViewItem
* WMGetSelectedTabViewItem(WMTabView
*tPtr
);
1739 void WMSelectTabViewItem(WMTabView
*tPtr
, WMTabViewItem
*item
);
1741 void WMSelectTabViewItemAtIndex(WMTabView
*tPtr
, int index
);
1743 void WMSetTabViewDelegate(WMTabView
*tPtr
, WMTabViewDelegate
*delegate
);
1746 WMTabViewItem
* WMCreateTabViewItemWithIdentifier(int identifier
);
1748 void WMSetTabViewItemEnabled(WMTabViewItem
*tPtr
, Bool flag
);
1750 int WMGetTabViewItemIdentifier(WMTabViewItem
*item
);
1752 void WMSetTabViewItemLabel(WMTabViewItem
*item
, const char *label
);
1754 char* WMGetTabViewItemLabel(WMTabViewItem
*item
);
1756 void WMSetTabViewItemView(WMTabViewItem
*item
, WMView
*view
);
1758 WMView
* WMGetTabViewItemView(WMTabViewItem
*item
);
1760 void WMDestroyTabViewItem(WMTabViewItem
*item
);
1763 /* ---[ WINGs/wbox.c ]---------------------------------------------------- */
1765 WMBox
* WMCreateBox(WMWidget
*parent
);
1767 void WMSetBoxBorderWidth(WMBox
*box
, unsigned width
);
1769 void WMAddBoxSubview(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1770 int minSize
, int maxSize
, int space
);
1772 void WMAddBoxSubviewAtEnd(WMBox
*bPtr
, WMView
*view
, Bool expand
, Bool fill
,
1773 int minSize
, int maxSize
, int space
);
1775 void WMRemoveBoxSubview(WMBox
*bPtr
, WMView
*view
);
1777 void WMSetBoxHorizontal(WMBox
*box
, Bool flag
);
1779 /* ---[ WINGs/wpanel.c ]-------------------------------------------------- */
1781 int WMRunAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
, const char *msg
,
1782 const char *defaultButton
, const char *alternateButton
,
1783 const char *otherButton
);
1785 /* you can free the returned string */
1786 char* WMRunInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
, const char *msg
,
1787 const char *defaultText
, const char *okButton
, const char *cancelButton
);
1789 WMAlertPanel
* WMCreateAlertPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1790 const char *msg
, const char *defaultButton
,
1791 const char *alternateButton
, const char *otherButton
);
1793 WMInputPanel
* WMCreateInputPanel(WMScreen
*app
, WMWindow
*owner
, const char *title
,
1794 const char *msg
, const char *defaultText
, const char *okButton
,
1795 const char *cancelButton
);
1798 WMGenericPanel
* WMCreateGenericPanel(WMScreen
*scrPtr
, WMWindow
*owner
,
1799 const char *title
, const char *defaultButton
,
1800 const char *alternateButton
);
1802 void WMDestroyAlertPanel(WMAlertPanel
*panel
);
1804 void WMDestroyInputPanel(WMInputPanel
*panel
);
1806 void WMDestroyGenericPanel(WMGenericPanel
*panel
);
1808 /* ---[ WINGs/wfilepanel.c ]---------------------------------------------- */
1810 /* only 1 instance per WMScreen */
1811 WMOpenPanel
* WMGetOpenPanel(WMScreen
*scrPtr
);
1813 WMSavePanel
* WMGetSavePanel(WMScreen
*scrPtr
);
1815 void WMSetFilePanelCanChooseDirectories(WMFilePanel
*panel
, Bool flag
);
1817 void WMSetFilePanelCanChooseFiles(WMFilePanel
*panel
, Bool flag
);
1819 void WMSetFilePanelAutoCompletion(WMFilePanel
*panel
, Bool flag
);
1821 void WMSetFilePanelDirectory(WMFilePanel
*panel
, char *path
);
1823 /* you can free the returned string */
1824 char* WMGetFilePanelFileName(WMFilePanel
*panel
);
1826 void WMFreeFilePanel(WMFilePanel
*panel
);
1828 int WMRunModalFilePanelForDirectory(WMFilePanel
*panel
, WMWindow
*owner
,
1829 char *path
, const char *name
, char **fileTypes
);
1831 void WMSetFilePanelAccessoryView(WMFilePanel
*panel
, WMView
*view
);
1833 WMView
* WMGetFilePanelAccessoryView(WMFilePanel
*panel
);
1836 /* ---[ WINGs/wfontpanel.c ]---------------------------------------------- */
1838 /* only 1 instance per WMScreen */
1839 WMFontPanel
* WMGetFontPanel(WMScreen
*scr
);
1841 void WMShowFontPanel(WMFontPanel
*panel
);
1843 void WMHideFontPanel(WMFontPanel
*panel
);
1845 void WMFreeFontPanel(WMFontPanel
*panel
);
1847 void WMSetFontPanelAction(WMFontPanel
*panel
, WMAction2
*action
, void *data
);
1849 void WMSetFontPanelFont(WMFontPanel
*panel
, const char *fontName
);
1851 WMFont
* WMGetFontPanelFont(WMFontPanel
*panel
);
1853 /* ---[ WINGs/configuration.c ]------------------------------------------- */
1854 unsigned W_getconf_mouseWheelUp(void);
1855 unsigned W_getconf_mouseWheelDown(void);
1856 void W_setconf_doubleClickDelay(int value
);
1860 #endif /* __cplusplus */