chiark
/
gitweb
/
~mdw
/
clg
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a5bc508
)
New type USER-CALLBACK and a bug fix
author
espen
<espen>
Mon, 20 Aug 2007 11:15:13 +0000
(11:15 +0000)
committer
espen
<espen>
Mon, 20 Aug 2007 11:15:13 +0000
(11:15 +0000)
glib/gcallback.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/gcallback.lisp
b/glib/gcallback.lisp
index 9e2c8fcd6421a7b87f8af005696adf0c155373a8..329bb606e5b1888b728908d4131ac39941ca84c6 100644
(file)
--- a/
glib/gcallback.lisp
+++ b/
glib/gcallback.lisp
@@
-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.
;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-;; $Id: gcallback.lisp,v 1.4
5 2007-06-25 13:49:05
espen Exp $
+;; $Id: gcallback.lisp,v 1.4
6 2007-08-20 11:15:13
espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-36,6
+36,17
@@
(defun register-callback-function (function)
(check-type function (or null symbol function))
(register-user-data function))
(check-type function (or null symbol function))
(register-user-data function))
+(deftype user-callback () '(or function symbol))
+
+(define-type-method alien-type ((type user-callback))
+ (declare (ignore type))
+ (alien-type 'pointer-data))
+
+(define-type-method to-alien-form ((type user-callback) func &optional copy-p)
+ (declare (ignore type copy-p))
+ `(register-callback-function ,func))
+
+
;; Callback marshaller for regular signal handlers
(define-callback signal-handler-marshal nil
((gclosure gclosure) (return-value gvalue) (n-params unsigned-int)
;; Callback marshaller for regular signal handlers
(define-callback signal-handler-marshal nil
((gclosure gclosure) (return-value gvalue) (n-params unsigned-int)
@@
-90,9
+101,9
@@
(defun invoke-signal-handler (callback-id return-type &rest args)
(disconnect () :report "Disconnect and exit signal handler"
(when (signal-handler-is-connected-p instance handler-id)
(signal-handler-disconnect instance handler-id))
(disconnect () :report "Disconnect and exit signal handler"
(when (signal-handler-is-connected-p instance handler-id)
(signal-handler-disconnect instance handler-id))
- (values nil t)))
)
+ (values nil t)))
(when (signal-handler-is-connected-p instance handler-id)
(when (signal-handler-is-connected-p instance handler-id)
- (signal-handler-unblock instance handler-id))))
+ (signal-handler-unblock instance handler-id))))
)
(defun invoke-callback (callback-id return-type &rest args)
(restart-case (apply (find-user-data callback-id) args)
(defun invoke-callback (callback-id return-type &rest args)
(restart-case (apply (find-user-data callback-id) args)