source: rtems-graphics-toolkit/fltk-1.1.10/documentation/intro.html @ 513eea1

Last change on this file since 513eea1 was 513eea1, checked in by Joel Sherrill <joel.sherrill@…>, on 01/09/10 at 22:43:24

2010-01-08 Joel Sherrill <joel.sherrill@…>

fltk 1.1.10. imported

  • ORIGIN: Updated.
  • Property mode set to 100644
File size: 13.4 KB
Line 
1<HTML>
2<HEAD>
3        <TITLE>1 - Introduction to FLTK</TITLE>
4</HEAD>
5<BODY>
6
7<H1 ALIGN="RIGHT"><A NAME="intro">1 - Introduction to FLTK</A></H1>
8
9<P>The Fast Light Tool Kit (&quot;FLTK&quot;, pronounced
10&quot;fulltick&quot;) is a cross-platform C++ GUI toolkit for
11UNIX&reg;/Linux&reg; (X11), Microsoft&reg; Windows&reg;, and
12MacOS&reg; X. FLTK provides modern GUI functionality without the
13bloat and supports 3D graphics via OpenGL&reg; and its built-in
14GLUT emulation. It was originally developed by Mr. Bill Spitzak
15and is currently maintained by a small group of developers
16across the world with a central repository in the US.</P>
17
18<H2>History of FLTK</H2>
19
20<P>It has always been Bill's belief that the GUI API of all
21modern  systems is much too high level. Toolkits (even FLTK) are
22<I>not</I> what  should be provided and documented as part of an
23operating system. The  system only has to provide arbitrary
24shaped but featureless windows, a  powerful set of graphics
25drawing calls, and a simple <I>unalterable</I> method of
26delivering events to the owners of the windows. NeXT (if  you
27ignored NextStep) provided this, but they chose to hide it and
28tried to push their own baroque toolkit instead.</P>
29
30<P>Many of the ideas in FLTK were developed on a NeXT (but
31<I>not</I> using NextStep) in 1987 in a C toolkit Bill called
32&quot;views&quot;. Here he came up with passing events downward
33in the tree and having the handle routine return a value
34indicating whether it used the event, and the table-driven menus. In
35general he was trying to prove that complex UI ideas could be
36entirely implemented in a user space toolkit, with no knowledge
37or support by the system.</P>
38
39<P>After going to film school for a few years, Bill worked at
40Sun Microsystems on the (doomed) NeWS project. Here he found an
41even better and cleaner windowing system, and he reimplemented
42&quot;views&quot; atop that. NeWS did have an unnecessarily
43complex method of delivering events which hurt it. But the
44designers did admit that perhaps the user could write just as
45good of a button as they could, and officially exposed the lower
46level interface.</P>
47
48<P>With the death of NeWS Bill realized that he would have to
49live with X. The biggest problem with X is the &quot;window
50manager&quot;, which means that the toolkit can no longer
51control the window borders or drag the window around.</P>
52
53<P>At Digital Domain Bill discovered another toolkit,
54&quot;Forms&quot;. Forms was similar to his work, but provided
55many more widgets, since it was used in many real applications,
56rather then as theoretical work. He decided to use Forms, except
57he integrated his table-driven menus into it. Several very large
58programs were created using this version of Forms.</P>
59
60<P>The need to switch to OpenGL and GLX, portability, and a
61desire to use C++ subclassing required a rewrite of Forms.
62This produced the first version of FLTK. The conversion to C++
63required so many changes it made it impossible to recompile any
64Forms objects. Since it was incompatible anyway, Bill decided
65to incorporate his older ideas as  much as possible by
66simplifying the lower level interface and the event passing
67mechanism.</P>
68
69<P>Bill received permission to release it for free on the
70Internet, with the GNU general public license. Response from
71Internet users indicated that the Linux market dwarfed the SGI
72and high-speed GL market, so he rewrote it to use X for all
73drawing, greatly speeding it up on these machines. That is the
74version you have now.</P>
75
76<P>Digital Domain has since withdrawn support for FLTK. While
77Bill is no longer able to actively develop it, he still
78contributes to FLTK in his free time and is a part of the FLTK
79development team.</P>
80
81<H2>Features</H2>
82
83<P>FLTK was designed to be statically linked. This was done by
84splitting it into many small objects and designing it so that
85functions that are not used do not have pointers to them in the
86parts that are used, and thus do not get linked in. This allows
87you to make an easy-to-install program or to modify FLTK to
88the exact requirements of your application without worrying
89about bloat. FLTK works fine as a shared library, though, and
90is now included with several Linux distributions.</P>
91
92<P>Here are some of the core features unique to FLTK:</P>
93
94<UL>
95
96        <LI>sizeof(Fl_Widget) == 64 to 92.</LI>
97
98        <LI>The &quot;core&quot; (the &quot;hello&quot; program
99        compiled &amp; linked with a static FLTK library using
100        gcc on a 486 and then stripped) is 114K.</LI>
101
102        <LI>The FLUID program (which includes every widget) is
103        538k.</LI>
104
105        <LI>Written directly atop core libraries (Xlib, WIN32 or
106        Carbon) for maximum speed, and carefully optimized for
107        code size and performance.</LI>
108
109        <LI>Precise low-level compatability between the X11,
110        WIN32 and MacOS versions - only about 10% of the code is
111        different.</LI>
112
113        <LI>Interactive user interface builder program. Output is
114        human-readable and editable C++ source code.</LI>
115
116        <LI>Support for overlay hardware, with emulation if none
117        is available.</LI>
118
119        <LI>Very small &amp; fast portable 2-D drawing library
120        to hide Xlib, WIN32, or QuickDraw.</LI>
121
122        <LI>OpenGL/Mesa drawing area widget.</LI>
123
124        <LI>Support for OpenGL overlay hardware on both X11 and
125        WIN32, with emulation if none is available.</LI>
126
127        <LI>Text widgets with Emacs key bindings, X cut &amp;
128        paste, and  foreign letter compose!</LI>
129
130        <LI>Compatibility header file for the GLUT library.</LI>
131
132        <LI>Compatibility header file for the XForms library.</LI>
133
134</UL>
135
136<H2>Licensing</H2>
137
138<P>FLTK comes with complete free source code. FLTK is available
139under the terms of the <A href="license.html">GNU Library
140General Public License</A> with exceptions that allow for static
141linking. Contrary to popular belief, it can be used in
142commercial software - even Bill Gates could use it!</P>
143
144<H2>What Does &quot;FLTK&quot; Mean?</H2>
145
146<P>FLTK was originally designed to be compatible with the Forms
147Library written for SGI machines. In that library all the
148functions and structures started with &quot;fl_&quot;. This
149naming was extended to all new  methods and widgets in the C++
150library, and this prefix was taken as the name of the library.
151It is almost impossible to search for &quot;FL&quot; on the
152Internet, due to the fact that it is also the abbreviation for
153Florida. After much debating and searching for a new name for
154the toolkit, which was already in use by several people, Bill
155came up with &quot;FLTK&quot;, including a bogus excuse that it
156stands for &quot;The Fast Light Toolkit&quot;.</P>
157
158<H2>Building and Installing FLTK Under UNIX and MacOS X</H2>
159
160<P>In most cases you can just type &quot;make&quot;. This will
161run configure with the default of no options and then compile
162everything.</P>
163
164<P>FLTK uses GNU autoconf to configure itself for your UNIX
165platform. The main things that the configure script will look
166for are the X11 and OpenGL (or Mesa) header and library files.
167If these cannot be found in the standard include/library
168locations you'll need to define the <tt>CFLAGS</tt>,
169<tt>CXXFLAGS</tt>, and <tt>LDFLAGS</tt> environment variables.
170For the Bourne and Korn shells you'd use:</P>
171
172<UL><PRE>
173CFLAGS=-I<I>includedir</I>; export CFLAGS
174CXXFLAGS=-I<I>includedir</I>; export CXXFLAGS
175LDFLAGS=-L<I>libdir</I>; export LDFLAGS
176</PRE></UL>
177
178<P>For C shell and tcsh, use:</P>
179
180<UL><PRE>
181setenv CFLAGS "-I<I>includedir</I>"
182setenv CXXFLAGS "-I<I>includedir</I>"
183setenv LDFLAGS "-L<I>libdir</I>"
184</PRE></UL>
185
186<P>By default configure will look for a C++ compiler named
187<tt>CC</tt>, <tt>c++</tt>, <tt>g++</tt>, or <tt>gcc</tt> in that
188order. To use another compiler you need to set the <tt>CXX</tt>
189environment variable:</P>
190
191<UL><PRE>
192CXX=xlC; export CXX
193setenv CXX "xlC"
194</PRE></UL>
195
196<P>The <tt>CC</tt> environment variable can also be used to
197override the default C compiler (<tt>cc</tt> or <tt>gcc</tt>),
198which is used for a few FLTK source files.</P>
199
200<P>You can run configure yourself to get the exact setup you
201need. Type  &quot;./configure &lt;options&gt;&quot;, where
202options are:</P>
203
204<DL>
205
206        <DT>--enable-cygwin</DT>
207        <DD>Enable the Cygwin libraries under WIN32</DD>
208
209        <DT>--enable-debug</DT>
210        <DD>Enable debugging code &amp; symbols</DD>
211
212        <DT>--disable-gl</DT>
213        <DD>Disable OpenGL support</DD>
214
215        <DT>--enable-shared</DT>
216        <DD>Enable generation of shared libraries</DD>
217
218        <DT>--enable-threads</DT>
219        <DD>Enable multithreading support</DD>
220
221        <DT>--enable-xdbe</DT>
222        <DD>Enable the X double-buffer extension</DD>
223
224        <DT>--enable-xft</DT>
225        <DD>Enable the Xft library for anti-aliased fonts under X11</DD>
226
227        <DT>--bindir=/path</DT>
228        <DD>Set the location for executables [default = $prefix/bin]</DD>
229
230        <DT>--datadir=/path</DT>
231        <DD>Set the location for data files. [default = $prefix/share]</DD>
232
233        <DT>--libdir=/path</DT>
234        <DD>Set the location for libraries [default = $prefix/lib]</DD>
235
236        <DT>--includedir=/path</DT>
237        <DD>Set the location for include files. [default = $prefix/include]</DD>
238
239        <DT>--mandir=/path</DT>
240        <DD>Set the location for man pages. [default = $prefix/man]</DD>
241
242        <DT>--prefix=/dir</DT>
243        <DD>Set the directory prefix for files [default = /usr/local]</DD>
244
245</DL>
246
247<P>When the configure script is done you can just run the
248&quot;make&quot; command. This will build the library, FLUID
249tool, and all of the test programs.</P>
250
251<P>To install the library, become root and type &quot;make
252install&quot;. This will copy the &quot;fluid&quot; executable
253to &quot;bindir&quot;, the header files to
254&quot;includedir&quot;, and the library files to
255&quot;libdir&quot;.</P>
256
257<H2>Building FLTK Under Microsoft Windows</H2>
258
259<P>There are three ways to build FLTK under Microsoft Windows.
260The first is to use the Visual C++ 5.0 project files under the
261&quot;visualc&quot; directory. Just open (or double-click on)
262the &quot;fltk.dsw&quot; file to get the whole shebang.</P>
263
264<P>The second method is to use the <TT>configure</TT> script
265included with the FLTK software; this has only been tested with
266the CygWin tools:</P>
267
268<UL><PRE>
269sh configure --prefix=C:/FLTK
270make
271</PRE></UL>
272
273<P>The final method is to use a GNU-based development tool with
274the files in the &quot;makefiles&quot; directory. To build
275using one of these tools simply copy the appropriate
276makeinclude and config files to the main directory and do a
277make:</P>
278
279<UL><PRE>
280copy makefiles\Makefile.&lt;env&gt; Makefile
281make
282</PRE></UL>
283
284<H3>Using the Visual C++ DLL Library</H3>
285
286<P>The &quot;fltkdll.dsp&quot; project file builds a DLL-version
287of the FLTK library. Because of name mangling differences
288between PC compilers (even between different versions of Visual
289C++!) you can only use the DLL that is generated with the same
290version compiler that you built it with.</P>
291
292<P>When compiling an application or DLL that uses the FLTK DLL,
293you will need to define the <tt>FL_DLL</tt> preprocessor symbol
294to get the correct linkage commands embedded within the FLTK
295header files.</P>
296
297<H2>Building FLTK Under OS/2</H2>
298
299<P>The current OS/2 build requires XFree86 for OS/2 to work.  A
300native  Presentation Manager version has not been implemented
301yet (volunteers  are welcome!).</P>
302
303<p>The current set of Makefiles/configuration failes assumes that
304EMX 0.9d and libExt
305(from <A HREF="http://posix2.sourceforge.net">posix2.sourceforge.net</A>)
306is installed.
307
308<P>To build the XFree86 version of FLTK for OS/2, copy the appropriate
309makeinclude and config files to the main directory and do a make: </P>
310
311<UL><PRE>
312copy makefiles\Makefile.os2x Makefile
313make
314</PRE></UL>
315
316<H2>Internet Resources</H2>
317
318<P>FLTK is available on the 'net in a bunch of locations:</P>
319
320<DL>
321
322        <DT>WWW
323        <DD><A href="http://www.fltk.org/">http://www.fltk.org/</A>
324        <DD><A href="http://www.fltk.org/str.php">http://www.fltk.org/str.php</A>
325          [for reporting bugs]
326        <DD><A href="http://www.fltk.org/software.php">http://www.fltk.org/software.php</A>
327          [source code]
328
329        <DT>FTP
330        <DD><A HREF="http://ftp.easysw.com/pub/fltk">California, USA, (http://ftp.easysw.com)</A>
331        <DD><A HREF="ftp://ftp.easysw.com/pub/fltk">California, USA (ftp://ftp.easysw.com)</A>
332        <DD><A HREF="ftp://ftp2.easysw.com/pub/fltk">Maryland, USA (ftp2.easysw.com)</A>
333        <DD><A HREF="ftp://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/fltk">Espoo, Finland (ftp.funet.fi)</A>
334        <DD><A HREF="ftp://linux.mathematik.tu-darmstadt.de/pub/linux/mirrors/misc/fltk">Germany (linux.mathematik.tu-darmstadt.de)</A>
335        <DD><A HREF="ftp://gd.tuwien.ac.at/hci/fltk">Austria (gd.tuwien.ac.at)</A>
336
337        <DT>EMail</DT>
338        <DD><A href="mailto:fltk@fltk.org">fltk@fltk.org</A> [see
339        instructions below]
340        <DD><A href="mailto:fltk-bugs@fltk.org">fltk-bugs@fltk.org</A> [for
341        reporting bugs]
342
343        <DT>NNTP Newsgroups</DT>
344        <DD>news.easysw.com</DD>
345
346</DL>
347
348<P>To send a message to the FLTK mailing list
349(&quot;fltk@fltk.org&quot;) you  must first join the list.
350Non-member submissions are blocked to avoid  problems with
351unsolicited email.</P>
352
353<P>To join the FLTK mailing list, send a message to
354&quot;majordomo@fltk.org&quot; with &quot;subscribe fltk&quot;
355in the message body. A digest of this list is available by
356subscribing to the &quot;fltk-digest&quot; mailing list.</P>
357
358<H2>Reporting Bugs</H2>
359
360<P>To report a bug in FLTK, send an email to
361&quot;fltk-bugs@fltk.org&quot;. Please include the FLTK version,
362operating system &amp; version, and compiler that you are using
363when describing the bug or problem. We will be unable to provide
364any kind of help without that basic information.</P>
365
366<P>Bugs can also be reported to the "fltk.bugs" newsgroup or on the
367SourceForge bug tracker pages.</P>
368
369<P>For general support and questions, please use the FLTK mailing list
370at &quot;fltk@fltk.org&quot; or one of the newsgroups.</P>
371
372</BODY>
373</HTML>
Note: See TracBrowser for help on using the repository browser.