visobj.hpp 960 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef VIS_OBJECT_HPP
  2. #define VIS_OBJECT_HPP
  3. #include "jwindow.hpp"
  4. #include "filter.hpp"
  5. class visual_object
  6. {
  7. public :
  8. virtual void draw(image *screen, int x, int y, window_manager *wm, filter *f) = 0;
  9. virtual int width(window_manager *wm) = 0;
  10. virtual int height(window_manager *wm) = 0;
  11. } ;
  12. class image_visual : public visual_object
  13. {
  14. public :
  15. image *im;
  16. image_visual(image *img) { im=img; }
  17. virtual void draw(image *screen, int x, int y,
  18. window_manager *wm, filter *f);
  19. virtual int width(window_manager *wm) { return im->width(); }
  20. virtual int height(window_manager *wm) { return im->height(); }
  21. } ;
  22. class string_visual : public visual_object
  23. {
  24. char *st;
  25. int color;
  26. int w,h;
  27. public :
  28. string_visual(char *string, int Color);
  29. virtual void draw(image *screen, int x, int y,
  30. window_manager *wm, filter *f);
  31. virtual int width(window_manager *wm);
  32. virtual int height(window_manager *wm);
  33. } ;
  34. #endif