* @ingroup Elm_Gesture_Layer
*/
static double
-get_angle(Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2)
+get_angle(Evas_Coord xx1, Evas_Coord yy1, Evas_Coord xx2, Evas_Coord yy2)
{
double a, xx, yy, rt = (-1);
- xx = fabs(x2 - x1);
- yy = fabs(y2 - y1);
+ xx = fabs(xx2 - xx1);
+ yy = fabs(yy2 - yy1);
- if (((int) xx) && ((int) yy))
+ if (((int)xx) && ((int)yy))
{
rt = a = RAD2DEG(atan(yy / xx));
- if (x1 < x2)
+ if (xx1 < xx2)
{
- if (y1 < y2)
- {
- rt = 360 - a;
- }
- else
- {
- rt = (a);
- }
+ if (yy1 < yy2) rt = 360 - a;
+ else rt = a;
}
else
{
- if (y1 < y2)
- {
- rt = 180 + a;
- }
- else
- {
- rt = 180 - a;
- }
+ if (yy1 < yy2) rt = 180 + a;
+ else rt = 180 - a;
}
}
if (rt < 0)
{ /* Do this only if rt is not set */
- if (((int) xx))
+ if (((int)xx))
{ /* Horizontal line */
- if (x2 < x1)
- {
- rt = 180;
- }
- else
- {
- rt = 0.0;
- }
+ if (xx2 < xx1) rt = 180;
+ else rt = 0.0;
}
else
{ /* Vertical line */
- if (y2 < y1)
- {
- rt = 90;
- }
- else
- {
- rt = 270;
- }
+ if (yy2 < yy1) rt = 90;
+ else rt = 270;
}
}
* original circle 180 0 We want: 270 90
* 270 180
*/
-
rt = 450 - rt;
- if (rt >= 360)
- rt -= 360;
+ if (rt >= 360) rt -= 360;
return rt;
}
* @ingroup Elm_Gesture_Layer
*/
static void
-get_vector(Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2,
- Evas_Coord *l, double *a)
+get_vector(Evas_Coord xx1, Evas_Coord yy1, Evas_Coord xx2, Evas_Coord yy2,
+ Evas_Coord *l, double *a)
{
Evas_Coord xx, yy;
- xx = x2 - x1;
- yy = y2 - y1;
- *l = (Evas_Coord) sqrt(xx*xx + yy*yy);
- *a = get_angle(x1, y1, x2, y2);
+ xx = xx2 - xx1;
+ yy = yy2 - yy1;
+ *l = (Evas_Coord) sqrt((xx * xx) + (yy * yy));
+ *a = get_angle(xx1, yy1, xx2, yy2);
}
static int
-_get_direction(Evas_Coord x1, Evas_Coord x2)
+_get_direction(Evas_Coord xx1, Evas_Coord xx2)
{
- if (x2 < x1)
- return -1;
-
- if (x2 > x1)
- return 1;
-
+ if (xx2 < xx1) return -1;
+ if (xx2 > xx1) return 1;
return 0;
}
/**
*/
static void
_momentum_test(Evas_Object *obj, Pointer_Event *pe,
- void *event_info, Evas_Callback_Type event_type,
- Elm_Gesture_Type g_type)
+ void *event_info, Evas_Callback_Type event_type,
+ Elm_Gesture_Type g_type)
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
* @ingroup Elm_Gesture_Layer
*/
static Evas_Coord
-get_finger_gap_length(Evas_Coord x1, Evas_Coord y1, Evas_Coord x2,
- Evas_Coord y2, Evas_Coord *x, Evas_Coord *y)
+get_finger_gap_length(Evas_Coord xx1, Evas_Coord yy1,
+ Evas_Coord xx2, Evas_Coord yy2,
+ Evas_Coord *x, Evas_Coord *y)
{
double a, b, xx, yy, gap;
- xx = fabs(x2 - x1);
- yy = fabs(y2 - y1);
- gap = sqrt(xx*xx + yy*yy);
+ xx = fabs(xx2 - xx1);
+ yy = fabs(yy2 - yy1);
+ gap = sqrt((xx * xx) + (yy * yy));
/* START - Compute zoom center point */
/* The triangle defined as follows:
* b
* http://en.wikipedia.org/wiki/Trigonometric_functions
*************************************/
- if (((int) xx) && ((int) yy))
+ if (((int)xx) && ((int)yy))
{
double A = atan((yy / xx));
#if defined(DEBUG_GESTURE_LAYER)
#endif
a = (Evas_Coord) ((gap / 2) * sin(A));
b = (Evas_Coord) ((gap / 2) * cos(A));
- *x = (Evas_Coord) ((x2 > x1) ? (x1 + b) : (x2 + b));
- *y = (Evas_Coord) ((y2 > y1) ? (y1 + a) : (y2 + a));
+ *x = (Evas_Coord) ((xx2 > xx1) ? (xx1 + b) : (xx2 + b));
+ *y = (Evas_Coord) ((yy2 > yy1) ? (yy1 + a) : (yy2 + a));
}
else
{
- if ((int) xx)
+ if ((int)xx)
{ /* horiz line, take half width */
#if defined(DEBUG_GESTURE_LAYER)
printf("==== HORIZ ====\n");
#endif
- *x = (Evas_Coord) ((x1 + x2) / 2);
- *y = (Evas_Coord) (y1);
+ *x = (Evas_Coord) ((xx1 + xx2) / 2);
+ *y = (Evas_Coord) (yy1);
}
- if ((int) yy)
+ if ((int)yy)
{ /* vert line, take half width */
#if defined(DEBUG_GESTURE_LAYER)
printf("==== VERT ====\n");
#endif
- *x = (Evas_Coord) (x1);
- *y = (Evas_Coord) ((y1 + y2) / 2);
+ *x = (Evas_Coord) (xx1);
+ *y = (Evas_Coord) ((yy1 + yy2) / 2);
}
}
/* END - Compute zoom center point */
static void _menu_move_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _menu_hide(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data);
-static void _elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Object *icon_obj, const char *icon_str, double icon_size, const char *signal);
-static void _item_label_set(Elm_Toolbar_Item *item, const char *label, const char *signal);
+static void _elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Object *icon_obj, const char *icon_str, double icon_size, const char *sig);
+static void _item_label_set(Elm_Toolbar_Item *item, const char *label, const char *sig);
static const char SIG_CLICKED[] = "clicked";
static const char SIG_LONGPRESSED[] = "longpressed";
}
static void
-_item_label_set(Elm_Toolbar_Item *item, const char *label, const char *signal)
+_item_label_set(Elm_Toolbar_Item *item, const char *label, const char *sig)
{
const char *s;
if ((s) && (atoi(s)))
{
edje_object_part_text_set(VIEW(item), "elm.text_new", item->label);
- edje_object_signal_emit (VIEW(item), signal, "elm");
+ edje_object_signal_emit (VIEW(item), sig, "elm");
edje_object_signal_callback_add(VIEW(item),
"elm,state,label_set,done", "elm",
_elm_toolbar_item_label_set_cb, item);
}
static void
-_elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Object *icon_obj, const char *icon_str, double icon_size, const char *signal)
+_elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Object *icon_obj, const char *icon_str, double icon_size, const char *sig)
{
Evas_Object *old_icon;
int ms = 0;
}
edje_object_part_swallow(VIEW(item), "elm.swallow.icon_new",
item->icon);
- edje_object_signal_emit (VIEW(item), signal, "elm");
+ edje_object_signal_emit (VIEW(item), sig, "elm");
edje_object_signal_callback_add(VIEW(item),
"elm,state,icon_set,done", "elm",
_elm_toolbar_item_icon_set_cb, item);