st_edit.hh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 ST_EDIT_HH
  9. #define ST_EDIT_HH
  10. #include "window/window.hh"
  11. #include "device/device.hh"
  12. #include "string/string.hh"
  13. #include "math/num_type.hh"
  14. class i4_image_class;
  15. class i4_text_input_class;
  16. class m1_st_edit_window_class : public i4_window_class
  17. {
  18. private:
  19. enum { LEFT = 1, RIGHT = 2, MIDDLE = 3 };
  20. int grab;
  21. int last_x, last_y, last_but;
  22. i4_image_class *texture;
  23. int preselect_x, preselect_y;
  24. int snap_off_x, snap_off_y;
  25. i4_bool verts_are_selected();
  26. i4_bool dragging;
  27. i4_text_input_class *tname_edit;
  28. void get_point(int poly, int num, int &x, int &y);
  29. void drag_points(int xc, int yc);
  30. i4_float twidth() const;
  31. i4_float theight() const;
  32. public:
  33. void edit_poly_changed();
  34. m1_st_edit_window_class(w16 w , w16 h, i4_text_input_class *tname_edit);
  35. void draw(i4_draw_context_class &context);
  36. void receive_event(i4_event *ev);
  37. void change_current_texture(i4_const_str new_name);
  38. void change_current_verts();
  39. void select_point(int point);
  40. char *name() { return "texture coord editor"; }
  41. };
  42. extern i4_event_handler_reference_class<m1_st_edit_window_class> m1_st_edit;
  43. #endif