Add Gdk/Images
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sat, 7 Nov 2009 02:57:34 +0000 (05:57 +0300)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sat, 7 Nov 2009 02:57:34 +0000 (05:57 +0300)
gdk/cl-gtk2-gdk.asd
gdk/gdk.images.lisp [new file with mode: 0644]
gdk/gdk.objects.lisp

index 96691fe..b7cd1ad 100644 (file)
@@ -14,5 +14,6 @@
                (:file "gdk.gc")
                (:file "gdk.drawing-primitives")
                (:file "gdk.bitmaps")
-               (:file "gdk.rgb"))
+               (:file "gdk.rgb")
+               (:file "gdk.images"))
   :depends-on (:cl-gtk2-glib :cffi :cl-gtk2-pango))
\ No newline at end of file
diff --git a/gdk/gdk.images.lisp b/gdk/gdk.images.lisp
new file mode 100644 (file)
index 0000000..ac31245
--- /dev/null
@@ -0,0 +1,39 @@
+(in-package :gdk)
+
+(defcfun (gdk-image-new "gdk_image_new") (g-object gdk-image :already-referenced)
+  (type gdk-image-type)
+  (visual (g-object visual))
+  (width :int)
+  (height :int))
+
+(export 'gdk-image-new)
+
+;; deprecated:
+;; GdkImage*           gdk_image_new_bitmap                (GdkVisual *visual,
+;;                                                          gpointer data,
+;;                                                          gint width,
+;;                                                          gint height);
+;; GdkImage*           gdk_image_get                       (GdkDrawable *drawable,
+;;                                                          gint x,
+;;                                                          gint y,
+;;                                                          gint width,
+;;                                                          gint height);
+;; GdkImage *          gdk_image_ref                       (GdkImage *image);
+;; void                gdk_image_unref                     (GdkImage *image);
+;; #define             gdk_image_destroy
+
+
+(defcfun (gdk-image-put-pixel "gdk_image_put_pixel") :void
+  (image (g-object gdk-image))
+  (x :int)
+  (y :int)
+  (pixel :uint32))
+
+(export 'gdk-image-put-pixel)
+
+(defcfun (gdk-image-get-pixel "gdk_image_get_pixel") :uint32
+  (image (g-object gdk-image))
+  (x :int)
+  (y :int))
+
+(export 'gdk-image-get-pixel)
index fd8f325..884b339 100644 (file)
   (:superclass g-object :export t :interfaces
                nil :type-initializer
                "gdk_image_get_type")
-  nil)
+  ((:cffi colormap gdk-image-colormap (g-object gdk-colormap)
+          "gdk_image_get_colormap" "gdk_image_set_colormap")))
+
+(define-g-enum "GdkImageType"
+    gdk-image-type
+    (:export t :type-initializer "gdk_image_type_get_type")
+  (:normal 0)
+  (:shared 1)
+  (:fastest 2))
+