[cl-gd-cvs] CVS update: cl-gd/CHANGELOG cl-gd/README cl-gd/cl-gd-glue.c cl-gd/cl-gd-test.asd cl-gd/cl-gd-test.lisp cl-gd/cl-gd.asd cl-gd/colors-aux.lisp cl-gd/colors.lisp cl-gd/drawing.lisp cl-gd/gd-uffi.lisp cl-gd/images.lisp cl-gd/init.lisp cl-gd/misc.lisp cl-gd/packages.lisp cl-gd/specials.lisp cl-gd/strings.lisp cl-gd/transform.lisp cl-gd/util.lisp

Edi Weitz eweitz at common-lisp.net
Sat Apr 24 00:29:27 UTC 2004


Update of /project/cl-gd/cvsroot/cl-gd
In directory common-lisp.net:/tmp/cvs-serv14058

Modified Files:
	CHANGELOG README cl-gd-glue.c cl-gd-test.asd cl-gd-test.lisp 
	cl-gd.asd colors-aux.lisp colors.lisp drawing.lisp 
	gd-uffi.lisp images.lisp init.lisp misc.lisp packages.lisp 
	specials.lisp strings.lisp transform.lisp util.lisp 
Log Message:
pre-0.3.1 with hyperdoc support

Date: Fri Apr 23 20:29:26 2004
Author: eweitz

Index: cl-gd/CHANGELOG
diff -u cl-gd/CHANGELOG:1.1.1.1 cl-gd/CHANGELOG:1.2
--- cl-gd/CHANGELOG:1.1.1.1	Tue Jan  6 20:02:32 2004
+++ cl-gd/CHANGELOG	Fri Apr 23 20:29:25 2004
@@ -1,3 +1,13 @@
+Version 0.3.1
+????-??-??
+Added hyperdoc support
+Added :CL-GD to *FEATURES*
+
+Version 0.3.0
+2004-03-29
+Added GIF support (thanks to Hans Hübner)
+Added Gentoo link
+
 Version 0.2.0
 2003-10-26
 Added DO-PIXELS and friends (proposed by Kevin Rosenberg)


Index: cl-gd/README
diff -u cl-gd/README:1.1.1.1 cl-gd/README:1.2
--- cl-gd/README:1.1.1.1	Tue Jan  6 20:02:29 2004
+++ cl-gd/README	Fri Apr 23 20:29:25 2004
@@ -1,4 +1,9 @@
-Complete documentation for CL-GD can be found in the 'doc' directory.
+Complete documentation for CL-GD can be found in the 'doc'
+directory. Make sure to read it if you want GIF support!
+
+CL-GD also supports Nikodemus Siivola's HYPERDOC, see
+<http://common-lisp.net/project/hyperdoc/> and
+<http://www.cliki.net/hyperdoc>.
 
 1. Installation
 
@@ -54,5 +59,5 @@
 
        (cl-gd-test:test #p"/usr/X11R6/lib/X11/fonts/truetype/georgiab.ttf")
 
-where you should obviously replace the path above with the pull path
+where you should obviously replace the path above with the full path
 to the font on your machine.


Index: cl-gd/cl-gd-glue.c
diff -u cl-gd/cl-gd-glue.c:1.1.1.1 cl-gd/cl-gd-glue.c:1.2
--- cl-gd/cl-gd-glue.c:1.1.1.1	Tue Jan  6 20:02:32 2004
+++ cl-gd/cl-gd-glue.c	Fri Apr 23 20:29:25 2004
@@ -45,6 +45,23 @@
   return NULL;
 }
 
+gdImagePtr gdImageCreateFromGifFile (char *filename, int *err) {
+  FILE *in;
+  gdImagePtr im;
+  
+  if (in = fopen(filename, "rb")) {
+    im = gdImageCreateFromGif(in);
+    if (im == NULL) {
+      *err = 0;
+      return NULL;
+    }
+    fclose(in);
+    return im;
+  }
+  *err = errno;
+  return NULL;
+}
+
 gdImagePtr gdImageCreateFromPngFile (char *filename, int *err) {
   FILE *in;
   gdImagePtr im;


Index: cl-gd/cl-gd-test.asd
diff -u cl-gd/cl-gd-test.asd:1.1.1.1 cl-gd/cl-gd-test.asd:1.2
--- cl-gd/cl-gd-test.asd:1.1.1.1	Tue Jan  6 20:02:28 2004
+++ cl-gd/cl-gd-test.asd	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd-test.asd,v 1.1.1.1 2004/01/07 01:02:28 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd-test.asd,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 


Index: cl-gd/cl-gd-test.lisp
diff -u cl-gd/cl-gd-test.lisp:1.1.1.1 cl-gd/cl-gd-test.lisp:1.2
--- cl-gd/cl-gd-test.lisp:1.1.1.1	Tue Jan  6 20:02:36 2004
+++ cl-gd/cl-gd-test.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd-test.lisp,v 1.1.1.1 2004/01/07 01:02:36 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd-test.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 


Index: cl-gd/cl-gd.asd
diff -u cl-gd/cl-gd.asd:1.1.1.1 cl-gd/cl-gd.asd:1.2
--- cl-gd/cl-gd.asd:1.1.1.1	Tue Jan  6 20:02:37 2004
+++ cl-gd/cl-gd.asd	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd.asd,v 1.1.1.1 2004/01/07 01:02:37 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/cl-gd.asd,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 


Index: cl-gd/colors-aux.lisp
diff -u cl-gd/colors-aux.lisp:1.1.1.1 cl-gd/colors-aux.lisp:1.2
--- cl-gd/colors-aux.lisp:1.1.1.1	Tue Jan  6 20:02:29 2004
+++ cl-gd/colors-aux.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors-aux.lisp,v 1.1.1.1 2004/01/07 01:02:29 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors-aux.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 


Index: cl-gd/colors.lisp
diff -u cl-gd/colors.lisp:1.1.1.1 cl-gd/colors.lisp:1.2
--- cl-gd/colors.lisp:1.1.1.1	Tue Jan  6 20:02:30 2004
+++ cl-gd/colors.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors.lisp,v 1.1.1.1 2004/01/07 01:02:30 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/colors.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 


Index: cl-gd/drawing.lisp
diff -u cl-gd/drawing.lisp:1.1.1.1 cl-gd/drawing.lisp:1.2
--- cl-gd/drawing.lisp:1.1.1.1	Tue Jan  6 20:02:36 2004
+++ cl-gd/drawing.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/drawing.lisp,v 1.1.1.1 2004/01/07 01:02:36 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/drawing.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 


Index: cl-gd/gd-uffi.lisp
diff -u cl-gd/gd-uffi.lisp:1.1.1.1 cl-gd/gd-uffi.lisp:1.2
--- cl-gd/gd-uffi.lisp:1.1.1.1	Tue Jan  6 20:02:34 2004
+++ cl-gd/gd-uffi.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/gd-uffi.lisp,v 1.1.1.1 2004/01/07 01:02:34 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/gd-uffi.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 
@@ -174,12 +174,19 @@
   :returning gd-image-ptr
   :module "gd")
 
-#-win32
+#-:win32
 (def-function ("gdImageCreateFromXpm" gd-image-create-from-xpm)
     ((filename :cstring))
   :returning gd-image-ptr
   :module "gd")
 
+#+:cl-gd-gif
+(def-function ("gdImageCreateFromGifFile" gd-image-create-from-gif-file)
+    ((filename :cstring)
+     (err (* :int)))
+  :returning gd-image-ptr
+  :module "gd")
+
 (def-function ("gdImageJpegPtr" gd-image-jpeg-ptr)
     ((im gd-image-ptr)
      (size (* :int))
@@ -216,6 +223,13 @@
     ((im gd-image-ptr)
      (size (* :int))
      (level :int))
+  :returning :pointer-void
+  :module "gd")
+
+#+:cl-gd-gif
+(def-function ("gdImageGifPtr" gd-image-gif-ptr)
+    ((im gd-image-ptr)
+     (size (* :int)))
   :returning :pointer-void
   :module "gd")
 


Index: cl-gd/images.lisp
diff -u cl-gd/images.lisp:1.1.1.1 cl-gd/images.lisp:1.2
--- cl-gd/images.lisp:1.1.1.1	Tue Jan  6 20:02:32 2004
+++ cl-gd/images.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/images.lisp,v 1.1.1.1 2004/01/07 01:02:32 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/images.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 
@@ -99,9 +99,12 @@
                             :gd2)
                           ((string-equal pathname-type "xbm")
                             :xbm)
-                          #-win32
+                          #-:win32
                           ((string-equal pathname-type "xpm")
-                            :xpm)))))
+			   :xpm)
+			  #+:cl-gd-gif
+			  ((string-equal pathname-type "gif")
+                            :gif)))))
     (unless %type
       (error "No type provided and it couldn't be guessed from filename"))
     (unless (probe-file file-name)
@@ -121,9 +124,12 @@
                          (gd-image-create-from-gd2-file c-file-name err))
                        ((:xbm)
                          (gd-image-create-from-xbm-file c-file-name err))
-                       #-win32
+                       #-:win32
                        ((:xpm)
-                         (gd-image-create-from-xpm c-file-name)))))
+			 (gd-image-create-from-xpm c-file-name))
+		       #+:cl-gd-gif
+		       ((:gif)
+                         (gd-image-create-from-gif-file c-file-name err)))))
           (cond ((null-pointer-p image)
                   (cond ((or (eq %type :xpm)
                              (zerop (deref-pointer err :int)))
@@ -209,9 +215,9 @@
   `(defun ,name ,signature
     ,docstring
     , at type-checks
-    (cond ((or #+(and allegro allegro-version>= (version>= 6 0))
+    (cond ((or #+(and :allegro :allegro-version>= (version>= 6 0))
                (typep stream 'excl:simple-stream)
-               #+lispworks4.3
+               #+:lispworks4.3
                (subtypep (stream-element-type stream) 'base-char)
                (subtypep (stream-element-type stream) '(unsigned-byte 8)))
             (with-foreign-object (size :int)
@@ -228,8 +234,8 @@
               (let ((memory ,gd-call))
                 (unwind-protect
                   (with-cast-pointer (temp memory
-                                           #+(or cmu scl sbcl) :unsigned-char
-                                           #-(or cmu scl sbcl) :char)
+                                           #+(or :cmu :scl :sbcl) :unsigned-char
+                                           #-(or :cmu :scl :sbcl) :char)
                     (dotimes (i (deref-pointer size :int))
                       (write-char (ensure-char-character
                                    (deref-array temp '(:array :char) i))
@@ -271,6 +277,17 @@
 the user of this function has to make sure the external format yields
 faithful output of all 8-bit characters.")
 
+#+:cl-gd-gif
+(make-stream-fn write-gif-to-stream (stream &key (image *default-image*))
+		(gd-image-gif-ptr (img image) size)
+                ((check-type stream stream)
+                 (check-type image image))
+                "Writes image IMAGE to stream STREAM as GIF. STREAM
+must be a character stream or a binary stream of element type
+\(UNSIGNED-BYTE 8). If STREAM is a character stream, the user of this
+function has to make sure the external format yields faithful output
+of all 8-bit characters.")
+
 (make-stream-fn write-wbmp-to-stream (stream &key foreground (image *default-image*))
                 (gd-image-wbmp-ptr (img image) size foreground)
                 ((check-type stream stream)
@@ -322,7 +339,10 @@
            ((:gd)
              #'write-gd-to-stream)
            ((:gd2)
-             #'write-gd2-to-stream))
+	     #'write-gd2-to-stream)
+           #+:cl-gd-gif
+	   ((:gif)
+             #'write-gif-to-stream))
          stream rest))
 
 (defun write-image-to-file (file-name &rest rest &key type (if-exists :error) &allow-other-keys)
@@ -350,6 +370,9 @@
                          :gd)
                        ((string-equal pathname-type "gd2")
                          :gd2)
+                       #+:cl-gd-gif
+                       ((string-equal pathname-type "gif")
+                         :gif)
                        (t
                          (error "Can't determine the type of the image")))))
            (sans rest :type :if-exists))))


Index: cl-gd/init.lisp
diff -u cl-gd/init.lisp:1.1.1.1 cl-gd/init.lisp:1.2
--- cl-gd/init.lisp:1.1.1.1	Tue Jan  6 20:02:32 2004
+++ cl-gd/init.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/init.lisp,v 1.1.1.1 2004/01/07 01:02:32 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/init.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 


Index: cl-gd/misc.lisp
diff -u cl-gd/misc.lisp:1.1.1.1 cl-gd/misc.lisp:1.2
--- cl-gd/misc.lisp:1.1.1.1	Tue Jan  6 20:02:36 2004
+++ cl-gd/misc.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/misc.lisp,v 1.1.1.1 2004/01/07 01:02:36 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/misc.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 


Index: cl-gd/packages.lisp
diff -u cl-gd/packages.lisp:1.1.1.1 cl-gd/packages.lisp:1.2
--- cl-gd/packages.lisp:1.1.1.1	Tue Jan  6 20:02:29 2004
+++ cl-gd/packages.lisp	Fri Apr 23 20:29:25 2004
@@ -24,6 +24,7 @@
            #:write-wbmp-to-stream
            #:write-gd-to-stream
            #:write-gd2-to-stream
+	   #+:cl-gd-gif #:write-gif-to-stream
            #:write-image-to-stream
            #:write-image-to-file
            #:image-width
@@ -71,4 +72,6 @@
            #:do-rows
            #:do-pixels-in-row
            #:do-pixels
-           #:raw-pixel))
\ No newline at end of file
+           #:raw-pixel))
+
+(pushnew :cl-gd *features*)
\ No newline at end of file


Index: cl-gd/specials.lisp
diff -u cl-gd/specials.lisp:1.1.1.1 cl-gd/specials.lisp:1.2
--- cl-gd/specials.lisp:1.1.1.1	Tue Jan  6 20:02:32 2004
+++ cl-gd/specials.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/specials.lisp,v 1.1.1.1 2004/01/07 01:02:32 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/specials.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 
@@ -139,7 +139,7 @@
   "The list of drive letters (used by Wintendo) used when looking for
 cl-gd-glue.so.")
 
-(defvar *gd-supporting-libraries* '("gd" "png" "z" "jpeg" "freetype" "iconv" "m")
+(defvar *gd-supporting-libraries* '("c" "gd" "png" "z" "jpeg" "freetype" "iconv" "m")
   "The libraries which are needed by cl-gd-glues.so \(and GD
 itself). Only needed for Python-based Lisps like CMUCL, SBCL, or
 SCL.")
@@ -153,4 +153,22 @@
 (defconstant +most-positive-unsigned-byte-32+
   (1- (expt 2 31))
   "Name says it all...")
-  
\ No newline at end of file
+
+;; stuff for Nikodemus Siivola's HYPERDOC
+;; see <http://common-lisp.net/project/hyperdoc/>
+;; and <http://www.cliki.net/hyperdoc>
+
+(defvar *hyperdoc-base-uri* "http://weitz.de/cl-gd/")
+
+(let ((exported-symbols-alist
+       (loop for symbol being the external-symbols of :cl-gd
+             collect (cons symbol
+                           (concatenate 'string
+                                        "#"
+                                        (string-downcase symbol))))))
+  (defun hyperdoc-lookup (symbol type)
+    (declare (ignore type))
+    (cdr (assoc symbol
+                exported-symbols-alist
+                :test #'eq))))
+               
\ No newline at end of file


Index: cl-gd/strings.lisp
diff -u cl-gd/strings.lisp:1.1.1.1 cl-gd/strings.lisp:1.2
--- cl-gd/strings.lisp:1.1.1.1	Tue Jan  6 20:02:36 2004
+++ cl-gd/strings.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/strings.lisp,v 1.1.1.1 2004/01/07 01:02:36 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/strings.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 


Index: cl-gd/transform.lisp
diff -u cl-gd/transform.lisp:1.1.1.1 cl-gd/transform.lisp:1.2
--- cl-gd/transform.lisp:1.1.1.1	Tue Jan  6 20:02:37 2004
+++ cl-gd/transform.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/transform.lisp,v 1.1.1.1 2004/01/07 01:02:37 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/transform.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 


Index: cl-gd/util.lisp
diff -u cl-gd/util.lisp:1.1.1.1 cl-gd/util.lisp:1.2
--- cl-gd/util.lisp:1.1.1.1	Tue Jan  6 20:02:36 2004
+++ cl-gd/util.lisp	Fri Apr 23 20:29:25 2004
@@ -1,5 +1,5 @@
 ;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-GD; Base: 10 -*-
-;;; $Header: /project/cl-gd/cvsroot/cl-gd/util.lisp,v 1.1.1.1 2004/01/07 01:02:36 eweitz Exp $
+;;; $Header: /project/cl-gd/cvsroot/cl-gd/util.lisp,v 1.2 2004/04/24 00:29:25 eweitz Exp $
 
 ;;; Copyright (c) 2003, Dr. Edmund Weitz.  All rights reserved.
 





More information about the Cl-gd-cvs mailing list