Add boilerplate

This commit is contained in:
Rene Hexel 2016-06-03 12:33:57 +10:00
parent 977ec2b1b9
commit f1f6eb4720
7 changed files with 29 additions and 2 deletions

0
Gdk-3.0.blacklist Normal file
View File

14
Gdk-3.0.preamble Normal file
View File

@ -0,0 +1,14 @@
import CGLib
import CCairo
import CPango
import CGdkPixbuf
import CGdk
import GLib
import GObject
import Pango
import Cairo
import PangoCairo
import GdkPixbuf
// missing header file type aliases
public typealias GdkXEvent = _GdkXEvent

7
Gdk-3.0.sed Normal file
View File

@ -0,0 +1,7 @@
s/GObject.Callback/Callback/g
s/EVENT_STOP: Bool = 5/EVENT_STOP: gboolean = 1/
s/gdk_cursor_ref/g_object_ref/g
s/gdk_cursor_unref/g_object_unref/g
s/create_similar_image_surface(format: CInt/create_similar_image_surface(format: cairo_format_t/
s/cairo.Content/Content/g
s/-> GdkAtom {/-> GdkAtom! {/g

2
Gdk-3.0.verbatim Normal file
View File

@ -0,0 +1,2 @@
EVENT_STOP
PRIORITY_REDRAW

3
Gdk-3.0.whitelist Normal file
View File

@ -0,0 +1,3 @@
Color
Gravity
Rectangle

View File

@ -3,7 +3,8 @@ import PackageDescription
let package = Package(
name: "Gdk",
dependencies: [
.Package(url: "https://github.com/rhx/CGdk.git", majorVersion: 1),
.Package(url: "https://github.com/rhx/SwiftGdkPixbuf.git", majorVersion: 2),
.Package(url: "https://github.com/rhx/SwiftPangoCairo.git", majorVersion: 2)
]
)
)

View File

@ -23,5 +23,5 @@ if [ ! -e "${GIR}" ] ; then
fi
LINKFLAGS=`pkg-config --libs $module pangocairo pangoft2 pango gobject-2.0 gio-unix-2.0 glib-2.0 | tr ' ' '\n' | sed 's/^/-Xlinker /' | tr '\n' ' '`
CCFLAGS=`pkg-config --cflags $module pangocairo pangoft2 pango gobject-2.0 gio-unix-2.0 glib-2.0 | tr ' ' '\n' | sed 's/^/-Xcc /' | tr '\n' ' ' `
gir2swift -p ${GIR_DIR}/GLib-2.0.gir -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/Pango-1.0.gir -p ${GIR_DIR}/Cairo-1.0.gir -p ${GIR_DIR}/PangoCairo-1.0.gir "${GIR}" | sed -f ${module}.sed > Sources/${Module}.swift
gir2swift -p ${GIR_DIR}/GLib-2.0.gir -p ${GIR_DIR}/GObject-2.0.gir -p ${GIR_DIR}/Pango-1.0.gir -p ${GIR_DIR}/Cairo-1.0.gir -p ${GIR_DIR}/PangoCairo-1.0.gir -p ${GIR_DIR}/GdkPixbuf-2.0.gir "${GIR}" | sed -f ${module}.sed > Sources/${Module}.swift
swift build $CCFLAGS $LINKFLAGS "$@"