summaryrefslogtreecommitdiff
path: root/src/Fl_Pixmap.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-11-27 17:44:08 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-11-27 17:44:08 +0000
commit2b85bf81680e2243ef5a5daf85d9eb04321c7278 (patch)
treedc7d3e1cdbd44ed10b358412098b73d24b64d143 /src/Fl_Pixmap.cxx
parent4dc5732a3e0f376786d1d6b788e5cf601439e890 (diff)
Preliminary commit of my MacOS X work.
**** THIS CODE COMPILES BUT DOES NOT WORK. **** TODO: fix event handling - getting blank windows, etc. TODO: re-port OpenGL code. TODO: add support for images with alpha. TODO: add support for more then just beeps in fl_beep(). TODO: other stuff I'm sure... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1765 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Pixmap.cxx')
-rw-r--r--src/Fl_Pixmap.cxx31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index bf6e984d7..aac769590 100644
--- a/src/Fl_Pixmap.cxx
+++ b/src/Fl_Pixmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.9 2001/11/24 02:46:19 easysw Exp $"
+// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.10 2001/11/27 17:44:06 easysw Exp $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -104,6 +104,29 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
} else {
fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
}
+#elif defined(__APPLE__)
+ if ( mask )
+ {
+ Rect src, dst;
+ src.left = 0; src.right = w();
+ src.top = 0; src.bottom = h();
+ dst.left = X; dst.right = X+w();
+ dst.top = Y; dst.bottom = Y+h();
+ RGBColor rgb;
+ rgb.red = 0xffff; rgb.green = 0xffff; rgb.blue = 0xffff;
+ RGBBackColor( &rgb );
+ rgb.red = 0x0000; rgb.green = 0x0000; rgb.blue = 0x0000;
+ RGBForeColor( &rgb );
+ CopyMask(
+ GetPortBitMapForCopyBits((GrafPtr)id),
+ GetPortBitMapForCopyBits((GrafPtr)mask),
+ GetPortBitMapForCopyBits((GrafPtr)fl_window),
+ &src, &src, &dst);
+ }
+ else
+ {
+ fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
+ }
#else
if (mask) {
// I can't figure out how to combine a mask with existing region,
@@ -342,7 +365,7 @@ void Fl_Pixmap::color_average(Fl_Color c, float i) {
while (*p && !isspace(*p)) p++;
}
-#ifdef WIN32
+#if defined(WIN32) || defined(__APPLE__)
if (fl_parse_color(p, r, g, b)) {
#else
XColor x;
@@ -437,7 +460,7 @@ void Fl_Pixmap::desaturate() {
while (*p && !isspace(*p)) p++;
}
-#ifdef WIN32
+#if defined(WIN32) || defined(__APPLE__)
if (fl_parse_color(p, r, g, b)) {
#else
XColor x;
@@ -462,5 +485,5 @@ void Fl_Pixmap::desaturate() {
}
//
-// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.9 2001/11/24 02:46:19 easysw Exp $".
+// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.10 2001/11/27 17:44:06 easysw Exp $".
//