From 24640a13aa26c165e20d71c7a46babe3cc7affd0 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Wed, 29 Oct 2014 12:37:00 +1000 Subject: [PATCH] Remove glx bindings, use the servo/rust-glx project instead. --- src/glx.rs | 142 ----------------------------------------------------- src/lib.rs | 3 -- 2 files changed, 145 deletions(-) delete mode 100644 src/glx.rs diff --git a/src/glx.rs b/src/glx.rs deleted file mode 100644 index 5172ce8..0000000 --- a/src/glx.rs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2013 The Servo Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! Functions for X11 support. - -use libc::{c_char, c_int, c_ulong}; - -// Types - -pub struct Display { - _opaque: (), -} - -pub type GLXDrawable = c_ulong; - -pub struct __GLXFBConfig { - _opaque: (), -} - -pub type GLXFBConfig = *mut __GLXFBConfig; - -pub type GLXPixmap = c_ulong; - -pub type Pixmap = c_ulong; - -pub struct __XVisualInfo { - _opaque: (), -} - -pub type XVisualInfo = *mut __XVisualInfo; - -// Constants - -pub static GLX_BIND_TO_TEXTURE_RGB_EXT: c_int = 0x20d0; -pub static GLX_BIND_TO_TEXTURE_RGBA_EXT: c_int = 0x20d1; -pub static GLX_BIND_TO_MIPMAP_TEXTURE_EXT: c_int = 0x20d2; -pub static GLX_BIND_TO_TEXTURE_TARGETS_EXT: c_int = 0x20d3; -pub static GLX_Y_INVERTED_EXT: c_int = 0x20d4; - -pub static GLX_TEXTURE_FORMAT_EXT: c_int = 0x20d5; -pub static GLX_TEXTURE_TARGET_EXT: c_int = 0x20d6; -pub static GLX_MIPMAP_TEXTURE_EXT: c_int = 0x20d7; - -pub static GLX_TEXTURE_FORMAT_NONE_EXT: c_int = 0x20d8; -pub static GLX_TEXTURE_FORMAT_RGB_EXT: c_int = 0x20d9; -pub static GLX_TEXTURE_FORMAT_RGBA_EXT: c_int = 0x20da; - -pub static GLX_TEXTURE_1D_BIT_EXT: c_int = 0x1; -pub static GLX_TEXTURE_2D_BIT_EXT: c_int = 0x2; -pub static GLX_TEXTURE_RECTANGLE_BIT_EXT: c_int = 0x4; - -pub static GLX_TEXTURE_1D_EXT: c_int = 0x20db; -pub static GLX_TEXTURE_2D_EXT: c_int = 0x20dc; -pub static GLX_TEXTURE_RECTANGLE_EXT: c_int = 0x20dd; - -pub static GLX_FRONT_LEFT_EXT: c_int = 0x20de; -pub static GLX_FRONT_RIGHT_EXT: c_int = 0x20df; -pub static GLX_BACK_LEFT_EXT: c_int = 0x20e0; -pub static GLX_BACK_RIGHT_EXT: c_int = 0x20e1; -pub static GLX_FRONT_EXT: c_int = GLX_FRONT_LEFT_EXT; -pub static GLX_BACK_EXT: c_int = GLX_BACK_LEFT_EXT; -pub static GLX_AUX0_EXT: c_int = 0x20e2; -pub static GLX_AUX1_EXT: c_int = 0x20e3; -pub static GLX_AUX2_EXT: c_int = 0x20e4; -pub static GLX_AUX3_EXT: c_int = 0x20e5; -pub static GLX_AUX4_EXT: c_int = 0x20e6; -pub static GLX_AUX5_EXT: c_int = 0x20e7; -pub static GLX_AUX6_EXT: c_int = 0x20e8; -pub static GLX_AUX7_EXT: c_int = 0x20e9; -pub static GLX_AUX8_EXT: c_int = 0x20ea; -pub static GLX_AUX9_EXT: c_int = 0x20eb; - -pub static GLX_DRAWABLE_TYPE: c_int = 0x8010; -pub static GLX_RENDER_TYPE: c_int = 0x8011; - -pub static GLX_VENDOR: c_int = 1; - -pub static GLX_RGBA: c_int = 4; -pub static GLX_DOUBLEBUFFER: c_int = 5; -pub static GLX_ALPHA_SIZE: c_int = 11; -pub static GLX_DEPTH_SIZE: c_int = 12; - -pub static GLX_WINDOW_BIT: c_int = 0x01; -pub static GLX_PIXMAP_BIT: c_int = 0x02; -pub static GLX_PBUFFER_BIT: c_int = 0x04; -pub static GLX_AUX_BUFFERS_BIT: c_int = 0x10; - -pub static GLX_RGBA_BIT: c_int = 0x00000001; -// Functions - -extern { - pub fn glXQueryVersion(dpy: *mut Display, major: *mut c_int, minor: *mut c_int) -> bool; - - pub fn glXGetProcAddress(procName: *mut c_char) -> extern "C" fn(); - - pub fn glXReleaseTexImageEXT(dpy: *mut Display, drawable: GLXDrawable, buffer: c_int); - - pub fn glXChooseFBConfig(dpy: *mut Display, - screen: c_int, - attrib_list: *mut c_int, - n_elements: *mut c_int) - -> *mut GLXFBConfig; - - pub fn glXChooseVisual(dpy: *mut Display, screen: c_int, attribList: *mut c_int) -> *mut XVisualInfo; - - // For GLX 1.3+ - pub fn glXCreatePixmap(dpy: *mut Display, config: GLXFBConfig, pixmap: Pixmap, attribList: *mut c_int) - -> GLXPixmap; - - pub fn glXDestroyPixmap(dpy: *mut Display, pixmap: GLXPixmap); - - // For GLX < 1.3. Use only to match behavior with other libraries (i.e. Skia) that - // access GLX pixmaps using the visual instead of fbconfig. - pub fn glXCreateGLXPixmap(dpy: *mut Display, visual: *mut XVisualInfo, pixmap: Pixmap) -> GLXPixmap; - - pub fn glXDestroyGLXPixmap(dpy: *mut Display, pix: GLXPixmap); - - pub fn glXGetFBConfigAttrib(dpy: *mut Display, - config: GLXFBConfig, - attribute: c_int, - value: *mut c_int) - -> c_int; - - pub fn glXGetFBConfigs(dpy: *mut Display, screen: c_int, nelements: *mut c_int) -> *mut GLXFBConfig; - - pub fn glXGetVisualFromFBConfig(dpy: *mut Display, config: GLXFBConfig) -> *mut XVisualInfo; -} - -pub fn get_version(display: *mut Display) -> (int, int) { - unsafe { - let mut major = 0; - let mut minor = 0; - glXQueryVersion(display, &mut major, &mut minor); - (major as int, minor as int) - } -} diff --git a/src/lib.rs b/src/lib.rs index e8d2a58..c1401ec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,9 +14,6 @@ extern crate libc; pub mod gl2; -#[cfg(target_os="linux")] -pub mod glx; - #[cfg(target_os="macos")] pub mod cgl;