Fluid_Image.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // "$Id: Fluid_Image.h 8864 2011-07-19 04:49:30Z greg.ercolano $"
  3. //
  4. // Image header file for the Fast Light Tool Kit (FLTK).
  5. //
  6. // This class stores the image labels for widgets in fluid. This is
  7. // not a class in FLTK itself, and will produce different types of
  8. // code depending on what the image type is.
  9. //
  10. // Copyright 1998-2010 by Bill Spitzak and others.
  11. //
  12. // This library is free software. Distribution and use rights are outlined in
  13. // the file "COPYING" which should have been included with this file. If this
  14. // file is missing or damaged, see the license at:
  15. //
  16. // http://www.fltk.org/COPYING.php
  17. //
  18. // Please report all bugs and problems on the following page:
  19. //
  20. // http://www.fltk.org/str.php
  21. //
  22. #ifndef FLUID_IMAGE_H
  23. # define FLUID_IMAGE_H
  24. # include <FL/Fl_Shared_Image.H>
  25. class Fluid_Image {
  26. const char *name_;
  27. int refcount;
  28. Fl_Shared_Image *img;
  29. protected:
  30. Fluid_Image(const char *name); // no public constructor
  31. ~Fluid_Image(); // no public destructor
  32. public:
  33. int written;
  34. static Fluid_Image* find(const char *);
  35. void decrement(); // reference counting & automatic free
  36. void increment();
  37. void image(Fl_Widget *); // set the image of this widget
  38. void deimage(Fl_Widget *); // set the deimage of this widget
  39. void write_static();
  40. void write_code(const char *var, int inactive = 0);
  41. const char *name() const {return name_;}
  42. };
  43. // pop up file chooser and return a legal image selected by user,
  44. // or zero for any errors:
  45. Fluid_Image *ui_find_image(const char *);
  46. extern const char *ui_find_image_name;
  47. #endif
  48. //
  49. // End of "$Id: Fluid_Image.h 8864 2011-07-19 04:49:30Z greg.ercolano $".
  50. //