(Changed all structs to public vis. by default)

This commit is contained in:
Robert Straw
2014-04-01 08:21:33 -05:00
parent ef0e904b88
commit 5850a74e8b
8 changed files with 244 additions and 244 deletions
+151 -151
View File
@@ -81,229 +81,229 @@ pub mod ll {
pub static SDL_LASTEVENT: SDL_EventType = 65535;
pub struct SDL_CommonEvent {
_type: uint32_t,
timestamp: uint32_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
}
pub struct SDL_WindowEvent {
_type: uint32_t,
timestamp: uint32_t,
windowID: uint32_t,
event: uint8_t,
padding1: uint8_t,
padding2: uint8_t,
padding3: uint8_t,
data1: int32_t,
data2: int32_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub windowID: uint32_t,
pub event: uint8_t,
pub padding1: uint8_t,
pub padding2: uint8_t,
pub padding3: uint8_t,
pub data1: int32_t,
pub data2: int32_t,
}
pub struct SDL_KeyboardEvent {
_type: uint32_t,
timestamp: uint32_t,
windowID: uint32_t,
state: uint8_t,
repeat: uint8_t,
padding2: uint8_t,
padding3: uint8_t,
keysym: SDL_Keysym,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub windowID: uint32_t,
pub state: uint8_t,
pub repeat: uint8_t,
pub padding2: uint8_t,
pub padding3: uint8_t,
pub keysym: SDL_Keysym,
}
pub struct SDL_TextEditingEvent {
_type: uint32_t,
timestamp: uint32_t,
windowID: uint32_t,
text: [c_schar, ..32u],
start: int32_t,
length: int32_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub windowID: uint32_t,
pub text: [c_schar, ..32u],
pub start: int32_t,
pub length: int32_t,
}
pub struct SDL_TextInputEvent {
_type: uint32_t,
timestamp: uint32_t,
windowID: uint32_t,
text: [c_schar, ..32u],
pub _type: uint32_t,
pub timestamp: uint32_t,
pub windowID: uint32_t,
pub text: [c_schar, ..32u],
}
pub struct SDL_MouseMotionEvent {
_type: uint32_t,
timestamp: uint32_t,
windowID: uint32_t,
which: uint32_t,
state: uint32_t,
x: int32_t,
y: int32_t,
xrel: int32_t,
yrel: int32_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub windowID: uint32_t,
pub which: uint32_t,
pub state: uint32_t,
pub x: int32_t,
pub y: int32_t,
pub xrel: int32_t,
pub yrel: int32_t,
}
pub struct SDL_MouseButtonEvent {
_type: uint32_t,
timestamp: uint32_t,
windowID: uint32_t,
which: uint32_t,
button: uint8_t,
state: uint8_t,
padding1: uint8_t,
padding2: uint8_t,
x: int32_t,
y: int32_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub windowID: uint32_t,
pub which: uint32_t,
pub button: uint8_t,
pub state: uint8_t,
pub padding1: uint8_t,
pub padding2: uint8_t,
pub x: int32_t,
pub y: int32_t,
}
pub struct SDL_MouseWheelEvent {
_type: uint32_t,
timestamp: uint32_t,
windowID: uint32_t,
which: uint32_t,
x: int32_t,
y: int32_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub windowID: uint32_t,
pub which: uint32_t,
pub x: int32_t,
pub y: int32_t,
}
pub struct SDL_JoyAxisEvent {
_type: uint32_t,
timestamp: uint32_t,
which: int32_t,
axis: uint8_t,
padding1: uint8_t,
padding2: uint8_t,
padding3: uint8_t,
value: int16_t,
padding4: uint16_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub which: int32_t,
pub axis: uint8_t,
pub padding1: uint8_t,
pub padding2: uint8_t,
pub padding3: uint8_t,
pub value: int16_t,
pub padding4: uint16_t,
}
pub struct SDL_JoyBallEvent {
_type: uint32_t,
timestamp: uint32_t,
which: int32_t,
ball: uint8_t,
padding1: uint8_t,
padding2: uint8_t,
padding3: uint8_t,
xrel: int16_t,
yrel: int16_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub which: int32_t,
pub ball: uint8_t,
pub padding1: uint8_t,
pub padding2: uint8_t,
pub padding3: uint8_t,
pub xrel: int16_t,
pub yrel: int16_t,
}
pub struct SDL_JoyHatEvent {
_type: uint32_t,
timestamp: uint32_t,
which: int32_t,
hat: uint8_t,
value: uint8_t,
padding1: uint8_t,
padding2: uint8_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub which: int32_t,
pub hat: uint8_t,
pub value: uint8_t,
pub padding1: uint8_t,
pub padding2: uint8_t,
}
pub struct SDL_JoyButtonEvent {
_type: uint32_t,
timestamp: uint32_t,
which: int32_t,
button: uint8_t,
state: uint8_t,
padding1: uint8_t,
padding2: uint8_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub which: int32_t,
pub button: uint8_t,
pub state: uint8_t,
pub padding1: uint8_t,
pub padding2: uint8_t,
}
pub struct SDL_JoyDeviceEvent {
_type: uint32_t,
timestamp: uint32_t,
which: int32_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub which: int32_t,
}
pub struct SDL_ControllerAxisEvent {
_type: uint32_t,
timestamp: uint32_t,
which: int32_t,
axis: uint8_t,
padding1: uint8_t,
padding2: uint8_t,
padding3: uint8_t,
value: int16_t,
padding4: uint16_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub which: int32_t,
pub axis: uint8_t,
pub padding1: uint8_t,
pub padding2: uint8_t,
pub padding3: uint8_t,
pub value: int16_t,
pub padding4: uint16_t,
}
pub struct SDL_ControllerButtonEvent {
_type: uint32_t,
timestamp: uint32_t,
which: int32_t,
button: uint8_t,
state: uint8_t,
padding1: uint8_t,
padding2: uint8_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub which: int32_t,
pub button: uint8_t,
pub state: uint8_t,
pub padding1: uint8_t,
pub padding2: uint8_t,
}
pub struct SDL_ControllerDeviceEvent {
_type: uint32_t,
timestamp: uint32_t,
which: int32_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub which: int32_t,
}
pub struct SDL_TouchFingerEvent {
_type: uint32_t,
timestamp: uint32_t,
touchId: SDL_TouchID,
fingerId: SDL_FingerID,
x: c_float,
y: c_float,
dx: c_float,
dy: c_float,
pressure: c_float,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub touchId: SDL_TouchID,
pub fingerId: SDL_FingerID,
pub x: c_float,
pub y: c_float,
pub dx: c_float,
pub dy: c_float,
pub pressure: c_float,
}
pub struct SDL_MultiGestureEvent {
_type: uint32_t,
timestamp: uint32_t,
touchId: SDL_TouchID,
dTheta: c_float,
dDist: c_float,
x: c_float,
y: c_float,
numFingers: uint16_t,
padding: uint16_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub touchId: SDL_TouchID,
pub dTheta: c_float,
pub dDist: c_float,
pub x: c_float,
pub y: c_float,
pub numFingers: uint16_t,
pub padding: uint16_t,
}
pub struct SDL_DollarGestureEvent {
_type: uint32_t,
timestamp: uint32_t,
touchId: SDL_TouchID,
gestureId: SDL_GestureID,
numFingers: uint32_t,
error: c_float,
x: c_float,
y: c_float,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub touchId: SDL_TouchID,
pub gestureId: SDL_GestureID,
pub numFingers: uint32_t,
pub error: c_float,
pub x: c_float,
pub y: c_float,
}
pub struct SDL_DropEvent {
_type: uint32_t,
timestamp: uint32_t,
file: *c_schar,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub file: *c_schar,
}
pub struct SDL_QuitEvent {
_type: uint32_t,
timestamp: uint32_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
}
pub struct SDL_OSEvent {
_type: uint32_t,
timestamp: uint32_t,
pub _type: uint32_t,
pub timestamp: uint32_t,
}
pub struct SDL_UserEvent {
_type: uint32_t,
timestamp: uint32_t,
windowID: uint32_t,
code: int32_t,
data1: *c_void,
data2: *c_void,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub windowID: uint32_t,
pub code: int32_t,
pub data1: *c_void,
pub data2: *c_void,
}
pub struct SDL_SysWMEvent {
_type: uint32_t,
timestamp: uint32_t,
msg: *SDL_SysWMmsg,
pub _type: uint32_t,
pub timestamp: uint32_t,
pub msg: *SDL_SysWMmsg,
}
pub struct SDL_Event {
data: [uint8_t, ..56u],
pub data: [uint8_t, ..56u],
}
impl SDL_Event {
+4 -4
View File
@@ -25,10 +25,10 @@ pub mod ll {
// SDL_keyboard.h
pub struct SDL_Keysym {
scancode: SDL_Scancode,
sym: SDL_Keycode,
_mod: uint16_t,
unused: uint32_t,
pub scancode: SDL_Scancode,
pub sym: SDL_Keycode,
pub _mod: uint16_t,
pub unused: uint32_t,
}
extern "C" {
+29 -29
View File
@@ -6,40 +6,40 @@ pub mod ll {
//SDL_pixels.h
pub struct SDL_Color {
r: uint8_t,
g: uint8_t,
b: uint8_t,
a: uint8_t,
pub r: uint8_t,
pub g: uint8_t,
pub b: uint8_t,
pub a: uint8_t,
}
pub struct SDL_Palette {
ncolors: c_int,
colors: *SDL_Color,
version: uint32_t,
refcount: c_int
pub ncolors: c_int,
pub colors: *SDL_Color,
pub version: uint32_t,
pub refcount: c_int
}
#[allow(uppercase_variables)]
pub struct SDL_PixelFormat {
format: SDL_PixelFormatFlag,
palette: *SDL_Palette,
BitsPerPixel: uint8_t,
BytesPerPixel: uint8_t,
padding: [uint8_t, ..2],
Rmask: uint8_t,
Gmask: uint8_t,
Bmask: uint8_t,
Amask: uint8_t,
Rloss: uint8_t,
Gloss: uint8_t,
Bloss: uint8_t,
Aloss: uint8_t,
Rshift: uint8_t,
Gshift: uint8_t,
Bshift: uint8_t,
Ashift: uint8_t,
refcount: c_int,
next: *SDL_PixelFormat
pub format: SDL_PixelFormatFlag,
pub palette: *SDL_Palette,
pub BitsPerPixel: uint8_t,
pub BytesPerPixel: uint8_t,
pub padding: [uint8_t, ..2],
pub Rmask: uint8_t,
pub Gmask: uint8_t,
pub Bmask: uint8_t,
pub Amask: uint8_t,
pub Rloss: uint8_t,
pub Gloss: uint8_t,
pub Bloss: uint8_t,
pub Aloss: uint8_t,
pub Rshift: uint8_t,
pub Gshift: uint8_t,
pub Bshift: uint8_t,
pub Ashift: uint8_t,
pub refcount: c_int,
pub next: *SDL_PixelFormat
}
pub type SDL_PixelFormatFlag = uint32_t;
@@ -89,7 +89,7 @@ pub mod ll {
}
#[deriving(Eq)] #[allow(raw_pointer_deriving)]
pub struct Palette {
raw: *ll::SDL_Palette
pub raw: *ll::SDL_Palette
}
#[deriving(Eq)]
@@ -132,7 +132,7 @@ impl rand::Rand for Color {
#[deriving(Eq)] #[allow(raw_pointer_deriving)]
pub struct PixelFormat {
raw: *ll::SDL_PixelFormat
pub raw: *ll::SDL_PixelFormat
}
#[deriving(Eq, FromPrimitive)]
+6 -6
View File
@@ -5,17 +5,17 @@ use std::ptr;
#[deriving(Eq)]
#[deriving(Clone)]
pub struct Point{
x: i32,
y: i32
pub x: i32,
pub y: i32
}
#[deriving(Eq)]
#[deriving(Clone)]
pub struct Rect {
x: i32,
y: i32,
w: i32,
h: i32
pub x: i32,
pub y: i32,
pub w: i32,
pub h: i32
}
#[allow(non_camel_case_types)]
+20 -20
View File
@@ -36,12 +36,12 @@ pub mod ll {
pub struct SDL_RendererInfo
{
name: *c_char,
flags: uint32_t,
num_texture_formats: uint32_t,
texture_formats: [uint32_t, ..16],
max_texture_width: c_int,
max_texture_height: c_int,
pub name: *c_char,
pub flags: uint32_t,
pub num_texture_formats: uint32_t,
pub texture_formats: [uint32_t, ..16],
pub max_texture_width: c_int,
pub max_texture_height: c_int,
}
pub enum SDL_TextureAccess {
@@ -155,11 +155,11 @@ pub enum RendererFlags {
#[deriving(Eq)]
pub struct RendererInfo {
name: ~str,
flags: Vec<RendererFlags>,
texture_formats: Vec<pixels::PixelFormatFlag>,
max_texture_width: int,
max_texture_height: int
pub name: ~str,
pub flags: Vec<RendererFlags>,
pub texture_formats: Vec<pixels::PixelFormatFlag>,
pub max_texture_width: int,
pub max_texture_height: int
}
#[deriving(Eq, FromPrimitive)]
@@ -216,9 +216,9 @@ enum RendererParent {
#[deriving(Eq)] #[allow(raw_pointer_deriving)]
pub struct Renderer {
raw: *ll::SDL_Renderer,
priv parent: RendererParent,
owned: bool
pub raw: *ll::SDL_Renderer,
parent: RendererParent,
pub owned: bool
}
impl Drop for Renderer {
@@ -516,16 +516,16 @@ impl Renderer {
}
pub struct TextureQuery {
format: pixels::PixelFormatFlag,
access: TextureAccess,
width: int,
height: int
pub format: pixels::PixelFormatFlag,
pub access: TextureAccess,
pub width: int,
pub height: int
}
#[deriving(Eq)] #[allow(raw_pointer_deriving)]
pub struct Texture {
raw: *ll::SDL_Texture,
owned: bool
pub raw: *ll::SDL_Texture,
pub owned: bool
}
impl Drop for Texture {
+7 -7
View File
@@ -7,13 +7,13 @@ pub mod ll {
}
pub struct SDL_RWops {
size: *uint8_t,
seek: *uint8_t,
read: *uint8_t,
write: *uint8_t,
close: *uint8_t,
_type: uint32_t,
priv hidden: SDL_RWops_Anon
pub size: *uint8_t,
pub seek: *uint8_t,
pub read: *uint8_t,
pub write: *uint8_t,
pub close: *uint8_t,
pub _type: uint32_t,
hidden: SDL_RWops_Anon
}
extern "C" {
+14 -14
View File
@@ -28,18 +28,18 @@ pub mod ll {
pub struct SDL_BlitMap;
pub struct SDL_Surface {
flags: uint32_t,
format: *SDL_PixelFormat,
w: c_int,
h: c_int,
pitch: c_int,
pixels: *c_void,
userdata: *c_void,
locked: c_int,
lock_data: *c_void,
clip_rect: SDL_Rect,
map: *SDL_BlitMap,
refcount: c_int
pub flags: uint32_t,
pub format: *SDL_PixelFormat,
pub w: c_int,
pub h: c_int,
pub pitch: c_int,
pub pixels: *c_void,
pub userdata: *c_void,
pub locked: c_int,
pub lock_data: *c_void,
pub clip_rect: SDL_Rect,
pub map: *SDL_BlitMap,
pub refcount: c_int
}
extern "C" {
@@ -85,8 +85,8 @@ pub enum SurfaceFlag {
#[deriving(Eq)] #[allow(raw_pointer_deriving)]
pub struct Surface {
raw: *ll::SDL_Surface,
owned: bool
pub raw: *ll::SDL_Surface,
pub owned: bool
}
impl Drop for Surface {
+13 -13
View File
@@ -25,11 +25,11 @@ pub mod ll {
pub struct SDL_Window;
pub struct SDL_DisplayMode {
format: uint32_t,
w: c_int,
h: c_int,
refresh_rate: c_int,
driverdata: *c_void
pub format: uint32_t,
pub w: c_int,
pub h: c_int,
pub refresh_rate: c_int,
pub driverdata: *c_void
}
pub type SDL_WindowPos = c_int;
@@ -220,10 +220,10 @@ fn empty_sdl_display_mode() -> ll::SDL_DisplayMode {
#[deriving(Eq)]
pub struct DisplayMode {
format: u32,
w: int,
h: int,
refresh_rate: int
pub format: u32,
pub w: int,
pub h: int,
pub refresh_rate: int
}
impl DisplayMode {
@@ -322,8 +322,8 @@ fn unwrap_windowpos (pos: WindowPos) -> ll::SDL_WindowPos {
#[deriving(Eq)]
pub struct GLContext {
raw: ll::SDL_GLContext,
owned: bool
pub raw: ll::SDL_GLContext,
pub owned: bool
}
impl Drop for GLContext {
@@ -339,8 +339,8 @@ impl Drop for GLContext {
#[deriving(Eq)] #[allow(raw_pointer_deriving)]
pub struct Window {
raw: *ll::SDL_Window,
owned: bool
pub raw: *ll::SDL_Window,
pub owned: bool
}
impl Drop for Window {