From 054d25081a74d504eb38042ffbd9acf70be4de1d Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 13 Sep 2008 13:28:51 +0000 Subject: documentation/preface.dox re-added, with history (preface.html) documentation/index.dox re-added, with history (index.html) documentation/advanced.dox added, copied from advanced.html git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6223 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/advanced.dox | 90 ++++++++++++++++++++++++++++++++++++++ documentation/index.dox | 103 +++++++++++++++++++++++++++++++++++++++++++ documentation/preface.dox | 107 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 300 insertions(+) create mode 100644 documentation/advanced.dox create mode 100644 documentation/index.dox create mode 100644 documentation/preface.dox (limited to 'documentation') diff --git a/documentation/advanced.dox b/documentation/advanced.dox new file mode 100644 index 000000000..4e4aeeffb --- /dev/null +++ b/documentation/advanced.dox @@ -0,0 +1,90 @@ +/** + + \page advanced 10 - Advanced FLTK + +

This chapter explains advanced programming and design topics +that will help you to get the most out of FLTK.

+ +

Multithreading

+ +

FLTK supports multithreaded application using a locking mechanism based on "pthreads". We do not provide a threading interface as part of the library. However a simple example how threads can be implemented for all supported platforms can be found in test/threads.h and test/threads.cxx. + +

To use the locking mechanism, FLTK must be compiled with --enable-threads set during the configure process. IDE-based versions of FLTK are automatically compiled with locking enabled if possible. + +

In main(), call Fl::lock() before Fl::run() or Fl::wait() to start the runtime multithreading support for your program. All callbacks and derived functions like handle() and draw() will now be properly locked:

+ +
+    int main() {
+      Fl::lock();
+      /* run thread */
+      while (Fl::wait() > 0) {
+        if (Fl::thread_message()) {
+          /* process your data */
+        }
+      }
+    }
+
+ +

You can now start as many threads as you like. From within +a thread (other than the main thread) FLTK calls must be wrapped +with calls to Fl::lock() +and Fl::unlock(): + +

+    Fl::lock();      // avoid conflicting calls
+    ...              // your code here
+    Fl::unlock();    // allow other threads to access FLTK again
+
+ +

You can send messages from child threads to the main thread +using Fl::awake(msg):

+ +
+    void *msg;       // "msg" is a pointer to your message
+    Fl::awake(msg);  // send "msg" to main thread
+
+ +

You can also tell the main thread to call a function for you +as soon as possible by using +Fl::awake(callback, userdata):

+ +
+    void do_something(void *userdata) {
+      // running with the main thread
+    }
+
+    // running in another thread
+    void *data;       // "data" is a pointer to your user data
+    Fl::awake(do_something, data);  // call something in main thread
+
+ + +

FLTK supports multiple platforms, some of them which do not +allow any other but the main thread to handle system events and +open or close windows. The safe thing to do is to adhere to the +following rules for threads on all operating systems: + +

+ +

See also: +void awake(void *message), +void lock(), +void *thread_message(), +void unlock(). + +*/ diff --git a/documentation/index.dox b/documentation/index.dox new file mode 100644 index 000000000..8253ce735 --- /dev/null +++ b/documentation/index.dox @@ -0,0 +1,103 @@ +/** + +\mainpage FLTK Programming Manual + + + + + + + + +
+ \image html FL200.gif + +

FLTK 1.3.0 Programming Manual

+

Revision 8 by Michael Sweet, Craig P. Earls,
Matthias Melcher, and Bill Spitzak
+ Copyright 1998-2008 by Bill Spitzak and others.

+
This software and manual are provided under the terms of the GNU Library General Public License. Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.
+ + + + + + +
+ \subpage preface + +
+
+ 1 - Introduction to FLTK +
+
+ 2 - FLTK Basics +
+
+ 3 - Common Widgets and Attributes + + 4 - Designing a Simple Text Editor +
+
+ 5 - Drawing Things in FLTK +
+
+ 6 - Handling Events + + 7 - Adding and Extending + Widgets +
+
+ 8 - Using OpenGL +
+ 9 - Programming with FLUID + + + \subpage advanced + +
+
+ A - Class Reference +
+
+ B - Function Reference +
+
+ C - FLTK Enumerations.H + +
+
+ D - GLUT Compatibility + + E - Forms Compatibility +
+
+ F - Operating System Issues +
+
+ G - Migrating Code from FLTK 1.0.x +
+
+ H - Software License +
+
+ I - Example Source Code +
+ +*/ + + diff --git a/documentation/preface.dox b/documentation/preface.dox new file mode 100644 index 000000000..78fca2128 --- /dev/null +++ b/documentation/preface.dox @@ -0,0 +1,107 @@ +/** + + \page preface Preface + +

This manual describes the Fast Light Tool Kit ("FLTK") +version 1.3.0, a C++ Graphical User Interface +("GUI") toolkit for UNIX, Microsoft Windows and MacOS. Each +of the chapters in this manual is designed as a tutorial for +using FLTK, while the appendices provide a convenient reference +for all FLTK widgets, functions, and operating system +interfaces.

+ +

This manual may be printed, modified, and/or used under +the terms of the FLTK license provided in Appendix A. + +

Organization

+ +

This manual is organized into the following chapters and appendices:

+ + + +

Conventions

+ +

The following typeface conventions are used in this manual:

+ + + +

Abbreviations

+ +

The following abbreviations are used in this manual:

+ +
+ +
X11
+
The X Window System version 11.
+ +
Xlib
+
The X Window System interface library.
+ +
WIN32
+
The Microsoft Windows 32-bit Application Programmer's Interface.
+ +
MacOS
+
The Apple Macintosh OS 8.6 and later, including OS X.
+ +
+ +

Copyrights and Trademarks

+ +

FLTK is Copyright 1998-2006 by Bill Spitzak and others. Use and +distribution of FLTK is governed by the GNU Library General Public +License, located in Appendix H.

+ +

UNIX is a registered trademark of the X Open Group, Inc. +Microsoft and Windows are registered trademarks of Microsoft +Corporation. OpenGL is a registered trademark of Silicon +Graphics, Inc. Apple, Macintosh, MacOS, and Mac OS X are +registered trademarks of Apple Computer, Inc.

+ +*/ -- cgit v1.2.3