summaryrefslogtreecommitdiff
path: root/FL
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 /FL
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
Diffstat (limited to 'FL')
-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
5 files changed, 31 insertions, 16 deletions
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 $".
//