• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

Fl_Bitmap.H

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_GDI_Printer_Graphics_Driver;
00037   friend class Fl_Xlib_Graphics_Driver;
00038 public:
00039 
00041   const uchar *array;
00043   int alloc_array;
00044   
00045   private:
00046   int start(int XP, int YP, int WP, int HP, int &cx, int &cy, 
00047             int &X, int &Y, int &W, int &H);
00048 #if defined(__APPLE__) || defined(WIN32)
00049 
00050   void *id_;
00051 #else
00052 
00053   unsigned id_;
00054 #endif // __APPLE__ || WIN32
00055 
00056   public:
00057 
00059   Fl_Bitmap(const uchar *bits, int W, int H) :
00060     Fl_Image(W,H,0), array(bits), alloc_array(0), id_(0) {data((const char **)&array, 1);}
00062   Fl_Bitmap(const char *bits, int W, int H) :
00063     Fl_Image(W,H,0), array((const uchar *)bits), alloc_array(0), id_(0) {data((const char **)&array, 1);}
00064   virtual ~Fl_Bitmap();
00065   virtual Fl_Image *copy(int W, int H);
00066   Fl_Image *copy() { return copy(w(), h()); }
00067   virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
00068   void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
00069   virtual void label(Fl_Widget*w);
00070   virtual void label(Fl_Menu_Item*m);
00071   virtual void uncache();
00072 };
00073 
00074 #endif
00075 
00076 //
00077 // End of "$Id$".
00078 //
  • © 1998-2016 by Bill Spitzak and others.     FLTK

  • © 1998-2016 by Bill Spitzak and others.     FLTK

    Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.