summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-11-18 20:52:28 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-11-18 20:52:28 +0000
commit681ded73c20af217254a8dfb7838b612b17b126c (patch)
treed1a27de803ee766c01f5cbcb3420aab7f97364ef
parent8b5a03d3a2a9927609d41127fd6d639fe961a46f (diff)
Add Fl_Bitmask type, fl_create_bitmask() and fl_delete_bitmask() functions
for common mask generation stuff (need to test under WIN32!) Add alpha channel support to Fl_RGB_Image class; currently uses "screen door" transparency. Update image demo to draw an RGBA image to show alpha channel. Comment out debug printf in tooltip code. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1696 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES7
-rw-r--r--FL/Fl_Bitmap.H6
-rw-r--r--FL/Fl_Image.H9
-rw-r--r--FL/Fl_Pixmap.H8
-rw-r--r--FL/win32.H12
-rw-r--r--FL/x.H12
-rw-r--r--fluid/makedepend3
-rw-r--r--src/Fl_Bitmap.cxx79
-rw-r--r--src/Fl_Image.cxx154
-rw-r--r--src/Fl_Pixmap.cxx20
-rw-r--r--src/Fl_Tooltip.cxx6
-rw-r--r--src/fl_draw_image_win32.cxx8
-rw-r--r--src/fl_draw_pixmap.cxx6
-rw-r--r--src/makedepend68
-rw-r--r--test/image.cxx22
-rw-r--r--test/makedepend81
16 files changed, 353 insertions, 148 deletions
diff --git a/CHANGES b/CHANGES
index fdf33e96e..a2b7caf1f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -37,6 +37,13 @@ CHANGES IN FLTK 1.1.0b6
- Tooltips could appear off the screen.
- Mouse wheel events are now sent to the focus widget
first, then to any other interested widget.
+ - The Fl_RGB_Image class now supports images with an
+ alpha channel. Images are currently drawn using
+ "screen door" transparency... See the "image" demo
+ for an example.
+ - Added new fl_create_bitmask() and fl_delete_bitmask()
+ functions that create bitmap objects for masking and
+ bitmap drawing.
CHANGES IN FLTK 1.1.0b5
diff --git a/FL/Fl_Bitmap.H b/FL/Fl_Bitmap.H
index 03256caa7..3d9ac5411 100644
--- a/FL/Fl_Bitmap.H
+++ b/FL/Fl_Bitmap.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Bitmap.H,v 1.5.2.3.2.1 2001/08/05 23:58:54 easysw Exp $"
+// "$Id: Fl_Bitmap.H,v 1.5.2.3.2.2 2001/11/18 20:52:27 easysw Exp $"
//
// Bitmap header file for the Fast Light Tool Kit (FLTK).
//
@@ -34,7 +34,7 @@ class FL_EXPORT Fl_Bitmap : public Fl_Image {
public:
const uchar *array;
- ulong id; // for internal use
+ Fl_Bitmask id; // for internal use
Fl_Bitmap(const uchar *bits, int W, int H) :
Fl_Image(W,H), array(bits), id(0) {}
@@ -50,5 +50,5 @@ class FL_EXPORT Fl_Bitmap : public Fl_Image {
#endif
//
-// End of "$Id: Fl_Bitmap.H,v 1.5.2.3.2.1 2001/08/05 23:58:54 easysw Exp $".
+// End of "$Id: Fl_Bitmap.H,v 1.5.2.3.2.2 2001/11/18 20:52:27 easysw Exp $".
//
diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H
index e0a9f29f8..e277eb34b 100644
--- a/FL/Fl_Image.H
+++ b/FL/Fl_Image.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Image.H,v 1.5.2.3.2.1 2001/08/05 23:58:54 easysw Exp $"
+// "$Id: Fl_Image.H,v 1.5.2.3.2.2 2001/11/18 20:52:27 easysw Exp $"
//
// Image header file for the Fast Light Tool Kit (FLTK).
//
@@ -26,6 +26,8 @@
#ifndef Fl_Image_H
#define Fl_Image_H
+# include "x.H"
+
class Fl_Widget;
struct Fl_Menu_Item;
@@ -52,7 +54,8 @@ class FL_EXPORT Fl_RGB_Image : public Fl_Image {
const uchar *array;
int d, ld;
- ulong id; // for internal use
+ Fl_Offscreen id; // for internal use
+ Fl_Bitmask mask; // for internal use (mask bitmap)
Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0) :
Fl_Image(W,H), array(bits), d(D), ld(LD), id(0) {}
@@ -66,5 +69,5 @@ class FL_EXPORT Fl_RGB_Image : public Fl_Image {
#endif
//
-// End of "$Id: Fl_Image.H,v 1.5.2.3.2.1 2001/08/05 23:58:54 easysw Exp $".
+// End of "$Id: Fl_Image.H,v 1.5.2.3.2.2 2001/11/18 20:52:27 easysw Exp $".
//
diff --git a/FL/Fl_Pixmap.H b/FL/Fl_Pixmap.H
index 78c8c389c..9d448afa8 100644
--- a/FL/Fl_Pixmap.H
+++ b/FL/Fl_Pixmap.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Pixmap.H,v 1.6.2.8.2.2 2001/11/01 18:53:46 easysw Exp $"
+// "$Id: Fl_Pixmap.H,v 1.6.2.8.2.3 2001/11/18 20:52:27 easysw Exp $"
//
// Pixmap header file for the Fast Light Tool Kit (FLTK).
//
@@ -41,8 +41,8 @@ class FL_EXPORT Fl_Pixmap : public Fl_Image {
public:
const char * const * data;
- ulong id; // for internal use
- ulong mask; // for internal use (mask bitmap)
+ Fl_Offscreen id; // for internal use
+ Fl_Bitmask mask; // for internal use (mask bitmap)
explicit Fl_Pixmap(char * const * d) : Fl_Image(-1,0), data((const char*const*)d), id(0),mask(0) {measure();}
explicit Fl_Pixmap(uchar* const * d) : Fl_Image(-1,0), data((const char*const*)d), id(0),mask(0) {measure();}
@@ -58,5 +58,5 @@ class FL_EXPORT Fl_Pixmap : public Fl_Image {
#endif
//
-// End of "$Id: Fl_Pixmap.H,v 1.6.2.8.2.2 2001/11/01 18:53:46 easysw Exp $".
+// End of "$Id: Fl_Pixmap.H,v 1.6.2.8.2.3 2001/11/18 20:52:27 easysw Exp $".
//
diff --git a/FL/win32.H b/FL/win32.H
index b4dfc238d..92e97452f 100644
--- a/FL/win32.H
+++ b/FL/win32.H
@@ -1,5 +1,5 @@
//
-// "$Id: win32.H,v 1.15.2.3 2001/01/22 15:13:38 easysw Exp $"
+// "$Id: win32.H,v 1.15.2.3.2.1 2001/11/18 20:52:27 easysw Exp $"
//
// WIN32 header file for the Fast Light Tool Kit (FLTK).
//
@@ -106,7 +106,7 @@ extern FL_EXPORT HDC fl_GetDC(Window);
extern FL_EXPORT MSG fl_msg;
// off-screen pixmaps: create, destroy, draw into, copy to window
-#define Fl_Offscreen HBITMAP
+typedef HBITMAP Fl_Offscreen;
#define fl_create_offscreen(w, h) CreateCompatibleBitmap(fl_gc, w, h)
extern FL_EXPORT HDC fl_makeDC(HBITMAP);
@@ -120,6 +120,12 @@ extern FL_EXPORT HDC fl_makeDC(HBITMAP);
FL_EXPORT void fl_copy_offscreen(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy);
#define fl_delete_offscreen(bitmap) DeleteObject(bitmap);
+// Bitmap masks
+typedef HBITMAP Fl_Bitmask;
+
+extern FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data);
+extern FL_EXPORT void fl_delete_bitmask(Fl_Bitmask bm);
+
//
-// End of "$Id: win32.H,v 1.15.2.3 2001/01/22 15:13:38 easysw Exp $".
+// End of "$Id: win32.H,v 1.15.2.3.2.1 2001/11/18 20:52:27 easysw Exp $".
//
diff --git a/FL/x.H b/FL/x.H
index 1d12da5da..a56424a23 100644
--- a/FL/x.H
+++ b/FL/x.H
@@ -1,5 +1,5 @@
//
-// "$Id: x.H,v 1.10.2.8 2001/01/22 15:13:38 easysw Exp $"
+// "$Id: x.H,v 1.10.2.8.2.1 2001/11/18 20:52:27 easysw Exp $"
//
// X11 header file for the Fast Light Tool Kit (FLTK).
//
@@ -77,7 +77,7 @@ extern FL_EXPORT const XEvent* fl_xevent;
extern FL_EXPORT ulong fl_event_time;
// off-screen pixmaps: create, destroy, draw into, copy to window:
-#define Fl_Offscreen ulong
+typedef ulong Fl_Offscreen;
#define fl_create_offscreen(w,h) \
XCreatePixmap(fl_display, fl_window, w, h, fl_visual->depth)
// begin/end are macros that save the old state in local variables:
@@ -90,6 +90,12 @@ extern FL_EXPORT ulong fl_event_time;
XCopyArea(fl_display, pixmap, fl_window, fl_gc, srcx, srcy, w, h, x, y)
#define fl_delete_offscreen(pixmap) XFreePixmap(fl_display, pixmap)
+// Bitmap masks
+typedef ulong Fl_Bitmask;
+
+extern FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data);
+extern FL_EXPORT void fl_delete_bitmask(Fl_Bitmask bm);
+
// this object contains all X-specific stuff about a window:
// Warning: this object is highly subject to change! It's definition
// is only here so that fl_xid can be declared inline:
@@ -125,5 +131,5 @@ extern FL_EXPORT int fl_background_pixel; // hack into Fl_X::make_xid()
#endif
//
-// End of "$Id: x.H,v 1.10.2.8 2001/01/22 15:13:38 easysw Exp $".
+// End of "$Id: x.H,v 1.10.2.8.2.1 2001/11/18 20:52:27 easysw Exp $".
//
diff --git a/fluid/makedepend b/fluid/makedepend
index 115b75204..da931a748 100644
--- a/fluid/makedepend
+++ b/fluid/makedepend
@@ -70,7 +70,8 @@ Fluid_Image.o: ../FL/Fl_Menu_Item.H Fluid_Image.h ../FL/Fl_Tabs.H
Fluid_Image.o: ../FL/Fl_Group.H ../FL/Fl_Pack.H ../FL/Fl_Group.H
Fluid_Image.o: ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H
Fluid_Image.o: ../FL/Fl_Menu_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_Bar.H
-Fluid_Image.o: ../FL/filename.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
+Fluid_Image.o: ../FL/filename.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H ../FL/x.H
+Fluid_Image.o: ../FL/Fl_Window.H
code.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H Fl_Type.h
code.o: ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H Fluid_Image.h
code.o: ../FL/Fl_Tabs.H ../FL/Fl_Group.H ../FL/Fl_Pack.H ../FL/Fl_Group.H
diff --git a/src/Fl_Bitmap.cxx b/src/Fl_Bitmap.cxx
index 49d450479..c20bfeabf 100644
--- a/src/Fl_Bitmap.cxx
+++ b/src/Fl_Bitmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.1 2001/08/05 23:58:54 easysw Exp $"
+// "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.2 2001/11/18 20:52:27 easysw Exp $"
//
// Bitmap drawing routines for the Fast Light Tool Kit (FLTK).
//
@@ -30,6 +30,48 @@
#include <FL/Fl_Menu_Item.H>
#include <FL/Fl_Bitmap.H>
+#ifdef WIN32 // Windows bitmask functions...
+Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data) {
+ // we need to pad the lines out to words & swap the bits
+ // in each byte.
+ int w1 = (w+7)/8;
+ int w2 = ((w+15)/16)*2;
+ uchar* newarray = new uchar[w2*h];
+ const uchar* src = data;
+ uchar* dest = newarray;
+ Fl_Bitmask id;
+ static uchar reverse[16] = /* Bit reversal lookup table */
+ { 0x00, 0x88, 0x44, 0xcc, 0x22, 0xaa, 0x66, 0xee,
+ 0x11, 0x99, 0x55, 0xdd, 0x33, 0xbb, 0x77, 0xff };
+
+ for (int y=0; y < h; y++) {
+ for (int n = 0; n < w1; n++, src++)
+ *dest++ = (reverse[*src & 0x0f] & 0xf0) |
+ (reverse[(*src >> 4) & 0x0f] & 0x0f);
+ dest += w2-w1;
+ }
+
+ id = CreateBitmap(w, h, 1, 1, newarray);
+
+ delete[] newarray;
+
+ return (id);
+}
+
+void fl_delete_bitmask(Fl_Bitmask bm) {
+ DeleteObject((HGDIOBJ)bm);
+}
+#else // X11 bitmask functions
+Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data) {
+ return XCreateBitmapFromData(fl_display, fl_window, (const char *)data,
+ (w+7)&-8, h);
+}
+
+void fl_delete_bitmask(Fl_Bitmask bm) {
+ fl_delete_offscreen((Fl_Offscreen)bm);
+}
+#endif // WIN32
+
void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
// account for current clip region (faster on Irix):
int X,Y,W,H; fl_clip_box(XP,YP,WP,HP,X,Y,W,H);
@@ -41,27 +83,9 @@ void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
if (cy < 0) {H += cy; Y -= cy; cy = 0;}
if ((cy+H) > h()) H = h()-cy;
if (H <= 0) return;
+ if (!id) id = fl_create_bitmask(w(), h(), array);
+
#ifdef WIN32
- if (!id) {
- // we need to pad the lines out to words & swap the bits
- // in each byte.
- int w1 = (w()+7)/8;
- int w2 = ((w()+15)/16)*2;
- uchar* newarray = new uchar[w2*h()];
- const uchar* src = array;
- uchar* dest = newarray;
- static uchar reverse[16] = /* Bit reversal lookup table */
- { 0x00, 0x88, 0x44, 0xcc, 0x22, 0xaa, 0x66, 0xee,
- 0x11, 0x99, 0x55, 0xdd, 0x33, 0xbb, 0x77, 0xff };
- for (int y=0; y < h(); y++) {
- for (int n = 0; n < w1; n++, src++)
- *dest++ = (reverse[*src & 0x0f] & 0xf0) |
- (reverse[(*src >> 4) & 0x0f] & 0x0f);
- dest += w2-w1;
- }
- id = (ulong)CreateBitmap(w(), h(), 1, 1, newarray);
- array = newarray; // keep the pointer so I can free it later
- }
HDC tempdc = CreateCompatibleDC(fl_gc);
SelectObject(tempdc, (HGDIOBJ)id);
SelectObject(fl_gc, fl_brush());
@@ -69,8 +93,6 @@ void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
BitBlt(fl_gc, X, Y, W, H, tempdc, cx, cy, 0xE20746L);
DeleteDC(tempdc);
#else
- if (!id) id = XCreateBitmapFromData(fl_display, fl_window,
- (const char*)array, (w()+7)&-8, h());
XSetStipple(fl_display, fl_gc, id);
int ox = X-cx; if (ox < 0) ox += w();
int oy = Y-cy; if (oy < 0) oy += h();
@@ -82,14 +104,7 @@ void Fl_Bitmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
}
Fl_Bitmap::~Fl_Bitmap() {
-#ifdef WIN32
- if (id) {
- DeleteObject((HGDIOBJ)id);
- delete[] (uchar*)array;
- }
-#else
- if (id) fl_delete_offscreen((Fl_Offscreen)id);
-#endif
+ if (id) fl_delete_bitmask(id);
}
void Fl_Bitmap::label(Fl_Widget* w) {
@@ -100,5 +115,5 @@ void Fl_Bitmap::label(Fl_Menu_Item* m) {
}
//
-// End of "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.1 2001/08/05 23:58:54 easysw Exp $".
+// End of "$Id: Fl_Bitmap.cxx,v 1.5.2.4.2.2 2001/11/18 20:52:27 easysw Exp $".
//
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index 1c62e2fea..e2e7bd843 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Image.cxx,v 1.5.2.3.2.1 2001/08/05 23:58:54 easysw Exp $"
+// "$Id: Fl_Image.cxx,v 1.5.2.3.2.2 2001/11/18 20:52:28 easysw Exp $"
//
// Image drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -29,6 +29,9 @@
#include <FL/Fl_Widget.H>
#include <FL/Fl_Menu_Item.H>
#include <FL/Fl_Image.H>
+#include <string.h>
+
+void fl_restore_clip(); // in fl_rect.cxx
Fl_Image::~Fl_Image() {
}
@@ -63,8 +66,153 @@ void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
fl_begin_offscreen((Fl_Offscreen)id);
fl_draw_image(array, 0, 0, w(), h(), d, ld);
fl_end_offscreen();
+
+ if (d == 2 || d == 4) {
+ // Create alpha mask...
+ int bmw = (w() + 7) / 8;
+ uchar *bitmap = new uchar[bmw * h()];
+ uchar *bitptr, bit;
+ const uchar *dataptr;
+ int x, y;
+ static uchar dither[16][16] = { // Simple 16x16 Floyd dither
+ { 0, 128, 32, 160, 8, 136, 40, 168,
+ 2, 130, 34, 162, 10, 138, 42, 170 },
+ { 192, 64, 224, 96, 200, 72, 232, 104,
+ 194, 66, 226, 98, 202, 74, 234, 106 },
+ { 48, 176, 16, 144, 56, 184, 24, 152,
+ 50, 178, 18, 146, 58, 186, 26, 154 },
+ { 240, 112, 208, 80, 248, 120, 216, 88,
+ 242, 114, 210, 82, 250, 122, 218, 90 },
+ { 12, 140, 44, 172, 4, 132, 36, 164,
+ 14, 142, 46, 174, 6, 134, 38, 166 },
+ { 204, 76, 236, 108, 196, 68, 228, 100,
+ 206, 78, 238, 110, 198, 70, 230, 102 },
+ { 60, 188, 28, 156, 52, 180, 20, 148,
+ 62, 190, 30, 158, 54, 182, 22, 150 },
+ { 252, 124, 220, 92, 244, 116, 212, 84,
+ 254, 126, 222, 94, 246, 118, 214, 86 },
+ { 3, 131, 35, 163, 11, 139, 43, 171,
+ 1, 129, 33, 161, 9, 137, 41, 169 },
+ { 195, 67, 227, 99, 203, 75, 235, 107,
+ 193, 65, 225, 97, 201, 73, 233, 105 },
+ { 51, 179, 19, 147, 59, 187, 27, 155,
+ 49, 177, 17, 145, 57, 185, 25, 153 },
+ { 243, 115, 211, 83, 251, 123, 219, 91,
+ 241, 113, 209, 81, 249, 121, 217, 89 },
+ { 15, 143, 47, 175, 7, 135, 39, 167,
+ 13, 141, 45, 173, 5, 133, 37, 165 },
+ { 207, 79, 239, 111, 199, 71, 231, 103,
+ 205, 77, 237, 109, 197, 69, 229, 101 },
+ { 63, 191, 31, 159, 55, 183, 23, 151,
+ 61, 189, 29, 157, 53, 181, 21, 149 },
+ { 254, 127, 223, 95, 247, 119, 215, 87,
+ 253, 125, 221, 93, 245, 117, 213, 85 }
+ };
+
+ // Right now do a "screen door" alpha mask; not always pretty, but
+ // definitely fast...
+ memset(bitmap, 0, bmw * h());
+
+ for (dataptr = array + d - 1, y = 0; y < h(); y ++)
+ for (bitptr = bitmap + y * bmw, bit = 128, x = 0; x < w(); x ++, dataptr += d) {
+ if (*dataptr > dither[x & 15][y & 15])
+ *bitptr |= bit;
+ if (bit > 1) bit >>= 1;
+ else {
+ bit = 128;
+ bitptr ++;
+ }
+ }
+
+#if 0 // MRS: Don't think this is necessary; try using new fl_create_bitmask code...
+#ifdef WIN32 // Matt: mask done
+ // this won't work ehen the user changes display mode during run or
+ // has two screens with differnet depths
+ static uchar hiNibble[16] =
+ { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
+ 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0 };
+ static uchar loNibble[16] =
+ { 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e,
+ 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f };
+ int np = GetDeviceCaps(fl_gc, PLANES); //: was always one on sample machines
+ int bpp = GetDeviceCaps(fl_gc, BITSPIXEL);//: 1,4,8,16,24,32 and more odd stuff?
+ int Bpr = (bpp*w()+7)/8; //: bytes per row
+ int pad = Bpr&1, w1 = (w()+7)/8, shr = ((w()-1)&7)+1;
+ if (bpp==4) shr = (shr+1)/2;
+ uchar *newarray = new uchar[(Bpr+pad)*h()], *dst = newarray, *src = bitmap;
+ for (int i=0; i<h(); i++) {
+ //: this is slooow, but we do it only once per pixmap
+ for (int j=w1; j>0; j--) {
+ uchar b = *src++;
+ if (bpp==1) {
+ *dst++ = ( hiNibble[b&15] ) | ( loNibble[(b>>4)&15] );
+ } else if (bpp==4) {
+ for (int k=(j==1)?shr:4; k>0; k--) {
+ *dst++ = "\377\360\017\000"[b&3];
+ b = b >> 2;
+ }
+ } else {
+ for (int k=(j==1)?shr:8; k>0; k--) {
+ if (b&1) {
+ *dst++=0;
+ if (bpp>8) *dst++=0;
+ if (bpp>16) *dst++=0;
+ if (bpp>24) *dst++=0;
+ } else {
+ *dst++=0xff;
+ if (bpp>8) *dst++=0xff;
+ if (bpp>16) *dst++=0xff;
+ if (bpp>24) *dst++=0xff;
+ }
+ b = b >> 1;
+ }
+ }
+ }
+ dst += pad;
+ }
+ mask = (ulong)CreateBitmap(w(), h(), np, bpp, newarray);
+ delete[] newarray;
+#else
+ mask = XCreateBitmapFromData(fl_display, fl_window,
+ (const char*)bitmap, (w()+7)&-8, h());
+#endif
+#endif // 0
+
+ mask = fl_create_bitmask(w(), h(), bitmap);
+ delete[] bitmap;
+ }
+ }
+#ifdef WIN32
+ if (mask) {
+ HDC new_gc = CreateCompatibleDC(fl_gc);
+ SelectObject(new_gc, (void*)mask);
+ BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCAND);
+ SelectObject(new_gc, (void*)id);
+ BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCPAINT);
+ DeleteDC(new_gc);
+ } else {
+ fl_copy_offscreen(X, Y, W, H, id, cx, cy);
+ }
+#else
+ if (mask) {
+ // I can't figure out how to combine a mask with existing region,
+ // so cut the image down to a clipped rectangle:
+ int nx, ny; fl_clip_box(X,Y,W,H,nx,ny,W,H);
+ cx += nx-X; X = nx;
+ cy += ny-Y; Y = ny;
+ // make X use the bitmap as a mask:
+ XSetClipMask(fl_display, fl_gc, mask);
+ int ox = X-cx; if (ox < 0) ox += w();
+ int oy = Y-cy; if (oy < 0) oy += h();
+ XSetClipOrigin(fl_display, fl_gc, X-cx, Y-cy);
+ }
+ fl_copy_offscreen(X, Y, W, H, id, cx, cy);
+ if (mask) {
+ // put the old clip region back
+ XSetClipOrigin(fl_display, fl_gc, 0, 0);
+ fl_restore_clip();
}
- fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)id, cx, cy);
+#endif
}
void Fl_RGB_Image::label(Fl_Widget* w) {
@@ -76,5 +224,5 @@ void Fl_RGB_Image::label(Fl_Menu_Item* m) {
//
-// End of "$Id: Fl_Image.cxx,v 1.5.2.3.2.1 2001/08/05 23:58:54 easysw Exp $".
+// End of "$Id: Fl_Image.cxx,v 1.5.2.3.2.2 2001/11/18 20:52:28 easysw Exp $".
//
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index 77146622a..cf3b65465 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.2 2001/08/06 23:51:39 easysw Exp $"
+// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.3 2001/11/18 20:52:28 easysw Exp $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -39,8 +39,8 @@
#include <stdio.h>
-extern uchar **fl_mask_bitmap; // used by fl_draw_pixmap.C to store mask
-void fl_restore_clip(); // in fl_rect.C
+extern uchar **fl_mask_bitmap; // used by fl_draw_pixmap.cxx to store mask
+void fl_restore_clip(); // in fl_rect.cxx
void Fl_Pixmap::measure() {
int W, H;
@@ -70,13 +70,15 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
if (cy+H > h()) H = h()-cy;
if (H <= 0) return;
if (!id) {
- id = (ulong)fl_create_offscreen(w(), h());
- fl_begin_offscreen((Fl_Offscreen)id);
+ id = fl_create_offscreen(w(), h());
+ fl_begin_offscreen(id);
uchar *bitmap = 0;
fl_mask_bitmap = &bitmap;
fl_draw_pixmap(data, 0, 0, FL_BLACK);
fl_mask_bitmap = 0;
if (bitmap) {
+ mask = fl_create_bitmask(w(), h(), bitmap);
+#if 0 // Don't think this is needed; try using fl_create_bitmask()...
#ifdef WIN32 // Matt: mask done
// this won't work ehen the user changes display mode during run or
// has two screens with differnet depths
@@ -128,8 +130,10 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
mask = XCreateBitmapFromData(fl_display, fl_window,
(const char*)bitmap, (w()+7)&-8, h());
#endif
+#endif // 0
delete[] bitmap;
}
+
fl_end_offscreen();
}
#ifdef WIN32
@@ -166,8 +170,8 @@ void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
}
Fl_Pixmap::~Fl_Pixmap() {
- if (id) fl_delete_offscreen((Fl_Offscreen)id);
- if (mask) fl_delete_offscreen((Fl_Offscreen)mask);
+ if (id) fl_delete_offscreen(id);
+ if (mask) fl_delete_bitmask(mask);
}
void Fl_Pixmap::label(Fl_Widget* w) {
@@ -178,5 +182,5 @@ void Fl_Pixmap::label(Fl_Menu_Item* m) {
}
//
-// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.2 2001/08/06 23:51:39 easysw Exp $".
+// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.3 2001/11/18 20:52:28 easysw Exp $".
//
diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx
index 06ddd0141..92c435e1e 100644
--- a/src/Fl_Tooltip.cxx
+++ b/src/Fl_Tooltip.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Tooltip.cxx,v 1.38.2.6 2001/11/17 18:20:09 easysw Exp $"
+// "$Id: Fl_Tooltip.cxx,v 1.38.2.7 2001/11/18 20:52:28 easysw Exp $"
//
// Tooltip source file for the Fast Light Tool Kit (FLTK).
//
@@ -127,7 +127,7 @@ Fl_Tooltip::enter(Fl_Widget *w) {
// the widget
void
Fl_Tooltip::exit(Fl_Widget *w) {
- printf("Fl_Tooltip::exit(%p)\n", w);
+// printf("Fl_Tooltip::exit(%p)\n", w);
if (tooltip_exit_) tooltip_exit_(w);
}
@@ -189,5 +189,5 @@ Fl_Tooltip::tooltip_timeout(void *v) {
//
-// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.6 2001/11/17 18:20:09 easysw Exp $".
+// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.7 2001/11/18 20:52:28 easysw Exp $".
//
diff --git a/src/fl_draw_image_win32.cxx b/src/fl_draw_image_win32.cxx
index 7b4f8069f..93d556393 100644
--- a/src/fl_draw_image_win32.cxx
+++ b/src/fl_draw_image_win32.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_draw_image_win32.cxx,v 1.4.2.3 2001/01/22 15:13:40 easysw Exp $"
+// "$Id: fl_draw_image_win32.cxx,v 1.4.2.3.2.1 2001/11/18 20:52:28 easysw Exp $"
//
// WIN32 image drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -51,7 +51,7 @@
#if USE_COLORMAP
-// error-diffusion dither into the fltk colormap
+// error-diffusion dither into the FLTK colormap
static void dither(uchar* to, const uchar* from, int w, int delta) {
static int ri, gi, bi, dir;
int r=ri, g=gi, b=bi;
@@ -82,7 +82,7 @@ static void dither(uchar* to, const uchar* from, int w, int delta) {
ri = r; gi = g; bi = b;
}
-// error-diffusion dither into the fltk colormap
+// error-diffusion dither into the FLTK colormap
static void monodither(uchar* to, const uchar* from, int w, int delta) {
static int ri,dir;
int r=ri;
@@ -258,5 +258,5 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
}
//
-// End of "$Id: fl_draw_image_win32.cxx,v 1.4.2.3 2001/01/22 15:13:40 easysw Exp $".
+// End of "$Id: fl_draw_image_win32.cxx,v 1.4.2.3.2.1 2001/11/18 20:52:28 easysw Exp $".
//
diff --git a/src/fl_draw_pixmap.cxx b/src/fl_draw_pixmap.cxx
index eb8c92076..37fed65c9 100644
--- a/src/fl_draw_pixmap.cxx
+++ b/src/fl_draw_pixmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_draw_pixmap.cxx,v 1.4.2.8 2001/04/13 19:07:40 easysw Exp $"
+// "$Id: fl_draw_pixmap.cxx,v 1.4.2.8.2.1 2001/11/18 20:52:28 easysw Exp $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -148,7 +148,7 @@ int fl_draw_pixmap(const char*const* di, int x, int y, Fl_Color bg) {
const uchar*const* data = (const uchar*const*)(di+1);
int transparent_index = -1;
- if (ncolors < 0) { // fltk (non standard) compressed colormap
+ if (ncolors < 0) { // FLTK (non standard) compressed colormap
ncolors = -ncolors;
const uchar *p = *data++;
// if first color is ' ' it is transparent (put it later to make
@@ -272,5 +272,5 @@ int fl_draw_pixmap(const char*const* di, int x, int y, Fl_Color bg) {
}
//
-// End of "$Id: fl_draw_pixmap.cxx,v 1.4.2.8 2001/04/13 19:07:40 easysw Exp $".
+// End of "$Id: fl_draw_pixmap.cxx,v 1.4.2.8.2.1 2001/11/18 20:52:28 easysw Exp $".
//
diff --git a/src/makedepend b/src/makedepend
index 56cb5a8df..5ec30ec5e 100644
--- a/src/makedepend
+++ b/src/makedepend
@@ -5,12 +5,12 @@ Fl.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/x.H ../FL/Fl_Window.H
Fl.o: ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H ../FL/fl_draw.H
Fl_Adjuster.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Adjuster.o: ../FL/Fl_Adjuster.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
-Fl_Adjuster.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/fl_draw.H fastarrow.h
-Fl_Adjuster.o: mediumarrow.h slowarrow.h
+Fl_Adjuster.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
+Fl_Adjuster.o: ../FL/fl_draw.H fastarrow.h mediumarrow.h slowarrow.h
Fl_Bitmap.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/x.H
Fl_Bitmap.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_Widget.H
Fl_Bitmap.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Bitmap.H
-Fl_Bitmap.o: ../FL/Fl_Image.H
+Fl_Bitmap.o: ../FL/Fl_Image.H ../FL/x.H
Fl_Browser.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Browser.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Group.H
Fl_Browser.o: ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
@@ -72,7 +72,7 @@ Fl_File_Chooser.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/Fl_Button.H
Fl_File_Chooser.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/fl_ask.H
Fl_File_Chooser.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Choice.H
Fl_File_Chooser.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Bitmap.H
-Fl_File_Chooser.o: ../FL/Fl_Image.H
+Fl_File_Chooser.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
Fl_File_Chooser2.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/Enumerations.H
Fl_File_Chooser2.o: ../FL/Fl_Export.H ../FL/Fl_Window.H ../FL/Fl_Group.H
Fl_File_Chooser2.o: ../FL/Fl_Widget.H ../FL/Fl_File_Browser.H
@@ -102,15 +102,16 @@ Fl_Help_Dialog.o: ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/Fl_Button.H
Fl_Help_View.o: ../FL/Fl_Help_View.H ../FL/Fl.H ../FL/Enumerations.H
Fl_Help_View.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Scrollbar.H
Fl_Help_View.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Widget.H
-Fl_Help_View.o: ../FL/fl_draw.H ../config.h ../FL/Fl_Image.H
-Fl_Help_View.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
+Fl_Help_View.o: ../FL/fl_draw.H ../config.h ../FL/Fl_Image.H ../FL/x.H
+Fl_Help_View.o: ../FL/Fl_Window.H ../FL/Fl_Pixmap.H ../FL/Fl_Image.H
Fl_Image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/fl_draw.H
Fl_Image.o: ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Widget.H
-Fl_Image.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H
+Fl_Image.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H ../FL/x.H
Fl_Input.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Input.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_draw.H
Fl_Input_.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Input_.o: ../FL/Fl_Input_.H ../FL/Fl_Widget.H ../FL/fl_draw.H
+Fl_Input_.o: ../FL/fl_ask.H
Fl_Light_Button.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Light_Button.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H
Fl_Light_Button.o: ../FL/Fl_Widget.H ../FL/fl_draw.H
@@ -148,7 +149,7 @@ Fl_Pack.o: ../FL/Fl_Group.H ../FL/fl_draw.H
Fl_Pixmap.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Pixmap.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H ../FL/Fl_Widget.H
Fl_Pixmap.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Pixmap.H
-Fl_Pixmap.o: ../FL/Fl_Image.H
+Fl_Pixmap.o: ../FL/Fl_Image.H ../FL/x.H
Fl_Positioner.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Positioner.o: ../FL/Fl_Positioner.H ../FL/Fl_Widget.H ../FL/fl_draw.H
Fl_Progress.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
@@ -271,7 +272,7 @@ fl_curve.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Export.H
fl_diamond_box.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
fl_diamond_box.o: ../FL/fl_draw.H
fl_draw.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Export.H
-fl_draw.o: ../FL/Fl_Image.H
+fl_draw.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
fl_draw_image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
fl_draw_image.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H Fl_XColor.H
fl_draw_image.o: ../config.h ../FL/Enumerations.H
@@ -293,7 +294,8 @@ fl_font.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
fl_font.o: ../FL/fl_draw.H ../FL/x.H ../FL/Fl_Window.H Fl_Font.H
fl_labeltype.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
fl_labeltype.o: ../FL/Fl_Widget.H ../FL/Fl_Group.H ../FL/fl_draw.H
-fl_labeltype.o: ../FL/Fl_Image.H ../FL/Fl_Input_.H ../FL/Fl_Widget.H
+fl_labeltype.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
+fl_labeltype.o: ../FL/Fl_Input_.H ../FL/Fl_Widget.H
fl_line_style.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/Fl_Export.H
fl_line_style.o: ../FL/x.H ../FL/Fl_Window.H
fl_oval_box.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
@@ -329,7 +331,7 @@ forms_compatability.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_compatability.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_compatability.o: ../FL/Fl_Window.H ../FL/fl_draw.H
forms_compatability.o: ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
-forms_compatability.o: ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H
+forms_compatability.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_FormsPixmap.H
forms_compatability.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
forms_compatability.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
forms_compatability.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
@@ -350,15 +352,15 @@ forms_compatability.o: ../FL/Fl_Timer.H ../FL/Fl_Repeat_Button.H
forms_bitmap.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_bitmap.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_bitmap.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H
-forms_bitmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H
-forms_bitmap.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
-forms_bitmap.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
-forms_bitmap.o: ../FL/Fl_Valuator.H ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
-forms_bitmap.o: ../FL/Fl_Round_Button.H ../FL/Fl_Check_Button.H
-forms_bitmap.o: ../FL/Fl_Chart.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
-forms_bitmap.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H ../FL/Fl_Counter.H
-forms_bitmap.o: ../FL/Fl_Dial.H ../FL/Fl_Free.H ../FL/fl_ask.H
-forms_bitmap.o: ../FL/fl_show_colormap.H ../FL/filename.H
+forms_bitmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/x.H
+forms_bitmap.o: ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Box.H
+forms_bitmap.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
+forms_bitmap.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Button.H
+forms_bitmap.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H
+forms_bitmap.o: ../FL/Fl_Check_Button.H ../FL/Fl_Chart.H ../FL/Fl_Choice.H
+forms_bitmap.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H
+forms_bitmap.o: ../FL/Fl_Counter.H ../FL/Fl_Dial.H ../FL/Fl_Free.H
+forms_bitmap.o: ../FL/fl_ask.H ../FL/fl_show_colormap.H ../FL/filename.H
forms_bitmap.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/Fl_Window.H
forms_bitmap.o: ../FL/Fl_File_Browser.H ../FL/Fl_File_Icon.H
forms_bitmap.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/fl_ask.H
@@ -370,10 +372,10 @@ forms_free.o: ../FL/Fl_Free.H ../FL/Fl_Widget.H
forms_fselect.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_fselect.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_fselect.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H
-forms_fselect.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H
-forms_fselect.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
-forms_fselect.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
-forms_fselect.o: ../FL/Fl_Valuator.H ../FL/Fl_Button.H
+forms_fselect.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/x.H
+forms_fselect.o: ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Box.H
+forms_fselect.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
+forms_fselect.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Button.H
forms_fselect.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H
forms_fselect.o: ../FL/Fl_Check_Button.H ../FL/Fl_Chart.H ../FL/Fl_Choice.H
forms_fselect.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H
@@ -389,15 +391,15 @@ forms_fselect.o: ../FL/Fl_Timer.H
forms_pixmap.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_pixmap.o: ../FL/Fl_Export.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_pixmap.o: ../FL/Fl_Window.H ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H
-forms_pixmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H
-forms_pixmap.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
-forms_pixmap.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
-forms_pixmap.o: ../FL/Fl_Valuator.H ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
-forms_pixmap.o: ../FL/Fl_Round_Button.H ../FL/Fl_Check_Button.H
-forms_pixmap.o: ../FL/Fl_Chart.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
-forms_pixmap.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H ../FL/Fl_Counter.H
-forms_pixmap.o: ../FL/Fl_Dial.H ../FL/Fl_Free.H ../FL/fl_ask.H
-forms_pixmap.o: ../FL/fl_show_colormap.H ../FL/filename.H
+forms_pixmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/x.H
+forms_pixmap.o: ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Box.H
+forms_pixmap.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
+forms_pixmap.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Button.H
+forms_pixmap.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H
+forms_pixmap.o: ../FL/Fl_Check_Button.H ../FL/Fl_Chart.H ../FL/Fl_Choice.H
+forms_pixmap.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H
+forms_pixmap.o: ../FL/Fl_Counter.H ../FL/Fl_Dial.H ../FL/Fl_Free.H
+forms_pixmap.o: ../FL/fl_ask.H ../FL/fl_show_colormap.H ../FL/filename.H
forms_pixmap.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/Fl_Window.H
forms_pixmap.o: ../FL/Fl_File_Browser.H ../FL/Fl_File_Icon.H
forms_pixmap.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/fl_ask.H
diff --git a/test/image.cxx b/test/image.cxx
index 43840c0c4..565353cdb 100644
--- a/test/image.cxx
+++ b/test/image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: image.cxx,v 1.6.2.3.2.1 2001/08/05 23:58:54 easysw Exp $"
+// "$Id: image.cxx,v 1.6.2.3.2.2 2001/11/18 20:52:28 easysw Exp $"
//
// Fl_Image test program for the Fast Light Tool Kit (FLTK).
//
@@ -33,13 +33,14 @@
#include <FL/Fl_Image.H>
#include <stdio.h>
#include <stdlib.h>
+#include <math.h>
-int width = 75;
-int height = 75;
+int width = 100;
+int height = 100;
uchar *image;
void make_image() {
- image = new uchar[3*width*height];
+ image = new uchar[4*width*height];
uchar *p = image;
for (int y = 0; y < height; y++) {
double Y = double(y)/(height-1);
@@ -48,6 +49,12 @@ void make_image() {
*p++ = uchar(255*((1-X)*(1-Y))); // red in upper-left
*p++ = uchar(255*((1-X)*Y)); // green in lower-left
*p++ = uchar(255*(X*Y)); // blue in lower-right
+ X -= 0.5;
+ Y -= 0.5;
+ int alpha = (int)(255 * sqrt(X * X + Y * Y));
+ if (alpha < 255) *p++ = uchar(alpha); // alpha transparency
+ else *p++ = 255;
+ Y += 0.5;
}
}
}
@@ -114,9 +121,10 @@ int main(int argc, char **argv) {
#endif
Fl_Window window(400,400); ::w = &window;
- Fl_Button b(140,160,120,120,"Image"); ::b = &b;
+ window.color(FL_WHITE);
+ Fl_Button b(140,160,120,120,"Image w/Alpha"); ::b = &b;
make_image();
- (new Fl_RGB_Image(image, width, height))->label(&b);
+ b.image(new Fl_RGB_Image(image, width, height,4));
leftb = new Fl_Toggle_Button(25,75,50,25,"left");
leftb->callback(button_cb);
rightb = new Fl_Toggle_Button(75,75,50,25,"right");
@@ -136,5 +144,5 @@ int main(int argc, char **argv) {
}
//
-// End of "$Id: image.cxx,v 1.6.2.3.2.1 2001/08/05 23:58:54 easysw Exp $".
+// End of "$Id: image.cxx,v 1.6.2.3.2.2 2001/11/18 20:52:28 easysw Exp $".
//
diff --git a/test/makedepend b/test/makedepend
index 720383f3f..4dc209008 100644
--- a/test/makedepend
+++ b/test/makedepend
@@ -21,15 +21,16 @@ ask.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
ask.o: ../FL/fl_ask.H
bitmap.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
bitmap.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H
-bitmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/Fl_Toggle_Button.H
-bitmap.o: ../FL/Fl_Button.H
+bitmap.o: ../FL/Fl_Bitmap.H ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
+bitmap.o: ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H
boxtype.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
boxtype.o: ../FL/Fl_Single_Window.H ../FL/Fl_Window.H ../FL/Fl_Box.H
browser.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
browser.o: ../FL/Fl_Select_Browser.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
browser.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Scrollbar.H
browser.o: ../FL/Fl_Slider.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
-browser.o: ../FL/Fl_Button.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
+browser.o: ../FL/Fl_Button.H ../FL/Fl_Int_Input.H ../FL/Fl_Input.H
+browser.o: ../FL/Fl_Input_.H ../FL/fl_ask.H
button.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
button.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H
buttons.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
@@ -40,7 +41,7 @@ buttons.o: ../FL/Fl_Light_Button.H ../FL/Fl_Light_Button.H
buttons.o: ../FL/Fl_Round_Button.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
checkers.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
checkers.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/Fl_Bitmap.H
-checkers.o: ../FL/Fl_Image.H ../FL/fl_draw.H ../FL/Fl_Menu_Item.H
+checkers.o: ../FL/Fl_Image.H ../FL/x.H ../FL/fl_draw.H ../FL/Fl_Menu_Item.H
checkers.o: ../FL/Fl_Widget.H ../FL/fl_ask.H black_1.xbm black_2.xbm
checkers.o: black_3.xbm black_4.xbm white_1.xbm white_2.xbm white_3.xbm
checkers.o: white_4.xbm blackking_1.xbm blackking_2.xbm blackking_3.xbm
@@ -53,19 +54,20 @@ clock.o: ../FL/Fl_Round_Clock.H ../FL/Fl_Clock.H
colbrowser.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
colbrowser.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
colbrowser.o: ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
-colbrowser.o: ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H
-colbrowser.o: ../FL/Fl_Box.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
-colbrowser.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Button.H
-colbrowser.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H
-colbrowser.o: ../FL/Fl_Check_Button.H ../FL/Fl_Chart.H ../FL/Fl_Choice.H
-colbrowser.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H
-colbrowser.o: ../FL/Fl_Counter.H ../FL/Fl_Valuator.H ../FL/Fl_Dial.H
-colbrowser.o: ../FL/Fl_Free.H ../FL/fl_ask.H ../FL/fl_show_colormap.H
-colbrowser.o: ../FL/filename.H ../FL/Fl_File_Chooser.H ../FL/Fl.H
-colbrowser.o: ../FL/Fl_Window.H ../FL/Fl_File_Browser.H ../FL/Fl_File_Icon.H
-colbrowser.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/fl_ask.H
-colbrowser.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Choice.H
-colbrowser.o: ../FL/Fl_Input.H ../FL/Fl_Menu_Button.H ../FL/Fl_Positioner.H
+colbrowser.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_FormsPixmap.H
+colbrowser.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
+colbrowser.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
+colbrowser.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
+colbrowser.o: ../FL/Fl_Round_Button.H ../FL/Fl_Check_Button.H
+colbrowser.o: ../FL/Fl_Chart.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
+colbrowser.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H ../FL/Fl_Counter.H
+colbrowser.o: ../FL/Fl_Valuator.H ../FL/Fl_Dial.H ../FL/Fl_Free.H
+colbrowser.o: ../FL/fl_ask.H ../FL/fl_show_colormap.H ../FL/filename.H
+colbrowser.o: ../FL/Fl_File_Chooser.H ../FL/Fl.H ../FL/Fl_Window.H
+colbrowser.o: ../FL/Fl_File_Browser.H ../FL/Fl_File_Icon.H ../FL/Fl_Button.H
+colbrowser.o: ../FL/Fl_Return_Button.H ../FL/fl_ask.H ../FL/Fl_Input.H
+colbrowser.o: ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/Fl_Input.H
+colbrowser.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Positioner.H
colbrowser.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H
color_chooser.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
color_chooser.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
@@ -73,8 +75,9 @@ color_chooser.o: ../FL/Fl_Box.H ../FL/Fl_Button.H ../FL/fl_show_colormap.H
color_chooser.o: ../FL/Fl_Color_Chooser.H ../FL/Fl_Group.H
color_chooser.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/Fl_Choice.H
color_chooser.o: ../FL/Fl_Value_Input.H ../FL/Fl_Valuator.H ../FL/Fl_Input.H
-color_chooser.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H ../FL/fl_draw.H
-color_chooser.o: list_visuals.cxx ../config.h
+color_chooser.o: ../FL/Fl_Input_.H ../FL/Fl_Image.H ../FL/x.H
+color_chooser.o: ../FL/Fl_Window.H ../FL/x.H ../FL/fl_draw.H list_visuals.cxx
+color_chooser.o: ../config.h
cube.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
cube.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H
cube.o: ../FL/Fl_Button.H ../FL/Fl_Radio_Light_Button.H
@@ -91,7 +94,7 @@ curve.o: ../FL/Fl_Slider.H ../FL/fl_draw.H ../FL/Fl_Toggle_Button.H
curve.o: ../FL/Fl_Button.H
demo.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
demo.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Button.H
-demo.o: ../FL/filename.H ../FL/x.H ../FL/Fl_Window.H
+demo.o: ../FL/filename.H ../FL/x.H
doublebuffer.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
doublebuffer.o: ../FL/Fl_Single_Window.H ../FL/Fl_Window.H
doublebuffer.o: ../FL/Fl_Double_Window.H ../FL/Fl_Box.H ../FL/fl_draw.H
@@ -122,7 +125,7 @@ fonts.o: ../FL/Fl_Slider.H ../FL/fl_draw.H ../FL/Fl_Box.H ../FL/fl_ask.H
forms.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms.o: ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
forms.o: ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
-forms.o: ../FL/Fl_Image.H ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H
+forms.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H
forms.o: ../FL/Fl_Box.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
forms.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Button.H
forms.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H
@@ -165,8 +168,9 @@ iconize.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
iconize.o: ../FL/Fl_Button.H ../FL/Fl_Box.H
image.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
image.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H
-image.o: ../FL/Fl_Image.H ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H
-image.o: ../FL/x.H ../FL/Fl_Window.H list_visuals.cxx ../config.h
+image.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
+image.o: ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H ../FL/x.H
+image.o: list_visuals.cxx ../config.h
input.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
input.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Input.H
input.o: ../FL/Fl_Input_.H ../FL/Fl_Float_Input.H ../FL/Fl_Input.H
@@ -207,10 +211,10 @@ navigation.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
navigation.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H
output.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
output.o: ../FL/Fl_Value_Input.H ../FL/Fl_Valuator.H ../FL/Fl_Input.H
-output.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Box.H
-output.o: ../FL/Fl_Hor_Value_Slider.H ../FL/Fl_Value_Slider.H
-output.o: ../FL/Fl_Slider.H ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H
-output.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/fl_draw.H
+output.o: ../FL/Fl_Input_.H ../FL/Fl_Window.H ../FL/Fl_Group.H
+output.o: ../FL/Fl_Widget.H ../FL/Fl_Box.H ../FL/Fl_Hor_Value_Slider.H
+output.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Slider.H ../FL/Fl_Toggle_Button.H
+output.o: ../FL/Fl_Button.H ../FL/Fl_Input.H ../FL/fl_draw.H
output.o: ../FL/Fl_Output.H ../FL/Fl_Multiline_Output.H ../FL/Fl_Output.H
overlay.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
overlay.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
@@ -218,18 +222,19 @@ overlay.o: ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H
overlay.o: ../FL/Fl_Window.H ../FL/Fl_Button.H ../FL/fl_draw.H
pixmap.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Window.H
pixmap.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H
-pixmap.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H porsche.xpm
-pixmap.o: ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H ../FL/Fl_Multi_Label.H
+pixmap.o: ../FL/Fl_Pixmap.H ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
+pixmap.o: porsche.xpm ../FL/Fl_Toggle_Button.H ../FL/Fl_Button.H
+pixmap.o: ../FL/Fl_Multi_Label.H
pixmap_browser.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
pixmap_browser.o: ../FL/Fl_Box.H ../FL/Fl_Window.H ../FL/Fl_Group.H
pixmap_browser.o: ../FL/Fl_Widget.H ../FL/Fl_Button.H ../FL/Fl_Pixmap.H
-pixmap_browser.o: ../FL/Fl_Image.H ../FL/Fl_File_Chooser.H
-pixmap_browser.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H
-pixmap_browser.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
-pixmap_browser.o: ../FL/Fl_File_Icon.H ../FL/Fl.H ../FL/Fl_Return_Button.H
-pixmap_browser.o: ../FL/Fl_Button.H ../FL/fl_ask.H ../FL/Fl_Input.H
-pixmap_browser.o: ../FL/Fl_Input_.H ../FL/Fl_Choice.H ../FL/fl_message.H
-pixmap_browser.o: ../FL/fl_ask.H
+pixmap_browser.o: ../FL/Fl_Image.H ../FL/x.H ../FL/Fl_Window.H
+pixmap_browser.o: ../FL/Fl_File_Chooser.H ../FL/Fl_File_Browser.H
+pixmap_browser.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
+pixmap_browser.o: ../FL/Fl_Slider.H ../FL/Fl_File_Icon.H ../FL/Fl.H
+pixmap_browser.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H ../FL/fl_ask.H
+pixmap_browser.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Choice.H
+pixmap_browser.o: ../FL/fl_message.H ../FL/fl_ask.H
radio.o: radio.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
radio.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
radio.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
@@ -275,8 +280,8 @@ valuators.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
valuators.o: ../FL/Fl_Box.H ../FL/Fl_Slider.H ../FL/Fl_Value_Slider.H
valuators.o: ../FL/Fl_Slider.H ../FL/Fl_Adjuster.H ../FL/Fl_Valuator.H
valuators.o: ../FL/Fl_Counter.H ../FL/Fl_Dial.H ../FL/Fl_Roller.H
-valuators.o: ../FL/Fl_Value_Input.H ../FL/Fl_Input.H ../FL/Fl_Value_Output.H
-valuators.o: ../FL/Fl_Scrollbar.H
+valuators.o: ../FL/Fl_Value_Input.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
+valuators.o: ../FL/Fl_Value_Output.H ../FL/Fl_Scrollbar.H
fast_slow.o: fast_slow.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
fast_slow.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
fast_slow.o: ../FL/Fl_Slider.H ../FL/Fl_Box.H