~profzoom/ubuntu/quantal/wmaker/bug-1079925

« back to all changes in this revision

Viewing changes to WINGs/WINGs/WINGs.h

  • Committer: Bazaar Package Importer
  • Author(s): Marcelo E. Magallon
  • Date: 2004-11-10 14:05:30 UTC
  • Revision ID: james.westby@ubuntu.com-20041110140530-qpd66b5lm38x7apk
Tags: upstream-0.91.0
ImportĀ upstreamĀ versionĀ 0.91.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
#ifndef _WINGS_H_
 
4
#define _WINGS_H_
 
5
 
 
6
#include <wraster.h>
 
7
#include <WINGs/WUtil.h>
 
8
#include <X11/Xlib.h>
 
9
 
 
10
#define WINGS_H_VERSION  20040406
 
11
 
 
12
 
 
13
#ifdef __cplusplus
 
14
extern "C" {
 
15
#endif /* __cplusplus */
 
16
#if 0
 
17
}
 
18
#endif
 
19
 
 
20
 
 
21
typedef unsigned long WMPixel;
 
22
 
 
23
 
 
24
typedef struct {
 
25
    unsigned int width;
 
26
    unsigned int height;
 
27
} WMSize;
 
28
 
 
29
typedef struct {
 
30
    int x;
 
31
    int y;
 
32
} WMPoint;
 
33
 
 
34
typedef struct {
 
35
    WMPoint pos;
 
36
    WMSize size;
 
37
} WMRect;
 
38
 
 
39
 
 
40
 
 
41
 
 
42
 
 
43
#define ClientMessageMask       (1L<<30)
 
44
 
 
45
 
 
46
#ifndef _DEFINED_GNUSTEP_WINDOW_INFO
 
47
#define _DEFINED_GNUSTEP_WINDOW_INFO
 
48
/*
 
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
 */
 
57
enum {
 
58
    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
 
69
};
 
70
 
 
71
 
 
72
/* window attributes */
 
73
enum {
 
74
    WMBorderlessWindowMask = 0,
 
75
    WMTitledWindowMask = 1,
 
76
    WMClosableWindowMask = 2,
 
77
    WMMiniaturizableWindowMask = 4,
 
78
    WMResizableWindowMask = 8,
 
79
    WMIconWindowMask = 64,
 
80
    WMMiniWindowMask = 128
 
81
};
 
82
#endif
 
83
 
 
84
 
 
85
/* button types */
 
86
typedef enum {
 
87
    /* 0 is reserved for internal use */
 
88
    WBTMomentaryPush = 1,
 
89
    WBTPushOnPushOff = 2,
 
90
    WBTToggle = 3,
 
91
    WBTSwitch = 4,
 
92
    WBTRadio = 5,
 
93
    WBTMomentaryChange = 6,
 
94
    WBTOnOff = 7,
 
95
    WBTMomentaryLight = 8
 
96
} WMButtonType;
 
97
 
 
98
/* button behaviour masks */
 
99
enum {
 
100
    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
 
 
110
/* frame title positions */
 
111
typedef enum {
 
112
    WTPNoTitle,
 
113
    WTPAboveTop,
 
114
    WTPAtTop,
 
115
    WTPBelowTop,
 
116
    WTPAboveBottom,
 
117
    WTPAtBottom,
 
118
    WTPBelowBottom
 
119
} WMTitlePosition;
 
120
 
 
121
 
 
122
/* relief types */
 
123
typedef enum {
 
124
    WRFlat,
 
125
    WRSimple,
 
126
    WRRaised,
 
127
    WRSunken,
 
128
    WRGroove,
 
129
    WRRidge,
 
130
    WRPushed
 
131
} WMReliefType;
 
132
 
 
133
 
 
134
/* alignment types */
 
135
typedef enum {
 
136
    WALeft,
 
137
    WACenter,
 
138
    WARight,
 
139
    WAJustified                /* not valid for textfields */
 
140
} WMAlignment;
 
141
 
 
142
 
 
143
/* image position */
 
144
typedef enum {
 
145
    WIPNoImage,
 
146
    WIPImageOnly,
 
147
    WIPLeft,
 
148
    WIPRight,
 
149
    WIPBelow,
 
150
    WIPAbove,
 
151
    WIPOverlaps
 
152
} WMImagePosition;
 
153
 
 
154
 
 
155
/* scroller arrow position */
 
156
typedef enum {
 
157
    WSAMaxEnd,
 
158
    WSAMinEnd,
 
159
    WSANone
 
160
} WMScrollArrowPosition;
 
161
 
 
162
/* scroller parts */
 
163
typedef enum {
 
164
    WSNoPart,
 
165
    WSDecrementPage,
 
166
    WSIncrementPage,
 
167
    WSDecrementLine,
 
168
    WSIncrementLine,
 
169
    WSDecrementWheel,
 
170
    WSIncrementWheel,
 
171
    WSKnob,
 
172
    WSKnobSlot
 
173
} WMScrollerPart;
 
174
 
 
175
/* usable scroller parts */
 
176
typedef enum {
 
177
    WSUNoParts,
 
178
    WSUOnlyArrows,
 
179
    WSUAllParts
 
180
} WMUsableScrollerParts;
 
181
 
 
182
/* matrix types */
 
183
typedef enum {
 
184
    WMRadioMode,
 
185
    WMHighlightMode,
 
186
    WMListMode,
 
187
    WMTrackMode
 
188
} WMMatrixTypes;
 
189
 
 
190
 
 
191
typedef enum {
 
192
    WTTopTabsBevelBorder,
 
193
    WTNoTabsBevelBorder,
 
194
    WTNoTabsLineBorder,
 
195
    WTNoTabsNoBorder
 
196
} WMTabViewType;
 
197
 
 
198
 
 
199
/* text movement types */
 
200
enum {
 
201
    WMIllegalTextMovement,
 
202
    WMReturnTextMovement,
 
203
    WMEscapeTextMovement,
 
204
    WMTabTextMovement,
 
205
    WMBacktabTextMovement,
 
206
    WMLeftTextMovement,
 
207
    WMRightTextMovement,
 
208
    WMUpTextMovement,
 
209
    WMDownTextMovement
 
210
};
 
211
 
 
212
/* text field special events */
 
213
enum {
 
214
    WMInsertTextEvent,
 
215
    WMDeleteTextEvent
 
216
};
 
217
 
 
218
 
 
219
enum {
 
220
    WLNotFound = -1       /* element was not found in WMList */
 
221
};
 
222
 
 
223
 
 
224
/* drag operations */
 
225
typedef enum {
 
226
    WDOperationNone = 0,
 
227
    WDOperationCopy,
 
228
    WDOperationMove,
 
229
    WDOperationLink,
 
230
    WDOperationAsk,
 
231
    WDOperationPrivate
 
232
} WMDragOperationType;
 
233
 
 
234
 
 
235
typedef enum {
 
236
    WMGrayModeColorPanel = 1,
 
237
    WMRGBModeColorPanel = 2,
 
238
    WMCMYKModeColorPanel = 3,
 
239
    WMHSBModeColorPanel = 4,
 
240
    WMCustomPaletteModeColorPanel = 5,
 
241
    WMColorListModeColorPanel = 6,
 
242
    WMWheelModeColorPanel = 7
 
243
} WMColorPanelMode;
 
244
 
 
245
 
 
246
 
 
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
 
259
#define WSICheckMark                    12
 
260
 
 
261
enum {
 
262
    WLDSSelected = (1 << 16),
 
263
    WLDSDisabled = (1 << 17),
 
264
    WLDSFocused = (1 << 18),
 
265
    WLDSIsBranch = (1 << 19)
 
266
};
 
267
 
 
268
/* alert panel return values */
 
269
enum {
 
270
    WAPRDefault = 0,
 
271
    WAPRAlternate = 1,
 
272
    WAPROther = -1,
 
273
    WAPRError = -2
 
274
};
 
275
 
 
276
 
 
277
 
 
278
/* types of input observers */
 
279
enum {
 
280
    WIReadMask = (1 << 0),
 
281
    WIWriteMask = (1 << 1),
 
282
    WIExceptMask = (1 << 2)
 
283
};
 
284
 
 
285
 
 
286
 
 
287
typedef int W_Class;
 
288
 
 
289
enum {
 
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 */
 
303
    WC_SplitView = 13,
 
304
    WC_TabView = 14,
 
305
    WC_ProgressIndicator = 15,
 
306
    WC_MenuView = 16,
 
307
    WC_Ruler = 17,
 
308
    WC_Text = 18,
 
309
    WC_Box = 19
 
310
};
 
311
 
 
312
/* All widgets must start with the following structure
 
313
 * in that order. Used for typecasting to get some generic data */
 
314
typedef struct W_WidgetType {
 
315
    W_Class widgetClass;
 
316
    struct W_View *view;
 
317
 
 
318
} 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
 
 
327
typedef void WMWidget;
 
328
 
 
329
typedef struct W_Pixmap WMPixmap;
 
330
typedef struct W_Font   WMFont;
 
331
typedef struct W_Color  WMColor;
 
332
 
 
333
typedef struct W_Screen WMScreen;
 
334
 
 
335
typedef struct W_View WMView;
 
336
 
 
337
typedef struct W_Window WMWindow;
 
338
typedef struct W_Frame WMFrame;
 
339
typedef struct W_Button WMButton;
 
340
typedef struct W_Label WMLabel;
 
341
typedef struct W_TextField WMTextField;
 
342
typedef struct W_Scroller WMScroller;
 
343
typedef struct W_ScrollView WMScrollView;
 
344
typedef struct W_List WMList;
 
345
typedef struct W_Browser WMBrowser;
 
346
typedef struct W_PopUpButton WMPopUpButton;
 
347
typedef struct W_ProgressIndicator WMProgressIndicator;
 
348
typedef struct W_ColorWell WMColorWell;
 
349
typedef struct W_Slider WMSlider;
 
350
typedef struct W_Matrix WMMatrix;      /* not ready */
 
351
typedef struct W_SplitView WMSplitView;
 
352
typedef struct W_TabView WMTabView;
 
353
typedef struct W_Ruler WMRuler;
 
354
typedef struct W_Text WMText;
 
355
typedef struct W_Box WMBox;
 
356
 
 
357
 
 
358
/* not widgets */
 
359
typedef struct W_TabViewItem WMTabViewItem;
 
360
typedef struct W_MenuItem WMMenuItem;
 
361
 
 
362
 
 
363
typedef struct W_FilePanel WMFilePanel;
 
364
typedef WMFilePanel WMOpenPanel;
 
365
typedef WMFilePanel WMSavePanel;
 
366
 
 
367
typedef struct W_FontPanel WMFontPanel;
 
368
 
 
369
typedef struct W_ColorPanel WMColorPanel;
 
370
 
 
371
 
 
372
/* item for WMList */
 
373
typedef struct WMListItem {
 
374
    char *text;
 
375
    void *clientData;                  /* ptr for user clientdata. */
 
376
 
 
377
    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 */
 
385
typedef struct WMAlertPanel {
 
386
    WMWindow *win;                     /* window */
 
387
    WMBox *vbox;
 
388
    WMBox *hbox;
 
389
    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 */
 
397
} WMAlertPanel;
 
398
 
 
399
 
 
400
typedef struct WMGenericPanel {
 
401
    WMWindow *win;
 
402
    WMBox *vbox;
 
403
 
 
404
    WMLabel *iLbl;
 
405
    WMLabel *tLbl;
 
406
 
 
407
    WMFrame *line;
 
408
 
 
409
    WMFrame *content;
 
410
 
 
411
    WMBox *buttonBox;
 
412
    WMButton *defBtn;
 
413
    WMButton *altBtn;
 
414
 
 
415
    short result;
 
416
} WMGenericPanel;
 
417
 
 
418
 
 
419
typedef 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 */
 
427
} WMInputPanel;
 
428
 
 
429
 
 
430
/* Basic font styles. Used to easily get one style from another */
 
431
typedef enum WMFontStyle {
 
432
    WFSNormal = 0,
 
433
    WFSBold   = 1,
 
434
    WFSItalic = 2,
 
435
    WFSBoldItalic = 3
 
436
} WMFontStyle;
 
437
 
 
438
 
 
439
/* WMRuler: */
 
440
typedef struct {
 
441
    WMArray  *tabs;             /* a growable array of tabstops */
 
442
    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 */
 
446
    unsigned short retainCount;
 
447
} WMRulerMargins;
 
448
/* All indentation and tab markers are _relative_ to the left margin marker */
 
449
 
 
450
 
 
451
typedef void WMEventProc(XEvent *event, void *clientData);
 
452
 
 
453
typedef 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() */
 
457
typedef void WMAction(WMWidget *self, void *clientData);
 
458
 
 
459
/* same as WMAction, but for stuff that arent widgets */
 
460
typedef void WMAction2(void *self, void *clientData);
 
461
 
 
462
 
 
463
/* delegate method like stuff */
 
464
typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
 
465
                            int state, WMRect *rect);
 
466
 
 
467
 
 
468
/*
 
469
typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
 
470
                                           unsigned int oldWidth,
 
471
                                           unsigned int oldHeight);
 
472
*/
 
473
 
 
474
typedef void WMSplitViewConstrainProc(WMSplitView *sPtr, int dividerIndex,
 
475
                                      int *minSize, int *maxSize);
 
476
 
 
477
typedef WMWidget* WMMatrixCreateCellProc(WMMatrix *mPtr);
 
478
 
 
479
 
 
480
 
 
481
 
 
482
typedef struct WMBrowserDelegate {
 
483
    void *data;
 
484
 
 
485
    void (*createRowsForColumn)(struct WMBrowserDelegate *self,
 
486
                                WMBrowser *sender, int column, WMList *list);
 
487
 
 
488
    char* (*titleOfColumn)(struct WMBrowserDelegate *self, WMBrowser *sender,
 
489
                           int column);
 
490
 
 
491
    void (*didScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
 
492
 
 
493
    void (*willScroll)(struct WMBrowserDelegate *self, WMBrowser *sender);
 
494
} WMBrowserDelegate;
 
495
 
 
496
 
 
497
typedef struct WMTextFieldDelegate {
 
498
    void *data;
 
499
 
 
500
    void (*didBeginEditing)(struct WMTextFieldDelegate *self,
 
501
                            WMNotification *notif);
 
502
 
 
503
    void (*didChange)(struct WMTextFieldDelegate *self,
 
504
                      WMNotification *notif);
 
505
 
 
506
    void (*didEndEditing)(struct WMTextFieldDelegate *self,
 
507
                          WMNotification *notif);
 
508
 
 
509
    Bool (*shouldBeginEditing)(struct WMTextFieldDelegate *self,
 
510
                               WMTextField *tPtr);
 
511
 
 
512
    Bool (*shouldEndEditing)(struct WMTextFieldDelegate *self,
 
513
                             WMTextField *tPtr);
 
514
} WMTextFieldDelegate;
 
515
 
 
516
 
 
517
typedef struct WMTextDelegate {
 
518
    void *data;
 
519
 
 
520
    Bool (*didDoubleClickOnPicture)(struct WMTextDelegate *self,
 
521
                                    void *description);
 
522
 
 
523
} WMTextDelegate;
 
524
 
 
525
 
 
526
 
 
527
typedef struct WMTabViewDelegate {
 
528
    void *data;
 
529
 
 
530
    void (*didChangeNumberOfItems)(struct WMTabViewDelegate *self,
 
531
                                   WMTabView *tabView);
 
532
 
 
533
    void (*didSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
 
534
                          WMTabViewItem *item);
 
535
 
 
536
    Bool (*shouldSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
 
537
                             WMTabViewItem *item);
 
538
 
 
539
    void (*willSelectItem)(struct WMTabViewDelegate *self, WMTabView *tabView,
 
540
                           WMTabViewItem *item);
 
541
} WMTabViewDelegate;
 
542
 
 
543
 
 
544
 
 
545
 
 
546
typedef void WMSelectionCallback(WMView *view, Atom selection, Atom target,
 
547
                                 Time timestamp, void *cdata, WMData *data);
 
548
 
 
549
 
 
550
typedef struct WMSelectionProcs {
 
551
    WMData* (*convertSelection)(WMView *view, Atom selection, Atom target,
 
552
                                void *cdata, Atom *type);
 
553
    void (*selectionLost)(WMView *view, Atom selection, void *cdata);
 
554
    void (*selectionDone)(WMView *view, Atom selection, Atom target,
 
555
                          void *cdata);
 
556
} WMSelectionProcs;
 
557
 
 
558
 
 
559
typedef struct W_DraggingInfo WMDraggingInfo;
 
560
 
 
561
 
 
562
/* links a label to a dnd operation. */
 
563
typedef struct W_DragOperationtItem WMDragOperationItem;
 
564
 
 
565
 
 
566
typedef struct W_DragSourceProcs {
 
567
    WMArray* (*dropDataTypes)(WMView *self);
 
568
    WMDragOperationType (*wantedDropOperation)(WMView *self);
 
569
    WMArray* (*askedOperations)(WMView *self);
 
570
    Bool (*acceptDropOperation)(WMView *self, WMDragOperationType operation);
 
571
    void (*beganDrag)(WMView *self, WMPoint *point);
 
572
    void (*endedDrag)(WMView *self, WMPoint *point, Bool deposited);
 
573
    WMData* (*fetchDragData)(WMView *self, char *type);
 
574
    /*Bool (*ignoreModifierKeysWhileDragging)(WMView *view);*/
 
575
} WMDragSourceProcs;
 
576
 
 
577
 
 
578
 
 
579
typedef struct W_DragDestinationProcs {
 
580
    void (*prepareForDragOperation)(WMView *self);
 
581
    WMArray* (*requiredDataTypes)(WMView *self, WMDragOperationType request,
 
582
                                  WMArray *sourceDataTypes);
 
583
    WMDragOperationType (*allowedOperation)(WMView *self,
 
584
                                            WMDragOperationType request,
 
585
                                            WMArray *sourceDataTypes);
 
586
    Bool (*inspectDropData)(WMView *self, WMArray *dropData);
 
587
    void (*performDragOperation)(WMView *self, WMArray *dropData,
 
588
                                 WMArray *operations, WMPoint *dropLocation);
 
589
    void (*concludeDragOperation)(WMView *self);
 
590
} WMDragDestinationProcs;
 
591
 
 
592
 
 
593
/* ...................................................................... */
 
594
 
 
595
 
 
596
WMPoint wmkpoint(int x, int y);
 
597
 
 
598
WMSize wmksize(unsigned int width, unsigned int height);
 
599
 
 
600
WMRect wmkrect(int x, int y, unsigned int width, unsigned int height);
 
601
 
 
602
#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
 
606
 
 
607
/* ....................................................................... */
 
608
 
 
609
 
 
610
 
 
611
void WMInitializeApplication(char *applicationName, int *argc, char **argv);
 
612
 
 
613
void WMSetResourcePath(char *path);
 
614
 
 
615
/* don't free the returned string */
 
616
char* WMGetApplicationName();
 
617
 
 
618
/* Try to locate resource file. ext may be NULL */
 
619
char* WMPathForResourceOfType(char *resource, char *ext);
 
620
 
 
621
 
 
622
WMScreen* WMOpenScreen(const char *display);
 
623
 
 
624
WMScreen* WMCreateScreenWithRContext(Display *display, int screen,
 
625
                                     RContext *context);
 
626
 
 
627
WMScreen* WMCreateScreen(Display *display, int screen);
 
628
 
 
629
WMScreen* WMCreateSimpleApplicationScreen(Display *display);
 
630
 
 
631
void WMScreenMainLoop(WMScreen *scr);
 
632
 
 
633
void WMBreakModalLoop(WMScreen *scr);
 
634
 
 
635
void WMRunModalLoop(WMScreen *scr, WMView *view);
 
636
 
 
637
RContext* WMScreenRContext(WMScreen *scr);
 
638
 
 
639
Display* WMScreenDisplay(WMScreen *scr);
 
640
 
 
641
int WMScreenDepth(WMScreen *scr);
 
642
 
 
643
 
 
644
 
 
645
void WMSetApplicationIconImage(WMScreen *app, RImage *image);
 
646
 
 
647
RImage* WMGetApplicationIconImage(WMScreen *app);
 
648
 
 
649
void WMSetApplicationIconPixmap(WMScreen *app, WMPixmap *icon);
 
650
 
 
651
WMPixmap* WMGetApplicationIconPixmap(WMScreen *app);
 
652
 
 
653
/* If color==NULL it will use the default color for panels: ae/aa/ae */
 
654
WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color);
 
655
 
 
656
void WMSetApplicationIconWindow(WMScreen *scr, Window window);
 
657
 
 
658
void WMSetFocusToWidget(WMWidget *widget);
 
659
 
 
660
WMEventHook* WMHookEventHandler(WMEventHook *handler);
 
661
 
 
662
int WMHandleEvent(XEvent *event);
 
663
 
 
664
Bool WMScreenPending(WMScreen *scr);
 
665
 
 
666
void WMCreateEventHandler(WMView *view, unsigned long mask,
 
667
                          WMEventProc *eventProc, void *clientData);
 
668
 
 
669
void WMDeleteEventHandler(WMView *view, unsigned long mask,
 
670
                          WMEventProc *eventProc, void *clientData);
 
671
 
 
672
int WMIsDoubleClick(XEvent *event);
 
673
 
 
674
/*int WMIsTripleClick(XEvent *event);*/
 
675
 
 
676
void WMNextEvent(Display *dpy, XEvent *event);
 
677
 
 
678
void WMMaskEvent(Display *dpy, long mask, XEvent *event);
 
679
 
 
680
 
 
681
/* ....................................................................... */
 
682
 
 
683
 
 
684
Bool WMCreateSelectionHandler(WMView *view, Atom selection, Time timestamp,
 
685
                              WMSelectionProcs *procs, void *cdata);
 
686
 
 
687
void WMDeleteSelectionHandler(WMView *view, Atom selection, Time timestamp);
 
688
 
 
689
Bool WMRequestSelection(WMView *view, Atom selection, Atom target,
 
690
                        Time timestamp, WMSelectionCallback *callback,
 
691
                        void *cdata);
 
692
 
 
693
 
 
694
extern char *WMSelectionOwnerDidChangeNotification;
 
695
 
 
696
/* ....................................................................... */
 
697
 
 
698
WMArray* WMCreateDragOperationArray(int initialSize);
 
699
 
 
700
WMDragOperationItem* WMCreateDragOperationItem(WMDragOperationType type,
 
701
                                               char* text);
 
702
 
 
703
WMDragOperationType WMGetDragOperationItemType(WMDragOperationItem* item);
 
704
 
 
705
char* WMGetDragOperationItemText(WMDragOperationItem* item);
 
706
 
 
707
void WMSetViewDragImage(WMView* view, WMPixmap *dragImage);
 
708
 
 
709
void WMReleaseViewDragImage(WMView* view);
 
710
 
 
711
void WMSetViewDragSourceProcs(WMView *view, WMDragSourceProcs *procs);
 
712
 
 
713
Bool WMIsDraggingFromView(WMView *view);
 
714
 
 
715
void WMDragImageFromView(WMView *view, XEvent *event);
 
716
 
 
717
/* Create a drag handler, associating drag event masks with dragEventProc */
 
718
void WMCreateDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
 
719
 
 
720
void WMDeleteDragHandler(WMView *view, WMEventProc *dragEventProc, void *clientData);
 
721
 
 
722
/* set default drag handler for view */
 
723
void WMSetViewDraggable(WMView *view, WMDragSourceProcs *procs, WMPixmap *dragImage);
 
724
 
 
725
void WMUnsetViewDraggable(WMView *view);
 
726
 
 
727
void WMRegisterViewForDraggedTypes(WMView *view, WMArray *acceptedTypes);
 
728
 
 
729
void WMUnregisterViewDraggedTypes(WMView *view);
 
730
 
 
731
void WMSetViewDragDestinationProcs(WMView *view, WMDragDestinationProcs *procs);
 
732
 
 
733
/* ....................................................................... */
 
734
 
 
735
Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
 
736
 
 
737
/* ....................................................................... */
 
738
 
 
739
WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
 
740
 
 
741
WMFont* WMCopyFontWithStyle(WMScreen *scrPtr, WMFont *font, WMFontStyle style);
 
742
 
 
743
WMFont* WMRetainFont(WMFont *font);
 
744
 
 
745
void WMReleaseFont(WMFont *font);
 
746
 
 
747
char* WMGetFontName(WMFont *font);
 
748
 
 
749
unsigned int WMFontHeight(WMFont *font);
 
750
 
 
751
void WMSetWidgetDefaultFont(WMScreen *scr, WMFont *font);
 
752
 
 
753
void WMSetWidgetDefaultBoldFont(WMScreen *scr, WMFont *font);
 
754
 
 
755
WMFont* WMDefaultSystemFont(WMScreen *scrPtr);
 
756
 
 
757
WMFont* WMDefaultBoldSystemFont(WMScreen *scrPtr);
 
758
 
 
759
WMFont* WMSystemFontOfSize(WMScreen *scrPtr, int size);
 
760
 
 
761
WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
 
762
 
 
763
/* ....................................................................... */
 
764
 
 
765
WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
 
766
 
 
767
void WMReleasePixmap(WMPixmap *pixmap);
 
768
 
 
769
WMPixmap* WMCreatePixmap(WMScreen *scrPtr, int width, int height, int depth,
 
770
                         Bool masked);
 
771
 
 
772
WMPixmap* WMCreatePixmapFromXPixmaps(WMScreen *scrPtr, Pixmap pixmap,
 
773
                                     Pixmap mask, int width, int height,
 
774
                                     int depth);
 
775
 
 
776
WMPixmap* WMCreatePixmapFromRImage(WMScreen *scrPtr, RImage *image,
 
777
                                   int threshold);
 
778
 
 
779
WMPixmap* WMCreatePixmapFromXPMData(WMScreen *scrPtr, char **data);
 
780
 
 
781
WMSize WMGetPixmapSize(WMPixmap *pixmap);
 
782
 
 
783
WMPixmap* WMCreatePixmapFromFile(WMScreen *scrPtr, char *fileName);
 
784
 
 
785
WMPixmap* WMCreateBlendedPixmapFromRImage(WMScreen *scrPtr, RImage *image,
 
786
                                          RColor *color);
 
787
 
 
788
WMPixmap* WMCreateBlendedPixmapFromFile(WMScreen *scrPtr, char *fileName,
 
789
                                        RColor *color);
 
790
 
 
791
void WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y);
 
792
 
 
793
Pixmap WMGetPixmapXID(WMPixmap *pixmap);
 
794
 
 
795
Pixmap WMGetPixmapMaskXID(WMPixmap *pixmap);
 
796
 
 
797
WMPixmap* WMGetSystemPixmap(WMScreen *scr, int image);
 
798
 
 
799
/* ....................................................................... */
 
800
 
 
801
 
 
802
WMColor* WMDarkGrayColor(WMScreen *scr);
 
803
 
 
804
WMColor* WMGrayColor(WMScreen *scr);
 
805
 
 
806
WMColor* WMBlackColor(WMScreen *scr);
 
807
 
 
808
WMColor* WMWhiteColor(WMScreen *scr);
 
809
 
 
810
void WMSetColorInGC(WMColor *color, GC gc);
 
811
 
 
812
GC WMColorGC(WMColor *color);
 
813
 
 
814
WMPixel WMColorPixel(WMColor *color);
 
815
 
 
816
void WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
 
817
                        unsigned int width, unsigned int height);
 
818
 
 
819
void WMReleaseColor(WMColor *color);
 
820
 
 
821
WMColor* WMRetainColor(WMColor *color);
 
822
 
 
823
WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
 
824
                          unsigned short green, unsigned short blue,
 
825
                          Bool exact);
 
826
 
 
827
WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
 
828
                           unsigned short green, unsigned short blue,
 
829
                           unsigned short alpha, Bool exact);
 
830
 
 
831
WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
 
832
 
 
833
RColor WMGetRColorFromColor(WMColor *color);
 
834
 
 
835
void WMSetColorAlpha(WMColor *color, unsigned short alpha);
 
836
 
 
837
unsigned short WMRedComponentOfColor(WMColor *color);
 
838
 
 
839
unsigned short WMGreenComponentOfColor(WMColor *color);
 
840
 
 
841
unsigned short WMBlueComponentOfColor(WMColor *color);
 
842
 
 
843
unsigned short WMGetColorAlpha(WMColor *color);
 
844
 
 
845
char* WMGetColorRGBDescription(WMColor *color);
 
846
 
 
847
/* ....................................................................... */
 
848
 
 
849
 
 
850
void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
 
851
                  int x, int y, char *text, int length);
 
852
 
 
853
void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
 
854
                       WMColor *background, WMFont *font, int x, int y,
 
855
                       char *text, int length);
 
856
 
 
857
int WMWidthOfString(WMFont *font, char *text, int length);
 
858
 
 
859
 
 
860
 
 
861
/* ....................................................................... */
 
862
 
 
863
WMScreen* WMWidgetScreen(WMWidget *w);
 
864
 
 
865
unsigned int WMScreenWidth(WMScreen *scr);
 
866
 
 
867
unsigned int WMScreenHeight(WMScreen *scr);
 
868
 
 
869
void WMUnmapWidget(WMWidget *w);
 
870
 
 
871
void WMMapWidget(WMWidget *w);
 
872
 
 
873
Bool WMWidgetIsMapped(WMWidget *w);
 
874
 
 
875
void WMRaiseWidget(WMWidget *w);
 
876
 
 
877
void WMLowerWidget(WMWidget *w);
 
878
 
 
879
void WMMoveWidget(WMWidget *w, int x, int y);
 
880
 
 
881
void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
 
882
 
 
883
void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
 
884
 
 
885
WMColor* WMGetWidgetBackgroundColor(WMWidget *w);
 
886
 
 
887
void WMMapSubwidgets(WMWidget *w);
 
888
 
 
889
void WMUnmapSubwidgets(WMWidget *w);
 
890
 
 
891
void WMRealizeWidget(WMWidget *w);
 
892
 
 
893
void WMReparentWidget(WMWidget *w, WMWidget *newParent, int x, int y);
 
894
 
 
895
void WMDestroyWidget(WMWidget *widget);
 
896
 
 
897
void WMHangData(WMWidget *widget, void *data);
 
898
 
 
899
void* WMGetHangedData(WMWidget *widget);
 
900
 
 
901
unsigned int WMWidgetWidth(WMWidget *w);
 
902
 
 
903
unsigned int WMWidgetHeight(WMWidget *w);
 
904
 
 
905
Window WMWidgetXID(WMWidget *w);
 
906
 
 
907
Window WMViewXID(WMView *view);
 
908
 
 
909
void WMRedisplayWidget(WMWidget *w);
 
910
 
 
911
void WMSetViewNotifySizeChanges(WMView *view, Bool flag);
 
912
 
 
913
void WMSetViewExpandsToParent(WMView *view, int topOffs, int leftOffs,
 
914
                              int rightOffs, int bottomOffs);
 
915
 
 
916
WMSize WMGetViewSize(WMView *view);
 
917
 
 
918
WMPoint WMGetViewPosition(WMView *view);
 
919
 
 
920
WMPoint WMGetViewScreenPosition(WMView *view);
 
921
 
 
922
WMWidget* WMWidgetOfView(WMView *view);
 
923
 
 
924
void WMSetViewNextResponder(WMView *view, WMView *responder);
 
925
 
 
926
void WMRelayToNextResponder(WMView *view, XEvent *event);
 
927
 
 
928
/* notifications */
 
929
extern char *WMViewSizeDidChangeNotification;
 
930
 
 
931
extern char *WMViewFocusDidChangeNotification;
 
932
 
 
933
extern char *WMViewRealizedNotification;
 
934
 
 
935
 
 
936
/* ....................................................................... */
 
937
 
 
938
void WMSetBalloonTextForView(char *text, WMView *view);
 
939
 
 
940
void WMSetBalloonTextAlignment(WMScreen *scr, WMAlignment alignment);
 
941
 
 
942
void WMSetBalloonFont(WMScreen *scr, WMFont *font);
 
943
 
 
944
void WMSetBalloonTextColor(WMScreen *scr, WMColor *color);
 
945
 
 
946
void WMSetBalloonDelay(WMScreen *scr, int delay);
 
947
 
 
948
void WMSetBalloonEnabled(WMScreen *scr, Bool flag);
 
949
 
 
950
 
 
951
/* ....................................................................... */
 
952
 
 
953
WMWindow* WMCreateWindow(WMScreen *screen, char *name);
 
954
 
 
955
WMWindow* WMCreateWindowWithStyle(WMScreen *screen, char *name, int style);
 
956
 
 
957
WMWindow* WMCreatePanelWithStyleForWindow(WMWindow *owner, char *name,
 
958
                                          int style);
 
959
 
 
960
WMWindow* WMCreatePanelForWindow(WMWindow *owner, char *name);
 
961
 
 
962
void WMChangePanelOwner(WMWindow *win, WMWindow *newOwner);
 
963
 
 
964
void WMSetWindowTitle(WMWindow *wPtr, char *title);
 
965
 
 
966
void WMSetWindowMiniwindowTitle(WMWindow *win, char *title);
 
967
 
 
968
void WMSetWindowMiniwindowImage(WMWindow *win, RImage *image);
 
969
 
 
970
void WMSetWindowMiniwindowPixmap(WMWindow *win, WMPixmap *pixmap);
 
971
 
 
972
void WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData);
 
973
 
 
974
void WMSetWindowInitialPosition(WMWindow *win, int x, int y);
 
975
 
 
976
void WMSetWindowUserPosition(WMWindow *win, int x, int y);
 
977
 
 
978
void WMSetWindowAspectRatio(WMWindow *win, int minX, int minY,
 
979
                            int maxX, int maxY);
 
980
 
 
981
void WMSetWindowMaxSize(WMWindow *win, unsigned width, unsigned height);
 
982
 
 
983
void WMSetWindowMinSize(WMWindow *win, unsigned width, unsigned height);
 
984
 
 
985
void WMSetWindowBaseSize(WMWindow *win, unsigned width, unsigned height);
 
986
 
 
987
void WMSetWindowResizeIncrements(WMWindow *win, unsigned wIncr, unsigned hIncr);
 
988
 
 
989
void WMSetWindowLevel(WMWindow *win, int level);
 
990
 
 
991
void WMSetWindowDocumentEdited(WMWindow *win, Bool flag);
 
992
 
 
993
void WMCloseWindow(WMWindow *win);
 
994
 
 
995
/* ....................................................................... */
 
996
 
 
997
void WMSetButtonAction(WMButton *bPtr, WMAction *action, void *clientData);
 
998
 
 
999
#define WMCreateCommandButton(parent) \
 
1000
    WMCreateCustomButton((parent), WBBSpringLoadedMask\
 
1001
    |WBBPushInMask\
 
1002
    |WBBPushLightMask\
 
1003
    |WBBPushChangeMask)
 
1004
 
 
1005
#define WMCreateRadioButton(parent) \
 
1006
    WMCreateButton((parent), WBTRadio)
 
1007
 
 
1008
#define WMCreateSwitchButton(parent) \
 
1009
    WMCreateButton((parent), WBTSwitch)
 
1010
 
 
1011
WMButton* WMCreateButton(WMWidget *parent, WMButtonType type);
 
1012
 
 
1013
WMButton* WMCreateCustomButton(WMWidget *parent, int behaviourMask);
 
1014
 
 
1015
void WMSetButtonImageDefault(WMButton *bPtr);
 
1016
 
 
1017
void WMSetButtonImage(WMButton *bPtr, WMPixmap *image);
 
1018
 
 
1019
void WMSetButtonAltImage(WMButton *bPtr, WMPixmap *image);
 
1020
 
 
1021
void WMSetButtonImagePosition(WMButton *bPtr, WMImagePosition position);
 
1022
 
 
1023
void WMSetButtonFont(WMButton *bPtr, WMFont *font);
 
1024
 
 
1025
void WMSetButtonTextAlignment(WMButton *bPtr, WMAlignment alignment);
 
1026
 
 
1027
void WMSetButtonText(WMButton *bPtr, char *text);
 
1028
 
 
1029
void WMSetButtonAltText(WMButton *bPtr, char *text);
 
1030
 
 
1031
void WMSetButtonTextColor(WMButton *bPtr, WMColor *color);
 
1032
 
 
1033
void WMSetButtonAltTextColor(WMButton *bPtr, WMColor *color);
 
1034
 
 
1035
void WMSetButtonDisabledTextColor(WMButton *bPtr, WMColor *color);
 
1036
 
 
1037
void WMSetButtonSelected(WMButton *bPtr, int isSelected);
 
1038
 
 
1039
int WMGetButtonSelected(WMButton *bPtr);
 
1040
 
 
1041
void WMSetButtonBordered(WMButton *bPtr, int isBordered);
 
1042
 
 
1043
void WMSetButtonEnabled(WMButton *bPtr, Bool flag);
 
1044
 
 
1045
int WMGetButtonEnabled(WMButton *bPtr);
 
1046
 
 
1047
void WMSetButtonImageDimsWhenDisabled(WMButton *bPtr, Bool flag);
 
1048
 
 
1049
void WMSetButtonTag(WMButton *bPtr, int tag);
 
1050
 
 
1051
void WMGroupButtons(WMButton *bPtr, WMButton *newMember);
 
1052
 
 
1053
void WMPerformButtonClick(WMButton *bPtr);
 
1054
 
 
1055
void WMSetButtonContinuous(WMButton *bPtr, Bool flag);
 
1056
 
 
1057
void WMSetButtonPeriodicDelay(WMButton *bPtr, float delay, float interval);
 
1058
 
 
1059
/* ....................................................................... */
 
1060
 
 
1061
WMLabel* WMCreateLabel(WMWidget *parent);
 
1062
 
 
1063
void WMSetLabelWraps(WMLabel *lPtr, Bool flag);
 
1064
 
 
1065
void WMSetLabelImage(WMLabel *lPtr, WMPixmap *image);
 
1066
 
 
1067
WMPixmap* WMGetLabelImage(WMLabel *lPtr);
 
1068
 
 
1069
char* WMGetLabelText(WMLabel *lPtr);
 
1070
 
 
1071
void WMSetLabelImagePosition(WMLabel *lPtr, WMImagePosition position);
 
1072
 
 
1073
void WMSetLabelTextAlignment(WMLabel *lPtr, WMAlignment alignment);
 
1074
 
 
1075
void WMSetLabelRelief(WMLabel *lPtr, WMReliefType relief);
 
1076
 
 
1077
void WMSetLabelText(WMLabel *lPtr, char *text);
 
1078
 
 
1079
WMFont* WMGetLabelFont(WMLabel *lPtr);
 
1080
 
 
1081
void WMSetLabelFont(WMLabel *lPtr, WMFont *font);
 
1082
 
 
1083
void WMSetLabelTextColor(WMLabel *lPtr, WMColor *color);
 
1084
 
 
1085
/* ....................................................................... */
 
1086
 
 
1087
WMFrame* WMCreateFrame(WMWidget *parent);
 
1088
 
 
1089
void WMSetFrameTitlePosition(WMFrame *fPtr, WMTitlePosition position);
 
1090
 
 
1091
void WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief);
 
1092
 
 
1093
void WMSetFrameTitle(WMFrame *fPtr, char *title);
 
1094
 
 
1095
/* ....................................................................... */
 
1096
 
 
1097
WMTextField* WMCreateTextField(WMWidget *parent);
 
1098
 
 
1099
void WMInsertTextFieldText(WMTextField *tPtr, char *text, int position);
 
1100
 
 
1101
void WMDeleteTextFieldRange(WMTextField *tPtr, WMRange range);
 
1102
 
 
1103
/* you can free the returned string */
 
1104
char* WMGetTextFieldText(WMTextField *tPtr);
 
1105
 
 
1106
void WMSetTextFieldText(WMTextField *tPtr, char *text);
 
1107
 
 
1108
void WMSetTextFieldAlignment(WMTextField *tPtr, WMAlignment alignment);
 
1109
 
 
1110
void WMSetTextFieldFont(WMTextField *tPtr, WMFont *font);
 
1111
 
 
1112
WMFont* WMGetTextFieldFont(WMTextField *tPtr);
 
1113
 
 
1114
void WMSetTextFieldBordered(WMTextField *tPtr, Bool bordered);
 
1115
 
 
1116
void WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag);
 
1117
 
 
1118
Bool WMGetTextFieldEditable(WMTextField *tPtr);
 
1119
 
 
1120
void WMSetTextFieldEditable(WMTextField *tPtr, Bool flag);
 
1121
 
 
1122
void WMSetTextFieldSecure(WMTextField *tPtr, Bool flag);
 
1123
 
 
1124
void WMSelectTextFieldRange(WMTextField *tPtr, WMRange range);
 
1125
 
 
1126
void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
 
1127
 
 
1128
void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
 
1129
 
 
1130
void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
 
1131
 
 
1132
void WMSetTextFieldDelegate(WMTextField *tPtr, WMTextFieldDelegate *delegate);
 
1133
 
 
1134
WMTextFieldDelegate* WMGetTextFieldDelegate(WMTextField *tPtr);
 
1135
 
 
1136
extern char *WMTextDidChangeNotification;
 
1137
extern char *WMTextDidBeginEditingNotification;
 
1138
extern char *WMTextDidEndEditingNotification;
 
1139
 
 
1140
/* ....................................................................... */
 
1141
 
 
1142
WMScroller* WMCreateScroller(WMWidget *parent);
 
1143
 
 
1144
void WMSetScrollerParameters(WMScroller *sPtr, float floatValue,
 
1145
                             float knobProportion);
 
1146
 
 
1147
float WMGetScrollerKnobProportion(WMScroller *sPtr);
 
1148
 
 
1149
float WMGetScrollerValue(WMScroller *sPtr);
 
1150
 
 
1151
WMScrollerPart WMGetScrollerHitPart(WMScroller *sPtr);
 
1152
 
 
1153
void WMSetScrollerAction(WMScroller *sPtr, WMAction *action, void *clientData);
 
1154
 
 
1155
void WMSetScrollerArrowsPosition(WMScroller *sPtr,
 
1156
                                 WMScrollArrowPosition position);
 
1157
 
 
1158
extern char *WMScrollerDidScrollNotification;
 
1159
 
 
1160
/* ....................................................................... */
 
1161
 
 
1162
WMList* WMCreateList(WMWidget *parent);
 
1163
 
 
1164
void WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag);
 
1165
 
 
1166
void WMSetListAllowEmptySelection(WMList *lPtr, Bool flag);
 
1167
 
 
1168
#define WMAddListItem(lPtr, text) WMInsertListItem((lPtr), -1, (text))
 
1169
 
 
1170
WMListItem* WMInsertListItem(WMList *lPtr, int row, char *text);
 
1171
 
 
1172
void WMSortListItems(WMList *lPtr);
 
1173
 
 
1174
void WMSortListItemsWithComparer(WMList *lPtr, WMCompareDataProc *func);
 
1175
 
 
1176
int WMFindRowOfListItemWithTitle(WMList *lPtr, char *title);
 
1177
 
 
1178
WMListItem* WMGetListItem(WMList *lPtr, int row);
 
1179
 
 
1180
WMArray* WMGetListItems(WMList *lPtr);
 
1181
 
 
1182
void WMRemoveListItem(WMList *lPtr, int row);
 
1183
 
 
1184
void WMSelectListItem(WMList *lPtr, int row);
 
1185
 
 
1186
void WMUnselectListItem(WMList *lPtr, int row);
 
1187
 
 
1188
/* This will select all items in range, and deselect all the others */
 
1189
void WMSetListSelectionToRange(WMList *lPtr, WMRange range);
 
1190
 
 
1191
/* This will select all items in range, leaving the others as they are */
 
1192
void WMSelectListItemsInRange(WMList *lPtr, WMRange range);
 
1193
 
 
1194
void WMSelectAllListItems(WMList *lPtr);
 
1195
 
 
1196
void WMUnselectAllListItems(WMList *lPtr);
 
1197
 
 
1198
void WMSetListUserDrawProc(WMList *lPtr, WMListDrawProc *proc);
 
1199
 
 
1200
void WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height);
 
1201
 
 
1202
int WMGetListItemHeight(WMList *lPtr);
 
1203
 
 
1204
/* don't free the returned data */
 
1205
WMArray* WMGetListSelectedItems(WMList *lPtr);
 
1206
 
 
1207
/*
 
1208
 * For the following 2 functions, in case WMList allows multiple selection,
 
1209
 * the first item in the list of selected items, respective its row number,
 
1210
 * will be returned.
 
1211
 */
 
1212
 
 
1213
/* don't free the returned data */
 
1214
WMListItem* WMGetListSelectedItem(WMList *lPtr);
 
1215
 
 
1216
int WMGetListSelectedItemRow(WMList *lPtr);
 
1217
 
 
1218
void WMSetListAction(WMList *lPtr, WMAction *action, void *clientData);
 
1219
 
 
1220
void WMSetListDoubleAction(WMList *lPtr, WMAction *action, void *clientData);
 
1221
 
 
1222
void WMClearList(WMList *lPtr);
 
1223
 
 
1224
int WMGetListNumberOfRows(WMList *lPtr);
 
1225
 
 
1226
void WMSetListPosition(WMList *lPtr, int row);
 
1227
 
 
1228
void WMSetListBottomPosition(WMList *lPtr, int row);
 
1229
 
 
1230
int WMGetListPosition(WMList *lPtr);
 
1231
 
 
1232
Bool WMListAllowsMultipleSelection(WMList *lPtr);
 
1233
 
 
1234
Bool WMListAllowsEmptySelection(WMList *lPtr);
 
1235
 
 
1236
 
 
1237
extern char *WMListDidScrollNotification;
 
1238
extern char *WMListSelectionDidChangeNotification;
 
1239
 
 
1240
/* ....................................................................... */
 
1241
 
 
1242
WMBrowser* WMCreateBrowser(WMWidget *parent);
 
1243
 
 
1244
void WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag);
 
1245
 
 
1246
void WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag);
 
1247
 
 
1248
void WMSetBrowserPathSeparator(WMBrowser *bPtr, char *separator);
 
1249
 
 
1250
void WMSetBrowserTitled(WMBrowser *bPtr, Bool flag);
 
1251
 
 
1252
void WMLoadBrowserColumnZero(WMBrowser *bPtr);
 
1253
 
 
1254
int WMAddBrowserColumn(WMBrowser *bPtr);
 
1255
 
 
1256
void WMRemoveBrowserItem(WMBrowser *bPtr, int column, int row);
 
1257
 
 
1258
void WMSetBrowserMaxVisibleColumns(WMBrowser *bPtr, int columns);
 
1259
 
 
1260
void WMSetBrowserColumnTitle(WMBrowser *bPtr, int column, char *title);
 
1261
 
 
1262
WMListItem* WMInsertBrowserItem(WMBrowser *bPtr, int column, int row, char *text, Bool isBranch);
 
1263
 
 
1264
void WMSortBrowserColumn(WMBrowser *bPtr, int column);
 
1265
 
 
1266
void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
 
1267
                                     WMCompareDataProc *func);
 
1268
 
 
1269
/* Don't free the returned string. */
 
1270
char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
 
1271
 
 
1272
/* free the returned string */
 
1273
char* WMGetBrowserPath(WMBrowser *bPtr);
 
1274
 
 
1275
/* free the returned string */
 
1276
char* WMGetBrowserPathToColumn(WMBrowser *bPtr, int column);
 
1277
 
 
1278
/* free the returned array */
 
1279
WMArray* WMGetBrowserPaths(WMBrowser *bPtr);
 
1280
 
 
1281
void WMSetBrowserAction(WMBrowser *bPtr, WMAction *action, void *clientData);
 
1282
 
 
1283
void WMSetBrowserDoubleAction(WMBrowser *bPtr, WMAction *action,
 
1284
                              void *clientData);
 
1285
 
 
1286
WMListItem* WMGetBrowserSelectedItemInColumn(WMBrowser *bPtr, int column);
 
1287
 
 
1288
int WMGetBrowserFirstVisibleColumn(WMBrowser *bPtr);
 
1289
 
 
1290
int WMGetBrowserSelectedColumn(WMBrowser *bPtr);
 
1291
 
 
1292
int WMGetBrowserSelectedRowInColumn(WMBrowser *bPtr, int column);
 
1293
 
 
1294
int WMGetBrowserNumberOfColumns(WMBrowser *bPtr);
 
1295
 
 
1296
int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
 
1297
 
 
1298
WMList* WMGetBrowserListInColumn(WMBrowser *bPtr, int column);
 
1299
 
 
1300
void WMSetBrowserDelegate(WMBrowser *bPtr, WMBrowserDelegate *delegate);
 
1301
 
 
1302
Bool WMBrowserAllowsMultipleSelection(WMBrowser *bPtr);
 
1303
 
 
1304
Bool WMBrowserAllowsEmptySelection(WMBrowser *bPtr);
 
1305
 
 
1306
void WMSetBrowserHasScroller(WMBrowser *bPtr, int hasScroller);
 
1307
 
 
1308
/* ....................................................................... */
 
1309
 
 
1310
 
 
1311
Bool WMMenuItemIsSeparator(WMMenuItem *item);
 
1312
 
 
1313
WMMenuItem* WMCreateMenuItem(void);
 
1314
 
 
1315
void WMDestroyMenuItem(WMMenuItem *item);
 
1316
 
 
1317
Bool WMGetMenuItemEnabled(WMMenuItem *item);
 
1318
 
 
1319
void WMSetMenuItemEnabled(WMMenuItem *item, Bool flag);
 
1320
 
 
1321
char* WMGetMenuItemShortcut(WMMenuItem *item);
 
1322
 
 
1323
unsigned WMGetMenuItemShortcutModifierMask(WMMenuItem *item);
 
1324
 
 
1325
void WMSetMenuItemShortcut(WMMenuItem *item, char *shortcut);
 
1326
 
 
1327
void WMSetMenuItemShortcutModifierMask(WMMenuItem *item, unsigned mask);
 
1328
 
 
1329
void* WMGetMenuItemRepresentedObject(WMMenuItem *item);
 
1330
 
 
1331
void WMSetMenuItemRepresentedObject(WMMenuItem *item, void *object);
 
1332
 
 
1333
void WMSetMenuItemAction(WMMenuItem *item, WMAction *action, void *data);
 
1334
 
 
1335
WMAction* WMGetMenuItemAction(WMMenuItem *item);
 
1336
 
 
1337
void* WMGetMenuItemData(WMMenuItem *item);
 
1338
 
 
1339
void WMSetMenuItemTitle(WMMenuItem *item, char *title);
 
1340
 
 
1341
char* WMGetMenuItemTitle(WMMenuItem *item);
 
1342
 
 
1343
void WMSetMenuItemState(WMMenuItem *item, int state);
 
1344
 
 
1345
int WMGetMenuItemState(WMMenuItem *item);
 
1346
 
 
1347
void WMSetMenuItemPixmap(WMMenuItem *item, WMPixmap *pixmap);
 
1348
 
 
1349
WMPixmap* WMGetMenuItemPixmap(WMMenuItem *item);
 
1350
 
 
1351
void WMSetMenuItemOnStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
 
1352
 
 
1353
WMPixmap* WMGetMenuItemOnStatePixmap(WMMenuItem *item);
 
1354
 
 
1355
void WMSetMenuItemOffStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
 
1356
 
 
1357
WMPixmap* WMGetMenuItemOffStatePixmap(WMMenuItem *item);
 
1358
 
 
1359
void WMSetMenuItemMixedStatePixmap(WMMenuItem *item, WMPixmap *pixmap);
 
1360
 
 
1361
WMPixmap* WMGetMenuItemMixedStatePixmap(WMMenuItem *item);
 
1362
 
 
1363
/*void WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu);
 
1364
 
 
1365
 
 
1366
WMMenu* WMGetMenuItemSubmenu(WMMenuItem *item);
 
1367
 
 
1368
Bool WMGetMenuItemHasSubmenu(WMMenuItem *item);
 
1369
*/
 
1370
 
 
1371
/* ....................................................................... */
 
1372
 
 
1373
WMPopUpButton* WMCreatePopUpButton(WMWidget *parent);
 
1374
 
 
1375
void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
 
1376
                            void *clientData);
 
1377
 
 
1378
void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
 
1379
 
 
1380
WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
 
1381
 
 
1382
WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
 
1383
                                    char *title);
 
1384
 
 
1385
void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
 
1386
 
 
1387
void WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag);
 
1388
 
 
1389
Bool WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index);
 
1390
 
 
1391
void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
 
1392
 
 
1393
int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
 
1394
 
 
1395
void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
 
1396
 
 
1397
/* don't free the returned data */
 
1398
char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
 
1399
 
 
1400
WMMenuItem* WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index);
 
1401
 
 
1402
int WMGetPopUpButtonNumberOfItems(WMPopUpButton *bPtr);
 
1403
 
 
1404
void WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag);
 
1405
 
 
1406
Bool WMGetPopUpButtonEnabled(WMPopUpButton *bPtr);
 
1407
 
 
1408
/* ....................................................................... */
 
1409
 
 
1410
WMProgressIndicator* WMCreateProgressIndicator(WMWidget *parent);
 
1411
 
 
1412
void WMSetProgressIndicatorMinValue(WMProgressIndicator *progressindicator, int value);
 
1413
 
 
1414
void WMSetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator, int value);
 
1415
 
 
1416
void WMSetProgressIndicatorValue(WMProgressIndicator *progressindicator, int value);
 
1417
 
 
1418
int WMGetProgressIndicatorMinValue(WMProgressIndicator *progressindicator);
 
1419
 
 
1420
int WMGetProgressIndicatorMaxValue(WMProgressIndicator *progressindicator);
 
1421
 
 
1422
int WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator);
 
1423
 
 
1424
 
 
1425
/* ....................................................................... */
 
1426
 
 
1427
WMColorPanel* WMGetColorPanel(WMScreen *scrPtr);
 
1428
 
 
1429
void WMFreeColorPanel(WMColorPanel *panel);
 
1430
 
 
1431
void WMShowColorPanel(WMColorPanel *panel);
 
1432
 
 
1433
void WMCloseColorPanel(WMColorPanel *panel);
 
1434
 
 
1435
void WMSetColorPanelColor(WMColorPanel *panel, WMColor *color);
 
1436
 
 
1437
WMColor* WMGetColorPanelColor(WMColorPanel *panel);
 
1438
 
 
1439
void WMSetColorPanelPickerMode(WMColorPanel *panel, WMColorPanelMode mode);
 
1440
 
 
1441
void WMSetColorPanelAction(WMColorPanel *panel, WMAction2 *action, void *data);
 
1442
 
 
1443
extern char *WMColorPanelColorChangedNotification;
 
1444
 
 
1445
/* ....................................................................... */
 
1446
 
 
1447
WMColorWell* WMCreateColorWell(WMWidget *parent);
 
1448
 
 
1449
void WMSetColorWellColor(WMColorWell *cPtr, WMColor *color);
 
1450
 
 
1451
WMColor* WMGetColorWellColor(WMColorWell *cPtr);
 
1452
 
 
1453
void WSetColorWellBordered(WMColorWell *cPtr, Bool flag);
 
1454
 
 
1455
 
 
1456
extern char *WMColorWellDidChangeNotification;
 
1457
 
 
1458
 
 
1459
/* ...................................................................... */
 
1460
 
 
1461
WMScrollView* WMCreateScrollView(WMWidget *parent);
 
1462
 
 
1463
void WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
 
1464
                               unsigned int height);
 
1465
 
 
1466
void WMSetScrollViewHasHorizontalScroller(WMScrollView *sPtr, Bool flag);
 
1467
 
 
1468
void WMSetScrollViewHasVerticalScroller(WMScrollView *sPtr, Bool flag);
 
1469
 
 
1470
void WMSetScrollViewContentView(WMScrollView *sPtr, WMView *view);
 
1471
 
 
1472
void WMSetScrollViewRelief(WMScrollView *sPtr, WMReliefType type);
 
1473
 
 
1474
WMRect WMGetScrollViewVisibleRect(WMScrollView *sPtr);
 
1475
 
 
1476
WMScroller* WMGetScrollViewHorizontalScroller(WMScrollView *sPtr);
 
1477
 
 
1478
WMScroller* WMGetScrollViewVerticalScroller(WMScrollView *sPtr);
 
1479
 
 
1480
void WMSetScrollViewLineScroll(WMScrollView *sPtr, int amount);
 
1481
 
 
1482
void WMSetScrollViewPageScroll(WMScrollView *sPtr, int amount);
 
1483
 
 
1484
/* ....................................................................... */
 
1485
 
 
1486
WMSlider* WMCreateSlider(WMWidget *parent);
 
1487
 
 
1488
int WMGetSliderMinValue(WMSlider *slider);
 
1489
 
 
1490
int WMGetSliderMaxValue(WMSlider *slider);
 
1491
 
 
1492
int WMGetSliderValue(WMSlider *slider);
 
1493
 
 
1494
void WMSetSliderMinValue(WMSlider *slider, int value);
 
1495
 
 
1496
void WMSetSliderMaxValue(WMSlider *slider, int value);
 
1497
 
 
1498
void WMSetSliderValue(WMSlider *slider, int value);
 
1499
 
 
1500
void WMSetSliderContinuous(WMSlider *slider, Bool flag);
 
1501
 
 
1502
void WMSetSliderAction(WMSlider *slider, WMAction *action, void *data);
 
1503
 
 
1504
void WMSetSliderKnobThickness(WMSlider *sPtr, int thickness);
 
1505
 
 
1506
void WMSetSliderImage(WMSlider *sPtr, WMPixmap *pixmap);
 
1507
 
 
1508
/* ....................................................................... */
 
1509
 
 
1510
 
 
1511
WMSplitView* WMCreateSplitView(WMWidget *parent);
 
1512
 
 
1513
Bool WMGetSplitViewVertical(WMSplitView *sPtr);
 
1514
 
 
1515
void WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag);
 
1516
 
 
1517
int WMGetSplitViewSubviewsCount(WMSplitView *sPtr); /* ??? remove ??? */
 
1518
 
 
1519
WMView* WMGetSplitViewSubviewAt(WMSplitView *sPtr, int index);
 
1520
 
 
1521
/* remove the first subview == view */
 
1522
void WMRemoveSplitViewSubview(WMSplitView *sPtr, WMView *view);
 
1523
 
 
1524
void WMRemoveSplitViewSubviewAt(WMSplitView *sPtr, int index);
 
1525
 
 
1526
 
 
1527
void WMAddSplitViewSubview(WMSplitView *sPtr, WMView *subview);
 
1528
 
 
1529
void WMAdjustSplitViewSubviews(WMSplitView *sPtr);
 
1530
 
 
1531
void WMSetSplitViewConstrainProc(WMSplitView *sPtr,
 
1532
                                 WMSplitViewConstrainProc *proc);
 
1533
 
 
1534
/*
 
1535
void WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
 
1536
                                      WMSplitViewResizeSubviewsProc *proc);
 
1537
*/
 
1538
 
 
1539
int WMGetSplitViewDividerThickness(WMSplitView *sPtr);
 
1540
 
 
1541
/* ...................................................................... */
 
1542
 
 
1543
WMRuler* WMCreateRuler (WMWidget *parent);
 
1544
 
 
1545
WMRulerMargins* WMGetRulerMargins(WMRuler *rPtr);
 
1546
 
 
1547
void WMSetRulerMargins(WMRuler *rPtr, WMRulerMargins margins);
 
1548
 
 
1549
Bool WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin);
 
1550
 
 
1551
int WMGetGrabbedRulerMargin(WMRuler *rPtr);
 
1552
 
 
1553
int WMGetReleasedRulerMargin(WMRuler *rPtr);
 
1554
 
 
1555
int WMGetRulerOffset(WMRuler *rPtr);
 
1556
 
 
1557
void WMSetRulerOffset(WMRuler *rPtr, int pixels);
 
1558
 
 
1559
void WMSetRulerMoveAction(WMRuler *rPtr, WMAction *action, void *clientData);
 
1560
 
 
1561
void WMSetRulerReleaseAction(WMRuler *rPtr, WMAction *action, void *clientData);
 
1562
 
 
1563
/* ....................................................................... */
 
1564
 
 
1565
 
 
1566
#define WMCreateText(parent) WMCreateTextForDocumentType \
 
1567
    ((parent), (NULL), (NULL))
 
1568
 
 
1569
WMText* WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser,
 
1570
                                    WMAction *writer);
 
1571
 
 
1572
void WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate);
 
1573
 
 
1574
void WMFreezeText(WMText *tPtr);
 
1575
 
 
1576
#define WMRefreshText(tPtr) WMThawText((tPtr))
 
1577
 
 
1578
void WMThawText(WMText *tPtr);
 
1579
 
 
1580
int WMScrollText(WMText *tPtr, int amount);
 
1581
 
 
1582
int WMPageText(WMText *tPtr, Bool direction);
 
1583
 
 
1584
void WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave);
 
1585
 
 
1586
void WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave);
 
1587
 
 
1588
void WMSetTextHasRuler(WMText *tPtr, Bool shouldhave);
 
1589
 
 
1590
void WMShowTextRuler(WMText *tPtr, Bool show);
 
1591
 
 
1592
int WMGetTextRulerShown(WMText *tPtr);
 
1593
 
 
1594
void WMSetTextEditable(WMText *tPtr, Bool editable);
 
1595
 
 
1596
int WMGetTextEditable(WMText *tPtr);
 
1597
 
 
1598
void WMSetTextUsesMonoFont(WMText *tPtr, Bool mono);
 
1599
 
 
1600
int WMGetTextUsesMonoFont(WMText *tPtr);
 
1601
 
 
1602
void WMSetTextIndentNewLines(WMText *tPtr, Bool indent);
 
1603
 
 
1604
void WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore);
 
1605
 
 
1606
int WMGetTextIgnoresNewline(WMText *tPtr);
 
1607
 
 
1608
void WMSetTextDefaultFont(WMText *tPtr, WMFont *font);
 
1609
 
 
1610
WMFont* WMGetTextDefaultFont(WMText *tPtr);
 
1611
 
 
1612
void WMSetTextDefaultColor(WMText *tPtr, WMColor *color);
 
1613
 
 
1614
WMColor* WMGetTextDefaultColor(WMText *tPtr);
 
1615
 
 
1616
void WMSetTextRelief(WMText *tPtr, WMReliefType relief);
 
1617
 
 
1618
void WMSetTextForegroundColor(WMText *tPtr, WMColor *color);
 
1619
 
 
1620
void WMSetTextBackgroundColor(WMText *tPtr, WMColor *color);
 
1621
 
 
1622
void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap);
 
1623
 
 
1624
void WMPrependTextStream(WMText *tPtr, char *text);
 
1625
 
 
1626
void WMAppendTextStream(WMText *tPtr, char *text);
 
1627
 
 
1628
#define WMClearText(tPtr) WMAppendTextStream \
 
1629
    ((tPtr), (NULL))
 
1630
 
 
1631
/* free the text */
 
1632
char* WMGetTextStream(WMText *tPtr);
 
1633
 
 
1634
/* free the text */
 
1635
char* WMGetTextSelectedStream(WMText *tPtr);
 
1636
 
 
1637
/* destroy the array */
 
1638
WMArray* WMGetTextObjects(WMText *tPtr);
 
1639
 
 
1640
/* destroy the array */
 
1641
WMArray* WMGetTextSelectedObjects(WMText *tPtr);
 
1642
 
 
1643
void WMSetTextSelectionColor(WMText *tPtr, WMColor *color);
 
1644
 
 
1645
WMColor* WMGetTextSelectionColor(WMText *tPtr);
 
1646
 
 
1647
void WMSetTextSelectionFont(WMText *tPtr, WMFont *font);
 
1648
 
 
1649
WMFont* WMGetTextSelectionFont(WMText *tPtr);
 
1650
 
 
1651
void WMSetTextSelectionUnderlined(WMText *tPtr, int underlined);
 
1652
 
 
1653
int WMGetTextSelectionUnderlined(WMText *tPtr);
 
1654
 
 
1655
void WMSetTextAlignment(WMText *tPtr, WMAlignment alignment);
 
1656
 
 
1657
Bool WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
 
1658
                        Bool caseSensitive);
 
1659
 
 
1660
Bool WMReplaceTextSelection(WMText *tPtr, char *replacement);
 
1661
 
 
1662
 
 
1663
/* parser related stuff... use only if implementing a new parser */
 
1664
 
 
1665
void* WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, char *description,
 
1666
                                  WMColor *color, unsigned short first,
 
1667
                                  unsigned short extraInfo);
 
1668
 
 
1669
void* WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, char *description,
 
1670
                                  WMColor *color, unsigned short first,
 
1671
                                  unsigned short extraInfo);
 
1672
 
 
1673
void* WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font,
 
1674
                                WMColor *color, unsigned short first,
 
1675
                                unsigned short length);
 
1676
 
 
1677
void WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
 
1678
                              unsigned int kanji, unsigned int underlined,
 
1679
                              int script, WMRulerMargins *margins);
 
1680
 
 
1681
/* do NOT free the margins */
 
1682
void WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
 
1683
                              unsigned int *kanji, unsigned int *underlined,
 
1684
                              int *script, WMRulerMargins *margins);
 
1685
 
 
1686
int WMGetTextInsertType(WMText *tPtr);
 
1687
 
 
1688
/*int WMGetTextBlocks(WMText *tPtr);
 
1689
 
 
1690
void WMSetCurrentTextBlock(WMText *tPtr, int current);
 
1691
 
 
1692
int WMGetCurrentTextBlock(WMText *tPtr);*/
 
1693
 
 
1694
void WMPrependTextBlock(WMText *tPtr, void *vtb);
 
1695
 
 
1696
void WMAppendTextBlock(WMText *tPtr, void *vtb);
 
1697
 
 
1698
void* WMRemoveTextBlock(WMText *tPtr);
 
1699
 
 
1700
void WMDestroyTextBlock(WMText *tPtr, void *vtb);
 
1701
 
 
1702
/* ....................................................................... */
 
1703
 
 
1704
 
 
1705
WMTabView* WMCreateTabView(WMWidget *parent);
 
1706
 
 
1707
void WMSetTabViewType(WMTabView *tPtr, WMTabViewType type);
 
1708
 
 
1709
void WMSetTabViewEnabled(WMTabView *tPtr, Bool flag);
 
1710
 
 
1711
void WMSetTabViewFont(WMTabView *tPtr, WMFont *font);
 
1712
 
 
1713
void WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item);
 
1714
 
 
1715
void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
 
1716
 
 
1717
void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
 
1718
 
 
1719
WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
 
1720
                                        int identifier, char *label);
 
1721
 
 
1722
WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
 
1723
 
 
1724
void WMSelectFirstTabViewItem(WMTabView *tPtr);
 
1725
 
 
1726
void WMSelectLastTabViewItem(WMTabView *tPtr);
 
1727
 
 
1728
void WMSelectNextTabViewItem(WMTabView *tPtr);
 
1729
 
 
1730
void WMSelectPreviousTabViewItem(WMTabView *tPtr);
 
1731
 
 
1732
WMTabViewItem* WMGetSelectedTabViewItem(WMTabView *tPtr);
 
1733
 
 
1734
void WMSelectTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
 
1735
 
 
1736
void WMSelectTabViewItemAtIndex(WMTabView *tPtr, int index);
 
1737
 
 
1738
void WMSetTabViewDelegate(WMTabView *tPtr, WMTabViewDelegate *delegate);
 
1739
 
 
1740
 
 
1741
WMTabViewItem* WMCreateTabViewItemWithIdentifier(int identifier);
 
1742
 
 
1743
void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
 
1744
 
 
1745
int WMGetTabViewItemIdentifier(WMTabViewItem *item);
 
1746
 
 
1747
void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
 
1748
 
 
1749
char* WMGetTabViewItemLabel(WMTabViewItem *item);
 
1750
 
 
1751
void WMSetTabViewItemView(WMTabViewItem *item, WMView *view);
 
1752
 
 
1753
WMView* WMGetTabViewItemView(WMTabViewItem *item);
 
1754
 
 
1755
void WMDestroyTabViewItem(WMTabViewItem *item);
 
1756
 
 
1757
 
 
1758
/* ....................................................................... */
 
1759
 
 
1760
WMBox* WMCreateBox(WMWidget *parent);
 
1761
 
 
1762
void WMSetBoxBorderWidth(WMBox *box, unsigned width);
 
1763
 
 
1764
void WMAddBoxSubview(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
 
1765
                     int minSize, int maxSize, int space);
 
1766
 
 
1767
void WMAddBoxSubviewAtEnd(WMBox *bPtr, WMView *view, Bool expand, Bool fill,
 
1768
                          int minSize, int maxSize, int space);
 
1769
 
 
1770
void WMRemoveBoxSubview(WMBox *bPtr, WMView *view);
 
1771
 
 
1772
void WMSetBoxHorizontal(WMBox *box, Bool flag);
 
1773
 
 
1774
/* ....................................................................... */
 
1775
 
 
1776
int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
 
1777
                    char *defaultButton, char *alternateButton,
 
1778
                    char *otherButton);
 
1779
 
 
1780
/* you can free the returned string */
 
1781
char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
 
1782
                      char *defaultText, char *okButton, char *cancelButton);
 
1783
 
 
1784
WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
 
1785
                                 char *msg, char *defaultButton,
 
1786
                                 char *alternateButton, char *otherButton);
 
1787
 
 
1788
WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
 
1789
                                 char *msg, char *defaultText, char *okButton,
 
1790
                                 char *cancelButton);
 
1791
 
 
1792
 
 
1793
WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
 
1794
                                     char *title, char *defaultButton,
 
1795
                                     char *alternateButton);
 
1796
 
 
1797
void WMDestroyAlertPanel(WMAlertPanel *panel);
 
1798
 
 
1799
void WMDestroyInputPanel(WMInputPanel *panel);
 
1800
 
 
1801
void WMDestroyGenericPanel(WMGenericPanel *panel);
 
1802
 
 
1803
/* ....................................................................... */
 
1804
 
 
1805
/* only 1 instance per WMScreen */
 
1806
WMOpenPanel* WMGetOpenPanel(WMScreen *scrPtr);
 
1807
 
 
1808
WMSavePanel* WMGetSavePanel(WMScreen *scrPtr);
 
1809
 
 
1810
void WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag);
 
1811
 
 
1812
void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
 
1813
 
 
1814
void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
 
1815
 
 
1816
void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
 
1817
 
 
1818
/* you can free the returned string */
 
1819
char* WMGetFilePanelFileName(WMFilePanel *panel);
 
1820
 
 
1821
void WMFreeFilePanel(WMFilePanel *panel);
 
1822
 
 
1823
int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
 
1824
                                    char *path, char *name, char **fileTypes);
 
1825
 
 
1826
void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
 
1827
 
 
1828
WMView* WMGetFilePanelAccessoryView(WMFilePanel *panel);
 
1829
 
 
1830
 
 
1831
/* ...................................................................... */
 
1832
 
 
1833
/* only 1 instance per WMScreen */
 
1834
WMFontPanel* WMGetFontPanel(WMScreen *scr);
 
1835
 
 
1836
void WMShowFontPanel(WMFontPanel *panel);
 
1837
 
 
1838
void WMHideFontPanel(WMFontPanel *panel);
 
1839
 
 
1840
void WMFreeFontPanel(WMFontPanel *panel);
 
1841
 
 
1842
void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
 
1843
 
 
1844
void WMSetFontPanelFont(WMFontPanel *panel, char *fontName);
 
1845
 
 
1846
WMFont* WMGetFontPanelFont(WMFontPanel *panel);
 
1847
 
 
1848
#ifdef __cplusplus
 
1849
}
 
1850
#endif /* __cplusplus */
 
1851
 
 
1852
#endif
 
1853