diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2026-08-24 11:16:07 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2026-08-24 11:16:07 +0200 |
| commit | c068f22329d5cc722622a2183bbb22eef2093df7 (patch) | |
| tree | 12d56c1aede67988a55e241364606bfbb4dba933 /src/parsec/include/e_mouse.h | |
| download | openparsec-c068f22329d5cc722622a2183bbb22eef2093df7.tar.xz openparsec-c068f22329d5cc722622a2183bbb22eef2093df7.zip | |
Diffstat (limited to 'src/parsec/include/e_mouse.h')
| -rw-r--r-- | src/parsec/include/e_mouse.h | 51 |
1 files changed, 51 insertions, 0 deletions
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_ + + |
