deco_win.hh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /********************************************************************** <BR>
  2. This file is part of Crack dot Com's free source code release of
  3. Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
  4. information about compiling & licensing issues visit this URL</a>
  5. <PRE> If that doesn't help, contact Jonathan Clark at
  6. golgotha_source@usa.net (Subject should have "GOLG" in it)
  7. ***********************************************************************/
  8. #ifndef I4_DECO_WIN_HH
  9. #define I4_DECO_WIN_HH
  10. #include "window/style.hh"
  11. class i4_deco_window_class : public i4_parent_window_class
  12. {
  13. i4_bool in;
  14. sw32 x1,y1;
  15. i4_graphical_style_class *style;
  16. public:
  17. i4_deco_window_class(w16 w, w16 h, // size not including deco border
  18. i4_bool in, // pressed in or out look?
  19. i4_graphical_style_class *style)
  20. : i4_parent_window_class(0,0),
  21. in(in),
  22. style(style)
  23. {
  24. w32 l,r,t,b;
  25. if (in)
  26. style->get_in_deco_size(l,r,t,b);
  27. else
  28. style->get_out_deco_size(l,r,t,b);
  29. x1=l; y1=r;
  30. resize(w+l+r, h+t+b);
  31. }
  32. sw32 get_x1() { return x1; }
  33. sw32 get_y1() { return y1; }
  34. virtual void parent_draw(i4_draw_context_class &context)
  35. {
  36. w32 l,r,t,b;
  37. if (in)
  38. {
  39. style->get_in_deco_size(l,r,t,b);
  40. style->draw_in_deco(local_image, 0,0, width()-1, height()-1, i4_F, context);
  41. }
  42. else
  43. {
  44. style->get_out_deco_size(l,r,t,b);
  45. style->draw_in_deco(local_image, 0,0, width()-1, height()-1, i4_F, context);
  46. }
  47. style->deco_neutral_fill(local_image, l,t, width()-r, height()-b, context);
  48. // local_image->bar(l,t, width()-r, height()-b,
  49. // style->color_hint->window.passive.medium,
  50. // context);
  51. }
  52. char *name() { return "deco_window"; }
  53. } ;
  54. #endif