]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/pango/pango.factor
stomp.cli: simplify
[factor.git] / basis / pango / pango.factor
index 3a0e2f1cce5a96aeb430b97768e2a4fe5f3267b7..539b84eb16e18f885c3bd929d93c72707981a15b 100644 (file)
@@ -1,37 +1,4 @@
-! Copyright (C) 2008 Matthew Willis.
-! Copyright (C) 2009 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license
-USING: arrays system alien.destructors alien.c-types alien.syntax alien
-combinators math.rectangles kernel math ;
+! Copyright (C) 2009 Anton Gorenko.
+! See https://factorcode.org/license.txt for BSD license.
+USING: pango.ffi ;
 IN: pango
-
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-! Helpful functions from other parts of pango
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-<< "pango" {
-    { [ os winnt? ] [ "libpango-1.0-0.dll" ] }
-    { [ os macosx? ] [ "/opt/local/lib/libpango-1.0.0.dylib" ] }
-    { [ os unix? ] [ "libpango-1.0.so" ] }
-} cond "cdecl" add-library >>
-
-LIBRARY: pango
-
-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 ( ) ;
-
-C-STRUCT: PangoRectangle
-    { "int" "x" }
-    { "int" "y" }
-    { "int" "width" }
-    { "int" "height" } ;
-
-: PangoRectangle>rect ( PangoRectangle -- rect )
-    [ [ PangoRectangle-x pango>float ] [ PangoRectangle-y pango>float ] bi 2array ]
-    [ [ PangoRectangle-width pango>float ] [ PangoRectangle-height pango>float ] bi 2array ] bi
-    <rect> ;
\ No newline at end of file