From c068f22329d5cc722622a2183bbb22eef2093df7 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 24 Aug 2026 11:16:07 +0200 Subject: initial import --- src/parsec/include/e_mouse.h | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/parsec/include/e_mouse.h (limited to 'src/parsec/include/e_mouse.h') diff --git a/src/parsec/include/e_mouse.h b/src/parsec/include/e_mouse.h new file mode 100644 index 0000000..b9985d1 --- /dev/null +++ b/src/parsec/include/e_mouse.h @@ -0,0 +1,51 @@ +/* + * PARSEC HEADER: e_mouse.h + */ + +#ifndef _E_MOUSE_H_ +#define _E_MOUSE_H_ + + +// mouse area definition in reference size + +struct mouse_area_s { + + int xpos; + int ypos; + int width; + int height; +}; + + +// mouse area definition for scaled coordinates + +struct mouse_area_scaled_s { + + int xleft; + int xright; + int ytop; + int ybottom; +}; + + +// external functions + +void MouseCalcScaledAreas( mouse_area_s *src, mouse_area_scaled_s *dst, int numareas ); +int DrawMouseCursor(); + + +// determine whether a position is within the supplied area ------------------- +// +inline +int MouseOverArea( mouse_area_scaled_s *area, int mousex, int mousey ) +{ + ASSERT( area != NULL ); + + return ( ( mousex >= area->xleft ) && ( mousex < area->xright ) && + ( mousey >= area->ytop ) && ( mousey < area->ybottom ) ); +} + + +#endif // _E_MOUSE_H_ + + -- cgit v1.2.3