FLTK 1.3.0
Fl_Bitmap.H
00001 //
00002 // "$Id: Fl_Bitmap.H 7903 2010-11-28 21:06:39Z matt $"
00003 //
00004 // Bitmap header file for the Fast Light Tool Kit (FLTK).
00005 //
00006 // Copyright 1998-2010 by Bill Spitzak and others.
00007 //
00008 // This library is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU Library General Public
00010 // License as published by the Free Software Foundation; either
00011 // version 2 of the License, or (at your option) any later version.
00012 //
00013 // This library is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 // Library General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU Library General Public
00019 // License along with this library; if not, write to the Free Software
00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021 // USA.
00022 //
00023 // Please report all bugs and problems on the following page:
00024 //
00025 //     http://www.fltk.org/str.php
00026 //
00027 
00028 /* \file
00029    Fl_Bitmap widget . */
00030 
00031 #ifndef Fl_Bitmap_H
00032 #define Fl_Bitmap_H
00033 #  include "Fl_Image.H"
00034 
00035 class Fl_Widget;
00036 struct Fl_Menu_Item;
00037 
00042 class FL_EXPORT Fl_Bitmap : public Fl_Image {
00043   friend class Fl_Quartz_Graphics_Driver;
00044   friend class Fl_GDI_Graphics_Driver;
00045   friend class Fl_Xlib_Graphics_Driver;
00046 public:
00047 
00049   const uchar *array;
00051   int alloc_array;
00052   
00053   private:
00054 
00055 #if defined(__APPLE__) || defined(WIN32)
00056 
00057   void *id_;
00058 #else
00059 
00060   unsigned id_;
00061 #endif // __APPLE__ || WIN32
00062 
00063   public:
00064 
00066   Fl_Bitmap(const uchar *bits, int W, int H) :
00067     Fl_Image(W,H,0), array(bits), alloc_array(0), id_(0) {data((const char **)&array, 1);}
00069   Fl_Bitmap(const char *bits, int W, int H) :
00070     Fl_Image(W,H,0), array((const uchar *)bits), alloc_array(0), id_(0) {data((const char **)&array, 1);}
00071   virtual ~Fl_Bitmap();
00072   virtual Fl_Image *copy(int W, int H);
00073   Fl_Image *copy() { return copy(w(), h()); }
00074   virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
00075   void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
00076   virtual void label(Fl_Widget*w);
00077   virtual void label(Fl_Menu_Item*m);
00078   virtual void uncache();
00079 };
00080 
00081 #endif
00082 
00083 //
00084 // End of "$Id: Fl_Bitmap.H 7903 2010-11-28 21:06:39Z matt $".
00085 //