You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/08/01 12:02:01 UTC
svn commit: r561748 [1/2] - in /harmony/enhanced/classlib/trunk:
depends/build/platform/
modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/
modules/awt/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/
modules/awt/src/main/java...
Author: hindessm
Date: Wed Aug 1 03:01:54 2007
New Revision: 561748
URL: http://svn.apache.org/viewvc?view=rev&rev=561748
Log:
Fixing svn:eol-style property. Committers please make sure you have
~/.subversion/config entries as documented in the last paragraph of:
http://www.apache.org/dev/version-control.html#https-svn
Modified:
harmony/enhanced/classlib/trunk/depends/build/platform/aix.ppc32.mk (props changed)
harmony/enhanced/classlib/trunk/depends/build/platform/aix.ppc64.mk (props changed)
harmony/enhanced/classlib/trunk/depends/build/platform/macosx.ppc32.mk (props changed)
harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/GLXGraphicsConfiguration.java (props changed)
harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/GLX.java (props changed)
harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WGLGraphicsConfiguration.java (contents, props changed)
harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGL.java (contents, props changed)
harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGLDefs.java (contents, props changed)
harmony/enhanced/classlib/trunk/modules/awt/src/main/native/oglwrapper/shared/nativelib_common.h (props changed)
harmony/enhanced/classlib/trunk/modules/awt/src/main/native/oglwrapper/shared/org_apache_harmony_awt_gl_opengl_GL.h (props changed)
harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/org/apache/harmony/awt/AWTPermissionTest.java (props changed)
harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java (contents, props changed)
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConfiguration.java (props changed)
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnection.java (props changed)
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnectionManager.java (props changed)
harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/SecurityManager2Test.java (props changed)
harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java (contents, props changed)
harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java (contents, props changed)
harmony/enhanced/classlib/trunk/modules/luni/src/test/impl/org/apache/harmony/tests/internal/net/www/protocol/http/PersistenceTest.java (props changed)
harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/freebsd.x86/hysignal_context.c (props changed)
harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/freebsd.x86/hysignal_context.h (props changed)
harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/javax/rmi/ssl/SslRMIClientSocketFactoryTest.java (props changed)
harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/javax/rmi/ssl/SslRMIServerSocketFactoryTest.java (props changed)
harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java (contents, props changed)
harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/RowSetMetaDataImpl.java (contents, props changed)
harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/org/apache/harmony/swing/tests/javax/swing/text/parser/ContentModelCompatilityTest.java (props changed)
harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/org/apache/harmony/swing/tests/javax/swing/text/parser/ContentModelSemanticTest.java (props changed)
harmony/enhanced/classlib/trunk/support/src/test/java/javax/swing/text/parser/utils/DTDGetter.java (props changed)
Propchange: harmony/enhanced/classlib/trunk/depends/build/platform/aix.ppc32.mk
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/depends/build/platform/aix.ppc64.mk
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/depends/build/platform/macosx.ppc32.mk
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/GLXGraphicsConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/GLX.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WGLGraphicsConfiguration.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WGLGraphicsConfiguration.java?view=diff&rev=561748&r1=561747&r2=561748
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WGLGraphicsConfiguration.java (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WGLGraphicsConfiguration.java Wed Aug 1 03:01:54 2007
@@ -1,343 +1,343 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @author Oleg V. Khaschansky
- * @version $Revision$
- */
-
-package org.apache.harmony.awt.gl.windows;
-
-import org.apache.harmony.awt.gl.opengl.OGLContextManager;
-import org.apache.harmony.awt.gl.opengl.GLDefs;
-import org.apache.harmony.awt.gl.opengl.OGLVolatileImage;
-import org.apache.harmony.awt.nativebridge.windows.*;
-import org.apache.harmony.awt.nativebridge.NativeBridge;
-import org.apache.harmony.awt.nativebridge.Int32Pointer;
-import org.apache.harmony.awt.wtk.windows.WindowProcHandler;
-import org.apache.harmony.awt.wtk.windows.WinEventQueue;
-import org.apache.harmony.awt.ContextStorage;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.awt.image.VolatileImage;
-
-public class WGLGraphicsConfiguration
- extends WinGraphicsConfiguration
- implements OGLContextManager {
- private static final Win32 w32 = Win32.getInstance();
- private static final WGL wgl = WGL.getInstance();
-
- private static final String WINDOW_CLASS_NAME = "org.apache.harmony.awt.gl.tmpWindow";
- private static final int FORMATTED_DRAWABLES_CACHE_SIZE = 255;
-
- private static final ThreadLocal oglContextThreadLocal = new ThreadLocal();
-
- private static long currentOGLContext;
- private static long currentDrawable;
-
- private static final ArrayList existingContexts = new ArrayList();
- private static final HashSet formattedDrawables = new HashSet(255);
-
- private static boolean wndClassRegistetred;
-
- private long hTmpWnd;
- private long hTmpDC;
- private long tmpCtx;
-
- // XXX - todo - maybe we need different pointers for different configurations?
- //private static boolean resolvedEXT = false; // Are ext funcs resolved?
-
- private long getLocalOGLContext() {
- Long ctxId = (Long) oglContextThreadLocal.get();
- return ctxId == null ? 0 : ctxId.longValue();
- }
-
- public WGLGraphicsConfiguration(WinGraphicsDevice device, int index, Win32.PIXELFORMATDESCRIPTOR pfd) {
- super(device, index, pfd);
- }
-
- public WGLGraphicsConfiguration(long hwnd, long hdc) {
- super(hwnd, hdc);
- }
-
- public WGLGraphicsConfiguration(long hdc) {
- super(hdc);
- }
-
- public long windowProc(long hwnd, int msg, long wParam, long lParam) {
- return w32.DefWindowProcW(hwnd, msg, wParam, lParam);
- }
-
- private final long getHWND() {
- if (!wndClassRegistetred) {
- WindowProcHandler.registerWindowClass(WINDOW_CLASS_NAME);
- wndClassRegistetred = true;
- }
-
- WinEventQueue.Task task = new WinEventQueue.Task () {
- public void perform() {
- returnValue = new Long(w32.CreateWindowExW(
- 0, WINDOW_CLASS_NAME, "TmpWindow",
- 0, 0, 0, 0, 0, 0, 0, 0, null
- ));
- }
- };
-
- WinEventQueue winEventQueue = ((WinEventQueue) ContextStorage.getNativeEventQueue());
- winEventQueue.performTask(task);
-
- return ((Long)task.returnValue).longValue();
- }
-
- private void activateTmpCtx() {
- if (hTmpWnd == 0) {
- hTmpWnd = getHWND();
- hTmpDC = w32.GetDC(hTmpWnd);
-
- Win32.PIXELFORMATDESCRIPTOR pfd = w32.createPIXELFORMATDESCRIPTOR(false);
- pfd.set_nSize((short)pfd.size());
- pfd.set_nVersion((short)1);
- pfd.set_dwFlags(WindowsDefs.PFD_DRAW_TO_WINDOW | WindowsDefs.PFD_SUPPORT_OPENGL);
- pfd.set_iPixelType((byte)WindowsDefs.PFD_TYPE_RGBA);
- pfd.set_cAlphaBits((byte)8);
- pfd.set_cStencilBits((byte)1);
- pfd.set_iLayerType((byte)WindowsDefs.PFD_MAIN_PLANE);
-
- int pixelFormat = w32.ChoosePixelFormat(hTmpDC, pfd);
- w32.SetPixelFormat(hTmpDC, pixelFormat, pfd);
- tmpCtx = wgl.wglCreateContext(hTmpDC);
- }
-
- wgl.wglMakeCurrent(hTmpDC, tmpCtx);
- }
-
- protected void finalize() throws Throwable {
- wgl.wglDeleteContext(tmpCtx);
- w32.ReleaseDC(hTmpWnd, hTmpDC);
- w32.DestroyWindow(hTmpWnd);
- }
-
- private final int choosePixelFormatARB(long hdc) {
- /*
- if (!resolvedEXT) {
- resolveEXT();
- }
- */
- activateTmpCtx();
-
- Int32Pointer nFormats = NativeBridge.getInstance().createInt32Pointer(1, true);
- Int32Pointer formatPtr = NativeBridge.getInstance().createInt32Pointer(1, true);
- Int32Pointer attribList = NativeBridge.getInstance().createInt32Pointer(13, true);
-
- // Fill in FB config attributes
- attribList.set(0, WGLDefs.WGL_PIXEL_TYPE_ARB);
- attribList.set(1, WGLDefs.WGL_TYPE_RGBA_ARB);
- attribList.set(2, WGLDefs.WGL_DRAW_TO_WINDOW_ARB);
- attribList.set(3, GLDefs.GL_TRUE);
- attribList.set(4, WGLDefs.WGL_DRAW_TO_PBUFFER_ARB);
- attribList.set(5, GLDefs.GL_TRUE);
- attribList.set(6, WGLDefs.WGL_STENCIL_BITS_ARB);
- attribList.set(7, 1);
- attribList.set(8, WGLDefs.WGL_ALPHA_BITS_ARB);
- attribList.set(9, 8);
- attribList.set(10, WGLDefs.WGL_ACCELERATION_ARB);
- attribList.set(11, WGLDefs.WGL_FULL_ACCELERATION_ARB);
- //attribList.set(12, WGLDefs.WGL_DOUBLE_BUFFER_ARB);
- //attribList.set(13, GLDefs.GL_TRUE);
- attribList.set(12, 0);
-
- wgl.wglChoosePixelFormatARB(hdc, attribList, null, 1, formatPtr, nFormats);
-
- int res = formatPtr.get(0);
-
- formatPtr.free();
- nFormats.free();
- attribList.free();
-
- return res;
- }
-
- /**
- * This method calls ext (ARB) functions to resolve its addresses.
- * For now it calls only one - wglChoosePixelFormatARB
- */
- /*
- private final void resolveEXT() {
- long hwnd = getHWND();
- long hdc = w32.GetDC(hwnd);
-
- Win32.PIXELFORMATDESCRIPTOR pfd = w32.createPIXELFORMATDESCRIPTOR(false);
- pfd.set_nSize((short)pfd.size());
- pfd.set_nVersion((short)1);
- pfd.set_dwFlags(WindowsDefs.PFD_DRAW_TO_WINDOW | WindowsDefs.PFD_SUPPORT_OPENGL);
- pfd.set_iPixelType((byte)WindowsDefs.PFD_TYPE_RGBA);
- pfd.set_cColorBits((byte)32);
- pfd.set_cAlphaBits((byte)8);
- pfd.set_cStencilBits((byte)1);
- pfd.set_iLayerType((byte)WindowsDefs.PFD_MAIN_PLANE);
-
- int pixelFormat = w32.ChoosePixelFormat(hdc, pfd);
- w32.SetPixelFormat(hdc, pixelFormat, pfd);
- // XXX - todo - check for success
- long ctx = wgl.wglCreateContext(hdc);
- wgl.wglMakeCurrent(hdc, ctx);
-
- WGL.init(); // Initialize function pointers
-
- wgl.wglMakeCurrent(0, 0);
- wgl.wglDeleteContext(ctx);
-
- w32.ReleaseDC(hwnd, hdc);
- w32.DestroyWindow(hwnd);
-
- resolvedEXT = true;
- }
- */
- public long getOGLContext(long drawable, long oshdc) {
- long oglContext = getLocalOGLContext();
-
- if (oglContext == 0) {
- long hdc = (oshdc == 0) ? w32.GetDC(drawable) : oshdc;
-
- if (oshdc == 0) {
- int pixelFormat = choosePixelFormatARB(hdc);
- w32.SetPixelFormat(hdc, pixelFormat, w32.createPIXELFORMATDESCRIPTOR(false));
- if (formattedDrawables.size() > FORMATTED_DRAWABLES_CACHE_SIZE) {
- formattedDrawables.clear();
- }
- formattedDrawables.add(new Long(drawable));
- }
-
- oglContext = wgl.wglCreateContext(hdc);
-
- if(oshdc == 0) {
- w32.ReleaseDC(drawable, hdc);
- }
-
- // Share display lists if there are othe contexts
- if (existingContexts.size() > 0) {
- wgl.wglShareLists(((Long)existingContexts.get(0)).longValue(), oglContext);
- }
-
- existingContexts.add(new Long(oglContext));
- oglContextThreadLocal.set(new Long(oglContext));
- }
-
- return oglContext;
- }
-
- public void destroyOGLContext(long oglContext) {
- if (oglContext == currentOGLContext) {
- currentOGLContext = 0;
- }
-
- wgl.wglDeleteContext(oglContext);
- existingContexts.remove(new Long(oglContext));
- }
-
- public boolean makeCurrent(long oglContext, long drawable, long oshdc) {
- if (oglContext != currentOGLContext || drawable != currentDrawable) {
-
- long hdc = (oshdc == 0) ? w32.GetDC(drawable) : oshdc;
-
- if (oshdc == 0 && !formattedDrawables.contains(new Long(drawable))) { // Need to set pixel format
- int pixelFormat = choosePixelFormatARB(hdc);
- w32.SetPixelFormat(hdc, pixelFormat, w32.createPIXELFORMATDESCRIPTOR(false));
- if (formattedDrawables.size() > FORMATTED_DRAWABLES_CACHE_SIZE) {
- formattedDrawables.clear();
- }
- formattedDrawables.add(new Long(drawable));
- }
-
- if (wgl.wglMakeCurrent(hdc, oglContext) == 0) {
- w32.ReleaseDC(drawable, hdc);
- throw new IllegalStateException("Cannot make opengl context current");
- }
-
- if(oshdc == 0) {
- w32.ReleaseDC(drawable, hdc);
- }
-
- currentOGLContext = oglContext;
- currentDrawable = drawable;
-
- return true;
- }
-
- return false;
- }
-
- public boolean makeContextCurrent(
- long oglContext,
- long draw, long read,
- long drawHDC, long readHDC
- ) {
- return makeCurrent(oglContext, draw, drawHDC); // XXX - todo - implement
- }
-
- public void swapBuffers(long drawable, long oshdc) {
- long hdc = (oshdc == 0) ? w32.GetDC(drawable) : oshdc;
- wgl.SwapBuffers(hdc);
- if(oshdc == 0) {
- w32.ReleaseDC(drawable, hdc);
- }
- }
-
- public OffscreenBufferObject createOffscreenBuffer(int w, int h) {
- // Try to get pbuffer from cache
- OffscreenBufferObject pbuffer = OffscreenBufferObject.getCachedBuffer(w, h, this);
- if (pbuffer != null) {
- return pbuffer;
- }
-
- long hwnd = getHWND();
- long hdc = w32.GetDC(hwnd);
-
- int pixelFormat = choosePixelFormatARB(hdc);
-
- Int32Pointer attribList = NativeBridge.getInstance().createInt32Pointer(1, true);
- attribList.set(0,0);
- long id = wgl.wglCreatePbufferARB(hdc, pixelFormat, w, h, attribList.lock());
- attribList.unlock();
- attribList.free();
-
- long buffHdc = wgl.wglGetPbufferDCARB(id);
-
- w32.ReleaseDC(hwnd, hdc);
- w32.DestroyWindow(hwnd);
-
- return new OffscreenBufferObject(id, buffHdc, w, h, this);
- }
-
- public void freeOffscreenBuffer(OffscreenBufferObject pbuffer) {
- pbuffer = OffscreenBufferObject.freeCachedBuffer(pbuffer);
-
- if (pbuffer != null) {
- wgl.wglReleasePbufferDCARB(pbuffer.id, pbuffer.hdc);
- wgl.wglDestroyPbufferARB(pbuffer.id);
- }
- }
-
- public void freeOffscreenBuffer(long id, long hdc) {
- wgl.wglReleasePbufferDCARB(id, hdc);
- wgl.wglDestroyPbufferARB(id);
- }
-
- public VolatileImage createCompatibleVolatileImage(int width, int height) {
- return new OGLVolatileImage(this, width, height);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @author Oleg V. Khaschansky
+ * @version $Revision$
+ */
+
+package org.apache.harmony.awt.gl.windows;
+
+import org.apache.harmony.awt.gl.opengl.OGLContextManager;
+import org.apache.harmony.awt.gl.opengl.GLDefs;
+import org.apache.harmony.awt.gl.opengl.OGLVolatileImage;
+import org.apache.harmony.awt.nativebridge.windows.*;
+import org.apache.harmony.awt.nativebridge.NativeBridge;
+import org.apache.harmony.awt.nativebridge.Int32Pointer;
+import org.apache.harmony.awt.wtk.windows.WindowProcHandler;
+import org.apache.harmony.awt.wtk.windows.WinEventQueue;
+import org.apache.harmony.awt.ContextStorage;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.awt.image.VolatileImage;
+
+public class WGLGraphicsConfiguration
+ extends WinGraphicsConfiguration
+ implements OGLContextManager {
+ private static final Win32 w32 = Win32.getInstance();
+ private static final WGL wgl = WGL.getInstance();
+
+ private static final String WINDOW_CLASS_NAME = "org.apache.harmony.awt.gl.tmpWindow";
+ private static final int FORMATTED_DRAWABLES_CACHE_SIZE = 255;
+
+ private static final ThreadLocal oglContextThreadLocal = new ThreadLocal();
+
+ private static long currentOGLContext;
+ private static long currentDrawable;
+
+ private static final ArrayList existingContexts = new ArrayList();
+ private static final HashSet formattedDrawables = new HashSet(255);
+
+ private static boolean wndClassRegistetred;
+
+ private long hTmpWnd;
+ private long hTmpDC;
+ private long tmpCtx;
+
+ // XXX - todo - maybe we need different pointers for different configurations?
+ //private static boolean resolvedEXT = false; // Are ext funcs resolved?
+
+ private long getLocalOGLContext() {
+ Long ctxId = (Long) oglContextThreadLocal.get();
+ return ctxId == null ? 0 : ctxId.longValue();
+ }
+
+ public WGLGraphicsConfiguration(WinGraphicsDevice device, int index, Win32.PIXELFORMATDESCRIPTOR pfd) {
+ super(device, index, pfd);
+ }
+
+ public WGLGraphicsConfiguration(long hwnd, long hdc) {
+ super(hwnd, hdc);
+ }
+
+ public WGLGraphicsConfiguration(long hdc) {
+ super(hdc);
+ }
+
+ public long windowProc(long hwnd, int msg, long wParam, long lParam) {
+ return w32.DefWindowProcW(hwnd, msg, wParam, lParam);
+ }
+
+ private final long getHWND() {
+ if (!wndClassRegistetred) {
+ WindowProcHandler.registerWindowClass(WINDOW_CLASS_NAME);
+ wndClassRegistetred = true;
+ }
+
+ WinEventQueue.Task task = new WinEventQueue.Task () {
+ public void perform() {
+ returnValue = new Long(w32.CreateWindowExW(
+ 0, WINDOW_CLASS_NAME, "TmpWindow",
+ 0, 0, 0, 0, 0, 0, 0, 0, null
+ ));
+ }
+ };
+
+ WinEventQueue winEventQueue = ((WinEventQueue) ContextStorage.getNativeEventQueue());
+ winEventQueue.performTask(task);
+
+ return ((Long)task.returnValue).longValue();
+ }
+
+ private void activateTmpCtx() {
+ if (hTmpWnd == 0) {
+ hTmpWnd = getHWND();
+ hTmpDC = w32.GetDC(hTmpWnd);
+
+ Win32.PIXELFORMATDESCRIPTOR pfd = w32.createPIXELFORMATDESCRIPTOR(false);
+ pfd.set_nSize((short)pfd.size());
+ pfd.set_nVersion((short)1);
+ pfd.set_dwFlags(WindowsDefs.PFD_DRAW_TO_WINDOW | WindowsDefs.PFD_SUPPORT_OPENGL);
+ pfd.set_iPixelType((byte)WindowsDefs.PFD_TYPE_RGBA);
+ pfd.set_cAlphaBits((byte)8);
+ pfd.set_cStencilBits((byte)1);
+ pfd.set_iLayerType((byte)WindowsDefs.PFD_MAIN_PLANE);
+
+ int pixelFormat = w32.ChoosePixelFormat(hTmpDC, pfd);
+ w32.SetPixelFormat(hTmpDC, pixelFormat, pfd);
+ tmpCtx = wgl.wglCreateContext(hTmpDC);
+ }
+
+ wgl.wglMakeCurrent(hTmpDC, tmpCtx);
+ }
+
+ protected void finalize() throws Throwable {
+ wgl.wglDeleteContext(tmpCtx);
+ w32.ReleaseDC(hTmpWnd, hTmpDC);
+ w32.DestroyWindow(hTmpWnd);
+ }
+
+ private final int choosePixelFormatARB(long hdc) {
+ /*
+ if (!resolvedEXT) {
+ resolveEXT();
+ }
+ */
+ activateTmpCtx();
+
+ Int32Pointer nFormats = NativeBridge.getInstance().createInt32Pointer(1, true);
+ Int32Pointer formatPtr = NativeBridge.getInstance().createInt32Pointer(1, true);
+ Int32Pointer attribList = NativeBridge.getInstance().createInt32Pointer(13, true);
+
+ // Fill in FB config attributes
+ attribList.set(0, WGLDefs.WGL_PIXEL_TYPE_ARB);
+ attribList.set(1, WGLDefs.WGL_TYPE_RGBA_ARB);
+ attribList.set(2, WGLDefs.WGL_DRAW_TO_WINDOW_ARB);
+ attribList.set(3, GLDefs.GL_TRUE);
+ attribList.set(4, WGLDefs.WGL_DRAW_TO_PBUFFER_ARB);
+ attribList.set(5, GLDefs.GL_TRUE);
+ attribList.set(6, WGLDefs.WGL_STENCIL_BITS_ARB);
+ attribList.set(7, 1);
+ attribList.set(8, WGLDefs.WGL_ALPHA_BITS_ARB);
+ attribList.set(9, 8);
+ attribList.set(10, WGLDefs.WGL_ACCELERATION_ARB);
+ attribList.set(11, WGLDefs.WGL_FULL_ACCELERATION_ARB);
+ //attribList.set(12, WGLDefs.WGL_DOUBLE_BUFFER_ARB);
+ //attribList.set(13, GLDefs.GL_TRUE);
+ attribList.set(12, 0);
+
+ wgl.wglChoosePixelFormatARB(hdc, attribList, null, 1, formatPtr, nFormats);
+
+ int res = formatPtr.get(0);
+
+ formatPtr.free();
+ nFormats.free();
+ attribList.free();
+
+ return res;
+ }
+
+ /**
+ * This method calls ext (ARB) functions to resolve its addresses.
+ * For now it calls only one - wglChoosePixelFormatARB
+ */
+ /*
+ private final void resolveEXT() {
+ long hwnd = getHWND();
+ long hdc = w32.GetDC(hwnd);
+
+ Win32.PIXELFORMATDESCRIPTOR pfd = w32.createPIXELFORMATDESCRIPTOR(false);
+ pfd.set_nSize((short)pfd.size());
+ pfd.set_nVersion((short)1);
+ pfd.set_dwFlags(WindowsDefs.PFD_DRAW_TO_WINDOW | WindowsDefs.PFD_SUPPORT_OPENGL);
+ pfd.set_iPixelType((byte)WindowsDefs.PFD_TYPE_RGBA);
+ pfd.set_cColorBits((byte)32);
+ pfd.set_cAlphaBits((byte)8);
+ pfd.set_cStencilBits((byte)1);
+ pfd.set_iLayerType((byte)WindowsDefs.PFD_MAIN_PLANE);
+
+ int pixelFormat = w32.ChoosePixelFormat(hdc, pfd);
+ w32.SetPixelFormat(hdc, pixelFormat, pfd);
+ // XXX - todo - check for success
+ long ctx = wgl.wglCreateContext(hdc);
+ wgl.wglMakeCurrent(hdc, ctx);
+
+ WGL.init(); // Initialize function pointers
+
+ wgl.wglMakeCurrent(0, 0);
+ wgl.wglDeleteContext(ctx);
+
+ w32.ReleaseDC(hwnd, hdc);
+ w32.DestroyWindow(hwnd);
+
+ resolvedEXT = true;
+ }
+ */
+ public long getOGLContext(long drawable, long oshdc) {
+ long oglContext = getLocalOGLContext();
+
+ if (oglContext == 0) {
+ long hdc = (oshdc == 0) ? w32.GetDC(drawable) : oshdc;
+
+ if (oshdc == 0) {
+ int pixelFormat = choosePixelFormatARB(hdc);
+ w32.SetPixelFormat(hdc, pixelFormat, w32.createPIXELFORMATDESCRIPTOR(false));
+ if (formattedDrawables.size() > FORMATTED_DRAWABLES_CACHE_SIZE) {
+ formattedDrawables.clear();
+ }
+ formattedDrawables.add(new Long(drawable));
+ }
+
+ oglContext = wgl.wglCreateContext(hdc);
+
+ if(oshdc == 0) {
+ w32.ReleaseDC(drawable, hdc);
+ }
+
+ // Share display lists if there are othe contexts
+ if (existingContexts.size() > 0) {
+ wgl.wglShareLists(((Long)existingContexts.get(0)).longValue(), oglContext);
+ }
+
+ existingContexts.add(new Long(oglContext));
+ oglContextThreadLocal.set(new Long(oglContext));
+ }
+
+ return oglContext;
+ }
+
+ public void destroyOGLContext(long oglContext) {
+ if (oglContext == currentOGLContext) {
+ currentOGLContext = 0;
+ }
+
+ wgl.wglDeleteContext(oglContext);
+ existingContexts.remove(new Long(oglContext));
+ }
+
+ public boolean makeCurrent(long oglContext, long drawable, long oshdc) {
+ if (oglContext != currentOGLContext || drawable != currentDrawable) {
+
+ long hdc = (oshdc == 0) ? w32.GetDC(drawable) : oshdc;
+
+ if (oshdc == 0 && !formattedDrawables.contains(new Long(drawable))) { // Need to set pixel format
+ int pixelFormat = choosePixelFormatARB(hdc);
+ w32.SetPixelFormat(hdc, pixelFormat, w32.createPIXELFORMATDESCRIPTOR(false));
+ if (formattedDrawables.size() > FORMATTED_DRAWABLES_CACHE_SIZE) {
+ formattedDrawables.clear();
+ }
+ formattedDrawables.add(new Long(drawable));
+ }
+
+ if (wgl.wglMakeCurrent(hdc, oglContext) == 0) {
+ w32.ReleaseDC(drawable, hdc);
+ throw new IllegalStateException("Cannot make opengl context current");
+ }
+
+ if(oshdc == 0) {
+ w32.ReleaseDC(drawable, hdc);
+ }
+
+ currentOGLContext = oglContext;
+ currentDrawable = drawable;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public boolean makeContextCurrent(
+ long oglContext,
+ long draw, long read,
+ long drawHDC, long readHDC
+ ) {
+ return makeCurrent(oglContext, draw, drawHDC); // XXX - todo - implement
+ }
+
+ public void swapBuffers(long drawable, long oshdc) {
+ long hdc = (oshdc == 0) ? w32.GetDC(drawable) : oshdc;
+ wgl.SwapBuffers(hdc);
+ if(oshdc == 0) {
+ w32.ReleaseDC(drawable, hdc);
+ }
+ }
+
+ public OffscreenBufferObject createOffscreenBuffer(int w, int h) {
+ // Try to get pbuffer from cache
+ OffscreenBufferObject pbuffer = OffscreenBufferObject.getCachedBuffer(w, h, this);
+ if (pbuffer != null) {
+ return pbuffer;
+ }
+
+ long hwnd = getHWND();
+ long hdc = w32.GetDC(hwnd);
+
+ int pixelFormat = choosePixelFormatARB(hdc);
+
+ Int32Pointer attribList = NativeBridge.getInstance().createInt32Pointer(1, true);
+ attribList.set(0,0);
+ long id = wgl.wglCreatePbufferARB(hdc, pixelFormat, w, h, attribList.lock());
+ attribList.unlock();
+ attribList.free();
+
+ long buffHdc = wgl.wglGetPbufferDCARB(id);
+
+ w32.ReleaseDC(hwnd, hdc);
+ w32.DestroyWindow(hwnd);
+
+ return new OffscreenBufferObject(id, buffHdc, w, h, this);
+ }
+
+ public void freeOffscreenBuffer(OffscreenBufferObject pbuffer) {
+ pbuffer = OffscreenBufferObject.freeCachedBuffer(pbuffer);
+
+ if (pbuffer != null) {
+ wgl.wglReleasePbufferDCARB(pbuffer.id, pbuffer.hdc);
+ wgl.wglDestroyPbufferARB(pbuffer.id);
+ }
+ }
+
+ public void freeOffscreenBuffer(long id, long hdc) {
+ wgl.wglReleasePbufferDCARB(id, hdc);
+ wgl.wglDestroyPbufferARB(id);
+ }
+
+ public VolatileImage createCompatibleVolatileImage(int width, int height) {
+ return new OGLVolatileImage(this, width, height);
+ }
+}
Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WGLGraphicsConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGL.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGL.java?view=diff&rev=561748&r1=561747&r2=561748
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGL.java (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGL.java Wed Aug 1 03:01:54 2007
@@ -1,256 +1,256 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @author Oleg V. Khaschansky
- * @version $Revision$
- */
-/**
- * This file is based on WGL headers and has been generated by the nativebridge tool.
- */
-
-package org.apache.harmony.awt.nativebridge.windows;
-
-import org.apache.harmony.awt.nativebridge.*;
-
-/**
- * This file is based on WGL headers and has been generated by the nativebridge tool.
- */
-public class WGL extends BasicLibWrapper {
- static WGL instance;
-
- public static synchronized WGL getInstance() {
- if (instance == null) {
- instance = new WGL();
- }
- return instance;
- }
-
- private WGL() {
- System.loadLibrary("Win32Wrapper");
- init();
- }
-
- private static native void init();
-
- public final long wglGetProcAddress(String param_0) {
- Int8Pointer _param_0 = null == param_0? null : nb.createInt8Pointer(param_0, false);
- long tmp_0 = _param_0 == null ? 0 : _param_0.longLockPointer();
- long tmp_ret = wglGetProcAddress(tmp_0);
- if (_param_0 != null) {
- _param_0.unlock();
- _param_0.free();
- }
- return tmp_ret;
- }
- public final long wglGetProcAddress(Int8Pointer param_0) {
- long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
- long tmp_ret = wglGetProcAddress(tmp_0);
- if (param_0 != null) {
- param_0.unlock();
- }
- return tmp_ret;
- }
- public final native long wglGetProcAddress(long param_0);
-
- public final native long wglCreateContext(long param_0);
-
-
- public static class HGLRC__ extends CommonStructWrapper {
-
- public static final int sizeof = 4;
-
- HGLRC__(boolean direct) {
- super(sizeof, direct);
- }
- HGLRC__(VoidPointer base) {
- super(base);
- }
- HGLRC__(long addr) {
- super(addr);
- }
- public final void set_unused(int val) {
- byteBase.setInt32(0, val);
- }
- public final int get_unused() {
- return byteBase.getInt32(0);
- }
- public int size() {
- return sizeof;
- }
- }
-
- public final HGLRC__ createHGLRC__(boolean direct) {
- return new HGLRC__(direct);
- }
- public final HGLRC__ createHGLRC__(VoidPointer base) {
- return new HGLRC__(base);
- }
- public final HGLRC__ createHGLRC__(long addr) {
- return new HGLRC__(addr);
- }
-
- public final int wglMakeCurrent(long param_0, WGL.HGLRC__ param_1) {
- long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
- int tmp_ret = wglMakeCurrent(param_0, tmp_0);
- if (param_1 != null) {
- param_1.unlock();
- }
- return tmp_ret;
- }
- public final native int wglMakeCurrent(long param_0, long param_1);
-
- public final int wglDestroyPbufferARB(HPBUFFERARB__ param_0) {
- long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
- int tmp_ret = wglDestroyPbufferARB(tmp_0);
- if (param_0 != null) {
- param_0.unlock();
- }
- return tmp_ret;
- }
- public final native int wglDestroyPbufferARB(long param_0);
-
-
- public static class HPBUFFERARB__ extends CommonStructWrapper {
-
- public static final int sizeof = 4;
-
- HPBUFFERARB__(boolean direct) {
- super(sizeof, direct);
- }
- HPBUFFERARB__(VoidPointer base) {
- super(base);
- }
- HPBUFFERARB__(long addr) {
- super(addr);
- }
- public final void set_unused(int val) {
- byteBase.setInt32(0, val);
- }
- public final int get_unused() {
- return byteBase.getInt32(0);
- }
- public int size() {
- return sizeof;
- }
- }
-
- public final HPBUFFERARB__ createHPBUFFERARB__(boolean direct) {
- return new HPBUFFERARB__(direct);
- }
- public final HPBUFFERARB__ createHPBUFFERARB__(VoidPointer base) {
- return new HPBUFFERARB__(base);
- }
- public final HPBUFFERARB__ createHPBUFFERARB__(long addr) {
- return new HPBUFFERARB__(addr);
- }
-
- public final native int SwapBuffers(long param_0);
-
- public final int wglReleasePbufferDCARB(WGL.HPBUFFERARB__ param_0, long param_1) {
- long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
- int tmp_ret = wglReleasePbufferDCARB(tmp_0, param_1);
- if (param_0 != null) {
- param_0.unlock();
- }
- return tmp_ret;
- }
- public final native int wglReleasePbufferDCARB(long param_0, long param_1);
-
- public final WGL.HPBUFFERARB__ wglCreatePbufferARB(long param_0, int param_1, int param_2, int param_3, Int32Pointer param_4) {
- long tmp_0 = param_4 == null ? 0 : param_4.longLockPointer();
- long tmp_ret = wglCreatePbufferARB(param_0, param_1, param_2, param_3, tmp_0);
- if (param_4 != null) {
- param_4.unlock();
- }
- return WGL.instance.createHPBUFFERARB__(tmp_ret);
- }
- public final native long wglCreatePbufferARB(long param_0, int param_1, int param_2, int param_3, long param_4);
-
- public final int wglQueryPbufferARB(WGL.HPBUFFERARB__ param_0, int param_1, Int32Pointer param_2) {
- long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
- long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer();
- int tmp_ret = wglQueryPbufferARB(tmp_0, param_1, tmp_1);
- if (param_0 != null) {
- param_0.unlock();
- }
- if (param_2 != null) {
- param_2.unlock();
- }
- return tmp_ret;
- }
- public final native int wglQueryPbufferARB(long param_0, int param_1, long param_2);
-
- public final int wglDeleteContext(WGL.HGLRC__ param_0) {
- long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
- int tmp_ret = wglDeleteContext(tmp_0);
- if (param_0 != null) {
- param_0.unlock();
- }
- return tmp_ret;
- }
- public final native int wglDeleteContext(long param_0);
-
- public final native long wglGetExtensionsStringARB(long param_0);
-
- public final int wglChoosePixelFormatARB(long param_0, Int32Pointer param_1, FloatPointer param_2, int param_3, Int32Pointer param_4, Int32Pointer param_5) {
- long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
- long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer();
- long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer();
- long tmp_3 = param_5 == null ? 0 : param_5.longLockPointer();
- int tmp_ret = wglChoosePixelFormatARB(param_0, tmp_0, tmp_1, param_3, tmp_2, tmp_3);
- if (param_1 != null) {
- param_1.unlock();
- }
- if (param_2 != null) {
- param_2.unlock();
- }
- if (param_4 != null) {
- param_4.unlock();
- }
- if (param_5 != null) {
- param_5.unlock();
- }
- return tmp_ret;
- }
- public final native int wglChoosePixelFormatARB(long param_0, long param_1, long param_2, int param_3, long param_4, long param_5);
-
- public final int wglShareLists(WGL.HGLRC__ param_0, WGL.HGLRC__ param_1) {
- long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
- long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer();
- int tmp_ret = wglShareLists(tmp_0, tmp_1);
- if (param_0 != null) {
- param_0.unlock();
- }
- if (param_1 != null) {
- param_1.unlock();
- }
- return tmp_ret;
- }
- public final native int wglShareLists(long param_0, long param_1);
-
- public final long wglGetPbufferDCARB(WGL.HPBUFFERARB__ param_0) {
- long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
- long tmp_ret = wglGetPbufferDCARB(tmp_0);
- if (param_0 != null) {
- param_0.unlock();
- }
- return tmp_ret;
- }
- public final native long wglGetPbufferDCARB(long param_0);
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @author Oleg V. Khaschansky
+ * @version $Revision$
+ */
+/**
+ * This file is based on WGL headers and has been generated by the nativebridge tool.
+ */
+
+package org.apache.harmony.awt.nativebridge.windows;
+
+import org.apache.harmony.awt.nativebridge.*;
+
+/**
+ * This file is based on WGL headers and has been generated by the nativebridge tool.
+ */
+public class WGL extends BasicLibWrapper {
+ static WGL instance;
+
+ public static synchronized WGL getInstance() {
+ if (instance == null) {
+ instance = new WGL();
+ }
+ return instance;
+ }
+
+ private WGL() {
+ System.loadLibrary("Win32Wrapper");
+ init();
+ }
+
+ private static native void init();
+
+ public final long wglGetProcAddress(String param_0) {
+ Int8Pointer _param_0 = null == param_0? null : nb.createInt8Pointer(param_0, false);
+ long tmp_0 = _param_0 == null ? 0 : _param_0.longLockPointer();
+ long tmp_ret = wglGetProcAddress(tmp_0);
+ if (_param_0 != null) {
+ _param_0.unlock();
+ _param_0.free();
+ }
+ return tmp_ret;
+ }
+ public final long wglGetProcAddress(Int8Pointer param_0) {
+ long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
+ long tmp_ret = wglGetProcAddress(tmp_0);
+ if (param_0 != null) {
+ param_0.unlock();
+ }
+ return tmp_ret;
+ }
+ public final native long wglGetProcAddress(long param_0);
+
+ public final native long wglCreateContext(long param_0);
+
+
+ public static class HGLRC__ extends CommonStructWrapper {
+
+ public static final int sizeof = 4;
+
+ HGLRC__(boolean direct) {
+ super(sizeof, direct);
+ }
+ HGLRC__(VoidPointer base) {
+ super(base);
+ }
+ HGLRC__(long addr) {
+ super(addr);
+ }
+ public final void set_unused(int val) {
+ byteBase.setInt32(0, val);
+ }
+ public final int get_unused() {
+ return byteBase.getInt32(0);
+ }
+ public int size() {
+ return sizeof;
+ }
+ }
+
+ public final HGLRC__ createHGLRC__(boolean direct) {
+ return new HGLRC__(direct);
+ }
+ public final HGLRC__ createHGLRC__(VoidPointer base) {
+ return new HGLRC__(base);
+ }
+ public final HGLRC__ createHGLRC__(long addr) {
+ return new HGLRC__(addr);
+ }
+
+ public final int wglMakeCurrent(long param_0, WGL.HGLRC__ param_1) {
+ long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
+ int tmp_ret = wglMakeCurrent(param_0, tmp_0);
+ if (param_1 != null) {
+ param_1.unlock();
+ }
+ return tmp_ret;
+ }
+ public final native int wglMakeCurrent(long param_0, long param_1);
+
+ public final int wglDestroyPbufferARB(HPBUFFERARB__ param_0) {
+ long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
+ int tmp_ret = wglDestroyPbufferARB(tmp_0);
+ if (param_0 != null) {
+ param_0.unlock();
+ }
+ return tmp_ret;
+ }
+ public final native int wglDestroyPbufferARB(long param_0);
+
+
+ public static class HPBUFFERARB__ extends CommonStructWrapper {
+
+ public static final int sizeof = 4;
+
+ HPBUFFERARB__(boolean direct) {
+ super(sizeof, direct);
+ }
+ HPBUFFERARB__(VoidPointer base) {
+ super(base);
+ }
+ HPBUFFERARB__(long addr) {
+ super(addr);
+ }
+ public final void set_unused(int val) {
+ byteBase.setInt32(0, val);
+ }
+ public final int get_unused() {
+ return byteBase.getInt32(0);
+ }
+ public int size() {
+ return sizeof;
+ }
+ }
+
+ public final HPBUFFERARB__ createHPBUFFERARB__(boolean direct) {
+ return new HPBUFFERARB__(direct);
+ }
+ public final HPBUFFERARB__ createHPBUFFERARB__(VoidPointer base) {
+ return new HPBUFFERARB__(base);
+ }
+ public final HPBUFFERARB__ createHPBUFFERARB__(long addr) {
+ return new HPBUFFERARB__(addr);
+ }
+
+ public final native int SwapBuffers(long param_0);
+
+ public final int wglReleasePbufferDCARB(WGL.HPBUFFERARB__ param_0, long param_1) {
+ long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
+ int tmp_ret = wglReleasePbufferDCARB(tmp_0, param_1);
+ if (param_0 != null) {
+ param_0.unlock();
+ }
+ return tmp_ret;
+ }
+ public final native int wglReleasePbufferDCARB(long param_0, long param_1);
+
+ public final WGL.HPBUFFERARB__ wglCreatePbufferARB(long param_0, int param_1, int param_2, int param_3, Int32Pointer param_4) {
+ long tmp_0 = param_4 == null ? 0 : param_4.longLockPointer();
+ long tmp_ret = wglCreatePbufferARB(param_0, param_1, param_2, param_3, tmp_0);
+ if (param_4 != null) {
+ param_4.unlock();
+ }
+ return WGL.instance.createHPBUFFERARB__(tmp_ret);
+ }
+ public final native long wglCreatePbufferARB(long param_0, int param_1, int param_2, int param_3, long param_4);
+
+ public final int wglQueryPbufferARB(WGL.HPBUFFERARB__ param_0, int param_1, Int32Pointer param_2) {
+ long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
+ long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer();
+ int tmp_ret = wglQueryPbufferARB(tmp_0, param_1, tmp_1);
+ if (param_0 != null) {
+ param_0.unlock();
+ }
+ if (param_2 != null) {
+ param_2.unlock();
+ }
+ return tmp_ret;
+ }
+ public final native int wglQueryPbufferARB(long param_0, int param_1, long param_2);
+
+ public final int wglDeleteContext(WGL.HGLRC__ param_0) {
+ long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
+ int tmp_ret = wglDeleteContext(tmp_0);
+ if (param_0 != null) {
+ param_0.unlock();
+ }
+ return tmp_ret;
+ }
+ public final native int wglDeleteContext(long param_0);
+
+ public final native long wglGetExtensionsStringARB(long param_0);
+
+ public final int wglChoosePixelFormatARB(long param_0, Int32Pointer param_1, FloatPointer param_2, int param_3, Int32Pointer param_4, Int32Pointer param_5) {
+ long tmp_0 = param_1 == null ? 0 : param_1.longLockPointer();
+ long tmp_1 = param_2 == null ? 0 : param_2.longLockPointer();
+ long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer();
+ long tmp_3 = param_5 == null ? 0 : param_5.longLockPointer();
+ int tmp_ret = wglChoosePixelFormatARB(param_0, tmp_0, tmp_1, param_3, tmp_2, tmp_3);
+ if (param_1 != null) {
+ param_1.unlock();
+ }
+ if (param_2 != null) {
+ param_2.unlock();
+ }
+ if (param_4 != null) {
+ param_4.unlock();
+ }
+ if (param_5 != null) {
+ param_5.unlock();
+ }
+ return tmp_ret;
+ }
+ public final native int wglChoosePixelFormatARB(long param_0, long param_1, long param_2, int param_3, long param_4, long param_5);
+
+ public final int wglShareLists(WGL.HGLRC__ param_0, WGL.HGLRC__ param_1) {
+ long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
+ long tmp_1 = param_1 == null ? 0 : param_1.longLockPointer();
+ int tmp_ret = wglShareLists(tmp_0, tmp_1);
+ if (param_0 != null) {
+ param_0.unlock();
+ }
+ if (param_1 != null) {
+ param_1.unlock();
+ }
+ return tmp_ret;
+ }
+ public final native int wglShareLists(long param_0, long param_1);
+
+ public final long wglGetPbufferDCARB(WGL.HPBUFFERARB__ param_0) {
+ long tmp_0 = param_0 == null ? 0 : param_0.longLockPointer();
+ long tmp_ret = wglGetPbufferDCARB(tmp_0);
+ if (param_0 != null) {
+ param_0.unlock();
+ }
+ return tmp_ret;
+ }
+ public final native long wglGetPbufferDCARB(long param_0);
+
+}
+
Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGL.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGLDefs.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGLDefs.java?view=diff&rev=561748&r1=561747&r2=561748
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGLDefs.java (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGLDefs.java Wed Aug 1 03:01:54 2007
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * @author Oleg V. Khaschansky
- * @version $Revision$
- */
-/**
- * This file is based on WGL headers.
- */
-
-package org.apache.harmony.awt.nativebridge.windows;
-
-public interface WGLDefs {
- public static final int WGL_DRAW_TO_WINDOW_ARB = 0x2001;
- public static final int WGL_PIXEL_TYPE_ARB = 0x2013;
- public static final int WGL_TYPE_RGBA_ARB = 0x202B;
- public static final int WGL_DRAW_TO_PBUFFER_ARB = 0x202D;
- public static final int WGL_STENCIL_BITS_ARB = 0x2023;
- public static final int WGL_ALPHA_BITS_ARB = 0x201B;
- public static final int WGL_DOUBLE_BUFFER_ARB = 0x2011;
- public static final int WGL_ACCELERATION_ARB = 0x2003;
- public static final int WGL_FULL_ACCELERATION_ARB = 0x2027;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @author Oleg V. Khaschansky
+ * @version $Revision$
+ */
+/**
+ * This file is based on WGL headers.
+ */
+
+package org.apache.harmony.awt.nativebridge.windows;
+
+public interface WGLDefs {
+ public static final int WGL_DRAW_TO_WINDOW_ARB = 0x2001;
+ public static final int WGL_PIXEL_TYPE_ARB = 0x2013;
+ public static final int WGL_TYPE_RGBA_ARB = 0x202B;
+ public static final int WGL_DRAW_TO_PBUFFER_ARB = 0x202D;
+ public static final int WGL_STENCIL_BITS_ARB = 0x2023;
+ public static final int WGL_ALPHA_BITS_ARB = 0x201B;
+ public static final int WGL_DOUBLE_BUFFER_ARB = 0x2011;
+ public static final int WGL_ACCELERATION_ARB = 0x2003;
+ public static final int WGL_FULL_ACCELERATION_ARB = 0x2027;
+}
Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/nativebridge/windows/WGLDefs.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/oglwrapper/shared/nativelib_common.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/main/native/oglwrapper/shared/org_apache_harmony_awt_gl_opengl_GL.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/awt/src/test/api/java/common/org/apache/harmony/awt/AWTPermissionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java?view=diff&rev=561748&r1=561747&r2=561748
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java (original)
+++ harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java Wed Aug 1 03:01:54 2007
@@ -1,85 +1,85 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.beans.tests.java.beans.beancontext;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.beancontext.BeanContextSupport;
-import java.beans.beancontext.BeanContextMembershipListener;
-import java.beans.beancontext.BeanContextMembershipEvent;
-import java.beans.beancontext.BeanContextChildSupport;
-import java.util.Locale;
-
-import junit.framework.TestCase;
-
-public class BeanContextSupport2Test extends TestCase {
-
- //Regression for HARMONY-3774.
- public void test_setLocale_null() throws Exception
- {
- Locale locale = Locale.FRANCE;
- BeanContextSupport beanContextSupport = new BeanContextSupport(null, locale);
- assertEquals(Locale.FRANCE, beanContextSupport.getLocale());
- MyPropertyChangeListener myPropertyChangeListener = new MyPropertyChangeListener();
- beanContextSupport.addPropertyChangeListener("locale", myPropertyChangeListener);
- beanContextSupport.setLocale(null);
- assertEquals(Locale.FRANCE, beanContextSupport.getLocale());
- assertFalse(myPropertyChangeListener.changed);
- }
-
- /**
- * Regression test for HARMONY-4011
- */
- public void test4011() {
- BeanContextSupport context = new BeanContextSupport();
- final int[] k = { 0 };
- BeanContextMembershipListener listener =
- new BeanContextMembershipListener() {
-
- public void childrenAdded(BeanContextMembershipEvent bcme) {
- k[0]++;
- }
-
- public void childrenRemoved(BeanContextMembershipEvent bcme) {}
- };
-
- // add listener
- context.addBeanContextMembershipListener(listener);
- context.add(new BeanContextChildSupport());
- assertEquals(1, k[0]);
-
- // add the same listener onse again
- context.addBeanContextMembershipListener(listener);
- context.add(new BeanContextChildSupport());
- assertEquals(2, k[0]);
- }
-
- private class MyPropertyChangeListener implements PropertyChangeListener {
- public boolean changed = false;
-
- public void propertyChange(PropertyChangeEvent event) {
- changed = true;
- }
-
- public void reset() {
- changed = false;
- }
-
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.beans.tests.java.beans.beancontext;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.beancontext.BeanContextSupport;
+import java.beans.beancontext.BeanContextMembershipListener;
+import java.beans.beancontext.BeanContextMembershipEvent;
+import java.beans.beancontext.BeanContextChildSupport;
+import java.util.Locale;
+
+import junit.framework.TestCase;
+
+public class BeanContextSupport2Test extends TestCase {
+
+ //Regression for HARMONY-3774.
+ public void test_setLocale_null() throws Exception
+ {
+ Locale locale = Locale.FRANCE;
+ BeanContextSupport beanContextSupport = new BeanContextSupport(null, locale);
+ assertEquals(Locale.FRANCE, beanContextSupport.getLocale());
+ MyPropertyChangeListener myPropertyChangeListener = new MyPropertyChangeListener();
+ beanContextSupport.addPropertyChangeListener("locale", myPropertyChangeListener);
+ beanContextSupport.setLocale(null);
+ assertEquals(Locale.FRANCE, beanContextSupport.getLocale());
+ assertFalse(myPropertyChangeListener.changed);
+ }
+
+ /**
+ * Regression test for HARMONY-4011
+ */
+ public void test4011() {
+ BeanContextSupport context = new BeanContextSupport();
+ final int[] k = { 0 };
+ BeanContextMembershipListener listener =
+ new BeanContextMembershipListener() {
+
+ public void childrenAdded(BeanContextMembershipEvent bcme) {
+ k[0]++;
+ }
+
+ public void childrenRemoved(BeanContextMembershipEvent bcme) {}
+ };
+
+ // add listener
+ context.addBeanContextMembershipListener(listener);
+ context.add(new BeanContextChildSupport());
+ assertEquals(1, k[0]);
+
+ // add the same listener onse again
+ context.addBeanContextMembershipListener(listener);
+ context.add(new BeanContextChildSupport());
+ assertEquals(2, k[0]);
+ }
+
+ private class MyPropertyChangeListener implements PropertyChangeListener {
+ public boolean changed = false;
+
+ public void propertyChange(PropertyChangeEvent event) {
+ changed = true;
+ }
+
+ public void reset() {
+ changed = false;
+ }
+
+ }
+
+}
Propchange: harmony/enhanced/classlib/trunk/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/beancontext/BeanContextSupport2Test.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnectionManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/SecurityManager2Test.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java?view=diff&rev=561748&r1=561747&r2=561748
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java Wed Aug 1 03:01:54 2007
@@ -1,85 +1,85 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.java.net;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.SecureCacheResponse;
-import java.security.Principal;
-import java.security.cert.Certificate;
-import java.util.List;
-import java.util.Map;
-
-import javax.net.ssl.SSLPeerUnverifiedException;
-
-import junit.framework.TestCase;
-
-public class SecureCacheResponseTest extends TestCase {
-
- public void testSecureCacheResponse() {
- // test constructor
- SecureCacheResponse sc = new MockCacheResponse();
- // nothing happened
- assertNull(sc.getCipherSuite());
- }
-
- class MockCacheResponse extends SecureCacheResponse{
-
- @Override
- public String getCipherSuite() {
- // do nothing
- return null;
- }
-
- @Override
- public List<Certificate> getLocalCertificateChain() {
- // do nothing
- return null;
- }
-
- @Override
- public Principal getLocalPrincipal() {
- // do nothing
- return null;
- }
-
- @Override
- public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
- // do nothing
- return null;
- }
-
- @Override
- public List<Certificate> getServerCertificateChain() throws SSLPeerUnverifiedException {
- // do nothing
- return null;
- }
-
- @Override
- public InputStream getBody() throws IOException {
- // do nothing
- return null;
- }
-
- @Override
- public Map<String, List<String>> getHeaders() throws IOException {
- // do nothing
- return null;
- }
-
- }
-}
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package tests.api.java.net;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.SecureCacheResponse;
+import java.security.Principal;
+import java.security.cert.Certificate;
+import java.util.List;
+import java.util.Map;
+
+import javax.net.ssl.SSLPeerUnverifiedException;
+
+import junit.framework.TestCase;
+
+public class SecureCacheResponseTest extends TestCase {
+
+ public void testSecureCacheResponse() {
+ // test constructor
+ SecureCacheResponse sc = new MockCacheResponse();
+ // nothing happened
+ assertNull(sc.getCipherSuite());
+ }
+
+ class MockCacheResponse extends SecureCacheResponse{
+
+ @Override
+ public String getCipherSuite() {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public List<Certificate> getLocalCertificateChain() {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public Principal getLocalPrincipal() {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public List<Certificate> getServerCertificateChain() throws SSLPeerUnverifiedException {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public InputStream getBody() throws IOException {
+ // do nothing
+ return null;
+ }
+
+ @Override
+ public Map<String, List<String>> getHeaders() throws IOException {
+ // do nothing
+ return null;
+ }
+
+ }
+}
Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/SecureCacheResponseTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java?view=diff&rev=561748&r1=561747&r2=561748
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java Wed Aug 1 03:01:54 2007
@@ -1,95 +1,95 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package tests.api.java.util;
-
-import java.util.AbstractSequentialList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.ListIterator;
-
-import junit.framework.TestCase;
-
-public class AbstractSequentialListTest extends TestCase {
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- class ASLT<E> extends AbstractSequentialList<E> {
-
- LinkedList<E> l = new LinkedList<E>();
-
- @Override
- public ListIterator<E> listIterator(int index) {
- return l.listIterator(index);
- }
-
- @Override
- public int size() {
- return l.size();
- }
- }
-
- /**
- * @tests {@link java.util.AbstractSequentialList#addAll(int, java.util.Collection)}
- */
- public void test_addAll_ILCollection() {
- AbstractSequentialList<String> al = new ASLT<String>();
- String[] someList = { "Aardvark", //$NON-NLS-1$
- "Bear", //$NON-NLS-1$
- "Chimpanzee", //$NON-NLS-1$
- "Duck" }; //$NON-NLS-1$
- Collection<String> c = Arrays.asList(someList);
- al.addAll(c);
- assertTrue("Should return true", al.addAll(2, c)); //$NON-NLS-1$
- }
-
- public void test_set() throws Exception {
- MyAbstractSequentialList list = new MyAbstractSequentialList();
- try {
- list.set(0, new Object());
- fail("should throw IndexOutOfBoundsException");
- } catch (IndexOutOfBoundsException e) {
- // expected
- }
- }
-
- public static class MyAbstractSequentialList extends AbstractSequentialList {
-
- private LinkedList list = new LinkedList();
-
- public ListIterator listIterator(int index) {
- ListIterator iter = list.listIterator();
- for (int i = 0; i < index; i++) {
- iter.next();
- }
- return iter;
- }
-
- @Override
- public int size() {
- return list.size();
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package tests.api.java.util;
+
+import java.util.AbstractSequentialList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.ListIterator;
+
+import junit.framework.TestCase;
+
+public class AbstractSequentialListTest extends TestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ class ASLT<E> extends AbstractSequentialList<E> {
+
+ LinkedList<E> l = new LinkedList<E>();
+
+ @Override
+ public ListIterator<E> listIterator(int index) {
+ return l.listIterator(index);
+ }
+
+ @Override
+ public int size() {
+ return l.size();
+ }
+ }
+
+ /**
+ * @tests {@link java.util.AbstractSequentialList#addAll(int, java.util.Collection)}
+ */
+ public void test_addAll_ILCollection() {
+ AbstractSequentialList<String> al = new ASLT<String>();
+ String[] someList = { "Aardvark", //$NON-NLS-1$
+ "Bear", //$NON-NLS-1$
+ "Chimpanzee", //$NON-NLS-1$
+ "Duck" }; //$NON-NLS-1$
+ Collection<String> c = Arrays.asList(someList);
+ al.addAll(c);
+ assertTrue("Should return true", al.addAll(2, c)); //$NON-NLS-1$
+ }
+
+ public void test_set() throws Exception {
+ MyAbstractSequentialList list = new MyAbstractSequentialList();
+ try {
+ list.set(0, new Object());
+ fail("should throw IndexOutOfBoundsException");
+ } catch (IndexOutOfBoundsException e) {
+ // expected
+ }
+ }
+
+ public static class MyAbstractSequentialList extends AbstractSequentialList {
+
+ private LinkedList list = new LinkedList();
+
+ public ListIterator listIterator(int index) {
+ ListIterator iter = list.listIterator();
+ for (int i = 0; i < index; i++) {
+ iter.next();
+ }
+ return iter;
+ }
+
+ @Override
+ public int size() {
+ return list.size();
+ }
+ }
+}
Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/AbstractSequentialListTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/luni/src/test/impl/org/apache/harmony/tests/internal/net/www/protocol/http/PersistenceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/freebsd.x86/hysignal_context.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/unix/freebsd.x86/hysignal_context.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/javax/rmi/ssl/SslRMIClientSocketFactoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/tests/javax/rmi/ssl/SslRMIServerSocketFactoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native