From 567f89515de9136a877e115f87e315bda6481ec5 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 22 Nov 2004 21:40:13 +0000 Subject: [PATCH] Mac OS X: Implemented MacOSXDisplay.openURL() --- src/java/org/lwjgl/opengl/MacOSXDisplay.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/java/org/lwjgl/opengl/MacOSXDisplay.java b/src/java/org/lwjgl/opengl/MacOSXDisplay.java index de454ebc..26f8cec7 100644 --- a/src/java/org/lwjgl/opengl/MacOSXDisplay.java +++ b/src/java/org/lwjgl/opengl/MacOSXDisplay.java @@ -51,6 +51,7 @@ import java.lang.reflect.Proxy; import java.nio.ByteBuffer; import java.nio.FloatBuffer; import java.nio.IntBuffer; +import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -375,8 +376,16 @@ final class MacOSXDisplay implements DisplayImplementation { return GL11.glGetString(GL11.GL_EXTENSIONS).indexOf("GL_APPLE_pixel_buffer") != -1 ? Pbuffer.PBUFFER_SUPPORTED : 0; } + /* Use the com.apple.eio.FileManager Mac OS X extension to show the given URL */ public boolean openURL(String url) { - return false; + try { + Class com_apple_eio_FileManager = Class.forName("com.apple.eio.FileManager"); + Method openURL_method = com_apple_eio_FileManager.getMethod("openURL", new Class[]{String.class}); + openURL_method.invoke(null, new Object[]{url}); + return true; + } catch (Exception e) { + return false; + } } /**