Initial commit

This commit is contained in:
Brian J. Burg
2012-10-19 12:45:59 -07:00
commit 7971feda4f
6 changed files with 74 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
*~
*#
*.o
*.a
*.so
*.dylib
*.dSYM
*.dll
*.dummy
cocoa-test
build
+23
View File
@@ -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
Vendored Executable
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
SRCDIR="$(cd $(dirname $0) && pwd)"
sed "s#%VPATH%#${SRCDIR}#" ${SRCDIR}/Makefile.in > Makefile
+8
View File
@@ -0,0 +1,8 @@
#[link(name = "core_graphics",
vers = "0.1")];
#[crate_type = "lib"];
extern mod std;
pub mod data_provider;
pub mod font;
+16
View File
@@ -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);
}
+11
View File
@@ -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);
}