Code Search for Developers
 
 
  

LinuxSysImplementation.java from Lightweight Java Game Library at Krugle


Show LinuxSysImplementation.java syntax highlighted

/*
 * Copyright (c) 2002-2004 LWJGL Project
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * * Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 *
 * * Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 *
 * * Neither the name of 'LWJGL' nor the names of
 *   its contributors may be used to endorse or promote products derived
 *   from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package org.lwjgl;

import java.security.AccessController;

/**
 *
 * @author elias_naur <elias_naur@users.sourceforge.net>
 * @version $Revision: 2856 $
 * $Id: LinuxSysImplementation.java 2856 2007-06-29 22:11:31Z elias_naur $
 */
class LinuxSysImplementation extends J2SESysImplementation {
	static {
		java.awt.Toolkit.getDefaultToolkit(); // This will make sure libjawt.so is loaded
	}

	public boolean openURL(final String url) {
		// Linux may as well resort to pure Java hackery, as there's no Linux native way of doing it
		// right anyway.

		String[] browsers = {"xdg-open", "firefox", "mozilla", "opera", "konqueror", "nautilus", "galeon", "netscape"};

		for (int i = 0; i < browsers.length; i ++) {
			final String browser = browsers[i];
			try {
				LWJGLUtil.execPrivileged(new String[] { browser, url });
				return true;
			} catch (Exception e) {
				// Ignore
				e.printStackTrace(System.err);
			}
		}

		// Seems to have failed
		return false;
	}

	public boolean has64Bit() {
		return true;
	}
}




See more files for this project here

Lightweight Java Game Library

A Java Game Library extension: 1. Handles the graphics, sound, and input simply 2. Wraps OpenGL, OpenAL, fmod3 and DevIL 3. Hires timers LWJGL currently supports Linux, Mac OS X (10.2 and above) and Windows (98 and above).

Project homepage: http://sourceforge.net/projects/java-game-lib
Programming language(s): C,Java
License: other

  d3d/
    Context.java
    ContextImplementation.java
    D3DAdapterIdentifier9.java
    D3DBox.java
    D3DCaps9.java
    D3DClipStatus9.java
    D3DColorValue.java
    D3DDeviceCreationParameters.java
    D3DDisplaymode.java
    D3DDisplaymodeEx.java
    D3DDisplaymodeFilter.java
    D3DGammaRamp.java
    D3DIndexBufferDesc.java
    D3DLight9.java
    D3DLockedBox.java
    D3DLockedRect.java
    D3DMaterial9.java
    D3DMatrix.java
    D3DPShaderCaps2_0.java
    D3DPresentParameters.java
    D3DPresentStats.java
    D3DRasterStatus.java
    D3DRectPatchInfo.java
    D3DRegionData.java
    D3DRegionDataHeader.java
    D3DSsurfaceDesc.java
    D3DSurfaceDesc.java
    D3DTriPatchInfo.java
    D3DUtil.java
    D3DVShaderCaps2_0.java
    D3DVector.java
    D3DVertexBufferDesc.java
    D3DVertexElement9.java
    D3DViewport9.java
    D3DVolumeDesc.java
    Direct3DConstants.java
    Display.java
    DisplayImplementation.java
    DisplayMode.java
    Drawable.java
    EventQueue.java
    GUID.java
    GlobalLock.java
    IDirect3D9.java
    IDirect3D9Ex.java
    IDirect3DBaseTexture9.java
    IDirect3DCubeTexture9.java
    IDirect3DDevice9.java
    IDirect3DDevice9Ex.java
    IDirect3DIndexBuffer9.java
    IDirect3DPixelShader9.java
    IDirect3DQuery9.java
    IDirect3DResource9.java
    IDirect3DStateBlock9.java
    IDirect3DSurface9.java
    IDirect3DSwapChain9.java
    IDirect3DSwapChain9Ex.java
    IDirect3DTexture9.java
    IDirect3DVertexBuffer9.java
    IDirect3DVertexDeclaration9.java
    IDirect3DVertexShader9.java
    IDirect3DVolume9.java
    IDirect3DVolumeTexture9.java
    InputImplementation.java
    LUID.java
    NewDisplay.java
    PaletteEntry.java
    PeerInfo.java
    PixelFormat.java
    Point.java
    Rectangle.java
    RegionData.java
    RegionDataHeader.java
    WindowsContextImplementation.java
    WindowsDirectInput.java
    WindowsDirectInput3.java
    WindowsDirectInput8.java
    WindowsDirectInputDevice.java
    WindowsDirectInputDevice3.java
    WindowsDirectInputDevice8.java
  devil/
  examples/
  fmod3/
  input/
  openal/
  opengl/
  test/
  util/
  BufferChecks.java
  BufferUtils.java
  DefaultSysImplementation.java
  J2SESysImplementation.java
  LWJGLException.java
  LWJGLUtil.java
  LinuxSysImplementation.java
  MacOSXSysImplementation.java
  NondirectBufferWrapper.java
  Sys.java
  SysImplementation.java
  WindowsSysImplementation.java