From 64922434a0eafed5817e370f2283ce5913a5bc88 Mon Sep 17 00:00:00 2001 From: Dmitry Kalyanov Date: Sat, 7 Nov 2009 05:57:34 +0300 Subject: [PATCH] Add Gdk/Images --- gdk/cl-gtk2-gdk.asd | 3 ++- gdk/gdk.images.lisp | 39 +++++++++++++++++++++++++++++++++++++++ gdk/gdk.objects.lisp | 11 ++++++++++- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 gdk/gdk.images.lisp diff --git a/gdk/cl-gtk2-gdk.asd b/gdk/cl-gtk2-gdk.asd index 96691fe..b7cd1ad 100644 --- a/gdk/cl-gtk2-gdk.asd +++ b/gdk/cl-gtk2-gdk.asd @@ -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 index 0000000..ac31245 --- /dev/null +++ b/gdk/gdk.images.lisp @@ -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) diff --git a/gdk/gdk.objects.lisp b/gdk/gdk.objects.lisp index fd8f325..884b339 100644 --- a/gdk/gdk.objects.lisp +++ b/gdk/gdk.objects.lisp @@ -661,4 +661,13 @@ (: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)) + -- 1.7.10.4