fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
  SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fluid_Image.h

Go to the documentation of this file.
00001 //
00002 // "$Id: Fluid_Image.h 7903 2010-11-28 21:06:39Z matt $"
00003 //
00004 // Image header file for the Fast Light Tool Kit (FLTK).
00005 //
00006 // This class stores the image labels for widgets in fluid.  This is
00007 // not a class in FLTK itself, and will produce different types of
00008 // code depending on what the image type is.
00009 //
00010 // Copyright 1998-2010 by Bill Spitzak and others.
00011 //
00012 // This library is free software; you can redistribute it and/or
00013 // modify it under the terms of the GNU Library General Public
00014 // License as published by the Free Software Foundation; either
00015 // version 2 of the License, or (at your option) any later version.
00016 //
00017 // This library is distributed in the hope that it will be useful,
00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 // Library General Public License for more details.
00021 //
00022 // You should have received a copy of the GNU Library General Public
00023 // License along with this library; if not, write to the Free Software
00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 // USA.
00026 //
00027 // Please report all bugs and problems on the following page:
00028 //
00029 //     http://www.fltk.org/str.php
00030 //
00031 
00032 #ifndef FLUID_IMAGE_H
00033 #  define FLUID_IMAGE_H
00034 
00035 #  include <FL/Fl_Shared_Image.H>
00036 
00037 
00038 class Fluid_Image {
00039   const char *name_;
00040   int refcount;
00041   Fl_Shared_Image *img;
00042 protected:
00043   Fluid_Image(const char *name); // no public constructor
00044   ~Fluid_Image(); // no public destructor
00045 public:
00046   int written;
00047   static Fluid_Image* find(const char *);
00048   void decrement(); // reference counting & automatic free
00049   void increment();
00050   void image(Fl_Widget *); // set the image of this widget
00051   void deimage(Fl_Widget *); // set the deimage of this widget
00052   void write_static();
00053   void write_code(const char *var, int inactive = 0);
00054   const char *name() const {return name_;}
00055 };
00056 
00057 // pop up file chooser and return a legal image selected by user,
00058 // or zero for any errors:
00059 Fluid_Image *ui_find_image(const char *);
00060 extern const char *ui_find_image_name;
00061 
00062 #endif
00063 
00064 //
00065 // End of "$Id: Fluid_Image.h 7903 2010-11-28 21:06:39Z matt $".
00066 //