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/make_macosx.mak (-2 / +2 lines)
Lines 44-52 Link Here
44
	-Wno-non-virtual-dtor -include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include 
44
	-Wno-non-virtual-dtor -include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include 
45
XULRUNNERLFLAGS = $(LFLAGS)
45
XULRUNNERLFLAGS = $(LFLAGS)
46
46
47
all: $(SWT_LIB) $(SWTPI_LIB) $(AWT_LIB) $(XULRUNNER_LIB)
47
all: $(SWT_LIB) $(SWTPI_LIB) $(AWT_LIB)
48
48
49
all_x86_64: $(SWT_LIB) $(SWTPI_LIB) $(AWT_LIB) $(XULRUNNER_LIB)
49
all_x86_64: $(SWT_LIB) $(SWTPI_LIB) $(AWT_LIB)
50
50
51
.c.o:
51
.c.o:
52
	cc $(CFLAGS) $*.c
52
	cc $(CFLAGS) $*.c
(-)Eclipse SWT PI/cocoa/library/os.c (+30 lines)
Lines 9440-9445 Link Here
9440
}
9440
}
9441
#endif
9441
#endif
9442
9442
9443
#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))
9444
#ifndef JNI64
9445
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)
9446
#else
9447
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)
9448
#endif
9449
{
9450
	NSPoint _arg2, *lparg2=NULL;
9451
	NSRect _arg3, *lparg3=NULL;
9452
	jboolean rc = 0;
9453
#ifndef JNI64
9454
	OS_NATIVE_ENTER(env, that, objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
9455
#else
9456
	OS_NATIVE_ENTER(env, that, objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
9457
#endif
9458
	if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
9459
	if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
9460
	rc = (jboolean)((BOOL (*)(jintLong, jintLong, NSPoint, NSRect))objc_msgSend_bool)(arg0, arg1, *lparg2, *lparg3);
9461
fail:
9462
	if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
9463
	if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
9464
#ifndef JNI64
9465
	OS_NATIVE_EXIT(env, that, objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
9466
#else
9467
	OS_NATIVE_EXIT(env, that, objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
9468
#endif
9469
	return rc;
9470
}
9471
#endif
9472
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))
9473
#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
9474
#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)
9475
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 / +7 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 = 611;
18
int OS_nativeFunctionCallCount[610];
18
int OS_nativeFunctionCallCount[611];
19
char * OS_nativeFunctionNames[] = {
19
char * OS_nativeFunctionNames[] = {
20
	"ATSFontActivateFromFileReference",
20
	"ATSFontActivateFromFileReference",
21
	"AcquireRootMenu",
21
	"AcquireRootMenu",
Lines 1081-1086 Link Here
1081
	"objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2",
1081
	"objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2",
1082
#endif
1082
#endif
1083
#ifndef JNI64
1083
#ifndef JNI64
1084
	"objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2",
1085
#else
1086
	"objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2",
1087
#endif
1088
#ifndef JNI64
1084
	"objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I",
1089
	"objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I",
1085
#else
1090
#else
1086
	"objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J",
1091
	"objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J",
(-)Eclipse SWT PI/cocoa/library/os_stats.h (+5 lines)
Lines 1089-1094 Link Here
1089
	objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
1089
	objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
1090
#endif
1090
#endif
1091
#ifndef JNI64
1091
#ifndef JNI64
1092
	objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
1093
#else
1094
	objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
1095
#endif
1096
#ifndef JNI64
1092
	objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
1097
	objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
1093
#else
1098
#else
1094
	objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J_FUNC,
1099
	objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J_FUNC,
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras (+55 lines)
Lines 650-659 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>
656
		</method>
660
		</method>
661
		<method selector="setShowsStateBy:" swt_gen="true">
662
			<arg swt_gen="true"></arg>
663
			<retval swt_gen="true"></retval>
664
		</method>
657
		<method selector="title" swt_gen="true">
665
		<method selector="title" swt_gen="true">
658
			<retval swt_gen="true"></retval>
666
			<retval swt_gen="true"></retval>
659
		</method>
667
		</method>
Lines 742-747 Link Here
742
			<arg swt_gen="true"></arg>
750
			<arg swt_gen="true"></arg>
743
			<retval swt_gen="true"></retval>
751
			<retval swt_gen="true"></retval>
744
		</method>
752
		</method>
753
		<method selector="setBackgroundStyle:" swt_gen="true">
754
			<arg swt_gen="true"></arg>
755
			<retval swt_gen="true"></retval>
756
		</method>
745
		<method selector="setBaseWritingDirection:" swt_gen="true">
757
		<method selector="setBaseWritingDirection:" swt_gen="true">
746
			<arg swt_gen="true"></arg>
758
			<arg swt_gen="true"></arg>
747
			<retval swt_gen="true"></retval>
759
			<retval swt_gen="true"></retval>
Lines 3547-3552 Link Here
3547
			<arg swt_gen="true"></arg>
3559
			<arg swt_gen="true"></arg>
3548
			<retval swt_gen="true"></retval>
3560
			<retval swt_gen="true"></retval>
3549
		</method>
3561
		</method>
3562
		<method selector="isVisible" swt_gen="true">
3563
			<retval swt_gen="true"></retval>
3564
		</method>
3550
		<method selector="removeItemAtIndex:" swt_gen="true">
3565
		<method selector="removeItemAtIndex:" swt_gen="true">
3551
			<arg swt_gen="true"></arg>
3566
			<arg swt_gen="true"></arg>
3552
			<retval swt_gen="true"></retval>
3567
			<retval swt_gen="true"></retval>
Lines 3563-3568 Link Here
3563
			<arg swt_gen="true"></arg>
3578
			<arg swt_gen="true"></arg>
3564
			<retval swt_gen="true"></retval>
3579
			<retval swt_gen="true"></retval>
3565
		</method>
3580
		</method>
3581
		<method selector="setSelectedItemIdentifier:" swt_gen="true">
3582
			<arg swt_gen="true"></arg>
3583
			<retval swt_gen="true"></retval>
3584
		</method>
3566
		<method selector="setVisible:" swt_gen="true">
3585
		<method selector="setVisible:" swt_gen="true">
3567
			<arg swt_gen="true"></arg>
3586
			<arg swt_gen="true"></arg>
3568
			<retval swt_gen="true"></retval>
3587
			<retval swt_gen="true"></retval>
Lines 3596-3601 Link Here
3596
			<arg swt_gen="true"></arg>
3615
			<arg swt_gen="true"></arg>
3597
			<retval swt_gen="true"></retval>
3616
			<retval swt_gen="true"></retval>
3598
		</method>
3617
		</method>
3618
		<method selector="setMenuFormRepresentation:" swt_gen="true">
3619
			<arg swt_gen="true"></arg>
3620
			<retval swt_gen="true"></retval>
3621
		</method>
3599
		<method selector="setMinSize:" swt_gen="true">
3622
		<method selector="setMinSize:" swt_gen="true">
3600
			<arg swt_gen="true"></arg>
3623
			<arg swt_gen="true"></arg>
3601
			<retval swt_gen="true"></retval>
3624
			<retval swt_gen="true"></retval>
Lines 3616-3621 Link Here
3616
			<arg swt_gen="true"></arg>
3639
			<arg swt_gen="true"></arg>
3617
			<retval swt_gen="true"></retval>
3640
			<retval swt_gen="true"></retval>
3618
		</method>
3641
		</method>
3642
		<method selector="view" swt_gen="true">
3643
			<retval swt_gen="true"></retval>
3644
		</method>
3619
	</class>
3645
	</class>
3620
	<class name="NSToolbarItemGroup" swt_superclass="NSToolbarItem">
3646
	<class name="NSToolbarItemGroup" swt_superclass="NSToolbarItem">
3621
	</class>
3647
	</class>
Lines 3676-3681 Link Here
3676
			<arg swt_gen="true"></arg>
3702
			<arg swt_gen="true"></arg>
3677
			<retval swt_gen="true"></retval>
3703
			<retval swt_gen="true"></retval>
3678
		</method>
3704
		</method>
3705
		<method selector="autoresizingMask" swt_gen="true">
3706
			<retval swt_gen="true"></retval>
3707
		</method>
3679
		<method selector="beginDocument" swt_gen="true">
3708
		<method selector="beginDocument" swt_gen="true">
3680
			<retval swt_gen="true"></retval>
3709
			<retval swt_gen="true"></retval>
3681
		</method>
3710
		</method>
Lines 3808-3813 Link Here
3808
			<arg swt_gen="true"></arg>
3837
			<arg swt_gen="true"></arg>
3809
			<retval swt_gen="true"></retval>
3838
			<retval swt_gen="true"></retval>
3810
		</method>
3839
		</method>
3840
		<method selector="mouse:inRect:" swt_gen="true">
3841
			<arg swt_gen="true"></arg>
3842
			<arg swt_gen="true"></arg>
3843
			<retval swt_gen="true"></retval>
3844
		</method>
3845
		<method selector="mouseDownCanMoveWindow" swt_gen="true">
3846
			<retval swt_gen="true"></retval>
3847
		</method>
3811
		<method selector="registerForDraggedTypes:" swt_gen="true">
3848
		<method selector="registerForDraggedTypes:" swt_gen="true">
3812
			<arg swt_gen="true"></arg>
3849
			<arg swt_gen="true"></arg>
3813
			<retval swt_gen="true"></retval>
3850
			<retval swt_gen="true"></retval>
Lines 3940-3945 Link Here
3940
		<method selector="close" swt_gen="true">
3977
		<method selector="close" swt_gen="true">
3941
			<retval swt_gen="true"></retval>
3978
			<retval swt_gen="true"></retval>
3942
		</method>
3979
		</method>
3980
		<method class_method="true" selector="contentRectForFrameRect:styleMask:" swt_gen="true">
3981
			<arg swt_gen="true"></arg>
3982
			<arg swt_gen="true"></arg>
3983
			<retval swt_gen="true"></retval>
3984
		</method>
3943
		<method selector="contentView" swt_gen="true">
3985
		<method selector="contentView" swt_gen="true">
3944
			<retval swt_gen="true" swt_java_type="NSView"></retval>
3986
			<retval swt_gen="true" swt_java_type="NSView"></retval>
3945
		</method>
3987
		</method>
Lines 4460-4465 Link Here
4460
	<enum name="NSApplicationDefined" swt_gen="true"></enum>
4502
	<enum name="NSApplicationDefined" swt_gen="true"></enum>
4461
	<enum name="NSApplicationDelegateReplySuccess" swt_gen="true"></enum>
4503
	<enum name="NSApplicationDelegateReplySuccess" swt_gen="true"></enum>
4462
	<enum name="NSAtTop" swt_gen="true"></enum>
4504
	<enum name="NSAtTop" swt_gen="true"></enum>
4505
	<enum name="NSBackgroundStyleDark" swt_gen="true"></enum>
4506
	<enum name="NSBackgroundStyleLight" swt_gen="true"></enum>
4507
	<enum name="NSBackgroundStyleLowered" swt_gen="true"></enum>
4508
	<enum name="NSBackgroundStyleRaised" swt_gen="true"></enum>
4463
	<enum name="NSBackingStoreBuffered" swt_gen="true"></enum>
4509
	<enum name="NSBackingStoreBuffered" swt_gen="true"></enum>
4464
	<enum name="NSBackspaceCharacter" swt_gen="true"></enum>
4510
	<enum name="NSBackspaceCharacter" swt_gen="true"></enum>
4465
	<enum name="NSBevelLineJoinStyle" swt_gen="true"></enum>
4511
	<enum name="NSBevelLineJoinStyle" swt_gen="true"></enum>
Lines 4473-4478 Link Here
4473
	<enum name="NSCancelButton" swt_gen="true"></enum>
4519
	<enum name="NSCancelButton" swt_gen="true"></enum>
4474
	<enum name="NSCarriageReturnCharacter" swt_gen="true"></enum>
4520
	<enum name="NSCarriageReturnCharacter" swt_gen="true"></enum>
4475
	<enum name="NSCenterTextAlignment" swt_gen="true"></enum>
4521
	<enum name="NSCenterTextAlignment" swt_gen="true"></enum>
4522
	<enum name="NSChangeBackgroundCellMask" swt_gen="true"></enum>
4523
	<enum name="NSChangeGrayCellMask" swt_gen="true"></enum>
4476
	<enum name="NSClockAndCalendarDatePickerStyle" swt_gen="true"></enum>
4524
	<enum name="NSClockAndCalendarDatePickerStyle" swt_gen="true"></enum>
4477
	<enum name="NSClosableWindowMask" swt_gen="true"></enum>
4525
	<enum name="NSClosableWindowMask" swt_gen="true"></enum>
4478
	<enum name="NSClosePathBezierPathElement" swt_gen="true"></enum>
4526
	<enum name="NSClosePathBezierPathElement" swt_gen="true"></enum>
Lines 4481-4486 Link Here
4481
	<enum name="NSCompositeCopy" swt_gen="true"></enum>
4529
	<enum name="NSCompositeCopy" swt_gen="true"></enum>
4482
	<enum name="NSCompositeSourceOver" swt_gen="true"></enum>
4530
	<enum name="NSCompositeSourceOver" swt_gen="true"></enum>
4483
	<enum name="NSCompositeXOR" swt_gen="true"></enum>
4531
	<enum name="NSCompositeXOR" swt_gen="true"></enum>
4532
	<enum name="NSContentsCellMask" swt_gen="true"></enum>
4484
	<enum name="NSControlKeyMask" swt_gen="true"></enum>
4533
	<enum name="NSControlKeyMask" swt_gen="true"></enum>
4485
	<enum name="NSCriticalAlertStyle" swt_gen="true"></enum>
4534
	<enum name="NSCriticalAlertStyle" swt_gen="true"></enum>
4486
	<enum name="NSCurveToBezierPathElement" swt_gen="true"></enum>
4535
	<enum name="NSCurveToBezierPathElement" swt_gen="true"></enum>
Lines 4547-4552 Link Here
4547
	<enum name="NSNonZeroWindingRule" swt_gen="true"></enum>
4596
	<enum name="NSNonZeroWindingRule" swt_gen="true"></enum>
4548
	<enum name="NSNonactivatingPanelMask" swt_gen="true"></enum>
4597
	<enum name="NSNonactivatingPanelMask" swt_gen="true"></enum>
4549
	<enum name="NSOffState" swt_gen="true"></enum>
4598
	<enum name="NSOffState" swt_gen="true"></enum>
4599
	<enum name="NSOnOffButton" swt_gen="true"></enum>
4550
	<enum name="NSOnState" swt_gen="true"></enum>
4600
	<enum name="NSOnState" swt_gen="true"></enum>
4551
	<enum name="NSOpenGLPFAAccumSize" swt_gen="true"></enum>
4601
	<enum name="NSOpenGLPFAAccumSize" swt_gen="true"></enum>
4552
	<enum name="NSOpenGLPFAAlphaSize" swt_gen="true"></enum>
4602
	<enum name="NSOpenGLPFAAlphaSize" swt_gen="true"></enum>
Lines 4566-4571 Link Here
4566
	<enum name="NSPortraitOrientation" swt_gen="true"></enum>
4616
	<enum name="NSPortraitOrientation" swt_gen="true"></enum>
4567
	<enum name="NSPrintPanelShowsPageSetupAccessory" swt_gen="true"></enum>
4617
	<enum name="NSPrintPanelShowsPageSetupAccessory" swt_gen="true"></enum>
4568
	<enum name="NSProgressIndicatorPreferredThickness" swt_gen="true"></enum>
4618
	<enum name="NSProgressIndicatorPreferredThickness" swt_gen="true"></enum>
4619
	<enum name="NSPushInCellMask" swt_gen="true"></enum>
4569
	<enum name="NSPushOnPushOffButton" swt_gen="true"></enum>
4620
	<enum name="NSPushOnPushOffButton" swt_gen="true"></enum>
4570
	<enum name="NSRadioButton" swt_gen="true"></enum>
4621
	<enum name="NSRadioButton" swt_gen="true"></enum>
4571
	<enum name="NSRegularControlSize" swt_gen="true"></enum>
4622
	<enum name="NSRegularControlSize" swt_gen="true"></enum>
Lines 4606-4611 Link Here
4606
	<enum name="NSTerminateNow" swt_gen="true"></enum>
4657
	<enum name="NSTerminateNow" swt_gen="true"></enum>
4607
	<enum name="NSTextFieldAndStepperDatePickerStyle" swt_gen="true"></enum>
4658
	<enum name="NSTextFieldAndStepperDatePickerStyle" swt_gen="true"></enum>
4608
	<enum name="NSTitledWindowMask" swt_gen="true"></enum>
4659
	<enum name="NSTitledWindowMask" swt_gen="true"></enum>
4660
	<enum name="NSToggleButton" swt_gen="true"></enum>
4661
	<enum name="NSToolbarDisplayModeIconAndLabel" swt_gen="true"></enum>
4662
	<enum name="NSToolbarDisplayModeIconOnly" swt_gen="true"></enum>
4663
	<enum name="NSToolbarDisplayModeLabelOnly" swt_gen="true"></enum>
4609
	<enum name="NSUnderlineStyleDouble" swt_gen="true"></enum>
4664
	<enum name="NSUnderlineStyleDouble" swt_gen="true"></enum>
4610
	<enum name="NSUnderlineStyleNone" swt_gen="true"></enum>
4665
	<enum name="NSUnderlineStyleNone" swt_gen="true"></enum>
4611
	<enum name="NSUnderlineStyleSingle" swt_gen="true"></enum>
4666
	<enum name="NSUnderlineStyleSingle" swt_gen="true"></enum>
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java (+8 lines)
Lines 47-56 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
}
53
57
58
public void setShowsStateBy(int /*long*/ aType) {
59
	OS.objc_msgSend(this.id, OS.sel_setShowsStateBy_, aType);
60
}
61
54
public NSString title() {
62
public NSString title() {
55
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_title);
63
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_title);
56
	return result != 0 ? new NSString(result) : null;
64
	return result != 0 ? new NSString(result) : null;
(-)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/NSColorPanel.java (-1 / +7 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 38-43 Link Here
38
	return result != 0 ? new NSColorPanel(result) : null;
38
	return result != 0 ? new NSColorPanel(result) : null;
39
}
39
}
40
40
41
public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) {
42
	NSRect result = new NSRect();
43
	OS.objc_msgSend_stret(result, OS.class_NSColorPanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle);
44
	return result;
45
}
46
41
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
47
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
42
	return (float)OS.objc_msgSend_fpret(OS.class_NSColorPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
48
	return (float)OS.objc_msgSend_fpret(OS.class_NSColorPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
43
}
49
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontPanel.java (-1 / +7 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 38-43 Link Here
38
	return result != 0 ? new NSFontPanel(result) : null;
38
	return result != 0 ? new NSFontPanel(result) : null;
39
}
39
}
40
40
41
public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) {
42
	NSRect result = new NSRect();
43
	OS.objc_msgSend_stret(result, OS.class_NSFontPanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle);
44
	return result;
45
}
46
41
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
47
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
42
	return (float)OS.objc_msgSend_fpret(OS.class_NSFontPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
48
	return (float)OS.objc_msgSend_fpret(OS.class_NSFontPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
43
}
49
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenPanel.java (-1 / +7 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 51-56 Link Here
51
	return result != 0 ? new NSSavePanel(result) : null;
51
	return result != 0 ? new NSSavePanel(result) : null;
52
}
52
}
53
53
54
public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) {
55
	NSRect result = new NSRect();
56
	OS.objc_msgSend_stret(result, OS.class_NSOpenPanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle);
57
	return result;
58
}
59
54
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
60
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
55
	return (float)OS.objc_msgSend_fpret(OS.class_NSOpenPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
61
	return (float)OS.objc_msgSend_fpret(OS.class_NSOpenPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
56
}
62
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPanel.java (+6 lines)
Lines 40-45 Link Here
40
	return OS.objc_msgSend_bool(this.id, OS.sel_worksWhenModal);
40
	return OS.objc_msgSend_bool(this.id, OS.sel_worksWhenModal);
41
}
41
}
42
42
43
public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) {
44
	NSRect result = new NSRect();
45
	OS.objc_msgSend_stret(result, OS.class_NSPanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle);
46
	return result;
47
}
48
43
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
49
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
44
	return (float)OS.objc_msgSend_fpret(OS.class_NSPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
50
	return (float)OS.objc_msgSend_fpret(OS.class_NSPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
45
}
51
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java (-1 / +7 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 66-71 Link Here
66
	OS.objc_msgSend(this.id, OS.sel_validateVisibleColumns);
66
	OS.objc_msgSend(this.id, OS.sel_validateVisibleColumns);
67
}
67
}
68
68
69
public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) {
70
	NSRect result = new NSRect();
71
	OS.objc_msgSend_stret(result, OS.class_NSSavePanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle);
72
	return result;
73
}
74
69
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
75
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
70
	return (float)OS.objc_msgSend_fpret(OS.class_NSSavePanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
76
	return (float)OS.objc_msgSend_fpret(OS.class_NSSavePanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
71
}
77
}
(-)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 / +10 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
}
Lines 74-77 Link Here
74
	OS.objc_msgSend(this.id, OS.sel_setView_, view != null ? view.id : 0);
78
	OS.objc_msgSend(this.id, OS.sel_setView_, view != null ? view.id : 0);
75
}
79
}
76
80
81
public NSView view() {
82
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_view);
83
	return result != 0 ? new NSView(result) : null;
84
}
85
77
}
86
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java (+12 lines)
Lines 40-45 Link Here
40
	return OS.objc_msgSend(this.id, OS.sel_addToolTipRect_owner_userData_, aRect, anObject != null ? anObject.id : 0, data);
40
	return OS.objc_msgSend(this.id, OS.sel_addToolTipRect_owner_userData_, aRect, anObject != null ? anObject.id : 0, data);
41
}
41
}
42
42
43
public int /*long*/ autoresizingMask() {
44
	return OS.objc_msgSend(this.id, OS.sel_autoresizingMask);
45
}
46
43
public void beginDocument() {
47
public void beginDocument() {
44
	OS.objc_msgSend(this.id, OS.sel_beginDocument);
48
	OS.objc_msgSend(this.id, OS.sel_beginDocument);
45
}
49
}
Lines 203-208 Link Here
203
	return result != 0 ? new NSMenu(result) : null;
207
	return result != 0 ? new NSMenu(result) : null;
204
}
208
}
205
209
210
public boolean mouse(NSPoint aPoint, NSRect aRect) {
211
	return OS.objc_msgSend_bool(this.id, OS.sel_mouse_inRect_, aPoint, aRect);
212
}
213
214
public boolean mouseDownCanMoveWindow() {
215
	return OS.objc_msgSend_bool(this.id, OS.sel_mouseDownCanMoveWindow);
216
}
217
206
public void registerForDraggedTypes(NSArray newTypes) {
218
public void registerForDraggedTypes(NSArray newTypes) {
207
	OS.objc_msgSend(this.id, OS.sel_registerForDraggedTypes_, newTypes != null ? newTypes.id : 0);
219
	OS.objc_msgSend(this.id, OS.sel_registerForDraggedTypes_, newTypes != null ? newTypes.id : 0);
208
}
220
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindow.java (+6 lines)
Lines 54-59 Link Here
54
	OS.objc_msgSend(this.id, OS.sel_close);
54
	OS.objc_msgSend(this.id, OS.sel_close);
55
}
55
}
56
56
57
public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) {
58
	NSRect result = new NSRect();
59
	OS.objc_msgSend_stret(result, OS.class_NSWindow, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle);
60
	return result;
61
}
62
57
public NSView contentView() {
63
public NSView contentView() {
58
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_contentView);
64
	int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_contentView);
59
	return result != 0 ? new NSView(result) : null;
65
	return result != 0 ? new NSView(result) : null;
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java (+30 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 879-884 Link Here
879
public static final int /*long*/ sel_attributedTitle = sel_registerName("attributedTitle");
881
public static final int /*long*/ sel_attributedTitle = sel_registerName("attributedTitle");
880
public static final int /*long*/ sel_attributesAtIndex_longestEffectiveRange_inRange_ = sel_registerName("attributesAtIndex:longestEffectiveRange:inRange:");
882
public static final int /*long*/ sel_attributesAtIndex_longestEffectiveRange_inRange_ = sel_registerName("attributesAtIndex:longestEffectiveRange:inRange:");
881
public static final int /*long*/ sel_autorelease = sel_registerName("autorelease");
883
public static final int /*long*/ sel_autorelease = sel_registerName("autorelease");
884
public static final int /*long*/ sel_autoresizingMask = sel_registerName("autoresizingMask");
882
public static final int /*long*/ sel_availableFontFamilies = sel_registerName("availableFontFamilies");
885
public static final int /*long*/ sel_availableFontFamilies = sel_registerName("availableFontFamilies");
883
public static final int /*long*/ sel_availableFonts = sel_registerName("availableFonts");
886
public static final int /*long*/ sel_availableFonts = sel_registerName("availableFonts");
884
public static final int /*long*/ sel_availableMembersOfFontFamily_ = sel_registerName("availableMembersOfFontFamily:");
887
public static final int /*long*/ sel_availableMembersOfFontFamily_ = sel_registerName("availableMembersOfFontFamily:");
Lines 980-985 Link Here
980
public static final int /*long*/ sel_containsObject_ = sel_registerName("containsObject:");
983
public static final int /*long*/ sel_containsObject_ = sel_registerName("containsObject:");
981
public static final int /*long*/ sel_containsPoint_ = sel_registerName("containsPoint:");
984
public static final int /*long*/ sel_containsPoint_ = sel_registerName("containsPoint:");
982
public static final int /*long*/ sel_contentRect = sel_registerName("contentRect");
985
public static final int /*long*/ sel_contentRect = sel_registerName("contentRect");
986
public static final int /*long*/ sel_contentRectForFrameRect_styleMask_ = sel_registerName("contentRectForFrameRect:styleMask:");
983
public static final int /*long*/ sel_contentSize = sel_registerName("contentSize");
987
public static final int /*long*/ sel_contentSize = sel_registerName("contentSize");
984
public static final int /*long*/ sel_contentSizeForFrameSize_hasHorizontalScroller_hasVerticalScroller_borderType_ = sel_registerName("contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType:");
988
public static final int /*long*/ sel_contentSizeForFrameSize_hasHorizontalScroller_hasVerticalScroller_borderType_ = sel_registerName("contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType:");
985
public static final int /*long*/ sel_contentView = sel_registerName("contentView");
989
public static final int /*long*/ sel_contentView = sel_registerName("contentView");
Lines 1375-1381 Link Here
1375
public static final int /*long*/ sel_minuteOfHour = sel_registerName("minuteOfHour");
1379
public static final int /*long*/ sel_minuteOfHour = sel_registerName("minuteOfHour");
1376
public static final int /*long*/ sel_modifierFlags = sel_registerName("modifierFlags");
1380
public static final int /*long*/ sel_modifierFlags = sel_registerName("modifierFlags");
1377
public static final int /*long*/ sel_monthOfYear = sel_registerName("monthOfYear");
1381
public static final int /*long*/ sel_monthOfYear = sel_registerName("monthOfYear");
1382
public static final int /*long*/ sel_mouse_inRect_ = sel_registerName("mouse:inRect:");
1378
public static final int /*long*/ sel_mouseDown_ = sel_registerName("mouseDown:");
1383
public static final int /*long*/ sel_mouseDown_ = sel_registerName("mouseDown:");
1384
public static final int /*long*/ sel_mouseDownCanMoveWindow = sel_registerName("mouseDownCanMoveWindow");
1379
public static final int /*long*/ sel_mouseDragged_ = sel_registerName("mouseDragged:");
1385
public static final int /*long*/ sel_mouseDragged_ = sel_registerName("mouseDragged:");
1380
public static final int /*long*/ sel_mouseEntered_ = sel_registerName("mouseEntered:");
1386
public static final int /*long*/ sel_mouseEntered_ = sel_registerName("mouseEntered:");
1381
public static final int /*long*/ sel_mouseExited_ = sel_registerName("mouseExited:");
1387
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:");
1646
public static final int /*long*/ sel_setAutosaveExpandedItems_ = sel_registerName("setAutosaveExpandedItems:");
1641
public static final int /*long*/ sel_setBackgroundColor_ = sel_registerName("setBackgroundColor:");
1647
public static final int /*long*/ sel_setBackgroundColor_ = sel_registerName("setBackgroundColor:");
1642
public static final int /*long*/ sel_setBackgroundLayoutEnabled_ = sel_registerName("setBackgroundLayoutEnabled:");
1648
public static final int /*long*/ sel_setBackgroundLayoutEnabled_ = sel_registerName("setBackgroundLayoutEnabled:");
1649
public static final int /*long*/ sel_setBackgroundStyle_ = sel_registerName("setBackgroundStyle:");
1643
public static final int /*long*/ sel_setBadgeLabel_ = sel_registerName("setBadgeLabel:");
1650
public static final int /*long*/ sel_setBadgeLabel_ = sel_registerName("setBadgeLabel:");
1644
public static final int /*long*/ sel_setBaseWritingDirection_ = sel_registerName("setBaseWritingDirection:");
1651
public static final int /*long*/ sel_setBaseWritingDirection_ = sel_registerName("setBaseWritingDirection:");
1645
public static final int /*long*/ sel_setBaseWritingDirection_range_ = sel_registerName("setBaseWritingDirection:range:");
1652
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:");
1739
public static final int /*long*/ sel_setHighlightMode_ = sel_registerName("setHighlightMode:");
1733
public static final int /*long*/ sel_setHighlighted_ = sel_registerName("setHighlighted:");
1740
public static final int /*long*/ sel_setHighlighted_ = sel_registerName("setHighlighted:");
1734
public static final int /*long*/ sel_setHighlightedTableColumn_ = sel_registerName("setHighlightedTableColumn:");
1741
public static final int /*long*/ sel_setHighlightedTableColumn_ = sel_registerName("setHighlightedTableColumn:");
1742
public static final int /*long*/ sel_setHighlightsBy_ = sel_registerName("setHighlightsBy:");
1735
public static final int /*long*/ sel_setHorizontalScroller_ = sel_registerName("setHorizontalScroller:");
1743
public static final int /*long*/ sel_setHorizontalScroller_ = sel_registerName("setHorizontalScroller:");
1736
public static final int /*long*/ sel_setHorizontallyResizable_ = sel_registerName("setHorizontallyResizable:");
1744
public static final int /*long*/ sel_setHorizontallyResizable_ = sel_registerName("setHorizontallyResizable:");
1737
public static final int /*long*/ sel_setIcon_ = sel_registerName("setIcon:");
1745
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:");
1783
public static final int /*long*/ sel_setMaximumIntegerDigits_ = sel_registerName("setMaximumIntegerDigits:");
1776
public static final int /*long*/ sel_setMenu_ = sel_registerName("setMenu:");
1784
public static final int /*long*/ sel_setMenu_ = sel_registerName("setMenu:");
1777
public static final int /*long*/ sel_setMenu_forSegment_ = sel_registerName("setMenu:forSegment:");
1785
public static final int /*long*/ sel_setMenu_forSegment_ = sel_registerName("setMenu:forSegment:");
1786
public static final int /*long*/ sel_setMenuFormRepresentation_ = sel_registerName("setMenuFormRepresentation:");
1778
public static final int /*long*/ sel_setMessage_ = sel_registerName("setMessage:");
1787
public static final int /*long*/ sel_setMessage_ = sel_registerName("setMessage:");
1779
public static final int /*long*/ sel_setMessageText_ = sel_registerName("setMessageText:");
1788
public static final int /*long*/ sel_setMessageText_ = sel_registerName("setMessageText:");
1780
public static final int /*long*/ sel_setMinSize_ = sel_registerName("setMinSize:");
1789
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:");
1826
public static final int /*long*/ sel_setSegmentStyle_ = sel_registerName("setSegmentStyle:");
1818
public static final int /*long*/ sel_setSelectable_ = sel_registerName("setSelectable:");
1827
public static final int /*long*/ sel_setSelectable_ = sel_registerName("setSelectable:");
1819
public static final int /*long*/ sel_setSelected_forSegment_ = sel_registerName("setSelected:forSegment:");
1828
public static final int /*long*/ sel_setSelected_forSegment_ = sel_registerName("setSelected:forSegment:");
1829
public static final int /*long*/ sel_setSelectedItemIdentifier_ = sel_registerName("setSelectedItemIdentifier:");
1820
public static final int /*long*/ sel_setSelectedRange_ = sel_registerName("setSelectedRange:");
1830
public static final int /*long*/ sel_setSelectedRange_ = sel_registerName("setSelectedRange:");
1821
public static final int /*long*/ sel_setSelectedSegment_ = sel_registerName("setSelectedSegment:");
1831
public static final int /*long*/ sel_setSelectedSegment_ = sel_registerName("setSelectedSegment:");
1822
public static final int /*long*/ sel_setSelectedTextAttributes_ = sel_registerName("setSelectedTextAttributes:");
1832
public static final int /*long*/ sel_setSelectedTextAttributes_ = sel_registerName("setSelectedTextAttributes:");
Lines 1826-1831 Link Here
1826
public static final int /*long*/ sel_setShowsPrintPanel_ = sel_registerName("setShowsPrintPanel:");
1836
public static final int /*long*/ sel_setShowsPrintPanel_ = sel_registerName("setShowsPrintPanel:");
1827
public static final int /*long*/ sel_setShowsProgressPanel_ = sel_registerName("setShowsProgressPanel:");
1837
public static final int /*long*/ sel_setShowsProgressPanel_ = sel_registerName("setShowsProgressPanel:");
1828
public static final int /*long*/ sel_setShowsResizeIndicator_ = sel_registerName("setShowsResizeIndicator:");
1838
public static final int /*long*/ sel_setShowsResizeIndicator_ = sel_registerName("setShowsResizeIndicator:");
1839
public static final int /*long*/ sel_setShowsStateBy_ = sel_registerName("setShowsStateBy:");
1829
public static final int /*long*/ sel_setShowsToolbarButton_ = sel_registerName("setShowsToolbarButton:");
1840
public static final int /*long*/ sel_setShowsToolbarButton_ = sel_registerName("setShowsToolbarButton:");
1830
public static final int /*long*/ sel_setSize_ = sel_registerName("setSize:");
1841
public static final int /*long*/ sel_setSize_ = sel_registerName("setSize:");
1831
public static final int /*long*/ sel_setState_ = sel_registerName("setState:");
1842
public static final int /*long*/ sel_setState_ = sel_registerName("setState:");
Lines 2087-2092 Link Here
2087
public static final int NSApplicationDefined = 15;
2098
public static final int NSApplicationDefined = 15;
2088
public static final int NSApplicationDelegateReplySuccess = 0;
2099
public static final int NSApplicationDelegateReplySuccess = 0;
2089
public static final int NSAtTop = 2;
2100
public static final int NSAtTop = 2;
2101
public static final int NSBackgroundStyleDark = 1;
2102
public static final int NSBackgroundStyleLight = 0;
2103
public static final int NSBackgroundStyleLowered = 3;
2104
public static final int NSBackgroundStyleRaised = 2;
2090
public static final int NSBackingStoreBuffered = 2;
2105
public static final int NSBackingStoreBuffered = 2;
2091
public static final int NSBackspaceCharacter = 8;
2106
public static final int NSBackspaceCharacter = 8;
2092
public static final int NSBevelLineJoinStyle = 2;
2107
public static final int NSBevelLineJoinStyle = 2;
Lines 2100-2105 Link Here
2100
public static final int NSCancelButton = 0;
2115
public static final int NSCancelButton = 0;
2101
public static final int NSCarriageReturnCharacter = 13;
2116
public static final int NSCarriageReturnCharacter = 13;
2102
public static final int NSCenterTextAlignment = 2;
2117
public static final int NSCenterTextAlignment = 2;
2118
public static final int NSChangeBackgroundCellMask = 8;
2119
public static final int NSChangeGrayCellMask = 4;
2103
public static final int NSClockAndCalendarDatePickerStyle = 1;
2120
public static final int NSClockAndCalendarDatePickerStyle = 1;
2104
public static final int NSClosableWindowMask = 2;
2121
public static final int NSClosableWindowMask = 2;
2105
public static final int NSClosePathBezierPathElement = 3;
2122
public static final int NSClosePathBezierPathElement = 3;
Lines 2108-2113 Link Here
2108
public static final int NSCompositeCopy = 1;
2125
public static final int NSCompositeCopy = 1;
2109
public static final int NSCompositeSourceOver = 2;
2126
public static final int NSCompositeSourceOver = 2;
2110
public static final int NSCompositeXOR = 10;
2127
public static final int NSCompositeXOR = 10;
2128
public static final int NSContentsCellMask = 1;
2111
public static final int NSControlKeyMask = 262144;
2129
public static final int NSControlKeyMask = 262144;
2112
public static final int NSCriticalAlertStyle = 2;
2130
public static final int NSCriticalAlertStyle = 2;
2113
public static final int NSCurveToBezierPathElement = 2;
2131
public static final int NSCurveToBezierPathElement = 2;
Lines 2174-2179 Link Here
2174
public static final int NSNonZeroWindingRule = 0;
2192
public static final int NSNonZeroWindingRule = 0;
2175
public static final int NSNonactivatingPanelMask = 128;
2193
public static final int NSNonactivatingPanelMask = 128;
2176
public static final int NSOffState = 0;
2194
public static final int NSOffState = 0;
2195
public static final int NSOnOffButton = 6;
2177
public static final int NSOnState = 1;
2196
public static final int NSOnState = 1;
2178
public static final int NSOpenGLPFAAccumSize = 14;
2197
public static final int NSOpenGLPFAAccumSize = 14;
2179
public static final int NSOpenGLPFAAlphaSize = 11;
2198
public static final int NSOpenGLPFAAlphaSize = 11;
Lines 2193-2198 Link Here
2193
public static final int NSPortraitOrientation = 0;
2212
public static final int NSPortraitOrientation = 0;
2194
public static final int NSPrintPanelShowsPageSetupAccessory = 256;
2213
public static final int NSPrintPanelShowsPageSetupAccessory = 256;
2195
public static final int NSProgressIndicatorPreferredThickness = 14;
2214
public static final int NSProgressIndicatorPreferredThickness = 14;
2215
public static final int NSPushInCellMask = 2;
2196
public static final int NSPushOnPushOffButton = 1;
2216
public static final int NSPushOnPushOffButton = 1;
2197
public static final int NSRadioButton = 4;
2217
public static final int NSRadioButton = 4;
2198
public static final int NSRegularControlSize = 0;
2218
public static final int NSRegularControlSize = 0;
Lines 2233-2238 Link Here
2233
public static final int NSTerminateNow = 1;
2253
public static final int NSTerminateNow = 1;
2234
public static final int NSTextFieldAndStepperDatePickerStyle = 0;
2254
public static final int NSTextFieldAndStepperDatePickerStyle = 0;
2235
public static final int NSTitledWindowMask = 1;
2255
public static final int NSTitledWindowMask = 1;
2256
public static final int NSToggleButton = 2;
2257
public static final int NSToolbarDisplayModeIconAndLabel = 1;
2258
public static final int NSToolbarDisplayModeIconOnly = 2;
2259
public static final int NSToolbarDisplayModeLabelOnly = 3;
2236
public static final int NSUnderlineStyleDouble = 9;
2260
public static final int NSUnderlineStyleDouble = 9;
2237
public static final int NSUnderlineStyleNone = 0;
2261
public static final int NSUnderlineStyleNone = 0;
2238
public static final int NSUnderlineStyleSingle = 1;
2262
public static final int NSUnderlineStyleSingle = 1;
Lines 3526-3531 Link Here
3526
/**
3550
/**
3527
 * @method flags=cast
3551
 * @method flags=cast
3528
 * @param arg0 flags=struct
3552
 * @param arg0 flags=struct
3553
 * @param arg1 flags=struct
3554
 */
3555
public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, NSPoint arg0, NSRect arg1);
3556
/**
3557
 * @method flags=cast
3558
 * @param arg0 flags=struct
3529
 */
3559
 */
3530
public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, NSRange arg0, int /*long*/ arg1);
3560
public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, NSRange arg0, int /*long*/ arg1);
3531
/**
3561
/**
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SFCertificatePanel.java (+6 lines)
Lines 32-37 Link Here
32
	OS.objc_msgSend(this.id, OS.sel_setShowsHelp_, showsHelp);
32
	OS.objc_msgSend(this.id, OS.sel_setShowsHelp_, showsHelp);
33
}
33
}
34
34
35
public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) {
36
	NSRect result = new NSRect();
37
	OS.objc_msgSend_stret(result, OS.class_SFCertificatePanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle);
38
	return result;
39
}
40
35
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
41
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
36
	return (float)OS.objc_msgSend_fpret(OS.class_SFCertificatePanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
42
	return (float)OS.objc_msgSend_fpret(OS.class_SFCertificatePanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
37
}
43
}
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SFCertificateTrustPanel.java (+6 lines)
Lines 33-38 Link Here
33
	return result != 0 ? new SFCertificateTrustPanel(result) : null;
33
	return result != 0 ? new SFCertificateTrustPanel(result) : null;
34
}
34
}
35
35
36
public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) {
37
	NSRect result = new NSRect();
38
	OS.objc_msgSend_stret(result, OS.class_SFCertificateTrustPanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle);
39
	return result;
40
}
41
36
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
42
public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) {
37
	return (float)OS.objc_msgSend_fpret(OS.class_SFCertificateTrustPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
43
	return (float)OS.objc_msgSend_fpret(OS.class_SFCertificateTrustPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle);
38
}
44
}
(-)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 (+51 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
 * @return a ToolBar object representing the window's tool bar or null.
1126
 *
1127
 * @exception SWTException <ul>
1128
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
1129
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
1130
 * </ul>
1131
 */
1132
public ToolBar getToolbar() {
1133
	checkWidget();
1134
	if (toolBar == null) toolBar = new ToolBar(this, SWT.HORIZONTAL | SWT.SMOOTH, true);
1135
	return toolBar;
1136
}
1137
1107
boolean hasBorder () {
1138
boolean hasBorder () {
1108
	return false;
1139
	return false;
1109
}
1140
}
Lines 1174-1179 Link Here
1174
	window.makeKeyAndOrderFront (null);
1205
	window.makeKeyAndOrderFront (null);
1175
}
1206
}
1176
1207
1208
Point minimumSize (int wHint, int Hint, boolean changed) {
1209
	// minimumSize is used by computeSize() to figure out how big the view
1210
	// (or, in this case, the content view of the Shell) should be.
1211
	// An NSToolbar does not contribute to the content area, but must be
1212
	// accounted for. If the shell has a toolbar but no other children
1213
	// this will return the width of the toolbar and a height of 1
1214
	Control [] children = _getChildren ();
1215
	int width = 0, height = 0;
1216
	for (int i=0; i<children.length; i++) {
1217
		Rectangle rect = children [i].getBounds ();
1218
		width = Math.max (width, rect.x + rect.width);
1219
		if (children[i] != toolBar)	{
1220
			height = Math.max (height, rect.y + rect.height);
1221
		} else {
1222
			height = Math.max (height, 1);
1223
		}
1224
	}
1225
	return new Point (width, height);
1226
}
1227
1177
void mouseMoved(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
1228
void mouseMoved(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
1178
	super.mouseMoved(id, sel, theEvent);
1229
	super.mouseMoved(id, sel, theEvent);
1179
1230
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java (-29 / +221 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
public Rectangle getBounds () {
345
	checkWidget();
346
347
	if ((style & SWT.SMOOTH) != 0) {
348
		// The NSToolbar's view will always be a child of the Shell, so we can just
349
		// convert the frame to window-relative coordinates.
350
		NSRect rect = view.frame();
351
		rect = view.convertRect_toView_(rect, null);
352
		return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
353
	}
354
	
355
	return super.getBounds();
356
}
357
265
boolean forceFocus (NSView focusView) {
358
boolean forceFocus (NSView focusView) {
266
	if (lastFocus != null && lastFocus.setFocus ()) return true;
359
	if (lastFocus != null && lastFocus.setFocus ()) return true;
267
	ToolItem [] items = getItems ();
360
	ToolItem [] items = getItems ();
Lines 448-453 Link Here
448
	return new int [] {rows, maxX, y + itemHeight};
541
	return new int [] {rows, maxX, y + itemHeight};
449
}
542
}
450
543
544
int [] layoutUnified (int width, int height, boolean resize) {
545
	int x = 0, y = 0;
546
	int itemHeight = 0, maxX = 0;
547
	Point [] sizes = new Point [itemCount];
548
	NSRect [] containerRects = new NSRect[itemCount];
549
	// This next line relies on the observation that all of the toolbar item views are children of the first
550
	// subview of the NSToolbarView.
551
	NSArray itemViewers = new NSView(view.subviews().objectAtIndex(0)).subviews();
552
	for (int i=0; i<itemCount; i++) {
553
		Point size = sizes [i] = items [i].computeSize ();
554
		containerRects [i] = new NSView(itemViewers.objectAtIndex(i)).frame();
555
		if (i == 0) x = (int) containerRects[0].x;
556
		itemHeight = Math.max (itemHeight, size.y);
557
	}
558
	for (int i=0; i<itemCount; i++) {
559
		ToolItem item = items [i];
560
		Point size = sizes [i];
561
		if (resize) {
562
			item.setBounds (0, 0, size.x, itemHeight);
563
			Control control = item.control;
564
			if (control != null) {
565
				control.setBounds (x, y, size.x, itemHeight);
566
			}
567
		}
568
		x += containerRects[i].width;
569
		maxX = Math.max (maxX, x);
570
	}
571
	
572
	return new int [] {1, maxX, itemHeight};
573
}
574
451
int [] layoutVertical (int width, int height, boolean resize) {
575
int [] layoutVertical (int width, int height, boolean resize) {
452
	int xSpacing = 2, ySpacing = 0;
576
	int xSpacing = 2, ySpacing = 0;
453
	int marginWidth = 0, marginHeight = 0;
577
	int marginWidth = 0, marginHeight = 0;
Lines 485-497 Link Here
485
}
609
}
486
610
487
int [] layout (int nWidth, int nHeight, boolean resize) {
611
int [] layout (int nWidth, int nHeight, boolean resize) {
488
	if ((style & SWT.VERTICAL) != 0) {
612
	if ((style & SWT.SMOOTH) != 0) {
489
		return layoutVertical (nWidth, nHeight, resize);
613
		return layoutUnified(nWidth, nHeight, resize);
490
	} else {
614
	} else {
491
		return layoutHorizontal (nWidth, nHeight, resize);
615
		if ((style & SWT.VERTICAL) != 0) {
616
			return layoutVertical (nWidth, nHeight, resize);
617
		} else {
618
			return layoutHorizontal (nWidth, nHeight, resize);
619
		}
492
	}
620
	}
493
}
621
}
494
622
623
void register() {
624
	super.register();
625
	if (nsToolbar != null) display.addWidget (nsToolbar, this);
626
}
627
495
void relayout () {
628
void relayout () {
496
	if (!getDrawing()) return;
629
	if (!getDrawing()) return;
497
	Rectangle rect = getClientArea ();
630
	Rectangle rect = getClientArea ();
Lines 513-519 Link Here
513
}
646
}
514
647
515
void releaseHandle () {
648
void releaseHandle () {
516
	super.releaseHandle ();
649
    super.releaseHandle ();
650
651
    if (nsToolbar != null) {
652
        nsToolbar.release();
653
        nsToolbar = null;
654
	}
655
517
	if (accessibilityAttributes != null) accessibilityAttributes.release();
656
	if (accessibilityAttributes != null) accessibilityAttributes.release();
518
	accessibilityAttributes = null;
657
	accessibilityAttributes = null;
519
}
658
}
Lines 547-560 Link Here
547
	case SWT.MouseMove:
686
	case SWT.MouseMove:
548
		// Start with the global mouse location, as the MouseEnter may occur due to
687
		// 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.
688
		// an application-activated event, which isn't associated with a window.
550
		NSPoint toolbarPoint = NSEvent.mouseLocation();
689
		NSPoint windowPoint = NSEvent.mouseLocation();
551
		toolbarPoint = view.window().convertScreenToBase(toolbarPoint);
690
		windowPoint = view.window().convertScreenToBase(windowPoint);
552
		toolbarPoint = view.convertPoint_fromView_(toolbarPoint, null);
553
		for (int i = 0; i < itemCount; i++) {
691
		for (int i = 0; i < itemCount; i++) {
554
			ToolItem item = items [i];
692
			ToolItem item = items [i];
555
			int currState = item.state;
693
			int currState = item.state;
556
			
694
			NSPoint viewPoint = item.view.convertPoint_fromView_(windowPoint, null); 
557
			if (OS.NSPointInRect(toolbarPoint, item.view.frame())) {
695
			if (item.view.mouse(viewPoint, item.view.bounds())) {
558
				item.state |= Widget.HOT;
696
				item.state |= Widget.HOT;
559
			} else {
697
			} else {
560
				item.state &= ~Widget.HOT;				
698
				item.state &= ~Widget.HOT;				
Lines 576-581 Link Here
576
	return super.sendMouseEvent(nsEvent, type, send);
714
	return super.sendMouseEvent(nsEvent, type, send);
577
}
715
}
578
716
717
void setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
718
	// In unified toolbar case, the toolbar view size and position is completely controlled
719
	// by the window, so don't change its bounds or location.
720
	if ((style & SWT.SMOOTH) != 0) return;
721
	super.setBounds(x, y, width, height, move, resize);
722
}
723
	
579
void setFont(NSFont font) {
724
void setFont(NSFont font) {
580
	for (int i = 0; i < itemCount; i++) {
725
	for (int i = 0; i < itemCount; i++) {
581
		ToolItem item = items[i];
726
		ToolItem item = items[i];
Lines 589-594 Link Here
589
	if (redraw && drawCount == 0) relayout();
734
	if (redraw && drawCount == 0) relayout();
590
}
735
}
591
736
737
public void setVisible(boolean visible) {
738
    if (nsToolbar != null) nsToolbar.setVisible(visible);
739
    super.setVisible(visible);
740
}
741
742
int /*long*/ toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar, int /*long*/ itemIdentifier, boolean flag) {
743
	NSString itemID = new NSString(itemIdentifier);
744
	for (int j = 0; j < itemCount; j++) {
745
		ToolItem item = items[j];
746
		if (itemID.isEqual(item.nsItem.itemIdentifier())) {
747
			return item.nsItem.id;
748
		}
749
	}
750
	return 0;
751
}
752
753
/*
754
 * Returns an array of all toolbar item IDs allowed to be in the toolbar. Since the ToolBar created all of the ToolItems
755
 * return all of the item IDs.
756
 */
757
int /*long*/ toolbarAllowedItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) {
758
	NSMutableArray array = NSMutableArray.arrayWithCapacity(itemCount);
759
	for (int i = 0; i < itemCount; i++) {
760
		array.addObject(items[i].nsItem.itemIdentifier());
761
	}
762
	return array.id;
763
}
764
765
/*
766
 * This delegate method isn't really needed because ToolBars aren't customizable, but it's required according to the documentation.
767
 */
768
int /*long*/ toolbarDefaultItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) {
769
	return toolbarAllowedItemIdentifiers(id, sel, toolbar);
770
}
771
772
/*
773
 * toolbarSelectableItemIdentifiers returns an array of all items that can be the selected item, as determined
774
 * by setSelectedItemIdentifier. 
775
 */
776
int /*long*/ toolbarSelectableItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) {
777
	NSMutableArray array = NSMutableArray.arrayWithCapacity(itemCount);
778
	for (int i = 0; i < itemCount; i++) {
779
		if ((items[i].style & SWT.RADIO) != 0) array.addObject(items[i].nsItem.itemIdentifier());
780
	}
781
	return array.id;
782
}
783
592
boolean translateTraversal (int key, NSEvent theEvent, boolean[] consume) {
784
boolean translateTraversal (int key, NSEvent theEvent, boolean[] consume) {
593
	boolean result = super.translateTraversal (key, theEvent, consume);
785
	boolean result = super.translateTraversal (key, theEvent, consume);
594
	if (result) return result;
786
	if (result) return result;
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java (-43 / +169 lines)
Lines 39-44 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
	NSToolbarItem nsItem;
43
	NSMenuItem nsMenuRep;
44
	NSString id;
42
	int width = DEFAULT_SEPARATOR_WIDTH;
45
	int width = DEFAULT_SEPARATOR_WIDTH;
43
	ToolBar parent;
46
	ToolBar parent;
44
	Image hotImage, disabledImage;
47
	Image hotImage, disabledImage;
Lines 46-51 Link Here
46
	Control control;
49
	Control control;
47
	boolean selection;
50
	boolean selection;
48
51
52
	static final int SEPARATOR_MASK = SWT.SEPARATOR | SWT.SPACER | SWT.FLEX_SPACER;
49
	static final int DEFAULT_WIDTH = 24;
53
	static final int DEFAULT_WIDTH = 24;
50
	static final int DEFAULT_HEIGHT = 22;
54
	static final int DEFAULT_HEIGHT = 22;
51
	static final int DEFAULT_SEPARATOR_WIDTH = 6;
55
	static final int DEFAULT_SEPARATOR_WIDTH = 6;
Lines 301-307 Link Here
301
Point computeSize () {
305
Point computeSize () {
302
	checkWidget();
306
	checkWidget();
303
	int width = 0, height = 0;
307
	int width = 0, height = 0;
304
	if ((style & SWT.SEPARATOR) != 0) {
308
	if ((style & SEPARATOR_MASK) != 0) {
305
		if ((parent.style & SWT.HORIZONTAL) != 0) {
309
		if ((parent.style & SWT.HORIZONTAL) != 0) {
306
			width = getWidth ();
310
			width = getWidth ();
307
			height = DEFAULT_HEIGHT;
311
			height = DEFAULT_HEIGHT;
Lines 314-321 Link Here
314
		}
318
		}
315
	} else {
319
	} else {
316
		if (text.length () != 0 || image != null) {
320
		if (text.length () != 0 || image != null) {
317
			NSButton widget = (NSButton)button;
321
			NSSize size = button.cell().cellSize();
318
			NSSize size = widget.cell().cellSize();
319
			width = (int)Math.ceil(size.width);
322
			width = (int)Math.ceil(size.width);
320
			height = (int)Math.ceil(size.height);
323
			height = (int)Math.ceil(size.height);
321
		} else {
324
		} else {
Lines 332-343 Link Here
332
}
335
}
333
336
334
void createHandle () {
337
void createHandle () {
335
	if ((style & SWT.SEPARATOR) != 0) {
338
	if ((style & SWT.SMOOTH) != 0) {
336
		NSBox widget = (NSBox)new SWTBox().alloc();
339
		id = NSString.stringWith(String.valueOf(ToolBar.NEXT_ID++));
337
		widget.init();
340
		id.retain();
338
		widget.setBoxType(OS.NSBoxSeparator);
341
		nsItem = ((NSToolbarItem)new NSToolbarItem().alloc()).initWithItemIdentifier(id);
339
		widget.setBorderWidth(0);
342
		nsItem.setAction(OS.sel_sendSelection);
340
		view = widget;
343
		nsMenuRep = ((NSMenuItem)new SWTMenuItem().alloc()).initWithTitle(NSString.string(), OS.sel_sendSelection, NSString.string());
344
		nsItem.setMenuFormRepresentation(nsMenuRep);
345
	} 
346
347
	if ((style & SEPARATOR_MASK) != 0) {
348
		if ((style & SWT.SMOOTH) != 0) {
349
			view = (NSView)new SWTView().alloc();
350
			view.init();
351
		} else {
352
			NSBox widget = (NSBox)new SWTBox().alloc();
353
			widget.init();
354
			widget.setBoxType(OS.NSBoxSeparator);
355
			widget.setBorderWidth(0);
356
			view = widget;
357
		}
341
	} else {
358
	} else {
342
		NSView widget = (NSView)new SWTView().alloc();
359
		NSView widget = (NSView)new SWTView().alloc();
343
		widget.init();
360
		widget.init();
Lines 348-367 Link Here
348
		* between their edge and their image.  The workaround is to provide a
365
		* between their edge and their image.  The workaround is to provide a
349
		* custom cell that displays the image in a better position. 
366
		* custom cell that displays the image in a better position. 
350
		*/
367
		*/
351
		NSButtonCell cell = (NSButtonCell)new SWTButtonCell ().alloc ().init ();
368
		if ((style & SWT.SMOOTH) == 0) {
352
		button.setCell (cell);
369
			NSCell cell = (NSCell)new SWTButtonCell().alloc().init();
353
		cell.release();
370
			button.setCell (cell);
371
			cell.release();
372
		} else {
373
			NSButtonCell buttonCell = new NSButtonCell(button.cell().id);
374
			buttonCell.setHighlightsBy(OS.NSContentsCellMask);
375
			buttonCell.setBackgroundStyle(OS.NSBackgroundStyleRaised);
376
		}
354
		button.setBordered(false);
377
		button.setBordered(false);
355
		button.setAction(OS.sel_sendSelection);
378
		button.setAction(OS.sel_sendSelection);
356
		button.setTarget(button);
379
		button.setTarget(button);
357
		Font font = parent.font != null ? parent.font : parent.defaultFont ();
380
		Font font = parent.font != null ? parent.font : parent.defaultFont ();
358
		button.setFont(font.handle);
381
		button.setFont(font.handle);
359
		button.setImagePosition(OS.NSImageOverlaps);
382
		button.setTitle(NSString.stringWith(""));
360
		button.setTitle(NSString.string());
383
		button.setImagePosition(OS.NSImageOnly);
361
		button.setEnabled(parent.getEnabled());
384
		button.setEnabled(parent.getEnabled());
362
		widget.addSubview(button);
385
		widget.addSubview(button);
363
		view = widget;
386
		view = widget;
364
	}
387
	}
388
389
	if (nsItem != null) {
390
		nsItem.setTarget(button);
391
		nsItem.setView(view);
392
		nsMenuRep.setTarget(button);
393
	}
365
}
394
}
366
395
367
NSAttributedString createString() {
396
NSAttributedString createString() {
Lines 393-404 Link Here
393
			rect.y += 3;			
422
			rect.y += 3;			
394
		}
423
		}
395
	}
424
	}
396
	callSuper (id, sel, image, rect, view);
425
	super.drawImageWithFrameInView(id, sel, image, rect, view);
397
}
426
}
398
427
399
void drawWidget (int /*long*/ id, NSGraphicsContext context, NSRect rect) {
428
void drawWidget (int /*long*/ id, NSGraphicsContext context, NSRect rect) {
400
	if (id == view.id) {
429
	if (id == view.id) {
401
		if (getSelection ()) {
430
		boolean drawSelected = getSelection() && (((style & (SWT.SMOOTH | SWT.CHECK)) == (SWT.SMOOTH | SWT.CHECK)) || ((style & SWT.SMOOTH) == 0)); 
431
		if (drawSelected) {
402
			NSRect bounds = view.bounds();
432
			NSRect bounds = view.bounds();
403
			context.saveGraphicsState();
433
			context.saveGraphicsState();
404
			NSColor.colorWithCalibratedRed(0.1f, 0.1f, 0.1f, 0.1f).setFill();
434
			NSColor.colorWithCalibratedRed(0.1f, 0.1f, 0.1f, 0.1f).setFill();
Lines 435-443 Link Here
435
}
465
}
436
466
437
void enableWidget(boolean enabled) {
467
void enableWidget(boolean enabled) {
438
	if ((style & SWT.SEPARATOR) == 0) {
468
	if ((style & SWT.SMOOTH) != 0) {
439
		((NSButton)button).setEnabled(enabled);
469
		nsItem.setEnabled(enabled);
440
		updateImage(true);
470
	} else {
471
		if ((style & SEPARATOR_MASK) == 0) {
472
			((NSButton)button).setEnabled(enabled);
473
			updateImage(true);
474
		}
441
	}
475
	}
442
}
476
}
443
477
Lines 454-459 Link Here
454
 */
488
 */
455
public Rectangle getBounds () {
489
public Rectangle getBounds () {
456
	checkWidget();
490
	checkWidget();
491
	if ((style & SWT.SMOOTH) != 0) {
492
		NSRect rect = view.frame();
493
		// ToolItems in the unified toolbar are not contained directly within the Toolbar.
494
		// Convert the toolitem rect from toolitem-relative coordinates to its
495
		// parent, the toolbar, relative coordinates.
496
		rect = parent.view.convertRect_fromView_(rect, view);
497
		return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
498
	} 
499
457
	NSRect rect = view.frame();
500
	NSRect rect = view.frame();
458
	return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
501
	return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
459
}
502
}
Lines 540-545 Link Here
540
	return hotImage;
583
	return hotImage;
541
}
584
}
542
585
586
NSString getItemID() {
587
    NSString itemID = id;
588
    
589
    // For separators, return a Cocoa constant for the tool item ID.
590
    if ((style & SEPARATOR_MASK) != 0) {
591
    	// If we are using a non-default width or control use that instead.  
592
    	if (width == DEFAULT_SEPARATOR_WIDTH && control == null) {
593
    		if ((style & SWT.SEPARATOR) != 0) {
594
    			itemID = OS.NSToolbarSeparatorItemIdentifier;
595
    		} else if ((style & SWT.SPACER) != 0) {
596
    			itemID = OS.NSToolbarSpaceItemIdentifier;
597
    		} else if ((style & SWT.FLEX_SPACER) != 0) {
598
    			itemID = OS.NSToolbarFlexibleSpaceItemIdentifier;
599
    		}
600
    	}
601
    }
602
    
603
    return itemID;
604
}
605
543
/**
606
/**
544
 * Returns the receiver's parent, which must be a <code>ToolBar</code>.
607
 * Returns the receiver's parent, which must be a <code>ToolBar</code>.
545
 *
608
 *
Lines 652-657 Link Here
652
	}
715
	}
653
}
716
}
654
717
718
boolean mouseDownCanMoveWindow(int /*long*/ id, int /*long*/ sel) {
719
	if (id == view.id) return false;
720
	return super.mouseDownCanMoveWindow(id, sel);
721
}
722
655
void mouseUp(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
723
void mouseUp(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
656
	if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseUp)) return;
724
	if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseUp)) return;
657
	super.mouseUp(id, sel, theEvent);
725
	super.mouseUp(id, sel, theEvent);
Lines 737-742 Link Here
737
	if (view != null) view.release ();
805
	if (view != null) view.release ();
738
	if (button != null) button.release ();
806
	if (button != null) button.release ();
739
	view = button = null;
807
	view = button = null;
808
	if (nsItem != null) {
809
	    nsItem.release();
810
	    nsItem = null;
811
	}
812
	if (id != null) {
813
	    id.release();
814
	    id = null;
815
	}
816
	if (nsMenuRep != null) {
817
		nsMenuRep.release();
818
		nsMenuRep = null;
819
	}
740
	parent = null;
820
	parent = null;
741
}
821
}
742
822
Lines 770-787 Link Here
770
850
771
void setBounds (int x, int y, int width, int height) {
851
void setBounds (int x, int y, int width, int height) {
772
	NSRect rect = new NSRect();
852
	NSRect rect = new NSRect();
773
	rect.x = x;
853
	if ((style & SWT.SMOOTH) == 0) {
774
	rect.y = y;
854
		rect.x = x;
775
	rect.width = width;
855
		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;
856
		rect.width = width;
782
		rect.height = height;
857
		rect.height = height;
783
		if ((style & SWT.DROP_DOWN) != 0) rect.width -= ARROW_WIDTH + INSET;
858
		view.setFrame(rect);
784
		button.setFrame(rect);
859
		if (button != null) {
860
			rect.x = 0;
861
			rect.y = 0;
862
			rect.width = width;
863
			rect.height = height;
864
			if ((style & SWT.DROP_DOWN) != 0) rect.width -= ARROW_WIDTH + INSET;
865
			button.setFrame(rect);
866
		}
867
	} else {
868
		// Let the NSToolbar manage the position of the view in the toolbar.
869
		NSSize newSize = new NSSize();
870
		newSize.height = height;
871
		newSize.width = width;
872
		// Temporarily clear the view. This will force the item and toolbar to re-layout
873
		// when the view is set again.
874
		nsItem.setView(null);
875
		view.setFrameSize(newSize);
876
		nsItem.setMinSize(newSize);
877
		nsItem.setMaxSize(newSize);
878
		nsItem.setView(view);
879
		if ((style & SWT.DROP_DOWN) != 0) newSize.width -= ARROW_WIDTH + INSET;
880
		if (button != null) button.setFrameSize(newSize);
785
	}
881
	}
786
}
882
}
787
883
Lines 806-818 Link Here
806
		if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
902
		if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
807
		if (control.parent != parent) error (SWT.ERROR_INVALID_PARENT);
903
		if (control.parent != parent) error (SWT.ERROR_INVALID_PARENT);
808
	}
904
	}
809
	if ((style & SWT.SEPARATOR) == 0) return;
905
	if ((style & SEPARATOR_MASK) == 0) return;
810
	if (this.control == control) return;
906
	if (this.control == control) return;
811
	NSBox widget = (NSBox)view;
907
812
	if (control == null) {
908
	if ((style & SWT.SMOOTH) == 0) {
813
		widget.setBoxType(OS.NSBoxSeparator);
909
        NSBox widget = (NSBox)view;
814
	} else {
910
        if (control == null) {
815
		widget.setBoxType(OS.NSBoxCustom);
911
        	widget.setBoxType(OS.NSBoxSeparator);
912
        } else {
913
        	widget.setBoxType(OS.NSBoxCustom);
914
        }
816
	}
915
	}
817
	this.control = control;
916
	this.control = control;
818
	view.setHidden(control != null);
917
	view.setHidden(control != null);
Lines 869-875 Link Here
869
public void setDisabledImage (Image image) {
968
public void setDisabledImage (Image image) {
870
	checkWidget();
969
	checkWidget();
871
	if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
970
	if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
872
	if ((style & SWT.SEPARATOR) != 0) return;
971
	if ((style & SEPARATOR_MASK) != 0) return;
873
	disabledImage = image;
972
	disabledImage = image;
874
	updateImage (true);
973
	updateImage (true);
875
}
974
}
Lines 900-906 Link Here
900
public void setHotImage (Image image) {
999
public void setHotImage (Image image) {
901
	checkWidget();
1000
	checkWidget();
902
	if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
1001
	if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
903
	if ((style & SWT.SEPARATOR) != 0) return;
1002
	if ((style & SEPARATOR_MASK) != 0) return;
904
	hotImage = image;
1003
	hotImage = image;
905
	updateImage (true);
1004
	updateImage (true);
906
}
1005
}
Lines 908-914 Link Here
908
public void setImage (Image image) {
1007
public void setImage (Image image) {
909
	checkWidget();
1008
	checkWidget();
910
	if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
1009
	if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
911
	if ((style & SWT.SEPARATOR) != 0) return;
1010
	if ((style & SEPARATOR_MASK) != 0) return;
912
	super.setImage (image);
1011
	super.setImage (image);
913
	updateImage (true);
1012
	updateImage (true);
914
}
1013
}
Lines 941-946 Link Here
941
	checkWidget();
1040
	checkWidget();
942
	if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return;
1041
	if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return;
943
	this.selection = selected;
1042
	this.selection = selected;
1043
	
1044
	if ((style & (SWT.RADIO | SWT.SMOOTH)) == (SWT.RADIO | SWT.SMOOTH) && selection) {
1045
		parent.nsToolbar.setSelectedItemIdentifier(nsItem.itemIdentifier());
1046
	}
1047
	
944
	view.setNeedsDisplay(true);
1048
	view.setNeedsDisplay(true);
945
}
1049
}
946
1050
Lines 975-990 Link Here
975
	if ((style & SWT.SEPARATOR) != 0) return;
1079
	if ((style & SWT.SEPARATOR) != 0) return;
976
	super.setText (string);
1080
	super.setText (string);
977
	NSButton widget = (NSButton)button;
1081
	NSButton widget = (NSButton)button;
1082
	if ((style & SWT.SMOOTH) != 0) {
1083
		char [] chars = new char [text.length ()];
1084
		text.getChars (0, chars.length, chars, 0);
1085
		int length = fixMnemonic (chars);
1086
		nsMenuRep.setTitle(NSString.stringWithCharacters(chars, length));
1087
	}
1088
978
	widget.setAttributedTitle(createString());
1089
	widget.setAttributedTitle(createString());
979
	if (text.length() != 0 && image != null) {
1090
	if (text.length() != 0 && image != null) {
980
		if ((parent.style & SWT.RIGHT) != 0) {
1091
		if ((parent.style & SWT.RIGHT) != 0) {
981
			widget.setImagePosition(OS.NSImageLeft);
1092
			widget.setImagePosition(OS.NSImageLeft);
982
		} else {
1093
		} else {
983
			widget.setImagePosition(OS.NSImageAbove);		
1094
			widget.setImagePosition(OS.NSImageAbove);
984
		}
1095
		}
985
	} else {
1096
	} else {
986
		widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly);
1097
		widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly);
987
	}
1098
	}
1099
988
	parent.relayout ();
1100
	parent.relayout ();
989
}
1101
}
990
1102
Lines 1010-1017 Link Here
1010
 */
1122
 */
1011
public void setToolTipText (String string) {
1123
public void setToolTipText (String string) {
1012
	checkWidget();
1124
	checkWidget();
1013
	toolTipText = string;
1125
    toolTipText = string;
1014
	parent.checkToolTip (this);
1126
	if ((style & SWT.SMOOTH) != 0) {
1127
        char[] chars = new char [toolTipText.length ()];
1128
        string.getChars (0, chars.length, chars, 0);
1129
        int length = fixMnemonic (chars);
1130
        nsItem.setToolTip(NSString.stringWithCharacters (chars, length));
1131
	} else {
1132
        parent.checkToolTip (this);
1133
	}
1015
}
1134
}
1016
1135
1017
void setVisible (boolean visible) {
1136
void setVisible (boolean visible) {
Lines 1037-1045 Link Here
1037
 */
1156
 */
1038
public void setWidth (int width) {
1157
public void setWidth (int width) {
1039
	checkWidget();
1158
	checkWidget();
1040
	if ((style & SWT.SEPARATOR) == 0) return;
1159
	if ((style & SEPARATOR_MASK) == 0) return;
1041
	if (width < 0 || this.width == width) return;
1160
	if (width < 0 || this.width == width) return;
1161
	if (width == SWT.DEFAULT) width = DEFAULT_SEPARATOR_WIDTH;
1042
	this.width = width;
1162
	this.width = width;
1163
	if ((style & SWT.SMOOTH) != 0) {
1164
		NSToolbar toolbar = parent.nsToolbar;
1165
		int index = parent.indexOf(this);
1166
		toolbar.removeItemAtIndex(index);
1167
		toolbar.insertItemWithItemIdentifier(getItemID(), index);
1168
	}
1043
	parent.relayout();
1169
	parent.relayout();
1044
}
1170
}
1045
1171
Lines 1048-1054 Link Here
1048
}
1174
}
1049
1175
1050
void updateImage (boolean layout) {
1176
void updateImage (boolean layout) {
1051
	if ((style & SWT.SEPARATOR) != 0) return;
1177
	if ((style & SEPARATOR_MASK) != 0) return;
1052
	Image newImage = null;
1178
	Image newImage = null;
1053
1179
1054
	if ((state & DISABLED) == DISABLED && disabledImage != null) {
1180
	if ((state & DISABLED) == DISABLED && disabledImage != null) {
(-)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 (+14 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
     * A Style constant representing a flexible space separator in a Cocoa
1015
     * Unified toolbar. Although the (1 << 7) bit is already taken (they all are
1016
     * several times over) it's in a different context so it shouldn't represent
1017
     * a conflict. Carries no meaning on WS-s other than Cocoa.
1018
     */
1019
    public static final int FLEX_SPACER = 1 << 7;
1020
1021
    /**
1022
     * A Style constant representing a space separator in a Cocoa Unified
1023
     * toolbar. Carries no meaning on WS-s other than Cocoa.
1024
     */
1025
    public static final int SPACER = 1 << 10;
1026
1013
	/**
1027
	/**
1014
	 * Style constant for toggle button behavior (value is 1&lt;&lt;1).
1028
	 * Style constant for toggle button behavior (value is 1&lt;&lt;1).
1015
	 * <p><b>Used By:</b><ul>
1029
	 * <p><b>Used By:</b><ul>

Return to bug 222859