1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
|
/*
* tkMacOSXCursor.c --
*
* This file contains Macintosh specific cursor related routines.
*
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
* Copyright 2001-2009, Apple Inc.
* Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id$
*/
#include "tkMacOSXPrivate.h"
#include "tkMacOSXCursors.h"
#include "tkMacOSXXCursors.h"
/*
* Mac Cursor Types.
*/
#define NONE -1 /* Hidden cursor */
#define SELECTOR 1 /* NSCursor class method */
#define IMAGENAMED 2 /* Named NSImage */
#define IMAGEPATH 3 /* Path to NSImage */
#define IMAGEBITMAP 4 /* Pointer to 16x16 cursor bitmap data */
#define pix 16 /* Pixel width & height of cursor bitmap data */
/*
* The following data structure contains the system specific data necessary to
* control Windows cursors.
*/
typedef struct {
TkCursor info; /* Generic cursor info used by tkCursor.c */
NSCursor *macCursor; /* Macintosh cursor */
int type; /* Type of Mac cursor */
} TkMacOSXCursor;
/*
* The table below is used to map from the name of a predefined cursor
* to a NSCursor.
*/
struct CursorName {
const char *name;
const int kind;
id id1, id2;
NSPoint hotspot;
};
#define MacCursorData(n) ((id)tkMacOSXCursors[TK_MAC_CURSOR_##n])
#define MacXCursorData(n) ((id)tkMacOSXXCursors[TK_MAC_XCURSOR_##n])
static const struct CursorName cursorNames[] = {
{"none", NONE, nil},
{"arrow", SELECTOR, @"arrowCursor"},
{"top_left_arrow", SELECTOR, @"arrowCursor"},
{"left_ptr", SELECTOR, @"arrowCursor"},
{"copyarrow", SELECTOR, @"dragCopyCursor", @"_copyDragCursor"},
{"aliasarrow", SELECTOR, @"dragLinkCursor", @"_linkDragCursor"},
{"contextualmenuarrow", SELECTOR, @"contextualMenuCursor"},
{"movearrow", SELECTOR, @"_moveCursor"},
{"ibeam", SELECTOR, @"IBeamCursor"},
{"text", SELECTOR, @"IBeamCursor"},
{"xterm", SELECTOR, @"IBeamCursor"},
{"cross", SELECTOR, @"crosshairCursor"},
{"crosshair", SELECTOR, @"crosshairCursor"},
{"cross-hair", SELECTOR, @"crosshairCursor"},
{"tcross", SELECTOR, @"crosshairCursor"},
{"hand", SELECTOR, @"openHandCursor"},
{"openhand", SELECTOR, @"openHandCursor"},
{"closedhand", SELECTOR, @"closedHandCursor"},
{"fist", SELECTOR, @"closedHandCursor"},
{"pointinghand", SELECTOR, @"pointingHandCursor"},
{"resize", SELECTOR, @"arrowCursor"},
{"resizeleft", SELECTOR, @"resizeLeftCursor"},
{"resizeright", SELECTOR, @"resizeRightCursor"},
{"resizeleftright", SELECTOR, @"resizeLeftRightCursor"},
{"resizeup", SELECTOR, @"resizeUpCursor"},
{"resizedown", SELECTOR, @"resizeDownCursor"},
{"resizeupdown", SELECTOR, @"resizeUpDownCursor"},
{"resizebottomleft", SELECTOR, @"_bottomLeftResizeCursor"},
{"resizetopleft", SELECTOR, @"_topLeftResizeCursor"},
{"resizebottomright", SELECTOR, @"_bottomRightResizeCursor"},
{"resizetopright", SELECTOR, @"_topRightResizeCursor"},
{"notallowed", SELECTOR, @"operationNotAllowedCursor"},
{"poof", SELECTOR, @"disappearingItemCursor"},
{"wait", SELECTOR, @"busyButClickableCursor"},
{"spinning", SELECTOR, @"busyButClickableCursor"},
{"countinguphand", SELECTOR, @"busyButClickableCursor"},
{"countingdownhand", SELECTOR, @"busyButClickableCursor"},
{"countingupanddownhand", SELECTOR, @"busyButClickableCursor"},
{"help", IMAGENAMED, @"NSHelpCursor", nil, {8, 8}},
// {"hand", IMAGEBITMAP, MacCursorData(hand)},
{"bucket", IMAGEBITMAP, MacCursorData(bucket)},
{"cancel", IMAGEBITMAP, MacCursorData(cancel)},
// {"resize", IMAGEBITMAP, MacCursorData(resize)},
{"eyedrop", IMAGEBITMAP, MacCursorData(eyedrop)},
{"eyedrop-full", IMAGEBITMAP, MacCursorData(eyedrop_full)},
{"zoom-in", IMAGEBITMAP, MacCursorData(zoom_in)},
{"zoom-out", IMAGEBITMAP, MacCursorData(zoom_out)},
{"X_cursor", IMAGEBITMAP, MacXCursorData(X_cursor)},
// {"arrow", IMAGEBITMAP, MacXCursorData(arrow)},
{"based_arrow_down", IMAGEBITMAP, MacXCursorData(based_arrow_down)},
{"based_arrow_up", IMAGEBITMAP, MacXCursorData(based_arrow_up)},
{"boat", IMAGEBITMAP, MacXCursorData(boat)},
{"bogosity", IMAGEBITMAP, MacXCursorData(bogosity)},
{"bottom_left_corner", IMAGEBITMAP, MacXCursorData(bottom_left_corner)},
{"bottom_right_corner", IMAGEBITMAP, MacXCursorData(bottom_right_corner)},
{"bottom_side", IMAGEBITMAP, MacXCursorData(bottom_side)},
{"bottom_tee", IMAGEBITMAP, MacXCursorData(bottom_tee)},
{"box_spiral", IMAGEBITMAP, MacXCursorData(box_spiral)},
{"center_ptr", IMAGEBITMAP, MacXCursorData(center_ptr)},
{"circle", IMAGEBITMAP, MacXCursorData(circle)},
{"clock", IMAGEBITMAP, MacXCursorData(clock)},
{"coffee_mug", IMAGEBITMAP, MacXCursorData(coffee_mug)},
// {"cross", IMAGEBITMAP, MacXCursorData(cross)},
{"cross_reverse", IMAGEBITMAP, MacXCursorData(cross_reverse)},
// {"crosshair", IMAGEBITMAP, MacXCursorData(crosshair)},
{"diamond_cross", IMAGEBITMAP, MacXCursorData(diamond_cross)},
{"dot", IMAGEBITMAP, MacXCursorData(dot)},
{"dotbox", IMAGEBITMAP, MacXCursorData(dotbox)},
{"double_arrow", IMAGEBITMAP, MacXCursorData(double_arrow)},
{"draft_large", IMAGEBITMAP, MacXCursorData(draft_large)},
{"draft_small", IMAGEBITMAP, MacXCursorData(draft_small)},
{"draped_box", IMAGEBITMAP, MacXCursorData(draped_box)},
{"exchange", IMAGEBITMAP, MacXCursorData(exchange)},
{"fleur", IMAGEBITMAP, MacXCursorData(fleur)},
{"gobbler", IMAGEBITMAP, MacXCursorData(gobbler)},
{"gumby", IMAGEBITMAP, MacXCursorData(gumby)},
{"hand1", IMAGEBITMAP, MacXCursorData(hand1)},
{"hand2", IMAGEBITMAP, MacXCursorData(hand2)},
{"heart", IMAGEBITMAP, MacXCursorData(heart)},
{"icon", IMAGEBITMAP, MacXCursorData(icon)},
{"iron_cross", IMAGEBITMAP, MacXCursorData(iron_cross)},
// {"left_ptr", IMAGEBITMAP, MacXCursorData(left_ptr)},
{"left_side", IMAGEBITMAP, MacXCursorData(left_side)},
{"left_tee", IMAGEBITMAP, MacXCursorData(left_tee)},
{"leftbutton", IMAGEBITMAP, MacXCursorData(leftbutton)},
{"ll_angle", IMAGEBITMAP, MacXCursorData(ll_angle)},
{"lr_angle", IMAGEBITMAP, MacXCursorData(lr_angle)},
{"man", IMAGEBITMAP, MacXCursorData(man)},
{"middlebutton", IMAGEBITMAP, MacXCursorData(middlebutton)},
{"mouse", IMAGEBITMAP, MacXCursorData(mouse)},
{"pencil", IMAGEBITMAP, MacXCursorData(pencil)},
{"pirate", IMAGEBITMAP, MacXCursorData(pirate)},
{"plus", IMAGEBITMAP, MacXCursorData(plus)},
{"question_arrow", IMAGEBITMAP, MacXCursorData(question_arrow)},
{"right_ptr", IMAGEBITMAP, MacXCursorData(right_ptr)},
{"right_side", IMAGEBITMAP, MacXCursorData(right_side)},
{"right_tee", IMAGEBITMAP, MacXCursorData(right_tee)},
{"rightbutton", IMAGEBITMAP, MacXCursorData(rightbutton)},
{"rtl_logo", IMAGEBITMAP, MacXCursorData(rtl_logo)},
{"sailboat", IMAGEBITMAP, MacXCursorData(sailboat)},
{"sb_down_arrow", IMAGEBITMAP, MacXCursorData(sb_down_arrow)},
{"sb_h_double_arrow", IMAGEBITMAP, MacXCursorData(sb_h_double_arrow)},
{"sb_left_arrow", IMAGEBITMAP, MacXCursorData(sb_left_arrow)},
{"sb_right_arrow", IMAGEBITMAP, MacXCursorData(sb_right_arrow)},
{"sb_up_arrow", IMAGEBITMAP, MacXCursorData(sb_up_arrow)},
{"sb_v_double_arrow", IMAGEBITMAP, MacXCursorData(sb_v_double_arrow)},
{"shuttle", IMAGEBITMAP, MacXCursorData(shuttle)},
{"sizing", IMAGEBITMAP, MacXCursorData(sizing)},
{"spider", IMAGEBITMAP, MacXCursorData(spider)},
{"spraycan", IMAGEBITMAP, MacXCursorData(spraycan)},
{"star", IMAGEBITMAP, MacXCursorData(star)},
{"target", IMAGEBITMAP, MacXCursorData(target)},
// {"tcross", IMAGEBITMAP, MacXCursorData(tcross)},
// {"top_left_arrow", IMAGEBITMAP, MacXCursorData(top_left_arrow)},
{"top_left_corner", IMAGEBITMAP, MacXCursorData(top_left_corner)},
{"top_right_corner", IMAGEBITMAP, MacXCursorData(top_right_corner)},
{"top_side", IMAGEBITMAP, MacXCursorData(top_side)},
{"top_tee", IMAGEBITMAP, MacXCursorData(top_tee)},
{"trek", IMAGEBITMAP, MacXCursorData(trek)},
{"ul_angle", IMAGEBITMAP, MacXCursorData(ul_angle)},
{"umbrella", IMAGEBITMAP, MacXCursorData(umbrella)},
{"ur_angle", IMAGEBITMAP, MacXCursorData(ur_angle)},
{"watch", IMAGEBITMAP, MacXCursorData(watch)},
// {"xterm", IMAGEBITMAP, MacXCursorData(xterm)},
{NULL}
};
/*
* Declarations of static variables used in this file.
*/
static TkMacOSXCursor * gCurrentCursor = NULL;
/* A pointer to the current cursor. */
static int gResizeOverride = false;
/* A boolean indicating whether we should use
* the resize cursor during installations. */
static int gTkOwnsCursor = true;/* A boolean indicating whether Tk owns the
* cursor. If not (for instance, in the case
* where a Tk window is embedded in another
* app's window, and the cursor is out of the
* tk window, we will not attempt to adjust
* the cursor. */
/*
* Declarations of procedures local to this file
*/
static void FindCursorByName(TkMacOSXCursor *macCursorPtr, const char *string);
/*
*----------------------------------------------------------------------
*
* FindCursorByName --
*
* Retrieve a system cursor by name, and fill the macCursorPtr
* structure. If the cursor cannot be found, the macCursor field
* will be nil.
*
* Results:
* Fills the macCursorPtr record.
*
* Side effects:
* None
*
*----------------------------------------------------------------------
*/
void
FindCursorByName(
TkMacOSXCursor *macCursorPtr,
const char *name)
{
NSString *path = nil;
NSImage *image = nil;
NSPoint hotSpot = NSZeroPoint;
int haveHotSpot = 0, result = TCL_ERROR;
NSCursor *macCursor = nil;
if (name[0] == '@') {
/*
* System cursor of type @filename
*/
macCursorPtr->type = IMAGEPATH;
path = [NSString stringWithUTF8String:&name[1]];
} else {
Tcl_Obj *strPtr = Tcl_NewStringObj(name, -1);
int idx;
result = Tcl_GetIndexFromObjStruct(NULL, strPtr, cursorNames,
sizeof(struct CursorName), NULL, TCL_EXACT, &idx);
Tcl_DecrRefCount(strPtr);
if (result == TCL_OK) {
macCursorPtr->type = cursorNames[idx].kind;
switch (cursorNames[idx].kind) {
case SELECTOR: {
SEL selector = NSSelectorFromString(cursorNames[idx].id1);
if ([NSCursor respondsToSelector:selector]) {
macCursor = [[NSCursor performSelector:selector] retain];
} else if (cursorNames[idx].id2) {
selector = NSSelectorFromString(cursorNames[idx].id2);
if ([NSCursor respondsToSelector:selector]) {
macCursor = [[NSCursor performSelector:selector] retain];
}
}
break;
}
case IMAGENAMED:
image = [[NSImage imageNamed:cursorNames[idx].id1] retain];
hotSpot = cursorNames[idx].hotspot;
haveHotSpot = 1;
break;
case IMAGEPATH:
path = [NSApp tkFrameworkImagePath:cursorNames[idx].id1];
break;
case IMAGEBITMAP: {
unsigned char *bitmap = (unsigned char *)(cursorNames[idx].id1);
NSBitmapImageRep *bitmapImageRep = NULL;
CGImageRef img = NULL, mask = NULL, maskedImg = NULL;
static const CGFloat decodeWB[] = {1, 0};
CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(
kCGColorSpaceGenericGray);
CGDataProviderRef provider = CGDataProviderCreateWithData(NULL,
bitmap, pix*pix/8, NULL);
if (provider) {
img = CGImageCreate(pix, pix, 1, 1, pix/8, colorspace,
kCGBitmapByteOrderDefault, provider, decodeWB, 0,
kCGRenderingIntentDefault);
CFRelease(provider);
}
provider = CGDataProviderCreateWithData(NULL, bitmap +
pix*pix/8, pix*pix/8, NULL);
if (provider) {
mask = CGImageMaskCreate(pix, pix, 1, 1, pix/8, provider,
decodeWB, 0);
CFRelease(provider);
}
if (img && mask) {
maskedImg = CGImageCreateWithMask(img, mask);
}
if (maskedImg) {
bitmapImageRep = [[NSBitmapImageRep alloc]
initWithCGImage:maskedImg];
CFRelease(maskedImg);
}
if (mask) { CFRelease(mask); }
if (img) { CFRelease(img); }
if (colorspace) { CFRelease(colorspace); }
if (bitmapImageRep) {
image = [[NSImage alloc] initWithSize:NSMakeSize(pix, pix)];
[image addRepresentation:bitmapImageRep];
[bitmapImageRep release];
}
uint16_t *hotSpotData = (uint16_t*)(bitmap + 2*pix*pix/8);
hotSpot.y = CFSwapInt16BigToHost(*hotSpotData++);
hotSpot.x = CFSwapInt16BigToHost(*hotSpotData);
haveHotSpot = 1;
break;
}
}
}
}
if (path) {
image = [[NSImage alloc] initWithContentsOfFile:path];
}
if (!image && !macCursor && result != TCL_OK) {
macCursorPtr->type = IMAGENAMED;
image = [[NSImage imageNamed:[NSString stringWithUTF8String:name]]
retain];
haveHotSpot = 0;
}
if (image) {
if (!haveHotSpot && [[path pathExtension] isEqualToString:@"cur"]) {
NSData *data = [NSData dataWithContentsOfFile:path];
if ([data length] > 14) {
uint16_t *hotSpotData = (uint16_t*)((char*) [data bytes] + 10);
hotSpot.x = CFSwapInt16LittleToHost(*hotSpotData++);
hotSpot.y = CFSwapInt16LittleToHost(*hotSpotData);
haveHotSpot = 1;
}
}
if (!haveHotSpot) {
NSSize size = [image size];
hotSpot.x = size.width * 0.5;
hotSpot.y = size.height * 0.5;
}
hotSpot.y = -hotSpot.y;
macCursor = [[NSCursor alloc] initWithImage:image hotSpot:hotSpot];
[image release];
}
macCursorPtr->macCursor = TkMacOSXMakeUncollectable(macCursor);
}
/*
*----------------------------------------------------------------------
*
* TkGetCursorByName --
*
* Retrieve a system cursor by name.
*
* Results:
* Returns a new cursor, or NULL on errors.
*
* Side effects:
* Allocates a new cursor.
*
*----------------------------------------------------------------------
*/
TkCursor *
TkGetCursorByName(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tk_Window tkwin, /* Window in which cursor will be used. */
Tk_Uid string) /* Description of cursor. See manual entry
* for details on legal syntax. */
{
TkMacOSXCursor *macCursorPtr = NULL;
const char **argv = NULL;
int argc;
/*
* All cursor names are valid lists of one element (for
* TkX11-compatibility), even unadorned system cursor names.
*/
if (Tcl_SplitList(interp, string, &argc, &argv) == TCL_OK) {
if (argc) {
macCursorPtr = (TkMacOSXCursor *) ckalloc(sizeof(TkMacOSXCursor));
macCursorPtr->info.cursor = (Tk_Cursor) macCursorPtr;
macCursorPtr->macCursor = nil;
macCursorPtr->type = 0;
FindCursorByName(macCursorPtr, argv[0]);
}
ckfree((char *) argv);
}
if (!macCursorPtr || (!macCursorPtr->macCursor &&
macCursorPtr->type != NONE)) {
Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"", NULL);
if (macCursorPtr) {
ckfree((char *)macCursorPtr);
macCursorPtr = NULL;
}
}
return (TkCursor *) macCursorPtr;
}
/*
*----------------------------------------------------------------------
*
* TkCreateCursorFromData --
*
* Creates a cursor from the source and mask bits.
*
* Results:
* Returns a new cursor, or NULL on errors.
*
* Side effects:
* Allocates a new cursor.
*
*----------------------------------------------------------------------
*/
TkCursor *
TkCreateCursorFromData(
Tk_Window tkwin, /* Window in which cursor will be used. */
const char *source, /* Bitmap data for cursor shape. */
const char *mask, /* Bitmap data for cursor mask. */
int width, int height, /* Dimensions of cursor. */
int xHot, int yHot, /* Location of hot-spot in cursor. */
XColor fgColor, /* Foreground color for cursor. */
XColor bgColor) /* Background color for cursor. */
{
return NULL;
}
/*
*----------------------------------------------------------------------
*
* TkpFreeCursor --
*
* This procedure is called to release a cursor allocated by
* TkGetCursorByName.
*
* Results:
* None.
*
* Side effects:
* The cursor data structure is deallocated.
*
*----------------------------------------------------------------------
*/
void
TkpFreeCursor(
TkCursor *cursorPtr)
{
TkMacOSXCursor *macCursorPtr = (TkMacOSXCursor *) cursorPtr;
TkMacOSXMakeCollectableAndRelease(macCursorPtr->macCursor);
if (macCursorPtr == gCurrentCursor) {
gCurrentCursor = NULL;
}
}
/*
*----------------------------------------------------------------------
*
* TkMacOSXInstallCursor --
*
* Installs either the current cursor as defined by TkpSetCursor or a
* resize cursor as the cursor the Macintosh should currently display.
*
* Results:
* None.
*
* Side effects:
* Changes the Macintosh mouse cursor.
*
*----------------------------------------------------------------------
*/
void
TkMacOSXInstallCursor(
int resizeOverride)
{
TkMacOSXCursor *macCursorPtr = gCurrentCursor;
static int cursorHidden = 0;
int cursorNone = 0;
gResizeOverride = resizeOverride;
if (resizeOverride || !macCursorPtr) {
[[NSCursor arrowCursor] set];
} else {
switch (macCursorPtr->type) {
case NONE:
if (!cursorHidden) {
cursorHidden = 1;
[NSCursor hide];
}
cursorNone = 1;
break;
case SELECTOR:
case IMAGENAMED:
case IMAGEPATH:
case IMAGEBITMAP:
default:
[macCursorPtr->macCursor set];
break;
}
}
if (cursorHidden && !cursorNone) {
cursorHidden = 0;
[NSCursor unhide];
}
}
/*
*----------------------------------------------------------------------
*
* TkpSetCursor --
*
* Set the current cursor and install it.
*
* Results:
* None.
*
* Side effects:
* Changes the current cursor.
*
*----------------------------------------------------------------------
*/
void
TkpSetCursor(
TkpCursor cursor)
{
int cursorChanged = 1;
if (!gTkOwnsCursor) {
return;
}
if (cursor == None) {
/*
* This is a little tricky. We can't really tell whether
* gCurrentCursor is NULL because it was NULL last time around or
* because we just freed the current cursor. So if the input cursor is
* NULL, we always need to reset it, we can't trust the cursorChanged
* logic.
*/
gCurrentCursor = NULL;
} else {
if (gCurrentCursor == (TkMacOSXCursor *) cursor) {
cursorChanged = 0;
}
gCurrentCursor = (TkMacOSXCursor *) cursor;
}
if (Tk_MacOSXIsAppInFront() && cursorChanged) {
TkMacOSXInstallCursor(gResizeOverride);
}
}
/*
*----------------------------------------------------------------------
*
* Tk_MacOSXTkOwnsCursor --
*
* Sets whether Tk has the right to adjust the cursor.
*
* Results:
* None.
*
* Side effects:
* May keep Tk from changing the cursor.
*
*----------------------------------------------------------------------
*/
void
Tk_MacOSXTkOwnsCursor(
int tkOwnsIt)
{
gTkOwnsCursor = tkOwnsIt;
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 79
* coding: utf-8
* End:
*/
|