changelog shortlog graph tags branches changeset files file revisions raw help

Mercurial > core / annotate lisp/ffi/glib/pkg.lisp

changeset 475: 2ce4891d0661
parent: ea3b643a27a3
child: 52a5ffbba7ac
author: Richard Westhaver <ellis@rwest.io>
date: Mon, 24 Jun 2024 20:59:53 -0400
permissions: -rw-r--r--
description: inig gst-play
474
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
1
 ;;; pkg.lisp --- Glib FFI
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
2
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
3
 ;; 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
4
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
5
 ;;; Code:
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
6
 (defpackage :glib
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
7
   (:use :cl :std :sb-alien)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
8
   (:export))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
9
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
10
 (in-package :glib)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
11
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
12
 (define-alien-loader glib t "/usr/lib/" "glib-2.0")
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
13
 
475
2ce4891d0661 inig gst-play
Richard Westhaver <ellis@rwest.io>
parents: 474
diff changeset
14
 (define-alien-type gtype unsigned)
2ce4891d0661 inig gst-play
Richard Westhaver <ellis@rwest.io>
parents: 474
diff changeset
15
 
2ce4891d0661 inig gst-play
Richard Westhaver <ellis@rwest.io>
parents: 474
diff changeset
16
 (define-alien-type gtype-interface (* t))
2ce4891d0661 inig gst-play
Richard Westhaver <ellis@rwest.io>
parents: 474
diff changeset
17
 
2ce4891d0661 inig gst-play
Richard Westhaver <ellis@rwest.io>
parents: 474
diff changeset
18
 (eval-always
2ce4891d0661 inig gst-play
Richard Westhaver <ellis@rwest.io>
parents: 474
diff changeset
19
   (define-opaque gmainloop)
2ce4891d0661 inig gst-play
Richard Westhaver <ellis@rwest.io>
parents: 474
diff changeset
20
   (define-opaque gmaincontext)
2ce4891d0661 inig gst-play
Richard Westhaver <ellis@rwest.io>
parents: 474
diff changeset
21
   (define-opaque gobjectgroup)
2ce4891d0661 inig gst-play
Richard Westhaver <ellis@rwest.io>
parents: 474
diff changeset
22
   (define-opaque glist))
474
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
23
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
24
 (define-alien-type ginitially-unowned (* t))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
25
 (define-alien-type gmutex (* t))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
26
 (define-alien-type gpointer (* t))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
27
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
28
 (define-alien-type glist-t
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
29
   (struct glist
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
30
           (data gpointer)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
31
           (next (* glist))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
32
           (prev (* glist))))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
33
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
34
 (define-alien-type grec-mutex
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
35
     (struct grec-mutex
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
36
             (p gpointer)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
37
             (i (array unsigned-int 2))))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
38
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
39
 (define-alien-routine g-main-loop-new (* gmainloop) (context (* gmaincontext)) (is-running boolean))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
40
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
41
 (define-alien-type gquark (unsigned 32))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
42
 (define-alien-type gerror (struct gerror
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
43
                                   (domain gquark)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
44
                                   (code int)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
45
                                   (message c-string)))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
46
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
47
 (define-opaque goptioncontext (* t))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
48
 (define-opaque goptiongroup (* t))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
49
 (define-opaque goptionentry (* t))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
50
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
51
 (define-alien-enum (goption-flags int)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
52
                    :none 0
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
53
                    :hidden (ash 1 0)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
54
                    :in-main (ash 1 1)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
55
                    :reverse (ash 1 2)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
56
                    :no-arg (ash 1 3)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
57
                    :filename (ash 1 4)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
58
                    :optional-arg (ash 1 5)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
59
                    :noalias (ash 1 6))
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
60
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
61
 (define-alien-enum (goption-arg int)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
62
                    :none 0
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
63
                    :string 1
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
64
                    :int 2
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
65
                    :callback 3
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
66
                    :filename 4
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
67
                    :string-array 5
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
68
                    :filename-array 6
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
69
                    :double 7
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
70
                    :int64 8)
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
71
 
ea3b643a27a3 init glib and gstreamer FFI
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
72
 (define-alien-routine g-option-error-quark gquark)