Author: manolo
Date: 2010-12-28 07:33:36 -0800 (Tue, 28 Dec 2010)
New Revision: 8129
Log:
Use device abstraction for colors.
Modified:
branches/branch-1.3/FL/Fl_Device.H
branches/branch-1.3/src/fl_color.cxx
branches/branch-1.3/src/fl_color_mac.cxx
branches/branch-1.3/src/fl_color_win32.cxx
Modified: branches/branch-1.3/FL/Fl_Device.H
===================================================================
--- branches/branch-1.3/FL/Fl_Device.H 2010-12-28 15:17:23 UTC (rev 8128)
+++ branches/branch-1.3/FL/Fl_Device.H 2010-12-28 15:33:36 UTC (rev 8129)
@@ -193,9 +193,9 @@
/** \brief see fl_font(Fl_Font face, Fl_Fontsize size). */
virtual void font(Fl_Font face, Fl_Fontsize size) {};
/** \brief see fl_color(Fl_Color c). */
- virtual void color(Fl_Color c);
+ virtual void color(Fl_Color c) {};
/** \brief see fl_color(uchar r, uchar g, uchar b). */
- virtual void color(uchar r, uchar g, uchar b);
+ virtual void color(uchar r, uchar g, uchar b) {};
/** \brief see fl_point(int x, int y). */
virtual void point(int x, int y);
/** \brief see fl_loop(int x0, int y0, int x1, int y1, int x2, int y2). */
@@ -298,6 +298,8 @@
/** \brief The constructor. */
Fl_Quartz_Graphics_Driver() { type_ = device_type; };
static const char *device_type;
+ void color(Fl_Color c);
+ void color(uchar r, uchar g, uchar b);
void draw(const char* str, int n, int x, int y);
void draw(int angle, const char *str, int n, int x, int y);
void rtl_draw(const char* str, int n, int x, int y);
@@ -322,6 +324,8 @@
/** \brief The constructor. */
Fl_GDI_Graphics_Driver() { type_ = device_type; };
static const char *device_type;
+ void color(Fl_Color c);
+ void color(uchar r, uchar g, uchar b);
void draw(const char* str, int n, int x, int y);
void draw(int angle, const char *str, int n, int x, int y);
void rtl_draw(const char* str, int n, int x, int y);
@@ -346,6 +350,8 @@
/** \brief The constructor. */
Fl_Xlib_Graphics_Driver() { type_ = device_type; };
static const char *device_type;
+ void color(Fl_Color c);
+ void color(uchar r, uchar g, uchar b);
void draw(const char* str, int n, int x, int y);
void draw(int angle, const char *str, int n, int x, int y);
void rtl_draw(const char* str, int n, int x, int y);
Modified: branches/branch-1.3/src/fl_color.cxx
===================================================================
--- branches/branch-1.3/src/fl_color.cxx 2010-12-28 15:17:23 UTC (rev
8128)
+++ branches/branch-1.3/src/fl_color.cxx 2010-12-28 15:33:36 UTC (rev
8129)
@@ -127,7 +127,7 @@
/** Current color for drawing operations */
Fl_Color fl_color_;
-void Fl_Graphics_Driver::color(Fl_Color i) {
+void Fl_Xlib_Graphics_Driver::color(Fl_Color i) {
if (i & 0xffffff00) {
unsigned rgb = (unsigned)i;
fl_color((uchar)(rgb >> 24), (uchar)(rgb >> 16), (uchar)(rgb >> 8));
@@ -138,7 +138,7 @@
}
}
-void Fl_Graphics_Driver::color(uchar r,uchar g,uchar b) {
+void Fl_Xlib_Graphics_Driver::color(uchar r,uchar g,uchar b) {
fl_color_ = fl_rgb_color(r, g, b);
if(!fl_gc) return; // don't get a default gc if current window is not yet
created/valid
XSetForeground(fl_display, fl_gc, fl_xpixel(r,g,b));
Modified: branches/branch-1.3/src/fl_color_mac.cxx
===================================================================
--- branches/branch-1.3/src/fl_color_mac.cxx 2010-12-28 15:17:23 UTC (rev
8128)
+++ branches/branch-1.3/src/fl_color_mac.cxx 2010-12-28 15:33:36 UTC (rev
8129)
@@ -49,7 +49,7 @@
Fl_Color fl_color_;
-void Fl_Graphics_Driver::color(Fl_Color i) {
+void Fl_Quartz_Graphics_Driver::color(Fl_Color i) {
fl_color_ = i;
int index;
uchar r, g, b;
@@ -74,7 +74,7 @@
CGContextSetRGBStrokeColor(fl_gc, fr, fg, fb, 1.0f);
}
-void Fl_Graphics_Driver::color(uchar r, uchar g, uchar b) {
+void Fl_Quartz_Graphics_Driver::color(uchar r, uchar g, uchar b) {
fl_color_ = fl_rgb_color(r, g, b);
float fr = r/255.0f;
float fg = g/255.0f;
Modified: branches/branch-1.3/src/fl_color_win32.cxx
===================================================================
--- branches/branch-1.3/src/fl_color_win32.cxx 2010-12-28 15:17:23 UTC (rev
8128)
+++ branches/branch-1.3/src/fl_color_win32.cxx 2010-12-28 15:33:36 UTC (rev
8129)
@@ -94,7 +94,7 @@
Fl_Color fl_color_;
-void Fl_Graphics_Driver::color(Fl_Color i) {
+void Fl_GDI_Graphics_Driver::color(Fl_Color i) {
if (i & 0xffffff00) {
unsigned rgb = (unsigned)i;
fl_color((uchar)(rgb >> 24), (uchar)(rgb >> 16), (uchar)(rgb >> 8));
@@ -118,7 +118,7 @@
}
}
-void Fl_Graphics_Driver::color(uchar r, uchar g, uchar b) {
+void Fl_GDI_Graphics_Driver::color(uchar r, uchar g, uchar b) {
static Fl_XMap xmap;
COLORREF c = RGB(r,g,b);
fl_color_ = fl_rgb_color(r, g, b);
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit