From 9584477b2684aa23db696645d541f2c06cac819d Mon Sep 17 00:00:00 2001 From: engelsman Date: Sat, 11 Oct 2008 12:46:11 +0000 Subject: more html to doxygen conversion for {osissues,migration*,development}.dox git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6410 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/development.dox | 66 ++++- documentation/migration_1_1.dox | 101 +++---- documentation/migration_1_3.dox | 4 +- documentation/osissues.dox | 606 +++++++++++++++++++++------------------- 4 files changed, 430 insertions(+), 347 deletions(-) (limited to 'documentation') diff --git a/documentation/development.dox b/documentation/development.dox index af5058215..f733438ae 100644 --- a/documentation/development.dox +++ b/documentation/development.dox @@ -2,8 +2,7 @@ \page development I - Developer Information -

This chapter describes FLTK development and documentation. -

+This chapter describes FLTK development and documentation. \note documentation with doxygen will be described here. @@ -247,6 +246,7 @@ The following section is \section development_links Creating Links \endcode + \section development_links Creating Links Links to other documents and external links can be embedded with @@ -341,6 +341,68 @@ becomes: \endcode + +\section development_paragraphs Paragraph Layout + +There is no real need to use HTML \ and \ tags within the text +to tell doxygen to start or stop a paragraph. In most cases, when doxygen +encounters a blank line or some, but not all, \b \\commands in the text it +knows that it as reached the start or end of a paragraph. Doxygen also +offers the \b \\par command for special paragraph handling. It can be used +to provide a paragraph title and also to indent a paragraph. Unfortunately +\b \\par won't do what you expect if you want to have doxygen links and +sometimes html tags don't work either. + + + \verbatim + \par Normal Paragraph with title + + This paragraph will have a title, but because there is a blank line + between the \par and the text, it will have the normal layout. + + \par Indented Paragraph with title + This paragraph will also have a title, but because there is no blank + line between the \par and the text, it will be indented. + + \par + It is also possible to have an indented paragraph without title. + This is how you indent subsequent paragraphs. + + \par No link to Fl_Widget::draw() + Note that the paragraph title is treated as plain text. + Doxygen type links will not work. + HTML characters and tags may or may not work. + + Fl_Widget::draw() links and "html" tags work
+ \par + Use a single line ending with
for complicated paragraph titles. + \endverbatim + +The above code produces the following paragraphs: + + \par Normal Paragraph with title + + This paragraph will have a title, but because there is a blank line + between the \\par and the text, it will have the normal layout. + + \par Indented Paragraph with title + This paragraph will also have a title, but because there is no blank + line between the \\par and the text, it will be indented. + + \par + It is also possible to have an indented paragraph without title. + This is how you indent subsequent paragraphs. + + \par No link to Fl_Widget::draw() + Note that the paragraph title is treated as plain text. + Doxygen type links will not work. + HTML characters and tags may or may not work. + + Fl_Widget::draw() links and "html" tags work
+ \par + Use a single line ending with \ for complicated paragraph titles. + + \section development_html_footer Hack for missing "tiny.gif" file \todo diff --git a/documentation/migration_1_1.dox b/documentation/migration_1_1.dox index 2f1533675..544532108 100644 --- a/documentation/migration_1_1.dox +++ b/documentation/migration_1_1.dox @@ -2,51 +2,52 @@ \page migration_1_1 G - Migrating Code from FLTK 1.0 to 1.1 -

This appendix describes the differences between the FLTK -1.0.x and FLTK 1.1.x functions and classes.

-

Color Values

+This appendix describes the differences between the FLTK +1.0.x and FLTK 1.1.x functions and classes. -

Color values are now stored in a 32-bit unsigned integer +\section migration_1_1_color Color Values + +Color values are now stored in a 32-bit unsigned integer instead of the unsigned character in 1.0.x. This allows for the specification of 24-bit RGB values or 8-bit FLTK color indices. -

FL_BLACK and FL_WHITE now remain black and +FL_BLACK and FL_WHITE now remain black and white, even if the base color of the gray ramp is changed using -Fl::background(). -FL_DARK3 and FL_LIGHT3 can be used instead to -draw a very dark or a very bright background hue.

+Fl::background(). +FL_DARK3 and FL_LIGHT3 can be used instead to +draw a very dark or a very bright background hue. -

Widgets use the new color symbols FL_FORGROUND_COLOR, -FL_BACKGROUND_COLOR, FL_BACKGROUND2_COLOR, -FL_INACTIVE_COLOR, and FL_SELECTION_COLOR. +Widgets use the new color symbols FL_FORGROUND_COLOR, +FL_BACKGROUND_COLOR, FL_BACKGROUND2_COLOR, +FL_INACTIVE_COLOR, and FL_SELECTION_COLOR. More details can be found in the chapter -Enumerations.

+Enumerations. -

Cut and Paste Support

+\section migration_1_1_cutnpaste Cut and Paste Support -

The FLTK clipboard is now broken into two parts - a local +The FLTK clipboard is now broken into two parts - a local selection value and a cut-and-paste value. This allows FLTK to support things like highlighting and replacing text that was previously cut or copied, which makes FLTK applications behave like traditional GUI applications. -

File Chooser

+\section migration_1_1_file_chooser File Chooser -

The file chooser in FLTK 1.1.x is significantly different +The file chooser in FLTK 1.1.x is significantly different than the one supplied with FLTK 1.0.x. Any code that directly -references the old FCB class or members will need -to be ported to the new Fl_File_Chooser -class.

+references the old FCB class or members will need +to be ported to the new +Fl_File_Chooser +class. -

Function Names

+\section migration_1_1_functions Function Names -

Some function names have changed from FLTK 1.0.x to 1.1.x in +Some function names have changed from FLTK 1.0.x to 1.1.x in order to avoid name space collisions. You can still use the old -function names by defining the FLTK_1_0_COMPAT +function names by defining the FLTK_1_0_COMPAT symbol on the command-line when you compile -(-DFLTK_1_0_COMPAT) or in your source, e.g.: +(-DFLTK_1_0_COMPAT) or in your source, e.g.: \code #define FLTK_1_0_COMPAT @@ -55,9 +56,10 @@ symbol on the command-line when you compile #include \endcode -

The following table shows the old and new function names:

+The following table shows the old and new function names: -
+
+
@@ -118,37 +120,40 @@ symbol on the command-line when you compile -
Old 1.0.x Name New 1.1.x Namenumericsort() fl_numericsort()
+ + -

Image Support

+\section migration_1_1_images Image Support -

Image support in FLTK has been significantly revamped in -1.1.x. The Fl_Image class +Image support in FLTK has been significantly revamped in +1.1.x. The Fl_Image class is now a proper base class, with the core image drawing -functionality in the Fl_Bitmap, Fl_Pixmap, and Fl_RGB_Image classes. - -

BMP, GIF, JPEG, PNG, XBM, and XPM image files can now be -loaded using the appropriate image classes, and the Fl_Shared_Image class -can be used to cache images in memory. - -

Image labels are no longer provided as an add-on label type. -If you use the old label() methods on an image, the -widget's image() method is called to set the image +functionality in the +Fl_Bitmap, +Fl_Pixmap, +and +Fl_RGB_Image +classes. + +BMP, GIF, JPEG, PNG, XBM, and XPM image files can now be +loaded using the appropriate image classes, and the +Fl_Shared_Image +class can be used to cache images in memory. + +Image labels are no longer provided as an add-on label type. +If you use the old label() methods on an image, the +widget's image() method is called to set the image as the label. -

Image labels in menu items must still use the old labeltype +Image labels in menu items must still use the old labeltype mechanism to preserve source compatibility. -

Keyboard Navigation

+\section migration_1_1_keyboard Keyboard Navigation -

FLTK 1.1.x now supports keyboard navigation and control with +FLTK 1.1.x now supports keyboard navigation and control with all widgets. To restore the old FLTK 1.0.x behavior so that only -text widgets get keyboard focus, call the Fl::visible_focus() +text widgets get keyboard focus, call the +Fl::visible_focus() method to disable it: \code diff --git a/documentation/migration_1_3.dox b/documentation/migration_1_3.dox index d22f1c439..b86c335c6 100644 --- a/documentation/migration_1_3.dox +++ b/documentation/migration_1_3.dox @@ -2,8 +2,8 @@ \page migration_1_3 H - Migrating Code from FLTK 1.1 to 1.3 -

This appendix describes the differences between the FLTK -1.1.x and FLTK 1.3.x functions and classes.

+This appendix describes the differences between the FLTK +1.1.x and FLTK 1.3.x functions and classes. If you want to migrate your code from FLTK 1.0 to FLTK 1.3, then you should also consult Appendix \ref migration_1_1. diff --git a/documentation/osissues.dox b/documentation/osissues.dox index 1b9d082f9..baf0e437a 100644 --- a/documentation/osissues.dox +++ b/documentation/osissues.dox @@ -2,107 +2,115 @@ \page osissues F - Operating System Issues -

This appendix describes the operating system specific interfaces in FLTK. +This appendix describes the operating system specific interfaces in FLTK. -

Accessing the OS Interfaces

+\section osissues_accessing Accessing the OS Interfaces -

All programs that need to access the operating system +All programs that need to access the operating system specific interfaces must include the following header file: \code #include \endcode -

Despite the name, this header file will define the +Despite the name, this header file will define the appropriate interface for your environment. The pages that follow describe the functionality that is provided for each operating system. -

+
+
-
WARNING: -

The interfaces provided by this header file may + The interfaces provided by this header file may change radically in new FLTK releases. Use them only when an existing generic FLTK interface is not - sufficient.

+ sufficient.
+ + -

The UNIX (X11) Interface

+\section osissues_unit The UNIX (X11) Interface -

The UNIX interface provides access to the X Window System +The UNIX interface provides access to the X Window System state information and data structures. -

Handling Other X Events

+\subsection osissues_x_events Handling Other X Events -

void Fl::add_handler(int (*f)(int))

+ +void Fl::add_handler(int (*f)(int)) -

Installs a function to parse unrecognized events. If FLTK +Installs a function to parse unrecognized events. If FLTK cannot figure out what to do with an event, it calls each of these functions (most recent first) until one of them returns non-zero. If none of them returns non-zero then the event is ignored. -

FLTK calls this for any X events it does not recognize, or X +FLTK calls this for any X events it does not recognize, or X events with a window ID that FLTK does not recognize. You can -look at the X event in the fl_xevent variable.

+look at the X event in the +fl_xevent variable. -

The argument is the FLTK event type that was not handled, or +The argument is the FLTK event type that was not handled, or zero for unrecognized X events. These handlers are also called for global shortcuts and some other events that the widget they were passed to did not handle, for example -FL_SHORTCUT.

+FL_SHORTCUT. -

extern XEvent *fl_xvent

+ +extern XEvent *fl_xvent -

This variable contains the most recent X event. +This variable contains the most recent X event. -

extern ulong fl_event_time

+ +extern ulong fl_event_time -

This variable contains the time stamp from the most recent X +This variable contains the time stamp from the most recent X event that reported it; not all events do. Many X calls like cut and paste need this value. -

Window fl_xid(const Fl_Window *)

+ +Window fl_xid(const Fl_Window *) -

Returns the XID for a window, or zero if not shown(). +Returns the XID for a window, or zero if not shown(). -

Fl_Window *fl_find(ulong xid)

+ +Fl_Window *fl_find(ulong xid) -

Returns the Fl_Window that corresponds to the given -XID, or NULL if not found. This function uses a cache +Returns the Fl_Window that corresponds to the given +XID, or NULL if not found. This function uses a cache so it is slightly faster than iterating through the windows -yourself.

+yourself. -

int fl_handle(const XEvent &)

+ +int fl_handle(const XEvent &) -

This call allows you to supply the X events to FLTK, which +This call allows you to supply the X events to FLTK, which may allow FLTK to cooperate with another toolkit or library. The return value is non-zero if FLTK understood the event. If the -window does not belong to FLTK and the add_handler() +window does not belong to FLTK and the add_handler() functions all return 0, this function will return false. -

Besides feeding events your code should call Fl::flush() -periodically so that FLTK redraws its windows.

+Besides feeding events your code should call +Fl::flush() +periodically so that FLTK redraws its windows. -

This function will call the callback functions. It will not +This function will call the callback functions. It will not return until they complete. In particular, if a callback pops up -a modal window by calling fl_ask(), for -instance, it will not return until the modal function -returns.

+a modal window by calling +fl_ask(), +for instance, it will not return until the modal function +returns. -

Drawing using Xlib

+\subsection osissues_drawing_xlib Drawing using Xlib -

The following global variables are set before Fl_Widget::draw() is -called, or by Fl_Window::make_current(): +The following global variables are set before +Fl_Widget::draw() +is called, or by +Fl_Window::make_current(): \code extern Display *fl_display; @@ -113,108 +121,120 @@ extern XVisualInfo *fl_visual; extern Colormap fl_colormap; \endcode -

You must use them to produce Xlib calls. Don't attempt to change +You must use them to produce Xlib calls. Don't attempt to change them. A typical X drawing call is written like this: \code XDrawSomething(fl_display, fl_window, fl_gc, ...); \endcode -

Other information such as the position or size of the X -window can be found by looking at Fl_Window::current(), -which returns a pointer to the Fl_Window being drawn. +Other information such as the position or size of the X +window can be found by looking at +Fl_Window::current(), +which returns a pointer to the Fl_Window being drawn. -

unsigned long fl_xpixel(Fl_Color i)
-unsigned long fl_xpixel(uchar r, uchar g, uchar b)

+ +unsigned long fl_xpixel(Fl_Color i)
+unsigned long fl_xpixel(uchar r, uchar g, uchar b) -

Returns the X pixel number used to draw the given FLTK color -index or RGB color. This is the X pixel that fl_color() would use. +Returns the X pixel number used to draw the given FLTK color +index or RGB color. This is the X pixel that +fl_color() would use. -

int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b)

+ +int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) -

Convert a name into the red, green, and blue values of a color +Convert a name into the red, green, and blue values of a color by parsing the X11 color names. On other systems, fl_parse_color can only convert names in hexadecimal encoding, for example \#ff8083. -

extern XFontStruct *fl_xfont

- -

Points to the font selected by the most recent fl_font(). This is not -necessarily the current font of fl_gc, which is not set -until fl_draw() is -called. If FLTK was compiled with Xft support, fl_xfont -will usually be 0 and fl_xftfont will contain a pointer + +extern XFontStruct *fl_xfont + +Points to the font selected by the most recent +fl_font(). +This is not necessarily the current font of fl_gc, +which is not set until +fl_draw() +is called. If FLTK was compiled with Xft support, fl_xfont +will usually be 0 and fl_xftfont will contain a pointer to the XftFont structure instead. -

extern void *fl_xftfont

+ +extern void *fl_xftfont -

If FLTK was compiled with Xft support enabled, fl_xftfont -Points to the xft font selected by the most recent fl_font(). Otherwise -it will be 0. fl_xftfont should be cast to +If FLTK was compiled with Xft support enabled, fl_xftfont +Points to the xft font selected by the most recent +fl_font(). +Otherwise it will be 0. fl_xftfont should be cast to XftFont*. -

Changing the Display, Screen, or X Visual

+\subsection osissues_xvisual Changing the Display, Screen, or X Visual -

FLTK uses only a single display, screen, X visual, and X +FLTK uses only a single display, screen, X visual, and X colormap. This greatly simplifies its internal structure and makes it much smaller and faster. You can change which it uses by setting global variables before the first -Fl_Window::show() is called. You may also want to -call Fl::visual(), which is -a portable interface to get a full color and/or double buffered +Fl_Window::show() is called. You may also want to call +Fl::visual(), +which is a portable interface to get a full color and/or double buffered visual. -

int Fl::display(const char *)

+ +int Fl::display(const char *) -

Set which X display to use. This actually does -putenv("DISPLAY=...") so that child programs -will display on the same screen if called with exec(). +Set which X display to use. This actually does +putenv("DISPLAY=...") so that child programs +will display on the same screen if called with exec(). This must be done before the display is opened. This call is provided under MacOS and WIN32 but it has no effect. -

extern Display *fl_display

+ +extern Display *fl_display -

The open X display. This is needed as an argument to most -Xlib calls. Don't attempt to change it! This is NULL +The open X display. This is needed as an argument to most +Xlib calls. Don't attempt to change it! This is NULL before the display is opened. -

void fl_open_display()

+ +void fl_open_display() -

Opens the display. Does nothing if it is already open. This -will make sure fl_display is non-zero. You should call +Opens the display. Does nothing if it is already open. This +will make sure fl_display is non-zero. You should call this if you wish to do X calls and there is a chance that your -code will be called before the first show() of a +code will be called before the first show() of a window. -

This may call Fl::abort() if there is an error -opening the display.

+This may call Fl::abort() if there is an error +opening the display. -

void fl_close_display()

+ +void fl_close_display() -

This closes the X connection. You do not need to call +This closes the X connection. You do not need to call this to exit, and in fact it is faster to not do so! It may be useful to call this if you want your program to continue without the X connection. You cannot open the display again, and probably cannot call any FLTK functions. -

extern int fl_screen

+ +extern int fl_screen -

Which screen number to use. This is set by -fl_open_display() to the default screen. You can change +Which screen number to use. This is set by +fl_open_display() to the default screen. You can change it by setting this to a different value immediately afterwards. It can also be set by changing the last number in the -Fl::display() string to "host:0.#". +Fl::display() string to "host:0.#". -

extern XVisualInfo *fl_visual
-extern Colormap fl_colormap

+ +extern XVisualInfo *fl_visual
+ +extern Colormap fl_colormap -

The visual and colormap that FLTK will use for all windows. -These are set by fl_open_display() to the default +The visual and colormap that FLTK will use for all windows. +These are set by fl_open_display() to the default visual and colormap. You can change them before calling -show() on the first window. Typical code for changing +show() on the first window. Typical code for changing the default visual is: \code @@ -227,30 +247,30 @@ fl_colormap = make_a_colormap(fl_display, fl_visual->visual, fl_visual->depth); window->show(argc, argv); \endcode -

Using a Subclass of Fl_Window for Special X Stuff

+\subsection osissues_specialx Using a Subclass of Fl_Window for Special X Stuff -

FLTK can manage an X window on a different screen, visual +FLTK can manage an X window on a different screen, visual and/or colormap, you just can't use FLTK's drawing routines to -draw into it. But you can write your own draw() method +draw into it. But you can write your own draw() method that uses Xlib (and/or OpenGL) calls only. -

FLTK can also manage XID's provided by other libraries or +FLTK can also manage XID's provided by other libraries or programs, and call those libraries when the window needs to be -redrawn.

+redrawn. -

To do this, you need to make a subclass of Fl_Window and -override some of these virtual functions:

+To do this, you need to make a subclass of +Fl_Window +and override some of these virtual functions: -

virtual void Fl_Window::show()

+virtual void Fl_Window::show() -

If the window is already shown() this must cause it +If the window is already shown() this must cause it to be raised, this can usually be done by calling -Fl_Window::show(). If not shown() your -implementation must call either Fl_X::set_xid() or -Fl_X::make_xid(). +Fl_Window::show(). If not shown() your +implementation must call either Fl_X::set_xid() or +Fl_X::make_xid(). -

An example:

+An example: \code void MyWindow::show() { @@ -268,44 +288,43 @@ void MyWindow::show() { } \endcode -

Fl_X *Fl_X::set_xid(Fl_Window *, Window xid)

+Fl_X *Fl_X::set_xid(Fl_Window *, Window xid) -

Allocate a hidden structure called an Fl_X, put the +Allocate a hidden structure called an Fl_X, put the XID into it, and set a pointer to it from the -Fl_Window. This causes Fl_Window::shown() to +Fl_Window. This causes Fl_Window::shown() to return true. -

void Fl_X::make_xid(Fl_Window *, XVisualInfo *= fl_visual, -Colormap = fl_colormap)

+void Fl_X::make_xid(Fl_Window *, XVisualInfo *= fl_visual, Colormap = fl_colormap) -

This static method does the most onerous parts of creating an +This static method does the most onerous parts of creating an X window, including setting the label, resize limitations, etc. -It then does Fl_X::set_xid() with this new window and +It then does Fl_X::set_xid() with this new window and maps the window. -

virtual void Fl_Window::flush()

+virtual void Fl_Window::flush() -

This virtual function is called by Fl::flush() to +This virtual function is called by Fl::flush() to update the window. For FLTK's own windows it does this by -setting the global variables fl_window and -fl_gc and then calling the draw() method. For +setting the global variables fl_window and +fl_gc and then calling the draw() method. For your own windows you might just want to put all the drawing code in here. -

The X region that is a combination of all damage() -calls done so far is in Fl_X::i(this)->region. If -NULL then you should redraw the entire window. The -undocumented function fl_clip_region(XRegion) will -initialize the FLTK clip stack with a region or NULL -for no clipping. You must set region to NULL afterwards -as fl_clip_region() will own and delete it when -done.

+The X region that is a combination of all damage() +calls done so far is in Fl_X::i(this)->region. If +NULL then you should redraw the entire window. The +undocumented function fl_clip_region(XRegion) will +initialize the FLTK clip stack with a region or NULL +for no clipping. You must set region to NULL afterwards +as fl_clip_region() will own and delete it when +done. -

If damage() & FL_DAMAGE_EXPOSE then only X +If damage() & FL_DAMAGE_EXPOSE then only X expose events have happened. This may be useful if you have an -undamaged image (such as a backing buffer) around.

+undamaged image (such as a backing buffer) around. -

Here is a sample where an undamaged image is kept somewhere:

+Here is a sample where an undamaged image is kept somewhere: \code void MyWindow::flush() { @@ -316,12 +335,12 @@ void MyWindow::flush() { } \endcode -

virtual void Fl_Window::hide()

+virtual void Fl_Window::hide() -

Destroy the window server copy of the window. Usually you +Destroy the window server copy of the window. Usually you will destroy contexts, pixmaps, or other resources used by the -window, and then call Fl_Window::hide() to get rid of -the main window identified by xid(). If you override +window, and then call Fl_Window::hide() to get rid of +the main window identified by xid(). If you override this, you must also override the destructor as shown: \code @@ -334,11 +353,11 @@ void MyWindow::hide() { } \endcode -

virtual void Fl_Window::~Fl_Window()

+virtual void Fl_Window::~Fl_Window() -

Because of the way C++ works, if you override hide() +Because of the way C++ works, if you override hide() you must override the destructor as well (otherwise only -the base class hide() is called): +the base class hide() is called): \code MyWindow::~MyWindow() { @@ -346,15 +365,15 @@ MyWindow::~MyWindow() { } \endcode -

Setting the Icon of a Window

+\subsection osissues_x_icon Setting the Icon of a Window -

FLTK currently supports setting a window's icon before it -is shown using the Fl_Window::icon() method. +FLTK currently supports setting a window's icon before it +is shown using the Fl_Window::icon() method. -

void Fl_Window::icon(char *)

+void Fl_Window::icon(char *) -

Sets the icon for the window to the passed pointer. You will -need to cast the icon Pixmap to a char * when +Sets the icon for the window to the passed pointer. You will +need to cast the icon Pixmap to a char * when calling this method. To set a monochrome icon using a bitmap compiled with your application use: @@ -369,7 +388,7 @@ Pixmap p = XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display), window->icon((char *)p); \endcode -

To use a multi-colored icon, the XPM format and library +To use a multi-colored icon, the XPM format and library should be used as follows: \code @@ -386,122 +405,122 @@ XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), window->icon((char *)p); \endcode -

When using the Xpm library, be sure to include it in the list -of libraries that are used to link the application (usually -"-lXpm").

+When using the Xpm library, be sure to include it in the list +of libraries that are used to link the application (usually "-lXpm"). -
+
+
-
NOTE: -

You must call Fl_Window::show(argc, - argv) for the icon to be used. The - Fl_Window::show() method does not bind the icon + You must call Fl_Window::show(argc, + argv) for the icon to be used. The + Fl_Window::show() method does not bind the icon to the window.

+ + -

X Resources

+\subsection osissues_xresources X Resources -

When the Fl_Window::show(argc, -argv) method is called, FLTK looks for the following X -resources: +When the +Fl_Window::show(argc, argv) +method is called, FLTK looks for the following X resources: -

- -

Resources associated with the first window's Fl_Window::xclass() +Resources associated with the first window's +Fl_Window::xclass() string are queried first, or if no class has been specified then -the class "fltk" is used (e.g. fltk.background). If no +the class "fltk" is used (e.g. fltk.background). If no match is found, a global search is done (e.g. -*background). +*background). -

The Windows (WIN32) Interface

+\section osissues_win32 The Windows (WIN32) Interface -

The Windows interface provides access to the WIN32 GDI +The Windows interface provides access to the WIN32 GDI state information and data structures. -

Handling Other WIN32 Messages

+\subsection osissues_win32_messages Handling Other WIN32 Messages -

By default a single WNDCLASSEX called "FLTK" is -created. All Fl_Window's are of this class unless you -use Fl_Window::xclass(). The window class is created -the first time Fl_Window::show() is called. +By default a single WNDCLASSEX called "FLTK" is +created. All Fl_Window's are of this class unless you +use Fl_Window::xclass(). The window class is created +the first time Fl_Window::show() is called. -

You can probably combine FLTK with other libraries that make +You can probably combine FLTK with other libraries that make their own WIN32 window classes. The easiest way is to call -Fl::wait(), as it will call DispatchMessage +Fl::wait(), as it will call DispatchMessage for all messages to the other windows. If necessary you can let the other library take over as long as it calls -DispatchMessage(), but you will have to arrange for the -function Fl::flush() to be called regularly so that +DispatchMessage(), but you will have to arrange for the +function Fl::flush() to be called regularly so that widgets are updated, timeouts are handled, and the idle -functions are called.

+functions are called. -

extern MSG fl_msg

+ +extern MSG fl_msg -

This variable contains the most recent message read by -GetMessage, which is called by Fl::wait(). This may not be the +This variable contains the most recent message read by +GetMessage, which is called by Fl::wait(). This may not be the most recent message sent to an FLTK window, because silly WIN32 calls the handle procedures directly for some events (sigh). -

void Fl::add_handler(int (*f)(int))

+ +void Fl::add_handler(int (*f)(int)) -

Installs a function to parse unrecognized messages sent to +Installs a function to parse unrecognized messages sent to FLTK windows. If FLTK cannot figure out what to do with a message, it calls each of these functions (most recent first) until one of them returns non-zero. The argument passed to the functions is the FLTK event that was not handled or zero for unknown messages. If all the handlers return zero then FLTK -calls DefWindowProc(). +calls DefWindowProc(). -

HWND fl_xid(const Fl_Window *)

+ +HWND fl_xid(const Fl_Window *) -

Returns the window handle for a Fl_Window, or zero -if not shown(). +Returns the window handle for a Fl_Window, or zero +if not shown(). -

Fl_Window *fl_find(HWND xid)

+ +Fl_Window *fl_find(HWND xid) -

Returns the Fl_Window that corresponds to the given -window handle, or NULL if not found. This function uses +Returns the Fl_Window that corresponds to the given +window handle, or NULL if not found. This function uses a cache so it is slightly faster than iterating through the windows yourself. -

Drawing Things Using the WIN32 GDI

+ +\subsection osissues_win32_gdi Drawing Things Using the WIN32 GDI -

When the virtual function Fl_Widget::draw() is +When the virtual function +Fl_Widget::draw() is called, FLTK stores all the silly extra arguments you need to make a proper GDI call in some global variables: @@ -514,12 +533,11 @@ HPEN fl_pen(); HBRUSH fl_brush(); \endcode -

These global variables are set before draw() is -called, or by Fl_Window::make_current(). +These global variables are set before draw() is called, or by +Fl_Window::make_current(). You can refer to them when needed to produce GDI calls, but don't attempt to change them. The functions return GDI objects for -the current color set by fl_color() and are created as +the current color set by fl_color() and are created as needed and cached. A typical GDI drawing call is written like this: @@ -527,19 +545,19 @@ this: DrawSomething(fl_gc, ..., fl_brush()); \endcode -

It may also be useful to refer to Fl_Window::current() +It may also be useful to refer to +Fl_Window::current() to get the window's size or position. -

Setting the Icon of a Window

+\subsection osissues_icon_windows Setting the Icon of a Window -

FLTK currently supports setting a window's icon *before* it -is shown using the Fl_Window::icon() method. +FLTK currently supports setting a window's icon *before* it +is shown using the Fl_Window::icon() method. -

void Fl_Window::icon(char *)

+void Fl_Window::icon(char *) -

Sets the icon for the window to the passed pointer. You will -need to cast the HICON handle to a char * when +Sets the icon for the window to the passed pointer. You will +need to cast the HICON handle to a char * when calling this method. To set the icon using an icon resource compiled with your application use: @@ -547,55 +565,55 @@ compiled with your application use: window->icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON))); \endcode -

You can also use the LoadImage() and related +You can also use the LoadImage() and related functions to load specific resolutions or create the icon from bitmap data. -

+
+
-
NOTE: -

You must call Fl_Window::show(argc, - argv) for the icon to be used. The - Fl_Window::show() method does not bind the icon + You must call Fl_Window::show(argc, + argv) for the icon to be used. The + Fl_Window::show() method does not bind the icon to the window.

+ + -

How to Not Get a MSDOS Console Window

+\subsection osissues_msdos_console How to Not Get a MSDOS Console Window -

WIN32 has a really stupid mode switch stored in the +WIN32 has a really stupid mode switch stored in the executables that controls whether or not to make a console window. -

To always get a console window you simply create a console +To always get a console window you simply create a console application (the "/SUBSYSTEM:CONSOLE" option for the linker). For a GUI-only application create a WIN32 application -(the "/SUBSYSTEM:WINDOWS" option for the linker).

+(the "/SUBSYSTEM:WINDOWS" option for the linker). -

FLTK includes a WinMain() function that calls the -ANSI standard main() entry point for you. This +FLTK includes a WinMain() function that calls the +ANSI standard main() entry point for you. This function creates a console window when you use the debug version -of the library.

+of the library. -

WIN32 applications without a console cannot write to -stdout or stderr, even if they are run from a +WIN32 applications without a console cannot write to +stdout or stderr, even if they are run from a console window. Any output is silently thrown away. Additionally, WIN32 applications are run in the background by the console, although you can use "start /wait program" to run -them in the foreground.

+them in the foreground. -

Known WIN32 Bugs and Problems

+\subsection osissues_win32_problems Known WIN32 Bugs and Problems -

The following is a list of known bugs and problems in the WIN32 +The following is a list of known bugs and problems in the WIN32 version of FLTK: -

+ in STR#1656 -

The MacOS Interface

+\subject osissues_macos The MacOS Interface -

FLTK supports MacOS X using the Apple Carbon library. Older +FLTK supports MacOS X using the Apple Carbon library. Older versions of MacOS are not supported. -

Control, Option, and Command Modifier Keys

+\par Control, Option, and Command Modifier Keys -

FLTK maps the Mac 'control' key to FL_CTRL, the -'option' key to FL_ALT and the 'Apple' key to -FL_META. Keyboard events return the key name in -Fl::event_key() and the keystroke translation in -Fl::event_text(). For example, typing Option-Y on a Mac -keyboard will set FL_ALT in Fl::event_state(), -set Fl::event_key() to 'y' and return the Yen symbol in -Fl::event_text(). +FLTK maps the Mac 'control' key to FL_CTRL, the +'option' key to FL_ALT and the 'Apple' key to +FL_META. Keyboard events return the key name in +Fl::event_key() and the keystroke translation in +Fl::event_text(). For example, typing Option-Y on a Mac +keyboard will set FL_ALT in Fl::event_state(), +set Fl::event_key() to 'y' and return the Yen symbol in +Fl::event_text(). -

WindowRef fl_xid(const Fl_Window *)

+WindowRef fl_xid(const Fl_Window *) -

Returns the window reference for an Fl_Window, or -NULL if the window has not been shown. +Returns the window reference for an Fl_Window, or +NULL if the window has not been shown. -

Fl_Window *fl_find(WindowRef xid)

+Fl_Window *fl_find(WindowRef xid) -

Returns the Fl_Window that corresponds to the give -window handle, or NULL if not found. FLTK windows that +Returns the Fl_Window that corresponds to the give +window handle, or NULL if not found. FLTK windows that are children of top-level windows share the WindowRef of the top-level window. -

Apple "Quit" Event

+\subsection osissues_apple_quit Apple "Quit" Event -

When the user press Cmd-Q or requests a termination of the +When the user press Cmd-Q or requests a termination of the application, OS X will send a "Quit" Apple Event. FLTK handles this event by sending an FL_CLOSE event to all open windows. If all windows close, the application will terminate. -

Apple "Open" Event

+\subsection osissues_apple_open Apple "Open" Event Whenever the user drops a file onto an application icon, OS X generates an Apple Event of the type "Open". You can have FLTK notify you of an Open event by setting the fl_open_callback. -

void fl_open_callback(void (*cb)(const char *))

+ +void fl_open_callback(void (*cb)(const char *)) cb will be called with a single iUnix-style file name and path. If multiple files were dropped, fl_open_callback will be called multiple times. -

Drawing Things Using QuickDraw

+\subsection osissues_quickdraw Drawing Things Using QuickDraw -

When the virtual function Fl_Widget::draw() is +When the virtual function Fl_Widget::draw() is called, FLTK has prepared the Window and CGrafPort for drawing. Clipping and offsets are prepared to allow correct subwindow drawing. -

Drawing Things Using Quartz

+\subsection osissues_quartz Drawing Things Using Quartz -

If the FLTK library was compiled using the configuration +If the FLTK library was compiled using the configuration flag --enable-quartz, all code inside Fl_Widget::draw() is expected to call Quartz drawing functions instead of QuickDraw. The Quartz coordinate system is flipped to match FLTK's coordinate system. The origin for all drawing is in the top left corner of the enclosing Fl_Window. -

Fl_Double_Window

+Fl_Double_Window -

OS X double-buffers all windows automatically. On OS X, +OS X double-buffers all windows automatically. On OS X, Fl_Window and Fl_Double_Window are handled internally in the same way. -

Mac File System Specifics

+\subsection osissues_mac_files Mac File System Specifics -

Resource Forks

+\par Resource Forks -

FLTK does not access the resource fork of an application. +FLTK does not access the resource fork of an application. However, a minimal resource fork must be created for OS X applications -

+
+
Caution: -

When using UNIX commands to copy or move executables, OS X +When using UNIX commands to copy or move executables, OS X will NOT copy any resource forks! For copying and moving use CpMac and MvMac respectively. For creating a tar archive, all executables need to be stripped from their Resource Fork before packing, e.g. "DeRez fluid > fluid.r". After unpacking the Resource Fork needs to be reattached, e.g. "Rez fluid.r -o fluid". -

+ + -

It is advisable to use the Finder for moving and copying and +It is advisable to use the Finder for moving and copying and Mac archiving tools like Sit for distribution as they will handle the Resource Fork correctly. -

Mac File Paths

+\par Mac File Paths -

FLTK uses UNIX-style filenames and paths. +FLTK uses UNIX-style filenames and paths. -

Known MacOS Bugs and Problems

+\subsection osissues_macos_problems Known MacOS Bugs and Problems -

The following is a list of known bugs and problems in the +The following is a list of known bugs and problems in the MacOS version of FLTK: -

+ Fl_Window inside a Fl_Window.
[Index]    -- cgit v1.2.3