]> gitweb.factorcode.org Git - factor.git/commitdiff
update vocabs so a load-all on macosx works without parsing c-type strings
authorJoe Groff <arcata@gmail.com>
Sun, 27 Sep 2009 20:11:21 +0000 (15:11 -0500)
committerJoe Groff <arcata@gmail.com>
Sun, 27 Sep 2009 20:11:21 +0000 (15:11 -0500)
42 files changed:
basis/compression/zlib/ffi/ffi.factor
basis/db/postgresql/ffi/ffi.factor
basis/glib/glib.factor
basis/images/bitmap/loading/loading.factor
basis/iokit/hid/hid.factor
basis/math/blas/matrices/matrices.factor
basis/math/blas/vectors/vectors.factor
basis/math/floats/env/x86/x86.factor
basis/pango/cairo/cairo.factor
basis/pango/fonts/fonts.factor
basis/pango/layouts/layouts.factor
basis/pango/pango.factor
basis/ui/pens/gradient/gradient.factor
basis/ui/pens/polygon/polygon.factor
basis/x11/constants/constants.factor
basis/x11/xlib/xlib.factor
extra/benchmark/dawes/dawes.factor
extra/benchmark/dispatch2/dispatch2.factor
extra/benchmark/dispatch3/dispatch3.factor
extra/benchmark/fasta/fasta.factor
extra/benchmark/nbody-simd/nbody-simd.factor
extra/benchmark/nbody/nbody.factor
extra/benchmark/raytracer/raytracer.factor
extra/benchmark/spectral-norm/spectral-norm.factor
extra/benchmark/struct-arrays/struct-arrays.factor
extra/freetype/freetype.factor
extra/gpu/render/render-docs.factor
extra/gpu/util/util.factor
extra/gpu/util/wasd/wasd.factor
extra/grid-meshes/grid-meshes.factor
extra/images/normalization/normalization.factor
extra/jamshred/player/player.factor
extra/jamshred/tunnel/tunnel.factor
extra/native-thread-test/native-thread-test.factor
extra/nurbs/nurbs.factor
extra/ogg/ogg.factor
extra/openal/macosx/macosx.factor
extra/openal/other/other.factor
extra/opengl/glu/glu.factor
extra/terrain/terrain.factor
extra/tokyo/alien/tchdb/tchdb.factor
extra/tokyo/alien/tctdb/tctdb.factor

index a472f9a2fe85479c52d161f48ca05abfedf91a46..553b55cf6e94ed664da1b6afe73787d220d714e3 100755 (executable)
@@ -1,6 +1,7 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.syntax combinators system alien.libraries ;
+USING: alien alien.c-types alien.syntax combinators system
+alien.libraries ;
 IN: compression.zlib.ffi
 
 << "zlib" {
index 1e7f4d5b827f6ef6b265d9ec264e43a6ae3f912b..88618c6212b841b910b6881d2adcc55a1490eff5 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2007, 2008 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 ! tested on debian linux with postgresql 8.1
-USING: alien alien.syntax combinators system alien.libraries ;
+USING: alien alien.c-types alien.syntax combinators system
+alien.libraries ;
 IN: db.postgresql.ffi
 
 << "postgresql" {
@@ -69,6 +70,7 @@ TYPEDEF: void* PGnotify*
 TYPEDEF: void* PQArgBlock*
 TYPEDEF: void* PQprintOpt*
 TYPEDEF: void* SSL*
+TYPEDEF: void* FILE*
 
 LIBRARY: postgresql
 
index ca481cb900fc9645f068d25daf631539881c953a..157a426e19e783769ba82c6fd44910ca2ae8def2 100755 (executable)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2008 Matthew Willis.
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license
-USING: alien alien.syntax alien.destructors combinators system
-alien.libraries ;
+USING: alien alien.c-types alien.syntax alien.destructors
+combinators system alien.libraries ;
 IN: glib
 
 <<
@@ -27,12 +27,10 @@ TYPEDEF: void* gpointer
 TYPEDEF: int gint
 TYPEDEF: bool gboolean
 
-FUNCTION: void
-g_free ( gpointer mem ) ;
+FUNCTION: void g_free ( gpointer mem ) ;
 
 LIBRARY: gobject
 
-FUNCTION: void
-g_object_unref ( gpointer object ) ;
+FUNCTION: void g_object_unref ( gpointer object ) ;
 
 DESTRUCTOR: g_object_unref
index 823cfcd03a9f67c519103a62146b49ef164013e1..91e0cb882db1b3e5ac92535616793dd5314dd5f0 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays byte-arrays combinators
+USING: accessors alien.c-types arrays byte-arrays combinators
 compression.run-length fry grouping images images.loader io
 io.binary io.encodings.8-bit io.encodings.binary
 io.encodings.string io.streams.limited kernel math math.bitwise
index a1a4b942b7941bfa16e3e610d86564e7d30b6536..b3894d7b496dfe867554160baa3994c7a0f5cb31 100644 (file)
@@ -1,6 +1,7 @@
-USING: iokit alien alien.syntax alien.c-types kernel
-system core-foundation core-foundation.data
-core-foundation.dictionaries ;
+USING: iokit alien alien.syntax alien.c-types kernel system
+core-foundation core-foundation.arrays core-foundation.data
+core-foundation.dictionaries core-foundation.run-loop
+core-foundation.strings core-foundation.time ;
 IN: iokit.hid
 
 CONSTANT: kIOHIDDeviceKey "IOHIDDevice"
index aa9681bb2e952360d1add249b10f14efedba6df5..0a6fc147ade16f62d221bec1d22d90efbbb4a03e 100755 (executable)
@@ -1,10 +1,11 @@
-USING: accessors alien alien.c-types alien.data arrays
-byte-arrays combinators combinators.short-circuit fry
-kernel locals macros math math.blas.ffi math.blas.vectors
-math.blas.vectors.private math.complex math.functions
-math.order functors words sequences sequences.merged
-sequences.private shuffle parser prettyprint.backend
-prettyprint.custom ascii specialized-arrays ;
+USING: accessors alien alien.c-types alien.complex
+alien.data arrays byte-arrays combinators
+combinators.short-circuit fry kernel locals macros math
+math.blas.ffi math.blas.vectors math.blas.vectors.private
+math.complex math.functions math.order functors words
+sequences sequences.merged sequences.private shuffle
+parser prettyprint.backend prettyprint.custom ascii
+specialized-arrays ;
 FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 SPECIALIZED-ARRAY: double
index 20ee7925b080a285d67838cb96859cf18962ab5b..8d057de720d8673852c7104ef50f4fe77a4e066f 100755 (executable)
@@ -1,8 +1,8 @@
-USING: accessors alien alien.c-types arrays ascii byte-arrays combinators
-combinators.short-circuit fry kernel math math.blas.ffi
-math.complex math.functions math.order sequences sequences.private
-functors words locals parser prettyprint.backend prettyprint.custom
-specialized-arrays ;
+USING: accessors alien alien.c-types alien.complex arrays ascii
+byte-arrays combinators combinators.short-circuit fry kernel
+math math.blas.ffi math.complex math.functions math.order
+sequences sequences.private functors words locals parser
+prettyprint.backend prettyprint.custom specialized-arrays ;
 FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 SPECIALIZED-ARRAY: double
index e9120567aaa11a5491a407538fa335e4cdc8e86c..2b73628b4ce064b7c6074647d2ad801cd082fa8d 100644 (file)
@@ -1,7 +1,7 @@
-USING: accessors alien.syntax arrays assocs biassocs
-classes.struct combinators cpu.x86.features kernel literals
-math math.bitwise math.floats.env math.floats.env.private
-system ;
+USING: accessors alien.c-types alien.syntax arrays assocs
+biassocs classes.struct combinators cpu.x86.features kernel
+literals math math.bitwise math.floats.env
+math.floats.env.private system ;
 IN: math.floats.env.x86
 
 STRUCT: sse-env
index 45b7a9cb319c72e4507284ed3cb34f45c2c6614e..2ad730ee6e32a1cca77fd48d7475746272e49eec 100644 (file)
@@ -3,8 +3,12 @@
 ! See http://factorcode.org/license.txt for BSD license.
 !
 ! pangocairo bindings, from pango/pangocairo.h
-USING: alien alien.syntax combinators system cairo.ffi
-alien.libraries ;
+USING: arrays sequences alien alien.c-types alien.destructors
+alien.libraries alien.syntax math math.functions math.vectors
+destructors combinators colors fonts accessors assocs namespaces
+kernel pango pango.fonts pango.layouts glib unicode.data images
+cache init system math.rectangles fry memoize io.encodings.utf8
+classes.struct cairo cairo.ffi ;
 IN: pango.cairo
 
 << {
@@ -15,6 +19,9 @@ IN: pango.cairo
 
 LIBRARY: pangocairo
 
+TYPEDEF: void* PangoCairoFontMap*
+TYPEDEF: void* PangoCairoFont*
+
 FUNCTION: PangoFontMap*
 pango_cairo_font_map_new ( ) ;
 
@@ -87,3 +94,150 @@ pango_cairo_layout_path ( cairo_t* cr, PangoLayout* layout ) ;
 
 FUNCTION: void
 pango_cairo_error_underline_path ( cairo_t* cr, double x, double y, double width, double height ) ;
+
+TUPLE: layout < disposable font string selection layout metrics ink-rect logical-rect image ;
+
+SYMBOL: dpi
+
+72 dpi set-global
+
+: set-layout-font ( font layout -- )
+    swap cache-font-description pango_layout_set_font_description ;
+
+: set-layout-text ( str layout -- )
+    #! Replace nulls with something else since Pango uses null-terminated
+    #! strings
+    swap -1 pango_layout_set_text ;
+
+: layout-extents ( layout -- ink-rect logical-rect )
+    PangoRectangle <struct>
+    PangoRectangle <struct>
+    [ pango_layout_get_extents ] 2keep
+    [ PangoRectangle>rect ] bi@ ;
+
+: layout-baseline ( layout -- baseline )
+    pango_layout_get_iter &pango_layout_iter_free
+    pango_layout_iter_get_baseline
+    pango>float ;
+
+: set-foreground ( cr font -- )
+    foreground>> set-source-color ;
+
+: fill-background ( cr font dim -- )
+    [ background>> set-source-color ]
+    [ [ { 0 0 } ] dip <rect> fill-rect ] bi-curry* bi ;
+
+: rect-translate-x ( rect x -- rect' )
+    '[ _ 0 2array v- ] change-loc ;
+
+: first-line ( layout -- line )
+    layout>> 0 pango_layout_get_line_readonly ;
+
+: line-offset>x ( layout n -- x )
+    #! n is an index into the UTF8 encoding of the text
+    [ drop first-line ] [ swap string>> >utf8-index ] 2bi
+    0 0 <int> [ pango_layout_line_index_to_x ] keep
+    *int pango>float ;
+
+: x>line-offset ( layout x -- n )
+    #! n is an index into the UTF8 encoding of the text
+    [
+        [ first-line ] dip
+        float>pango 0 <int> 0 <int>
+        [ pango_layout_line_x_to_index drop ] 2keep
+        [ *int ] bi@ swap
+    ] [ drop string>> ] 2bi utf8-index> + ;
+
+: selection-start/end ( selection -- start end )
+    selection>> [ start>> ] [ end>> ] bi ;
+
+: selection-rect ( layout -- rect )
+    [ ink-rect>> dim>> ] [ ] [ selection-start/end ] tri [ line-offset>x ] bi-curry@ bi
+    [ drop nip 0 2array ] [ swap - swap second 2array ] 3bi <rect> ;
+
+: fill-selection-background ( cr layout -- )
+    dup selection>> [
+        [ selection>> color>> set-source-color ]
+        [
+            [ selection-rect ] [ ink-rect>> loc>> first ] bi
+            rect-translate-x
+            fill-rect
+        ] 2bi
+    ] [ 2drop ] if ;
+
+: text-position ( layout -- loc )
+    [ logical-rect>> ] [ ink-rect>> ] bi [ loc>> ] bi@ v- ;
+
+: set-text-position ( cr loc -- )
+    first2 cairo_move_to ;
+
+: draw-layout ( layout -- image )
+    dup ink-rect>> dim>> [ >fixnum ] map [
+        swap {
+            [ layout>> pango_cairo_update_layout ]
+            [ [ font>> ] [ ink-rect>> dim>> ] bi fill-background ]
+            [ fill-selection-background ]
+            [ text-position set-text-position ]
+            [ font>> set-foreground ]
+            [ layout>> pango_cairo_show_layout ]
+        } 2cleave
+    ] make-bitmap-image ;
+
+: escape-nulls ( str -- str' )
+    { { 0 CHAR: zero-width-no-break-space } } substitute ;
+
+: unpack-selection ( layout string/selection -- layout )
+    dup selection? [
+        [ string>> escape-nulls >>string ] [ >>selection ] bi
+    ] [ escape-nulls >>string ] if ; inline
+
+: set-layout-resolution ( layout -- )
+    pango_layout_get_context dpi get pango_cairo_context_set_resolution ;
+
+: <PangoLayout> ( text font -- layout )
+    dummy-cairo pango_cairo_create_layout |g_object_unref
+    [ set-layout-resolution ] keep
+    [ set-layout-font ] keep
+    [ set-layout-text ] keep ;
+
+: glyph-height ( font string -- y )
+    swap <PangoLayout> &g_object_unref layout-extents drop dim>> second ;
+
+MEMO: missing-font-metrics ( font -- metrics )
+    #! Pango doesn't provide x-height and cap-height but Core Text does, so we
+    #! simulate them on Pango.
+    [
+        [ metrics new ] dip
+        [ "x" glyph-height >>x-height ]
+        [ "Y" glyph-height >>cap-height ] bi
+    ] with-destructors ;
+
+: layout-metrics ( layout -- metrics )
+    dup font>> missing-font-metrics clone
+        swap
+        [ layout>> layout-baseline >>ascent ]
+        [ logical-rect>> dim>> [ first >>width ] [ second >>height ] bi ] bi
+        dup [ height>> ] [ ascent>> ] bi - >>descent ;
+
+: <layout> ( font string -- line )
+    [
+        layout new-disposable
+            swap unpack-selection
+            swap >>font
+            dup [ string>> ] [ font>> ] bi <PangoLayout> >>layout
+            dup layout>> layout-extents [ >>ink-rect ] [ >>logical-rect ] bi*
+            dup layout-metrics >>metrics
+            dup draw-layout >>image
+    ] with-destructors ;
+
+M: layout dispose* layout>> g_object_unref ;
+
+SYMBOL: cached-layouts
+
+: cached-layout ( font string -- layout )
+    cached-layouts get [ <layout> ] 2cache ;
+
+: cached-line ( font string -- line )
+    cached-layout layout>> first-line ;
+
+[ <cache-assoc> cached-layouts set-global ] "pango.cairo" add-init-hook
index abfc086820d03e782a60a776134315d7e71dc259..eb3e2208b1ce90c9faf7fe0cb2e6fd9312c7f96c 100644 (file)
@@ -15,6 +15,15 @@ PANGO_STYLE_OBLIQUE
 PANGO_STYLE_ITALIC ;
 
 TYPEDEF: int PangoWeight
+TYPEDEF: void* PangoFont*
+TYPEDEF: void* PangoFontFamily*
+TYPEDEF: void* PangoFontFace*
+TYPEDEF: void* PangoFontMap*
+TYPEDEF: void* PangoFontMetrics*
+TYPEDEF: void* PangoFontDescription*
+TYPEDEF: void* PangoGlyphString*
+TYPEDEF: void* PangoLanguage*
+
 CONSTANT: PANGO_WEIGHT_THIN 100
 CONSTANT: PANGO_WEIGHT_ULTRALIGHT 200
 CONSTANT: PANGO_WEIGHT_LIGHT 300
@@ -102,4 +111,4 @@ MEMO: (cache-font-description) ( font -- description )
 : cache-font-description ( font -- description )
     strip-font-colors (cache-font-description) ;
 
-[ \ (cache-font-description) reset-memoized ] "pango.fonts" add-init-hook
\ No newline at end of file
+[ \ (cache-font-description) reset-memoized ] "pango.fonts" add-init-hook
index 7a7bd86aea2cded2bdaaa2419a115e080a4e5eb5..a03d26fb6782b8d20c4b45afcff164aef610b963 100644 (file)
@@ -4,12 +4,16 @@
 USING: arrays sequences alien alien.c-types alien.destructors
 alien.syntax math math.functions math.vectors destructors combinators
 colors fonts accessors assocs namespaces kernel pango pango.fonts
-pango.cairo cairo cairo.ffi glib unicode.data images cache init
+glib unicode.data images cache init
 math.rectangles fry memoize io.encodings.utf8 classes.struct ;
 IN: pango.layouts
 
 LIBRARY: pango
 
+TYPEDEF: void* PangoLayout*
+TYPEDEF: void* PangoLayoutIter*
+TYPEDEF: void* PangoLayoutLine*
+
 FUNCTION: PangoLayout*
 pango_layout_new ( PangoContext* context ) ;
 
@@ -60,149 +64,3 @@ pango_layout_iter_free ( PangoLayoutIter* iter ) ;
 
 DESTRUCTOR: pango_layout_iter_free
 
-TUPLE: layout < disposable font string selection layout metrics ink-rect logical-rect image ;
-
-SYMBOL: dpi
-
-72 dpi set-global
-
-: set-layout-font ( font layout -- )
-    swap cache-font-description pango_layout_set_font_description ;
-
-: set-layout-text ( str layout -- )
-    #! Replace nulls with something else since Pango uses null-terminated
-    #! strings
-    swap -1 pango_layout_set_text ;
-
-: set-layout-resolution ( layout -- )
-    pango_layout_get_context dpi get pango_cairo_context_set_resolution ;
-
-: <PangoLayout> ( text font -- layout )
-    dummy-cairo pango_cairo_create_layout |g_object_unref
-    [ set-layout-resolution ] keep
-    [ set-layout-font ] keep
-    [ set-layout-text ] keep ;
-
-: layout-extents ( layout -- ink-rect logical-rect )
-    PangoRectangle <struct>
-    PangoRectangle <struct>
-    [ pango_layout_get_extents ] 2keep
-    [ PangoRectangle>rect ] bi@ ;
-
-: glyph-height ( font string -- y )
-    swap <PangoLayout> &g_object_unref layout-extents drop dim>> second ;
-
-MEMO: missing-font-metrics ( font -- metrics )
-    #! Pango doesn't provide x-height and cap-height but Core Text does, so we
-    #! simulate them on Pango.
-    [
-        [ metrics new ] dip
-        [ "x" glyph-height >>x-height ]
-        [ "Y" glyph-height >>cap-height ] bi
-    ] with-destructors ;
-
-: layout-baseline ( layout -- baseline )
-    pango_layout_get_iter &pango_layout_iter_free
-    pango_layout_iter_get_baseline
-    pango>float ;
-
-: set-foreground ( cr font -- )
-    foreground>> set-source-color ;
-
-: fill-background ( cr font dim -- )
-    [ background>> set-source-color ]
-    [ [ { 0 0 } ] dip <rect> fill-rect ] bi-curry* bi ;
-
-: rect-translate-x ( rect x -- rect' )
-    '[ _ 0 2array v- ] change-loc ;
-
-: first-line ( layout -- line )
-    layout>> 0 pango_layout_get_line_readonly ;
-
-: line-offset>x ( layout n -- x )
-    #! n is an index into the UTF8 encoding of the text
-    [ drop first-line ] [ swap string>> >utf8-index ] 2bi
-    0 0 <int> [ pango_layout_line_index_to_x ] keep
-    *int pango>float ;
-
-: x>line-offset ( layout x -- n )
-    #! n is an index into the UTF8 encoding of the text
-    [
-        [ first-line ] dip
-        float>pango 0 <int> 0 <int>
-        [ pango_layout_line_x_to_index drop ] 2keep
-        [ *int ] bi@ swap
-    ] [ drop string>> ] 2bi utf8-index> + ;
-
-: selection-start/end ( selection -- start end )
-    selection>> [ start>> ] [ end>> ] bi ;
-
-: selection-rect ( layout -- rect )
-    [ ink-rect>> dim>> ] [ ] [ selection-start/end ] tri [ line-offset>x ] bi-curry@ bi
-    [ drop nip 0 2array ] [ swap - swap second 2array ] 3bi <rect> ;
-
-: fill-selection-background ( cr layout -- )
-    dup selection>> [
-        [ selection>> color>> set-source-color ]
-        [
-            [ selection-rect ] [ ink-rect>> loc>> first ] bi
-            rect-translate-x
-            fill-rect
-        ] 2bi
-    ] [ 2drop ] if ;
-
-: text-position ( layout -- loc )
-    [ logical-rect>> ] [ ink-rect>> ] bi [ loc>> ] bi@ v- ;
-
-: set-text-position ( cr loc -- )
-    first2 cairo_move_to ;
-
-: layout-metrics ( layout -- metrics )
-    dup font>> missing-font-metrics clone
-        swap
-        [ layout>> layout-baseline >>ascent ]
-        [ logical-rect>> dim>> [ first >>width ] [ second >>height ] bi ] bi
-        dup [ height>> ] [ ascent>> ] bi - >>descent ;
-
-: draw-layout ( layout -- image )
-    dup ink-rect>> dim>> [ >fixnum ] map [
-        swap {
-            [ layout>> pango_cairo_update_layout ]
-            [ [ font>> ] [ ink-rect>> dim>> ] bi fill-background ]
-            [ fill-selection-background ]
-            [ text-position set-text-position ]
-            [ font>> set-foreground ]
-            [ layout>> pango_cairo_show_layout ]
-        } 2cleave
-    ] make-bitmap-image ;
-
-: escape-nulls ( str -- str' )
-    { { 0 CHAR: zero-width-no-break-space } } substitute ;
-
-: unpack-selection ( layout string/selection -- layout )
-    dup selection? [
-        [ string>> escape-nulls >>string ] [ >>selection ] bi
-    ] [ escape-nulls >>string ] if ; inline
-
-: <layout> ( font string -- line )
-    [
-        layout new-disposable
-            swap unpack-selection
-            swap >>font
-            dup [ string>> ] [ font>> ] bi <PangoLayout> >>layout
-            dup layout>> layout-extents [ >>ink-rect ] [ >>logical-rect ] bi*
-            dup layout-metrics >>metrics
-            dup draw-layout >>image
-    ] with-destructors ;
-
-M: layout dispose* layout>> g_object_unref ;
-
-SYMBOL: cached-layouts
-
-: cached-layout ( font string -- layout )
-    cached-layouts get [ <layout> ] 2cache ;
-
-: cached-line ( font string -- line )
-    cached-layout layout>> first-line ;
-
-[ <cache-assoc> cached-layouts set-global ] "pango.layouts" add-init-hook
index 11e15ae951a67701b90fafe06e72f0cda2f68c23..03134ed7871ac348c23397218dd010afaf0b5487 100644 (file)
@@ -23,8 +23,9 @@ CONSTANT: PANGO_SCALE 1024
 : pango>float ( n -- x ) PANGO_SCALE /f ; inline
 : float>pango ( x -- n ) PANGO_SCALE * >integer ; inline
 
-FUNCTION: PangoContext*
-pango_context_new ( ) ;
+TYPEDEF: void* PangoContext*
+
+FUNCTION: PangoContext* pango_context_new ( ) ;
 
 STRUCT: PangoRectangle
     { x int }
index 53b4357d44f52871f148eb1743d8b16cd849a3f6..7f7bd02204884598504d9fc1644108186b3adec8 100644 (file)
@@ -3,6 +3,7 @@
 USING: kernel accessors math math.vectors locals sequences
 specialized-arrays colors arrays combinators
 opengl opengl.gl ui.pens ui.pens.caching ;
+FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 IN: ui.pens.gradient
 
index a39a5cb7cdba4cbec476d80ed922e931da884bec..c1e1ada61b8b7d5f365371efd6a3d4dfc5ec1a8e 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors colors help.markup help.syntax kernel opengl
-opengl.gl sequences math.vectors ui.gadgets ui.pens
-specialized-arrays ;
+USING: accessors alien.c-types colors help.markup help.syntax
+kernel opengl opengl.gl sequences math.vectors ui.gadgets
+ui.pens specialized-arrays ;
 SPECIALIZED-ARRAY: float
 IN: ui.pens.polygon
 
@@ -36,4 +36,4 @@ M: polygon draw-interior
 
 : <polygon-gadget> ( color points -- gadget )
     [ <polygon> ] [ { 0 0 } [ vmax ] reduce ] bi
-    [ <gadget> ] 2dip [ >>interior ] [ >>dim ] bi* ;
\ No newline at end of file
+    [ <gadget> ] 2dip [ >>interior ] [ >>dim ] bi* ;
index 1fe825d6af042618f85a7a22a226a2e553dbd19d..763cddaaf10877f581eafc14d8bbe7f501bbbc7e 100644 (file)
@@ -3,7 +3,7 @@
 
 ! Based on X.h
 
-USING: alien alien.syntax math x11.xlib ;
+USING: alien alien.c-types alien.syntax math x11.xlib ;
 IN: x11.constants
 
 TYPEDEF: ulong Mask
@@ -406,4 +406,4 @@ CONSTANT: MSBFirst 1
 ! * EXTENDED WINDOW MANAGER HINTS
 ! *****************************************************************
 
-C-ENUM: _NET_WM_STATE_REMOVE _NET_WM_STATE_ADD _NET_WM_STATE_TOGGLE ;
\ No newline at end of file
+C-ENUM: _NET_WM_STATE_REMOVE _NET_WM_STATE_ADD _NET_WM_STATE_TOGGLE ;
index 0cd7704cf88781f3c2fcd1bb9cd64ffa6be8ffa9..2b90b1bff276fb367b85bcddf45be4b69beaad00 100644 (file)
@@ -410,10 +410,6 @@ STRUCT: XCharStruct
 { descent short }
 { attributes ushort } ;
 
-X-FUNCTION: Font XLoadFont ( Display* display, char* name ) ;
-X-FUNCTION: XFontStruct* XQueryFont ( Display* display, XID font_ID ) ;
-X-FUNCTION: XFontStruct* XLoadQueryFont ( Display* display, char* name ) ;
-
 STRUCT: XFontStruct
 { ext_data XExtData* }
 { fid Font }
@@ -432,6 +428,10 @@ STRUCT: XFontStruct
 { ascent int }
 { descent int } ;
 
+X-FUNCTION: Font XLoadFont ( Display* display, char* name ) ;
+X-FUNCTION: XFontStruct* XQueryFont ( Display* display, XID font_ID ) ;
+X-FUNCTION: XFontStruct* XLoadQueryFont ( Display* display, char* name ) ;
+
 X-FUNCTION: int XTextWidth ( XFontStruct* font_struct, char* string, int count ) ;
 
 ! 8.6 - Drawing Text
index ebfa37cdbcd817a0b18a121a6b5e9e2d3a36857a..31c202b803716a6d1a02a088b3f93ab9e6573754 100644 (file)
@@ -1,4 +1,5 @@
-USING: sequences kernel math specialized-arrays fry ;
+USING: alien.c-types sequences kernel math specialized-arrays
+fry ;
 SPECIALIZED-ARRAY: int
 IN: benchmark.dawes
 
index 5dcefdda5a0ec7019746b4be188827910c433d43..87848cee9dfae4532333da07036f259e756e4ac7 100644 (file)
@@ -1,4 +1,4 @@
-USING: make math sequences splitting grouping
+USING: alien.c-types make math sequences splitting grouping
 kernel columns specialized-arrays bit-arrays ;
 SPECIALIZED-ARRAY: double
 IN: benchmark.dispatch2
@@ -29,4 +29,4 @@ IN: benchmark.dispatch2
     1000000 sequences
     [ [ 0 swap nth don't-flush-me ] each ] curry times ;
 
-MAIN: dispatch-test
\ No newline at end of file
+MAIN: dispatch-test
index 58301b57af14328d57ca20b5b6efb8c1f2e3e3c5..d5b5432f079abd5389795bf623b10c0db81c371d 100644 (file)
@@ -1,4 +1,4 @@
-USING: sequences math mirrors splitting grouping
+USING: alien.c-types sequences math mirrors splitting grouping
 kernel make assocs alien.syntax columns
 specialized-arrays bit-arrays ;
 SPECIALIZED-ARRAY: double
index 5b1a50c9e6226d373d4cc98f51495a050701a365..1ad769173bb8c4c5291c46cad2212fd79dfb4879 100755 (executable)
@@ -1,7 +1,7 @@
 ! Based on http://shootout.alioth.debian.org/gp4/benchmark.php?test=fasta&lang=java&id=2
-USING: math kernel io io.files locals multiline assocs sequences
-sequences.private benchmark.reverse-complement hints
-io.encodings.ascii byte-arrays specialized-arrays ;
+USING: alien.c-types math kernel io io.files locals multiline
+assocs sequences sequences.private benchmark.reverse-complement
+hints io.encodings.ascii byte-arrays specialized-arrays ;
 SPECIALIZED-ARRAY: double
 IN: benchmark.fasta
 
index c47cdf4ee8f15f9b7a7330bf0329f7bf09e2ae13..6648c5263902e4a4a6ac90ee06a94f980524799f 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors fry kernel locals math math.constants
-math.functions math.vectors math.vectors.simd prettyprint
-combinators.smart sequences hints classes.struct
+USING: accessors alien.c-types fry kernel locals math
+math.constants math.functions math.vectors math.vectors.simd
+prettyprint combinators.smart sequences hints classes.struct
 specialized-arrays ;
 SIMD: double
 IN: benchmark.nbody-simd
index fc1cbaa12c211bc24ad38471376a6edb422823ca..c7ffed2bb32728c5763f789a87dcb3255cbebc1a 100644 (file)
@@ -1,8 +1,9 @@
 ! Copyright (C) 2008, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors specialized-arrays fry kernel locals math
-math.constants math.functions math.vectors prettyprint
-combinators.smart sequences hints arrays ;
+USING: accessors specialized-arrays fry kernel
+locals math math.constants math.functions math.vectors
+prettyprint combinators.smart sequences hints arrays ;
+FROM: alien.c-types => double ;
 SPECIALIZED-ARRAY: double
 IN: benchmark.nbody
 
index 96f345510f0a400efa44501de37e59c8f49c22e9..2413e7fd1e38991a47ccee77d20c543b542148f9 100755 (executable)
@@ -1,10 +1,10 @@
 ! Factor port of the raytracer benchmark from
 ! http://www.ffconsultancy.com/free/ray_tracer/languages.html
-
-USING: arrays accessors specialized-arrays io io.files
-io.files.temp io.encodings.binary kernel math math.constants
-math.functions math.vectors math.parser make sequences
-sequences.private words hints ;
+USING: arrays accessors specialized-arrays io
+io.files io.files.temp io.encodings.binary kernel math
+math.constants math.functions math.vectors math.parser make
+sequences sequences.private words hints ;
+FROM: alien.c-types => double ;
 SPECIALIZED-ARRAY: double
 IN: benchmark.raytracer
 
index 41ae5b35781b3d6ced2fb634f49de8657deb4182..68efffe08313b3f056c3033a796804b1ddd21db1 100644 (file)
@@ -1,7 +1,8 @@
 ! Factor port of
 ! http://shootout.alioth.debian.org/gp4/benchmark.php?test=spectralnorm&lang=all
-USING: specialized-arrays kernel math math.functions
-math.vectors sequences prettyprint words hints locals ;
+USING: alien.c-types specialized-arrays kernel math
+math.functions math.vectors sequences prettyprint words hints
+locals ;
 SPECIALIZED-ARRAY: double
 IN: benchmark.spectral-norm
 
index 24c3ec965dc24b43f7e5ce7482cb0c5ea8e76bcc..942f78a483219ef6450b0de4af7e6e9ee4d675dd 100644 (file)
@@ -3,6 +3,7 @@
 USING: accessors classes.struct combinators.smart fry kernel
 math math.functions math.order math.parser sequences
 specialized-arrays io ;
+FROM: alien.c-types => float ;
 IN: benchmark.struct-arrays
 
 STRUCT: point { x float } { y float } { z float } ;
index 6644596828bd3bb4da78523226b763af8aafcb39..6105381f86cec6618098b22c5c7349b3302cf02f 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2005, 2007 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.syntax kernel system combinators
+USING: alien alien.c-types alien.syntax kernel system combinators
 alien.libraries classes.struct ;
 IN: freetype
 
@@ -38,8 +38,8 @@ TYPEDEF: long FT_F26Dot6
 FUNCTION: FT_Error FT_Init_FreeType ( void* library ) ;
 
 ! circular reference between glyph and face
-TYPEDEF: void face
-TYPEDEF: void glyph
+TYPEDEF: void* face*
+TYPEDEF: void* glyph*
 
 STRUCT: glyph
     { library void* }
@@ -166,6 +166,8 @@ STRUCT: FT_Bitmap
     { palette_mode char }
     { palette void* } ;
 
+TYPEDEF: void* FT_Face*
+
 FUNCTION: FT_Error FT_New_Face ( void* library, FT_Char* font, FT_Long index, face* face ) ;
 
 FUNCTION: FT_Error FT_New_Memory_Face ( void* library, FT_Byte* file_base, FT_Long file_size, FT_Long face_index, FT_Face* aface ) ;
index 35b529df5f7e0814a3a365dd8e0f38f645699614..e34b9b119dd0cb6e07658d982f0b9602ebe18e6e 100755 (executable)
@@ -1,9 +1,11 @@
 ! (c)2009 Joe Groff bsd license
-USING: alien alien.syntax byte-arrays classes gpu.buffers
-gpu.framebuffers gpu.shaders gpu.textures help.markup
+USING: alien alien.c-types alien.syntax byte-arrays classes
+gpu.buffers gpu.framebuffers gpu.shaders gpu.textures help.markup
 help.syntax images kernel math sequences
 specialized-arrays strings ;
-SPECIALIZED-ARRAY: float
+QUALIFIED-WITH: alien.c-types c
+QUALIFIED-WITH: math m
+SPECIALIZED-ARRAY: c:float
 SPECIALIZED-ARRAY: int
 SPECIALIZED-ARRAY: uint
 SPECIALIZED-ARRAY: ulong
@@ -49,7 +51,7 @@ $nl
 "Uniform parameters are passed from Factor to the shader program through the uniform tuple as follows:"
 { $list
 { { $link int-uniform } "s and " { $link uint-uniform } "s take their values from Factor " { $link integer } "s." }
-{ { $link float-uniform } "s take their values from Factor " { $link float } "s." }
+{ { $link float-uniform } "s take their values from Factor " { $link m:float } "s." }
 { { $link bool-uniform } "s take their values from Factor " { $link boolean } "s." }
 { { $link texture-uniform } "s take their values from " { $link texture } " objects." }
 { "Vector uniforms take their values from Factor " { $link sequence } "s of the corresponding component type."
index 862c94d4b304e9212ec1ee031d12c79eefd91f9d..1c9c8e629ccf3624f35fdc54dd2a4e0c14b45d3b 100644 (file)
@@ -1,6 +1,7 @@
 ! (c)2009 Joe Groff bsd license
 USING: gpu.buffers gpu.render gpu.shaders gpu.textures images kernel
 specialized-arrays ;
+FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 IN: gpu.util
 
index 9145434d90e688b70ddb9d8cacde1ef0ddd818ca..496735f0dbf2434b3fe20e8e45f11bb694d2c3d2 100644 (file)
@@ -5,6 +5,7 @@ gpu.render gpu.state kernel literals
 locals math math.constants math.functions math.matrices
 math.order math.vectors opengl.gl sequences
 ui ui.gadgets.worlds specialized-arrays ;
+FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 IN: gpu.util.wasd
 
index 94638de3460b8dbd6fbdc7f42e485f40fde9c212..4eaa702468c795a9002f353345bafffd11d42e15 100644 (file)
@@ -1,6 +1,7 @@
 ! (c)2009 Joe Groff bsd license
 USING: accessors arrays destructors kernel math opengl
 opengl.gl sequences sequences.product specialized-arrays ;
+FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 IN: grid-meshes
 
index 8706ac58341ed561b61dd93f57eaa98c054c2474..f557e979dd372eebde4003b1613b90e57e9d3515 100755 (executable)
@@ -1,7 +1,9 @@
 ! Copyright (C) 2009 Doug Coleman
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel accessors grouping sequences combinators math
-byte-arrays fry images half-floats specialized-arrays ;
+USING: alien.c-types kernel accessors grouping sequences
+combinators math byte-arrays fry images half-floats
+specialized-arrays ;
+FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: uint
 SPECIALIZED-ARRAY: ushort
 SPECIALIZED-ARRAY: float
index 536974952e255eb1bc17c3f9413d679968f6756d..e4c954d793d04f2b33fbd5a9971c2dbab67eb498 100644 (file)
@@ -4,7 +4,8 @@ USING: accessors colors.constants combinators jamshred.log
 jamshred.oint jamshred.sound jamshred.tunnel kernel locals math
 math.constants math.order math.ranges math.vectors math.matrices
 sequences shuffle specialized-arrays strings system ;
-SPECIALIZED-ARRAY: float
+QUALIFIED-WITH: alien.c-types c
+SPECIALIZED-ARRAY: c:float
 IN: jamshred.player
 
 TUPLE: player < oint
index 2767444c8f930a377db801425669353080e02e7b..742f8346225d379b7dd1323b8d53e354ac8fd096 100644 (file)
@@ -5,6 +5,7 @@ kernel literals locals math math.constants math.matrices
 math.order math.quadratic math.ranges math.vectors random
 sequences specialized-arrays vectors ;
 FROM: jamshred.oint => distance ;
+FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 IN: jamshred.tunnel
 
index 16eff168d423e3de22877c18f037ff5eea4e9575..508e590d010275c6ab531a30ac51e07aa1da134b 100644 (file)
@@ -1,5 +1,6 @@
-USING: alien.syntax io io.encodings.utf16n io.encodings.utf8 io.files
-kernel namespaces sequences system threads unix.utilities ;
+USING: alien.c-types alien.syntax io io.encodings.utf16n
+io.encodings.utf8 io.files kernel namespaces sequences system threads
+unix.utilities ;
 IN: native-thread-test
 
 FUNCTION: void* start_standalone_factor_in_new_thread ( int argc, char** argv ) ;
@@ -22,4 +23,4 @@ M: unix native-string-encoding utf8 ;
 : testthread ( -- )
      "/tmp/hello" utf8 [ "hello!\n" write ] with-file-appender 5000000 sleep ;
 
-MAIN: testthread
\ No newline at end of file
+MAIN: testthread
index b8f2f1cb5f8dba3cc238815270cf1906c380616a..0df063e2c6dbce5558d47d8169450bef9594cfa6 100644 (file)
@@ -1,7 +1,8 @@
 ! (c)2009 Joe Groff bsd license
-USING: accessors arrays grouping kernel locals math math.order
-math.ranges math.vectors math.vectors.homogeneous sequences
-specialized-arrays ;
+USING: accessors alien.c-types arrays grouping kernel locals
+math math.order math.ranges math.vectors
+math.vectors.homogeneous sequences specialized-arrays ;
+FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 IN: nurbs
 
index 6cd6964721af767dd4b083c2545b5ce36f999450..24227167c97e9c05032835e0802681213eb59a92 100644 (file)
@@ -122,7 +122,7 @@ FUNCTION: int      ogg_sync_pageout ( ogg-sync-state* oy, ogg-page* og ) ;
 FUNCTION: int      ogg_stream_pagein ( ogg-stream-state* os, ogg-page* og ) ;
 FUNCTION: int      ogg_stream_packetout ( ogg-stream-state* os, ogg-packet* op ) ;
 FUNCTION: int      ogg_stream_packetpeek ( ogg-stream-state* os, ogg-packet* op ) ;
-FUNCTION: int      ogg_stream_init (ogg-stream-state* os, int serialno ) ;
+FUNCTION: int      ogg_stream_init ( ogg-stream-state* os, int serialno ) ;
 FUNCTION: int      ogg_stream_clear ( ogg-stream-state* os ) ;
 FUNCTION: int      ogg_stream_reset ( ogg-stream-state* os ) ;
 FUNCTION: int      ogg_stream_reset_serialno ( ogg-stream-state* os, int serialno ) ;
index 81d360eca1ea2e83fb96276310d734f08d0616b0..f0a6b928e93305bf46d739bd98dd69303b0a3ec2 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2007 Chris Double.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.c-types kernel alien alien.syntax shuffle
-openal.backend namespaces system generalizations ;
+openal openal.backend namespaces system generalizations ;
 IN: openal.macosx
 
 LIBRARY: alut
index 0936c94150862a81f94771005e4dea9a505db1af..ada8d6b1fb18868b9272e536c3fd400349cde5cb 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2007 Chris Double.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.c-types alien.syntax combinators generalizations
-kernel openal.backend ;
+kernel openal openal.backend ;
 IN: openal.other
 
 LIBRARY: alut
index a8404bb13aaa8f3214575af74ea143cccc5908f3..a62745cb6aab473cb87b1f219634bbe2b9b7984b 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2005 Alex Chapman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.libraries alien.syntax kernel sequences words system
-combinators ;
+USING: alien alien.c-types alien.libraries alien.syntax kernel
+sequences words system combinators opengl.gl ;
 IN: opengl.glu
 
 <<
@@ -268,4 +268,4 @@ FUNCTION: GLint gluUnProject ( GLdouble winX, GLdouble winY, GLdouble winZ, GLdo
 ! FUNCTION: GLint gluUnProject4 ( GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, GLdouble* model, GLdouble* proj, GLint* view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW ) ;
 
 : gl-look-at ( eye focus up -- )
-    [ first3 ] tri@ gluLookAt ;
\ No newline at end of file
+    [ first3 ] tri@ gluLookAt ;
index 95322e423a93bd0c92fb18743910638f89f91670..050a83542212c625af0dfa3f141584a7850e579e 100644 (file)
@@ -9,6 +9,7 @@ terrain.generation terrain.shaders ui ui.gadgets
 ui.gadgets.worlds ui.pixel-formats game-worlds method-chains
 math.affine-transforms noise ui.gestures combinators.short-circuit
 destructors grid-meshes ;
+FROM: alien.c-types => float ;
 SPECIALIZED-ARRAY: float
 IN: terrain
 
index 3793846050c8ae2bbdd5403b6897a4d11aaa03b8..b9503bdab4a74910dfd2bacc2a529953459885a0 100755 (executable)
@@ -6,6 +6,7 @@ IN: tokyo.alien.tchdb
 
 LIBRARY: tokyocabinet
 
+TYPEDEF: void* TCXSTR*
 TYPEDEF: void* TCHDB*
 
 CONSTANT: HDBFOPEN  1
index e43ed9c765117521bad97f37d2ac0ca1fc15ef9f..8373a6aaaaf5be22e7aeb323cfc53dec5b5df369 100755 (executable)
@@ -8,6 +8,7 @@ LIBRARY: tokyocabinet
 
 TYPEDEF: void* TDBIDX*
 TYPEDEF: void* TCTDB*
+TYPEDEF: void* TCMAP*
 
 CONSTANT: TDBFOPEN  HDBFOPEN
 CONSTANT: TDBFFATAL HDBFFATAL