3 (defcfun (pixmap-new "gdk_pixmap_new") (g-object pixmap
:already-referenced
)
4 (drawable (g-object drawable
))
11 (defcfun (bitmap-create-from-data "gdk_bitmap_create_from_data") (g-object pixmap
:already-referenced
)
12 (drawable (g-object drawable
))
17 (export 'bitmap-create-from-data
)
19 (defcfun (pixmap-create-from-data "gdk_pixmap_create_from_data") (g-object pixmap
:already-referenced
)
20 (drawable (g-object drawable
))
25 (fg-color (g-boxed-foreign color
))
26 (bg-color (g-boxed-foreign color
)))
28 (export 'pixmap-create-from-data
)
30 (defcfun gdk-pixmap-create-from-xpm
(g-object pixmap
:already-referenced
)
31 (drawable (g-object drawable
))
33 (transparent-color (g-boxed-foreign color
))
36 (defcfun gdk-pixmap-colormap-create-from-xpm
(g-object pixmap
:already-referenced
)
37 (drawable (g-object drawable
))
38 (colormap (g-object colormap
))
40 (transparent-color (g-boxed-foreign color
))
43 (defcfun gdk-pixmap-create-from-xpm-d
(g-object pixmap
:already-referenced
)
44 (drawable (g-object drawable
))
46 (transparent-color (g-boxed-foreign color
))
47 (data (:pointer
:pointer
)))
49 (defun gdk-pixmap-create-from-xpm-d-1 (drawable mask transparent-color data
)
50 (let ((n (length data
)))
51 (with-foreign-object (data-ptr :pointer n
)
55 (setf (mem-aref data-ptr
:pointer i
) (cffi:foreign-string-alloc str
))
58 (gdk-pixmap-create-from-xpm-d drawable mask transparent-color data-ptr
))))
60 (defcfun gdk-pixmap-colormap-create-from-xpm-d
(g-object pixmap
:already-referenced
)
61 (drawable (g-object drawable
))
62 (colormap (g-object colormap
))
64 (transparent-color (g-boxed-foreign color
))
65 (data (:pointer
:pointer
)))
67 (defun gdk-pixmap-colormap-create-from-xpm-d-1 (drawable colormap mask transparent-color data
)
68 (let ((n (length data
)))
69 (with-foreign-object (data-ptr :pointer n
)
73 (setf (mem-aref data-ptr
:pointer i
) (cffi:foreign-string-alloc str
))
76 (gdk-pixmap-colormap-create-from-xpm-d drawable colormap mask transparent-color data-ptr
))))
78 (defun pixmap-create-from-xpm (drawable transparent-color
&key
(colormap nil colormap-p
) (filename nil filename-p
) (xpm-data nil xpm-p
))
79 (unless (or filename-p xpm-p
)
80 (error "FILENAME or XPM-DATA must be specified"))
81 (when (and filename-p xpm-p
)
82 (error "FILENAME and XPM-DATA may not be specified at the same time"))
83 (with-foreign-object (mask-ptr :pointer
)
84 (let ((pixmap (if filename-p
86 (gdk-pixmap-colormap-create-from-xpm drawable colormap mask-ptr transparent-color filename
)
87 (gdk-pixmap-create-from-xpm drawable mask-ptr transparent-color filename
))
89 (gdk-pixmap-colormap-create-from-xpm-d-1 drawable colormap mask-ptr transparent-color xpm-data
)
90 (gdk-pixmap-create-from-xpm-d-1 drawable mask-ptr transparent-color xpm-data
)))))
91 (values pixmap
(convert-from-foreign mask-ptr
'(g-object pixmap
:already-referenced
))))))
93 (export 'pixmap-create-from-xpm
)