You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.1KB

  1. //
  2. // "$Id: Fluid_Image.h 7903 2010-11-28 21:06:39Z matt $"
  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; you can redistribute it and/or
  13. // modify it under the terms of the GNU Library General Public
  14. // License as published by the Free Software Foundation; either
  15. // version 2 of the License, or (at your option) any later version.
  16. //
  17. // This library is distributed in the hope that it will be useful,
  18. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. // Library General Public License for more details.
  21. //
  22. // You should have received a copy of the GNU Library General Public
  23. // License along with this library; if not, write to the Free Software
  24. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  25. // USA.
  26. //
  27. // Please report all bugs and problems on the following page:
  28. //
  29. // http://www.fltk.org/str.php
  30. //
  31. #ifndef FLUID_IMAGE_H
  32. # define FLUID_IMAGE_H
  33. # include <FL/Fl_Shared_Image.H>
  34. class Fluid_Image {
  35. const char *name_;
  36. int refcount;
  37. Fl_Shared_Image *img;
  38. protected:
  39. Fluid_Image(const char *name); // no public constructor
  40. ~Fluid_Image(); // no public destructor
  41. public:
  42. int written;
  43. static Fluid_Image* find(const char *);
  44. void decrement(); // reference counting & automatic free
  45. void increment();
  46. void image(Fl_Widget *); // set the image of this widget
  47. void deimage(Fl_Widget *); // set the deimage of this widget
  48. void write_static();
  49. void write_code(const char *var, int inactive = 0);
  50. const char *name() const {return name_;}
  51. };
  52. // pop up file chooser and return a legal image selected by user,
  53. // or zero for any errors:
  54. Fluid_Image *ui_find_image(const char *);
  55. extern const char *ui_find_image_name;
  56. #endif
  57. //
  58. // End of "$Id: Fluid_Image.h 7903 2010-11-28 21:06:39Z matt $".
  59. //