Okay, it builds!
This commit is contained in:
@@ -5,6 +5,7 @@ rust_library(
|
||||
srcs = ["wrlib.rs"],
|
||||
deps = [":wrlib"],
|
||||
visibility = ["//visibility:public"],
|
||||
edition = "2021",
|
||||
)
|
||||
|
||||
cc_library(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::os::raw::{c_char, c_int, c_uchar};
|
||||
use std::os::raw::{c_char, c_int, c_uchar, c_ulong};
|
||||
|
||||
#[repr(u8)]
|
||||
#[repr(C)]
|
||||
pub enum RImageFormat {
|
||||
RGBAFormat = 0,
|
||||
RRGBAFormat = 1,
|
||||
@@ -15,12 +15,60 @@ pub struct RImage {
|
||||
ref_count: c_int,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct RContext {
|
||||
// display: *mut Display,
|
||||
display: usize,
|
||||
screen_number: c_int,
|
||||
// cmap: Colormap,
|
||||
|
||||
// attribs: *mut RContextAttributes,
|
||||
attribs: usize,
|
||||
|
||||
// copy_gc: GC,
|
||||
|
||||
// visual: *mut Visual,
|
||||
visual: usize,
|
||||
depth: c_int,
|
||||
// drawable: Window,
|
||||
vclass: c_int,
|
||||
|
||||
black: c_ulong,
|
||||
white: c_ulong,
|
||||
|
||||
red_offset: c_int,
|
||||
green_offset: c_int,
|
||||
blue_offset: c_int,
|
||||
|
||||
std_rgb_map: usize,
|
||||
std_gray_map: usize,
|
||||
// std_rgb_map: *mut XStandardColorMap,
|
||||
// std_gray_map: *mut XStandardColorMap,
|
||||
|
||||
ncolors: c_int,
|
||||
colors: usize,
|
||||
// colors: *mut XColor,
|
||||
pixels: *mut c_ulong,
|
||||
|
||||
flags: u8,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub enum RScalingFilter {
|
||||
RBoxFilter,
|
||||
RTriangleFilter,
|
||||
RBellFilter,
|
||||
RBSplineFilter,
|
||||
RLanczos3Filter,
|
||||
RMitchellFilter,
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
pub fn r_destroy_conversion_tables() -> ();
|
||||
|
||||
pub fn RLoadPPM(file: *const c_char) -> *mut RImage;
|
||||
|
||||
pub fn RLoadXPM(context: *mut RContext, file: *const c_char) -> mut *RImage;
|
||||
pub fn RLoadXPM(context: *mut RContext, file: *const c_char) -> *mut RImage;
|
||||
|
||||
pub fn RReleaseCache() -> ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user