Generate references by introspection
[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 {args}
10 @defun \args\
11 @end defun
12 @end macro
13
14 @macro Macro {args}
15 @defmac \args\
16 @end defmac
17 @end macro
18
19 @macro Struct {args}
20 @deftp {Structure} \args\
21 @end deftp
22 @end macro
23
24 @macro Class {args}
25 @deftp {Class} \args\
26 @end deftp
27 @end macro
28
29 @macro Enum {args}
30 @deftp {Enum} \args\
31 @end deftp
32 @end macro
33
34 @macro Flags {args}
35 @deftp {Flags} \args\
36 @end deftp
37 @end macro
38
39 @macro Accessor {args}
40 @deffn {Accessor} \args\
41 @end deffn
42 @end macro
43
44 @macro GenericFunction {args}
45 @deffn {Generic Function} \args\
46 @end deffn
47 @end macro
48
49 @macro ForeignType {args}
50 @deftp {Foreign Type} \args\
51 @end deftp
52 @end macro
53
54 @macro Variable {args}
55 @defvr {Special Variable} \args\
56 @end defvr
57 @end macro
58
59 @macro Condition {args}
60 @deftp {Condition Type} \args\
61 @end deftp
62 @end macro
63
64 @macro cffi
65 @acronym{CFFI}
66 @end macro
67
68 @macro impnote {text}
69 @quotation
70 @strong{Implementor's note:} @emph{\text\}
71 @end quotation
72 @end macro
73
74 @c Info "requires" that x-refs end in a period or comma, or ) in the
75 @c case of @pxref.  So the following implements that requirement for
76 @c the "See also" subheadings that permeate this manual, but only in
77 @c Info mode.
78 @ifinfo
79 @macro seealso {name}
80 @ref{\name\}.
81 @end macro
82 @end ifinfo
83
84 @ifnotinfo
85 @alias seealso = ref
86 @end ifnotinfo
87
88 @c Typeset comments in roman font for the TeX output.
89 @iftex
90 @alias lispcmt = r
91 @end iftex
92 @ifnottex
93 @alias lispcmt = asis
94 @end ifnottex
95
96 @c My copy of makeinfo is not generating any HTML for @result{} for
97 @c some odd reason. (It certainly used to...)
98 @ifhtml
99 @macro result
100 =>
101 @end macro
102 @end ifhtml
103
104 @c Similar macro to @result. Its purpose is to work around the fact
105 @c that ⇒ does not work properly inside @lisp.
106 @ifhtml
107 @macro res
108 @html
109 ⇒
110 @end html
111 @end macro
112 @end ifhtml
113
114 @ifnothtml
115 @alias res = result
116 @end ifnothtml
117
118 @c ============================= Macros =============================
119
120
121 @c Show types, functions, and concepts in the same index.
122 @syncodeindex tp cp
123 @syncodeindex fn cp
124
125 @titlepage
126 @title CL-GTK2
127 @subtitle A Common Lisp binding for Gtk+
128 @author Dmitry Kalyanov
129 @end titlepage
130
131 @contents
132
133 @ifnottex
134 @node Top
135 @top cl-gtk2-gtk
136 @end ifnottex
137
138 @menu
139 * Overview::
140 * Installation::
141 * GObject Reference::
142 * Gdk Reference::
143 * Gtk Reference::
144 @end menu
145
146 @node Overview
147 @chapter Overview
148
149 @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.
150
151 As @code{Gtk+} is based on object system GObject, @code{cl-gtk2} is based on a binding to this object system called @uref{../gobject/index.html,,cl-gtk2-gobject}.
152
153 @code{cl-gtk2} provides a thin wrapper around @code{Gtk+} functionality, mostly retaining the same set of classes, properties and methods.
154
155 The important parts of @code{Gtk+} are:
156 @itemize
157 @item GObject type system
158 @itemize
159 @item Classes
160 @item Objects
161 @item Signals
162 @end itemize
163 @item Events
164 @item Layout and composition of widgets
165 @item Widget set
166 @item Using Gtk+ with threads
167 @item Building stand-alone applications
168 @end itemize
169
170 @node Installation
171 @chapter Installation
172
173 @code{cl-gtk2} has the following dependencies. They all must be installed before installing @code{cl-gtk2}.
174
175 @itemize
176 @item @uref{http://common-lisp.net/project/cffi/,,CFFI} (version >= 0.10.4)
177 @item @uref{http://www.cliki.net/trivial-garbage,,Trivial-Garbage} (version >= 0.18)
178 @item @uref{http://common-lisp.net/project/iterate/,,Iterate} (version >= 1.4.3)
179 @item @uref{http://common-lisp.net/project/bordeaux-threads/,,Bordeaux-Threads} (version >= 0.6.0)
180 @item @uref{http://common-lisp.net/project/closer/closer-mop.html,,Closer-MOP} (version >= 0.55)
181 @end itemize
182
183 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.
184
185 To get sources with Git, clone @code{cl-gtk2} repository:
186 @example
187 git clone git://repo.or.cz/cl-gtk2.git
188 @end example
189
190 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}.
191
192 To be able to compile, load and use @code{cl-gtk2}, you should register the @code{ASDF} system definitions.
193
194 To do this, either add @code{glib}, @code{gdk} and @code{gtk} directories to @code{asdf:*central-registry*}:
195 @lisp
196 (push "/path/to/cl-gtk2/glib" asdf:*central-registry*)
197 (push "/path/to/cl-gtk2/gdk" asdf:*central-registry*)
198 (push "/path/to/cl-gtk2/gtk" asdf:*central-registry*)
199 @end lisp
200 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):
201 @example
202 cd ~/.sbcl/systems           # depends on your system
203 ln -s /path/to/cl-gtk2/glib/cl-gtk2-glib.asd .
204 ln -s /path/to/cl-gtk2/gdk/cl-gtk2-gdk.asd .
205 ln -s /path/to/cl-gtk2/gtk/cl-gtk2-gtk.asd .
206 @end example
207
208 @node GObject Reference
209 @chapter GObject Reference
210
211 @include gobject.ref.texi
212
213 @node Gdk Reference
214 @chapter Gdk Reference
215
216 @include gdk.ref.texi
217
218 @node Gtk Reference
219 @chapter Gtk Reference
220
221 @include gtk.ref.texi
222
223 @bye