]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix Pango and ui.event-loop for Windows
authorU-SLAVA-DFB8FF805\Slava <Slava@slava-dfb8ff805.(none)>
Mon, 2 Mar 2009 07:12:06 +0000 (01:12 -0600)
committerU-SLAVA-DFB8FF805\Slava <Slava@slava-dfb8ff805.(none)>
Mon, 2 Mar 2009 07:12:06 +0000 (01:12 -0600)
basis/glib/glib.factor [changed mode: 0644->0755]
basis/ui/backend/windows/windows.factor
basis/ui/event-loop/event-loop.factor [changed mode: 0644->0755]
basis/ui/text/pango/pango.factor [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index cfb5893..23baded
@@ -7,13 +7,13 @@ IN: glib
 <<
 
 "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
index a8c8e823c83ecfe88a808868f0a496c5fae934b7..54d9ed456a1d082128580b0152de9f974eb796de 100755 (executable)
@@ -2,15 +2,15 @@
 ! 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
@@ -25,8 +25,7 @@ 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
old mode 100644 (file)
new mode 100755 (executable)
index 26983e3..f054d2b
@@ -1,7 +1,7 @@
-! 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? ( -- ? )
old mode 100644 (file)
new mode 100755 (executable)
index e7f850f..ddc7194
@@ -2,7 +2,7 @@
 ! 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
@@ -10,7 +10,9 @@ 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
@@ -31,9 +33,11 @@ M: pango-renderer offset>x ( n font string -- x )
     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