mirror of
https://github.com/fltk/fltk.git
synced 2026-05-31 22:04:26 +08:00
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:
@@ -265,14 +265,6 @@ set(CFILES
|
|||||||
fl_utf.c
|
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)
|
add_definitions(-DFL_LIBRARY)
|
||||||
|
|
||||||
if(APPLE AND NOT OPTION_APPLE_X11)
|
if(APPLE AND NOT OPTION_APPLE_X11)
|
||||||
|
|||||||
+17
-41
@@ -23,53 +23,25 @@
|
|||||||
|
|
||||||
// Implementation of fl_color(i), fl_color(r,g,b).
|
// 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_Device.H>
|
||||||
#include <FL/Fl.H>
|
#include <FL/Fl.H>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "config_lib.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] = {
|
unsigned fl_cmap[256] = {
|
||||||
#include "fl_cmap.h" // this is a file produced by "cmap.cxx":
|
#include "fl_cmap.h" // this is a file produced by "cmap.cxx":
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
// Remove #ifndef FL_LIBRARY_CMAKE and the entire block of #include
|
// all driver code is now in drivers/XXX/Fl_XXX_Graphics_Driver_xyz.cxx
|
||||||
// statements when the new build system is ready:
|
|
||||||
#ifndef FL_LIBRARY_CMAKE
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Apple Quartz driver in "drivers/Quartz/Fl_Quartz_Graphics_Driver_color.cxx"
|
/** \addtogroup fl_attributes
|
||||||
|
@{ */
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the RGB value(s) for the given FLTK color index.
|
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);
|
if (i & 0xffffff00) return (i);
|
||||||
else return fl_cmap[i];
|
else return fl_cmap[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets an entry in the fl_color index table. You can set it to
|
Sets an entry in the fl_color index table.
|
||||||
any 8-bit RGB color. The color is not allocated until fl_color(i)
|
|
||||||
is used.
|
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) {
|
void Fl::set_color(Fl_Color i, uchar red, uchar green, uchar blue) {
|
||||||
Fl::set_color((Fl_Color)(i & 255),
|
Fl::set_color((Fl_Color)(i & 255),
|
||||||
((unsigned)red<<24)+((unsigned)green<<16)+((unsigned)blue<<8));
|
((unsigned)red<<24)+((unsigned)green<<16)+((unsigned)blue<<8));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the RGB value(s) for the given FLTK color index.
|
Returns the RGB value(s) for the given FLTK color index.
|
||||||
|
|
||||||
This form returns the red, green, and blue values
|
This form returns the red, green, and blue values
|
||||||
separately in referenced variables.
|
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) {
|
void Fl::get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue) {
|
||||||
unsigned c;
|
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.
|
Returns the weighted average color between the two given colors.
|
||||||
|
|
||||||
The red, green and blue values are averages using the following formula:
|
The red, green and blue values are averages using the following formula:
|
||||||
\code
|
\code
|
||||||
color = color1 * weight + color2 * (1 - weight)
|
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) {
|
Fl_Color fl_inactive(Fl_Color c) {
|
||||||
return fl_color_average(c, FL_GRAY, .33f);
|
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.
|
Returns a color that contrasts with the background color.
|
||||||
|
|
||||||
This will be the foreground color if it contrasts sufficiently with the
|
This will be the foreground color if it contrasts sufficiently with the
|
||||||
background color. Otherwise, returns \p FL_WHITE or \p FL_BLACK depending
|
background color. Otherwise, returns \p FL_WHITE or \p FL_BLACK depending
|
||||||
on which color provides the best contrast.
|
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
|
unsigned c1, c2; // RGB colors
|
||||||
int l1, l2; // Luminosities
|
int l1, l2; // Luminosities
|
||||||
|
|
||||||
|
|
||||||
// Get the RGB values for each color...
|
// Get the RGB values for each color...
|
||||||
if (fg & 0xffffff00) c1 = (unsigned)fg;
|
if (fg & 0xffffff00) c1 = (unsigned)fg;
|
||||||
else c1 = fl_cmap[fg];
|
else c1 = fl_cmap[fg];
|
||||||
|
|||||||
+1
-38
@@ -21,52 +21,15 @@
|
|||||||
\brief Line style drawing utility hiding different platforms.
|
\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.
|
// We save the current line width (absolute value) here.
|
||||||
// This is currently used only for X11 clipping, see src/fl_rect.cxx.
|
// This is currently used only for X11 clipping, see src/fl_rect.cxx.
|
||||||
// FIXME: this would probably better be in class Fl::
|
// FIXME: this would probably better be in class Fl::
|
||||||
int fl_line_width_ = 0;
|
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
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
// all driver code is now in drivers/XXX/Fl_XXX_Graphics_Driver_xyz.cxx
|
||||||
// Apple Quartz driver in "drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.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$".
|
// End of "$Id$".
|
||||||
//
|
//
|
||||||
|
|||||||
+5
-34
@@ -40,8 +40,12 @@
|
|||||||
#else
|
#else
|
||||||
#endif
|
#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
|
// 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
|
// This is defined in src/fl_line_style.cxx
|
||||||
extern int fl_line_width_;
|
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$".
|
// End of "$Id$".
|
||||||
//
|
//
|
||||||
|
|||||||
+5
-45
@@ -22,17 +22,15 @@
|
|||||||
simple 2D transformations.
|
simple 2D transformations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Portable drawing code for drawing arbitrary shapes with
|
// Portable code for drawing arbitrary shapes with simple 2D transformations.
|
||||||
// simple 2D transformations. See also fl_arc.cxx
|
// See also fl_arc.cxx
|
||||||
|
|
||||||
// matt: the Quartz implementation purposely doesn't use the Quartz matrix
|
// matt: the Quartz implementation purposely doesn't use the Quartz matrix
|
||||||
// operations for reasons of compatibility and maintainability
|
// operations for reasons of compatibility and maintainability
|
||||||
|
|
||||||
#if defined(WIN32) || defined(__APPLE__)
|
// -----------------------------------------------------------------------------
|
||||||
#elif defined(FL_PORTING)
|
// all driver code is now in drivers/XXX/Fl_XXX_Graphics_Driver_xyz.cxx
|
||||||
# pragma message "FL_PORTING: implement functions below for vector drawing"
|
// -----------------------------------------------------------------------------
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "config_lib.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--;
|
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$".
|
// End of "$Id$".
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user