Replace png-gadget in otug-talk with icon gadget usage; convert PNG images to TIFF

db4
Slava Pestov 2009-03-10 17:00:46 -05:00
parent 3acd00b403
commit 712711e869
13 changed files with 13 additions and 40 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

BIN
extra/otug-talk/2bi.tiff Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

BIN
extra/otug-talk/2bi_at.tiff Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

BIN
extra/otug-talk/bi.tiff Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

BIN
extra/otug-talk/bi_at.tiff Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

View File

@ -1,41 +1,14 @@
! Copyright (C) 2008 Slava Pestov. ! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: slides help.markup math arrays hashtables namespaces USING: slides help.markup math arrays hashtables namespaces sequences
sequences kernel sequences parser memoize io.encodings.binary kernel sequences parser memoize io.encodings.binary locals
locals kernel.private tools.vocabs.browser assocs quotations kernel.private tools.vocabs.browser assocs quotations tools.vocabs
tools.vocabs tools.annotations tools.crossref tools.annotations tools.crossref help.topics math.functions
help.topics math.functions compiler.tree.optimizer compiler.tree.optimizer compiler.cfg.optimizer fry ui.gadgets.panes
compiler.cfg.optimizer fry tetris tetris.game combinators generalizations multiline
ui.gadgets.panes tetris tetris.game combinators generalizations sequences.private ;
multiline sequences.private ;
IN: otug-talk IN: otug-talk
USING: cairo cairo.ffi cairo.gadgets accessors
io.backend ui.gadgets ;
TUPLE: png-gadget < cairo-gadget surface ;
: <png-gadget> ( file -- gadget )
png-gadget new-gadget
swap normalize-path
cairo_image_surface_create_from_png >>surface ; inline
M: png-gadget pref-dim* ( gadget -- )
surface>>
[ cairo_image_surface_get_width ]
[ cairo_image_surface_get_height ]
bi 2array ;
M: png-gadget render-cairo* ( gadget -- )
cr swap surface>> 0 0 cairo_set_source_surface
cr cairo_paint ;
M: png-gadget ungraft* ( gadget -- )
surface>> cairo_surface_destroy ;
: $bitmap ( element -- )
[ first <png-gadget> gadget. ] ($block) ;
: $tetris ( element -- ) : $tetris ( element -- )
drop [ <default-tetris> <tetris-gadget> gadget. ] ($block) ; drop [ <default-tetris> <tetris-gadget> gadget. ] ($block) ;
@ -105,11 +78,11 @@ CONSTANT: otug-slides
} }
{ $slide "Data flow combinators - cleave family" { $slide "Data flow combinators - cleave family"
{ { $link bi } ", " { $link tri } ", " { $link cleave } } { { $link bi } ", " { $link tri } ", " { $link cleave } }
{ $bitmap "resource:extra/otug-talk/bi.png" } { $image "resource:extra/otug-talk/bi.tiff" }
} }
{ $slide "Data flow combinators - cleave family" { $slide "Data flow combinators - cleave family"
{ { $link 2bi } ", " { $link 2tri } ", " { $link 2cleave } } { { $link 2bi } ", " { $link 2tri } ", " { $link 2cleave } }
{ $bitmap "resource:extra/otug-talk/2bi.png" } { $image "resource:extra/otug-talk/2bi.tiff" }
} }
{ $slide "Data flow combinators" { $slide "Data flow combinators"
"First, let's define a data type:" "First, let's define a data type:"
@ -128,19 +101,19 @@ CONSTANT: otug-slides
} }
{ $slide "Data flow combinators - spread family" { $slide "Data flow combinators - spread family"
{ { $link bi* } ", " { $link tri* } ", " { $link spread } } { { $link bi* } ", " { $link tri* } ", " { $link spread } }
{ $bitmap "resource:extra/otug-talk/bi_star.png" } { $image "resource:extra/otug-talk/bi_star.tiff" }
} }
{ $slide "Data flow combinators - spread family" { $slide "Data flow combinators - spread family"
{ { $link 2bi* } } { { $link 2bi* } }
{ $bitmap "resource:extra/otug-talk/2bi_star.png" } { $image "resource:extra/otug-talk/2bi_star.tiff" }
} }
{ $slide "Data flow combinators - apply family" { $slide "Data flow combinators - apply family"
{ { $link bi@ } ", " { $link tri@ } ", " { $link napply } } { { $link bi@ } ", " { $link tri@ } ", " { $link napply } }
{ $bitmap "resource:extra/otug-talk/bi_at.png" } { $image "resource:extra/otug-talk/bi_at.tiff" }
} }
{ $slide "Data flow combinators - apply family" { $slide "Data flow combinators - apply family"
{ { $link 2bi@ } } { { $link 2bi@ } }
{ $bitmap "resource:extra/otug-talk/2bi_at.png" } { $image "resource:extra/otug-talk/2bi_at.tiff" }
} }
{ $slide "Shuffle words" { $slide "Shuffle words"
"When data flow combinators are not enough" "When data flow combinators are not enough"