X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/7d56481e1f1488e8027bf955a525f0602861f2b1..c07660b35e589c4ffc05b9b859808c4cca0a4435:/gdk/gdk.lisp diff --git a/gdk/gdk.lisp b/gdk/gdk.lisp index a42f432..497b985 100644 --- a/gdk/gdk.lisp +++ b/gdk/gdk.lisp @@ -15,15 +15,46 @@ ;; License along with this library; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -;; $Id: gdk.lisp,v 1.7 2001-10-21 23:02:40 espen Exp $ +;; $Id: gdk.lisp,v 1.11 2004-11-06 21:39:58 espen Exp $ (in-package "GDK") +;;; Initialization + +(defbinding (gdk-init "gdk_parse_args") () nil + "Initializes the library without opening the display." + (nil null) + (nil null)) -;;; Events -(defbinding connection-number () int) +;;; Display + +(defbinding (display-manager "gdk_display_manager_get") () display-manager) + + +(defbinding (display-set-default "gdk_display_manager_set_default_display") + (display) nil + ((display-manager) display-manager) + (display display)) + +(defbinding display-get-default () display) + +(defbinding %display-open () display + (display-name (or null string))) + +(defun display-open (&optional display-name) + (let ((display (%display-open display-name))) + (unless (display-get-default) + (display-set-default display)) + display)) + +(defbinding (display-connection-number "clg_gdk_connection_number") + (&optional (display (display-get-default))) int + (display display)) + + +;;; Events (defbinding (events-pending-p "gdk_events_pending") () boolean) @@ -271,8 +302,12 @@ (y int :out) (mask modifier-type :out)) -(defbinding get-root-window () window) +(defbinding %get-default-root-window () window) +(defun get-root-window (&optional display) + (if display + (error "Not implemented") + (%get-default-root-window))) ;; @@ -284,15 +319,6 @@ ;;; Cursor -(deftype-method alien-ref cursor (type-spec) - (declare (ignore type-spec)) - '%cursor-ref) - -(deftype-method alien-unref cursor (type-spec) - (declare (ignore type-spec)) - '%cursor-unref) - - (defbinding cursor-new () cursor (cursor-type cursor-type)) @@ -304,15 +330,24 @@ (x int) (y int)) (defbinding %cursor-ref () pointer - (cursor (or cursor pointer))) + (location pointer)) (defbinding %cursor-unref () nil - (cursor (or cursor pointer))) + (location pointer)) + +(defmethod reference-foreign ((class (eql (find-class 'cursor))) location) + (declare (ignore class)) + (%cursor-ref location)) + +(defmethod unreference-foreign ((class (eql (find-class 'cursor))) location) + (declare (ignore class)) + (%cursor-unref location)) + ;;; Pixmaps -#| + (defbinding pixmap-new (width height depth &key window) pixmap (width int) (height int) @@ -345,10 +380,10 @@ window colormap color (namestring (truename source)))) ((vector string) (%pixmap-colormap-create-from-xpm-d window colormap color source))) - (unreference-instance pixmap) - (unreference-instance mask) +;; (unreference-instance pixmap) +;; (unreference-instance mask) (values pixmap mask)))) -|# + ;;; Color