Initial commit
[cl-gtk2.git] / gtk / gtk.main_loop_events.lisp
1 (in-package :gtk)
2
3 (defcfun gtk-init-check :boolean
4   (argc (:pointer :int))
5   (argv (:pointer (:pointer :string))))
6
7 (defun gtk-init ()
8   (gtk-init-check (foreign-alloc :int :initial-element 0)
9                   (foreign-alloc :string :initial-contents '("/usr/bin/sbcl")))
10   #+nil(with-foreign-objects ((argc :int)
11                          (argv '(:pointer :string) 1))
12     (setf (mem-ref argc :int) 0
13           (mem-ref argv '(:pointer :string)) (foreign-alloc :string :count 1
14                                                             :initial-element "/usr/bin/sbcl"))
15     (unwind-protect
16          (unless (gtk-init-check argc argv)
17            (error "Cannot initialize Gtk+"))
18       (foreign-free (mem-ref argv '(:pointer :string))))))
19
20 (gtk-init)
21
22 (defcfun gtk-test-register-all-types :void)
23
24 (gtk-test-register-all-types)
25
26 (defcfun gtk-events-pending :boolean)
27
28 (defcfun gtk-main :void)
29
30 (defcfun gtk-main-level :uint)
31
32 (defcfun gtk-main-quit :void)
33
34 (defcfun gtk-main-iteration :boolean)
35
36 (defcfun gtk-main-iteration-do :boolean
37   (blocking :boolean))
38
39 (defcfun gtk-grab-add :void
40   (widget g-object))
41
42 (defcfun gtk-grab-get-current g-object)
43
44 (defcfun gtk-grab-remove :void
45   (widget g-object))