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