X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/5d46268894c9c8386aebcf9aeddd5f625845ce66..b2bea410be9b14ef1e81f8b09ad0983fbc2f57db:/gdk/gdkevents.lisp diff --git a/gdk/gdkevents.lisp b/gdk/gdkevents.lisp index 9721c7a..f0d0c3a 100644 --- a/gdk/gdkevents.lisp +++ b/gdk/gdkevents.lisp @@ -15,7 +15,7 @@ ;; 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: gdkevents.lisp,v 1.1 2001-05-11 16:20:20 espen Exp $ +;; $Id: gdkevents.lisp,v 1.3 2001-10-21 23:02:40 espen Exp $ (in-package "GDK") @@ -49,10 +49,8 @@ (defmethod initialize-instance ((event event) &rest initargs) (declare (ignore initargs)) - (with-slots (location %type) event - (setf location (%event-new)) - (setf %type (event-class-type (class-of event)))) - (call-next-method)) + (call-next-method) + (setf (slot-value event '%type) (event-class-type (class-of event)))) (deftype-method translate-from-alien event (type-spec location &optional weak-ref) @@ -61,27 +59,25 @@ (unless (null-pointer-p location) (ensure-proxy-instance (%type-of-event location) location ,weak-ref)))) -(defbinding %event-new () pointer) - ;;;; Metaclass for event classes (eval-when (:compile-toplevel :load-toplevel :execute) (defclass event-class (proxy-class) - ((event-type :reader event-class-type)))) - - -(defmethod shared-initialize ((class event-class) names - &rest initargs &key type) - (declare (ignore initargs names)) - (call-next-method) - (setf (slot-value class 'event-type) (first type)) - (setf (gethash (first type) *event-classes*) class)) + ((event-type :reader event-class-type))) + + (defmethod shared-initialize ((class event-class) names + &rest initargs &key type) + (declare (ignore initargs names)) + (call-next-method) + (setf (slot-value class 'event-type) (first type)) + (setf (gethash (first type) *event-classes*) class)) + -(defmethod validate-superclass - ((class event-class) (super pcl::standard-class)) - (subtypep (class-name super) 'event)) + (defmethod validate-superclass + ((class event-class) (super pcl::standard-class)) + (subtypep (class-name super) 'event))) ;;;;