2022-09-07 15:23:37 +00:00
|
|
|
use std::os::raw::*;
|
|
|
|
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct Position {
|
|
|
|
x: c_int,
|
|
|
|
y: c_int,
|
|
|
|
}
|
|
|
|
|
2022-09-07 15:29:09 +00:00
|
|
|
#[repr(C)]
|
|
|
|
pub struct Sizes {
|
|
|
|
width: c_int,
|
|
|
|
height: c_int,
|
|
|
|
}
|
|
|
|
|
2022-09-07 15:23:37 +00:00
|
|
|
impl Default for Position {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self::new(0, 0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-07 15:29:09 +00:00
|
|
|
impl Default for Sizes {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self::new(0, 0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-07 15:23:37 +00:00
|
|
|
impl Position {
|
|
|
|
fn new(x: c_int, y: c_int) -> Self {
|
|
|
|
Self { x, y }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn x(&self) -> c_int {
|
|
|
|
self.x
|
|
|
|
}
|
|
|
|
|
|
|
|
fn y(&self) -> c_int {
|
|
|
|
self.y
|
|
|
|
}
|
|
|
|
}
|
2022-09-07 15:29:09 +00:00
|
|
|
|
|
|
|
impl Sizes {
|
|
|
|
fn new(width: c_int, height: c_int) -> Self {
|
|
|
|
Self { width, height }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn width(&self) -> c_int {
|
|
|
|
self.width
|
|
|
|
}
|
|
|
|
|
|
|
|
fn height(&self) -> c_int {
|
|
|
|
self.height
|
|
|
|
}
|
|
|
|
}
|