diff --git a/basis/pango/layouts/layouts.factor b/basis/pango/layouts/layouts.factor index 88c6f17093..7a7bd86aea 100644 --- a/basis/pango/layouts/layouts.factor +++ b/basis/pango/layouts/layouts.factor @@ -5,7 +5,7 @@ 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 -math.rectangles fry memoize io.encodings.utf8 ; +math.rectangles fry memoize io.encodings.utf8 classes.struct ; IN: pango.layouts LIBRARY: pango @@ -84,8 +84,8 @@ SYMBOL: dpi [ set-layout-text ] keep ; : layout-extents ( layout -- ink-rect logical-rect ) - "PangoRectangle" - "PangoRectangle" + PangoRectangle + PangoRectangle [ pango_layout_get_extents ] 2keep [ PangoRectangle>rect ] bi@ ; diff --git a/basis/pango/pango.factor b/basis/pango/pango.factor index ec5afa3c3d..11e15ae951 100644 --- a/basis/pango/pango.factor +++ b/basis/pango/pango.factor @@ -2,7 +2,8 @@ ! 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 alien.libraries ; +combinators math.rectangles kernel math alien.libraries classes.struct +accessors ; IN: pango ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -25,13 +26,13 @@ CONSTANT: PANGO_SCALE 1024 FUNCTION: PangoContext* pango_context_new ( ) ; -C-STRUCT: PangoRectangle - { "int" "x" } - { "int" "y" } - { "int" "width" } - { "int" "height" } ; +STRUCT: PangoRectangle + { x int } + { y int } + { width int } + { height int } ; : 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 + [ [ x>> pango>float ] [ y>> pango>float ] bi 2array ] + [ [ width>> pango>float ] [ height>> pango>float ] bi 2array ] bi ;