Finish removing of #include of driver files, remove FL_LIBRARY_CMAKE.

Now all graphics drivers are compiled as individual files depending
on the platform and configuration. The preprocessor macro FL_LIBRARY_CMAKE
is now obsolete and has been removed.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11093 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2016-01-31 01:14:50 +00:00
parent 5c32d3b24c
commit 642187dc1c
5 changed files with 28 additions and 166 deletions

View File

@ -265,14 +265,6 @@ set(CFILES
fl_utf.c
)
# Add preprocessor macro FL_LIBRARY_CMAKE temporarily until the build
# system transition is completed.
# *** currently LINUX only ***
if (UNIX)
add_definitions(-DFL_LIBRARY_CMAKE)
endif (UNIX)
add_definitions(-DFL_LIBRARY)
if(APPLE AND NOT OPTION_APPLE_X11)

View File

@ -23,53 +23,25 @@
// Implementation of fl_color(i), fl_color(r,g,b).
# include <FL/Fl.H>
#include <FL/Fl.H>
#include <FL/Fl_Device.H>
#include <FL/Fl.H>
#include <config.h>
#include "config_lib.h"
// fl_cmap needs to be defined *before* we include Fl_GDI_Graphics_Driver_color.cxx
// fl_cmap needs to be defined globally (here) and is used in the device
// specific graphics drivers
/** \addtogroup fl_attributes
@{ */
/* static */
unsigned fl_cmap[256] = {
#include "fl_cmap.h" // this is a file produced by "cmap.cxx":
};
// Remove #ifndef FL_LIBRARY_CMAKE and the entire block of #include
// statements when the new build system is ready:
#ifndef FL_LIBRARY_CMAKE
// -----------------------------------------------------------------------------
// all driver code is now in drivers/XXX/Fl_XXX_Graphics_Driver_xyz.cxx
// -----------------------------------------------------------------------------
// Apple Quartz driver in "drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx"
#ifdef FL_CFG_GFX_GDI
// # include "drivers/GDI/Fl_GDI_Graphics_Driver_color.cxx"
#endif
// -----------------------------------------------------------------------------
#ifdef FL_CFG_GFX_XLIB
// # include "drivers/Xlib/Fl_Xlib_Graphics_Driver_color.cxx"
#endif
// -----------------------------------------------------------------------------
#endif // FL_LIBRARY_CMAKE
// -----------------------------------------------------------------------------
/** \addtogroup fl_attributes
@{ */
/**
Returns the RGB value(s) for the given FLTK color index.
@ -83,22 +55,25 @@ unsigned Fl::get_color(Fl_Color i) {
if (i & 0xffffff00) return (i);
else return fl_cmap[i];
}
/**
Sets an entry in the fl_color index table. You can set it to
any 8-bit RGB color. The color is not allocated until fl_color(i)
is used.
Sets an entry in the fl_color index table.
You can set it to any 8-bit RGB color. The color is not allocated
until fl_color(i) is used.
*/
void Fl::set_color(Fl_Color i, uchar red, uchar green, uchar blue) {
Fl::set_color((Fl_Color)(i & 255),
((unsigned)red<<24)+((unsigned)green<<16)+((unsigned)blue<<8));
}
/**
Returns the RGB value(s) for the given FLTK color index.
This form returns the red, green, and blue values
separately in referenced variables.
See also unsigned get_color(Fl_Color c)
\see unsigned get_color(Fl_Color c)
*/
void Fl::get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue) {
unsigned c;
@ -113,6 +88,7 @@ void Fl::get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue) {
/**
Returns the weighted average color between the two given colors.
The red, green and blue values are averages using the following formula:
\code
color = color1 * weight + color2 * (1 - weight)
@ -141,7 +117,7 @@ Fl_Color fl_color_average(Fl_Color color1, Fl_Color color2, float weight) {
}
/**
Returns the inactive, dimmed version of the given color
Returns the inactive, dimmed version of the given color.
*/
Fl_Color fl_inactive(Fl_Color c) {
return fl_color_average(c, FL_GRAY, .33f);
@ -149,6 +125,7 @@ Fl_Color fl_inactive(Fl_Color c) {
/**
Returns a color that contrasts with the background color.
This will be the foreground color if it contrasts sufficiently with the
background color. Otherwise, returns \p FL_WHITE or \p FL_BLACK depending
on which color provides the best contrast.
@ -159,7 +136,6 @@ Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg) {
unsigned c1, c2; // RGB colors
int l1, l2; // Luminosities
// Get the RGB values for each color...
if (fg & 0xffffff00) c1 = (unsigned)fg;
else c1 = fl_cmap[fg];

View File

@ -21,52 +21,15 @@
\brief Line style drawing utility hiding different platforms.
*/
#include "config_lib.h"
#include <FL/Fl.H>
#include <FL/fl_draw.H>
#include <FL/x.H>
#include <FL/Fl_Printer.H>
#include "flstring.h"
#include <stdio.h>
// We save the current line width (absolute value) here.
// This is currently used only for X11 clipping, see src/fl_rect.cxx.
// FIXME: this would probably better be in class Fl::
int fl_line_width_ = 0;
// Remove #ifndef FL_LIBRARY_CMAKE and the entire block of #include
// statements when the new build system is ready:
#ifndef FL_LIBRARY_CMAKE
// -----------------------------------------------------------------------------
// Apple Quartz driver in "drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx"
// all driver code is now in drivers/XXX/Fl_XXX_Graphics_Driver_xyz.cxx
// -----------------------------------------------------------------------------
#ifdef FL_CFG_GFX_GDI
// # include "drivers/GDI/Fl_GDI_Graphics_Driver_line_style.cxx"
#endif
// -----------------------------------------------------------------------------
#ifdef FL_CFG_GFX_XLIB
// # include "drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx"
#endif
// -----------------------------------------------------------------------------
#endif // FL_LIBRARY_CMAKE
//
// End of "$Id$".
//

View File

@ -40,8 +40,12 @@
#else
#endif
// -----------------------------------------------------------------------------
// all driver code is now in drivers/XXX/Fl_XXX_Graphics_Driver_xyz.cxx
// -----------------------------------------------------------------------------
// fl_line_width_ must contain the absolute value of the current
// line width to be used for X11 clipping (see below).
// line width to be used for X11 clipping (see driver code).
// This is defined in src/fl_line_style.cxx
extern int fl_line_width_;
@ -64,39 +68,6 @@ Fl_Region Fl_Graphics_Driver::clip_region() {
}
// -----------------------------------------------------------------------------
// Remove #ifndef FL_LIBRARY_CMAKE and the entire block of #include
// statements when the new build system is ready:
#ifndef FL_LIBRARY_CMAKE
// -----------------------------------------------------------------------------
// Apple Quartz driver in "drivers/Quartz/Fl_Quartz_Graphics_Driver_rect.cxx"
// -----------------------------------------------------------------------------
#ifdef FL_CFG_GFX_GDI
// # include "drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx"
#endif
// -----------------------------------------------------------------------------
#ifdef FL_CFG_GFX_XLIB
// # include "drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx"
#endif
// -----------------------------------------------------------------------------
#endif // FL_LIBRARY_CMAKE
// -----------------------------------------------------------------------------
//
// End of "$Id$".
//

View File

@ -22,17 +22,15 @@
simple 2D transformations.
*/
// Portable drawing code for drawing arbitrary shapes with
// simple 2D transformations. See also fl_arc.cxx
// Portable code for drawing arbitrary shapes with simple 2D transformations.
// See also fl_arc.cxx
// matt: the Quartz implementation purposely doesn't use the Quartz matrix
// operations for reasons of compatibility and maintainability
#if defined(WIN32) || defined(__APPLE__)
#elif defined(FL_PORTING)
# pragma message "FL_PORTING: implement functions below for vector drawing"
#else
#endif
// -----------------------------------------------------------------------------
// all driver code is now in drivers/XXX/Fl_XXX_Graphics_Driver_xyz.cxx
// -----------------------------------------------------------------------------
#include <config.h>
#include "config_lib.h"
@ -144,44 +142,6 @@ void Fl_Graphics_Driver::fixloop() { // remove equal points from closed path
while (n>2 && p[n-1].x == p[0].x && p[n-1].y == p[0].y) n--;
}
// -----------------------------------------------------------------------------
// Remove #ifndef FL_LIBRARY_CMAKE and the entire block of #include
// statements when the new build system is ready:
#ifndef FL_LIBRARY_CMAKE
// -----------------------------------------------------------------------------
// Apple Quartz graphics driver "drivers/Quartz/Fl_Quartz_Graphics_Driver_vertex.cxx"
// -----------------------------------------------------------------------------
#ifdef FL_CFG_GFX_GDI
// # include "drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx"
#endif
// -----------------------------------------------------------------------------
#ifdef FL_CFG_GFX_XLIB
// # include "drivers/Xlib/Fl_Xlib_Graphics_Driver_vertex.cxx"
#endif
// -----------------------------------------------------------------------------
#endif // FL_LIBRARY_CMAKE
// -----------------------------------------------------------------------------
//
// End of "$Id$".
//