[gtk-cffi-cvs] CVS gtk-cffi/gdk

CVS User rklochkov rklochkov at common-lisp.net
Sun Aug 28 10:32:37 UTC 2011


Update of /project/gtk-cffi/cvsroot/gtk-cffi/gdk
In directory tiger.common-lisp.net:/tmp/cvs-serv22827

Added Files:
	atom.lisp 
Log Message:
GdkAtom support



--- /project/gtk-cffi/cvsroot/gtk-cffi/gdk/atom.lisp	2011/08/28 10:32:37	NONE
+++ /project/gtk-cffi/cvsroot/gtk-cffi/gdk/atom.lisp	2011/08/28 10:32:37	1.1
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; atom.lisp --- GdkAtom
;;;
;;; Copyright (C) 2007, Roman Klochkov <kalimehtar at mail.ru>
;;;

(in-package :gdk-cffi)

(defcfun gdk-atom-name :string (atom :pointer))
(defcfun gdk-atom-intern-static-string :pointer (val gtk-dyn-string))
(defcfun gdk-atom-intern :pointer (val :string) (only-if-exists :boolean))

(define-foreign-type gatom ()
  ()
  (:actual-type :pointer)
  (:simple-parser gatom))

(defmethod translate-to-foreign (value (gatom gatom))
  (typecase value
    (foreign-pointer value)
    (integer (make-pointer value))
    (t (gdk-atom-intern value nil))))

(defmethod translate-from-foreign (value (gatom gatom))
  (make-keyword (gdk-atom-name value)))
    




More information about the gtk-cffi-cvs mailing list