Initial commit
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
*~
|
||||
*#
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
*.dylib
|
||||
*.dSYM
|
||||
*.dll
|
||||
*.dummy
|
||||
cocoa-test
|
||||
build
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
VPATH=%VPATH%
|
||||
|
||||
RUSTC ?= rustc
|
||||
RUSTFLAGS ?=
|
||||
|
||||
RUST_SRC=$(shell find $(VPATH)/. -type f -name '*.rs')
|
||||
|
||||
.PHONY: all clean
|
||||
all: librustcoregraphics.dummy
|
||||
|
||||
librustcoregraphics.dummy: core_graphics.rc $(RUST_SRC)
|
||||
$(RUSTC) $(RUSTFLAGS) $< -o $@
|
||||
touch $@
|
||||
|
||||
rustcoregraphics-test: core_graphics.rc $(RUST_SRC)
|
||||
$(RUSTC) $(RUSTFLAGS) $< -o $@ --test
|
||||
|
||||
check: rustcoregraphics-test
|
||||
./rustcoregraphics-test
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a *.so *.dylib *.dll *.dummy
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRCDIR="$(cd $(dirname $0) && pwd)"
|
||||
sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.in > Makefile
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#[link(name = "core_graphics",
|
||||
vers = "0.1")];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
extern mod std;
|
||||
|
||||
pub mod data_provider;
|
||||
pub mod font;
|
||||
@@ -0,0 +1,16 @@
|
||||
use libc::{c_void, c_char, size_t};
|
||||
|
||||
pub type CGDataProviderRef = *c_void;
|
||||
pub type CGDataProviderReleaseDataCallback = *c_void;
|
||||
|
||||
#[link_args="-framework CoreGraphics"]
|
||||
#[nolink]
|
||||
extern {
|
||||
pub fn CGDataProviderCreateWithFilename(filename: *c_char) -> CGDataProviderRef;
|
||||
pub fn CGDataProviderCreateWithData(info: *c_void,
|
||||
data: *c_void,
|
||||
size: size_t,
|
||||
releaseData: CGDataProviderReleaseDataCallback
|
||||
) -> CGDataProviderRef;
|
||||
pub fn CGDataProviderRelease(provider: CGDataProviderRef);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
use libc::{c_void, c_char, size_t};
|
||||
use data_provider::CGDataProviderRef;
|
||||
|
||||
pub type CGFontRef = *c_void;
|
||||
|
||||
#[link_args="-framework CoreGraphics"]
|
||||
#[nolink]
|
||||
extern {
|
||||
pub fn CGFontCreateWithDataProvider(provider: CGDataProviderRef) -> CGFontRef;
|
||||
pub fn CGFontRelease(font: CGFontRef);
|
||||
}
|
||||
Reference in New Issue
Block a user