Some changes for being able to save snapshots of widgets
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Mon, 1 Jun 2009 20:08:06 +0000 (00:08 +0400)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Mon, 1 Jun 2009 20:08:06 +0000 (00:08 +0400)
gdk/gdk.functions.lisp
gtk/gtk.widget.lisp

index 96a5bf1..f050253 100644 (file)
 
 (defcfun gdk-atom-intern gdk-atom
   (name :string)
-  (only-if-exists :boolean))
\ No newline at end of file
+  (only-if-exists :boolean))
+
+(export 'drawable-size)
+
+(defcfun gdk-pixbuf-get-from-drawable (g-object pixbuf)
+  (dest (g-object pixbuf))
+  (src (g-object drawable))
+  (colormap :pointer)
+  (src-x :int)
+  (src-y :int)
+  (dest-x :int)
+  (dest-y :int)
+  (width :int)
+  (height :int))
+
+(defun pixbuf-get-from-drawable (pixbuf drawable &key (src-x 0) (src-y 0) (dest-x 0) (dest-y 0) (width -1) (height -1))
+  (gdk-pixbuf-get-from-drawable pixbuf drawable (null-pointer) src-x src-y dest-x dest-y width height))
+
+(export 'pixbuf-get-from-drawable)
+
+(defcfun gdk-pixbuf-savev :boolean
+  (pixbuf (g-object pixbuf))
+  (filename :string)
+  (type :string)
+  (option-keys (:pointer (:pointer :char)))
+  (option-values (:pointer (:pointer :char)))
+  (error :pointer))
+
+(defun pixbuf-save (pixbuf filename type)
+  (gdk-pixbuf-savev pixbuf
+                    (etypecase filename
+                      (string filename)
+                      (pathname (namestring filename)))
+                    type
+                    (null-pointer)
+                    (null-pointer)
+                    (null-pointer)))
+
+(export 'pixbuf-save)
index 0e5def4..38bb750 100644 (file)
 
 (export 'widget-trigger-tooltip-query)
 
-(defcfun (widget-snapshot "gtk_widget_get_snapshot") g-object
+(defcfun gtk-widget-get-snapshot g-object
   (widget g-object)
   (clip-rectangle (g-boxed-ptr rectangle)))
 
+(defun widget-snapshot (widget &optional clip-rectangle)
+  (gtk-widget-get-snapshot widget clip-rectangle))
+
 (export 'widget-snapshot)
\ No newline at end of file