Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 180379 Details for
Bug 222859
Support native Mac toolbar
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Newer patch
222859-patch-2 (text/plain), 73.94 KB, created by
Scott Kovatch
on 2010-10-06 18:23:56 EDT
(
hide
)
Description:
Newer patch
Filename:
MIME Type:
Creator:
Scott Kovatch
Created:
2010-10-06 18:23:56 EDT
Size:
73.94 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT PI/cocoa/library/make_macosx.mak >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak,v >retrieving revision 1.29 >diff -u -r1.29 make_macosx.mak >--- Eclipse SWT PI/cocoa/library/make_macosx.mak 31 May 2010 16:44:08 -0000 1.29 >+++ Eclipse SWT PI/cocoa/library/make_macosx.mak 6 Oct 2010 22:20:12 -0000 >@@ -44,9 +44,9 @@ > -Wno-non-virtual-dtor -include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include > XULRUNNERLFLAGS = $(LFLAGS) > >-all: $(SWT_LIB) $(SWTPI_LIB) $(AWT_LIB) $(XULRUNNER_LIB) >+all: $(SWT_LIB) $(SWTPI_LIB) $(AWT_LIB) > >-all_x86_64: $(SWT_LIB) $(SWTPI_LIB) $(AWT_LIB) $(XULRUNNER_LIB) >+all_x86_64: $(SWT_LIB) $(SWTPI_LIB) $(AWT_LIB) > > .c.o: > cc $(CFLAGS) $*.c >Index: Eclipse SWT PI/cocoa/library/os.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c,v >retrieving revision 1.149 >diff -u -r1.149 os.c >--- Eclipse SWT PI/cocoa/library/os.c 27 Sep 2010 21:21:58 -0000 1.149 >+++ Eclipse SWT PI/cocoa/library/os.c 6 Oct 2010 22:20:15 -0000 >@@ -9440,6 +9440,36 @@ > } > #endif > >+#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)) >+#ifndef JNI64 >+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) >+#else >+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) >+#endif >+{ >+ NSPoint _arg2, *lparg2=NULL; >+ NSRect _arg3, *lparg3=NULL; >+ jboolean rc = 0; >+#ifndef JNI64 >+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC); >+#else >+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC); >+#endif >+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail; >+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail; >+ rc = (jboolean)((BOOL (*)(jintLong, jintLong, NSPoint, NSRect))objc_msgSend_bool)(arg0, arg1, *lparg2, *lparg3); >+fail: >+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3); >+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2); >+#ifndef JNI64 >+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC); >+#else >+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC); >+#endif >+ return rc; >+} >+#endif >+ > #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)) > #ifndef JNI64 > 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) >Index: Eclipse SWT PI/cocoa/library/os_stats.c >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c,v >retrieving revision 1.140 >diff -u -r1.140 os_stats.c >--- Eclipse SWT PI/cocoa/library/os_stats.c 27 Sep 2010 21:21:58 -0000 1.140 >+++ Eclipse SWT PI/cocoa/library/os_stats.c 6 Oct 2010 22:20:15 -0000 >@@ -14,8 +14,8 @@ > > #ifdef NATIVE_STATS > >-int OS_nativeFunctionCount = 610; >-int OS_nativeFunctionCallCount[610]; >+int OS_nativeFunctionCount = 611; >+int OS_nativeFunctionCallCount[611]; > char * OS_nativeFunctionNames[] = { > "ATSFontActivateFromFileReference", > "AcquireRootMenu", >@@ -1081,6 +1081,11 @@ > "objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2", > #endif > #ifndef JNI64 >+ "objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2", >+#else >+ "objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2", >+#endif >+#ifndef JNI64 > "objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I", > #else > "objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J", >Index: Eclipse SWT PI/cocoa/library/os_stats.h >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h,v >retrieving revision 1.140 >diff -u -r1.140 os_stats.h >--- Eclipse SWT PI/cocoa/library/os_stats.h 27 Sep 2010 21:21:58 -0000 1.140 >+++ Eclipse SWT PI/cocoa/library/os_stats.h 6 Oct 2010 22:20:15 -0000 >@@ -1089,6 +1089,11 @@ > objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC, > #endif > #ifndef JNI64 >+ objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC, >+#else >+ objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC, >+#endif >+#ifndef JNI64 > objc_1msgSend_1bool__IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC, > #else > objc_1msgSend_1bool__JJLorg_eclipse_swt_internal_cocoa_NSRange_2J_FUNC, >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras,v >retrieving revision 1.234 >diff -u -r1.234 AppKitFull.bridgesupport.extras >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras 27 Sep 2010 21:21:58 -0000 1.234 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras 6 Oct 2010 22:20:16 -0000 >@@ -650,10 +650,18 @@ > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> > </method> >+ <method selector="setHighlightsBy:" swt_gen="true"> >+ <arg swt_gen="true"></arg> >+ <retval swt_gen="true"></retval> >+ </method> > <method selector="setImagePosition:" swt_gen="true"> > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> > </method> >+ <method selector="setShowsStateBy:" swt_gen="true"> >+ <arg swt_gen="true"></arg> >+ <retval swt_gen="true"></retval> >+ </method> > <method selector="title" swt_gen="true"> > <retval swt_gen="true"></retval> > </method> >@@ -742,6 +750,10 @@ > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> > </method> >+ <method selector="setBackgroundStyle:" swt_gen="true"> >+ <arg swt_gen="true"></arg> >+ <retval swt_gen="true"></retval> >+ </method> > <method selector="setBaseWritingDirection:" swt_gen="true"> > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> >@@ -3547,6 +3559,9 @@ > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> > </method> >+ <method selector="isVisible" swt_gen="true"> >+ <retval swt_gen="true"></retval> >+ </method> > <method selector="removeItemAtIndex:" swt_gen="true"> > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> >@@ -3563,6 +3578,10 @@ > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> > </method> >+ <method selector="setSelectedItemIdentifier:" swt_gen="true"> >+ <arg swt_gen="true"></arg> >+ <retval swt_gen="true"></retval> >+ </method> > <method selector="setVisible:" swt_gen="true"> > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> >@@ -3596,6 +3615,10 @@ > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> > </method> >+ <method selector="setMenuFormRepresentation:" swt_gen="true"> >+ <arg swt_gen="true"></arg> >+ <retval swt_gen="true"></retval> >+ </method> > <method selector="setMinSize:" swt_gen="true"> > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> >@@ -3616,6 +3639,9 @@ > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> > </method> >+ <method selector="view" swt_gen="true"> >+ <retval swt_gen="true"></retval> >+ </method> > </class> > <class name="NSToolbarItemGroup" swt_superclass="NSToolbarItem"> > </class> >@@ -3676,6 +3702,9 @@ > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> > </method> >+ <method selector="autoresizingMask" swt_gen="true"> >+ <retval swt_gen="true"></retval> >+ </method> > <method selector="beginDocument" swt_gen="true"> > <retval swt_gen="true"></retval> > </method> >@@ -3808,6 +3837,14 @@ > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> > </method> >+ <method selector="mouse:inRect:" swt_gen="true"> >+ <arg swt_gen="true"></arg> >+ <arg swt_gen="true"></arg> >+ <retval swt_gen="true"></retval> >+ </method> >+ <method selector="mouseDownCanMoveWindow" swt_gen="true"> >+ <retval swt_gen="true"></retval> >+ </method> > <method selector="registerForDraggedTypes:" swt_gen="true"> > <arg swt_gen="true"></arg> > <retval swt_gen="true"></retval> >@@ -3940,6 +3977,11 @@ > <method selector="close" swt_gen="true"> > <retval swt_gen="true"></retval> > </method> >+ <method class_method="true" selector="contentRectForFrameRect:styleMask:" swt_gen="true"> >+ <arg swt_gen="true"></arg> >+ <arg swt_gen="true"></arg> >+ <retval swt_gen="true"></retval> >+ </method> > <method selector="contentView" swt_gen="true"> > <retval swt_gen="true" swt_java_type="NSView"></retval> > </method> >@@ -4460,6 +4502,10 @@ > <enum name="NSApplicationDefined" swt_gen="true"></enum> > <enum name="NSApplicationDelegateReplySuccess" swt_gen="true"></enum> > <enum name="NSAtTop" swt_gen="true"></enum> >+ <enum name="NSBackgroundStyleDark" swt_gen="true"></enum> >+ <enum name="NSBackgroundStyleLight" swt_gen="true"></enum> >+ <enum name="NSBackgroundStyleLowered" swt_gen="true"></enum> >+ <enum name="NSBackgroundStyleRaised" swt_gen="true"></enum> > <enum name="NSBackingStoreBuffered" swt_gen="true"></enum> > <enum name="NSBackspaceCharacter" swt_gen="true"></enum> > <enum name="NSBevelLineJoinStyle" swt_gen="true"></enum> >@@ -4473,6 +4519,8 @@ > <enum name="NSCancelButton" swt_gen="true"></enum> > <enum name="NSCarriageReturnCharacter" swt_gen="true"></enum> > <enum name="NSCenterTextAlignment" swt_gen="true"></enum> >+ <enum name="NSChangeBackgroundCellMask" swt_gen="true"></enum> >+ <enum name="NSChangeGrayCellMask" swt_gen="true"></enum> > <enum name="NSClockAndCalendarDatePickerStyle" swt_gen="true"></enum> > <enum name="NSClosableWindowMask" swt_gen="true"></enum> > <enum name="NSClosePathBezierPathElement" swt_gen="true"></enum> >@@ -4481,6 +4529,7 @@ > <enum name="NSCompositeCopy" swt_gen="true"></enum> > <enum name="NSCompositeSourceOver" swt_gen="true"></enum> > <enum name="NSCompositeXOR" swt_gen="true"></enum> >+ <enum name="NSContentsCellMask" swt_gen="true"></enum> > <enum name="NSControlKeyMask" swt_gen="true"></enum> > <enum name="NSCriticalAlertStyle" swt_gen="true"></enum> > <enum name="NSCurveToBezierPathElement" swt_gen="true"></enum> >@@ -4547,6 +4596,7 @@ > <enum name="NSNonZeroWindingRule" swt_gen="true"></enum> > <enum name="NSNonactivatingPanelMask" swt_gen="true"></enum> > <enum name="NSOffState" swt_gen="true"></enum> >+ <enum name="NSOnOffButton" swt_gen="true"></enum> > <enum name="NSOnState" swt_gen="true"></enum> > <enum name="NSOpenGLPFAAccumSize" swt_gen="true"></enum> > <enum name="NSOpenGLPFAAlphaSize" swt_gen="true"></enum> >@@ -4566,6 +4616,7 @@ > <enum name="NSPortraitOrientation" swt_gen="true"></enum> > <enum name="NSPrintPanelShowsPageSetupAccessory" swt_gen="true"></enum> > <enum name="NSProgressIndicatorPreferredThickness" swt_gen="true"></enum> >+ <enum name="NSPushInCellMask" swt_gen="true"></enum> > <enum name="NSPushOnPushOffButton" swt_gen="true"></enum> > <enum name="NSRadioButton" swt_gen="true"></enum> > <enum name="NSRegularControlSize" swt_gen="true"></enum> >@@ -4606,6 +4657,10 @@ > <enum name="NSTerminateNow" swt_gen="true"></enum> > <enum name="NSTextFieldAndStepperDatePickerStyle" swt_gen="true"></enum> > <enum name="NSTitledWindowMask" swt_gen="true"></enum> >+ <enum name="NSToggleButton" swt_gen="true"></enum> >+ <enum name="NSToolbarDisplayModeIconAndLabel" swt_gen="true"></enum> >+ <enum name="NSToolbarDisplayModeIconOnly" swt_gen="true"></enum> >+ <enum name="NSToolbarDisplayModeLabelOnly" swt_gen="true"></enum> > <enum name="NSUnderlineStyleDouble" swt_gen="true"></enum> > <enum name="NSUnderlineStyleNone" swt_gen="true"></enum> > <enum name="NSUnderlineStyleSingle" swt_gen="true"></enum> >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java,v >retrieving revision 1.12 >diff -u -r1.12 NSButtonCell.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java 3 Sep 2010 16:10:05 -0000 1.12 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java 6 Oct 2010 22:20:16 -0000 >@@ -47,10 +47,18 @@ > OS.objc_msgSend(this.id, OS.sel_setButtonType_, aType); > } > >+public void setHighlightsBy(int /*long*/ aType) { >+ OS.objc_msgSend(this.id, OS.sel_setHighlightsBy_, aType); >+} >+ > public void setImagePosition(int /*long*/ aPosition) { > OS.objc_msgSend(this.id, OS.sel_setImagePosition_, aPosition); > } > >+public void setShowsStateBy(int /*long*/ aType) { >+ OS.objc_msgSend(this.id, OS.sel_setShowsStateBy_, aType); >+} >+ > public NSString title() { > int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_title); > return result != 0 ? new NSString(result) : null; >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCell.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCell.java,v >retrieving revision 1.29 >diff -u -r1.29 NSCell.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCell.java 27 Jul 2010 16:36:38 -0000 1.29 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCell.java 6 Oct 2010 22:20:16 -0000 >@@ -114,6 +114,10 @@ > OS.objc_msgSend(this.id, OS.sel_setAttributedStringValue_, obj != null ? obj.id : 0); > } > >+public void setBackgroundStyle(int /*long*/ style) { >+ OS.objc_msgSend(this.id, OS.sel_setBackgroundStyle_, style); >+} >+ > public void setBaseWritingDirection(int /*long*/ writingDirection) { > OS.objc_msgSend(this.id, OS.sel_setBaseWritingDirection_, writingDirection); > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPanel.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPanel.java,v >retrieving revision 1.10 >diff -u -r1.10 NSColorPanel.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPanel.java 1 Jul 2009 14:49:14 -0000 1.10 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPanel.java 6 Oct 2010 22:20:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -38,6 +38,12 @@ > return result != 0 ? new NSColorPanel(result) : null; > } > >+public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) { >+ NSRect result = new NSRect(); >+ OS.objc_msgSend_stret(result, OS.class_NSColorPanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle); >+ return result; >+} >+ > public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) { > return (float)OS.objc_msgSend_fpret(OS.class_NSColorPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle); > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontPanel.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontPanel.java,v >retrieving revision 1.9 >diff -u -r1.9 NSFontPanel.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontPanel.java 1 Jul 2009 14:49:08 -0000 1.9 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontPanel.java 6 Oct 2010 22:20:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -38,6 +38,12 @@ > return result != 0 ? new NSFontPanel(result) : null; > } > >+public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) { >+ NSRect result = new NSRect(); >+ OS.objc_msgSend_stret(result, OS.class_NSFontPanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle); >+ return result; >+} >+ > public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) { > return (float)OS.objc_msgSend_fpret(OS.class_NSFontPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle); > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenPanel.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenPanel.java,v >retrieving revision 1.9 >diff -u -r1.9 NSOpenPanel.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenPanel.java 1 Jul 2009 14:49:07 -0000 1.9 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenPanel.java 6 Oct 2010 22:20:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -51,6 +51,12 @@ > return result != 0 ? new NSSavePanel(result) : null; > } > >+public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) { >+ NSRect result = new NSRect(); >+ OS.objc_msgSend_stret(result, OS.class_NSOpenPanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle); >+ return result; >+} >+ > public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) { > return (float)OS.objc_msgSend_fpret(OS.class_NSOpenPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle); > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPanel.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPanel.java,v >retrieving revision 1.11 >diff -u -r1.11 NSPanel.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPanel.java 3 Aug 2010 22:56:24 -0000 1.11 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPanel.java 6 Oct 2010 22:20:16 -0000 >@@ -40,6 +40,12 @@ > return OS.objc_msgSend_bool(this.id, OS.sel_worksWhenModal); > } > >+public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) { >+ NSRect result = new NSRect(); >+ OS.objc_msgSend_stret(result, OS.class_NSPanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle); >+ return result; >+} >+ > public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) { > return (float)OS.objc_msgSend_fpret(OS.class_NSPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle); > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java,v >retrieving revision 1.17 >diff -u -r1.17 NSSavePanel.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java 7 Jul 2009 20:01:09 -0000 1.17 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java 6 Oct 2010 22:20:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -66,6 +66,12 @@ > OS.objc_msgSend(this.id, OS.sel_validateVisibleColumns); > } > >+public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) { >+ NSRect result = new NSRect(); >+ OS.objc_msgSend_stret(result, OS.class_NSSavePanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle); >+ return result; >+} >+ > public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) { > return (float)OS.objc_msgSend_fpret(OS.class_NSSavePanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle); > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbar.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbar.java,v >retrieving revision 1.11 >diff -u -r1.11 NSToolbar.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbar.java 1 Jul 2009 14:49:10 -0000 1.11 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbar.java 6 Oct 2010 22:20:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -33,6 +33,10 @@ > OS.objc_msgSend(this.id, OS.sel_insertItemWithItemIdentifier_atIndex_, itemIdentifier != null ? itemIdentifier.id : 0, index); > } > >+public boolean isVisible() { >+ return OS.objc_msgSend_bool(this.id, OS.sel_isVisible); >+} >+ > public void removeItemAtIndex(int /*long*/ index) { > OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_, index); > } >@@ -49,6 +53,10 @@ > OS.objc_msgSend(this.id, OS.sel_setDisplayMode_, displayMode); > } > >+public void setSelectedItemIdentifier(NSString itemIdentifier) { >+ OS.objc_msgSend(this.id, OS.sel_setSelectedItemIdentifier_, itemIdentifier != null ? itemIdentifier.id : 0); >+} >+ > public void setVisible(boolean shown) { > OS.objc_msgSend(this.id, OS.sel_setVisible_, shown); > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItem.java,v >retrieving revision 1.10 >diff -u -r1.10 NSToolbarItem.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItem.java 1 Jul 2009 14:49:10 -0000 1.10 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItem.java 6 Oct 2010 22:20:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -54,6 +54,10 @@ > OS.objc_msgSend(this.id, OS.sel_setMaxSize_, size); > } > >+public void setMenuFormRepresentation(NSMenuItem menuItem) { >+ OS.objc_msgSend(this.id, OS.sel_setMenuFormRepresentation_, menuItem != null ? menuItem.id : 0); >+} >+ > public void setMinSize(NSSize size) { > OS.objc_msgSend(this.id, OS.sel_setMinSize_, size); > } >@@ -74,4 +78,9 @@ > OS.objc_msgSend(this.id, OS.sel_setView_, view != null ? view.id : 0); > } > >+public NSView view() { >+ int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_view); >+ return result != 0 ? new NSView(result) : null; >+} >+ > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java,v >retrieving revision 1.30 >diff -u -r1.30 NSView.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java 18 Feb 2010 15:18:12 -0000 1.30 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java 6 Oct 2010 22:20:16 -0000 >@@ -40,6 +40,10 @@ > return OS.objc_msgSend(this.id, OS.sel_addToolTipRect_owner_userData_, aRect, anObject != null ? anObject.id : 0, data); > } > >+public int /*long*/ autoresizingMask() { >+ return OS.objc_msgSend(this.id, OS.sel_autoresizingMask); >+} >+ > public void beginDocument() { > OS.objc_msgSend(this.id, OS.sel_beginDocument); > } >@@ -203,6 +207,14 @@ > return result != 0 ? new NSMenu(result) : null; > } > >+public boolean mouse(NSPoint aPoint, NSRect aRect) { >+ return OS.objc_msgSend_bool(this.id, OS.sel_mouse_inRect_, aPoint, aRect); >+} >+ >+public boolean mouseDownCanMoveWindow() { >+ return OS.objc_msgSend_bool(this.id, OS.sel_mouseDownCanMoveWindow); >+} >+ > public void registerForDraggedTypes(NSArray newTypes) { > OS.objc_msgSend(this.id, OS.sel_registerForDraggedTypes_, newTypes != null ? newTypes.id : 0); > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindow.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindow.java,v >retrieving revision 1.45 >diff -u -r1.45 NSWindow.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindow.java 3 Aug 2010 22:56:24 -0000 1.45 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindow.java 6 Oct 2010 22:20:16 -0000 >@@ -54,6 +54,12 @@ > OS.objc_msgSend(this.id, OS.sel_close); > } > >+public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) { >+ NSRect result = new NSRect(); >+ OS.objc_msgSend_stret(result, OS.class_NSWindow, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle); >+ return result; >+} >+ > public NSView contentView() { > int /*long*/ result = OS.objc_msgSend(this.id, OS.sel_contentView); > return result != 0 ? new NSView(result) : null; >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java,v >retrieving revision 1.354 >diff -u -r1.354 OS.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java 27 Sep 2010 21:21:59 -0000 1.354 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java 6 Oct 2010 22:20:18 -0000 >@@ -137,6 +137,8 @@ > public static final int /*long*/ class_JRSAppKitAWT = objc_getClass("JRSAppKitAWT"); > public static final int /*long*/ sel_awtAppDelegate = sel_registerName("awtAppDelegate"); > >+ public static final int /*long*/ class_NSToolbarView = objc_getClass("NSToolbarView"); >+ > /** JNI natives */ > > /** @method flags=jni */ >@@ -879,6 +881,7 @@ > public static final int /*long*/ sel_attributedTitle = sel_registerName("attributedTitle"); > public static final int /*long*/ sel_attributesAtIndex_longestEffectiveRange_inRange_ = sel_registerName("attributesAtIndex:longestEffectiveRange:inRange:"); > public static final int /*long*/ sel_autorelease = sel_registerName("autorelease"); >+public static final int /*long*/ sel_autoresizingMask = sel_registerName("autoresizingMask"); > public static final int /*long*/ sel_availableFontFamilies = sel_registerName("availableFontFamilies"); > public static final int /*long*/ sel_availableFonts = sel_registerName("availableFonts"); > public static final int /*long*/ sel_availableMembersOfFontFamily_ = sel_registerName("availableMembersOfFontFamily:"); >@@ -980,6 +983,7 @@ > public static final int /*long*/ sel_containsObject_ = sel_registerName("containsObject:"); > public static final int /*long*/ sel_containsPoint_ = sel_registerName("containsPoint:"); > public static final int /*long*/ sel_contentRect = sel_registerName("contentRect"); >+public static final int /*long*/ sel_contentRectForFrameRect_styleMask_ = sel_registerName("contentRectForFrameRect:styleMask:"); > public static final int /*long*/ sel_contentSize = sel_registerName("contentSize"); > public static final int /*long*/ sel_contentSizeForFrameSize_hasHorizontalScroller_hasVerticalScroller_borderType_ = sel_registerName("contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType:"); > public static final int /*long*/ sel_contentView = sel_registerName("contentView"); >@@ -1375,7 +1379,9 @@ > public static final int /*long*/ sel_minuteOfHour = sel_registerName("minuteOfHour"); > public static final int /*long*/ sel_modifierFlags = sel_registerName("modifierFlags"); > public static final int /*long*/ sel_monthOfYear = sel_registerName("monthOfYear"); >+public static final int /*long*/ sel_mouse_inRect_ = sel_registerName("mouse:inRect:"); > public static final int /*long*/ sel_mouseDown_ = sel_registerName("mouseDown:"); >+public static final int /*long*/ sel_mouseDownCanMoveWindow = sel_registerName("mouseDownCanMoveWindow"); > public static final int /*long*/ sel_mouseDragged_ = sel_registerName("mouseDragged:"); > public static final int /*long*/ sel_mouseEntered_ = sel_registerName("mouseEntered:"); > public static final int /*long*/ sel_mouseExited_ = sel_registerName("mouseExited:"); >@@ -1640,6 +1646,7 @@ > public static final int /*long*/ sel_setAutosaveExpandedItems_ = sel_registerName("setAutosaveExpandedItems:"); > public static final int /*long*/ sel_setBackgroundColor_ = sel_registerName("setBackgroundColor:"); > public static final int /*long*/ sel_setBackgroundLayoutEnabled_ = sel_registerName("setBackgroundLayoutEnabled:"); >+public static final int /*long*/ sel_setBackgroundStyle_ = sel_registerName("setBackgroundStyle:"); > public static final int /*long*/ sel_setBadgeLabel_ = sel_registerName("setBadgeLabel:"); > public static final int /*long*/ sel_setBaseWritingDirection_ = sel_registerName("setBaseWritingDirection:"); > public static final int /*long*/ sel_setBaseWritingDirection_range_ = sel_registerName("setBaseWritingDirection:range:"); >@@ -1732,6 +1739,7 @@ > public static final int /*long*/ sel_setHighlightMode_ = sel_registerName("setHighlightMode:"); > public static final int /*long*/ sel_setHighlighted_ = sel_registerName("setHighlighted:"); > public static final int /*long*/ sel_setHighlightedTableColumn_ = sel_registerName("setHighlightedTableColumn:"); >+public static final int /*long*/ sel_setHighlightsBy_ = sel_registerName("setHighlightsBy:"); > public static final int /*long*/ sel_setHorizontalScroller_ = sel_registerName("setHorizontalScroller:"); > public static final int /*long*/ sel_setHorizontallyResizable_ = sel_registerName("setHorizontallyResizable:"); > public static final int /*long*/ sel_setIcon_ = sel_registerName("setIcon:"); >@@ -1775,6 +1783,7 @@ > public static final int /*long*/ sel_setMaximumIntegerDigits_ = sel_registerName("setMaximumIntegerDigits:"); > public static final int /*long*/ sel_setMenu_ = sel_registerName("setMenu:"); > public static final int /*long*/ sel_setMenu_forSegment_ = sel_registerName("setMenu:forSegment:"); >+public static final int /*long*/ sel_setMenuFormRepresentation_ = sel_registerName("setMenuFormRepresentation:"); > public static final int /*long*/ sel_setMessage_ = sel_registerName("setMessage:"); > public static final int /*long*/ sel_setMessageText_ = sel_registerName("setMessageText:"); > public static final int /*long*/ sel_setMinSize_ = sel_registerName("setMinSize:"); >@@ -1817,6 +1826,7 @@ > public static final int /*long*/ sel_setSegmentStyle_ = sel_registerName("setSegmentStyle:"); > public static final int /*long*/ sel_setSelectable_ = sel_registerName("setSelectable:"); > public static final int /*long*/ sel_setSelected_forSegment_ = sel_registerName("setSelected:forSegment:"); >+public static final int /*long*/ sel_setSelectedItemIdentifier_ = sel_registerName("setSelectedItemIdentifier:"); > public static final int /*long*/ sel_setSelectedRange_ = sel_registerName("setSelectedRange:"); > public static final int /*long*/ sel_setSelectedSegment_ = sel_registerName("setSelectedSegment:"); > public static final int /*long*/ sel_setSelectedTextAttributes_ = sel_registerName("setSelectedTextAttributes:"); >@@ -1826,6 +1836,7 @@ > public static final int /*long*/ sel_setShowsPrintPanel_ = sel_registerName("setShowsPrintPanel:"); > public static final int /*long*/ sel_setShowsProgressPanel_ = sel_registerName("setShowsProgressPanel:"); > public static final int /*long*/ sel_setShowsResizeIndicator_ = sel_registerName("setShowsResizeIndicator:"); >+public static final int /*long*/ sel_setShowsStateBy_ = sel_registerName("setShowsStateBy:"); > public static final int /*long*/ sel_setShowsToolbarButton_ = sel_registerName("setShowsToolbarButton:"); > public static final int /*long*/ sel_setSize_ = sel_registerName("setSize:"); > public static final int /*long*/ sel_setState_ = sel_registerName("setState:"); >@@ -2087,6 +2098,10 @@ > public static final int NSApplicationDefined = 15; > public static final int NSApplicationDelegateReplySuccess = 0; > public static final int NSAtTop = 2; >+public static final int NSBackgroundStyleDark = 1; >+public static final int NSBackgroundStyleLight = 0; >+public static final int NSBackgroundStyleLowered = 3; >+public static final int NSBackgroundStyleRaised = 2; > public static final int NSBackingStoreBuffered = 2; > public static final int NSBackspaceCharacter = 8; > public static final int NSBevelLineJoinStyle = 2; >@@ -2100,6 +2115,8 @@ > public static final int NSCancelButton = 0; > public static final int NSCarriageReturnCharacter = 13; > public static final int NSCenterTextAlignment = 2; >+public static final int NSChangeBackgroundCellMask = 8; >+public static final int NSChangeGrayCellMask = 4; > public static final int NSClockAndCalendarDatePickerStyle = 1; > public static final int NSClosableWindowMask = 2; > public static final int NSClosePathBezierPathElement = 3; >@@ -2108,6 +2125,7 @@ > public static final int NSCompositeCopy = 1; > public static final int NSCompositeSourceOver = 2; > public static final int NSCompositeXOR = 10; >+public static final int NSContentsCellMask = 1; > public static final int NSControlKeyMask = 262144; > public static final int NSCriticalAlertStyle = 2; > public static final int NSCurveToBezierPathElement = 2; >@@ -2174,6 +2192,7 @@ > public static final int NSNonZeroWindingRule = 0; > public static final int NSNonactivatingPanelMask = 128; > public static final int NSOffState = 0; >+public static final int NSOnOffButton = 6; > public static final int NSOnState = 1; > public static final int NSOpenGLPFAAccumSize = 14; > public static final int NSOpenGLPFAAlphaSize = 11; >@@ -2193,6 +2212,7 @@ > public static final int NSPortraitOrientation = 0; > public static final int NSPrintPanelShowsPageSetupAccessory = 256; > public static final int NSProgressIndicatorPreferredThickness = 14; >+public static final int NSPushInCellMask = 2; > public static final int NSPushOnPushOffButton = 1; > public static final int NSRadioButton = 4; > public static final int NSRegularControlSize = 0; >@@ -2233,6 +2253,10 @@ > public static final int NSTerminateNow = 1; > public static final int NSTextFieldAndStepperDatePickerStyle = 0; > public static final int NSTitledWindowMask = 1; >+public static final int NSToggleButton = 2; >+public static final int NSToolbarDisplayModeIconAndLabel = 1; >+public static final int NSToolbarDisplayModeIconOnly = 2; >+public static final int NSToolbarDisplayModeLabelOnly = 3; > public static final int NSUnderlineStyleDouble = 9; > public static final int NSUnderlineStyleNone = 0; > public static final int NSUnderlineStyleSingle = 1; >@@ -3526,6 +3550,12 @@ > /** > * @method flags=cast > * @param arg0 flags=struct >+ * @param arg1 flags=struct >+ */ >+public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, NSPoint arg0, NSRect arg1); >+/** >+ * @method flags=cast >+ * @param arg0 flags=struct > */ > public static final native boolean objc_msgSend_bool(int /*long*/ id, int /*long*/ sel, NSRange arg0, int /*long*/ arg1); > /** >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SFCertificatePanel.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SFCertificatePanel.java,v >retrieving revision 1.1 >diff -u -r1.1 SFCertificatePanel.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SFCertificatePanel.java 12 Apr 2010 14:53:51 -0000 1.1 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SFCertificatePanel.java 6 Oct 2010 22:20:18 -0000 >@@ -32,6 +32,12 @@ > OS.objc_msgSend(this.id, OS.sel_setShowsHelp_, showsHelp); > } > >+public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) { >+ NSRect result = new NSRect(); >+ OS.objc_msgSend_stret(result, OS.class_SFCertificatePanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle); >+ return result; >+} >+ > public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) { > return (float)OS.objc_msgSend_fpret(OS.class_SFCertificatePanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle); > } >Index: Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SFCertificateTrustPanel.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SFCertificateTrustPanel.java,v >retrieving revision 1.1 >diff -u -r1.1 SFCertificateTrustPanel.java >--- Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SFCertificateTrustPanel.java 12 Apr 2010 14:53:51 -0000 1.1 >+++ Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SFCertificateTrustPanel.java 6 Oct 2010 22:20:18 -0000 >@@ -33,6 +33,12 @@ > return result != 0 ? new SFCertificateTrustPanel(result) : null; > } > >+public static NSRect contentRectForFrameRect(NSRect fRect, int /*long*/ aStyle) { >+ NSRect result = new NSRect(); >+ OS.objc_msgSend_stret(result, OS.class_SFCertificateTrustPanel, OS.sel_contentRectForFrameRect_styleMask_, fRect, aStyle); >+ return result; >+} >+ > public static float /*double*/ minFrameWidthWithTitle(NSString aTitle, int /*long*/ aStyle) { > return (float)OS.objc_msgSend_fpret(OS.class_SFCertificateTrustPanel, OS.sel_minFrameWidthWithTitle_styleMask_, aTitle != null ? aTitle.id : 0, aStyle); > } >Index: Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java,v >retrieving revision 1.77 >diff -u -r1.77 Button.java >--- Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java 3 Sep 2010 16:10:05 -0000 1.77 >+++ Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java 6 Oct 2010 22:20:18 -0000 >@@ -308,7 +308,7 @@ > rect.height += EXTRA_HEIGHT; > } > } >- callSuper (id, sel, image, rect, view); >+ super.drawImageWithFrameInView(id, sel, image, rect, view); > } > > void drawInteriorWithFrame_inView (int /*long*/ id, int /*long*/ sel, NSRect cellRect, int /*long*/ viewid) { >Index: Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java,v >retrieving revision 1.341 >diff -u -r1.341 Display.java >--- Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java 5 Oct 2010 19:52:26 -0000 1.341 >+++ Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java 6 Oct 2010 22:20:19 -0000 >@@ -2132,6 +2132,7 @@ > OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:"); > OS.class_addMethod(cls, OS.sel_updateTrackingAreas, proc2, "@:"); > OS.class_addMethod(cls, OS.sel_getImageView, proc2, "@:"); >+ OS.class_addMethod(cls, OS.sel_mouseDownCanMoveWindow, proc2, "@:"); > } > if (needsDisplayInRectProc != 0) { > OS.class_addMethod(cls, OS.sel_setNeedsDisplayInRect_, needsDisplayInRectProc, "@:{NSRect}"); >@@ -2289,7 +2290,6 @@ > addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); > OS.class_addMethod (cls, OS.sel_drawImage_withFrame_inView_, drawImageWithFrameInViewProc, "@:@{NSRect}@"); > OS.class_addMethod (cls, OS.sel_drawTitle_withFrame_inView_, drawTitleWithFrameInViewProc, "@:@{NSRect}@"); >- OS.class_addMethod(cls, OS.sel_cellSize, cellSizeProc, "@:"); > OS.class_addMethod(cls, OS.sel_drawInteriorWithFrame_inView_, drawInteriorWithFrameInViewProc, "@:{NSRect}@"); > OS.class_addMethod(cls, OS.sel_titleRectForBounds_, titleRectForBoundsProc, "@:{NSRect}"); > OS.class_addMethod(cls, OS.sel_cellSizeForBounds_, cellSizeForBoundsProc, "@:{NSRect}"); >@@ -2688,6 +2688,25 @@ > addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); > OS.objc_registerClassPair(cls); > >+ className = "SWTToolbar"; >+ cls = OS.objc_allocateClassPair(OS.class_NSToolbar, className, 0); >+ OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); >+ OS.class_addMethod(cls, OS.sel_toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar_, proc5, "@:@@Z"); >+ OS.class_addMethod(cls, OS.sel_toolbarAllowedItemIdentifiers_, proc3, "@:@"); >+ OS.class_addMethod(cls, OS.sel_toolbarDefaultItemIdentifiers_, proc3, "@:@"); >+ OS.class_addMethod(cls, OS.sel_toolbarSelectableItemIdentifiers_, proc3, "@:@"); >+ addEventMethods(cls, proc2, proc3, drawRectProc, hitTestProc, setNeedsDisplayInRectProc); >+ addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc); >+ addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc); >+ OS.objc_registerClassPair(cls); >+ >+ className = "SWTToolbarView"; >+ cls = OS.objc_allocateClassPair(OS.class_NSToolbarView, className, 0); >+ OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); >+ addEventMethods(cls, proc2, proc3, drawRectProc, hitTestProc, setNeedsDisplayInRectProc); >+ addFrameMethods(cls, setFrameOriginProc, setFrameSizeProc); >+ OS.objc_registerClassPair(cls); >+ > className = "SWTWindowDelegate"; > cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0); > OS.class_addIvar(cls, SWT_OBJECT, size, (byte)align, types); >@@ -4615,7 +4634,7 @@ > // number passed to windowWithWindowNumber returns nil the window doesn't belong to > // this process. > if (window != null) { >- NSView contentView = window.contentView(); >+ NSView contentView = window.contentView().superview(); > if (contentView != null && OS.NSPointInRect(screenLocation, window.frame())) { > NSPoint location = window.convertScreenToBase(screenLocation); > view = contentView.hitTest (location); >@@ -5122,6 +5141,8 @@ > return widget.accessibilityParameterizedAttributeNames(id, sel); > } else if (sel == OS.sel_getImageView) { > return widget.imageView(); >+ } else if (sel == OS.sel_mouseDownCanMoveWindow) { >+ return (widget.mouseDownCanMoveWindow(id, sel) ? 1 : 0); > } else if (sel == OS.sel_accessibilityFocusedUIElement) { > return widget.accessibilityFocusedUIElement(id, sel); > } else if (sel == OS.sel_accessibilityIsIgnored) { >@@ -5396,6 +5417,12 @@ > widget.windowDidMiniturize(id, sel, arg0); > } else if (sel == OS.sel_windowDidDeminiaturize_) { > widget.windowDidDeminiturize(id, sel, arg0); >+ } else if (sel == OS.sel_toolbarAllowedItemIdentifiers_) { >+ return widget.toolbarAllowedItemIdentifiers(id, sel, arg0); >+ } else if (sel == OS.sel_toolbarDefaultItemIdentifiers_) { >+ return widget.toolbarDefaultItemIdentifiers(id, sel, arg0); >+ } else if (sel == OS.sel_toolbarSelectableItemIdentifiers_) { >+ return widget.toolbarSelectableItemIdentifiers(id, sel, arg0); > } > return 0; > } >@@ -5506,6 +5533,8 @@ > return (widget.tableView_writeRowsWithIndexes_toPasteboard(id, sel, arg0, arg1, arg2) ? 1 : 0); > } else if (sel == OS.sel_outlineView_writeItems_toPasteboard_) { > return (widget.outlineView_writeItems_toPasteboard(id, sel, arg0, arg1, arg2) ? 1 : 0); >+ } else if (sel == OS.sel_toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar_) { >+ return widget.toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(id, sel, arg0, arg1, arg2 != 0); > } > return 0; > } >Index: Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java,v >retrieving revision 1.176 >diff -u -r1.176 Shell.java >--- Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java 27 Sep 2010 21:21:59 -0000 1.176 >+++ Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java 6 Oct 2010 22:20:19 -0000 >@@ -124,6 +124,7 @@ > boolean keyInputHappened; > NSRect currentFrame; > NSRect fullScreenFrame; >+ ToolBar toolBar; > > static int DEFAULT_CLIENT_WIDTH = -1; > static int DEFAULT_CLIENT_HEIGHT = -1; >@@ -410,6 +411,17 @@ > return new Shell (display, null, SWT.NO_TRIM, handle, true); > } > >+Control [] _getChildren () { >+ Control [] children = super._getChildren(); >+ if (toolBar != null) { >+ Control [] newChildren = new Control [children.length + 1]; >+ System.arraycopy (children, 0, newChildren, 1, children.length); >+ newChildren[0] = toolBar; >+ children = newChildren; >+ } >+ return children; >+} >+ > static int checkStyle (Shell parent, int style) { > style = Decorations.checkStyle (style); > style &= ~SWT.TRANSPARENT; >@@ -1104,6 +1116,25 @@ > return 1; > } > >+/** >+ * Returns the instance of the ToolBar object representing the tool bar that can appear on the >+ * trim of the shell. This will return <code>null</code> if the platform does not support tool bars that >+ * not part of the content area of the shell, or if the style of the shell does not support a >+ * tool bar. >+ * <p> >+ * @return a ToolBar object representing the window's tool bar or null. >+ * >+ * @exception SWTException <ul> >+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> >+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> >+ * </ul> >+ */ >+public ToolBar getToolbar() { >+ checkWidget(); >+ if (toolBar == null) toolBar = new ToolBar(this, SWT.HORIZONTAL | SWT.SMOOTH, true); >+ return toolBar; >+} >+ > boolean hasBorder () { > return false; > } >@@ -1174,6 +1205,26 @@ > window.makeKeyAndOrderFront (null); > } > >+Point minimumSize (int wHint, int Hint, boolean changed) { >+ // minimumSize is used by computeSize() to figure out how big the view >+ // (or, in this case, the content view of the Shell) should be. >+ // An NSToolbar does not contribute to the content area, but must be >+ // accounted for. If the shell has a toolbar but no other children >+ // this will return the width of the toolbar and a height of 1 >+ Control [] children = _getChildren (); >+ int width = 0, height = 0; >+ for (int i=0; i<children.length; i++) { >+ Rectangle rect = children [i].getBounds (); >+ width = Math.max (width, rect.x + rect.width); >+ if (children[i] != toolBar) { >+ height = Math.max (height, rect.y + rect.height); >+ } else { >+ height = Math.max (height, 1); >+ } >+ } >+ return new Point (width, height); >+} >+ > void mouseMoved(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { > super.mouseMoved(id, sel, theEvent); > >Index: Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java,v >retrieving revision 1.40 >diff -u -r1.40 ToolBar.java >--- Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java 27 Sep 2010 22:14:07 -0000 1.40 >+++ Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java 6 Oct 2010 22:20:19 -0000 >@@ -47,8 +47,10 @@ > public class ToolBar extends Composite { > int itemCount; > ToolItem [] items; >+ NSToolbar nsToolbar; > NSArray accessibilityAttributes = null; > ToolItem lastFocus; >+ static int NEXT_ID; > > /** > * Constructs a new instance of this class given its parent >@@ -84,7 +86,11 @@ > * @see Widget#getStyle() > */ > public ToolBar (Composite parent, int style) { >- super (parent, checkStyle (style)); >+ this(parent, style, false); >+} >+ >+ToolBar(Composite parent, int style, boolean internal) { >+ super (parent, checkStyle (parent, style, internal)); > > /* > * Ensure that either of HORIZONTAL or VERTICAL is set. >@@ -141,7 +147,7 @@ > return super.accessibilityIsIgnored(id, sel); > } > >-static int checkStyle (int style) { >+static int checkStyle (Composite parent, int style, boolean internal) { > /* > * Even though it is legal to create this widget > * with scroll bars, they serve no useful purpose >@@ -149,7 +155,38 @@ > * widget's client area. The fix is to clear > * the SWT style. > */ >- return style & ~(SWT.H_SCROLL | SWT.V_SCROLL); >+ int newStyle = style & ~(SWT.H_SCROLL | SWT.V_SCROLL); >+ >+ /* >+ * Only internal clients can create an NSToolbar-based ToolBar. >+ */ >+ if (!internal && (newStyle & SWT.SMOOTH) != 0) { >+ newStyle &= ~SWT.SMOOTH; >+ } >+ >+ /* >+ * A unified toolbar can only be parented to a Shell, and >+ * there can only be one unified toolbar per shell. If neither of these >+ * conditions hold, turn off the SMOOTH flag. >+ */ >+ if ((style & SWT.SMOOTH) != 0) { >+ if (parent instanceof Shell) { >+ Shell s = (Shell)parent; >+ if (s.window.toolbar() != null) newStyle &= ~SWT.SMOOTH; >+ } else { >+ newStyle &= ~SWT.SMOOTH; >+ } >+ } >+ >+ /* >+ * Unified toolbar only supports a horizontal layout, and doesn't wrap. >+ */ >+ if ((newStyle & SWT.SMOOTH) != 0) { >+ newStyle &= ~(SWT.VERTICAL | SWT.WRAP); >+ newStyle |= SWT.HORIZONTAL; >+ } >+ >+ return newStyle; > } > > protected void checkSubclass () { >@@ -186,20 +223,38 @@ > } > > void createHandle () { >- state |= THEME_BACKGROUND; >- if (hasBorder()) { >- NSRect rect = new NSRect(); >- NSScrollView scrollWidget = (NSScrollView)new SWTScrollView().alloc(); >- scrollWidget.initWithFrame (rect); >- scrollWidget.setDrawsBackground(false); >- scrollWidget.setBorderType(OS.NSBezelBorder); >- scrollView = scrollWidget; >- } >- NSView widget = (NSView)new SWTView().alloc(); >- widget.init(); >-// widget.setDrawsBackground(false); >- view = widget; >- if (scrollView != null) view.setAutoresizingMask(OS.NSViewHeightSizable | OS.NSViewWidthSizable); >+ if ((style & SWT.SMOOTH) != 0) { >+ nsToolbar = ((NSToolbar)new SWTToolbar().alloc()).initWithIdentifier(NSString.stringWith(String.valueOf(NEXT_ID++))); >+ nsToolbar.setDelegate(nsToolbar); >+ nsToolbar.setDisplayMode(OS.NSToolbarDisplayModeIconOnly); >+ NSWindow window = parent.view.window(); >+ window.setToolbar(nsToolbar); >+ nsToolbar.setVisible(true); >+ NSArray views = window.contentView().superview().subviews(); >+ for (int i = 0; i < views.count(); i++) { >+ id id = views.objectAtIndex(i); >+ if (new NSObject(id).className().getString().equals("NSToolbarView")) { >+ view = new NSView(id); >+ OS.object_setClass(view.id, OS.objc_getClass("SWTToolbarView")); >+ view.retain(); >+ break; >+ } >+ } >+ } else { >+ state |= THEME_BACKGROUND; >+ if (hasBorder()) { >+ NSRect rect = new NSRect(); >+ NSScrollView scrollWidget = (NSScrollView)new SWTScrollView().alloc(); >+ scrollWidget.initWithFrame (rect); >+ scrollWidget.setDrawsBackground(false); >+ scrollWidget.setBorderType(OS.NSBezelBorder); >+ scrollView = scrollWidget; >+ } >+ NSView widget = (NSView)new SWTView().alloc(); >+ widget.init(); >+ view = widget; >+ if (scrollView != null) view.setAutoresizingMask(OS.NSViewHeightSizable | OS.NSViewWidthSizable); >+ } > } > > void createItem (ToolItem item, int index) { >@@ -209,10 +264,17 @@ > System.arraycopy (items, 0, newItems, 0, items.length); > items = newItems; > } >- item.createWidget(); >- view.addSubview(item.view); >+ if ((style & SWT.SMOOTH) != 0) { >+ item.style |= SWT.SMOOTH; >+ } >+ item.createWidget(); > System.arraycopy (items, index, items, index + 1, itemCount++ - index); > items [index] = item; >+ if ((style & SWT.SMOOTH) != 0) { >+ nsToolbar.insertItemWithItemIdentifier(item.getItemID(), index); >+ } else { >+ view.addSubview(item.view); >+ } > relayout (); > } > >@@ -222,6 +284,15 @@ > itemCount = 0; > } > >+NSFont defaultNSFont() { >+ return NSFont.systemFontOfSize(11.0f); >+} >+ >+void deregister () { >+ super.deregister (); >+ if (nsToolbar != null) display.removeWidget (nsToolbar); >+} >+ > void destroyItem (ToolItem item) { > int index = 0; > while (index < itemCount) { >@@ -232,7 +303,11 @@ > if (item == lastFocus) lastFocus = null; > System.arraycopy (items, index + 1, items, index, --itemCount - index); > items [itemCount] = null; >- item.view.removeFromSuperview(); >+ if ((style & SWT.SMOOTH) != 0) { >+ nsToolbar.removeItemAtIndex(index); >+ } else { >+ item.view.removeFromSuperview(); >+ } > relayout (); > } > >@@ -262,6 +337,24 @@ > return super.findTooltip (pt); > } > >+void setZOrder() { >+ if ((style & SWT.SMOOTH) != 0) return; >+ super.setZOrder(); >+} >+public Rectangle getBounds () { >+ checkWidget(); >+ >+ if ((style & SWT.SMOOTH) != 0) { >+ // The NSToolbar's view will always be a child of the Shell, so we can just >+ // convert the frame to window-relative coordinates. >+ NSRect rect = view.frame(); >+ rect = view.convertRect_toView_(rect, null); >+ return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height); >+ } >+ >+ return super.getBounds(); >+} >+ > boolean forceFocus (NSView focusView) { > if (lastFocus != null && lastFocus.setFocus ()) return true; > ToolItem [] items = getItems (); >@@ -448,6 +541,37 @@ > return new int [] {rows, maxX, y + itemHeight}; > } > >+int [] layoutUnified (int width, int height, boolean resize) { >+ int x = 0, y = 0; >+ int itemHeight = 0, maxX = 0; >+ Point [] sizes = new Point [itemCount]; >+ NSRect [] containerRects = new NSRect[itemCount]; >+ // This next line relies on the observation that all of the toolbar item views are children of the first >+ // subview of the NSToolbarView. >+ NSArray itemViewers = new NSView(view.subviews().objectAtIndex(0)).subviews(); >+ for (int i=0; i<itemCount; i++) { >+ Point size = sizes [i] = items [i].computeSize (); >+ containerRects [i] = new NSView(itemViewers.objectAtIndex(i)).frame(); >+ if (i == 0) x = (int) containerRects[0].x; >+ itemHeight = Math.max (itemHeight, size.y); >+ } >+ for (int i=0; i<itemCount; i++) { >+ ToolItem item = items [i]; >+ Point size = sizes [i]; >+ if (resize) { >+ item.setBounds (0, 0, size.x, itemHeight); >+ Control control = item.control; >+ if (control != null) { >+ control.setBounds (x, y, size.x, itemHeight); >+ } >+ } >+ x += containerRects[i].width; >+ maxX = Math.max (maxX, x); >+ } >+ >+ return new int [] {1, maxX, itemHeight}; >+} >+ > int [] layoutVertical (int width, int height, boolean resize) { > int xSpacing = 2, ySpacing = 0; > int marginWidth = 0, marginHeight = 0; >@@ -485,13 +609,22 @@ > } > > int [] layout (int nWidth, int nHeight, boolean resize) { >- if ((style & SWT.VERTICAL) != 0) { >- return layoutVertical (nWidth, nHeight, resize); >+ if ((style & SWT.SMOOTH) != 0) { >+ return layoutUnified(nWidth, nHeight, resize); > } else { >- return layoutHorizontal (nWidth, nHeight, resize); >+ if ((style & SWT.VERTICAL) != 0) { >+ return layoutVertical (nWidth, nHeight, resize); >+ } else { >+ return layoutHorizontal (nWidth, nHeight, resize); >+ } > } > } > >+void register() { >+ super.register(); >+ if (nsToolbar != null) display.addWidget (nsToolbar, this); >+} >+ > void relayout () { > if (!getDrawing()) return; > Rectangle rect = getClientArea (); >@@ -513,7 +646,13 @@ > } > > void releaseHandle () { >- super.releaseHandle (); >+ super.releaseHandle (); >+ >+ if (nsToolbar != null) { >+ nsToolbar.release(); >+ nsToolbar = null; >+ } >+ > if (accessibilityAttributes != null) accessibilityAttributes.release(); > accessibilityAttributes = null; > } >@@ -547,14 +686,13 @@ > case SWT.MouseMove: > // Start with the global mouse location, as the MouseEnter may occur due to > // an application-activated event, which isn't associated with a window. >- NSPoint toolbarPoint = NSEvent.mouseLocation(); >- toolbarPoint = view.window().convertScreenToBase(toolbarPoint); >- toolbarPoint = view.convertPoint_fromView_(toolbarPoint, null); >+ NSPoint windowPoint = NSEvent.mouseLocation(); >+ windowPoint = view.window().convertScreenToBase(windowPoint); > for (int i = 0; i < itemCount; i++) { > ToolItem item = items [i]; > int currState = item.state; >- >- if (OS.NSPointInRect(toolbarPoint, item.view.frame())) { >+ NSPoint viewPoint = item.view.convertPoint_fromView_(windowPoint, null); >+ if (item.view.mouse(viewPoint, item.view.bounds())) { > item.state |= Widget.HOT; > } else { > item.state &= ~Widget.HOT; >@@ -576,6 +714,13 @@ > return super.sendMouseEvent(nsEvent, type, send); > } > >+void setBounds (int x, int y, int width, int height, boolean move, boolean resize) { >+ // In unified toolbar case, the toolbar view size and position is completely controlled >+ // by the window, so don't change its bounds or location. >+ if ((style & SWT.SMOOTH) != 0) return; >+ super.setBounds(x, y, width, height, move, resize); >+} >+ > void setFont(NSFont font) { > for (int i = 0; i < itemCount; i++) { > ToolItem item = items[i]; >@@ -589,6 +734,53 @@ > if (redraw && drawCount == 0) relayout(); > } > >+public void setVisible(boolean visible) { >+ if (nsToolbar != null) nsToolbar.setVisible(visible); >+ super.setVisible(visible); >+} >+ >+int /*long*/ toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar, int /*long*/ itemIdentifier, boolean flag) { >+ NSString itemID = new NSString(itemIdentifier); >+ for (int j = 0; j < itemCount; j++) { >+ ToolItem item = items[j]; >+ if (itemID.isEqual(item.nsItem.itemIdentifier())) { >+ return item.nsItem.id; >+ } >+ } >+ return 0; >+} >+ >+/* >+ * Returns an array of all toolbar item IDs allowed to be in the toolbar. Since the ToolBar created all of the ToolItems >+ * return all of the item IDs. >+ */ >+int /*long*/ toolbarAllowedItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) { >+ NSMutableArray array = NSMutableArray.arrayWithCapacity(itemCount); >+ for (int i = 0; i < itemCount; i++) { >+ array.addObject(items[i].nsItem.itemIdentifier()); >+ } >+ return array.id; >+} >+ >+/* >+ * This delegate method isn't really needed because ToolBars aren't customizable, but it's required according to the documentation. >+ */ >+int /*long*/ toolbarDefaultItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) { >+ return toolbarAllowedItemIdentifiers(id, sel, toolbar); >+} >+ >+/* >+ * toolbarSelectableItemIdentifiers returns an array of all items that can be the selected item, as determined >+ * by setSelectedItemIdentifier. >+ */ >+int /*long*/ toolbarSelectableItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) { >+ NSMutableArray array = NSMutableArray.arrayWithCapacity(itemCount); >+ for (int i = 0; i < itemCount; i++) { >+ if ((items[i].style & SWT.RADIO) != 0) array.addObject(items[i].nsItem.itemIdentifier()); >+ } >+ return array.id; >+} >+ > boolean translateTraversal (int key, NSEvent theEvent, boolean[] consume) { > boolean result = super.translateTraversal (key, theEvent, consume); > if (result) return result; >Index: Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java,v >retrieving revision 1.71 >diff -u -r1.71 ToolItem.java >--- Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java 27 Sep 2010 22:14:07 -0000 1.71 >+++ Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java 6 Oct 2010 22:20:20 -0000 >@@ -39,6 +39,9 @@ > public class ToolItem extends Item { > NSView view; > NSButton button; >+ NSToolbarItem nsItem; >+ NSMenuItem nsMenuRep; >+ NSString id; > int width = DEFAULT_SEPARATOR_WIDTH; > ToolBar parent; > Image hotImage, disabledImage; >@@ -46,6 +49,7 @@ > Control control; > boolean selection; > >+ static final int SEPARATOR_MASK = SWT.SEPARATOR | SWT.SPACER | SWT.FLEX_SPACER; > static final int DEFAULT_WIDTH = 24; > static final int DEFAULT_HEIGHT = 22; > static final int DEFAULT_SEPARATOR_WIDTH = 6; >@@ -301,7 +305,7 @@ > Point computeSize () { > checkWidget(); > int width = 0, height = 0; >- if ((style & SWT.SEPARATOR) != 0) { >+ if ((style & SEPARATOR_MASK) != 0) { > if ((parent.style & SWT.HORIZONTAL) != 0) { > width = getWidth (); > height = DEFAULT_HEIGHT; >@@ -314,8 +318,7 @@ > } > } else { > if (text.length () != 0 || image != null) { >- NSButton widget = (NSButton)button; >- NSSize size = widget.cell().cellSize(); >+ NSSize size = button.cell().cellSize(); > width = (int)Math.ceil(size.width); > height = (int)Math.ceil(size.height); > } else { >@@ -332,12 +335,26 @@ > } > > void createHandle () { >- if ((style & SWT.SEPARATOR) != 0) { >- NSBox widget = (NSBox)new SWTBox().alloc(); >- widget.init(); >- widget.setBoxType(OS.NSBoxSeparator); >- widget.setBorderWidth(0); >- view = widget; >+ if ((style & SWT.SMOOTH) != 0) { >+ id = NSString.stringWith(String.valueOf(ToolBar.NEXT_ID++)); >+ id.retain(); >+ nsItem = ((NSToolbarItem)new NSToolbarItem().alloc()).initWithItemIdentifier(id); >+ nsItem.setAction(OS.sel_sendSelection); >+ nsMenuRep = ((NSMenuItem)new SWTMenuItem().alloc()).initWithTitle(NSString.string(), OS.sel_sendSelection, NSString.string()); >+ nsItem.setMenuFormRepresentation(nsMenuRep); >+ } >+ >+ if ((style & SEPARATOR_MASK) != 0) { >+ if ((style & SWT.SMOOTH) != 0) { >+ view = (NSView)new SWTView().alloc(); >+ view.init(); >+ } else { >+ NSBox widget = (NSBox)new SWTBox().alloc(); >+ widget.init(); >+ widget.setBoxType(OS.NSBoxSeparator); >+ widget.setBorderWidth(0); >+ view = widget; >+ } > } else { > NSView widget = (NSView)new SWTView().alloc(); > widget.init(); >@@ -348,20 +365,32 @@ > * between their edge and their image. The workaround is to provide a > * custom cell that displays the image in a better position. > */ >- NSButtonCell cell = (NSButtonCell)new SWTButtonCell ().alloc ().init (); >- button.setCell (cell); >- cell.release(); >+ if ((style & SWT.SMOOTH) == 0) { >+ NSCell cell = (NSCell)new SWTButtonCell().alloc().init(); >+ button.setCell (cell); >+ cell.release(); >+ } else { >+ NSButtonCell buttonCell = new NSButtonCell(button.cell().id); >+ buttonCell.setHighlightsBy(OS.NSContentsCellMask); >+ buttonCell.setBackgroundStyle(OS.NSBackgroundStyleRaised); >+ } > button.setBordered(false); > button.setAction(OS.sel_sendSelection); > button.setTarget(button); > Font font = parent.font != null ? parent.font : parent.defaultFont (); > button.setFont(font.handle); >- button.setImagePosition(OS.NSImageOverlaps); >- button.setTitle(NSString.string()); >+ button.setTitle(NSString.stringWith("")); >+ button.setImagePosition(OS.NSImageOnly); > button.setEnabled(parent.getEnabled()); > widget.addSubview(button); > view = widget; > } >+ >+ if (nsItem != null) { >+ nsItem.setTarget(button); >+ nsItem.setView(view); >+ nsMenuRep.setTarget(button); >+ } > } > > NSAttributedString createString() { >@@ -393,12 +422,13 @@ > rect.y += 3; > } > } >- callSuper (id, sel, image, rect, view); >+ super.drawImageWithFrameInView(id, sel, image, rect, view); > } > > void drawWidget (int /*long*/ id, NSGraphicsContext context, NSRect rect) { > if (id == view.id) { >- if (getSelection ()) { >+ boolean drawSelected = getSelection() && (((style & (SWT.SMOOTH | SWT.CHECK)) == (SWT.SMOOTH | SWT.CHECK)) || ((style & SWT.SMOOTH) == 0)); >+ if (drawSelected) { > NSRect bounds = view.bounds(); > context.saveGraphicsState(); > NSColor.colorWithCalibratedRed(0.1f, 0.1f, 0.1f, 0.1f).setFill(); >@@ -435,9 +465,13 @@ > } > > void enableWidget(boolean enabled) { >- if ((style & SWT.SEPARATOR) == 0) { >- ((NSButton)button).setEnabled(enabled); >- updateImage(true); >+ if ((style & SWT.SMOOTH) != 0) { >+ nsItem.setEnabled(enabled); >+ } else { >+ if ((style & SEPARATOR_MASK) == 0) { >+ ((NSButton)button).setEnabled(enabled); >+ updateImage(true); >+ } > } > } > >@@ -454,6 +488,15 @@ > */ > public Rectangle getBounds () { > checkWidget(); >+ if ((style & SWT.SMOOTH) != 0) { >+ NSRect rect = view.frame(); >+ // ToolItems in the unified toolbar are not contained directly within the Toolbar. >+ // Convert the toolitem rect from toolitem-relative coordinates to its >+ // parent, the toolbar, relative coordinates. >+ rect = parent.view.convertRect_fromView_(rect, view); >+ return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height); >+ } >+ > NSRect rect = view.frame(); > return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height); > } >@@ -540,6 +583,26 @@ > return hotImage; > } > >+NSString getItemID() { >+ NSString itemID = id; >+ >+ // For separators, return a Cocoa constant for the tool item ID. >+ if ((style & SEPARATOR_MASK) != 0) { >+ // If we are using a non-default width or control use that instead. >+ if (width == DEFAULT_SEPARATOR_WIDTH && control == null) { >+ if ((style & SWT.SEPARATOR) != 0) { >+ itemID = OS.NSToolbarSeparatorItemIdentifier; >+ } else if ((style & SWT.SPACER) != 0) { >+ itemID = OS.NSToolbarSpaceItemIdentifier; >+ } else if ((style & SWT.FLEX_SPACER) != 0) { >+ itemID = OS.NSToolbarFlexibleSpaceItemIdentifier; >+ } >+ } >+ } >+ >+ return itemID; >+} >+ > /** > * Returns the receiver's parent, which must be a <code>ToolBar</code>. > * >@@ -652,6 +715,11 @@ > } > } > >+boolean mouseDownCanMoveWindow(int /*long*/ id, int /*long*/ sel) { >+ if (id == view.id) return false; >+ return super.mouseDownCanMoveWindow(id, sel); >+} >+ > void mouseUp(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { > if (!parent.mouseEvent(parent.view.id, sel, theEvent, SWT.MouseUp)) return; > super.mouseUp(id, sel, theEvent); >@@ -737,6 +805,18 @@ > if (view != null) view.release (); > if (button != null) button.release (); > view = button = null; >+ if (nsItem != null) { >+ nsItem.release(); >+ nsItem = null; >+ } >+ if (id != null) { >+ id.release(); >+ id = null; >+ } >+ if (nsMenuRep != null) { >+ nsMenuRep.release(); >+ nsMenuRep = null; >+ } > parent = null; > } > >@@ -770,18 +850,34 @@ > > void setBounds (int x, int y, int width, int height) { > NSRect rect = new NSRect(); >- rect.x = x; >- rect.y = y; >- rect.width = width; >- rect.height = height; >- view.setFrame(rect); >- if (button != null) { >- rect.x = 0; >- rect.y = 0; >+ if ((style & SWT.SMOOTH) == 0) { >+ rect.x = x; >+ rect.y = y; > rect.width = width; > rect.height = height; >- if ((style & SWT.DROP_DOWN) != 0) rect.width -= ARROW_WIDTH + INSET; >- button.setFrame(rect); >+ view.setFrame(rect); >+ if (button != null) { >+ rect.x = 0; >+ rect.y = 0; >+ rect.width = width; >+ rect.height = height; >+ if ((style & SWT.DROP_DOWN) != 0) rect.width -= ARROW_WIDTH + INSET; >+ button.setFrame(rect); >+ } >+ } else { >+ // Let the NSToolbar manage the position of the view in the toolbar. >+ NSSize newSize = new NSSize(); >+ newSize.height = height; >+ newSize.width = width; >+ // Temporarily clear the view. This will force the item and toolbar to re-layout >+ // when the view is set again. >+ nsItem.setView(null); >+ view.setFrameSize(newSize); >+ nsItem.setMinSize(newSize); >+ nsItem.setMaxSize(newSize); >+ nsItem.setView(view); >+ if ((style & SWT.DROP_DOWN) != 0) newSize.width -= ARROW_WIDTH + INSET; >+ if (button != null) button.setFrameSize(newSize); > } > } > >@@ -806,13 +902,16 @@ > if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT); > if (control.parent != parent) error (SWT.ERROR_INVALID_PARENT); > } >- if ((style & SWT.SEPARATOR) == 0) return; >+ if ((style & SEPARATOR_MASK) == 0) return; > if (this.control == control) return; >- NSBox widget = (NSBox)view; >- if (control == null) { >- widget.setBoxType(OS.NSBoxSeparator); >- } else { >- widget.setBoxType(OS.NSBoxCustom); >+ >+ if ((style & SWT.SMOOTH) == 0) { >+ NSBox widget = (NSBox)view; >+ if (control == null) { >+ widget.setBoxType(OS.NSBoxSeparator); >+ } else { >+ widget.setBoxType(OS.NSBoxCustom); >+ } > } > this.control = control; > view.setHidden(control != null); >@@ -869,7 +968,7 @@ > public void setDisabledImage (Image image) { > checkWidget(); > if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT); >- if ((style & SWT.SEPARATOR) != 0) return; >+ if ((style & SEPARATOR_MASK) != 0) return; > disabledImage = image; > updateImage (true); > } >@@ -900,7 +999,7 @@ > public void setHotImage (Image image) { > checkWidget(); > if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT); >- if ((style & SWT.SEPARATOR) != 0) return; >+ if ((style & SEPARATOR_MASK) != 0) return; > hotImage = image; > updateImage (true); > } >@@ -908,7 +1007,7 @@ > public void setImage (Image image) { > checkWidget(); > if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT); >- if ((style & SWT.SEPARATOR) != 0) return; >+ if ((style & SEPARATOR_MASK) != 0) return; > super.setImage (image); > updateImage (true); > } >@@ -941,6 +1040,11 @@ > checkWidget(); > if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return; > this.selection = selected; >+ >+ if ((style & (SWT.RADIO | SWT.SMOOTH)) == (SWT.RADIO | SWT.SMOOTH) && selection) { >+ parent.nsToolbar.setSelectedItemIdentifier(nsItem.itemIdentifier()); >+ } >+ > view.setNeedsDisplay(true); > } > >@@ -975,16 +1079,24 @@ > if ((style & SWT.SEPARATOR) != 0) return; > super.setText (string); > NSButton widget = (NSButton)button; >+ if ((style & SWT.SMOOTH) != 0) { >+ char [] chars = new char [text.length ()]; >+ text.getChars (0, chars.length, chars, 0); >+ int length = fixMnemonic (chars); >+ nsMenuRep.setTitle(NSString.stringWithCharacters(chars, length)); >+ } >+ > widget.setAttributedTitle(createString()); > if (text.length() != 0 && image != null) { > if ((parent.style & SWT.RIGHT) != 0) { > widget.setImagePosition(OS.NSImageLeft); > } else { >- widget.setImagePosition(OS.NSImageAbove); >+ widget.setImagePosition(OS.NSImageAbove); > } > } else { > widget.setImagePosition(text.length() != 0 ? OS.NSNoImage : OS.NSImageOnly); > } >+ > parent.relayout (); > } > >@@ -1010,8 +1122,15 @@ > */ > public void setToolTipText (String string) { > checkWidget(); >- toolTipText = string; >- parent.checkToolTip (this); >+ toolTipText = string; >+ if ((style & SWT.SMOOTH) != 0) { >+ char[] chars = new char [toolTipText.length ()]; >+ string.getChars (0, chars.length, chars, 0); >+ int length = fixMnemonic (chars); >+ nsItem.setToolTip(NSString.stringWithCharacters (chars, length)); >+ } else { >+ parent.checkToolTip (this); >+ } > } > > void setVisible (boolean visible) { >@@ -1037,9 +1156,16 @@ > */ > public void setWidth (int width) { > checkWidget(); >- if ((style & SWT.SEPARATOR) == 0) return; >+ if ((style & SEPARATOR_MASK) == 0) return; > if (width < 0 || this.width == width) return; >+ if (width == SWT.DEFAULT) width = DEFAULT_SEPARATOR_WIDTH; > this.width = width; >+ if ((style & SWT.SMOOTH) != 0) { >+ NSToolbar toolbar = parent.nsToolbar; >+ int index = parent.indexOf(this); >+ toolbar.removeItemAtIndex(index); >+ toolbar.insertItemWithItemIdentifier(getItemID(), index); >+ } > parent.relayout(); > } > >@@ -1048,7 +1174,7 @@ > } > > void updateImage (boolean layout) { >- if ((style & SWT.SEPARATOR) != 0) return; >+ if ((style & SEPARATOR_MASK) != 0) return; > Image newImage = null; > > if ((state & DISABLED) == DISABLED && disabledImage != null) { >Index: Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java,v >retrieving revision 1.150 >diff -u -r1.150 Widget.java >--- Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java 20 Sep 2010 15:53:22 -0000 1.150 >+++ Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java 6 Oct 2010 22:20:20 -0000 >@@ -666,6 +666,7 @@ > } > > void drawImageWithFrameInView (int /*long*/ id, int /*long*/ sel, int /*long*/ image, NSRect rect, int /*long*/ view) { >+ callSuper(id, sel, image, rect, view); > } > > NSRect drawTitleWithFrameInView (int /*long*/ id, int /*long*/ sel, int /*long*/ title, NSRect rect, int /*long*/ view) { >@@ -1062,6 +1063,10 @@ > mouseDownSuper(id, sel, theEvent); > } > >+boolean mouseDownCanMoveWindow(int /*long*/ id, int /*long*/ sel) { >+ return callSuperBoolean(id, sel); >+} >+ > void mouseDownSuper(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { > callSuper(id, sel, theEvent); > } >@@ -1922,6 +1927,21 @@ > return result; > } > >+int /*long*/ toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar, int /*long*/ itemID, boolean flag) { >+ return 0; >+} >+ >+int /*long*/ toolbarAllowedItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) { >+ return 0; >+} >+ >+int /*long*/ toolbarDefaultItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) { >+ return 0; >+} >+ >+int /*long*/ toolbarSelectableItemIdentifiers(int /*long*/ id, int /*long*/ sel, int /*long*/ toolbar) { >+ return 0; >+} > String tooltipText () { > return null; > } >Index: Eclipse SWT/common/org/eclipse/swt/SWT.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java,v >retrieving revision 1.199 >diff -u -r1.199 SWT.java >--- Eclipse SWT/common/org/eclipse/swt/SWT.java 21 Sep 2010 15:02:33 -0000 1.199 >+++ Eclipse SWT/common/org/eclipse/swt/SWT.java 6 Oct 2010 22:20:21 -0000 >@@ -1010,6 +1010,20 @@ > */ > public static final int SEPARATOR = 1 << 1; > >+ /** >+ * A Style constant representing a flexible space separator in a Cocoa >+ * Unified toolbar. Although the (1 << 7) bit is already taken (they all are >+ * several times over) it's in a different context so it shouldn't represent >+ * a conflict. Carries no meaning on WS-s other than Cocoa. >+ */ >+ public static final int FLEX_SPACER = 1 << 7; >+ >+ /** >+ * A Style constant representing a space separator in a Cocoa Unified >+ * toolbar. Carries no meaning on WS-s other than Cocoa. >+ */ >+ public static final int SPACER = 1 << 10; >+ > /** > * Style constant for toggle button behavior (value is 1<<1). > * <p><b>Used By:</b><ul>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 222859
:
97896
|
99000
|
99485
|
99492
|
99494
|
100753
|
129651
|
129697
|
129893
|
129894
|
129909
|
129973
|
130031
|
130057
|
147838
|
170610
|
170611
|
180221
|
180379
|
180532
|
180977
|
189297
|
189299