Add history to some dialog boxes
[wmaker-crm.git] / WINGs / WINGs / WINGs.h
Commit [+]AuthorDateLineData
9d2e6ef9 scottc1998-09-29 22:36:29 +00001
2
3#ifndef _WINGS_H_
4#define _WINGS_H_
5
6#include <wraster.h>
b4851afb kojima2001-01-16 16:08:40 +00007#include <WINGs/WUtil.h>
9d2e6ef9 scottc1998-09-29 22:36:29 +00008#include <X11/Xlib.h>
9
e9e1186f dan2004-10-30 06:39:27 +000010#define WINGS_H_VERSION 20041030
9d2e6ef9 scottc1998-09-29 22:36:29 +000011
12
e7495baf dan1999-02-17 11:06:40 +000013#ifdef __cplusplus
14extern "C" {
15#endif /* __cplusplus */
16#if 0
17}
18#endif
9d2e6ef9 scottc1998-09-29 22:36:29 +000019
20
21typedef unsigned long WMPixel;
22
23
24typedef struct {
25 unsigned int width;
26 unsigned int height;
27} WMSize;
28
29typedef struct {
30 int x;
31 int y;
32} WMPoint;
33
34typedef struct {
35 WMPoint pos;
36 WMSize size;
37} WMRect;
38
9035122c dan2001-04-09 23:43:09 +000039
40
9d2e6ef9 scottc1998-09-29 22:36:29 +000041
42
43#define ClientMessageMask (1L<<30)
44
45
14f2db1e richard2001-02-10 18:13:32 +000046#ifndef _DEFINED_GNUSTEP_WINDOW_INFO
47#define _DEFINED_GNUSTEP_WINDOW_INFO
4d8e6916 richard2001-02-09 15:56:52 +000048/*
49 * Window levels are taken from GNUstep (gui/AppKit/NSWindow.h)
50 * NSDesktopWindowLevel intended to be the level at which things
51 * on the desktop sit ... so you should be able
52 * to put a desktop background just below it.
53 *
54 * Applications are actually permitted to use any value in the
55 * range INT_MIN+1 to INT_MAX
56 */
9d2e6ef9 scottc1998-09-29 22:36:29 +000057enum {
6830b057 dan2004-10-12 21:28:27 +000058 WMDesktopWindowLevel = -1000, /* GNUstep addition */
59 WMNormalWindowLevel = 0,
60 WMFloatingWindowLevel = 3,
61 WMSubmenuWindowLevel = 3,
62 WMTornOffMenuWindowLevel = 3,
63 WMMainMenuWindowLevel = 20,
64 WMDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */
65 WMStatusWindowLevel = 21,
66 WMModalPanelWindowLevel = 100,
67 WMPopUpMenuWindowLevel = 101,
68 WMScreenSaverWindowLevel = 1000
9d2e6ef9 scottc1998-09-29 22:36:29 +000069};
70
4d8e6916 richard2001-02-09 15:56:52 +000071
9d2e6ef9 scottc1998-09-29 22:36:29 +000072/* window attributes */
73enum {
6830b057 dan2004-10-12 21:28:27 +000074 WMBorderlessWindowMask = 0,
75 WMTitledWindowMask = 1,
76 WMClosableWindowMask = 2,
77 WMMiniaturizableWindowMask = 4,
78 WMResizableWindowMask = 8,
79 WMIconWindowMask = 64,
80 WMMiniWindowMask = 128
9d2e6ef9 scottc1998-09-29 22:36:29 +000081};
14f2db1e richard2001-02-10 18:13:32 +000082#endif
83
9d2e6ef9 scottc1998-09-29 22:36:29 +000084
9d2e6ef9 scottc1998-09-29 22:36:29 +000085/* button types */
86typedef enum {
87 /* 0 is reserved for internal use */
c2ec1cfe dan2002-11-13 15:13:48 +000088 WBTMomentaryPush = 1,
89 WBTPushOnPushOff = 2,
90 WBTToggle = 3,
91 WBTSwitch = 4,
92 WBTRadio = 5,
93 WBTMomentaryChange = 6,
94 WBTOnOff = 7,
95 WBTMomentaryLight = 8
9d2e6ef9 scottc1998-09-29 22:36:29 +000096} WMButtonType;
97
98/* button behaviour masks */
99enum {
c2ec1cfe dan2002-11-13 15:13:48 +0000100 WBBSpringLoadedMask = (1 << 0),
101 WBBPushInMask = (1 << 1),
102 WBBPushChangeMask = (1 << 2),
103 WBBPushLightMask = (1 << 3),
104 WBBStateLightMask = (1 << 5),
105 WBBStateChangeMask = (1 << 6),
106 WBBStatePushMask = (1 << 7)
107};
108
109
9d2e6ef9 scottc1998-09-29 22:36:29 +0000110/* frame title positions */
111typedef enum {
112 WTPNoTitle,
c2ec1cfe dan2002-11-13 15:13:48 +0000113 WTPAboveTop,
114 WTPAtTop,
115 WTPBelowTop,
116 WTPAboveBottom,
117 WTPAtBottom,
118 WTPBelowBottom
9d2e6ef9 scottc1998-09-29 22:36:29 +0000119} WMTitlePosition;
120
121
122/* relief types */
123typedef enum {
124 WRFlat,
c2ec1cfe dan2002-11-13 15:13:48 +0000125 WRSimple,
126 WRRaised,
127 WRSunken,
128 WRGroove,
129 WRRidge,
130 WRPushed
9d2e6ef9 scottc1998-09-29 22:36:29 +0000131} WMReliefType;
132
133
134/* alignment types */
135typedef enum {
136 WALeft,
c2ec1cfe dan2002-11-13 15:13:48 +0000137 WACenter,
138 WARight,
139 WAJustified /* not valid for textfields */
9d2e6ef9 scottc1998-09-29 22:36:29 +0000140} WMAlignment;
141
142
143/* image position */
144typedef enum {
145 WIPNoImage,
146 WIPImageOnly,
147 WIPLeft,
148 WIPRight,
149 WIPBelow,
150 WIPAbove,
151 WIPOverlaps
152} WMImagePosition;
153
154
155/* scroller arrow position */
156typedef enum {
157 WSAMaxEnd,
c2ec1cfe dan2002-11-13 15:13:48 +0000158 WSAMinEnd,
159 WSANone
9d2e6ef9 scottc1998-09-29 22:36:29 +0000160} WMScrollArrowPosition;
161
162/* scroller parts */
163typedef enum {
164 WSNoPart,
c2ec1cfe dan2002-11-13 15:13:48 +0000165 WSDecrementPage,
166 WSIncrementPage,
167 WSDecrementLine,
168 WSIncrementLine,
169 WSDecrementWheel,
170 WSIncrementWheel,
171 WSKnob,
172 WSKnobSlot
9d2e6ef9 scottc1998-09-29 22:36:29 +0000173} WMScrollerPart;
174
175/* usable scroller parts */
176typedef enum {
177 WSUNoParts,
c2ec1cfe dan2002-11-13 15:13:48 +0000178 WSUOnlyArrows,
179 WSUAllParts
9d2e6ef9 scottc1998-09-29 22:36:29 +0000180} WMUsableScrollerParts;
181
182/* matrix types */
183typedef enum {
dd2d71fc kojima1999-05-15 17:38:05 +0000184 WMRadioMode,
c2ec1cfe dan2002-11-13 15:13:48 +0000185 WMHighlightMode,
186 WMListMode,
187 WMTrackMode
9d2e6ef9 scottc1998-09-29 22:36:29 +0000188} WMMatrixTypes;
189
190
dd2d71fc kojima1999-05-15 17:38:05 +0000191typedef enum {
192 WTTopTabsBevelBorder,
c2ec1cfe dan2002-11-13 15:13:48 +0000193 WTNoTabsBevelBorder,
194 WTNoTabsLineBorder,
195 WTNoTabsNoBorder
60a247f2 kojima2000-04-03 03:10:20 +0000196} WMTabViewType;
dd2d71fc kojima1999-05-15 17:38:05 +0000197
198
9d2e6ef9 scottc1998-09-29 22:36:29 +0000199/* text movement types */
200enum {
201 WMIllegalTextMovement,
c2ec1cfe dan2002-11-13 15:13:48 +0000202 WMReturnTextMovement,
203 WMEscapeTextMovement,
204 WMTabTextMovement,
205 WMBacktabTextMovement,
206 WMLeftTextMovement,
207 WMRightTextMovement,
208 WMUpTextMovement,
209 WMDownTextMovement
9d2e6ef9 scottc1998-09-29 22:36:29 +0000210};
211
931a37b1 dan1999-01-29 08:11:17 +0000212/* text field special events */
213enum {
931a37b1 dan1999-01-29 08:11:17 +0000214 WMInsertTextEvent,
215 WMDeleteTextEvent
216};
217
60a247f2 kojima2000-04-03 03:10:20 +0000218
539fb327 dan2000-09-28 22:32:36 +0000219enum {
220 WLNotFound = -1 /* element was not found in WMList */
221};
222
223
60a247f2 kojima2000-04-03 03:10:20 +0000224/* drag operations */
225typedef enum {
e7d0c5d9 dan2004-04-07 02:50:52 +0000226 WDOperationNone = 0,
60a247f2 kojima2000-04-03 03:10:20 +0000227 WDOperationCopy,
228 WDOperationMove,
229 WDOperationLink,
230 WDOperationAsk,
231 WDOperationPrivate
232} WMDragOperationType;
233
234
416e3a82 dan1999-01-25 19:06:50 +0000235typedef enum {
c2ec1cfe dan2002-11-13 15:13:48 +0000236 WMGrayModeColorPanel = 1,
237 WMRGBModeColorPanel = 2,
238 WMCMYKModeColorPanel = 3,
239 WMHSBModeColorPanel = 4,
240 WMCustomPaletteModeColorPanel = 5,
241 WMColorListModeColorPanel = 6,
242 WMWheelModeColorPanel = 7
416e3a82 dan1999-01-25 19:06:50 +0000243} WMColorPanelMode;
244
245
9d2e6ef9 scottc1998-09-29 22:36:29 +0000246
247/* system images */
248#define WSIReturnArrow 1
249#define WSIHighlightedReturnArrow 2
250#define WSIScrollerDimple 3
251#define WSIArrowLeft 4
252#define WSIHighlightedArrowLeft 5
253#define WSIArrowRight 6
254#define WSIHighlightedArrowRight 7
255#define WSIArrowUp 8
256#define WSIHighlightedArrowUp 9
257#define WSIArrowDown 10
258#define WSIHighlightedArrowDown 11
0261c326 dan1999-01-06 15:22:33 +0000259#define WSICheckMark 12
9d2e6ef9 scottc1998-09-29 22:36:29 +0000260
261enum {
262 WLDSSelected = (1 << 16),
c2ec1cfe dan2002-11-13 15:13:48 +0000263 WLDSDisabled = (1 << 17),
264 WLDSFocused = (1 << 18),
265 WLDSIsBranch = (1 << 19)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000266};
267
268/* alert panel return values */
269enum {
270 WAPRDefault = 0,
c2ec1cfe dan2002-11-13 15:13:48 +0000271 WAPRAlternate = 1,
272 WAPROther = -1,
273 WAPRError = -2
9d2e6ef9 scottc1998-09-29 22:36:29 +0000274};
275
276
277
278/* types of input observers */
279enum {
280 WIReadMask = (1 << 0),
c2ec1cfe dan2002-11-13 15:13:48 +0000281 WIWriteMask = (1 << 1),
282 WIExceptMask = (1 << 2)
9d2e6ef9 scottc1998-09-29 22:36:29 +0000283};
284
285
286
287typedef int W_Class;
288
289enum {
290 WC_Window = 0,
291 WC_Frame = 1,
292 WC_Label = 2,
293 WC_Button = 3,
294 WC_TextField = 4,
295 WC_Scroller = 5,
296 WC_ScrollView = 6,
297 WC_List = 7,
298 WC_Browser = 8,
299 WC_PopUpButton = 9,
300 WC_ColorWell = 10,
301 WC_Slider = 11,
302 WC_Matrix = 12, /* not ready */
dd2d71fc kojima1999-05-15 17:38:05 +0000303 WC_SplitView = 13,
052ab01c kojima1999-09-16 02:55:56 +0000304 WC_TabView = 14,
eb87c409 kojima1999-10-20 03:25:06 +0000305 WC_ProgressIndicator = 15,
c49ad9ca kojima2000-06-20 23:27:37 +0000306 WC_MenuView = 16,
307 WC_Ruler = 17,
19160e8d kojima2000-11-09 05:01:58 +0000308 WC_Text = 18,
309 WC_Box = 19
9d2e6ef9 scottc1998-09-29 22:36:29 +0000310};
311
312/* All widgets must start with the following structure
313 * in that order. Used for typecasting to get some generic data */
314typedef struct W_WidgetType {
315 W_Class widgetClass;
316 struct W_View *view;
c2ec1cfe dan2002-11-13 15:13:48 +0000317
9d2e6ef9 scottc1998-09-29 22:36:29 +0000318} W_WidgetType;
319
320
321#define WMWidgetClass(widget) (((W_WidgetType*)(widget))->widgetClass)
322#define WMWidgetView(widget) (((W_WidgetType*)(widget))->view)
323
324
325/* widgets */
326
327typedef void WMWidget;
328
329typedef struct W_Pixmap WMPixmap;
330typedef struct W_Font WMFont;
331typedef struct W_Color WMColor;
332
333typedef struct W_Screen WMScreen;
334
335typedef struct W_View WMView;
336
337typedef struct W_Window WMWindow;
338typedef struct W_Frame WMFrame;
339typedef struct W_Button WMButton;
340typedef struct W_Label WMLabel;
341typedef struct W_TextField WMTextField;
342typedef struct W_Scroller WMScroller;
343typedef struct W_ScrollView WMScrollView;
344typedef struct W_List WMList;
345typedef struct W_Browser WMBrowser;
346typedef struct W_PopUpButton WMPopUpButton;
052ab01c kojima1999-09-16 02:55:56 +0000347typedef struct W_ProgressIndicator WMProgressIndicator;
9d2e6ef9 scottc1998-09-29 22:36:29 +0000348typedef struct W_ColorWell WMColorWell;
349typedef struct W_Slider WMSlider;
350typedef struct W_Matrix WMMatrix; /* not ready */
351typedef struct W_SplitView WMSplitView;
dd2d71fc kojima1999-05-15 17:38:05 +0000352typedef struct W_TabView WMTabView;
c49ad9ca kojima2000-06-20 23:27:37 +0000353typedef struct W_Ruler WMRuler;
354typedef struct W_Text WMText;
19160e8d kojima2000-11-09 05:01:58 +0000355typedef struct W_Box WMBox;
c49ad9ca kojima2000-06-20 23:27:37 +0000356
9d2e6ef9 scottc1998-09-29 22:36:29 +0000357
358/* not widgets */
dd2d71fc kojima1999-05-15 17:38:05 +0000359typedef struct W_TabViewItem WMTabViewItem;
eb87c409 kojima1999-10-20 03:25:06 +0000360typedef struct W_MenuItem WMMenuItem;
dd2d71fc kojima1999-05-15 17:38:05 +0000361
362
9d2e6ef9 scottc1998-09-29 22:36:29 +0000363typedef struct W_FilePanel WMFilePanel;
364typedef WMFilePanel WMOpenPanel;
365typedef WMFilePanel WMSavePanel;
366
367typedef struct W_FontPanel WMFontPanel;
368
416e3a82 dan1999-01-25 19:06:50 +0000369typedef struct W_ColorPanel WMColorPanel;
370
9d2e6ef9 scottc1998-09-29 22:36:29 +0000371
372/* item for WMList */
373typedef struct WMListItem {
374 char *text;
9af1c6c4 dan1998-10-21 14:43:47 +0000375 void *clientData; /* ptr for user clientdata. */
41ff1274 dan2000-09-23 03:49:58 +0000376
9d2e6ef9 scottc1998-09-29 22:36:29 +0000377 unsigned int uflags:16; /* flags for the user */
378 unsigned int selected:1;
379 unsigned int disabled:1;
380 unsigned int isBranch:1;
381 unsigned int loaded:1;
382} WMListItem;
383
384/* struct for message panel */
385typedef struct WMAlertPanel {
386 WMWindow *win; /* window */
22eb14c9 kojima2001-01-09 16:45:14 +0000387 WMBox *vbox;
72150b1d dan2001-11-05 23:19:46 +0000388 WMBox *hbox;
9d2e6ef9 scottc1998-09-29 22:36:29 +0000389 WMButton *defBtn; /* default button */
390 WMButton *altBtn; /* alternative button */
391 WMButton *othBtn; /* other button */
392 WMLabel *iLbl; /* icon label */
393 WMLabel *tLbl; /* title label */
394 WMLabel *mLbl; /* message label */
395 WMFrame *line; /* separator */
396 short result; /* button that was pushed */
9d2e6ef9 scottc1998-09-29 22:36:29 +0000397} WMAlertPanel;
398
399
affcc3ba kojima2001-02-20 23:38:36 +0000400typedef struct WMGenericPanel {
401 WMWindow *win;
402 WMBox *vbox;
6830b057 dan2004-10-12 21:28:27 +0000403
affcc3ba kojima2001-02-20 23:38:36 +0000404 WMLabel *iLbl;
405 WMLabel *tLbl;
6830b057 dan2004-10-12 21:28:27 +0000406
affcc3ba kojima2001-02-20 23:38:36 +0000407 WMFrame *line;
6830b057 dan2004-10-12 21:28:27 +0000408
affcc3ba kojima2001-02-20 23:38:36 +0000409 WMFrame *content;
6830b057 dan2004-10-12 21:28:27 +0000410
affcc3ba kojima2001-02-20 23:38:36 +0000411 WMBox *buttonBox;
412 WMButton *defBtn;
413 WMButton *altBtn;
6830b057 dan2004-10-12 21:28:27 +0000414
affcc3ba kojima2001-02-20 23:38:36 +0000415 short result;
affcc3ba kojima2001-02-20 23:38:36 +0000416} WMGenericPanel;
417
418
9d2e6ef9 scottc1998-09-29 22:36:29 +0000419typedef struct WMInputPanel {
420 WMWindow *win; /* window */
421 WMButton *defBtn; /* default button */
422 WMButton *altBtn; /* alternative button */
423 WMLabel *tLbl; /* title label */
424 WMLabel *mLbl; /* message label */
425 WMTextField *text; /* text field */
426 short result; /* button that was pushed */
9d2e6ef9 scottc1998-09-29 22:36:29 +0000427} WMInputPanel;
428
429
e7d0c5d9 dan2004-04-07 02:50:52 +0000430/* Basic font styles. Used to easily get one style from another */
431typedef enum WMFontStyle {
432 WFSNormal = 0,
433 WFSBold = 1,
08e811aa dan2004-10-22 00:21:51 +0000434 WFSItalic = 2,
435 WFSBoldItalic = 3
e7d0c5d9 dan2004-04-07 02:50:52 +0000436} WMFontStyle;
18b37532 dan2002-11-22 04:49:05 +0000437
438
cc3bbcaf nwanua2000-09-01 17:58:29 +0000439/* WMRuler: */
6de30498 dan2000-06-22 22:49:50 +0000440typedef struct {
81f5124c nwanua2000-09-29 04:50:56 +0000441 WMArray *tabs; /* a growable array of tabstops */
ac4997e7 nwanua2000-09-20 04:26:31 +0000442 unsigned short left; /* left margin marker */
443 unsigned short right; /* right margin marker */
444 unsigned short first; /* indentation marker for first line only */
445 unsigned short body; /* body indentation marker */
6830b057 dan2004-10-12 21:28:27 +0000446 unsigned short retainCount;
6de30498 dan2000-06-22 22:49:50 +0000447} WMRulerMargins;
cc3bbcaf nwanua2000-09-01 17:58:29 +0000448/* All indentation and tab markers are _relative_ to the left margin marker */
9d2e6ef9 scottc1998-09-29 22:36:29 +0000449
450
9d2e6ef9 scottc1998-09-29 22:36:29 +0000451typedef void WMEventProc(XEvent *event, void *clientData);
452
453typedef void WMEventHook(XEvent *event);
454
455/* self is set to the widget from where the callback is being called and
456 * clientData to the data set to with WMSetClientData() */
457typedef void WMAction(WMWidget *self, void *clientData);
458
bedc2238 kojima1999-05-16 07:00:01 +0000459/* same as WMAction, but for stuff that arent widgets */
460typedef void WMAction2(void *self, void *clientData);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000461
052ab01c kojima1999-09-16 02:55:56 +0000462
9d2e6ef9 scottc1998-09-29 22:36:29 +0000463/* delegate method like stuff */
0261c326 dan1999-01-06 15:22:33 +0000464typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
e7d0c5d9 dan2004-04-07 02:50:52 +0000465 int state, WMRect *rect);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000466
6830b057 dan2004-10-12 21:28:27 +0000467
9d2e6ef9 scottc1998-09-29 22:36:29 +0000468/*
469typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
6830b057 dan2004-10-12 21:28:27 +0000470 unsigned int oldWidth,
471 unsigned int oldHeight);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000472*/
473
474typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
e7d0c5d9 dan2004-04-07 02:50:52 +0000475 int *minSize, int *maxSize);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000476
36e46831 dan2001-04-21 07:12:21 +0000477typedef WMWidget* WMMatrixCreateCellProc(WMMatrix *mPtr);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000478
479
dd2d71fc kojima1999-05-15 17:38:05 +0000480
481
482typedef struct WMBrowserDelegate {
483 void *data;
484
485 void (*createRowsForColumn)(struct WMBrowserDelegate *self,
e7d0c5d9 dan2004-04-07 02:50:52 +0000486 WMBrowser *sender, int column, WMList *list);
dd2d71fc kojima1999-05-15 17:38:05 +0000487
488 char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
e7d0c5d9 dan2004-04-07 02:50:52 +0000489 int column);
dd2d71fc kojima1999-05-15 17:38:05 +0000490
491 void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
492
493 void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
494} WMBrowserDelegate;
495
496
497typedef struct WMTextFieldDelegate {
498 void *data;
499
35735b2f dan1999-05-18 00:01:59 +0000500 void (*didBeginEditing)(struct WMTextFieldDelegate *self,
41ff1274 dan2000-09-23 03:49:58 +0000501 WMNotification *notif);
35735b2f dan1999-05-18 00:01:59 +0000502
6830b057 dan2004-10-12 21:28:27 +0000503 void (*didChange)(struct WMTextFieldDelegate *self,
41ff1274 dan2000-09-23 03:49:58 +0000504 WMNotification *notif);
b4d4d52d dan1999-05-18 00:16:36 +0000505
dd2d71fc kojima1999-05-15 17:38:05 +0000506 void (*didEndEditing)(struct WMTextFieldDelegate *self,
41ff1274 dan2000-09-23 03:49:58 +0000507 WMNotification *notif);
dd2d71fc kojima1999-05-15 17:38:05 +0000508
509 Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
41ff1274 dan2000-09-23 03:49:58 +0000510 WMTextField *tPtr);
dd2d71fc kojima1999-05-15 17:38:05 +0000511
512 Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
41ff1274 dan2000-09-23 03:49:58 +0000513 WMTextField *tPtr);
dd2d71fc kojima1999-05-15 17:38:05 +0000514} WMTextFieldDelegate;
515
516
d3d03041 nwanua2000-07-13 23:48:54 +0000517typedef struct WMTextDelegate {
518 void *data;
41ff1274 dan2000-09-23 03:49:58 +0000519
9b0e0c6c nwanua2000-10-14 01:45:16 +0000520 Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
e7d0c5d9 dan2004-04-07 02:50:52 +0000521 void *description);
41ff1274 dan2000-09-23 03:49:58 +0000522
d3d03041 nwanua2000-07-13 23:48:54 +0000523} WMTextDelegate;
524
525
dd2d71fc kojima1999-05-15 17:38:05 +0000526
aff89828 kojima1999-05-17 03:55:35 +0000527typedef struct WMTabViewDelegate {
528 void *data;
529
530 void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
e7d0c5d9 dan2004-04-07 02:50:52 +0000531 WMTabView *tabView);
aff89828 kojima1999-05-17 03:55:35 +0000532
533 void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
41ff1274 dan2000-09-23 03:49:58 +0000534 WMTabViewItem *item);
aff89828 kojima1999-05-17 03:55:35 +0000535
6830b057 dan2004-10-12 21:28:27 +0000536 Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
41ff1274 dan2000-09-23 03:49:58 +0000537 WMTabViewItem *item);
aff89828 kojima1999-05-17 03:55:35 +0000538
539 void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
41ff1274 dan2000-09-23 03:49:58 +0000540 WMTabViewItem *item);
aff89828 kojima1999-05-17 03:55:35 +0000541} WMTabViewDelegate;
542
543
544
60a247f2 kojima2000-04-03 03:10:20 +0000545
546typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
e7d0c5d9 dan2004-04-07 02:50:52 +0000547 Time timestamp, void *cdata, WMData *data);
60a247f2 kojima2000-04-03 03:10:20 +0000548
549
550typedef struct WMSelectionProcs {
551 WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
e7d0c5d9 dan2004-04-07 02:50:52 +0000552 void *cdata, Atom *type);
60a247f2 kojima2000-04-03 03:10:20 +0000553 void (*selectionLost)(WMView *view, Atom selection, void *cdata);
554 void (*selectionDone)(WMView *view, Atom selection, Atom target,
e7d0c5d9 dan2004-04-07 02:50:52 +0000555 void *cdata);
60a247f2 kojima2000-04-03 03:10:20 +0000556} WMSelectionProcs;
557
558
6672180d kojima2000-03-28 02:30:13 +0000559typedef struct W_DraggingInfo WMDraggingInfo;
560
561
e7d0c5d9 dan2004-04-07 02:50:52 +0000562/* links a label to a dnd operation. */
563typedef struct W_DragOperationtItem WMDragOperationItem;
564
565
6672180d kojima2000-03-28 02:30:13 +0000566typedef struct W_DragSourceProcs {
6830b057 dan2004-10-12 21:28:27 +0000567 WMArray* (*dropDataTypes)(WMView *self);
e7d0c5d9 dan2004-04-07 02:50:52 +0000568 WMDragOperationType (*wantedDropOperation)(WMView *self);
6830b057 dan2004-10-12 21:28:27 +0000569 WMArray* (*askedOperations)(WMView *self);
570 Bool (*acceptDropOperation)(WMView *self, WMDragOperationType operation);
e7d0c5d9 dan2004-04-07 02:50:52 +0000571 void (*beganDrag)(WMView *self, WMPoint *point);
572 void (*endedDrag)(WMView *self, WMPoint *point, Bool deposited);
60a247f2 kojima2000-04-03 03:10:20 +0000573 WMData* (*fetchDragData)(WMView *self, char *type);
6830b057 dan2004-10-12 21:28:27 +0000574 /*Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
6672180d kojima2000-03-28 02:30:13 +0000575} WMDragSourceProcs;
576
577
578
579typedef struct W_DragDestinationProcs {
6830b057 dan2004-10-12 21:28:27 +0000580 void (*prepareForDragOperation)(WMView *self);
581 WMArray* (*requiredDataTypes)(WMView *self, WMDragOperationType request,
e7d0c5d9 dan2004-04-07 02:50:52 +0000582 WMArray *sourceDataTypes);
583 WMDragOperationType (*allowedOperation)(WMView *self,
584 WMDragOperationType request,
585 WMArray *sourceDataTypes);
6830b057 dan2004-10-12 21:28:27 +0000586 Bool (*inspectDropData)(WMView *self, WMArray *dropData);
587 void (*performDragOperation)(WMView *self, WMArray *dropData,
e7d0c5d9 dan2004-04-07 02:50:52 +0000588 WMArray *operations, WMPoint *dropLocation);
6830b057 dan2004-10-12 21:28:27 +0000589 void (*concludeDragOperation)(WMView *self);
6672180d kojima2000-03-28 02:30:13 +0000590} WMDragDestinationProcs;
591
592
648d75c2 dan2001-04-19 01:04:48 +0000593/* ...................................................................... */
594
595
596WMPoint wmkpoint(int x, int y);
597
598WMSize wmksize(unsigned int width, unsigned int height);
599
84576113 dan2003-07-16 20:58:49 +0000600WMRect wmkrect(int x, int y, unsigned int width, unsigned int height);
601
648d75c2 dan2001-04-19 01:04:48 +0000602#ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
603#define wmksize(width, height) (WMSize){(width), (height)}
604#define wmkpoint(x, y) (WMPoint){(x), (y)}
605#endif
d5fbe62d kojima1999-09-22 02:09:42 +0000606
9d2e6ef9 scottc1998-09-29 22:36:29 +0000607/* ....................................................................... */
608
416e3a82 dan1999-01-25 19:06:50 +0000609
610
9d2e6ef9 scottc1998-09-29 22:36:29 +0000611void WMInitializeApplication(char *applicationName, int *argc, char **argv);
612
f2f71a1f dan1999-09-10 20:13:44 +0000613void WMSetResourcePath(char *path);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000614
615/* don't free the returned string */
36e46831 dan2001-04-21 07:12:21 +0000616char* WMGetApplicationName();
9d2e6ef9 scottc1998-09-29 22:36:29 +0000617
618/* Try to locate resource file. ext may be NULL */
36e46831 dan2001-04-21 07:12:21 +0000619char* WMPathForResourceOfType(char *resource, char *ext);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000620
05f2a74e kojima2001-02-09 16:03:09 +0000621
36e46831 dan2001-04-21 07:12:21 +0000622WMScreen* WMOpenScreen(const char *display);
05f2a74e kojima2001-02-09 16:03:09 +0000623
36e46831 dan2001-04-21 07:12:21 +0000624WMScreen* WMCreateScreenWithRContext(Display *display, int screen,
6830b057 dan2004-10-12 21:28:27 +0000625 RContext *context);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000626
36e46831 dan2001-04-21 07:12:21 +0000627WMScreen* WMCreateScreen(Display *display, int screen);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000628
36e46831 dan2001-04-21 07:12:21 +0000629WMScreen* WMCreateSimpleApplicationScreen(Display *display);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000630
631void WMScreenMainLoop(WMScreen *scr);
632
22eb14c9 kojima2001-01-09 16:45:14 +0000633void WMBreakModalLoop(WMScreen *scr);
634
635void WMRunModalLoop(WMScreen *scr, WMView *view);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000636
36e46831 dan2001-04-21 07:12:21 +0000637RContext* WMScreenRContext(WMScreen *scr);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000638
36e46831 dan2001-04-21 07:12:21 +0000639Display* WMScreenDisplay(WMScreen *scr);
9af1c6c4 dan1998-10-21 14:43:47 +0000640
641int WMScreenDepth(WMScreen *scr);
642
643
644
36e46831 dan2001-04-21 07:12:21 +0000645void WMSetApplicationIconImage(WMScreen *app, RImage *image);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000646
36e46831 dan2001-04-21 07:12:21 +0000647RImage* WMGetApplicationIconImage(WMScreen *app);
648
649void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
650
651WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
652
653/* If color==NULL it will use the default color for panels: ae/aa/ae */
2eb1f266 dan2001-04-24 03:35:02 +0000654WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000655
edc57cf7 kojima2000-09-25 19:21:45 +0000656void WMSetApplicationIconWindow(WMScreen *scr, Window window);
657
9d2e6ef9 scottc1998-09-29 22:36:29 +0000658void WMSetFocusToWidget(WMWidget *widget);
659
36e46831 dan2001-04-21 07:12:21 +0000660WMEventHook* WMHookEventHandler(WMEventHook *handler);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000661
662int WMHandleEvent(XEvent *event);
663
664Bool WMScreenPending(WMScreen *scr);
665
666void WMCreateEventHandler(WMView *view, unsigned long mask,
6830b057 dan2004-10-12 21:28:27 +0000667 WMEventProc *eventProc, void *clientData);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000668
669void WMDeleteEventHandler(WMView *view, unsigned long mask,
6830b057 dan2004-10-12 21:28:27 +0000670 WMEventProc *eventProc, void *clientData);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000671
672int WMIsDoubleClick(XEvent *event);
673
048b43ae dan2002-07-01 23:52:22 +0000674/*int WMIsTripleClick(XEvent *event);*/
1d0a374b nwanua2000-10-01 01:49:47 +0000675
9d2e6ef9 scottc1998-09-29 22:36:29 +0000676void WMNextEvent(Display *dpy, XEvent *event);
677
678void WMMaskEvent(Display *dpy, long mask, XEvent *event);
679
60a247f2 kojima2000-04-03 03:10:20 +0000680
9b63a77d dan2002-01-07 06:11:34 +0000681/* ....................................................................... */
682
683
60a247f2 kojima2000-04-03 03:10:20 +0000684Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
6830b057 dan2004-10-12 21:28:27 +0000685 WMSelectionProcs *procs, void *cdata);
60a247f2 kojima2000-04-03 03:10:20 +0000686
687void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
688
6830b057 dan2004-10-12 21:28:27 +0000689Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
690 Time timestamp, WMSelectionCallback *callback,
691 void *cdata);
b9c1aba4 dan1999-06-04 20:13:40 +0000692
693
9b63a77d dan2002-01-07 06:11:34 +0000694extern char *WMSelectionOwnerDidChangeNotification;
695
9d2e6ef9 scottc1998-09-29 22:36:29 +0000696/* ....................................................................... */
9d2e6ef9 scottc1998-09-29 22:36:29 +0000697
e7d0c5d9 dan2004-04-07 02:50:52 +0000698WMArray* WMCreateDragOperationArray(int initialSize);
699
700WMDragOperationItem* WMCreateDragOperationItem(WMDragOperationType type,
701 char* text);
702
703WMDragOperationType WMGetDragOperationItemType(WMDragOperationItem* item);
704
705char* WMGetDragOperationItemText(WMDragOperationItem* item);
706
707void WMSetViewDragImage(WMView* view, WMPixmap *dragImage);
708
709void WMReleaseViewDragImage(WMView* view);
710
567e53c6 kojima2000-04-03 06:08:31 +0000711void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
712
e7d0c5d9 dan2004-04-07 02:50:52 +0000713Bool WMIsDraggingFromView(WMView *view);
567e53c6 kojima2000-04-03 06:08:31 +0000714
e7d0c5d9 dan2004-04-07 02:50:52 +0000715void WMDragImageFromView(WMView *view, XEvent *event);
567e53c6 kojima2000-04-03 06:08:31 +0000716
e7d0c5d9 dan2004-04-07 02:50:52 +0000717/* Create a drag handler, associating drag event masks with dragEventProc */
718void WMCreateDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
567e53c6 kojima2000-04-03 06:08:31 +0000719
e7d0c5d9 dan2004-04-07 02:50:52 +0000720void WMDeleteDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
721
722/* set default drag handler for view */
723void WMSetViewDraggable(WMView *view, WMDragSourceProcs *procs, WMPixmap *dragImage);
724
725void WMUnsetViewDraggable(WMView *view);
567e53c6 kojima2000-04-03 06:08:31 +0000726
e7d0c5d9 dan2004-04-07 02:50:52 +0000727void WMRegisterViewForDraggedTypes(WMView *view, WMArray *acceptedTypes);
567e53c6 kojima2000-04-03 06:08:31 +0000728
e7d0c5d9 dan2004-04-07 02:50:52 +0000729void WMUnregisterViewDraggedTypes(WMView *view);
730
731void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000732
733/* ....................................................................... */
734
c2ec1cfe dan2002-11-13 15:13:48 +0000735Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
736
737/* ....................................................................... */
738
36e46831 dan2001-04-21 07:12:21 +0000739WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000740
e7d0c5d9 dan2004-04-07 02:50:52 +0000741WMFont* WMCopyFontWithStyle(WMScreen *scrPtr, WMFont *font, WMFontStyle style);
c2ec1cfe dan2002-11-13 15:13:48 +0000742
36e46831 dan2001-04-21 07:12:21 +0000743WMFont* WMRetainFont(WMFont *font);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000744
745void WMReleaseFont(WMFont *font);
746
ca43aba0 dan2002-12-02 00:01:05 +0000747char* WMGetFontName(WMFont *font);
748
9d2e6ef9 scottc1998-09-29 22:36:29 +0000749unsigned int WMFontHeight(WMFont *font);
750
79ae37a3 kojima2000-05-21 23:56:33 +0000751void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
752
753void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
754
ad0ad5af dan2002-03-28 16:22:53 +0000755WMFont* WMDefaultSystemFont(WMScreen *scrPtr);
756
757WMFont* WMDefaultBoldSystemFont(WMScreen *scrPtr);
758
36e46831 dan2001-04-21 07:12:21 +0000759WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000760
36e46831 dan2001-04-21 07:12:21 +0000761WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000762
9d2e6ef9 scottc1998-09-29 22:36:29 +0000763/* ....................................................................... */
764
36e46831 dan2001-04-21 07:12:21 +0000765WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000766
767void WMReleasePixmap(WMPixmap *pixmap);
768
36e46831 dan2001-04-21 07:12:21 +0000769WMPixmap* WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
e7d0c5d9 dan2004-04-07 02:50:52 +0000770 Bool masked);
088c0ac2 dan1999-03-09 14:58:01 +0000771
36e46831 dan2001-04-21 07:12:21 +0000772WMPixmap* WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
e7d0c5d9 dan2004-04-07 02:50:52 +0000773 Pixmap mask, int width, int height,
774 int depth);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000775
36e46831 dan2001-04-21 07:12:21 +0000776WMPixmap* WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
e7d0c5d9 dan2004-04-07 02:50:52 +0000777 int threshold);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000778
36e46831 dan2001-04-21 07:12:21 +0000779WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000780
781WMSize WMGetPixmapSize(WMPixmap *pixmap);
782
36e46831 dan2001-04-21 07:12:21 +0000783WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000784
79b17caa dan2001-04-16 00:10:58 +0000785WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
786 RColor *color);
787
36e46831 dan2001-04-21 07:12:21 +0000788WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
e7d0c5d9 dan2004-04-07 02:50:52 +0000789 RColor *color);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000790
0261c326 dan1999-01-06 15:22:33 +0000791void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
792
9d2e6ef9 scottc1998-09-29 22:36:29 +0000793Pixmap WMGetPixmapXID(WMPixmap *pixmap);
794
795Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
796
36e46831 dan2001-04-21 07:12:21 +0000797WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000798
799/* ....................................................................... */
800
801
36e46831 dan2001-04-21 07:12:21 +0000802WMColor* WMDarkGrayColor(WMScreen *scr);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000803
36e46831 dan2001-04-21 07:12:21 +0000804WMColor* WMGrayColor(WMScreen *scr);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000805
36e46831 dan2001-04-21 07:12:21 +0000806WMColor* WMBlackColor(WMScreen *scr);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000807
36e46831 dan2001-04-21 07:12:21 +0000808WMColor* WMWhiteColor(WMScreen *scr);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000809
810void WMSetColorInGC(WMColor *color, GC gc);
811
812GC WMColorGC(WMColor *color);
813
814WMPixel WMColorPixel(WMColor *color);
815
6830b057 dan2004-10-12 21:28:27 +0000816void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
e7d0c5d9 dan2004-04-07 02:50:52 +0000817 unsigned int width, unsigned int height);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000818
819void WMReleaseColor(WMColor *color);
820
36e46831 dan2001-04-21 07:12:21 +0000821WMColor* WMRetainColor(WMColor *color);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000822
36e46831 dan2001-04-21 07:12:21 +0000823WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
e7d0c5d9 dan2004-04-07 02:50:52 +0000824 unsigned short green, unsigned short blue,
825 Bool exact);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000826
a2b404b5 dan2002-10-08 08:26:06 +0000827WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
828 unsigned short green, unsigned short blue,
829 unsigned short alpha, Bool exact);
830
36e46831 dan2001-04-21 07:12:21 +0000831WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000832
f274afdd kojima2004-10-25 00:07:51 +0000833RColor WMGetRColorFromColor(WMColor *color);
834
a2b404b5 dan2002-10-08 08:26:06 +0000835void WMSetColorAlpha(WMColor *color, unsigned short alpha);
836
9d2e6ef9 scottc1998-09-29 22:36:29 +0000837unsigned short WMRedComponentOfColor(WMColor *color);
838
839unsigned short WMGreenComponentOfColor(WMColor *color);
840
841unsigned short WMBlueComponentOfColor(WMColor *color);
842
1e922744 dan2002-10-16 04:05:45 +0000843unsigned short WMGetColorAlpha(WMColor *color);
844
36e46831 dan2001-04-21 07:12:21 +0000845char* WMGetColorRGBDescription(WMColor *color);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000846
847/* ....................................................................... */
848
849
a2b404b5 dan2002-10-08 08:26:06 +0000850void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
851 int x, int y, char *text, int length);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000852
a2b404b5 dan2002-10-08 08:26:06 +0000853void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
854 WMColor *background, WMFont *font, int x, int y,
855 char *text, int length);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000856
857int WMWidthOfString(WMFont *font, char *text, int length);
858
859
860
861/* ....................................................................... */
862
36e46831 dan2001-04-21 07:12:21 +0000863WMScreen* WMWidgetScreen(WMWidget *w);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000864
62240a0f dan1999-07-03 23:50:05 +0000865unsigned int WMScreenWidth(WMScreen *scr);
866
867unsigned int WMScreenHeight(WMScreen *scr);
868
9d2e6ef9 scottc1998-09-29 22:36:29 +0000869void WMUnmapWidget(WMWidget *w);
870
871void WMMapWidget(WMWidget *w);
872
edc57cf7 kojima2000-09-25 19:21:45 +0000873Bool WMWidgetIsMapped(WMWidget *w);
874
9a89e6cc kojima2000-07-15 22:08:25 +0000875void WMRaiseWidget(WMWidget *w);
876
ac4997e7 nwanua2000-09-20 04:26:31 +0000877void WMLowerWidget(WMWidget *w);
878
9d2e6ef9 scottc1998-09-29 22:36:29 +0000879void WMMoveWidget(WMWidget *w, int x, int y);
880
881void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
882
883void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
884
0fe70d2b dan2002-11-25 04:46:00 +0000885WMColor* WMGetWidgetBackgroundColor(WMWidget *w);
886
9d2e6ef9 scottc1998-09-29 22:36:29 +0000887void WMMapSubwidgets(WMWidget *w);
888
889void WMUnmapSubwidgets(WMWidget *w);
890
891void WMRealizeWidget(WMWidget *w);
892
649a7ac8 dan2001-04-26 02:45:28 +0000893void WMReparentWidget(WMWidget *w, WMWidget *newParent, int x, int y);
894
9d2e6ef9 scottc1998-09-29 22:36:29 +0000895void WMDestroyWidget(WMWidget *widget);
896
897void WMHangData(WMWidget *widget, void *data);
898
36e46831 dan2001-04-21 07:12:21 +0000899void* WMGetHangedData(WMWidget *widget);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000900
901unsigned int WMWidgetWidth(WMWidget *w);
902
903unsigned int WMWidgetHeight(WMWidget *w);
904
905Window WMWidgetXID(WMWidget *w);
906
907Window WMViewXID(WMView *view);
908
909void WMRedisplayWidget(WMWidget *w);
910
911void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
912
6830b057 dan2004-10-12 21:28:27 +0000913void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
e7d0c5d9 dan2004-04-07 02:50:52 +0000914 int rightOffs, int bottomOffs);
affcc3ba kojima2001-02-20 23:38:36 +0000915
9d2e6ef9 scottc1998-09-29 22:36:29 +0000916WMSize WMGetViewSize(WMView *view);
917
918WMPoint WMGetViewPosition(WMView *view);
919
6672180d kojima2000-03-28 02:30:13 +0000920WMPoint WMGetViewScreenPosition(WMView *view);
921
36e46831 dan2001-04-21 07:12:21 +0000922WMWidget* WMWidgetOfView(WMView *view);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000923
bb886be8 kojima2001-01-18 02:00:56 +0000924void WMSetViewNextResponder(WMView *view, WMView *responder);
925
926void WMRelayToNextResponder(WMView *view, XEvent *event);
927
9d2e6ef9 scottc1998-09-29 22:36:29 +0000928/* notifications */
929extern char *WMViewSizeDidChangeNotification;
930
6e72c202 dan2002-03-29 01:24:12 +0000931extern char *WMViewFocusDidChangeNotification;
9d2e6ef9 scottc1998-09-29 22:36:29 +0000932
6e72c202 dan2002-03-29 01:24:12 +0000933extern char *WMViewRealizedNotification;
ac4997e7 nwanua2000-09-20 04:26:31 +0000934
7f018497 kojima1999-04-24 20:08:20 +0000935
936/* ....................................................................... */
937
938void WMSetBalloonTextForView(char *text, WMView *view);
939
940void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
941
942void WMSetBalloonFont(WMScreen *scr, WMFont *font);
943
944void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
945
946void WMSetBalloonDelay(WMScreen *scr, int delay);
947
948void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
949
950
9d2e6ef9 scottc1998-09-29 22:36:29 +0000951/* ....................................................................... */
952
36e46831 dan2001-04-21 07:12:21 +0000953WMWindow* WMCreateWindow(WMScreen *screen, char *name);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000954
36e46831 dan2001-04-21 07:12:21 +0000955WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000956
36e46831 dan2001-04-21 07:12:21 +0000957WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
e7d0c5d9 dan2004-04-07 02:50:52 +0000958 int style);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000959
36e46831 dan2001-04-21 07:12:21 +0000960WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000961
962void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
963
964void WMSetWindowTitle(WMWindow *wPtr, char *title);
965
966void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
967
df1228f3 kojima2004-10-23 21:07:13 +0000968void WMSetWindowMiniwindowImage(WMWindow *win, RImage *image);
969
36e46831 dan2001-04-21 07:12:21 +0000970void WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap);
9d2e6ef9 scottc1998-09-29 22:36:29 +0000971
972void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
973
4dabd2ec dan1999-09-17 16:42:36 +0000974void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
52988491 kojima1999-03-16 11:27:01 +0000975
4193d226 dan2000-09-26 00:35:33 +0000976void WMSetWindowUserPosition(WMWindow *win, int x, int y);
977
c08022a0 kojima2000-04-09 23:06:55 +0000978void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
e7d0c5d9 dan2004-04-07 02:50:52 +0000979 int maxX, int maxY);
52988491 kojima1999-03-16 11:27:01 +0000980
9d2e6ef9 scottc1998-09-29 22:36:29 +0000981void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
982
983void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
984
985void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
986
987void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
988
989void WMSetWindowLevel(WMWindow *win, int level);
990
991void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
992
993void WMCloseWindow(WMWindow *win);
994
995/* ....................................................................... */
996
997void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
998
999#define WMCreateCommandButton(parent) \
6830b057 dan2004-10-12 21:28:27 +00001000 WMCreateCustomButton((parent), WBBSpringLoadedMask\
1001 |WBBPushInMask\
1002 |WBBPushLightMask\
1003 |WBBPushChangeMask)
9d2e6ef9 scottc1998-09-29 22:36:29 +00001004
1005#define WMCreateRadioButton(parent) \
6830b057 dan2004-10-12 21:28:27 +00001006 WMCreateButton((parent), WBTRadio)
9d2e6ef9 scottc1998-09-29 22:36:29 +00001007
1008#define WMCreateSwitchButton(parent) \
6830b057 dan2004-10-12 21:28:27 +00001009 WMCreateButton((parent), WBTSwitch)
9d2e6ef9 scottc1998-09-29 22:36:29 +00001010
36e46831 dan2001-04-21 07:12:21 +00001011WMButton* WMCreateButton(WMWidget *parent, WMButtonType type);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001012
36e46831 dan2001-04-21 07:12:21 +00001013WMButton* WMCreateCustomButton(WMWidget *parent, int behaviourMask);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001014
052ab01c kojima1999-09-16 02:55:56 +00001015void WMSetButtonImageDefault(WMButton *bPtr);
1016
9d2e6ef9 scottc1998-09-29 22:36:29 +00001017void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
1018
1019void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
1020
1021void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
1022
1023void WMSetButtonFont(WMButton *bPtr, WMFont *font);
1024
1025void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
1026
1027void WMSetButtonText(WMButton *bPtr, char *text);
1028
1029void WMSetButtonAltText(WMButton *bPtr, char *text);
1030
dba6e4d2 dan2000-01-05 22:02:22 +00001031void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
1032
1033void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
1034
1035void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
1036
9d2e6ef9 scottc1998-09-29 22:36:29 +00001037void WMSetButtonSelected(WMButton *bPtr, int isSelected);
1038
1039int WMGetButtonSelected(WMButton *bPtr);
1040
1041void WMSetButtonBordered(WMButton *bPtr, int isBordered);
1042
1043void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
1044
6e72c202 dan2002-03-29 01:24:12 +00001045int WMGetButtonEnabled(WMButton *bPtr);
1046
1047void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
dd2d71fc kojima1999-05-15 17:38:05 +00001048
9d2e6ef9 scottc1998-09-29 22:36:29 +00001049void WMSetButtonTag(WMButton *bPtr, int tag);
1050
1051void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
1052
1053void WMPerformButtonClick(WMButton *bPtr);
1054
1055void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
1056
1057void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
1058
1059/* ....................................................................... */
1060
36e46831 dan2001-04-21 07:12:21 +00001061WMLabel* WMCreateLabel(WMWidget *parent);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001062
1063void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
1064
1065void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
1066
36e46831 dan2001-04-21 07:12:21 +00001067WMPixmap* WMGetLabelImage(WMLabel *lPtr);
0261c326 dan1999-01-06 15:22:33 +00001068
36e46831 dan2001-04-21 07:12:21 +00001069char* WMGetLabelText(WMLabel *lPtr);
8493be97 dan2001-01-23 02:52:14 +00001070
9d2e6ef9 scottc1998-09-29 22:36:29 +00001071void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
8493be97 dan2001-01-23 02:52:14 +00001072
9d2e6ef9 scottc1998-09-29 22:36:29 +00001073void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
1074
1075void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
8493be97 dan2001-01-23 02:52:14 +00001076
9d2e6ef9 scottc1998-09-29 22:36:29 +00001077void WMSetLabelText(WMLabel *lPtr, char *text);
1078
1a1775ba dan2001-02-26 14:51:17 +00001079WMFont* WMGetLabelFont(WMLabel *lPtr);
1080
9d2e6ef9 scottc1998-09-29 22:36:29 +00001081void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
1082
1083void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
1084
1085/* ....................................................................... */
1086
36e46831 dan2001-04-21 07:12:21 +00001087WMFrame* WMCreateFrame(WMWidget *parent);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001088
1089void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
1090
1091void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
1092
1093void WMSetFrameTitle(WMFrame *fPtr, char *title);
1094
1095/* ....................................................................... */
1096
36e46831 dan2001-04-21 07:12:21 +00001097WMTextField* WMCreateTextField(WMWidget *parent);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001098
1099void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
1100
1101void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
1102
1103/* you can free the returned string */
36e46831 dan2001-04-21 07:12:21 +00001104char* WMGetTextFieldText(WMTextField *tPtr);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001105
1106void WMSetTextFieldText(WMTextField *tPtr, char *text);
1107
1108void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
1109
e7df5ed4 kojima1999-09-18 22:57:19 +00001110void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
1111
36e46831 dan2001-04-21 07:12:21 +00001112WMFont* WMGetTextFieldFont(WMTextField *tPtr);
d5fbe62d kojima1999-09-22 02:09:42 +00001113
9d2e6ef9 scottc1998-09-29 22:36:29 +00001114void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
1115
e7495baf dan1999-02-17 11:06:40 +00001116void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
1117
088c0ac2 dan1999-03-09 14:58:01 +00001118Bool WMGetTextFieldEditable(WMTextField *tPtr);
e7495baf dan1999-02-17 11:06:40 +00001119
088c0ac2 dan1999-03-09 14:58:01 +00001120void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001121
1122void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
1123
931a37b1 dan1999-01-29 08:11:17 +00001124void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
1125
1126void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
1127
05720d97
AV
Alexey Voinov2007-08-14 15:15:37 +04001128unsigned WMGetTextFieldCursorPosition(WMTextField *tPtr);
1129
e7495baf dan1999-02-17 11:06:40 +00001130void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
1131
1132void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
1133
4df40ab8 dan1999-05-18 20:52:09 +00001134void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
1135
75091798 dan2002-04-03 00:51:36 +00001136WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001137
1138extern char *WMTextDidChangeNotification;
1139extern char *WMTextDidBeginEditingNotification;
1140extern char *WMTextDidEndEditingNotification;
1141
1142/* ....................................................................... */
1143
36e46831 dan2001-04-21 07:12:21 +00001144WMScroller* WMCreateScroller(WMWidget *parent);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001145
6830b057 dan2004-10-12 21:28:27 +00001146void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
e7d0c5d9 dan2004-04-07 02:50:52 +00001147 float knobProportion);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001148
1149float WMGetScrollerKnobProportion(WMScroller *sPtr);
1150
1151float WMGetScrollerValue(WMScroller *sPtr);
1152
1153WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
1154
1155void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
1156
6830b057 dan2004-10-12 21:28:27 +00001157void WMSetScrollerArrowsPosition(WMScroller *sPtr,
1158 WMScrollArrowPosition position);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001159
275a2a37 kojima2000-10-11 16:21:50 +00001160extern char *WMScrollerDidScrollNotification;
1161
9d2e6ef9 scottc1998-09-29 22:36:29 +00001162/* ....................................................................... */
1163
36e46831 dan2001-04-21 07:12:21 +00001164WMList* WMCreateList(WMWidget *parent);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001165
6973f07f dan2000-09-28 03:09:57 +00001166void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
1167
1168void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
1169
9d2e6ef9 scottc1998-09-29 22:36:29 +00001170#define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
1171
36e46831 dan2001-04-21 07:12:21 +00001172WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001173
e82c30b2 kojima1999-10-03 03:47:21 +00001174void WMSortListItems(WMList *lPtr);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001175
7f74ea80 dan2000-09-25 02:00:55 +00001176void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
eb87c409 kojima1999-10-20 03:25:06 +00001177
9d2e6ef9 scottc1998-09-29 22:36:29 +00001178int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
1179
36e46831 dan2001-04-21 07:12:21 +00001180WMListItem* WMGetListItem(WMList *lPtr, int row);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001181
36e46831 dan2001-04-21 07:12:21 +00001182WMArray* WMGetListItems(WMList *lPtr);
e82c30b2 kojima1999-10-03 03:47:21 +00001183
b2478b63 dan2000-10-01 23:26:03 +00001184void WMRemoveListItem(WMList *lPtr, int row);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001185
1186void WMSelectListItem(WMList *lPtr, int row);
1187
aee58cbd dan2000-09-29 02:12:40 +00001188void WMUnselectListItem(WMList *lPtr, int row);
1189
b2478b63 dan2000-10-01 23:26:03 +00001190/* This will select all items in range, and deselect all the others */
1191void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
1192
1193/* This will select all items in range, leaving the others as they are */
1194void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
1195
aee58cbd dan2000-09-29 02:12:40 +00001196void WMSelectAllListItems(WMList *lPtr);
1197
1198void WMUnselectAllListItems(WMList *lPtr);
1199
9d2e6ef9 scottc1998-09-29 22:36:29 +00001200void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
1201
1202void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
1203
0261c326 dan1999-01-06 15:22:33 +00001204int WMGetListItemHeight(WMList *lPtr);
1205
9d2e6ef9 scottc1998-09-29 22:36:29 +00001206/* don't free the returned data */
6973f07f dan2000-09-28 03:09:57 +00001207WMArray* WMGetListSelectedItems(WMList *lPtr);
1208
1209/*
1210 * For the following 2 functions, in case WMList allows multiple selection,
1211 * the first item in the list of selected items, respective its row number,
1212 * will be returned.
1213 */
1214
1215/* don't free the returned data */
1216WMListItem* WMGetListSelectedItem(WMList *lPtr);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001217
1218int WMGetListSelectedItemRow(WMList *lPtr);
1219
1220void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
1221
1222void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
1223
1224void WMClearList(WMList *lPtr);
1225
1226int WMGetListNumberOfRows(WMList *lPtr);
1227
1228void WMSetListPosition(WMList *lPtr, int row);
1229
1230void WMSetListBottomPosition(WMList *lPtr, int row);
1231
1232int WMGetListPosition(WMList *lPtr);
1233
6973f07f dan2000-09-28 03:09:57 +00001234Bool WMListAllowsMultipleSelection(WMList *lPtr);
1235
1236Bool WMListAllowsEmptySelection(WMList *lPtr);
1237
1238
0261c326 dan1999-01-06 15:22:33 +00001239extern char *WMListDidScrollNotification;
e7495baf dan1999-02-17 11:06:40 +00001240extern char *WMListSelectionDidChangeNotification;
0261c326 dan1999-01-06 15:22:33 +00001241
9d2e6ef9 scottc1998-09-29 22:36:29 +00001242/* ....................................................................... */
1243
36e46831 dan2001-04-21 07:12:21 +00001244WMBrowser* WMCreateBrowser(WMWidget *parent);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001245
de991559 dan2000-10-02 06:59:18 +00001246void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
1247
1248void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
1249
9d2e6ef9 scottc1998-09-29 22:36:29 +00001250void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
1251
1252void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
1253
1254void WMLoadBrowserColumnZero(WMBrowser *bPtr);
1255
1256int WMAddBrowserColumn(WMBrowser *bPtr);
1257
1258void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
1259
345d980b dan1998-11-27 12:26:46 +00001260void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
1261
9d2e6ef9 scottc1998-09-29 22:36:29 +00001262void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
1263
36e46831 dan2001-04-21 07:12:21 +00001264WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
e82c30b2 kojima1999-10-03 03:47:21 +00001265
1266void WMSortBrowserColumn(WMBrowser *bPtr, int column);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001267
94f4483d kojima1999-10-27 22:32:12 +00001268void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
7f74ea80 dan2000-09-25 02:00:55 +00001269 WMCompareDataProc *func);
94f4483d kojima1999-10-27 22:32:12 +00001270
e7495baf dan1999-02-17 11:06:40 +00001271/* Don't free the returned string. */
1272char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001273
de991559 dan2000-10-02 06:59:18 +00001274/* free the returned string */
36e46831 dan2001-04-21 07:12:21 +00001275char* WMGetBrowserPath(WMBrowser *bPtr);
ed39c92d dan2000-10-03 20:52:15 +00001276
de991559 dan2000-10-02 06:59:18 +00001277/* free the returned string */
36e46831 dan2001-04-21 07:12:21 +00001278char* WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001279
ed39c92d dan2000-10-03 20:52:15 +00001280/* free the returned array */
1281WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
1282
9d2e6ef9 scottc1998-09-29 22:36:29 +00001283void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
1284
6830b057 dan2004-10-12 21:28:27 +00001285void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
e7d0c5d9 dan2004-04-07 02:50:52 +00001286 void *clientData);
e7495baf dan1999-02-17 11:06:40 +00001287
36e46831 dan2001-04-21 07:12:21 +00001288WMListItem* WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001289
1290int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
1291
1292int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
1293
1294int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
1295
1296int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
1297
4a473b8a kojima1999-04-10 18:27:21 +00001298int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
1299
36e46831 dan2001-04-21 07:12:21 +00001300WMList* WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001301
dd2d71fc kojima1999-05-15 17:38:05 +00001302void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001303
de991559 dan2000-10-02 06:59:18 +00001304Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
1305
1306Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
1307
327d5834 nwanua2000-12-12 23:08:52 +00001308void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
de991559 dan2000-10-02 06:59:18 +00001309
9d2e6ef9 scottc1998-09-29 22:36:29 +00001310/* ....................................................................... */
1311
eb87c409 kojima1999-10-20 03:25:06 +00001312
1313Bool WMMenuItemIsSeparator(WMMenuItem *item);
1314
36e46831 dan2001-04-21 07:12:21 +00001315WMMenuItem* WMCreateMenuItem(void);
eb87c409 kojima1999-10-20 03:25:06 +00001316
1317void WMDestroyMenuItem(WMMenuItem *item);
1318
1319Bool WMGetMenuItemEnabled(WMMenuItem *item);
1320
1321void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
1322
36e46831 dan2001-04-21 07:12:21 +00001323char* WMGetMenuItemShortcut(WMMenuItem *item);
eb87c409 kojima1999-10-20 03:25:06 +00001324
1325unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
1326
1327void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
1328
1329void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
1330
36e46831 dan2001-04-21 07:12:21 +00001331void* WMGetMenuItemRepresentedObject(WMMenuItem *item);
eb87c409 kojima1999-10-20 03:25:06 +00001332
1333void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
1334
1335void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
1336
36e46831 dan2001-04-21 07:12:21 +00001337WMAction* WMGetMenuItemAction(WMMenuItem *item);
eb87c409 kojima1999-10-20 03:25:06 +00001338
36e46831 dan2001-04-21 07:12:21 +00001339void* WMGetMenuItemData(WMMenuItem *item);
eb87c409 kojima1999-10-20 03:25:06 +00001340
1341void WMSetMenuItemTitle(WMMenuItem *item, char *title);
1342
36e46831 dan2001-04-21 07:12:21 +00001343char* WMGetMenuItemTitle(WMMenuItem *item);
eb87c409 kojima1999-10-20 03:25:06 +00001344
1345void WMSetMenuItemState(WMMenuItem *item, int state);
1346
1347int WMGetMenuItemState(WMMenuItem *item);
1348
1349void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
1350
36e46831 dan2001-04-21 07:12:21 +00001351WMPixmap* WMGetMenuItemPixmap(WMMenuItem *item);
eb87c409 kojima1999-10-20 03:25:06 +00001352
1353void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1354
36e46831 dan2001-04-21 07:12:21 +00001355WMPixmap* WMGetMenuItemOnStatePixmap(WMMenuItem *item);
eb87c409 kojima1999-10-20 03:25:06 +00001356
1357void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1358
36e46831 dan2001-04-21 07:12:21 +00001359WMPixmap* WMGetMenuItemOffStatePixmap(WMMenuItem *item);
eb87c409 kojima1999-10-20 03:25:06 +00001360
1361void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
1362
36e46831 dan2001-04-21 07:12:21 +00001363WMPixmap* WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
eb87c409 kojima1999-10-20 03:25:06 +00001364
1365/*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
6830b057 dan2004-10-12 21:28:27 +00001366
eb87c409 kojima1999-10-20 03:25:06 +00001367
36e46831 dan2001-04-21 07:12:21 +00001368WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
eb87c409 kojima1999-10-20 03:25:06 +00001369
1370Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
6830b057 dan2004-10-12 21:28:27 +00001371*/
eb87c409 kojima1999-10-20 03:25:06 +00001372
1373/* ....................................................................... */
1374
36e46831 dan2001-04-21 07:12:21 +00001375WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001376
6830b057 dan2004-10-12 21:28:27 +00001377void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
e7d0c5d9 dan2004-04-07 02:50:52 +00001378 void *clientData);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001379
1380void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
1381
36e46831 dan2001-04-21 07:12:21 +00001382WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001383
36e46831 dan2001-04-21 07:12:21 +00001384WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
e7d0c5d9 dan2004-04-07 02:50:52 +00001385 char *title);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001386
1387void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
1388
1389void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
1390
adb74c68 dan1999-05-25 02:15:44 +00001391Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
1392
9d2e6ef9 scottc1998-09-29 22:36:29 +00001393void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
1394
1395int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
1396
1397void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
1398
1399/* don't free the returned data */
36e46831 dan2001-04-21 07:12:21 +00001400char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001401
36e46831 dan2001-04-21 07:12:21 +00001402WMMenuItem* WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
eb87c409 kojima1999-10-20 03:25:06 +00001403
9d2e6ef9 scottc1998-09-29 22:36:29 +00001404int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
1405
0261c326 dan1999-01-06 15:22:33 +00001406void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
1407
adb74c68 dan1999-05-25 02:15:44 +00001408Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
1409
9d2e6ef9 scottc1998-09-29 22:36:29 +00001410/* ....................................................................... */
1411
36e46831 dan2001-04-21 07:12:21 +00001412WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
052ab01c kojima1999-09-16 02:55:56 +00001413
1414void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
1415
1416void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
1417
1418void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
1419
1420int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
1421
1422int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
1423
1424int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
1425
1426
1427/* ....................................................................... */
1428
36e46831 dan2001-04-21 07:12:21 +00001429WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
416e3a82 dan1999-01-25 19:06:50 +00001430
1431void WMFreeColorPanel(WMColorPanel *panel);
1432
088c0ac2 dan1999-03-09 14:58:01 +00001433void WMShowColorPanel(WMColorPanel *panel);
1434
1435void WMCloseColorPanel(WMColorPanel *panel);
416e3a82 dan1999-01-25 19:06:50 +00001436
f214ef92 kojima1999-03-18 19:48:19 +00001437void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
416e3a82 dan1999-01-25 19:06:50 +00001438
36e46831 dan2001-04-21 07:12:21 +00001439WMColor* WMGetColorPanelColor(WMColorPanel *panel);
aff89828 kojima1999-05-17 03:55:35 +00001440
088c0ac2 dan1999-03-09 14:58:01 +00001441void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
1442
bedc2238 kojima1999-05-16 07:00:01 +00001443void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
088c0ac2 dan1999-03-09 14:58:01 +00001444
bedc2238 kojima1999-05-16 07:00:01 +00001445extern char *WMColorPanelColorChangedNotification;
416e3a82 dan1999-01-25 19:06:50 +00001446
1447/* ....................................................................... */
1448
36e46831 dan2001-04-21 07:12:21 +00001449WMColorWell* WMCreateColorWell(WMWidget *parent);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001450
1451void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
1452
36e46831 dan2001-04-21 07:12:21 +00001453WMColor* WMGetColorWellColor(WMColorWell *cPtr);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001454
0261c326 dan1999-01-06 15:22:33 +00001455void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
1456
c56756dc dan1999-03-14 22:35:50 +00001457
1458extern char *WMColorWellDidChangeNotification;
1459
1460
9d2e6ef9 scottc1998-09-29 22:36:29 +00001461/* ...................................................................... */
1462
36e46831 dan2001-04-21 07:12:21 +00001463WMScrollView* WMCreateScrollView(WMWidget *parent);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001464
1465void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
e7d0c5d9 dan2004-04-07 02:50:52 +00001466 unsigned int height);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001467
1468void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
1469
1470void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
1471
1472void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
1473
1474void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
1475
275a2a37 kojima2000-10-11 16:21:50 +00001476WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
1477
36e46831 dan2001-04-21 07:12:21 +00001478WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001479
36e46831 dan2001-04-21 07:12:21 +00001480WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001481
9af1c6c4 dan1998-10-21 14:43:47 +00001482void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
1483
1484void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
1485
9d2e6ef9 scottc1998-09-29 22:36:29 +00001486/* ....................................................................... */
1487
36e46831 dan2001-04-21 07:12:21 +00001488WMSlider* WMCreateSlider(WMWidget *parent);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001489
1490int WMGetSliderMinValue(WMSlider *slider);
1491
1492int WMGetSliderMaxValue(WMSlider *slider);
1493
1494int WMGetSliderValue(WMSlider *slider);
1495
1496void WMSetSliderMinValue(WMSlider *slider, int value);
1497
1498void WMSetSliderMaxValue(WMSlider *slider, int value);
1499
1500void WMSetSliderValue(WMSlider *slider, int value);
1501
1502void WMSetSliderContinuous(WMSlider *slider, Bool flag);
1503
1504void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
1505
0261c326 dan1999-01-06 15:22:33 +00001506void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
1507
1508void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
1509
9d2e6ef9 scottc1998-09-29 22:36:29 +00001510/* ....................................................................... */
1511
94f4483d kojima1999-10-27 22:32:12 +00001512
36e46831 dan2001-04-21 07:12:21 +00001513WMSplitView* WMCreateSplitView(WMWidget *parent);
1514
94f4483d kojima1999-10-27 22:32:12 +00001515Bool WMGetSplitViewVertical(WMSplitView *sPtr);
36e46831 dan2001-04-21 07:12:21 +00001516
94f4483d kojima1999-10-27 22:32:12 +00001517void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
1518
38807b65 dan1999-11-07 21:40:22 +00001519int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
94f4483d kojima1999-10-27 22:32:12 +00001520
36e46831 dan2001-04-21 07:12:21 +00001521WMView* WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
94f4483d kojima1999-10-27 22:32:12 +00001522
1523/* remove the first subview == view */
1524void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
1525
1526void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
1527
9d2e6ef9 scottc1998-09-29 22:36:29 +00001528
1529void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
1530
1531void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
1532
e7d0c5d9 dan2004-04-07 02:50:52 +00001533void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
1534 WMSplitViewConstrainProc *proc);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001535
1536/*
6830b057 dan2004-10-12 21:28:27 +00001537void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
1538 WMSplitViewResizeSubviewsProc *proc);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001539*/
1540
1541int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
1542
c49ad9ca kojima2000-06-20 23:27:37 +00001543/* ...................................................................... */
1544
36e46831 dan2001-04-21 07:12:21 +00001545WMRuler* WMCreateRuler (WMWidget *parent);
c49ad9ca kojima2000-06-20 23:27:37 +00001546
36e46831 dan2001-04-21 07:12:21 +00001547WMRulerMargins* WMGetRulerMargins(WMRuler *rPtr);
c49ad9ca kojima2000-06-20 23:27:37 +00001548
6de30498 dan2000-06-22 22:49:50 +00001549void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
c49ad9ca kojima2000-06-20 23:27:37 +00001550
36e46831 dan2001-04-21 07:12:21 +00001551Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin);
ac4997e7 nwanua2000-09-20 04:26:31 +00001552
c49ad9ca kojima2000-06-20 23:27:37 +00001553int WMGetGrabbedRulerMargin(WMRuler *rPtr);
1554
6de30498 dan2000-06-22 22:49:50 +00001555int WMGetReleasedRulerMargin(WMRuler *rPtr);
1556
c49ad9ca kojima2000-06-20 23:27:37 +00001557int WMGetRulerOffset(WMRuler *rPtr);
1558
1559void WMSetRulerOffset(WMRuler *rPtr, int pixels);
1560
c49ad9ca kojima2000-06-20 23:27:37 +00001561void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
1562
6de30498 dan2000-06-22 22:49:50 +00001563void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
c49ad9ca kojima2000-06-20 23:27:37 +00001564
1565/* ....................................................................... */
1566
c49ad9ca kojima2000-06-20 23:27:37 +00001567
9b0e0c6c nwanua2000-10-14 01:45:16 +00001568#define WMCreateText(parent) WMCreateTextForDocumentType \
1569 ((parent), (NULL), (NULL))
1570
36e46831 dan2001-04-21 07:12:21 +00001571WMText* WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser,
1572 WMAction *writer);
c49ad9ca kojima2000-06-20 23:27:37 +00001573
84ba62ba nwanua2000-11-01 02:54:50 +00001574void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
1575
6830b057 dan2004-10-12 21:28:27 +00001576void WMFreezeText(WMText *tPtr);
c49ad9ca kojima2000-06-20 23:27:37 +00001577
6830b057 dan2004-10-12 21:28:27 +00001578#define WMRefreshText(tPtr) WMThawText((tPtr))
327d5834 nwanua2000-12-12 23:08:52 +00001579
d3d03041 nwanua2000-07-13 23:48:54 +00001580void WMThawText(WMText *tPtr);
c49ad9ca kojima2000-06-20 23:27:37 +00001581
c79c8aa7 nwanua2000-07-21 15:29:51 +00001582int WMScrollText(WMText *tPtr, int amount);
c49ad9ca kojima2000-06-20 23:27:37 +00001583
c79c8aa7 nwanua2000-07-21 15:29:51 +00001584int WMPageText(WMText *tPtr, Bool direction);
c49ad9ca kojima2000-06-20 23:27:37 +00001585
d3d03041 nwanua2000-07-13 23:48:54 +00001586void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
c49ad9ca kojima2000-06-20 23:27:37 +00001587
d3d03041 nwanua2000-07-13 23:48:54 +00001588void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
c49ad9ca kojima2000-06-20 23:27:37 +00001589
d3d03041 nwanua2000-07-13 23:48:54 +00001590void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
c49ad9ca kojima2000-06-20 23:27:37 +00001591
d3d03041 nwanua2000-07-13 23:48:54 +00001592void WMShowTextRuler(WMText *tPtr, Bool show);
c49ad9ca kojima2000-06-20 23:27:37 +00001593
c79c8aa7 nwanua2000-07-21 15:29:51 +00001594int WMGetTextRulerShown(WMText *tPtr);
1595
dbbddf95 nwanua2000-07-20 16:51:54 +00001596void WMSetTextEditable(WMText *tPtr, Bool editable);
1597
1598int WMGetTextEditable(WMText *tPtr);
1599
1600void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
c49ad9ca kojima2000-06-20 23:27:37 +00001601
d3d03041 nwanua2000-07-13 23:48:54 +00001602int WMGetTextUsesMonoFont(WMText *tPtr);
c49ad9ca kojima2000-06-20 23:27:37 +00001603
5f746a3e nwanua2000-11-03 02:33:29 +00001604void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
1605
dbbddf95 nwanua2000-07-20 16:51:54 +00001606void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
1607
1608int WMGetTextIgnoresNewline(WMText *tPtr);
1609
d3d03041 nwanua2000-07-13 23:48:54 +00001610void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
c49ad9ca kojima2000-06-20 23:27:37 +00001611
36e46831 dan2001-04-21 07:12:21 +00001612WMFont* WMGetTextDefaultFont(WMText *tPtr);
c49ad9ca kojima2000-06-20 23:27:37 +00001613
5f746a3e nwanua2000-11-03 02:33:29 +00001614void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
1615
36e46831 dan2001-04-21 07:12:21 +00001616WMColor* WMGetTextDefaultColor(WMText *tPtr);
5f746a3e nwanua2000-11-03 02:33:29 +00001617
d3d03041 nwanua2000-07-13 23:48:54 +00001618void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
1619
1620void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
c49ad9ca kojima2000-06-20 23:27:37 +00001621
c49ad9ca kojima2000-06-20 23:27:37 +00001622void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
1623
9a4037eb nwanua2000-11-22 04:48:40 +00001624void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
1625
d3d03041 nwanua2000-07-13 23:48:54 +00001626void WMPrependTextStream(WMText *tPtr, char *text);
1627
1628void WMAppendTextStream(WMText *tPtr, char *text);
1629
ae9e955f nwanua2001-02-22 07:32:36 +00001630#define WMClearText(tPtr) WMAppendTextStream \
1631 ((tPtr), (NULL))
1632
cc3bbcaf nwanua2000-09-01 17:58:29 +00001633/* free the text */
36e46831 dan2001-04-21 07:12:21 +00001634char* WMGetTextStream(WMText *tPtr);
dbbddf95 nwanua2000-07-20 16:51:54 +00001635
cc3bbcaf nwanua2000-09-01 17:58:29 +00001636/* free the text */
36e46831 dan2001-04-21 07:12:21 +00001637char* WMGetTextSelectedStream(WMText *tPtr);
dbbddf95 nwanua2000-07-20 16:51:54 +00001638
81f5124c nwanua2000-09-29 04:50:56 +00001639/* destroy the array */
36e46831 dan2001-04-21 07:12:21 +00001640WMArray* WMGetTextObjects(WMText *tPtr);
cc3bbcaf nwanua2000-09-01 17:58:29 +00001641
81f5124c nwanua2000-09-29 04:50:56 +00001642/* destroy the array */
94b17e2d nwanua2000-09-29 07:39:56 +00001643WMArray* WMGetTextSelectedObjects(WMText *tPtr);
d3d03041 nwanua2000-07-13 23:48:54 +00001644
dbbddf95 nwanua2000-07-20 16:51:54 +00001645void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
1646
36e46831 dan2001-04-21 07:12:21 +00001647WMColor* WMGetTextSelectionColor(WMText *tPtr);
7d463ca4 nwanua2000-11-10 07:24:49 +00001648
dbbddf95 nwanua2000-07-20 16:51:54 +00001649void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
1650
36e46831 dan2001-04-21 07:12:21 +00001651WMFont* WMGetTextSelectionFont(WMText *tPtr);
7d463ca4 nwanua2000-11-10 07:24:49 +00001652
1653void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
1654
1655int WMGetTextSelectionUnderlined(WMText *tPtr);
1656
dbbddf95 nwanua2000-07-20 16:51:54 +00001657void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
d3d03041 nwanua2000-07-13 23:48:54 +00001658
1d0a374b nwanua2000-10-01 01:49:47 +00001659Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
36e46831 dan2001-04-21 07:12:21 +00001660 Bool caseSensitive);
1d0a374b nwanua2000-10-01 01:49:47 +00001661
2d20abd0 nwanua2000-11-16 01:43:32 +00001662Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
1663
1664
ac4997e7 nwanua2000-09-20 04:26:31 +00001665/* parser related stuff... use only if implementing a new parser */
d3d03041 nwanua2000-07-13 23:48:54 +00001666
36e46831 dan2001-04-21 07:12:21 +00001667void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
1668 WMColor *color, unsigned short first,
1669 unsigned short extraInfo);
1670
1671void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
1672 WMColor *color, unsigned short first,
1673 unsigned short extraInfo);
1674
1675void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
1676 WMColor *color, unsigned short first,
1677 unsigned short length);
ac4997e7 nwanua2000-09-20 04:26:31 +00001678
ac4997e7 nwanua2000-09-20 04:26:31 +00001679void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
36e46831 dan2001-04-21 07:12:21 +00001680 unsigned int kanji, unsigned int underlined,
1681 int script, WMRulerMargins *margins);
1682
ac4997e7 nwanua2000-09-20 04:26:31 +00001683/* do NOT free the margins */
1684void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
36e46831 dan2001-04-21 07:12:21 +00001685 unsigned int *kanji, unsigned int *underlined,
1686 int *script, WMRulerMargins *margins);
ac4997e7 nwanua2000-09-20 04:26:31 +00001687
d3d03041 nwanua2000-07-13 23:48:54 +00001688int WMGetTextInsertType(WMText *tPtr);
c49ad9ca kojima2000-06-20 23:27:37 +00001689
048b43ae dan2002-07-01 23:52:22 +00001690/*int WMGetTextBlocks(WMText *tPtr);
d3d03041 nwanua2000-07-13 23:48:54 +00001691
048b43ae dan2002-07-01 23:52:22 +00001692void WMSetCurrentTextBlock(WMText *tPtr, int current);
d3d03041 nwanua2000-07-13 23:48:54 +00001693
048b43ae dan2002-07-01 23:52:22 +00001694int WMGetCurrentTextBlock(WMText *tPtr);*/
d3d03041 nwanua2000-07-13 23:48:54 +00001695
e4a53ba7 dan2002-03-28 04:20:30 +00001696void WMPrependTextBlock(WMText *tPtr, void *vtb);
d3d03041 nwanua2000-07-13 23:48:54 +00001697
1698void WMAppendTextBlock(WMText *tPtr, void *vtb);
1699
36e46831 dan2001-04-21 07:12:21 +00001700void* WMRemoveTextBlock(WMText *tPtr);
d3d03041 nwanua2000-07-13 23:48:54 +00001701
1702void WMDestroyTextBlock(WMText *tPtr, void *vtb);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001703
1704/* ....................................................................... */
1705
dd2d71fc kojima1999-05-15 17:38:05 +00001706
36e46831 dan2001-04-21 07:12:21 +00001707WMTabView* WMCreateTabView(WMWidget *parent);
dd2d71fc kojima1999-05-15 17:38:05 +00001708
e99511b0 kojima2001-01-02 14:17:26 +00001709void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
1710
b6f543df kojima2001-01-10 21:10:39 +00001711void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
1712
237fa3ce dan1999-05-16 15:11:13 +00001713void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
1714
dd2d71fc kojima1999-05-15 17:38:05 +00001715void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
1716
1717void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
1718
1719void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1720
36e46831 dan2001-04-21 07:12:21 +00001721WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
e7d0c5d9 dan2004-04-07 02:50:52 +00001722 int identifier, char *label);
1863d60e kojima2000-11-09 14:07:48 +00001723
36e46831 dan2001-04-21 07:12:21 +00001724WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
dd2d71fc kojima1999-05-15 17:38:05 +00001725
1726void WMSelectFirstTabViewItem(WMTabView *tPtr);
1727
1728void WMSelectLastTabViewItem(WMTabView *tPtr);
1729
1730void WMSelectNextTabViewItem(WMTabView *tPtr);
1731
1732void WMSelectPreviousTabViewItem(WMTabView *tPtr);
1733
36e46831 dan2001-04-21 07:12:21 +00001734WMTabViewItem* WMGetSelectedTabViewItem(WMTabView *tPtr);
dd2d71fc kojima1999-05-15 17:38:05 +00001735
1736void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
1737
1738void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
1739
aff89828 kojima1999-05-17 03:55:35 +00001740void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
dd2d71fc kojima1999-05-15 17:38:05 +00001741
1742
36e46831 dan2001-04-21 07:12:21 +00001743WMTabViewItem* WMCreateTabViewItemWithIdentifier(int identifier);
dd2d71fc kojima1999-05-15 17:38:05 +00001744
65e65c4e dan2002-03-14 12:28:52 +00001745void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
1746
aff89828 kojima1999-05-17 03:55:35 +00001747int WMGetTabViewItemIdentifier(WMTabViewItem *item);
1748
dd2d71fc kojima1999-05-15 17:38:05 +00001749void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
1750
36e46831 dan2001-04-21 07:12:21 +00001751char* WMGetTabViewItemLabel(WMTabViewItem *item);
dd2d71fc kojima1999-05-15 17:38:05 +00001752
1753void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
1754
36e46831 dan2001-04-21 07:12:21 +00001755WMView* WMGetTabViewItemView(WMTabViewItem *item);
dd2d71fc kojima1999-05-15 17:38:05 +00001756
1757void WMDestroyTabViewItem(WMTabViewItem *item);
1758
19160e8d kojima2000-11-09 05:01:58 +00001759
1760/* ....................................................................... */
1761
36e46831 dan2001-04-21 07:12:21 +00001762WMBox* WMCreateBox(WMWidget *parent);
19160e8d kojima2000-11-09 05:01:58 +00001763
1764void WMSetBoxBorderWidth(WMBox *box, unsigned width);
1765
1766void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
e7d0c5d9 dan2004-04-07 02:50:52 +00001767 int minSize, int maxSize, int space);
19160e8d kojima2000-11-09 05:01:58 +00001768
e99511b0 kojima2001-01-02 14:17:26 +00001769void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
e7d0c5d9 dan2004-04-07 02:50:52 +00001770 int minSize, int maxSize, int space);
e99511b0 kojima2001-01-02 14:17:26 +00001771
b4851afb kojima2001-01-16 16:08:40 +00001772void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
1773
19160e8d kojima2000-11-09 05:01:58 +00001774void WMSetBoxHorizontal(WMBox *box, Bool flag);
1775
dd2d71fc kojima1999-05-15 17:38:05 +00001776/* ....................................................................... */
1777
6830b057 dan2004-10-12 21:28:27 +00001778int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
1779 char *defaultButton, char *alternateButton,
1780 char *otherButton);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001781
1782/* you can free the returned string */
36e46831 dan2001-04-21 07:12:21 +00001783char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
e7d0c5d9 dan2004-04-07 02:50:52 +00001784 char *defaultText, char *okButton, char *cancelButton);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001785
36e46831 dan2001-04-21 07:12:21 +00001786WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
e7d0c5d9 dan2004-04-07 02:50:52 +00001787 char *msg, char *defaultButton,
1788 char *alternateButton, char *otherButton);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001789
36e46831 dan2001-04-21 07:12:21 +00001790WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
e7d0c5d9 dan2004-04-07 02:50:52 +00001791 char *msg, char *defaultText, char *okButton,
1792 char *cancelButton);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001793
affcc3ba kojima2001-02-20 23:38:36 +00001794
36e46831 dan2001-04-21 07:12:21 +00001795WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
e7d0c5d9 dan2004-04-07 02:50:52 +00001796 char *title, char *defaultButton,
1797 char *alternateButton);
affcc3ba kojima2001-02-20 23:38:36 +00001798
9d2e6ef9 scottc1998-09-29 22:36:29 +00001799void WMDestroyAlertPanel(WMAlertPanel *panel);
1800
1801void WMDestroyInputPanel(WMInputPanel *panel);
1802
affcc3ba kojima2001-02-20 23:38:36 +00001803void WMDestroyGenericPanel(WMGenericPanel *panel);
1804
9d2e6ef9 scottc1998-09-29 22:36:29 +00001805/* ....................................................................... */
1806
1807/* only 1 instance per WMScreen */
36e46831 dan2001-04-21 07:12:21 +00001808WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001809
36e46831 dan2001-04-21 07:12:21 +00001810WMSavePanel* WMGetSavePanel(WMScreen *scrPtr);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001811
931a37b1 dan1999-01-29 08:11:17 +00001812void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
1813
1814void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001815
931a37b1 dan1999-01-29 08:11:17 +00001816void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001817
1818void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
1819
1820/* you can free the returned string */
36e46831 dan2001-04-21 07:12:21 +00001821char* WMGetFilePanelFileName(WMFilePanel *panel);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001822
1823void WMFreeFilePanel(WMFilePanel *panel);
1824
e7495baf dan1999-02-17 11:06:40 +00001825int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
1826 char *path, char *name, char **fileTypes);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001827
0261c326 dan1999-01-06 15:22:33 +00001828void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
1829
36e46831 dan2001-04-21 07:12:21 +00001830WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
0261c326 dan1999-01-06 15:22:33 +00001831
1832
9d2e6ef9 scottc1998-09-29 22:36:29 +00001833/* ...................................................................... */
1834
1835/* only 1 instance per WMScreen */
36e46831 dan2001-04-21 07:12:21 +00001836WMFontPanel* WMGetFontPanel(WMScreen *scr);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001837
1838void WMShowFontPanel(WMFontPanel *panel);
1839
1840void WMHideFontPanel(WMFontPanel *panel);
1841
9aca0d5f dan2004-10-12 01:34:32 +00001842void WMFreeFontPanel(WMFontPanel *panel);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001843
9aca0d5f dan2004-10-12 01:34:32 +00001844void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
474c4caf dan2004-07-16 18:50:58 +00001845
9aca0d5f dan2004-10-12 01:34:32 +00001846void WMSetFontPanelFont(WMFontPanel *panel, char *fontName);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001847
36e46831 dan2001-04-21 07:12:21 +00001848WMFont* WMGetFontPanelFont(WMFontPanel *panel);
9d2e6ef9 scottc1998-09-29 22:36:29 +00001849
e7495baf dan1999-02-17 11:06:40 +00001850#ifdef __cplusplus
1851}
1852#endif /* __cplusplus */
1853
9d2e6ef9 scottc1998-09-29 22:36:29 +00001854#endif
1855