AC-EasyRaster-GTK 1.1.2 → 1.1.3
raw patch · 3 files changed
+23/−19 lines, 3 filesdep ~arraydep ~gtk
Dependency ranges changed: array, gtk
Files
- AC-EasyRaster-GTK.cabal +8/−7
- Graphics/EasyRaster/GTK.hs +10/−8
- Graphics/EasyRaster/GTK/Paranoid.hs +5/−4
AC-EasyRaster-GTK.cabal view
@@ -1,6 +1,6 @@ Cabal-Version: >= 1.6 Name: AC-EasyRaster-GTK -Version: 1.1.2 +Version: 1.1.3 Stability: Experimental Synopsis: GTK+ pixel plotting. @@ -8,16 +8,17 @@ This package is a thin layer over Gtk2hs providing an easy interface for people who want to do bitmapped graphics. + . Cairo already provides easy access to /vector/ graphics; this package is directed at /bitmap/ graphics (i.e., reading and writing individual pixels). This is useful for applications such as fractal generators, ray tracers, etc. - + . Changes: - - * Improved documentation (added sections and example code). - - * Should work with GHC 6.12.1 (not that Gtk2hs does yet!) + . + * Should work with Gtk2hs 0.11.x now. + . + * Fix minor documentation glitches. Category: Graphics License: BSD3 @@ -29,5 +30,5 @@ Library Exposed-modules: Graphics.EasyRaster.GTK, Graphics.EasyRaster.GTK.Paranoid - Build-Depends: base >= 4 && < 5, array >= 0.2.0.0 && < 0.4, gtk >= 0.10 && < 0.11 + Build-Depends: base >= 4 && < 5, array >= 0.2, gtk >= 0.10 HS-Source-Dirs: .
Graphics/EasyRaster/GTK.hs view
@@ -78,12 +78,13 @@ import Data.Array.IO import Data.Array.Base (unsafeWrite, unsafeRead) import Graphics.UI.Gtk +import Graphics.UI.Gtk.Gdk.GC -- Necessary with gtk-0.11.2 for some reason. {- | Initialise the GTK runtime system. This function /must/ be called before any other functions in this module. (If not, your program will likely summarily crash with - an obscure error to 'stderr'.) + an obscure error to @stderr@.) Note that Gtk2hs by default will crash with a warning message if the program is compiled with the threaded @@ -127,7 +128,7 @@ An @ImageBuffer@ is a space-efficient grid of 24-bit RGB pixels (i.e., 8 bits per channel) that the GTK library can also access. (The latter gives us the - ability to load/save/display the graphics, rather + ability to load\/save\/display the graphics, rather than just manipulate it in memory.) -} data ImageBuffer = ImageBuffer @@ -190,7 +191,7 @@ {- | Returns a GTK+ canvas object which displays the graphcs in the 'ImageBuffer' and will automatically repaint - itself in response of damage. + itself in response to damage. -} ib_canvas :: ImageBuffer -> IO DrawingArea ib_canvas ib = do @@ -211,10 +212,8 @@ Clicking the window's close button will call GTK's 'mainQuit' function. For example, - @ - ib_display buf "My Window Title" - main_loop - @ + > ib_display buf "My Window Title" + > main_loop will display @buf@ on screen and halt the program (or at least thread 0) until the user clicks the @@ -257,6 +256,9 @@ and height in pixels. Valid coordinates for this @ImageBuffer@ are from (0,0) to (x-1, y-1), where (x,y) is the value returned from @ib_size@. + + Note that this is a /pure/ function (since the size of an + 'ImageBuffer' is immutable). -} ib_size :: ImageBuffer -> (Coord,Coord) ib_size buf = (sizeX buf, sizeY buf) @@ -306,7 +308,7 @@ Note that pixel coordinates are /not/ checked, for efficiency reasons. However, supplying invalid pixel coordinates will at best result in - gibberish being returned, and at works a segmentation fault. See + gibberish being returned, and at worst a segmentation fault. See "Graphics.EasyRaster.Paranoid" for a version of this function with bounds checking turned on. -}
Graphics/EasyRaster/GTK/Paranoid.hs view
@@ -1,8 +1,9 @@ {- | This module provides exactly the same interface as - "Graphics.EasyRaster.GTK", but with more runtime sanity - checks. Typically you will use this module while - developing and debugging your application, and them + "Graphics.EasyRaster.GTK", but with run-time sanity + checks. This results in greater safety and reduced + performance. Typically you will use this module while + developing and debugging your application, and then change your import statement when you're happy that any bugs have been corrected. -} @@ -52,7 +53,7 @@ Initialise the GTK runtime system. This function /must/ be called before any other functions in this module. (If not, your program will likely summarily crash with - an obscure error to 'stderr'.) + an obscure error to @stderr@.) Note that Gtk2hs will crash with a warning message if the program is compiled with the threaded RTS. (Use