chiark / gitweb /
Hopefully allow (require :glib) again.
[clg] / gdk / gdkevents.lisp
index 3d7331a3328fb37be496a014feb1ed3763c03703..aadfb2ac0528d6625da4a4819dd8d0c9f8cf1764 100644 (file)
@@ -20,7 +20,7 @@
 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-;; $Id: gdkevents.lisp,v 1.12 2006-04-26 09:20:20 espen Exp $
+;; $Id: gdkevents.lisp,v 1.15 2008-03-18 15:08:08 espen Exp $
 
 (in-package "GDK")
 
@@ -47,7 +47,9 @@   (defmethod shared-initialize ((class event-class) names &key name event-type)
   
 (let ((reader (reader-function 'event-type)))
   (defun %event-class (location)
-    (gethash (funcall reader location 0) *event-classes*)))
+    (or
+     (gethash (funcall reader location 0) *event-classes*)
+     (error "No class defined for event type: ~S" (funcall reader location 0)))))
 
 (defmethod make-proxy-instance :around ((class event-class) location 
                                        &rest initargs)
@@ -75,14 +77,13 @@   (defclass event (boxed)
       :type (bool 8)))
     (:metaclass boxed-class)))
 
-(defmethod initialize-instance ((event event) &rest initargs)
+(defmethod initialize-instance :after ((event event) &rest initargs)
   (declare (ignore initargs))
-  (call-next-method)
   (setf (slot-value event '%type) (event-class-type (class-of event))))
 
-(defmethod make-proxy-instance :around ((class (eql (find-class 'event))) location &rest initargs)
+(defmethod make-proxy-instance ((class (eql (find-class 'event))) location &rest initargs)
   (let ((class (%event-class location)))
-    (apply #'call-next-method class location initargs)))
+    (apply #'make-proxy-instance class location initargs)))
 
 
 (defclass timed-event (event)
@@ -560,3 +561,21 @@ (defclass owner-change-event (event)
   (:metaclass event-class)
   (:event-type :owner-change))
 
+(defclass grab-broken-event (event)
+  ((keyboard
+    :allocation :alien
+    :accessor event-keyboard
+    :initarg :keyboard
+    :type boolean)
+   (implicit
+    :allocation :alien
+    :accessor event-implicit
+    :initarg :implicit
+    :type boolean)
+   (grab-window
+    :allocation :alien
+    :accessor event-grab-window
+    :initarg :grab-window
+    :type window))
+  (:metaclass event-class)
+  (:event-type :grab-broken))