diff options
author | Silenio Quarti <silenio> | 2002-12-10 21:34:26 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2002-12-10 21:34:26 +0000 |
commit | 76140865f1fe0a274071c5cb57bd48271b6ebea8 (patch) | |
tree | 54f276403dc2740828fc1e8272ff4db7ccf97ff1 | |
parent | 0ebd57eb6095f086bd8324763cec0a112939f042 (diff) | |
download | eclipse.platform.swt-76140865f1fe0a274071c5cb57bd48271b6ebea8.tar.gz eclipse.platform.swt-76140865f1fe0a274071c5cb57bd48271b6ebea8.tar.xz eclipse.platform.swt-76140865f1fe0a274071c5cb57bd48271b6ebea8.zip |
*** empty log message ***
4 files changed, 21 insertions, 23 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Cursor.java index 47f18c563b..976c6f32e6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Cursor.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Cursor.java @@ -148,7 +148,17 @@ public Cursor(Device device, int style) { case SWT.CURSOR_HELP: handle = OS.kThemeCrossCursor; break; case SWT.CURSOR_SIZEALL: handle = OS.kThemeCrossCursor; break; case SWT.CURSOR_SIZENESW: handle = OS.kThemeCrossCursor; break; - case SWT.CURSOR_SIZENS: break; + case SWT.CURSOR_SIZENS: { + org.eclipse.swt.internal.carbon.Cursor cursor = new org.eclipse.swt.internal.carbon.Cursor(); + cursor.data = SIZENS_SOURCE; + cursor.mask = SIZENS_MASK; + cursor.hotSpot_h = 7; + cursor.hotSpot_v = 7; + handle = OS.NewPtr(org.eclipse.swt.internal.carbon.Cursor.sizeof); + if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); + OS.memcpy(handle, cursor, org.eclipse.swt.internal.carbon.Cursor.sizeof); + break; + } case SWT.CURSOR_SIZENWSE: handle = OS.kThemeCrossCursor; break; case SWT.CURSOR_SIZEWE: handle = OS.kThemeResizeLeftRightCursor; break; case SWT.CURSOR_SIZEN: handle = OS.kThemeCrossCursor; break; @@ -165,21 +175,6 @@ public Cursor(Device device, int style) { default: SWT.error(SWT.ERROR_INVALID_ARGUMENT); } - - /* - * Mac OS X does not provide a native Size NS cursor. - * Create a Size NS cursor. - */ - if (style == SWT.CURSOR_SIZENS) { - org.eclipse.swt.internal.carbon.Cursor cursor = new org.eclipse.swt.internal.carbon.Cursor(); - cursor.data = SIZENS_SOURCE; - cursor.mask = SIZENS_MASK; - cursor.hotSpot_h = 7; - cursor.hotSpot_v = 7; - handle = OS.NewPtrClear(org.eclipse.swt.internal.carbon.Cursor.sizeof); - if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); - OS.memcpy(handle, cursor, org.eclipse.swt.internal.carbon.Cursor.sizeof); - } } /** @@ -255,7 +250,7 @@ public Cursor(Device device, ImageData source, ImageData mask, int hotspotX, int } cursor.hotSpot_h = (short)Math.min(16, hotspotX); cursor.hotSpot_v = (short)Math.min(16, hotspotY); - handle = OS.NewPtrClear(org.eclipse.swt.internal.carbon.Cursor.sizeof); + handle = OS.NewPtr(org.eclipse.swt.internal.carbon.Cursor.sizeof); if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES); OS.memcpy(handle, cursor, org.eclipse.swt.internal.carbon.Cursor.sizeof); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Device.java index f5d23940e5..eaeb77d8fb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Device.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Device.java @@ -288,8 +288,8 @@ public FontData[] getFontList (String faceName, boolean scalable) { short[] style = new short[1]; short[] size = new short[1]; byte[] buffer = new byte[256]; - int familyIter = OS.NewPtrClear(16 * 4); - int fontIter = OS.NewPtrClear(16 * 4); + int familyIter = OS.NewPtr(16 * 4); + int fontIter = OS.NewPtr(16 * 4); OS.FMCreateFontFamilyIterator(0, 0, 0, familyIter); while (OS.FMGetNextFontFamily(familyIter, fontFamily) != OS.kFMIterationCompleted) { OS.FMGetFontFamilyName(fontFamily[0], buffer); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Image.java index 1d3df32718..6b60cb7335 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/Image.java @@ -221,7 +221,7 @@ public Image(Device device, Image srcImage, int flag) { /* Create the image */ int dataSize = height * bpr; - data = OS.NewPtrClear(dataSize); + data = OS.NewPtr(dataSize); if (data == 0) SWT.error(SWT.ERROR_NO_HANDLES); int provider = OS.CGDataProviderCreateWithData(0, data, dataSize, 0); if (provider == 0) { @@ -655,7 +655,7 @@ void init(Device device, int width, int height) { /* Create the image */ int bpr = width * 4; int dataSize = height * bpr; - data = OS.NewPtrClear(dataSize); + data = OS.NewPtr(dataSize); if (data == 0) SWT.error(SWT.ERROR_NO_HANDLES); int provider = OS.CGDataProviderCreateWithData(0, data, dataSize, 0); if (provider == 0) { @@ -688,7 +688,7 @@ void init(Device device, ImageData image) { /* Create the image */ int dataSize = width * height * 4; - data = OS.NewPtrClear(width * height * 4); + data = OS.NewPtr(width * height * 4); if (data == 0) SWT.error(SWT.ERROR_NO_HANDLES); int provider = OS.CGDataProviderCreateWithData(0, data, dataSize, 0); if (provider == 0) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java index 92d74c36bf..aa15d6dd0a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Widget.java @@ -134,7 +134,7 @@ int createCIcon (Image image) { /* Create the icon */ int iconSize = PixMap.sizeof + BitMap.sizeof * 2 + 4 + maskSize; - int iconHandle = OS.NewHandleClear(iconSize); + int iconHandle = OS.NewHandle(iconSize); if (iconHandle == 0) SWT.error(SWT.ERROR_NO_HANDLES); OS.HLock(iconHandle); int[] iconPtr = new int[1]; @@ -457,10 +457,13 @@ int kEventControlDeactivate (int nextHandler, int theEvent, int userData) { int kEventControlDraw (int nextHandler, int theEvent, int userData) { int [] theControl = new int [1]; OS.GetEventParameter (theEvent, OS.kEventParamDirectObject, OS.typeControlRef, null, 4, null, theControl); + int [] region = new int [1]; + OS.GetEventParameter (theEvent, OS.kEventParamRgnHandle, OS.typeQDRgnHandle, null, 4, null, region); int clipRgn = getClipping (theControl [0]); int oldRgn = OS.NewRgn (); OS.GetClip (oldRgn); // OS.SectRgn(oldRgn, clipRgn, clipRgn); + OS.SectRgn(region [0], clipRgn, clipRgn); OS.SetClip (clipRgn); drawWidget (theControl [0]); int result = OS.CallNextEventHandler (nextHandler, theEvent); |