update pango for struct
parent
6ac21a8cf9
commit
0f8405c507
|
@ -5,7 +5,7 @@ USING: arrays sequences alien alien.c-types alien.destructors
|
||||||
alien.syntax math math.functions math.vectors destructors combinators
|
alien.syntax math math.functions math.vectors destructors combinators
|
||||||
colors fonts accessors assocs namespaces kernel pango pango.fonts
|
colors fonts accessors assocs namespaces kernel pango pango.fonts
|
||||||
pango.cairo cairo cairo.ffi glib unicode.data images cache init
|
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
|
IN: pango.layouts
|
||||||
|
|
||||||
LIBRARY: pango
|
LIBRARY: pango
|
||||||
|
@ -84,8 +84,8 @@ SYMBOL: dpi
|
||||||
[ set-layout-text ] keep ;
|
[ set-layout-text ] keep ;
|
||||||
|
|
||||||
: layout-extents ( layout -- ink-rect logical-rect )
|
: layout-extents ( layout -- ink-rect logical-rect )
|
||||||
"PangoRectangle" <c-object>
|
PangoRectangle <struct>
|
||||||
"PangoRectangle" <c-object>
|
PangoRectangle <struct>
|
||||||
[ pango_layout_get_extents ] 2keep
|
[ pango_layout_get_extents ] 2keep
|
||||||
[ PangoRectangle>rect ] bi@ ;
|
[ PangoRectangle>rect ] bi@ ;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license
|
! See http://factorcode.org/license.txt for BSD license
|
||||||
USING: arrays system alien.destructors alien.c-types alien.syntax alien
|
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
|
IN: pango
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
@ -25,13 +26,13 @@ CONSTANT: PANGO_SCALE 1024
|
||||||
FUNCTION: PangoContext*
|
FUNCTION: PangoContext*
|
||||||
pango_context_new ( ) ;
|
pango_context_new ( ) ;
|
||||||
|
|
||||||
C-STRUCT: PangoRectangle
|
STRUCT: PangoRectangle
|
||||||
{ "int" "x" }
|
{ x int }
|
||||||
{ "int" "y" }
|
{ y int }
|
||||||
{ "int" "width" }
|
{ width int }
|
||||||
{ "int" "height" } ;
|
{ height int } ;
|
||||||
|
|
||||||
: PangoRectangle>rect ( PangoRectangle -- rect )
|
: PangoRectangle>rect ( PangoRectangle -- rect )
|
||||||
[ [ PangoRectangle-x pango>float ] [ PangoRectangle-y pango>float ] bi 2array ]
|
[ [ x>> pango>float ] [ y>> pango>float ] bi 2array ]
|
||||||
[ [ PangoRectangle-width pango>float ] [ PangoRectangle-height pango>float ] bi 2array ] bi
|
[ [ width>> pango>float ] [ height>> pango>float ] bi 2array ] bi
|
||||||
<rect> ;
|
<rect> ;
|
||||||
|
|
Loading…
Reference in New Issue