File: README.gtk-defs

package info (click to toggle)
rep-gtk 0.15-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 728 kB
  • ctags: 349
  • sloc: ansic: 3,577; sh: 2,430; lisp: 1,102; makefile: 159
file content (142 lines) | stat: -rw-r--r-- 3,017 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
-*-Indented-Text-*-

These notes describe the format of the .defs files


(import "DEFS-FILE")
(include "DEFS-FILE")



(define-enum ENUM-TYPEDEF-NAME
  (LISP-SYM CPP-MACRO)
  ...)



(define-flags FLAGS-TYPEDEF-NAME
  (LISP-SYM CPP-MACRO)
  ...)



(define-boxed BOXED-TYPEDEF-NAME
  ATTR ...)

where each ATTR is one of:

      (copy C-COPY-FUN)
      (free C-FREE-FUN)
      (size "C sizeof expression")
      (fields FIELD ...)

      where each FIELD is (TYPE-SYM NAME-SYM OPTIONS...)
      each OPTION may be `(setter t)' denoting that the field
      is settable. Also `(getter FUNCTION-NAME)' defining a custom
      method of retrieving the value



(define-object OBJECT-TYPEDEF-NAME (SUPER-CLASS-TYPEDEF)
  ATTR ...)

where each ATTR is one of:

      (fields FIELD ...)		[as above]



(define-func C-FUNC-NAME
  RETURN-VALUE [RET-OPTIONS...]
  (ARG ...)
  OPTIONS...)

where each ARG is (TYPE NAME-SYM [ARG-OPTIONS...)
and each OPTION may be one of:

  (scm-name ACTUAL-NAME-STRING)
  (protection ARG)			; gc protect callback for life of ARG
  (protection t)			; gc protect callback always
  (protection *result*)			; gc protect for life of RETURN-VALUE
  (undeferred t)			; no scm interrupt protection?
  (rest-arg t)				; last arg is &rest

and each ARG-OPTION may be one of:

  (= "default expression")
  (null-ok)				; allow nil
  (protect-during)

and each RET-OPTION may be one of:

  (copy nil)



(options OPTION ...)

where each OPTION can be:

      (includes "#include expression")
      (init-func "name of C function")
      (other-inits "name of C function" ... )
      (extra-init-code "code string")
      (provide FEATURE)

the `provide' option generates the rep dl stub required to provide
FEATURE and call the init-func when loaded



GTK fundamental types seem to include:

	invalid, none, char, bool, int, uint, long, ulong, float,
	string, enum, flags, boxed, foreign, callback, args, pointer,
	signal, c-callback, object

The guile-gtk .defs files seem to add the following:

	static_string, full_callback, file-descriptor, list, slist,
	double, SCM, cvec, cvecr, fvec, ret, tvec

static_string:
  a static string returned from a function

full_callback:
  a callback function used by the _full function variants (i.e.
  gtk_signal_connect_full). 

file-descriptor:
  an integer file descriptor

double:
  a double-precision float

SCM:
  a scheme object

(list TYPE [MODE]):
  a glib GList* (doubly-linked)

(slist TYPE [MODE]):
  a glib GSList* (singly-linked)

(cvec TYPE [MODE]):
  a counted-vector, stored in sgtk_cvec struct, in gtk_ function calls,
  it expands ``cvec.data, cvec.len''

(cvecr TYPE [MODE]):
  similar to cvec but expands ``cvec.len, cvec.data''

(fvec TYPE LEN [MODE]):
  similar to cvec but fixed length

(ret TYPE):
  similar to fvec but length is always one. used to mimic the C ``&foo''
  idiom of returning multiple values

(tvec TYPE [MODE]):
  zero-terminated vector

[ in the above, MODE is one of `in', `out' or `inout'. Defaults to `in' ]