libeek: add eek_keyboard_find_key_by_position().

This commit is contained in:
Daiki Ueno
2010-08-05 12:31:43 +09:00
parent 94219bd31e
commit 039ea44520
10 changed files with 162 additions and 78 deletions

View File

@ -28,6 +28,7 @@
#endif /* HAVE_CONFIG_H */
#include "eek-types.h"
#include <math.h>
/* EekKeysymMatrix */
static EekKeysymMatrix *
@ -81,6 +82,19 @@ eek_point_get_type (void)
return our_type;
}
void
eek_point_rotate (EekPoint *point, gint angle)
{
EekPoint *p;
gdouble r, phi;
phi = atan2 (point->y, point->x);
r = sqrt (point->x * point->x + point->y * point->y);
phi += angle * M_PI / 180;
point->x = r * cos (phi);
point->y = r * sin (phi);
}
/* EekBounds */
static EekBounds *
eek_bounds_copy (const EekBounds *bounds)