images: only register with the images.loader on proper platform. Fixes #172. Fixes #173.

db4
John Benediktsson 2011-09-24 19:19:34 -07:00
parent e49c3d17b5
commit 849674f847
3 changed files with 36 additions and 24 deletions

View File

@ -4,9 +4,12 @@ USING: accessors alien.data cocoa cocoa.classes cocoa.messages
combinators core-foundation.data core-graphics
core-graphics.types fry locals images images.loader io kernel
math sequences ;
FROM: system => os macosx? ;
IN: images.cocoa
SINGLETON: ns-image
os macosx? [
"png" ns-image register-image-class
"tif" ns-image register-image-class
"tiff" ns-image register-image-class
@ -15,6 +18,7 @@ SINGLETON: ns-image
"jpeg" ns-image register-image-class
"bmp" ns-image register-image-class
"ico" ns-image register-image-class
] when
CONSTANT: NSImageRepLoadStatusUnknownType -1
CONSTANT: NSImageRepLoadStatusReadingHeader -2

View File

@ -3,9 +3,12 @@ USING: accessors alien.c-types alien.data alien.enums
classes.struct destructors images images.loader kernel locals
math windows.com windows.gdiplus windows.streams windows.types
typed byte-arrays grouping sequences ;
FROM: system => os windows? ;
IN: images.gdiplus
SINGLETON: gdi+-image
os windows? [
"png" gdi+-image register-image-class
"tif" gdi+-image register-image-class
"tiff" gdi+-image register-image-class
@ -14,6 +17,7 @@ SINGLETON: gdi+-image
"jpeg" gdi+-image register-image-class
"bmp" gdi+-image register-image-class
"ico" gdi+-image register-image-class
] when
<PRIVATE
: <GpRect> ( x y w h -- rect )

View File

@ -4,10 +4,13 @@ USING: accessors alien.c-types alien.data arrays combinators
destructors gdk.pixbuf.ffi gobject.ffi grouping images
images.loader io kernel locals math sequences
specialized-arrays ;
FROM: system => os linux freebsd netbsd openbsd ;
IN: images.gtk
SPECIALIZED-ARRAY: uchar
SINGLETON: gtk-image
os { linux freebsd netbsd openbsd } member? [
"png" gtk-image register-image-class
"tif" gtk-image register-image-class
"tiff" gtk-image register-image-class
@ -16,6 +19,7 @@ SINGLETON: gtk-image
"jpeg" gtk-image register-image-class
"bmp" gtk-image register-image-class
"ico" gtk-image register-image-class
] when
<PRIVATE