Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 222859 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse SWT PI/cocoa/library/os.c (+68 lines)
Lines 1290-1295 Link Here
1290
}
1290
}
1291
#endif
1291
#endif
1292
1292
1293
#ifndef NO_CGContextBeginTransparencyLayerWithRect
1294
JNIEXPORT void JNICALL OS_NATIVE(CGContextBeginTransparencyLayerWithRect)
1295
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1, jintLong arg2)
1296
{
1297
	CGRect _arg1, *lparg1=NULL;
1298
	OS_NATIVE_ENTER(env, that, CGContextBeginTransparencyLayerWithRect_FUNC);
1299
	if (arg1) if ((lparg1 = getCGRectFields(env, arg1, &_arg1)) == NULL) goto fail;
1300
	CGContextBeginTransparencyLayerWithRect((CGContextRef)arg0, *lparg1, (CFDictionaryRef)arg2);
1301
fail:
1302
	if (arg1 && lparg1) setCGRectFields(env, arg1, lparg1);
1303
	OS_NATIVE_EXIT(env, that, CGContextBeginTransparencyLayerWithRect_FUNC);
1304
}
1305
#endif
1306
1293
#ifndef NO_CGContextCopyPath
1307
#ifndef NO_CGContextCopyPath
1294
JNIEXPORT jintLong JNICALL OS_NATIVE(CGContextCopyPath)
1308
JNIEXPORT jintLong JNICALL OS_NATIVE(CGContextCopyPath)
1295
	(JNIEnv *env, jclass that, jintLong arg0)
1309
	(JNIEnv *env, jclass that, jintLong arg0)
Lines 1349-1354 Link Here
1349
}
1363
}
1350
#endif
1364
#endif
1351
1365
1366
#ifndef NO_CGContextEndTransparencyLayer
1367
JNIEXPORT void JNICALL OS_NATIVE(CGContextEndTransparencyLayer)
1368
	(JNIEnv *env, jclass that, jintLong arg0)
1369
{
1370
	OS_NATIVE_ENTER(env, that, CGContextEndTransparencyLayer_FUNC);
1371
	CGContextEndTransparencyLayer((CGContextRef)arg0);
1372
	OS_NATIVE_EXIT(env, that, CGContextEndTransparencyLayer_FUNC);
1373
}
1374
#endif
1375
1352
#ifndef NO_CGContextFillRect
1376
#ifndef NO_CGContextFillRect
1353
JNIEXPORT void JNICALL OS_NATIVE(CGContextFillRect)
1377
JNIEXPORT void JNICALL OS_NATIVE(CGContextFillRect)
1354
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
1378
	(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
Lines 4911-4916 Link Here
4911
}
4935
}
4912
#endif
4936
#endif
4913
4937
4938
#ifndef NO_NSRectFillUsingOperation
4939
JNIEXPORT void JNICALL OS_NATIVE(NSRectFillUsingOperation)
4940
	(JNIEnv *env, jclass that, jobject arg0, jintLong arg1)
4941
{
4942
	NSRect _arg0, *lparg0=NULL;
4943
	OS_NATIVE_ENTER(env, that, NSRectFillUsingOperation_FUNC);
4944
	if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
4945
	NSRectFillUsingOperation(*lparg0, (NSCompositingOperation)arg1);
4946
fail:
4947
	if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
4948
	OS_NATIVE_EXIT(env, that, NSRectFillUsingOperation_FUNC);
4949
}
4950
#endif
4951
4914
#ifndef NO_NSRect_1sizeof
4952
#ifndef NO_NSRect_1sizeof
4915
JNIEXPORT jint JNICALL OS_NATIVE(NSRect_1sizeof)
4953
JNIEXPORT jint JNICALL OS_NATIVE(NSRect_1sizeof)
4916
	(JNIEnv *env, jclass that)
4954
	(JNIEnv *env, jclass that)
Lines 9440-9445 Link Here
9440
}
9478
}
9441
#endif
9479
#endif
9442
9480
9481
#if (!defined(NO_objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2) && !defined(JNI64)) || (!defined(NO_objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2) && defined(JNI64))
9482
#ifndef JNI64
9483
JNIEXPORT jboolean JNICALL OS_NATIVE(objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2, jobject arg3)
9484
#else
9485
JNIEXPORT jboolean JNICALL OS_NATIVE(objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2, jobject arg3)
9486
#endif
9487
{
9488
	NSPoint _arg2, *lparg2=NULL;
9489
	NSRect _arg3, *lparg3=NULL;
9490
	jboolean rc = 0;
9491
#ifndef JNI64
9492
	OS_NATIVE_ENTER(env, that, objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
9493
#else
9494
	OS_NATIVE_ENTER(env, that, objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
9495
#endif
9496
	if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
9497
	if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
9498
	rc = (jboolean)((BOOL (*)(jintLong, jintLong, NSPoint, NSRect))objc_msgSend_bool)(arg0, arg1, *lparg2, *lparg3);
9499
fail:
9500
	if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
9501
	if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
9502
#ifndef JNI64
9503
	OS_NATIVE_EXIT(env, that, objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
9504
#else
9505
	OS_NATIVE_EXIT(env, that, objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
9506
#endif
9507
	return rc;
9508
}
9509
#endif
9510
9443
#if (!defined(NO_objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I) && !defined(JNI64)) || (!defined(NO_objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J) && defined(JNI64))
9511
#if (!defined(NO_objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I) && !defined(JNI64)) || (!defined(NO_objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J) && defined(JNI64))
9444
#ifndef JNI64
9512
#ifndef JNI64
9445
JNIEXPORT jboolean JNICALL OS_NATIVE(objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2, jintLong arg3)
9513
JNIEXPORT jboolean JNICALL OS_NATIVE(objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jobject arg2, jintLong arg3)
(-)Eclipse SWT PI/cocoa/library/os_stats.c (-2 / +10 lines)
Lines 14-21 Link Here
14
14
15
#ifdef NATIVE_STATS
15
#ifdef NATIVE_STATS
16
16
17
int OS_nativeFunctionCount = 610;
17
int OS_nativeFunctionCount = 614;
18
int OS_nativeFunctionCallCount[610];
18
int OS_nativeFunctionCallCount[614];
19
char * OS_nativeFunctionNames[] = {
19
char * OS_nativeFunctionNames[] = {
20
	"ATSFontActivateFromFileReference",
20
	"ATSFontActivateFromFileReference",
21
	"AcquireRootMenu",
21
	"AcquireRootMenu",
Lines 85-93 Link Here
85
	"CGColorSpaceCreateDeviceRGB",
85
	"CGColorSpaceCreateDeviceRGB",
86
	"CGColorSpaceRelease",
86
	"CGColorSpaceRelease",
87
	"CGContextAddPath",
87
	"CGContextAddPath",
88
	"CGContextBeginTransparencyLayerWithRect",
88
	"CGContextCopyPath",
89
	"CGContextCopyPath",
89
	"CGContextCopyWindowContentsToRect",
90
	"CGContextCopyWindowContentsToRect",
90
	"CGContextDrawImage",
91
	"CGContextDrawImage",
92
	"CGContextEndTransparencyLayer",
91
	"CGContextFillRect",
93
	"CGContextFillRect",
92
	"CGContextRelease",
94
	"CGContextRelease",
93
	"CGContextReplacePathWithStrokedPath",
95
	"CGContextReplacePathWithStrokedPath",
Lines 375-380 Link Here
375
	"NSPrintSpoolJob",
377
	"NSPrintSpoolJob",
376
	"NSRTFPboardType",
378
	"NSRTFPboardType",
377
	"NSRange_1sizeof",
379
	"NSRange_1sizeof",
380
	"NSRectFillUsingOperation",
378
	"NSRect_1sizeof",
381
	"NSRect_1sizeof",
379
	"NSSearchPathForDirectoriesInDomains",
382
	"NSSearchPathForDirectoriesInDomains",
380
	"NSSize_1sizeof",
383
	"NSSize_1sizeof",
Lines 1081-1086 Link Here
1081
	"objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2",
1084
	"objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2",
1082
#endif
1085
#endif
1083
#ifndef JNI64
1086
#ifndef JNI64
1087
	"objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2",
1088
#else
1089
	"objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2",
1090
#endif
1091
#ifndef JNI64
1084
	"objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I",
1092
	"objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I",
1085
#else
1093
#else
1086
	"objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J",
1094
	"objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J",
(-)Eclipse SWT PI/cocoa/library/os_stats.h (+8 lines)
Lines 93-101 Link Here
93
	CGColorSpaceCreateDeviceRGB_FUNC,
93
	CGColorSpaceCreateDeviceRGB_FUNC,
94
	CGColorSpaceRelease_FUNC,
94
	CGColorSpaceRelease_FUNC,
95
	CGContextAddPath_FUNC,
95
	CGContextAddPath_FUNC,
96
	CGContextBeginTransparencyLayerWithRect_FUNC,
96
	CGContextCopyPath_FUNC,
97
	CGContextCopyPath_FUNC,
97
	CGContextCopyWindowContentsToRect_FUNC,
98
	CGContextCopyWindowContentsToRect_FUNC,
98
	CGContextDrawImage_FUNC,
99
	CGContextDrawImage_FUNC,
100
	CGContextEndTransparencyLayer_FUNC,
99
	CGContextFillRect_FUNC,
101
	CGContextFillRect_FUNC,
100
	CGContextRelease_FUNC,
102
	CGContextRelease_FUNC,
101
	CGContextReplacePathWithStrokedPath_FUNC,
103
	CGContextReplacePathWithStrokedPath_FUNC,
Lines 383-388 Link Here
383
	NSPrintSpoolJob_FUNC,
385
	NSPrintSpoolJob_FUNC,
384
	NSRTFPboardType_FUNC,
386
	NSRTFPboardType_FUNC,
385
	NSRange_1sizeof_FUNC,
387
	NSRange_1sizeof_FUNC,
388
	NSRectFillUsingOperation_FUNC,
386
	NSRect_1sizeof_FUNC,
389
	NSRect_1sizeof_FUNC,
387
	NSSearchPathForDirectoriesInDomains_FUNC,
390
	NSSearchPathForDirectoriesInDomains_FUNC,
388
	NSSize_1sizeof_FUNC,
391
	NSSize_1sizeof_FUNC,
Lines 1089-1094 Link Here
1089
	objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
1092
	objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
1090
#endif
1093
#endif
1091
#ifndef JNI64
1094
#ifndef JNI64
1095
	objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
1096
#else
1097
	objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
1098
#endif
1099
#ifndef JNI64
1092
	objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
1100
	objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
1093
#else
1101
#else
1094
	objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J_FUNC,
1102
	objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J_FUNC,
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras (+35 lines)
Lines 650-655 Link Here
650
			<arg swt_gen="true"></arg>
650
			<arg swt_gen="true"></arg>
651
			<retval swt_gen="true"></retval>
651
			<retval swt_gen="true"></retval>
652
		</method>
652
		</method>
653
		<method selector="setHighlightsBy:" swt_gen="true">
654
			<arg swt_gen="true"></arg>
655
			<retval swt_gen="true"></retval>
656
		</method>
653
		<method selector="setImagePosition:" swt_gen="true">
657
		<method selector="setImagePosition:" swt_gen="true">
654
			<arg swt_gen="true"></arg>
658
			<arg swt_gen="true"></arg>
655
			<retval swt_gen="true"></retval>
659
			<retval swt_gen="true"></retval>
Lines 742-747 Link Here
742
			<arg swt_gen="true"></arg>
746
			<arg swt_gen="true"></arg>
743
			<retval swt_gen="true"></retval>
747
			<retval swt_gen="true"></retval>
744
		</method>
748
		</method>
749
		<method selector="setBackgroundStyle:" swt_gen="true">
750
			<arg swt_gen="true"></arg>
751
			<retval swt_gen="true"></retval>
752
		</method>
745
		<method selector="setBaseWritingDirection:" swt_gen="true">
753
		<method selector="setBaseWritingDirection:" swt_gen="true">
746
			<arg swt_gen="true"></arg>
754
			<arg swt_gen="true"></arg>
747
			<retval swt_gen="true"></retval>
755
			<retval swt_gen="true"></retval>
Lines 3547-3552 Link Here
3547
			<arg swt_gen="true"></arg>
3555
			<arg swt_gen="true"></arg>
3548
			<retval swt_gen="true"></retval>
3556
			<retval swt_gen="true"></retval>
3549
		</method>
3557
		</method>
3558
		<method selector="isVisible" swt_gen="true">
3559
			<retval swt_gen="true"></retval>
3560
		</method>
3550
		<method selector="removeItemAtIndex:" swt_gen="true">
3561
		<method selector="removeItemAtIndex:" swt_gen="true">
3551
			<arg swt_gen="true"></arg>
3562
			<arg swt_gen="true"></arg>
3552
			<retval swt_gen="true"></retval>
3563
			<retval swt_gen="true"></retval>
Lines 3563-3568 Link Here
3563
			<arg swt_gen="true"></arg>
3574
			<arg swt_gen="true"></arg>
3564
			<retval swt_gen="true"></retval>
3575
			<retval swt_gen="true"></retval>
3565
		</method>
3576
		</method>
3577
		<method selector="setSelectedItemIdentifier:" swt_gen="true">
3578
			<arg swt_gen="true"></arg>
3579
			<retval swt_gen="true"></retval>
3580
		</method>
3566
		<method selector="setVisible:" swt_gen="true">
3581
		<method selector="setVisible:" swt_gen="true">
3567
			<arg swt_gen="true"></arg>
3582
			<arg swt_gen="true"></arg>
3568
			<retval swt_gen="true"></retval>
3583
			<retval swt_gen="true"></retval>
Lines 3596-3601 Link Here
3596
			<arg swt_gen="true"></arg>
3611
			<arg swt_gen="true"></arg>
3597
			<retval swt_gen="true"></retval>
3612
			<retval swt_gen="true"></retval>
3598
		</method>
3613
		</method>
3614
		<method selector="setMenuFormRepresentation:" swt_gen="true">
3615
			<arg swt_gen="true"></arg>
3616
			<retval swt_gen="true"></retval>
3617
		</method>
3599
		<method selector="setMinSize:" swt_gen="true">
3618
		<method selector="setMinSize:" swt_gen="true">
3600
			<arg swt_gen="true"></arg>
3619
			<arg swt_gen="true"></arg>
3601
			<retval swt_gen="true"></retval>
3620
			<retval swt_gen="true"></retval>
Lines 3808-3813 Link Here
3808
			<arg swt_gen="true"></arg>
3827
			<arg swt_gen="true"></arg>
3809
			<retval swt_gen="true"></retval>
3828
			<retval swt_gen="true"></retval>
3810
		</method>
3829
		</method>
3830
		<method selector="mouse:inRect:" swt_gen="true">
3831
			<arg swt_gen="true"></arg>
3832
			<arg swt_gen="true"></arg>
3833
			<retval swt_gen="true"></retval>
3834
		</method>
3835
		<method selector="mouseDownCanMoveWindow" swt_gen="true">
3836
			<retval swt_gen="true"></retval>
3837
		</method>
3811
		<method selector="registerForDraggedTypes:" swt_gen="true">
3838
		<method selector="registerForDraggedTypes:" swt_gen="true">
3812
			<arg swt_gen="true"></arg>
3839
			<arg swt_gen="true"></arg>
3813
			<retval swt_gen="true"></retval>
3840
			<retval swt_gen="true"></retval>
Lines 4460-4465 Link Here
4460
	<enum name="NSApplicationDefined" swt_gen="true"></enum>
4487
	<enum name="NSApplicationDefined" swt_gen="true"></enum>
4461
	<enum name="NSApplicationDelegateReplySuccess" swt_gen="true"></enum>
4488
	<enum name="NSApplicationDelegateReplySuccess" swt_gen="true"></enum>
4462
	<enum name="NSAtTop" swt_gen="true"></enum>
4489
	<enum name="NSAtTop" swt_gen="true"></enum>
4490
	<enum name="NSBackgroundStyleRaised" swt_gen="true"></enum>
4463
	<enum name="NSBackingStoreBuffered" swt_gen="true"></enum>
4491
	<enum name="NSBackingStoreBuffered" swt_gen="true"></enum>
4464
	<enum name="NSBackspaceCharacter" swt_gen="true"></enum>
4492
	<enum name="NSBackspaceCharacter" swt_gen="true"></enum>
4465
	<enum name="NSBevelLineJoinStyle" swt_gen="true"></enum>
4493
	<enum name="NSBevelLineJoinStyle" swt_gen="true"></enum>
Lines 4479-4486 Link Here
4479
	<enum name="NSCommandKeyMask" swt_gen="true"></enum>
4507
	<enum name="NSCommandKeyMask" swt_gen="true"></enum>
4480
	<enum name="NSCompositeClear" swt_gen="true"></enum>
4508
	<enum name="NSCompositeClear" swt_gen="true"></enum>
4481
	<enum name="NSCompositeCopy" swt_gen="true"></enum>
4509
	<enum name="NSCompositeCopy" swt_gen="true"></enum>
4510
	<enum name="NSCompositeSourceAtop" swt_gen="true"></enum>
4482
	<enum name="NSCompositeSourceOver" swt_gen="true"></enum>
4511
	<enum name="NSCompositeSourceOver" swt_gen="true"></enum>
4483
	<enum name="NSCompositeXOR" swt_gen="true"></enum>
4512
	<enum name="NSCompositeXOR" swt_gen="true"></enum>
4513
	<enum name="NSContentsCellMask" swt_gen="true"></enum>
4484
	<enum name="NSControlKeyMask" swt_gen="true"></enum>
4514
	<enum name="NSControlKeyMask" swt_gen="true"></enum>
4485
	<enum name="NSCriticalAlertStyle" swt_gen="true"></enum>
4515
	<enum name="NSCriticalAlertStyle" swt_gen="true"></enum>
4486
	<enum name="NSCurveToBezierPathElement" swt_gen="true"></enum>
4516
	<enum name="NSCurveToBezierPathElement" swt_gen="true"></enum>
Lines 4606-4611 Link Here
4606
	<enum name="NSTerminateNow" swt_gen="true"></enum>
4636
	<enum name="NSTerminateNow" swt_gen="true"></enum>
4607
	<enum name="NSTextFieldAndStepperDatePickerStyle" swt_gen="true"></enum>
4637
	<enum name="NSTextFieldAndStepperDatePickerStyle" swt_gen="true"></enum>
4608
	<enum name="NSTitledWindowMask" swt_gen="true"></enum>
4638
	<enum name="NSTitledWindowMask" swt_gen="true"></enum>
4639
	<enum name="NSToolbarDisplayModeIconOnly" swt_gen="true"></enum>
4609
	<enum name="NSUnderlineStyleDouble" swt_gen="true"></enum>
4640
	<enum name="NSUnderlineStyleDouble" swt_gen="true"></enum>
4610
	<enum name="NSUnderlineStyleNone" swt_gen="true"></enum>
4641
	<enum name="NSUnderlineStyleNone" swt_gen="true"></enum>
4611
	<enum name="NSUnderlineStyleSingle" swt_gen="true"></enum>
4642
	<enum name="NSUnderlineStyleSingle" swt_gen="true"></enum>
Lines 4683-4688 Link Here
4683
		<arg swt_gen="true"></arg>
4714
		<arg swt_gen="true"></arg>
4684
		<retval swt_gen="true"></retval>
4715
		<retval swt_gen="true"></retval>
4685
	</function>
4716
	</function>
4717
	<function name="NSRectFillUsingOperation" swt_gen="true">
4718
		<arg swt_gen="true"></arg>
4719
		<arg swt_gen="true"></arg>
4720
	</function>
4686
	<function name="NSWindowList" swt_gen="true">
4721
	<function name="NSWindowList" swt_gen="true">
4687
		<arg swt_gen="true"></arg>
4722
		<arg swt_gen="true"></arg>
4688
		<arg swt_gen="true" swt_java_type="int[]" swt_java_type64="long[]"></arg>
4723
		<arg swt_gen="true" swt_java_type="int[]" swt_java_type64="long[]"></arg>
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreGraphicsFull.bridgesupport.extras (+8 lines)
Lines 63-73 Link Here
63
		<arg swt_gen="true"></arg>
63
		<arg swt_gen="true"></arg>
64
		<arg swt_gen="true"></arg>
64
		<arg swt_gen="true"></arg>
65
	</function>
65
	</function>
66
	<function name="CGContextBeginTransparencyLayerWithRect" swt_gen="true">
67
		<arg swt_gen="true"></arg>
68
		<arg swt_gen="true"></arg>
69
		<arg swt_gen="true"></arg>
70
	</function>
66
	<function name="CGContextDrawImage" swt_gen="true">
71
	<function name="CGContextDrawImage" swt_gen="true">
67
		<arg swt_gen="true"></arg>
72
		<arg swt_gen="true"></arg>
68
		<arg swt_gen="true"></arg>
73
		<arg swt_gen="true"></arg>
69
		<arg swt_gen="true"></arg>
74
		<arg swt_gen="true"></arg>
70
	</function>
75
	</function>
76
	<function name="CGContextEndTransparencyLayer" swt_gen="true">
77
		<arg swt_gen="true"></arg>
78
	</function>
71
	<function name="CGContextFillRect" swt_gen="true">
79
	<function name="CGContextFillRect" swt_gen="true">
72
		<arg swt_gen="true"></arg>
80
		<arg swt_gen="true"></arg>
73
		<arg swt_gen="true"></arg>
81
		<arg swt_gen="true"></arg>
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java (+4 lines)
Lines 47-52 Link Here
47
	OS.objc_msgSend(this.id, OS.sel_setButtonType_, aType);
47
	OS.objc_msgSend(this.id, OS.sel_setButtonType_, aType);
48
}
48
}
49
49
50
public void setHighlightsBy(int /*long*/ aType) {
51
	OS.objc_msgSend(this.id, OS.sel_setHighlightsBy_, aType);
52
}
53
50
public void setImagePosition(int /*long*/ aPosition) {
54
public void setImagePosition(int /*long*/ aPosition) {
51
	OS.objc_msgSend(this.id, OS.sel_setImagePosition_, aPosition);
55
	OS.objc_msgSend(this.id, OS.sel_setImagePosition_, aPosition);
52
}
56
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCell.java (+4 lines)
Lines 114-119 Link Here
114
	OS.objc_msgSend(this.id, OS.sel_setAttributedStringValue_, obj != null ? obj.id : 0);
114
	OS.objc_msgSend(this.id, OS.sel_setAttributedStringValue_, obj != null ? obj.id : 0);
115
}
115
}
116
116
117
public void setBackgroundStyle(int /*long*/ style) {
118
	OS.objc_msgSend(this.id, OS.sel_setBackgroundStyle_, style);
119
}
120
117
public void setBaseWritingDirection(int /*long*/ writingDirection) {
121
public void setBaseWritingDirection(int /*long*/ writingDirection) {
118
	OS.objc_msgSend(this.id, OS.sel_setBaseWritingDirection_, writingDirection);
122
	OS.objc_msgSend(this.id, OS.sel_setBaseWritingDirection_, writingDirection);
119
}
123
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbar.java (-1 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 33-38 Link Here
33
	OS.objc_msgSend(this.id, OS.sel_insertItemWithItemIdentifier_atIndex_, itemIdentifier != null ? itemIdentifier.id : 0, index);
33
	OS.objc_msgSend(this.id, OS.sel_insertItemWithItemIdentifier_atIndex_, itemIdentifier != null ? itemIdentifier.id : 0, index);
34
}
34
}
35
35
36
public boolean isVisible() {
37
	return OS.objc_msgSend_bool(this.id, OS.sel_isVisible);
38
}
39
36
public void removeItemAtIndex(int /*long*/ index) {
40
public void removeItemAtIndex(int /*long*/ index) {
37
	OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_, index);
41
	OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_, index);
38
}
42
}
Lines 49-54 Link Here
49
	OS.objc_msgSend(this.id, OS.sel_setDisplayMode_, displayMode);
53
	OS.objc_msgSend(this.id, OS.sel_setDisplayMode_, displayMode);
50
}
54
}
51
55
56
public void setSelectedItemIdentifier(NSString itemIdentifier) {
57
	OS.objc_msgSend(this.id, OS.sel_setSelectedItemIdentifier_, itemIdentifier != null ? itemIdentifier.id : 0);
58
}
59
52
public void setVisible(boolean shown) {
60
public void setVisible(boolean shown) {
53
	OS.objc_msgSend(this.id, OS.sel_setVisible_, shown);
61
	OS.objc_msgSend(this.id, OS.sel_setVisible_, shown);
54
}
62
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItem.java (-1 / +5 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 54-59 Link Here
54
	OS.objc_msgSend(this.id, OS.sel_setMaxSize_, size);
54
	OS.objc_msgSend(this.id, OS.sel_setMaxSize_, size);
55
}
55
}
56
56
57
public void setMenuFormRepresentation(NSMenuItem menuItem) {
58
	OS.objc_msgSend(this.id, OS.sel_setMenuFormRepresentation_, menuItem != null ? menuItem.id : 0);
59
}
60
57
public void setMinSize(NSSize size) {
61
public void setMinSize(NSSize size) {
58
	OS.objc_msgSend(this.id, OS.sel_setMinSize_, size);
62
	OS.objc_msgSend(this.id, OS.sel_setMinSize_, size);
59
}
63
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java (+8 lines)
Lines 203-208 Link Here
203
	return result != 0 ? new NSMenu(result) : null;
203
	return result != 0 ? new NSMenu(result) : null;
204
}
204
}
205
205
206
public boolean mouse(NSPoint aPoint, NSRect aRect) {
207
	return OS.objc_msgSend_bool(this.id, OS.sel_mouse_inRect_, aPoint, aRect);
208
}
209
210
public boolean mouseDownCanMoveWindow() {
211
	return OS.objc_msgSend_bool(this.id, OS.sel_mouseDownCanMoveWindow);
212
}
213
206
public void registerForDraggedTypes(NSArray newTypes) {
214
public void registerForDraggedTypes(NSArray newTypes) {
207
	OS.objc_msgSend(this.id, OS.sel_registerForDraggedTypes_, newTypes != null ? newTypes.id : 0);
215
	OS.objc_msgSend(this.id, OS.sel_registerForDraggedTypes_, newTypes != null ? newTypes.id : 0);
208
}
216
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java (+33 lines)
Lines 137-142 Link Here
137
	public static final int /*long*/ class_JRSAppKitAWT = objc_getClass("JRSAppKitAWT");
137
	public static final int /*long*/ class_JRSAppKitAWT = objc_getClass("JRSAppKitAWT");
138
	public static final int /*long*/ sel_awtAppDelegate = sel_registerName("awtAppDelegate");
138
	public static final int /*long*/ sel_awtAppDelegate = sel_registerName("awtAppDelegate");
139
	
139
	
140
	public static final int /*long*/ class_NSToolbarView = objc_getClass("NSToolbarView");
141
140
/** JNI natives */
142
/** JNI natives */
141
143
142
/** @method flags=jni */
144
/** @method flags=jni */
Lines 1375-1381 Link Here
1375
public static final int /*long*/ sel_minuteOfHour = sel_registerName("minuteOfHour");
1377
public static final int /*long*/ sel_minuteOfHour = sel_registerName("minuteOfHour");
1376
public static final int /*long*/ sel_modifierFlags = sel_registerName("modifierFlags");
1378
public static final int /*long*/ sel_modifierFlags = sel_registerName("modifierFlags");
1377
public static final int /*long*/ sel_monthOfYear = sel_registerName("monthOfYear");
1379
public static final int /*long*/ sel_monthOfYear = sel_registerName("monthOfYear");
1380
public static final int /*long*/ sel_mouse_inRect_ = sel_registerName("mouse:inRect:");
1378
public static final int /*long*/ sel_mouseDown_ = sel_registerName("mouseDown:");
1381
public static final int /*long*/ sel_mouseDown_ = sel_registerName("mouseDown:");
1382
public static final int /*long*/ sel_mouseDownCanMoveWindow = sel_registerName("mouseDownCanMoveWindow");
1379
public static final int /*long*/ sel_mouseDragged_ = sel_registerName("mouseDragged:");
1383
public static final int /*long*/ sel_mouseDragged_ = sel_registerName("mouseDragged:");
1380
public static final int /*long*/ sel_mouseEntered_ = sel_registerName("mouseEntered:");
1384
public static final int /*long*/ sel_mouseEntered_ = sel_registerName("mouseEntered:");
1381
public static final int /*long*/ sel_mouseExited_ = sel_registerName("mouseExited:");
1385
public static final int /*long*/ sel_mouseExited_ = sel_registerName("mouseExited:");
Lines 1640-1645 Link Here
1640
public static final int /*long*/ sel_setAutosaveExpandedItems_ = sel_registerName("setAutosaveExpandedItems:");
1644
public static final int /*long*/ sel_setAutosaveExpandedItems_ = sel_registerName("setAutosaveExpandedItems:");
1641
public static final int /*long*/ sel_setBackgroundColor_ = sel_registerName("setBackgroundColor:");
1645
public static final int /*long*/ sel_setBackgroundColor_ = sel_registerName("setBackgroundColor:");
1642
public static final int /*long*/ sel_setBackgroundLayoutEnabled_ = sel_registerName("setBackgroundLayoutEnabled:");
1646
public static final int /*long*/ sel_setBackgroundLayoutEnabled_ = sel_registerName("setBackgroundLayoutEnabled:");
1647
public static final int /*long*/ sel_setBackgroundStyle_ = sel_registerName("setBackgroundStyle:");
1643
public static final int /*long*/ sel_setBadgeLabel_ = sel_registerName("setBadgeLabel:");
1648
public static final int /*long*/ sel_setBadgeLabel_ = sel_registerName("setBadgeLabel:");
1644
public static final int /*long*/ sel_setBaseWritingDirection_ = sel_registerName("setBaseWritingDirection:");
1649
public static final int /*long*/ sel_setBaseWritingDirection_ = sel_registerName("setBaseWritingDirection:");
1645
public static final int /*long*/ sel_setBaseWritingDirection_range_ = sel_registerName("setBaseWritingDirection:range:");
1650
public static final int /*long*/ sel_setBaseWritingDirection_range_ = sel_registerName("setBaseWritingDirection:range:");
Lines 1732-1737 Link Here
1732
public static final int /*long*/ sel_setHighlightMode_ = sel_registerName("setHighlightMode:");
1737
public static final int /*long*/ sel_setHighlightMode_ = sel_registerName("setHighlightMode:");
1733
public static final int /*long*/ sel_setHighlighted_ = sel_registerName("setHighlighted:");
1738
public static final int /*long*/ sel_setHighlighted_ = sel_registerName("setHighlighted:");
1734
public static final int /*long*/ sel_setHighlightedTableColumn_ = sel_registerName("setHighlightedTableColumn:");
1739
public static final int /*long*/ sel_setHighlightedTableColumn_ = sel_registerName("setHighlightedTableColumn:");
1740
public static final int /*long*/ sel_setHighlightsBy_ = sel_registerName("setHighlightsBy:");
1735
public static final int /*long*/ sel_setHorizontalScroller_ = sel_registerName("setHorizontalScroller:");
1741
public static final int /*long*/ sel_setHorizontalScroller_ = sel_registerName("setHorizontalScroller:");
1736
public static final int /*long*/ sel_setHorizontallyResizable_ = sel_registerName("setHorizontallyResizable:");
1742
public static final int /*long*/ sel_setHorizontallyResizable_ = sel_registerName("setHorizontallyResizable:");
1737
public static final int /*long*/ sel_setIcon_ = sel_registerName("setIcon:");
1743
public static final int /*long*/ sel_setIcon_ = sel_registerName("setIcon:");
Lines 1775-1780 Link Here
1775
public static final int /*long*/ sel_setMaximumIntegerDigits_ = sel_registerName("setMaximumIntegerDigits:");
1781
public static final int /*long*/ sel_setMaximumIntegerDigits_ = sel_registerName("setMaximumIntegerDigits:");
1776
public static final int /*long*/ sel_setMenu_ = sel_registerName("setMenu:");
1782
public static final int /*long*/ sel_setMenu_ = sel_registerName("setMenu:");
1777
public static final int /*long*/ sel_setMenu_forSegment_ = sel_registerName("setMenu:forSegment:");
1783
public static final int /*long*/ sel_setMenu_forSegment_ = sel_registerName("setMenu:forSegment:");
1784
public static final int /*long*/ sel_setMenuFormRepresentation_ = sel_registerName("setMenuFormRepresentation:");
1778
public static final int /*long*/ sel_setMessage_ = sel_registerName("setMessage:");
1785
public static final int /*long*/ sel_setMessage_ = sel_registerName("setMessage:");
1779
public static final int /*long*/ sel_setMessageText_ = sel_registerName("setMessageText:");
1786
public static final int /*long*/ sel_setMessageText_ = sel_registerName("setMessageText:");
1780
public static final int /*long*/ sel_setMinSize_ = sel_registerName("setMinSize:");
1787
public static final int /*long*/ sel_setMinSize_ = sel_registerName("setMinSize:");
Lines 1817-1822 Link Here
1817
public static final int /*long*/ sel_setSegmentStyle_ = sel_registerName("setSegmentStyle:");
1824
public static final int /*long*/ sel_setSegmentStyle_ = sel_registerName("setSegmentStyle:");
1818
public static final int /*long*/ sel_setSelectable_ = sel_registerName("setSelectable:");
1825
public static final int /*long*/ sel_setSelectable_ = sel_registerName("setSelectable:");
1819
public static final int /*long*/ sel_setSelected_forSegment_ = sel_registerName("setSelected:forSegment:");
1826
public static final int /*long*/ sel_setSelected_forSegment_ = sel_registerName("setSelected:forSegment:");
1827
public static final int /*long*/ sel_setSelectedItemIdentifier_ = sel_registerName("setSelectedItemIdentifier:");
1820
public static final int /*long*/ sel_setSelectedRange_ = sel_registerName("setSelectedRange:");
1828
public static final int /*long*/ sel_setSelectedRange_ = sel_registerName("setSelectedRange:");
1821
public static final int /*long*/ sel_setSelectedSegment_ = sel_registerName("setSelectedSegment:");
1829
public static final int /*long*/ sel_setSelectedSegment_ = sel_registerName("setSelectedSegment:");
1822
public static final int /*long*/ sel_setSelectedTextAttributes_ = sel_registerName("setSelectedTextAttributes:");
1830
public static final int /*long*/ sel_setSelectedTextAttributes_ = sel_registerName("setSelectedTextAttributes:");
Lines 2087-2092 Link Here
2087
public static final int NSApplicationDefined = 15;
2095
public static final int NSApplicationDefined = 15;
2088
public static final int NSApplicationDelegateReplySuccess = 0;
2096
public static final int NSApplicationDelegateReplySuccess = 0;
2089
public static final int NSAtTop = 2;
2097
public static final int NSAtTop = 2;
2098
public static final int NSBackgroundStyleRaised = 2;
2090
public static final int NSBackingStoreBuffered = 2;
2099
public static final int NSBackingStoreBuffered = 2;
2091
public static final int NSBackspaceCharacter = 8;
2100
public static final int NSBackspaceCharacter = 8;
2092
public static final int NSBevelLineJoinStyle = 2;
2101
public static final int NSBevelLineJoinStyle = 2;
Lines 2106-2113 Link Here
2106
public static final int NSCommandKeyMask = 1048576;
2115
public static final int NSCommandKeyMask = 1048576;
2107
public static final int NSCompositeClear = 0;
2116
public static final int NSCompositeClear = 0;
2108
public static final int NSCompositeCopy = 1;
2117
public static final int NSCompositeCopy = 1;
2118
public static final int NSCompositeSourceAtop = 5;
2109
public static final int NSCompositeSourceOver = 2;
2119
public static final int NSCompositeSourceOver = 2;
2110
public static final int NSCompositeXOR = 10;
2120
public static final int NSCompositeXOR = 10;
2121
public static final int NSContentsCellMask = 1;
2111
public static final int NSControlKeyMask = 262144;
2122
public static final int NSControlKeyMask = 262144;
2112
public static final int NSCriticalAlertStyle = 2;
2123
public static final int NSCriticalAlertStyle = 2;
2113
public static final int NSCurveToBezierPathElement = 2;
2124
public static final int NSCurveToBezierPathElement = 2;
Lines 2233-2238 Link Here
2233
public static final int NSTerminateNow = 1;
2244
public static final int NSTerminateNow = 1;
2234
public static final int NSTextFieldAndStepperDatePickerStyle = 0;
2245
public static final int NSTextFieldAndStepperDatePickerStyle = 0;
2235
public static final int NSTitledWindowMask = 1;
2246
public static final int NSTitledWindowMask = 1;
2247
public static final int NSToolbarDisplayModeIconOnly = 2;
2236
public static final int NSUnderlineStyleDouble = 9;
2248
public static final int NSUnderlineStyleDouble = 9;
2237
public static final int NSUnderlineStyleNone = 0;
2249
public static final int NSUnderlineStyleNone = 0;
2238
public static final int NSUnderlineStyleSingle = 1;
2250
public static final int NSUnderlineStyleSingle = 1;
Lines 2948-2953 Link Here
2948
 */
2960
 */
2949
public static final native int /*long*/ NSNumberOfColorComponents(int /*long*/ colorSpaceName);
2961
public static final native int /*long*/ NSNumberOfColorComponents(int /*long*/ colorSpaceName);
2950
/**
2962
/**
2963
 * @param aRect flags=struct
2964
 * @param op cast=(NSCompositingOperation)
2965
 */
2966
public static final native void NSRectFillUsingOperation(NSRect aRect, int /*long*/ op);
2967
/**
2951
 * @param size cast=(NSInteger)
2968
 * @param size cast=(NSInteger)
2952
 * @param list cast=(NSInteger*)
2969
 * @param list cast=(NSInteger*)
2953
 */
2970
 */
Lines 3070-3081 Link Here
3070
 */
3087
 */
3071
public static final native void CGContextAddPath(int /*long*/ context, int /*long*/ path);
3088
public static final native void CGContextAddPath(int /*long*/ context, int /*long*/ path);
3072
/**
3089
/**
3090
 * @param context cast=(CGContextRef)
3091
 * @param rect flags=struct
3092
 * @param auxiliaryInfo cast=(CFDictionaryRef)
3093
 */
3094
public static final native void CGContextBeginTransparencyLayerWithRect(int /*long*/ context, CGRect rect, int /*long*/ auxiliaryInfo);
3095
/**
3073
 * @param c cast=(CGContextRef)
3096
 * @param c cast=(CGContextRef)
3074
 * @param rect flags=struct
3097
 * @param rect flags=struct
3075
 * @param image cast=(CGImageRef)
3098
 * @param image cast=(CGImageRef)
3076
 */
3099
 */
3077
public static final native void CGContextDrawImage(int /*long*/ c, CGRect rect, int /*long*/ image);
3100
public static final native void CGContextDrawImage(int /*long*/ c, CGRect rect, int /*long*/ image);
3078
/**
3101
/**
3102
 * @param context cast=(CGContextRef)
3103
 */
3104
public static final native void CGContextEndTransparencyLayer(int /*long*/ context);
3105
/**
3079
 * @param c cast=(CGContextRef)
3106
 * @param c cast=(CGContextRef)
3080
 * @param rect flags=struct
3107
 * @param rect flags=struct
3081
 */
3108
 */
Lines 3526-3531 Link Here
3526
/**
3553
/**
3527
 * @method flags=cast
3554
 * @method flags=cast
3528
 * @param arg0 flags=struct
3555
 * @param arg0 flags=struct
3556
 * @param arg1 flags=struct
3557
 */
3558
public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, NSPoint arg0, NSRect arg1);
3559
/**
3560
 * @method flags=cast
3561
 * @param arg0 flags=struct
3529
 */
3562
 */
3530
public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, NSRange arg0, int /*long*/ arg1);
3563
public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, NSRange arg0, int /*long*/ arg1);
3531
/**
3564
/**
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java (-1 / +1 lines)
Lines 308-314 Link Here
308
			rect.height += EXTRA_HEIGHT;
308
			rect.height += EXTRA_HEIGHT;
309
		}
309
		}
310
	}
310
	}
311
	callSuper (id, sel, image, rect, view);
311
	super.drawImageWithFrameInView(id, sel, image, rect, view);
312
}
312
}
313
313
314
void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect cellRect, int /*long*/ viewid) {
314
void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect cellRect, int /*long*/ viewid) {
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java (-2 / +31 lines)
Lines 2132-2137 Link Here
2132
		OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
2132
		OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
2133
		OS.class_addMethod(cls, OS.sel_updateTrackingAreas, proc2, "@:");
2133
		OS.class_addMethod(cls, OS.sel_updateTrackingAreas, proc2, "@:");
2134
		OS.class_addMethod(cls, OS.sel_getImageView, proc2, "@:");
2134
		OS.class_addMethod(cls, OS.sel_getImageView, proc2, "@:");
2135
		OS.class_addMethod(cls, OS.sel_mouseDownCanMoveWindow, proc2, "@:");
2135
	}
2136
	}
2136
	if (needsDisplayInRectProc != 0) {
2137
	if (needsDisplayInRectProc != 0) {
2137
		OS.class_addMethod(cls, OS.sel_setNeedsDisplayInRect_, needsDisplayInRectProc, "@:{NSRect}");
2138
		OS.class_addMethod(cls, OS.sel_setNeedsDisplayInRect_, needsDisplayInRectProc, "@:{NSRect}");
Lines 2289-2295 Link Here
2289
	addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc);	
2290
	addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc);	
2290
	OS.class_addMethod (cls, OS.sel_drawImage_withFrame_inView_, drawImageWithFrameInViewProc, "@:@{NSRect}@");
2291
	OS.class_addMethod (cls, OS.sel_drawImage_withFrame_inView_, drawImageWithFrameInViewProc, "@:@{NSRect}@");
2291
	OS.class_addMethod (cls, OS.sel_drawTitle_withFrame_inView_, drawTitleWithFrameInViewProc, "@:@{NSRect}@");
2292
	OS.class_addMethod (cls, OS.sel_drawTitle_withFrame_inView_, drawTitleWithFrameInViewProc, "@:@{NSRect}@");
2292
	OS.class_addMethod(cls, OS.sel_cellSize, cellSizeProc, "@:");
2293
	OS.class_addMethod(cls, OS.sel_drawInteriorWithFrame_inView_, drawInteriorWithFrameInViewProc, "@:{NSRect}@");
2293
	OS.class_addMethod(cls, OS.sel_drawInteriorWithFrame_inView_, drawInteriorWithFrameInViewProc, "@:{NSRect}@");
2294
	OS.class_addMethod(cls, OS.sel_titleRectForBounds_, titleRectForBoundsProc, "@:{NSRect}");
2294
	OS.class_addMethod(cls, OS.sel_titleRectForBounds_, titleRectForBoundsProc, "@:{NSRect}");
2295
	OS.class_addMethod(cls, OS.sel_cellSizeForBounds_, cellSizeForBoundsProc, "@:{NSRect}");
2295
	OS.class_addMethod(cls, OS.sel_cellSizeForBounds_, cellSizeForBoundsProc, "@:{NSRect}");
Lines 2688-2693 Link Here
2688
	addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc);
2688
	addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc);
2689
	OS.objc_registerClassPair(cls);
2689
	OS.objc_registerClassPair(cls);
2690
	
2690
	
2691
	className = "SWTToolbar";
2692
	cls = OS.objc_allocateClassPair(OS.class_NSToolbar, className, 0);
2693
	OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types);
2694
	OS.class_addMethod(cls, OS.sel_toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar_, proc5, "@:@@Z");
2695
	OS.class_addMethod(cls, OS.sel_toolbarAllowedItemIdentifiers_, proc3, "@:@");
2696
	OS.class_addMethod(cls, OS.sel_toolbarDefaultItemIdentifiers_, proc3, "@:@");
2697
	OS.class_addMethod(cls, OS.sel_toolbarSelectableItemIdentifiers_, proc3, "@:@");
2698
	addEventMethods(cls, proc2, proc3, drawRectProc, hitTestProc, setNeedsDisplayInRectProc);
2699
	addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc);
2700
	addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc);
2701
	OS.objc_registerClassPair(cls);
2702
	
2703
	className = "SWTToolbarView";
2704
	cls = OS.objc_allocateClassPair(OS.class_NSToolbarView, className, 0);
2705
	OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types);
2706
	addEventMethods(cls, proc2, proc3, drawRectProc, hitTestProc, setNeedsDisplayInRectProc);
2707
	addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc);
2708
	OS.objc_registerClassPair(cls);
2709
	
2691
	className = "SWTWindowDelegate";
2710
	className = "SWTWindowDelegate";
2692
	cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0);
2711
	cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0);
2693
	OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types);
2712
	OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types);
Lines 4615-4621 Link Here
4615
		// number passed to windowWithWindowNumber returns nil the window doesn't belong to
4634
		// number passed to windowWithWindowNumber returns nil the window doesn't belong to
4616
		// this process.
4635
		// this process.
4617
		if (window != null) {
4636
		if (window != null) {
4618
			NSView contentView = window.contentView();
4637
			NSView contentView = window.contentView().superview();
4619
			if (contentView != null && OS.NSPointInRect(screenLocation, window.frame())) {
4638
			if (contentView != null && OS.NSPointInRect(screenLocation, window.frame())) {
4620
				NSPoint location = window.convertScreenToBase(screenLocation);
4639
				NSPoint location = window.convertScreenToBase(screenLocation);
4621
				view = contentView.hitTest (location);
4640
				view = contentView.hitTest (location);
Lines 5122-5127 Link Here
5122
		return widget.accessibilityParameterizedAttributeNames(id, sel);
5141
		return widget.accessibilityParameterizedAttributeNames(id, sel);
5123
	} else if (sel == OS.sel_getImageView) {
5142
	} else if (sel == OS.sel_getImageView) {
5124
		return widget.imageView();
5143
		return widget.imageView();
5144
	} else if (sel == OS.sel_mouseDownCanMoveWindow) {
5145
		return (widget.mouseDownCanMoveWindow(id, sel) ? 1 : 0);
5125
	} else if (sel == OS.sel_accessibilityFocusedUIElement) {
5146
	} else if (sel == OS.sel_accessibilityFocusedUIElement) {
5126
		return widget.accessibilityFocusedUIElement(id, sel);
5147
		return widget.accessibilityFocusedUIElement(id, sel);
5127
	} else if (sel == OS.sel_accessibilityIsIgnored) {
5148
	} else if (sel == OS.sel_accessibilityIsIgnored) {
Lines 5396-5401 Link Here
5396
		widget.windowDidMiniturize(id, sel, arg0);
5417
		widget.windowDidMiniturize(id, sel, arg0);
5397
	} else if (sel == OS.sel_windowDidDeminiaturize_) {
5418
	} else if (sel == OS.sel_windowDidDeminiaturize_) {
5398
		widget.windowDidDeminiturize(id, sel, arg0);
5419
		widget.windowDidDeminiturize(id, sel, arg0);
5420
	} else if (sel == OS.sel_toolbarAllowedItemIdentifiers_) {
5421
		return widget.toolbarAllowedItemIdentifiers(id, sel, arg0);
5422
	} else if (sel == OS.sel_toolbarDefaultItemIdentifiers_) {
5423
		return widget.toolbarDefaultItemIdentifiers(id, sel, arg0);
5424
	} else if (sel == OS.sel_toolbarSelectableItemIdentifiers_) {
5425
		return widget.toolbarSelectableItemIdentifiers(id, sel, arg0);
5399
	}
5426
	}
5400
	return 0;
5427
	return 0;
5401
}
5428
}
Lines 5506-5511 Link Here
5506
		return (widget.tableView_writeRowsWithIndexes_toPasteboard(id, sel, arg0, arg1, arg2) ? 1 : 0);
5533
		return (widget.tableView_writeRowsWithIndexes_toPasteboard(id, sel, arg0, arg1, arg2) ? 1 : 0);
5507
	} else if (sel == OS.sel_outlineView_writeItems_toPasteboard_) {
5534
	} else if (sel == OS.sel_outlineView_writeItems_toPasteboard_) {
5508
		return (widget.outlineView_writeItems_toPasteboard(id, sel, arg0, arg1, arg2) ? 1 : 0);
5535
		return (widget.outlineView_writeItems_toPasteboard(id, sel, arg0, arg1, arg2) ? 1 : 0);
5536
	} else if (sel == OS.sel_toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar_) {
5537
		return widget.toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(id, sel, arg0, arg1, arg2 != 0);
5509
	}
5538
	}
5510
	return 0;
5539
	return 0;
5511
}
5540
}
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java (+55 lines)
Lines 124-129 Link Here
124
	boolean keyInputHappened;
124
	boolean keyInputHappened;
125
	NSRect currentFrame;
125
	NSRect currentFrame;
126
	NSRect fullScreenFrame;
126
	NSRect fullScreenFrame;
127
	ToolBar toolBar;
127
	
128
	
128
	static int DEFAULT_CLIENT_WIDTH = -1;
129
	static int DEFAULT_CLIENT_WIDTH = -1;
129
	static int DEFAULT_CLIENT_HEIGHT = -1;
130
	static int DEFAULT_CLIENT_HEIGHT = -1;
Lines 410-415 Link Here
410
	return new Shell (display, null, SWT.NO_TRIM, handle, true);
411
	return new Shell (display, null, SWT.NO_TRIM, handle, true);
411
}
412
}
412
413
414
Control [] _getChildren () {
415
	Control [] children = super._getChildren();
416
	if (toolBar != null) {
417
		Control [] newChildren = new Control [children.length + 1];
418
		System.arraycopy (children, 0, newChildren, 1, children.length);
419
		newChildren[0] = toolBar;
420
		children = newChildren;
421
	}
422
	return children;
423
}
424
413
static int checkStyle (Shell parent, int style) {
425
static int checkStyle (Shell parent, int style) {
414
	style = Decorations.checkStyle (style);
426
	style = Decorations.checkStyle (style);
415
	style &= ~SWT.TRANSPARENT;
427
	style &= ~SWT.TRANSPARENT;
Lines 1104-1109 Link Here
1104
	return 1;
1116
	return 1;
1105
}
1117
}
1106
1118
1119
/**
1120
 * Returns the instance of the ToolBar object representing the tool bar that can appear on the
1121
 * trim of the shell. This will return <code>null</code> if the platform does not support tool bars that
1122
 * not part of the content area of the shell, or if the style of the shell does not support a 
1123
 * tool bar. 
1124
 * <p>
1125
 * NOTE: This API should be considered experimental and subject to change before the final release.
1126
 * 
1127
 * @return a ToolBar object representing the window's tool bar or null.
1128
 *
1129
 * @exception SWTException <ul>
1130
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1131
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1132
 * </ul>
1133
 * 
1134
 * @since 3.7
1135
 */
1136
public ToolBar getToolbar() {
1137
	checkWidget();
1138
	if (toolBar == null) toolBar = new ToolBar(this, SWT.HORIZONTAL | SWT.SMOOTH, true);
1139
	return toolBar;
1140
}
1141
1107
boolean hasBorder () {
1142
boolean hasBorder () {
1108
	return false;
1143
	return false;
1109
}
1144
}
Lines 1174-1179 Link Here
1174
	window.makeKeyAndOrderFront (null);
1209
	window.makeKeyAndOrderFront (null);
1175
}
1210
}
1176
1211
1212
Point minimumSize (int wHint, int Hint, boolean changed) {
1213
	// minimumSize is used by computeSize() to figure out how big the view
1214
	// (or, in this case, the content view of the Shell) should be.
1215
	// An NSToolbar does not contribute to the content area, but must be
1216
	// accounted for. If the shell has a toolbar but no other children
1217
	// this will return the width of the toolbar and a height of 1
1218
	Control [] children = _getChildren ();
1219
	int width = 0, height = 0;
1220
	for (int i=0; i<children.length; i++) {
1221
		Rectangle rect = children [i].getBounds ();
1222
		width = Math.max (width, rect.x + rect.width);
1223
		if (children[i] != toolBar)	{
1224
			height = Math.max (height, rect.y + rect.height);
1225
		} else {
1226
			height = Math.max (height, 1);
1227
		}
1228
	}
1229
	return new Point (width, height);
1230
}
1231
1177
void mouseMoved(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
1232
void mouseMoved(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
1178
	super.mouseMoved(id, sel, theEvent);
1233
	super.mouseMoved(id, sel, theEvent);
1179
1234
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java (-26 / +219 lines)
Lines 47-54 Link Here
47
public class ToolBar extends Composite {
47
public class ToolBar extends Composite {
48
	int itemCount;
48
	int itemCount;
49
	ToolItem [] items;
49
	ToolItem [] items;
50
	NSToolbar nsToolbar;
50
	NSArray accessibilityAttributes = null;
51
	NSArray accessibilityAttributes = null;
51
	ToolItem lastFocus;
52
	ToolItem lastFocus;
53
	static int NEXT_ID;
52
54
53
/**
55
/**
54
 * Constructs a new instance of this class given its parent
56
 * Constructs a new instance of this class given its parent
Lines 84-90 Link Here
84
 * @see Widget#getStyle()
86
 * @see Widget#getStyle()
85
 */
87
 */
86
public ToolBar (Composite parent, int style) {
88
public ToolBar (Composite parent, int style) {
87
	super (parent, checkStyle (style));
89
	this(parent, style, false);
90
}
91
92
ToolBar(Composite parent, int style, boolean internal) {
93
	super (parent, checkStyle (parent, style, internal));
88
	
94
	
89
	/*
95
	/*
90
	* Ensure that either of HORIZONTAL or VERTICAL is set.
96
	* Ensure that either of HORIZONTAL or VERTICAL is set.
Lines 141-147 Link Here
141
	return super.accessibilityIsIgnored(id, sel);	
147
	return super.accessibilityIsIgnored(id, sel);	
142
}
148
}
143
149
144
static int checkStyle (int style) {
150
static int checkStyle (Composite parent, int style, boolean internal) {
145
	/*
151
	/*
146
	* Even though it is legal to create this widget
152
	* Even though it is legal to create this widget
147
	* with scroll bars, they serve no useful purpose
153
	* with scroll bars, they serve no useful purpose
Lines 149-155 Link Here
149
	* widget's client area.  The fix is to clear
155
	* widget's client area.  The fix is to clear
150
	* the SWT style.
156
	* the SWT style.
151
	*/
157
	*/
152
	return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
158
	int newStyle = style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
159
	
160
	/*
161
	 * Only internal clients can create an NSToolbar-based ToolBar.
162
	 */
163
	if (!internal && (newStyle & SWT.SMOOTH) != 0) {
164
		newStyle &= ~SWT.SMOOTH;
165
	}
166
	
167
	/*
168
	 * A unified toolbar can only be parented to a Shell, and
169
	 * there can only be one unified toolbar per shell. If neither of these
170
	 * conditions hold, turn off the SMOOTH flag.
171
	 */
172
	if ((style & SWT.SMOOTH) != 0) {
173
		if (parent instanceof Shell) {
174
			Shell s = (Shell)parent;
175
			if (s.window.toolbar() != null) newStyle &= ~SWT.SMOOTH;
176
		} else {
177
			newStyle &= ~SWT.SMOOTH;
178
		}
179
	}
180
	
181
	/*
182
	 * Unified toolbar only supports a horizontal layout, and doesn't wrap.
183
	 */
184
	if ((newStyle & SWT.SMOOTH) != 0) {
185
		newStyle &= ~(SWT.VERTICAL | SWT.WRAP); 
186
		newStyle |= SWT.HORIZONTAL;
187
	}
188
	
189
	return newStyle;
153
}
190
}
154
191
155
protected void checkSubclass () {
192
protected void checkSubclass () {
Lines 186-205 Link Here
186
}
223
}
187
224
188
void createHandle () {
225
void createHandle () {
189
	state |= THEME_BACKGROUND;
226
	if ((style & SWT.SMOOTH) != 0) {
190
	if (hasBorder()) {
227
		nsToolbar = ((NSToolbar)new SWTToolbar().alloc()).initWithIdentifier(NSString.stringWith(String.valueOf(NEXT_ID++)));
191
		NSRect rect = new NSRect();
228
		nsToolbar.setDelegate(nsToolbar);
192
		NSScrollView scrollWidget = (NSScrollView)new SWTScrollView().alloc();
229
		nsToolbar.setDisplayMode(OS.NSToolbarDisplayModeIconOnly);
193
		scrollWidget.initWithFrame (rect);
230
		NSWindow window = parent.view.window();
194
		scrollWidget.setDrawsBackground(false);
231
		window.setToolbar(nsToolbar);
195
		scrollWidget.setBorderType(OS.NSBezelBorder);
232
		nsToolbar.setVisible(true);
196
		scrollView = scrollWidget;
233
		NSArray views = window.contentView().superview().subviews();
197
	}
234
		for (int i = 0; i < views.count(); i++) {
198
	NSView widget = (NSView)new SWTView().alloc();
235
			id id = views.objectAtIndex(i);
199
	widget.init();
236
			if (new NSObject(id).className().getString().equals("NSToolbarView")) {
200
//	widget.setDrawsBackground(false);
237
				view = new NSView(id);
201
	view = widget;
238
				OS.object_setClass(view.id, OS.objc_getClass("SWTToolbarView"));
202
	if (scrollView != null) view.setAutoresizingMask(OS.NSViewHeightSizable | OS.NSViewWidthSizable);
239
				view.retain();
240
				break;
241
			}
242
		}
243
	} else {
244
		state |= THEME_BACKGROUND;
245
		if (hasBorder()) {
246
			NSRect rect = new NSRect();
247
			NSScrollView scrollWidget = (NSScrollView)new SWTScrollView().alloc();
248
			scrollWidget.initWithFrame (rect);
249
			scrollWidget.setDrawsBackground(false);
250
			scrollWidget.setBorderType(OS.NSBezelBorder);
251
			scrollView = scrollWidget;
252
		}
253
		NSView widget = (NSView)new SWTView().alloc();
254
		widget.init();
255
		view = widget;
256
		if (scrollView != null) view.setAutoresizingMask(OS.NSViewHeightSizable | OS.NSViewWidthSizable);
257
	}
203
}
258
}
204
259
205
void createItem (ToolItem item, int index) {
260
void createItem (ToolItem item, int index) {
Lines 209-218 Link Here
209
		System.arraycopy (items, 0, newItems, 0, items.length);
264
		System.arraycopy (items, 0, newItems, 0, items.length);
210
		items = newItems;
265
		items = newItems;
211
	}
266
	}
212
	item.createWidget();
267
	if ((style & SWT.SMOOTH) != 0) {
213
	view.addSubview(item.view);
268
		item.style |= SWT.SMOOTH;
269
	}
270
    item.createWidget();
214
	System.arraycopy (items, index, items, index + 1, itemCount++ - index);
271
	System.arraycopy (items, index, items, index + 1, itemCount++ - index);
215
	items [index] = item;
272
	items [index] = item;
273
	if ((style & SWT.SMOOTH) != 0) {
274
        nsToolbar.insertItemWithItemIdentifier(item.getItemID(), index);	    
275
	} else {
276
        view.addSubview(item.view);
277
	}
216
	relayout ();
278
	relayout ();
217
}
279
}
218
280
Lines 222-227 Link Here
222
	itemCount = 0;
284
	itemCount = 0;
223
}
285
}
224
286
287
NSFont defaultNSFont() {
288
	return NSFont.systemFontOfSize(11.0f);
289
}
290
291
void deregister () {
292
	super.deregister ();
293
	if (nsToolbar != null) display.removeWidget (nsToolbar);
294
}
295
225
void destroyItem (ToolItem item) {
296
void destroyItem (ToolItem item) {
226
	int index = 0;
297
	int index = 0;
227
	while (index < itemCount) {
298
	while (index < itemCount) {
Lines 232-238 Link Here
232
	if (item == lastFocus) lastFocus = null;
303
	if (item == lastFocus) lastFocus = null;
233
	System.arraycopy (items, index + 1, items, index, --itemCount - index);
304
	System.arraycopy (items, index + 1, items, index, --itemCount - index);
234
	items [itemCount] = null;
305
	items [itemCount] = null;
235
	item.view.removeFromSuperview();
306
	if ((style & SWT.SMOOTH) != 0) {
307
		nsToolbar.removeItemAtIndex(index);
308
	} else {
309
		item.view.removeFromSuperview();
310
	}
236
	relayout ();
311
	relayout ();
237
}
312
}
238
313
Lines 262-267 Link Here
262
	return super.findTooltip (pt);
337
	return super.findTooltip (pt);
263
}
338
}
264
339
340
void setZOrder() {
341
	if ((style & SWT.SMOOTH) != 0) return;
342
	super.setZOrder();
343
}
344
345
public Rectangle getBounds () {
346
	checkWidget();
347
348
	if ((style & SWT.SMOOTH) != 0) {
349
		// The NSToolbar's view will always be a child of the Shell, so we can just
350
		// convert the frame to window-relative coordinates.
351
		NSRect rect = view.frame();
352
		rect = view.convertRect_toView_(rect, null);
353
		return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
354
	}
355
	
356
	return super.getBounds();
357
}
358
265
boolean forceFocus (NSView focusView) {
359
boolean forceFocus (NSView focusView) {
266
	if (lastFocus != null && lastFocus.setFocus ()) return true;
360
	if (lastFocus != null && lastFocus.setFocus ()) return true;
267
	ToolItem [] items = getItems ();
361
	ToolItem [] items = getItems ();
Lines 448-453 Link Here
448
	return new int [] {rows, maxX, y + itemHeight};
542
	return new int [] {rows, maxX, y + itemHeight};
449
}
543
}
450
544
545
int [] layoutUnified (int width, int height, boolean resize) {
546
	int x = 0, y = 0;
547
	int itemHeight = 0, maxX = 0;
548
	Point [] sizes = new Point [itemCount];
549
	NSRect [] containerRects = new NSRect[itemCount];
550
	// This next line relies on the observation that all of the toolbar item views are children of the first
551
	// subview of the NSToolbarView.
552
	NSArray itemViewers = new NSView(view.subviews().objectAtIndex(0)).subviews();
553
	for (int i=0; i<itemCount; i++) {
554
		Point size = sizes [i] = items [i].computeSize ();
555
		containerRects [i] = new NSView(itemViewers.objectAtIndex(i)).frame();
556
		if (i == 0) x = (int) containerRects[0].x;
557
		itemHeight = Math.max (itemHeight, size.y);
558
	}
559
	for (int i=0; i<itemCount; i++) {
560
		ToolItem item = items [i];
561
		Point size = sizes [i];
562
		if (resize) {
563
			item.setBounds (0, 0, size.x, itemHeight);
564
			Control control = item.control;
565
			if (control != null) {
566
				control.setBounds (x, y, size.x, itemHeight);
567
			}
568
		}
569
		x += containerRects[i].width;
570
		maxX = Math.max (maxX, x);
571
	}
572
	
573
	return new int [] {1, maxX, itemHeight};
574
}
575
451
int [] layoutVertical (int width, int height, boolean resize) {
576
int [] layoutVertical (int width, int height, boolean resize) {
452
	int xSpacing = 2, ySpacing = 0;
577
	int xSpacing = 2, ySpacing = 0;
453
	int marginWidth = 0, marginHeight = 0;
578
	int marginWidth = 0, marginHeight = 0;
Lines 485-490 Link Here
485
}
610
}
486
611
487
int [] layout (int nWidth, int nHeight, boolean resize) {
612
int [] layout (int nWidth, int nHeight, boolean resize) {
613
	if ((style & SWT.SMOOTH) != 0) {
614
		return layoutUnified(nWidth, nHeight, resize);
615
	}
616
488
	if ((style & SWT.VERTICAL) != 0) {
617
	if ((style & SWT.VERTICAL) != 0) {
489
		return layoutVertical (nWidth, nHeight, resize);
618
		return layoutVertical (nWidth, nHeight, resize);
490
	} else {
619
	} else {
Lines 492-497 Link Here
492
	}
621
	}
493
}
622
}
494
623
624
void register() {
625
	super.register();
626
	if (nsToolbar != null) display.addWidget (nsToolbar, this);
627
}
628
495
void relayout () {
629
void relayout () {
496
	if (!getDrawing()) return;
630
	if (!getDrawing()) return;
497
	Rectangle rect = getClientArea ();
631
	Rectangle rect = getClientArea ();
Lines 513-519 Link Here
513
}
647
}
514
648
515
void releaseHandle () {
649
void releaseHandle () {
516
	super.releaseHandle ();
650
    super.releaseHandle ();
651
652
    if (nsToolbar != null) {
653
        nsToolbar.release();
654
        nsToolbar = null;
655
	}
656
517
	if (accessibilityAttributes != null) accessibilityAttributes.release();
657
	if (accessibilityAttributes != null) accessibilityAttributes.release();
518
	accessibilityAttributes = null;
658
	accessibilityAttributes = null;
519
}
659
}
Lines 547-560 Link Here
547
	case SWT.MouseMove:
687
	case SWT.MouseMove:
548
		// Start with the global mouse location, as the MouseEnter may occur due to
688
		// Start with the global mouse location, as the MouseEnter may occur due to
549
		// an application-activated event, which isn't associated with a window.
689
		// an application-activated event, which isn't associated with a window.
550
		NSPoint toolbarPoint = NSEvent.mouseLocation();
690
		NSPoint windowPoint = NSEvent.mouseLocation();
551
		toolbarPoint = view.window().convertScreenToBase(toolbarPoint);
691
		windowPoint = view.window().convertScreenToBase(windowPoint);
552
		toolbarPoint = view.convertPoint_fromView_(toolbarPoint, null);
553
		for (int i = 0; i < itemCount; i++) {
692
		for (int i = 0; i < itemCount; i++) {
554
			ToolItem item = items [i];
693
			ToolItem item = items [i];
555
			int currState = item.state;
694
			int currState = item.state;
556
			
695
			NSPoint viewPoint = item.view.convertPoint_fromView_(windowPoint, null); 
557
			if (OS.NSPointInRect(toolbarPoint, item.view.frame())) {
696
			if (item.view.mouse(viewPoint, item.view.bounds())) {
558
				item.state |= Widget.HOT;
697
				item.state |= Widget.HOT;
559
			} else {
698
			} else {
560
				item.state &= ~Widget.HOT;				
699
				item.state &= ~Widget.HOT;				
Lines 576-581 Link Here
576
	return super.sendMouseEvent(nsEvent, type, send);
715
	return super.sendMouseEvent(nsEvent, type, send);
577
}
716
}
578
717
718
void setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
719
	// In the unified toolbar case, the toolbar view size and position is completely controlled
720
	// by the window, so don't change its bounds or location.
721
	if ((style & SWT.SMOOTH) != 0) return;
722
	super.setBounds(x, y, width, height, move, resize);
723
}
724
	
579
void setFont(NSFont font) {
725
void setFont(NSFont font) {
580
	for (int i = 0; i < itemCount; i++) {
726
	for (int i = 0; i < itemCount; i++) {
581
		ToolItem item = items[i];
727
		ToolItem item = items[i];
Lines 589-594 Link Here
589
	if (redraw && drawCount == 0) relayout();
735
	if (redraw && drawCount == 0) relayout();
590
}
736
}
591
737
738
public void setVisible(boolean visible) {
739
    if (nsToolbar != null) nsToolbar.setVisible(visible);
740
    super.setVisible(visible);
741
}
742
743
int /*long*/ toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar, int /*long*/ itemIdentifier, boolean flag) {
744
	NSString itemID = new NSString(itemIdentifier);
745
	for (int j = 0; j < itemCount; j++) {
746
		ToolItem item = items[j];
747
		if (itemID.isEqual(item.nsItem.itemIdentifier())) {
748
			return item.nsItem.id;
749
		}
750
	}
751
	return 0;
752
}
753
754
/*
755
 * Returns an array of all toolbar item IDs allowed to be in the toolbar. Since the ToolBar created all of the ToolItems
756
 * return all of the item IDs.
757
 */
758
int /*long*/ toolbarAllowedItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) {
759
	NSMutableArray array = NSMutableArray.arrayWithCapacity(itemCount);
760
	for (int i = 0; i < itemCount; i++) {
761
		array.addObject(items[i].nsItem.itemIdentifier());
762
	}
763
	return array.id;
764
}
765
766
/*
767
 * This delegate method isn't really needed because ToolBars aren't customizable, but it's required according to the documentation.
768
 */
769
int /*long*/ toolbarDefaultItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) {
770
	return toolbarAllowedItemIdentifiers(id, sel, toolbar);
771
}
772
773
/*
774
 * toolbarSelectableItemIdentifiers returns an array of all items that can be the selected item, as determined
775
 * by setSelectedItemIdentifier. 
776
 */
777
int /*long*/ toolbarSelectableItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) {
778
	NSMutableArray array = NSMutableArray.arrayWithCapacity(itemCount);
779
	for (int i = 0; i < itemCount; i++) {
780
		if ((items[i].style & SWT.RADIO) != 0) array.addObject(items[i].nsItem.itemIdentifier());
781
	}
782
	return array.id;
783
}
784
592
boolean translateTraversal (int key, NSEvent theEvent, boolean[] consume) {
785
boolean translateTraversal (int key, NSEvent theEvent, boolean[] consume) {
593
	boolean result = super.translateTraversal (key, theEvent, consume);
786
	boolean result = super.translateTraversal (key, theEvent, consume);
594
	if (result) return result;
787
	if (result) return result;
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java (-30 / +200 lines)
Lines 39-45 Link Here
39
public class ToolItem extends Item {
39
public class ToolItem extends Item {
40
	NSView view;
40
	NSView view;
41
	NSButton button;
41
	NSButton button;
42
	int width = DEFAULT_SEPARATOR_WIDTH;
42
	NSToolbarItem nsItem;
43
	NSMenuItem nsMenuRep;
44
	NSString id;
45
	int width;
43
	ToolBar parent;
46
	ToolBar parent;
44
	Image hotImage, disabledImage;
47
	Image hotImage, disabledImage;
45
	String toolTipText;
48
	String toolTipText;
Lines 302-321 Link Here
302
	checkWidget();
305
	checkWidget();
303
	int width = 0, height = 0;
306
	int width = 0, height = 0;
304
	if ((style & SWT.SEPARATOR) != 0) {
307
	if ((style & SWT.SEPARATOR) != 0) {
308
		// In the unified toolbar case the width is ignored if 0, DEFAULT, or SEPARATOR_FILL.
305
		if ((parent.style & SWT.HORIZONTAL) != 0) {
309
		if ((parent.style & SWT.HORIZONTAL) != 0) {
306
			width = getWidth ();
310
			width = getWidth ();
311
			if (width == SWT.DEFAULT) width = DEFAULT_SEPARATOR_WIDTH;
307
			height = DEFAULT_HEIGHT;
312
			height = DEFAULT_HEIGHT;
308
		} else {
313
		} else {
309
			width = DEFAULT_WIDTH;
314
			width = DEFAULT_WIDTH;
310
			height = getWidth ();
315
			height = getWidth ();
316
			if (height == SWT.DEFAULT) width = DEFAULT_SEPARATOR_WIDTH;
311
		}
317
		}
312
		if (control != null) {
318
		if (control != null) {
313
			height = Math.max (height, control.getMininumHeight ());
319
			height = Math.max (height, control.getMininumHeight ());
314
		}
320
		}
315
	} else {
321
	} else {
316
		if (text.length () != 0 || image != null) {
322
		if (text.length () != 0 || image != null) {
317
			NSButton widget = (NSButton)button;
323
			NSSize size = button.cell().cellSize();
318
			NSSize size = widget.cell().cellSize();
319
			width = (int)Math.ceil(size.width);
324
			width = (int)Math.ceil(size.width);
320
			height = (int)Math.ceil(size.height);
325
			height = (int)Math.ceil(size.height);
321
		} else {
326
		} else {
Lines 325-343 Link Here
325
		if ((style & SWT.DROP_DOWN) != 0) {
330
		if ((style & SWT.DROP_DOWN) != 0) {
326
			width += ARROW_WIDTH + INSET;
331
			width += ARROW_WIDTH + INSET;
327
		}
332
		}
328
		width += INSET * 2;
333
		
329
		height += INSET * 2;
334
		if ((style & SWT.SMOOTH) == 0 || image != null) {
335
			width += INSET * 2;
336
			height += INSET * 2;
337
		} else {
338
			height -= 2;
339
		}
330
	}
340
	}
331
	return new Point (width, height);
341
	return new Point (width, height);
332
}
342
}
333
343
334
void createHandle () {
344
void createHandle () {
345
	if ((style & SWT.SMOOTH) != 0) {
346
		id = NSString.stringWith(String.valueOf(ToolBar.NEXT_ID++));
347
		id.retain();
348
		nsItem = ((NSToolbarItem)new NSToolbarItem().alloc()).initWithItemIdentifier(id);
349
		nsItem.setAction(OS.sel_sendSelection);
350
		nsMenuRep = ((NSMenuItem)new SWTMenuItem().alloc()).initWithTitle(NSString.string(), OS.sel_sendSelection, NSString.string());
351
		nsItem.setMenuFormRepresentation(nsMenuRep);
352
	} 
353
335
	if ((style & SWT.SEPARATOR) != 0) {
354
	if ((style & SWT.SEPARATOR) != 0) {
336
		NSBox widget = (NSBox)new SWTBox().alloc();
355
		if ((style & SWT.SMOOTH) != 0) {
337
		widget.init();
356
			view = (NSView)new SWTView().alloc();
338
		widget.setBoxType(OS.NSBoxSeparator);
357
			view.init();
339
		widget.setBorderWidth(0);
358
		} else {
340
		view = widget;
359
			NSBox widget = (NSBox)new SWTBox().alloc();
360
			widget.init();
361
			widget.setBoxType(OS.NSBoxSeparator);
362
			widget.setBorderWidth(0);
363
			view = widget;
364
		}
341
	} else {
365
	} else {
342
		NSView widget = (NSView)new SWTView().alloc();
366
		NSView widget = (NSView)new SWTView().alloc();
343
		widget.init();
367
		widget.init();
Lines 351-356 Link Here
351
		NSButtonCell cell = (NSButtonCell)new SWTButtonCell ().alloc ().init ();
375
		NSButtonCell cell = (NSButtonCell)new SWTButtonCell ().alloc ().init ();
352
		button.setCell (cell);
376
		button.setCell (cell);
353
		cell.release();
377
		cell.release();
378
		if ((style & SWT.SMOOTH) != 0) {
379
			cell.setHighlightsBy(OS.NSContentsCellMask);
380
			cell.setBackgroundStyle(OS.NSBackgroundStyleRaised);
381
		}
354
		button.setBordered(false);
382
		button.setBordered(false);
355
		button.setAction(OS.sel_sendSelection);
383
		button.setAction(OS.sel_sendSelection);
356
		button.setTarget(button);
384
		button.setTarget(button);
Lines 393-404 Link Here
393
			rect.y += 3;			
421
			rect.y += 3;			
394
		}
422
		}
395
	}
423
	}
396
	callSuper (id, sel, image, rect, view);
424
	int /*long*/ cgContext = NSGraphicsContext.currentContext().graphicsPort();
425
	NSCell cell = new NSCell(id);
426
	boolean drawSelected = ((style & SWT.SMOOTH) != 0) && getSelection() && ((style & SWT.CHECK) != 0) && !cell.isHighlighted();
427
428
	if (drawSelected) {
429
		NSGraphicsContext.currentContext().saveGraphicsState();
430
		CGRect cgRect = new CGRect();
431
		cgRect.origin.x = rect.x;
432
		cgRect.origin.y = rect.y;
433
		cgRect.size.width = rect.width;
434
		cgRect.size.height = rect.height;
435
		OS.CGContextBeginTransparencyLayerWithRect(cgContext, cgRect, 0);
436
	}
437
438
	super.drawImageWithFrameInView(id, sel, image, rect, view);
439
440
	if (drawSelected) {
441
		NSColor.colorWithCalibratedRed(0,0,0,.3f).setFill();
442
		OS.NSRectFillUsingOperation(rect, OS.NSCompositeSourceAtop);
443
		OS.CGContextEndTransparencyLayer(cgContext);
444
		NSGraphicsContext.currentContext().restoreGraphicsState();
445
	}
446
}
447
448
NSRect drawTitleWithFrameInView (int /*long*/ id, int /*long*/ sel, int /*long*/ title, NSRect titleRect, int /*long*/ view) {
449
    boolean hiliteShadow = new NSButtonCell(id).isHighlighted() && (style & SWT.SMOOTH) != 0 && text.length() > 0 && image == null;
450
    
451
    // An unbordered cell doesn't draw any highlighting when pushed or selected, so we have to do it here.
452
    if (hiliteShadow) {
453
    	NSColor transWhiteColor = NSColor.colorWithCalibratedRed(1.0f, 1.0f, 1.0f, .8f);
454
		NSAttributedString attribStr = new NSAttributedString(title);
455
		NSMutableAttributedString tmpString = new NSMutableAttributedString(attribStr.mutableCopy());
456
		NSRange range = new NSRange();
457
		range.location = 0;
458
		range.length = attribStr.length();
459
		tmpString.addAttribute(OS.NSForegroundColorAttributeName, transWhiteColor, range);
460
		tmpString.autorelease();
461
		title = tmpString.id;
462
    }
463
	return super.drawTitleWithFrameInView(id, sel, title, titleRect, view);
397
}
464
}
398
465
399
void drawWidget (int /*long*/ id, NSGraphicsContext context, NSRect rect) {
466
void drawWidget (int /*long*/ id, NSGraphicsContext context, NSRect rect) {
400
	if (id == view.id) {
467
	if (id == view.id) {
401
		if (getSelection ()) {
468
		boolean drawSelected = getSelection() && ((style & SWT.SMOOTH) == 0); 
469
		if (drawSelected) {
402
			NSRect bounds = view.bounds();
470
			NSRect bounds = view.bounds();
403
			context.saveGraphicsState();
471
			context.saveGraphicsState();
404
			NSColor.colorWithCalibratedRed(0.1f, 0.1f, 0.1f, 0.1f).setFill();
472
			NSColor.colorWithCalibratedRed(0.1f, 0.1f, 0.1f, 0.1f).setFill();
Lines 435-440 Link Here
435
}
503
}
436
504
437
void enableWidget(boolean enabled) {
505
void enableWidget(boolean enabled) {
506
	if ((style & SWT.SMOOTH) != 0) {
507
		nsItem.setEnabled(enabled);
508
	} 
509
438
	if ((style & SWT.SEPARATOR) == 0) {
510
	if ((style & SWT.SEPARATOR) == 0) {
439
		((NSButton)button).setEnabled(enabled);
511
		((NSButton)button).setEnabled(enabled);
440
		updateImage(true);
512
		updateImage(true);
Lines 454-459 Link Here
454
 */
526
 */
455
public Rectangle getBounds () {
527
public Rectangle getBounds () {
456
	checkWidget();
528
	checkWidget();
529
	if ((style & SWT.SMOOTH) != 0) {
530
		NSRect rect = view.frame();
531
		// ToolItems in the unified toolbar are not contained directly within the Toolbar.
532
		// Convert the toolitem rect from toolitem-relative coordinates to its
533
		// parent, the toolbar, relative coordinates.
534
		rect = parent.view.convertRect_fromView_(rect, view);
535
		return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
536
	} 
537
457
	NSRect rect = view.frame();
538
	NSRect rect = view.frame();
458
	return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
539
	return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
459
}
540
}
Lines 540-545 Link Here
540
	return hotImage;
621
	return hotImage;
541
}
622
}
542
623
624
NSString getItemID() {
625
    NSString itemID = id;
626
    
627
    // For separators, return a Cocoa constant for the tool item ID.
628
    if ((style & SWT.SEPARATOR) != 0) {
629
    	// If we are using a non-default width or control use that instead.  
630
    	if (width <= 0 && control == null) {
631
    		if (width == 0) {
632
    			itemID = OS.NSToolbarSeparatorItemIdentifier;
633
    		} else if (width == SWT.DEFAULT) {
634
    			itemID = OS.NSToolbarSpaceItemIdentifier;
635
    		} else if (width == SWT.SEPARATOR_FILL) {
636
    			itemID = OS.NSToolbarFlexibleSpaceItemIdentifier;
637
    		}
638
    	}
639
    }
640
    
641
    return itemID;
642
}
643
543
/**
644
/**
544
 * Returns the receiver's parent, which must be a <code>ToolBar</code>.
645
 * Returns the receiver's parent, which must be a <code>ToolBar</code>.
545
 *
646
 *
Lines 652-657 Link Here
652
	}
753
	}
653
}
754
}
654
755
756
boolean mouseDownCanMoveWindow(int /*long*/ id, int /*long*/ sel) {
757
	if (id == view.id) return false;
758
	return super.mouseDownCanMoveWindow(id, sel);
759
}
760
655
void mouseUp(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
761
void mouseUp(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
656
	if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseUp)) return;
762
	if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseUp)) return;
657
	super.mouseUp(id, sel, theEvent);
763
	super.mouseUp(id, sel, theEvent);
Lines 737-742 Link Here
737
	if (view != null) view.release ();
843
	if (view != null) view.release ();
738
	if (button != null) button.release ();
844
	if (button != null) button.release ();
739
	view = button = null;
845
	view = button = null;
846
	if (nsItem != null) {
847
	    nsItem.release();
848
	    nsItem = null;
849
	}
850
	if (id != null) {
851
	    id.release();
852
	    id = null;
853
	}
854
	if (nsMenuRep != null) {
855
		nsMenuRep.release();
856
		nsMenuRep = null;
857
	}
740
	parent = null;
858
	parent = null;
741
}
859
}
742
860
Lines 770-787 Link Here
770
888
771
void setBounds (int x, int y, int width, int height) {
889
void setBounds (int x, int y, int width, int height) {
772
	NSRect rect = new NSRect();
890
	NSRect rect = new NSRect();
773
	rect.x = x;
891
	if ((style & SWT.SMOOTH) == 0) {
774
	rect.y = y;
892
		rect.x = x;
775
	rect.width = width;
893
		rect.y = y;
776
	rect.height = height;
777
	view.setFrame(rect);
778
	if (button != null) {
779
		rect.x = 0;
780
		rect.y = 0;
781
		rect.width = width;
894
		rect.width = width;
782
		rect.height = height;
895
		rect.height = height;
783
		if ((style & SWT.DROP_DOWN) != 0) rect.width -= ARROW_WIDTH + INSET;
896
		view.setFrame(rect);
784
		button.setFrame(rect);
897
		if (button != null) {
898
			rect.x = 0;
899
			rect.y = 0;
900
			rect.width = width;
901
			rect.height = height;
902
			if ((style & SWT.DROP_DOWN) != 0) rect.width -= ARROW_WIDTH + INSET;
903
			button.setFrame(rect);
904
		}
905
	} else {
906
		// Let the NSToolbar manage the position of the view in the toolbar.
907
		NSSize newSize = new NSSize();
908
		newSize.height = height;
909
		newSize.width = width;
910
		// Temporarily clear the view. This will force the item and toolbar to re-layout
911
		// when the view is set again.
912
		nsItem.setView(null);
913
		view.setFrameSize(newSize);
914
		if ((style & SWT.DROP_DOWN) != 0) newSize.width -= ARROW_WIDTH + INSET;
915
		if (button != null) button.setFrameSize(newSize);
916
		if ((style & SWT.DROP_DOWN) != 0) newSize.width += ARROW_WIDTH + INSET;
917
		nsItem.setMinSize(newSize);
918
		nsItem.setMaxSize(newSize);
919
		nsItem.setView(view);
785
	}
920
	}
786
}
921
}
787
922
Lines 808-818 Link Here
808
	}
943
	}
809
	if ((style & SWT.SEPARATOR) == 0) return;
944
	if ((style & SWT.SEPARATOR) == 0) return;
810
	if (this.control == control) return;
945
	if (this.control == control) return;
811
	NSBox widget = (NSBox)view;
946
812
	if (control == null) {
947
	if ((style & SWT.SMOOTH) == 0) {
813
		widget.setBoxType(OS.NSBoxSeparator);
948
        NSBox widget = (NSBox)view;
814
	} else {
949
        if (control == null) {
815
		widget.setBoxType(OS.NSBoxCustom);
950
        	widget.setBoxType(OS.NSBoxSeparator);
951
        } else {
952
        	widget.setBoxType(OS.NSBoxCustom);
953
        }
816
	}
954
	}
817
	this.control = control;
955
	this.control = control;
818
	view.setHidden(control != null);
956
	view.setHidden(control != null);
Lines 941-946 Link Here
941
	checkWidget();
1079
	checkWidget();
942
	if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return;
1080
	if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return;
943
	this.selection = selected;
1081
	this.selection = selected;
1082
	
1083
	if ((style & (SWT.RADIO | SWT.SMOOTH)) == (SWT.RADIO | SWT.SMOOTH) && selection) {
1084
		parent.nsToolbar.setSelectedItemIdentifier(nsItem.itemIdentifier());
1085
	}
1086
	
944
	view.setNeedsDisplay(true);
1087
	view.setNeedsDisplay(true);
945
}
1088
}
946
1089
Lines 975-980 Link Here
975
	if ((style & SWT.SEPARATOR) != 0) return;
1118
	if ((style & SWT.SEPARATOR) != 0) return;
976
	super.setText (string);
1119
	super.setText (string);
977
	NSButton widget = (NSButton)button;
1120
	NSButton widget = (NSButton)button;
1121
	if ((style & SWT.SMOOTH) != 0) {
1122
		char [] chars = new char [text.length ()];
1123
		text.getChars (0, chars.length, chars, 0);
1124
		int length = fixMnemonic (chars);
1125
		nsMenuRep.setTitle(NSString.stringWithCharacters(chars, length));
1126
	}
1127
978
	widget.setAttributedTitle(createString());
1128
	widget.setAttributedTitle(createString());
979
	if (text.length() != 0 && image != null) {
1129
	if (text.length() != 0 && image != null) {
980
		if ((parent.style & SWT.RIGHT) != 0) {
1130
		if ((parent.style & SWT.RIGHT) != 0) {
Lines 1010-1017 Link Here
1010
 */
1160
 */
1011
public void setToolTipText (String string) {
1161
public void setToolTipText (String string) {
1012
	checkWidget();
1162
	checkWidget();
1013
	toolTipText = string;
1163
    toolTipText = string;
1014
	parent.checkToolTip (this);
1164
	if ((style & SWT.SMOOTH) != 0) {
1165
        char[] chars = new char [toolTipText.length ()];
1166
        string.getChars (0, chars.length, chars, 0);
1167
        int length = fixMnemonic (chars);
1168
        nsItem.setToolTip(NSString.stringWithCharacters (chars, length));
1169
	} else {
1170
        parent.checkToolTip (this);
1171
	}
1015
}
1172
}
1016
1173
1017
void setVisible (boolean visible) {
1174
void setVisible (boolean visible) {
Lines 1028-1034 Link Here
1028
/**
1185
/**
1029
 * Sets the width of the receiver, for <code>SEPARATOR</code> ToolItems.
1186
 * Sets the width of the receiver, for <code>SEPARATOR</code> ToolItems.
1030
 *
1187
 *
1031
 * @param width the new width
1188
 * @param width the new width. If the new value is <code>SWT.DEFAULT</code>,
1189
 * the width is a fixed-width area whose amount is determined by the platform.
1190
 * If the new value is 0 a vertical or horizontal line will be drawn, depending
1191
 * on the setting of the corresponding style bit (<code>SWT.VERTICAL</code> or 
1192
 * <code>SWT.HORIZONTAL</code>). If the new value is <code>SWT.SEPARATOR_FILL</code>
1193
 * a variable-width space is inserted that acts as a spring between the two adjoining
1194
 * items which will push them out to the extent of the containing ToolBar.
1195
 * 
1032
 *
1196
 *
1033
 * @exception SWTException <ul>
1197
 * @exception SWTException <ul>
1034
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1198
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
Lines 1040-1045 Link Here
1040
	if ((style & SWT.SEPARATOR) == 0) return;
1204
	if ((style & SWT.SEPARATOR) == 0) return;
1041
	if (width < 0 || this.width == width) return;
1205
	if (width < 0 || this.width == width) return;
1042
	this.width = width;
1206
	this.width = width;
1207
	if ((style & SWT.SMOOTH) != 0) {
1208
		NSToolbar toolbar = parent.nsToolbar;
1209
		int index = parent.indexOf(this);
1210
		toolbar.removeItemAtIndex(index);
1211
		toolbar.insertItemWithItemIdentifier(getItemID(), index);
1212
	}
1043
	parent.relayout();
1213
	parent.relayout();
1044
}
1214
}
1045
1215
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java (+20 lines)
Lines 666-671 Link Here
666
}
666
}
667
667
668
void drawImageWithFrameInView (int /*long*/ id, int /*long*/ sel, int /*long*/ image, NSRect rect, int /*long*/ view) {
668
void drawImageWithFrameInView (int /*long*/ id, int /*long*/ sel, int /*long*/ image, NSRect rect, int /*long*/ view) {
669
	callSuper(id, sel, image, rect, view);
669
}
670
}
670
671
671
NSRect drawTitleWithFrameInView (int /*long*/ id, int /*long*/ sel, int /*long*/ title, NSRect rect, int /*long*/ view) {
672
NSRect drawTitleWithFrameInView (int /*long*/ id, int /*long*/ sel, int /*long*/ title, NSRect rect, int /*long*/ view) {
Lines 1062-1067 Link Here
1062
	mouseDownSuper(id, sel, theEvent);
1063
	mouseDownSuper(id, sel, theEvent);
1063
}
1064
}
1064
1065
1066
boolean mouseDownCanMoveWindow(int /*long*/ id, int /*long*/ sel) {
1067
	return callSuperBoolean(id, sel);
1068
}
1069
1065
void mouseDownSuper(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
1070
void mouseDownSuper(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
1066
	callSuper(id, sel, theEvent);
1071
	callSuper(id, sel, theEvent);
1067
}
1072
}
Lines 1922-1927 Link Here
1922
	return result;
1927
	return result;
1923
}
1928
}
1924
1929
1930
int /*long*/ toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar, int /*long*/ itemID, boolean flag) {
1931
	return 0;
1932
}
1933
1934
int /*long*/ toolbarAllowedItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) {
1935
	return 0;
1936
}
1937
1938
int /*long*/ toolbarDefaultItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) {
1939
	return 0;
1940
}
1941
1942
int /*long*/ toolbarSelectableItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) {
1943
	return 0;
1944
}
1925
String tooltipText () {
1945
String tooltipText () {
1926
	return null;
1946
	return null;
1927
}
1947
}
(-)Eclipse SWT/common/org/eclipse/swt/SWT.java (+8 lines)
Lines 1010-1015 Link Here
1010
	 */
1010
	 */
1011
	public static final int SEPARATOR = 1 << 1;
1011
	public static final int SEPARATOR = 1 << 1;
1012
1012
1013
    /**
1014
     * Constant representing a flexible space separator in a ToolBar.
1015
	 * <p><b>Used By:</b><ul>
1016
	 * <li><code>ToolItem</code></li>
1017
	 * </ul></p>
1018
     */
1019
    public static final int SEPARATOR_FILL = -2;
1020
1013
	/**
1021
	/**
1014
	 * Style constant for toggle button behavior (value is 1&lt;&lt;1).
1022
	 * Style constant for toggle button behavior (value is 1&lt;&lt;1).
1015
	 * <p><b>Used By:</b><ul>
1023
	 * <p><b>Used By:</b><ul>

Return to bug 222859