+#ifdef __MAEMO__
+#define TOUCH_SENSITIVITY 20
+static int button_pressed = 0;
+static int button_pressed_x = 0;
+static int button_pressed_y = 0;
+static int dragging = 0;
+
+static void maemo_play_loop_point(int id, int x, int y, int dx, int dy)
+{
+ if (!dragging && button_pressed)
+ {
+ /* check how much we've moved */
+ if (abs(x - button_pressed_x) > TOUCH_SENSITIVITY ||
+ abs(y - button_pressed_y) > TOUCH_SENSITIVITY)
+ dragging = 1;
+ }
+
+ if (dragging)
+ {
+ if (dx > 0)
+ {
+ view_rotate.d = DIR_R;
+ view_rotate.R = dx / 15.0;
+ }
+ else
+ {
+ view_rotate.d = DIR_L;
+ view_rotate.L = dx / 15.0;
+ }
+ }
+}
+
+static void maemo_play_loop_click(int b, int d)
+{
+ if (d)
+ {
+ int y;
+ SDL_GetMouseState(&button_pressed_x, &y);
+ button_pressed_y = -y + config_get_d(CONFIG_HEIGHT);
+ }
+ else
+ {
+ VIEWR_SET_R(0);
+ VIEWR_SET_L(0);
+ }
+ button_pressed = d;
+ dragging = 0;
+}
+#endif
+