rebox.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef rebox_H_INCLUDED
  2. #define rebox_H_INCLUDED
  3. #include "eruta.h"
  4. typedef struct Rebox_ Rebox;
  5. /** Rebox is short for REctangular BOX. It's a rectangular
  6. box with given position and size. */
  7. struct Rebox_ {
  8. Point at;
  9. Point size;
  10. };
  11. Rebox rebox_make (int x , int y , int w , int h );
  12. Rebox * rebox_initbounds (Rebox * self , Rebox bounds );
  13. Rebox * rebox_init (Rebox * self , int x , int y , int w , int h );
  14. Rebox rebox_new (float x , float y , float w , float h );
  15. Point rebox_at (Rebox * self );
  16. Point rebox_x_ (Rebox * self , float x );
  17. Point rebox_y_ (Rebox * self , float y );
  18. Point rebox_xy_ (Rebox * self , float x , float y );
  19. Point rebox_at_ (Rebox * self , Point at );
  20. float rebox_x (Rebox * self );
  21. float rebox_y (Rebox * self );
  22. float rebox_w (Rebox * self );
  23. float rebox_h (Rebox * self );
  24. Point rebox_br(Rebox * self);
  25. float rebox_br_x (Rebox * self );
  26. float rebox_br_y (Rebox * self );
  27. float rebox_center_x (Rebox * self );
  28. float rebox_center_y (Rebox * self );
  29. Point rebox_center (Rebox * self );
  30. Point rebox_center_ (Rebox * self , Point center );
  31. int rebox_inside_p (Rebox * self , Rebox * other );
  32. double rebox_delta_x (Rebox * self , Rebox * other );
  33. double rebox_delta_y (Rebox * self , Rebox * other );
  34. int rebox_coordinates_inside_p(Rebox * self, double x, double y);
  35. int rebox_point_inside_p(Rebox * self, Point * point);
  36. #endif