summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/fl_color.cxx56
-rw-r--r--src/fl_line_style.cxx39
-rw-r--r--src/fl_rect.cxx39
-rw-r--r--src/fl_vertex.cxx50
5 files changed, 27 insertions, 165 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index feda5cabb..b28fff13b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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)
diff --git a/src/fl_color.cxx b/src/fl_color.cxx
index 630cfedb2..4fa08dd08 100644
--- a/src/fl_color.cxx
+++ b/src/fl_color.cxx
@@ -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
-
-/** \addtogroup fl_attributes
- @{ */
+// fl_cmap needs to be defined globally (here) and is used in the device
+// specific graphics drivers
-/* 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
// -----------------------------------------------------------------------------
-
-// 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
-
-
+// all driver code is now in drivers/XXX/Fl_XXX_Graphics_Driver_xyz.cxx
// -----------------------------------------------------------------------------
-
-#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];
diff --git a/src/fl_line_style.cxx b/src/fl_line_style.cxx
index 9876a1496..3685ff7ef 100644
--- a/src/fl_line_style.cxx
+++ b/src/fl_line_style.cxx
@@ -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"
-
-// -----------------------------------------------------------------------------
-
-
-#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
-
-
+// all driver code is now in drivers/XXX/Fl_XXX_Graphics_Driver_xyz.cxx
// -----------------------------------------------------------------------------
-#endif // FL_LIBRARY_CMAKE
-
//
// End of "$Id$".
//
diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx
index b2acba9ed..3fddf9388 100644
--- a/src/fl_rect.cxx
+++ b/src/fl_rect.cxx
@@ -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$".
//
diff --git a/src/fl_vertex.cxx b/src/fl_vertex.cxx
index 6e7b96cd4..cc58ea3fe 100644
--- a/src/fl_vertex.cxx
+++ b/src/fl_vertex.cxx
@@ -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$".
//