Merge branch 'feature_crate_attributes' of git://github.com/alexandercampbell/rust-sdl2 into alexandercampbell-feature_crate_attributes

Conflicts:
	src/sdl2/lib.rs
This commit is contained in:
Tony Aldridge
2015-02-02 09:44:41 +00:00
15 changed files with 23 additions and 11 deletions
+2
View File
@@ -1,3 +1,5 @@
#![feature(rand)]
extern crate sdl2;
use sdl2::audio::{AudioCallback, AudioSpecDesired};
+2
View File
@@ -1,3 +1,5 @@
#![feature(io, std_misc, core)]
extern crate sdl2;
use sdl2::{joystick, controller};
+2
View File
@@ -1,3 +1,5 @@
#![feature(os)]
extern crate "pkg-config" as pkg_config;
fn main() {
+2
View File
@@ -1,5 +1,7 @@
#![allow(non_camel_case_types)]
#![feature(core, libc)]
extern crate libc;
pub mod scancode;
+2 -2
View File
@@ -6,7 +6,7 @@ use std::mem;
use libc::c_int;
/// A structure that defines a two dimensional point.
#[derive(PartialEq, Clone, Show, Copy)]
#[derive(PartialEq, Clone, Debug, Copy)]
#[repr(C)]
pub struct Point {
pub x: i32,
@@ -14,7 +14,7 @@ pub struct Point {
}
/// A structure that defines a rectangle, with the origin at the upper left.
#[derive(PartialEq, Clone, Show, Copy)]
#[derive(PartialEq, Clone, Debug, Copy)]
#[repr(C)]
pub struct Rect {
pub x: i32,
+2 -2
View File
@@ -33,7 +33,7 @@ pub const AUDIOS32SYS : AudioFormat = ll::AUDIO_S32SYS;
pub const AUDIOF32SYS : AudioFormat = ll::AUDIO_F32SYS;
#[repr(C)]
#[derive(Copy, Clone, PartialEq, Hash, Show, FromPrimitive)]
#[derive(Copy, Clone, PartialEq, Hash, Debug, FromPrimitive)]
pub enum AudioStatus {
Stopped = ll::SDL_AUDIO_STOPPED as isize,
Playing = ll::SDL_AUDIO_PLAYING as isize,
@@ -288,7 +288,7 @@ impl<T: AudioFormatNum<T>, CB: AudioCallback<T>> AudioSpecDesired<T, CB> {
}
#[allow(missing_copy_implementations)]
#[derive(Show)]
#[derive(Debug)]
pub struct AudioSpec {
pub freq: i32,
// TODO: Showing format should be prettier
+2 -2
View File
@@ -8,7 +8,7 @@ use joystick;
use sys::controller as ll;
use sys::event::{SDL_QUERY, SDL_ENABLE};
#[derive(Copy, Clone, PartialEq, Show)]
#[derive(Copy, Clone, PartialEq, Debug)]
#[repr(i32)]
pub enum Axis {
Invalid = ll::SDL_CONTROLLER_AXIS_INVALID,
@@ -54,7 +54,7 @@ pub fn wrap_controller_axis(bitflags: u8) -> Axis {
}
}
#[derive(Copy, Clone, PartialEq, Show)]
#[derive(Copy, Clone, PartialEq, Debug)]
#[repr(i32)]
pub enum Button {
Invalid = ll::SDL_CONTROLLER_BUTTON_INVALID,
+1 -1
View File
@@ -82,7 +82,7 @@ pub enum EventType {
Last = ll::SDL_LASTEVENT,
}
#[derive(Copy, Clone, Show)]
#[derive(Copy, Clone, Debug)]
/// An enum of window events.
pub enum WindowEventId {
None,
+1
View File
@@ -1 +1,2 @@
#[allow(unused)]
use sys::gesture as ll;
+1
View File
@@ -1,2 +1,3 @@
//! Haptic Functions
#[allow(unused)]
use sys::haptic as ll;
+1 -1
View File
@@ -3,7 +3,7 @@ use std::num::ToPrimitive;
use sys::keycode as ll;
#[derive(PartialEq, Eq, FromPrimitive, Show, Copy)]
#[derive(PartialEq, Eq, FromPrimitive, Debug, Copy)]
pub enum KeyCode {
Unknown = ll::SDLK_UNKNOWN as isize,
Backspace = ll::SDLK_BACKSPACE as isize,
+1 -1
View File
@@ -1,7 +1,7 @@
#![crate_name = "sdl2"]
#![crate_type = "lib"]
#![feature(slicing_syntax, unsafe_destructor, optin_builtin_traits)]
#![feature(slicing_syntax, unsafe_destructor, optin_builtin_traits, std_misc, io, libc, hash, core, collections, rand, path)]
extern crate libc;
extern crate collections;
+1 -1
View File
@@ -62,7 +62,7 @@ pub struct PixelFormat {
impl_raw_accessors!((PixelFormat, *const ll::SDL_PixelFormat));
impl_raw_constructor!((PixelFormat, PixelFormat (raw: *const ll::SDL_PixelFormat)));
#[derive(Copy, Clone, PartialEq, Show, FromPrimitive)]
#[derive(Copy, Clone, PartialEq, Debug, FromPrimitive)]
pub enum PixelFormatEnum {
Unknown = ll::SDL_PIXELFORMAT_UNKNOWN as isize,
Index1LSB = ll::SDL_PIXELFORMAT_INDEX1LSB as isize,
+1 -1
View File
@@ -3,7 +3,7 @@ use std::num::ToPrimitive;
use sys::scancode as ll;
#[derive(PartialEq, Eq, FromPrimitive, Show, Copy)]
#[derive(PartialEq, Eq, FromPrimitive, Debug, Copy)]
pub enum ScanCode {
Unknown = ll::SDL_SCANCODE_UNKNOWN as isize,
A = ll::SDL_SCANCODE_A as isize,
+2
View File
@@ -1,3 +1,5 @@
#![feature(path)]
extern crate sdl2;
#[test]