FLTK 1.3.0
|
00001 // 00002 // "$Id$" 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. Distribution and use rights are outlined in 00009 // the file "COPYING" which should have been included with this file. If this 00010 // file is missing or damaged, see the license at: 00011 // 00012 // http://www.fltk.org/COPYING.php 00013 // 00014 // Please report all bugs and problems on the following page: 00015 // 00016 // http://www.fltk.org/str.php 00017 // 00018 00019 /* \file 00020 Fl_Bitmap widget . */ 00021 00022 #ifndef Fl_Bitmap_H 00023 #define Fl_Bitmap_H 00024 # include "Fl_Image.H" 00025 00026 class Fl_Widget; 00027 struct Fl_Menu_Item; 00028 00033 class FL_EXPORT Fl_Bitmap : public Fl_Image { 00034 friend class Fl_Quartz_Graphics_Driver; 00035 friend class Fl_GDI_Graphics_Driver; 00036 friend class Fl_Xlib_Graphics_Driver; 00037 public: 00038 00040 const uchar *array; 00042 int alloc_array; 00043 00044 private: 00045 00046 #if defined(__APPLE__) || defined(WIN32) 00047 00048 void *id_; 00049 #else 00050 00051 unsigned id_; 00052 #endif // __APPLE__ || WIN32 00053 00054 public: 00055 00057 Fl_Bitmap(const uchar *bits, int W, int H) : 00058 Fl_Image(W,H,0), array(bits), alloc_array(0), id_(0) {data((const char **)&array, 1);} 00060 Fl_Bitmap(const char *bits, int W, int H) : 00061 Fl_Image(W,H,0), array((const uchar *)bits), alloc_array(0), id_(0) {data((const char **)&array, 1);} 00062 virtual ~Fl_Bitmap(); 00063 virtual Fl_Image *copy(int W, int H); 00064 Fl_Image *copy() { return copy(w(), h()); } 00065 virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0); 00066 void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);} 00067 virtual void label(Fl_Widget*w); 00068 virtual void label(Fl_Menu_Item*m); 00069 virtual void uncache(); 00070 }; 00071 00072 #endif 00073 00074 // 00075 // End of "$Id$". 00076 //