<<
"glib" {
- { [ os winnt? ] [ "glib2.dll" ] }
+ { [ os winnt? ] [ "libglib-2.0-0.dll" ] }
{ [ os macosx? ] [ "/opt/local/lib/libglib-2.0.0.dylib" ] }
{ [ os unix? ] [ "libglib-2.0.0.so" ] }
} cond "cdecl" add-library
"gobject" {
- { [ os winnt? ] [ "gobject2.dll" ] }
+ { [ os winnt? ] [ "libgobject-2.0-0.dll" ] }
{ [ os macosx? ] [ "/opt/local/lib/libgobject-2.0.0.dylib" ] }
{ [ os unix? ] [ "libgobject-2.0.0.so" ] }
} cond "cdecl" add-library
! Portions copyright (C) 2007, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.c-types alien.strings arrays assocs ui
-ui.gadgets ui.backend ui.clipboards ui.gadgets.worlds
-ui.gestures ui.event-loop io kernel math
-math.vectors namespaces make sequences strings vectors words
-windows.kernel32 windows.gdi32 windows.user32 windows.opengl32
-windows.messages windows.types windows.nt windows threads libc
-combinators fry combinators.short-circuit continuations
-command-line shuffle opengl ui.render ascii math.bitwise locals
-accessors math.rectangles math.order ascii calendar
-io.encodings.utf16n ;
+ui.private ui.gadgets ui.gadgets.private ui.backend
+ui.clipboards ui.gadgets.worlds ui.gestures ui.event-loop io
+kernel math math.vectors namespaces make sequences strings
+vectors words windows.kernel32 windows.gdi32 windows.user32
+windows.opengl32 windows.messages windows.types windows.nt
+windows threads libc combinators fry combinators.short-circuit
+continuations command-line shuffle opengl ui.render ascii
+math.bitwise locals accessors math.rectangles math.order ascii
+calendar io.encodings.utf16n ;
IN: ui.backend.windows
SINGLETON: windows-ui-backend
0
[ EnumClipboardFormats win32-error dup dup 0 > ]
[ ]
- [ drop ]
- produce nip ;
+ produce 2nip ;
: with-clipboard ( quot -- )
f OpenClipboard win32-error=0/f
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: calendar combinators deques kernel namespaces sequences
-threads ui ui.backend ui.gadgets ;
+threads ui ui.private ui.backend ui.gadgets ui.gadgets.private ;
IN: ui.event-loop
: event-loop? ( -- ? )
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types assocs cache kernel math math.vectors
namespaces opengl.textures pango.cairo pango.layouts ui.gadgets.worlds
-ui.text ui.text.private pango ;
+ui.text ui.text.private pango sequences ;
IN: ui.text.pango
SINGLETON: pango-renderer
M: pango-renderer init-text-rendering
<cache-assoc> >>text-handle drop ;
-M: pango-renderer string-dim cached-layout logical-rect>> dim>> ;
+M: pango-renderer string-dim
+ [ " " string-dim { 0 1 } v* ]
+ [ cached-layout logical-rect>> dim>> [ >integer ] map ] if-empty ;
M: pango-renderer finish-text-rendering
text-handle>> purge-cache
cached-line swap line-offset>x ;
M: pango-renderer font-metrics ( font -- metrics )
- "" cached-layout metrics>> clone f >>width ;
+ " " cached-layout metrics>> clone f >>width ;
M: pango-renderer line-metrics ( font string -- metrics )
- cached-layout metrics>> ;
+ [ " " line-metrics clone 0 >>width ]
+ [ cached-layout metrics>> ]
+ if-empty ;
pango-renderer font-renderer set-global
\ No newline at end of file