Added texinfo macros EnumVRes, Method and RMethod
[cl-gtk2.git] / doc / gtk.texi
1 \input texinfo  @c -*-texinfo-*-
2 @c %**start of header (This is for running texinfo on a region.)
3 @setfilename gtk.info
4 @settitle CL-Gtk2
5 @c %**end of header (This is for running texinfo on a region.)
6
7 @c @documentencoding utf-8
8
9 @macro Function {name}
10 @defun \name\
11 @end defun
12 @end macro
13
14 @macro Macro {name}
15 @defmac \name\
16 @end defmac
17 @end macro
18
19 @macro Struct {name}
20 @deftp {Structure} \name\
21 @end deftp
22 @end macro
23
24 @macro Class {name}
25 @deftp {Class} \name\
26 @end deftp
27 @end macro
28
29 @macro Superclass {name}
30 Superclass: @ref{\name\}
31 @end macro
32
33 @macro Enum {name}
34 @deftp {Enum} \name\
35 @end deftp
36 @end macro
37
38 @macro EnumVRef {name,value}
39 @ref{enum.\name\.\value\,\value\}
40 @end macro
41
42 @macro Flags {name}
43 @deftp {Flags} \name\
44 @end deftp
45 @end macro
46
47 @macro Accessor {name}
48 @deffn {Accessor} \name\
49 @end deffn
50 @end macro
51
52 @macro TypedAccessor {name, class, type}
53 @deffn {Accessor} \name\ \class\
54 For class: @ref{\class\}
55
56 Type: \type\
57 @end deffn
58 @end macro
59
60 @macro GenericFunction {name}
61 @deffn {Generic Function} \name\
62 @end deffn
63 @end macro
64
65 @macro Method {name}
66 @deffn {Method} \name\
67 @end deffn
68 @end macro
69
70 @macro ForeignType {name}
71 @deftp {Foreign Type} \name\
72 @end deftp
73 @end macro
74
75 @macro Variable {name}
76 @defvr {Special Variable} \name\
77 @end defvr
78 @end macro
79
80 @macro Condition {name}
81 @deftp {Condition Type} \name\
82 @end deftp
83 @end macro
84
85 @macro Constant {name}
86 @defvr {Constant} \name\
87 @end defvr
88 @end macro
89
90 @macro RFunction {name}
91 @anchor{\name\}@defun \name\
92 @end defun
93 @end macro
94
95 @macro RMacro {name}
96 @anchor{\name\}@defmac \name\
97 @end defmac
98 @end macro
99
100 @macro RStruct {name}
101 @anchor{\name\}@deftp {Structure} \name\
102 @end deftp
103 @end macro
104
105 @macro RClass {name}
106 @anchor{\name\}@deftp {Class} \name\
107 @end deftp
108 @end macro
109
110 @macro RSuperclass {name}
111 @anchor{\name\}Superclass: @ref{\name\}
112 @end macro
113
114 @macro REnum {name}
115 @anchor{\name\}@deftp {Enum} \name\
116 @end deftp
117 @end macro
118
119 @macro RFlags {name}
120 @anchor{\name\}@deftp {Flags} \name\
121 @end deftp
122 @end macro
123
124 @macro RAccessor {name}
125 @anchor{\name\}@deffn {Accessor} \name\
126 @end deffn
127 @end macro
128
129 @macro RTypedAccessor {name, class, type}
130 @anchor{\name\}@deffn {Accessor} \name\ \class\
131 For class: @ref{\class\}
132
133 Type: \type\
134 @end deffn
135 @end macro
136
137 @macro RGenericFunction {name}
138 @anchor{\name\}@deffn {Generic Function} \name\
139 @end deffn
140 @end macro
141
142 @macro RMethod {name}
143 @anchor{\name\}@deffn {Method} \name\
144 @end deffn
145 @end macro
146
147 @macro RForeignType {name}
148 @anchor{\name\}@deftp {Foreign Type} \name\
149 @end deftp
150 @end macro
151
152 @macro RVariable {name}
153 @anchor{\name\}@defvr {Special Variable} \name\
154 @end defvr
155 @end macro
156
157 @macro RCondition {name}
158 @anchor{\name\}@deftp {Condition Type} \name\
159 @end deftp
160 @end macro
161
162 @macro RConstant {name}
163 @anchor{\name\}@defvr {Constant} \name\
164 @end defvr
165 @end macro
166
167 @macro SlotRef {class, slot}
168 @ref{slot.\class\.\slot\,\class\-\slot\}
169 @end macro
170
171 @macro SignalRef {class, signal}
172 @ref{signal.\class\.\signal\,\class\::\signal\}
173 @end macro
174
175 @macro cffi
176 @acronym{CFFI}
177 @end macro
178
179 @macro impnote {text}
180 @quotation
181 @strong{Implementor's note:} @emph{\text\}
182 @end quotation
183 @end macro
184
185 @c Info "requires" that x-refs end in a period or comma, or ) in the
186 @c case of @pxref.  So the following implements that requirement for
187 @c the "See also" subheadings that permeate this manual, but only in
188 @c Info mode.
189 @ifinfo
190 @macro seealso {name}
191 @ref{\name\}.
192 @end macro
193 @end ifinfo
194
195 @c @ifnotinfo
196 @c @alias seealso = ref
197 @c @end ifnotinfo
198
199 @c Typeset comments in roman font for the TeX output.
200 @c @iftex
201 @c @alias lispcmt = r
202 @c @end iftex
203 @c @ifnottex
204 @c @alias lispcmt = asis
205 @c @end ifnottex
206
207 @c My copy of makeinfo is not generating any HTML for @result{} for
208 @c some odd reason. (It certainly used to...)
209 @ifhtml
210 @macro result
211 =>
212 @end macro
213 @end ifhtml
214
215 @c Similar macro to @result. Its purpose is to work around the fact
216 @c that ⇒ does not work properly inside @lisp.
217 @ifhtml
218 @macro res
219 @html
220 ⇒
221 @end html
222 @end macro
223 @end ifhtml
224
225 @ifnothtml
226 @alias res = result
227 @end ifnothtml
228
229 @c ============================= Macros =============================
230
231
232 @c Show types, functions, and concepts in the same index.
233 @syncodeindex tp cp
234 @syncodeindex fn cp
235
236 @titlepage
237 @title CL-GTK2
238 @subtitle A Common Lisp binding for Gtk+
239 @author Dmitry Kalyanov
240 @end titlepage
241
242 @contents
243
244 @ifnottex
245 @node Top
246 @top cl-gtk2-gtk
247 @end ifnottex
248
249 @menu
250 * Overview::
251 * Installation::
252 * GLib Reference::
253 * GObject Reference::
254 * Gdk Reference::
255 * Gtk Reference::
256 @end menu
257
258 @node Overview
259 @chapter Overview
260
261 @code{cl-gtk2} is the GUI library for Common Lisp. @code{cl-gtk2} is based on @uref{http://www.gtk.org/,,Gtk+} GUI library and is Common Lisp binding for it. @code{cl-gtk2} allows you to create graphical user interfaces for Common Lisp applications.
262
263 As @code{Gtk+} is based on object system GObject, @code{cl-gtk2} is based on a binding to this object system called @code{cl-gtk2-gobject}.
264
265 @code{cl-gtk2} provides a thin wrapper around @code{Gtk+} functionality, mostly retaining the same set of classes, properties and methods.
266
267 The important parts of @code{Gtk+} are:
268 @itemize
269 @item GObject type system
270 @itemize
271 @item Classes
272 @item Objects
273 @item Signals
274 @end itemize
275 @item Events
276 @item Layout and composition of widgets
277 @item Widget set
278 @item Using Gtk+ with threads
279 @item Building stand-alone applications
280 @end itemize
281
282 @node Installation
283 @chapter Installation
284
285 @code{cl-gtk2} has the following dependencies. They all must be installed before installing @code{cl-gtk2}.
286
287 @itemize
288 @item @uref{http://common-lisp.net/project/cffi/,,CFFI} (version >= 0.10.4)
289 @item @uref{http://www.cliki.net/trivial-garbage,,Trivial-Garbage} (version >= 0.18)
290 @item @uref{http://common-lisp.net/project/iterate/,,Iterate} (version >= 1.4.3)
291 @item @uref{http://common-lisp.net/project/bordeaux-threads/,,Bordeaux-Threads} (version >= 0.6.0)
292 @item @uref{http://common-lisp.net/project/closer/closer-mop.html,,Closer-MOP} (version >= 0.55)
293 @end itemize
294
295 At first, source code of @code{cl-gtk2} needs to be downloaded. There are two options to download the sources: use @uref{http://git-scm.org/,,Git} or download @code{tar.gz} archive.
296
297 To get sources with Git, clone @code{cl-gtk2} repository:
298 @example
299 git clone git://repo.or.cz/cl-gtk2.git
300 @end example
301 or the mirror:
302 @example
303 git clone git://github.com/dmitryvk/cl-gtk2.git
304 @end example
305
306 Or download and unpack the @code{tar.gz}-archived @uref{http://repo.or.cz/w/cl-gtk2.git?a=snapshot;h=HEAD;sf=tgz,,snapshot} of @code{cl-gtk2}.
307
308 To be able to compile, load and use @code{cl-gtk2}, you should register the @code{ASDF} system definitions.
309
310 To do this, either add @code{glib}, @code{gdk} and @code{gtk} directories to @code{asdf:*central-registry*}:
311 @lisp
312 (push "/path/to/cl-gtk2/glib" asdf:*central-registry*)
313 (push "/path/to/cl-gtk2/gdk" asdf:*central-registry*)
314 (push "/path/to/cl-gtk2/gtk" asdf:*central-registry*)
315 @end lisp
316 or create symlinks to @code{cl-gtk2-glib.asd}, @code{cl-gtk2-gdk.asd} and @code{cl-gtk2-gtk.asd} files in a directory where @code{ASDF} systems are located (it might be @code{/usr/share/common-lisp/systems/} for system-wide installation in Gentoo Linux and Debian Linux, @code{~/.sbcl/systems/} for user installation for SBCL compiler):
317 @example
318 cd ~/.sbcl/systems           # depends on your system
319 ln -s /path/to/cl-gtk2/glib/cl-gtk2-glib.asd .
320 ln -s /path/to/cl-gtk2/gdk/cl-gtk2-gdk.asd .
321 ln -s /path/to/cl-gtk2/gtk/cl-gtk2-gtk.asd .
322 @end example
323
324 @node GLib Reference
325 @chapter GLib Reference
326
327 @lowersections
328 @include glib.ref.texi
329 @raisesections
330
331 @node GObject Reference
332 @chapter GObject Reference
333
334 @lowersections
335
336 @include gobject.ref.texi
337
338 @raisesections
339
340 @node Gdk Reference
341 @chapter Gdk Reference
342
343 @include gdk.ref.texi
344
345 @node Gtk Reference
346 @chapter Gtk Reference
347
348 @lowersections
349 @include gtk.ref.texi
350 @raisesections
351
352 @bye