elm_box_pack_end(bx, disk);
evas_object_show(disk);
evas_object_smart_callback_add(disk, "selected", _print_disk_info_cb, NULL);
-
+
// displayed item number setting example
disk = elm_diskselector_add(win);
elm_diskselector_display_item_num_set(disk, 5);
evas_object_size_hint_weight_set(fl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_box_pack_end(bx, fl);
evas_object_data_set(win, "fl", fl);
-
+
elm_flip_interaction_set(fl, ELM_FLIP_INTERACTION_NONE);
elm_flip_interacton_direction_enabled_set(fl, ELM_FLIP_DIRECTION_UP, EINA_TRUE);
elm_flip_interacton_direction_enabled_set(fl, ELM_FLIP_DIRECTION_DOWN, EINA_TRUE);
evas_object_image_file_set(im, buf, NULL);
elm_flip_content_back_set(fl, im);
evas_object_show(im);
-#else
+#else
li = elm_list_add(win);
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_list_item_append(li, "Item 0", NULL, NULL, NULL, NULL);
evas_object_smart_callback_add(rd, "changed", my_fl_ch, win);
rdg = rd;
evas_object_data_set(win, "rdg", rdg);
-
+
rd = elm_radio_add(win);
evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
elm_box_pack_end(bx, rd);
evas_object_show(rd);
evas_object_smart_callback_add(rd, "changed", my_fl_ch, win);
-
+
rd = elm_radio_add(win);
evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
elm_box_pack_end(bx, rd);
evas_object_show(rd);
evas_object_smart_callback_add(rd, "changed", my_fl_ch, win);
-
+
rd = elm_radio_add(win);
evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
-
+
evas_object_resize(win, 320, 480);
evas_object_show(win);
}
Evas_Coord down_x, down_y, x, y;
Eina_Bool down : 1;
Eina_Bool backflip : 1;
-
+
Ecore_Animator *anim;
Ecore_Job *job;
Evas_Coord ox, oy, w, h;
0, 0, 0, 0,
0,
0,
-
+
NULL,
NULL,
0, 0, 0, 0,
}
static void
-_slice_apply(State *st, Slice *sl,
+_slice_apply(State *st, Slice *sl,
Evas_Coord x __UNUSED__, Evas_Coord y __UNUSED__, Evas_Coord w, Evas_Coord h __UNUSED__,
Evas_Coord ox, Evas_Coord oy, Evas_Coord ow, Evas_Coord oh)
{
{
Evas_Map *m = (Evas_Map *)evas_object_map_get(sl->obj);
int i;
-
+
if (!m) return;
// vanishing point is center of page, and focal dist is 1024
evas_map_util_3d_perspective(m, x + (w / 2), y + (h / 2), 0, 1024);
{
Evas_Map *m = (Evas_Map *)evas_object_map_get(sl->obj);
int i;
-
+
if (!m) return;
- evas_map_util_3d_lighting(m,
- // light position
+ evas_map_util_3d_lighting(m,
+ // light position
// (centered over page 10 * h toward camera)
x + (w / 2) , y + (h / 2) , -10000,
255, 255, 255, // light color
for (i = 0; i < 4; i++)
{
int r, g, b, a;
-
+
evas_map_point_color_get(m, i, &r, &g, &b, &a);
r = (double)r * 1.2; if (r > 255) r = 255;
g = (double)g * 1.2; if (g > 255) g = 255;
sl->u[3] = u4; sl->v[3] = v4;
}
-static void
+static void
_deform_point(Vertex2 *vi, Vertex3 *vo, double rho, double theta, double A)
{
// ^Y
// rho == angle of cone from vertical axis (...-PI/2 to PI/2...)
Vertex3 v1;
double d, r, b;
-
- d = sqrt((vi->x * vi->x) + pow(vi->y - A, 2));
- r = d * sin(theta);
- b = asin(vi->x / d) / sin(theta);
-
+
+ d = sqrt((vi->x * vi->x) + pow(vi->y - A, 2));
+ r = d * sin(theta);
+ b = asin(vi->x / d) / sin(theta);
+
v1.x = r * sin(b);
- v1.y = d + A - (r * (1 - cos(b)) * sin(theta));
+ v1.y = d + A - (r * (1 - cos(b)) * sin(theta));
v1.z = r * (1 - cos(b)) * cos(theta);
-
+
vo->x = (v1.x * cos(rho)) - (v1.z * sin(rho));
vo->y = v1.y;
vo->z = (v1.x * sin(rho)) + (v1.z * cos(rho));
_state_slices_clear(State *st)
{
int i, j, num;
-
+
if (st->slices)
{
num = 0;
{
Evas_Map *m;
int rr = 0, gg = 0, bb = 0, aa = 0;
-
+
if (!s) return 0;
m = (Evas_Map *)evas_object_map_get(s->obj);
if (!m) return 0;
_slice_obj_color_set(Slice *s, int p, int r, int g, int b, int a)
{
Evas_Map *m;
-
+
if (!s) return;
m = (Evas_Map *)evas_object_map_get(s->obj);
if (!m) return;
}
static void
-_slice_obj_vert_color_merge(Slice *s1, int p1, Slice *s2, int p2,
+_slice_obj_vert_color_merge(Slice *s1, int p1, Slice *s2, int p2,
Slice *s3, int p3, Slice *s4, int p4)
{
int r = 0, g = 0, b = 0, a = 0, n = 0;
n += _slice_obj_color_sum(s2, p2, &r, &g, &b, &a);
n += _slice_obj_color_sum(s3, p3, &r, &g, &b, &a);
n += _slice_obj_color_sum(s4, p4, &r, &g, &b, &a);
-
+
if (n < 1) return;
r /= n; g /= n; b /= n; a /= n;
Vertex3 *tvo, *tvol;
st->backflip = 0;
-
+
evas_object_geometry_get(st->front, &x, &y, &w, &h);
ox = x; oy = y; ow = w; oh = h;
x1 = st->down_x;
else if (st->dir == 2)
{
Evas_Coord tmp;
-
+
tmp = x1; x1 = y1; y1 = tmp;
tmp = x2; x2 = y2; y2 = tmp;
tmp = w; w = h; h = tmp;
else if (st->dir == 3)
{
Evas_Coord tmp;
-
+
tmp = x1; x1 = y1; y1 = tmp;
tmp = x2; x2 = y2; y2 = tmp;
tmp = w; w = h; h = tmp;
x1 = (w - 1) - x1;
x2 = (w - 1) - x2;
}
-
+
if (x2 >= x1) x2 = x1 - 1;
mx = (x1 + x2) / 2;
my = (y1 + y2) / 2;
-
+
if (mx < 0) mx = 0;
else if (mx >= w) mx = w - 1;
if (my < 0) my = 0;
else if (my >= h) my = h - 1;
mgrad = (double)(y1 - y2) / (double)(x1 - x2);
-
+
if (mx < 1) mx = 1; // quick hack to keep curl line visible
-
+
if (mgrad == 0.0) // special horizontal case
mgrad = 0.001; // quick dirty hack for now
// else
{
minv = 1.0 / mgrad;
- // y = (m * x) + b
+ // y = (m * x) + b
b = my + (minv * mx);
}
if ((b >= -5) && (b <= (h + 5)))
b = my + (minv * mx);
}
}
-
+
perc = (double)x2 / (double)x1;
percm = (double)mx / (double)x1;
if (perc < 0.0) perc = 0.0;
else if (perc > 1.0) perc = 1.0;
if (percm < 0.0) percm = 0.0;
else if (percm > 1.0) percm = 1.0;
-
+
minva = atan(minv) / (M_PI / 2);
if (minva < 0.0) minva = -minva;
-
+
// A = apex of cone
if (b <= 0) A = b;
else A = h - b;
if (A < -(h * 20)) A = -h * 20;
//--//
Al = -5;
-
+
// rho = is how much the page is turned
n = 1.0 - perc;
n = 1.0 - cos(n * M_PI / 2.0);
rho = -(n * M_PI);
//--//
rhol = -(n * M_PI);
-
+
// theta == curliness (how much page culrs in on itself
n = sin((1.0 - perc) * M_PI);
n = n * 1.2;
}
num = (st->slices_w + 1) * (st->slices_h + 1);
-
+
tvi = alloca(sizeof(Vertex2) * num);
tvo = alloca(sizeof(Vertex3) * num);
tvol = alloca(sizeof(Vertex3) * (st->slices_w + 1));
for (col = 0, gx = 0; gx <= (w + gszw - 1); gx += gszw, col++)
{
Vertex2 vil;
-
+
vil.x = gx;
vil.y = h - gx;
_deform_point(&vil, &(tvol[col]), rhol, thetal, Al);
}
-
+
n = minva * sin(perc * M_PI);
n = n * n;
-
+
num = 0;
for (col = 0, gx = 0; gx <= (w + gszw - 1); gx += gszw, col++)
{
{
Vertex2 vi;
Vertex3 vo, tvo1;
-
+
if (gx > w) vi.x = w;
else vi.x = gx;
if (gy > h) vi.y = h;
{
num = st->slices_h * col;
num2 = jump * col;
-
+
gw = gszw;
if ((gx + gw) > w) gw = w - gx;
-
+
for (row = 0, gy = 0; gy < h; gy += gszh, row++)
{
Vertex3 vo[4];
if (b > 0) nn = num + st->slices_h - row - 1;
else nn = num + row;
-
+
gh = gszh;
if ((gy + gh) > h) gh = h - gy;
-
+
vo[0] = tvo[num2 + row];
vo[1] = tvo[num2 + row + jump];
vo[2] = tvo[num2 + row + jump + 1];
vo[2].y = h - vo[2].y;
vo[3].y = h - vo[3].y;
}
-
+
// FRONT
sl = st->slices[nn];
if (!sl)
_slice_uv(st, sl,
gx, h - (gy + gh), gx + gw, h - (gy + gh),
gx + gw, h - gy, gx, h - gy);
-
+
// BACK
sl = st->slices2[nn];
if (!sl)
}
}
}
-
+
num = 0;
for (j = 0; j < st->slices_h; j++)
{
for (j = 0; j <= st->slices_h; j++)
{
Slice *s[4];
-
+
s[0] = s[1] = s[2] = s[3] = NULL;
- if ((i > 0) && (j > 0))
+ if ((i > 0) && (j > 0))
s[0] = st->slices[num - 1 - st->slices_h];
if ((i < st->slices_w) && (j > 0))
s[1] = st->slices[num - 1];
_slice_obj_vert_color_merge(s[0], 2, s[1], 3,
s[2], 1, s[3], 0);
s[0] = s[1] = s[2] = s[3] = NULL;
- if ((i > 0) && (j > 0))
+ if ((i > 0) && (j > 0))
s[0] = st->slices2[num - 1 - st->slices_h];
if ((i < st->slices_w) && (j > 0))
s[1] = st->slices2[num - 1];
num++;
}
}
-
+
num = 0;
for (i = 0; i < st->slices_w; i++)
{
{
State *st = data;
double p;
-
+
p = ecore_animator_pos_map(pos, ECORE_POS_MAP_ACCELERATE, 0.0, 0.0);
if (st->finish)
{
Evas_Event_Mouse_Up *ev = event_info;
Evas_Coord x, y, w, h;
double tm = 0.5;
-
+
if (ev->button != 1) return;
st->down = 0;
evas_object_geometry_get(st->front, &x, &y, &w, &h);
evas_object_move(im2, 40, 40);
evas_object_resize(im2, 400, 400);
evas_object_show(im2);
-
+
#if 0
im = elm_layout_add(win);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR);
evas_object_move(im, 40, 40);
evas_object_resize(im, 400, 400);
evas_object_show(im);
-
+
evas_object_data_set(im, "im2", im2);
-
+
rc = evas_object_rectangle_add(evas_object_evas_get(win));
evas_object_color_set(rc, 0, 0, 0, 0);
evas_object_move(rc, 40, 340);
evas_object_resize(rc, 400, 100);
evas_object_show(rc);
-
+
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_DOWN, im_down_cb, im);
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_UP, im_up_cb, im);
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_MOVE, im_move_cb, im);
-
+
rc = evas_object_rectangle_add(evas_object_evas_get(win));
evas_object_color_set(rc, 0, 0, 0, 0);
evas_object_move(rc, 40, 40);
evas_object_resize(rc, 400, 100);
evas_object_show(rc);
-
+
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_DOWN, im_down_cb, im);
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_UP, im_up_cb, im);
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_MOVE, im_move_cb, im);
-
+
rc = evas_object_rectangle_add(evas_object_evas_get(win));
evas_object_color_set(rc, 0, 0, 0, 0);
evas_object_move(rc, 340, 40);
evas_object_resize(rc, 100, 400);
evas_object_show(rc);
-
+
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_DOWN, im_down_cb, im);
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_UP, im_up_cb, im);
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_MOVE, im_move_cb, im);
evas_object_move(rc, 40, 40);
evas_object_resize(rc, 100, 400);
evas_object_show(rc);
-
+
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_DOWN, im_down_cb, im);
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_UP, im_up_cb, im);
evas_object_event_callback_add(rc, EVAS_CALLBACK_MOUSE_MOVE, im_move_cb, im);
-
+
evas_object_resize(win, 480, 480);
evas_object_show(win);
}
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_table_pack(tb, bt, 0, 33, 33, 34);
evas_object_show(bt);
-
+
bt = elm_button_add(win);
elm_button_label_set(bt, "X");
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_table_pack(tb, bt, 33, 33, 34, 34);
evas_object_show(bt);
-
+
evas_object_show(win);
}
{
int pos = 0;
int code = 0, chnum;
-
+
for (chnum = 0; ; chnum++)
{
pos = evas_string_char_next_get(str, pos, &code);
{
int pos = 0;
int code = 0, chnum;
-
+
for (chnum = 0; ; chnum++)
{
if (chnum == length) break;
Eina_Bool dir_enabled[4];
int slices_w, slices_h;
Slice **slices, **slices2;
-
+
Eina_Bool state : 1;
Eina_Bool down : 1;
Eina_Bool finish : 1;
if (wd->dir_enabled[1]) fingy++;
if (wd->dir_enabled[2]) fingx++;
if (wd->dir_enabled[3]) fingx++;
-
+
elm_coords_finger_size_adjust(fingx, &minw, fingy, &minh);
-
+
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
}
_slice_new(Widget_Data *st __UNUSED__, Evas_Object *obj)
{
Slice *sl;
-
+
sl = calloc(1, sizeof(Slice));
if (!sl) return NULL;
sl->obj = evas_object_image_add(evas_object_evas_get(obj));
{
Evas_Map *m;
int i;
-
+
m = evas_map_new(4);
if (!m) return;
evas_map_smooth_set(m, 0);
{
Evas_Map *m = (Evas_Map *)evas_object_map_get(sl->obj);
int i;
-
+
if (!m) return;
// vanishing point is center of page, and focal dist is 1024
evas_map_util_3d_perspective(m, x + (w / 2), y + (h / 2), 0, 1024);
{
Evas_Map *m = (Evas_Map *)evas_object_map_get(sl->obj);
int i;
-
+
if (!m) return;
evas_map_util_3d_lighting(m,
// light position
for (i = 0; i < 4; i++)
{
int r, g, b, a;
-
+
evas_map_point_color_get(m, i, &r, &g, &b, &a);
r = (double)r * 1.2; if (r > 255) r = 255;
g = (double)g * 1.2; if (g > 255) g = 255;
// rho == angle of cone from vertical axis (...-PI/2 to PI/2...)
Vertex3 v1;
double d, r, b;
-
+
d = sqrt((vi->x * vi->x) + pow(vi->y - A, 2));
r = d * sin(theta);
b = asin(vi->x / d) / sin(theta);
-
+
v1.x = r * sin(b);
v1.y = d + A - (r * (1 - cos(b)) * sin(theta));
v1.z = r * (1 - cos(b)) * cos(theta);
-
+
vo->x = (v1.x * cos(rho)) - (v1.z * sin(rho));
vo->y = v1.y;
vo->z = (v1.x * sin(rho)) + (v1.z * cos(rho));
_state_slices_clear(Widget_Data *st)
{
int i, j, num;
-
+
if (st->slices)
{
num = 0;
{
Evas_Map *m;
int rr = 0, gg = 0, bb = 0, aa = 0;
-
+
if (!s) return 0;
m = (Evas_Map *)evas_object_map_get(s->obj);
if (!m) return 0;
_slice_obj_color_set(Slice *s, int p, int r, int g, int b, int a)
{
Evas_Map *m;
-
+
if (!s) return;
m = (Evas_Map *)evas_object_map_get(s->obj);
if (!m) return;
Slice *s3, int p3, Slice *s4, int p4)
{
int r = 0, g = 0, b = 0, a = 0, n = 0;
-
+
n += _slice_obj_color_sum(s1, p1, &r, &g, &b, &a);
n += _slice_obj_color_sum(s2, p2, &r, &g, &b, &a);
n += _slice_obj_color_sum(s3, p3, &r, &g, &b, &a);
n += _slice_obj_color_sum(s4, p4, &r, &g, &b, &a);
-
+
if (n < 1) return;
r /= n; g /= n; b /= n; a /= n;
-
+
_slice_obj_color_set(s1, p1, r, g, b, a);
_slice_obj_color_set(s2, p2, r, g, b, a);
_slice_obj_color_set(s3, p3, r, g, b, a);
Vertex2 *tvi;
Vertex3 *tvo, *tvol;
Evas_Object *front, *back;
-
+
st->backflip = 1;
if (st->state)
{
front = st->back.content;
back = st->back.content;
}
-
+
evas_object_geometry_get(st->obj, &x, &y, &w, &h);
ox = x; oy = y; ow = w; oh = h;
x1 = st->down_x;
y1 = st->down_y;
x2 = st->x;
y2 = st->y;
-
+
if (st->dir == 0)
{
// no nothing. left drag is standard
else if (st->dir == 2)
{
Evas_Coord tmp;
-
+
tmp = x1; x1 = y1; y1 = tmp;
tmp = x2; x2 = y2; y2 = tmp;
tmp = w; w = h; h = tmp;
else if (st->dir == 3)
{
Evas_Coord tmp;
-
+
tmp = x1; x1 = y1; y1 = tmp;
tmp = x2; x2 = y2; y2 = tmp;
tmp = w; w = h; h = tmp;
x1 = (w - 1) - x1;
x2 = (w - 1) - x2;
}
-
+
if (x2 >= x1) x2 = x1 - 1;
mx = (x1 + x2) / 2;
my = (y1 + y2) / 2;
-
+
if (mx < 0) mx = 0;
else if (mx >= w) mx = w - 1;
if (my < 0) my = 0;
else if (my >= h) my = h - 1;
-
+
mgrad = (double)(y1 - y2) / (double)(x1 - x2);
-
+
if (mx < 1) mx = 1; // quick hack to keep curl line visible
-
+
if (mgrad == 0.0) // special horizontal case
mgrad = 0.001; // quick dirty hack for now
// else
b = my + (minv * mx);
}
}
-
+
perc = (double)x2 / (double)x1;
percm = (double)mx / (double)x1;
if (perc < 0.0) perc = 0.0;
else if (perc > 1.0) perc = 1.0;
if (percm < 0.0) percm = 0.0;
else if (percm > 1.0) percm = 1.0;
-
+
minva = atan(minv) / (M_PI / 2);
if (minva < 0.0) minva = -minva;
-
+
// A = apex of cone
if (b <= 0) A = b;
else A = h - b;
if (A < -(h * 20)) A = -h * 20;
//--//
Al = -5;
-
+
// rho = is how much the page is turned
n = 1.0 - perc;
n = 1.0 - cos(n * M_PI / 2.0);
rho = -(n * M_PI);
//--//
rhol = -(n * M_PI);
-
+
// theta == curliness (how much page culrs in on itself
n = sin((1.0 - perc) * M_PI);
n = n * 1.2;
n = n * n;
n = 1.0 - n;
thetal = 7.86 + n;
-
+
nw = 16;
nh = 16;
if (nw < 1) nw = 1;
gszh = h / nh;
if (gszw < 4) gszw = 4;
if (gszh < 4) gszh = 4;
-
+
nw = (w + gszw - 1) / gszw;
nh = (h + gszh - 1) / gszh;
if ((st->slices_w != nw) || (st->slices_h != nh)) _state_slices_clear(st);
return 0;
}
}
-
+
num = (st->slices_w + 1) * (st->slices_h + 1);
-
+
tvi = alloca(sizeof(Vertex2) * num);
tvo = alloca(sizeof(Vertex3) * num);
tvol = alloca(sizeof(Vertex3) * (st->slices_w + 1));
-
+
for (col = 0, gx = 0; gx <= (w + gszw - 1); gx += gszw, col++)
{
Vertex2 vil;
-
+
vil.x = gx;
vil.y = h - ((gx * h) / (w + gszw - 1));
_deform_point(&vil, &(tvol[col]), rhol, thetal, Al);
}
-
+
n = minva * sin(perc * M_PI);
n = n * n;
-
+
num = 0;
for (col = 0, gx = 0; gx <= (w + gszw - 1); gx += gszw, col++)
{
{
Vertex2 vi;
Vertex3 vo, tvo1;
-
+
if (gx > w) vi.x = w;
else vi.x = gx;
if (gy > h) vi.y = h;
num++;
}
}
-
+
jump = st->slices_h + 1;
for (col = 0, gx = 0; gx < w; gx += gszw, col++)
{
num = st->slices_h * col;
num2 = jump * col;
-
+
gw = gszw;
if ((gx + gw) > w) gw = w - gx;
-
+
for (row = 0, gy = 0; gy < h; gy += gszh, row++)
{
Vertex3 vo[4];
-
+
if (b > 0) nn = num + st->slices_h - row - 1;
else nn = num + row;
-
+
gh = gszh;
if ((gy + gh) > h) gh = h - gy;
-
+
vo[0] = tvo[num2 + row];
vo[1] = tvo[num2 + row + jump];
vo[2] = tvo[num2 + row + jump + 1];
vo[2].y = h - vo[2].y;
vo[3].y = h - vo[3].y;
}
-
+
// FRONT
sl = st->slices[nn];
if (!sl)
_slice_uv(st, sl,
gx, h - (gy + gh), gx + gw, h - (gy + gh),
gx + gw, h - gy, gx, h - gy);
-
+
// BACK
sl = st->slices2[nn];
if (!sl)
sl = _slice_new(st, back);
st->slices2[nn] = sl;
}
-
+
_slice_xyz(st, sl,
vo[1].x, vo[1].y, vo[1].z,
vo[0].x, vo[0].y, vo[0].z,
}
}
}
-
+
num = 0;
for (j = 0; j < st->slices_h; j++)
{
num++;
}
}
-
+
for (i = 0; i <= st->slices_w; i++)
{
num = i * st->slices_h;
for (j = 0; j <= st->slices_h; j++)
{
Slice *s[4];
-
+
s[0] = s[1] = s[2] = s[3] = NULL;
if ((i > 0) && (j > 0))
s[0] = st->slices[num - 1 - st->slices_h];
num++;
}
}
-
+
num = 0;
for (i = 0; i < st->slices_w; i++)
{
num++;
}
}
-
+
return 1;
}
Evas_Coord cx, cy, px, py, foc;
int lx, ly, lz, lr, lg, lb, lar, lag, lab;
Widget_Data *wd = elm_widget_data_get(obj);
-
+
if (!wd) return;
-
+
mf = evas_map_new(4);
evas_map_smooth_set(mf, 0);
mb = evas_map_new(4);
evas_map_smooth_set(mb, 0);
-
+
if (wd->front.content)
{
const char *type = evas_object_type_get(wd->front.content);
-
+
// FIXME: only handles filled obj
if ((type) && (!strcmp(type, "image")))
{
if (wd->back.content)
{
const char *type = evas_object_type_get(wd->back.content);
-
+
if ((type) && (!strcmp(type, "image")))
{
int iw, ih;
Widget_Data *wd = elm_widget_data_get(obj);
Evas_Coord x, y, w, h;
if (!wd) return;
-
+
evas_object_geometry_get(obj, &x, &y, &w, &h);
if (wd->front.content)
{
}
evas_object_resize(wd->back.content, w, h);
}
-
+
}
static Eina_Bool
Widget_Data *wd = elm_widget_data_get(obj);
double t = ecore_loop_time_get() - wd->start;
Evas_Coord w, h;
-
+
if (!wd) return ECORE_CALLBACK_CANCEL;
if (!wd->animator) return ECORE_CALLBACK_CANCEL;
-
+
t = t / wd->len;
if (t > 1.0) t = 1.0;
-
+
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
if (wd->mode == ELM_FLIP_PAGE_LEFT)
{
evas_object_geometry_get(obj, &x, &y, &w, &h);
// FIXME: manual flip wont get fixed
if (wd->animator) _flip(obj);
-
+
if (wd->event[0])
{
fsize = (double)w * wd->dir_hitsize[0];
{
Evas_Coord x, y, w, h;
double t = 1.0;
-
+
evas_object_geometry_get(wd->obj, &x, &y, &w, &h);
switch (wd->intmode)
{
t = 1.0 - ((double)(h - wd->y) / (double)(h - wd->down_y));
*rev = 1;
}
-
+
if (t < 0.0) t = 0.0;
else if (t > 1.0) t = 1.0;
-
+
if ((wd->dir == 0) || (wd->dir == 1))
{
- if (wd->intmode == ELM_FLIP_INTERACTION_ROTATE)
+ if (wd->intmode == ELM_FLIP_INTERACTION_ROTATE)
*m = ELM_FLIP_ROTATE_Y_CENTER_AXIS;
else if (wd->intmode == ELM_FLIP_INTERACTION_CUBE)
{
}
else
{
- if (wd->intmode == ELM_FLIP_INTERACTION_ROTATE)
+ if (wd->intmode == ELM_FLIP_INTERACTION_ROTATE)
*m = ELM_FLIP_ROTATE_X_CENTER_AXIS;
else if (wd->intmode == ELM_FLIP_INTERACTION_CUBE)
{
{
Widget_Data *wd = data;
double p;
-
+
p = ecore_animator_pos_map(pos, ECORE_POS_MAP_ACCELERATE, 0.0, 0.0);
if (wd->finish)
{
_configure(wd->obj);
wd->animator = NULL;
evas_object_smart_callback_call(wd->obj, SIG_ANIMATE_DONE, NULL);
-
+
return ECORE_CALLBACK_CANCEL;
}
double p;
Elm_Flip_Mode m = ELM_FLIP_ROTATE_X_CENTER_AXIS;
int rev = 0;
-
+
wd->job = NULL;
switch (wd->intmode)
{
Widget_Data *wd = elm_widget_data_get(fl);
Evas_Event_Mouse_Down *ev = event_info;
Evas_Coord x, y, w, h;
-
+
if (!wd) return;
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return ;
evas_object_geometry_get(data, &x, &y, &w, &h);
wd->x = ev->canvas.x - x;
wd->y = ev->canvas.y - y;
- wd->w = w;
+ wd->w = w;
wd->h = h;
wd->down_x = wd->x;
wd->down_y = wd->y;
Evas_Event_Mouse_Up *ev = event_info;
Evas_Coord x, y, w, h;
double tm = 0.5;
-
+
if (!wd) return;
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return ;
Widget_Data *wd = elm_widget_data_get(fl);
Evas_Event_Mouse_Move *ev = event_info;
Evas_Coord x, y, w, h;
-
+
if (!wd) return;
if (!wd->down) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return ;
evas_object_geometry_get(data, &x, &y, &w, &h);
wd->x = ev->cur.canvas.x - x;
wd->y = ev->cur.canvas.y - y;
- wd->w = w;
+ wd->w = w;
wd->h = h;
if (!wd->started)
{
Evas_Coord dx, dy;
-
+
dx = wd->x - wd->down_x;
dy = wd->y - wd->down_y;
if (((dx * dx) + (dy * dy)) > (_elm_config->finger_size * _elm_config->finger_size / 4))
// FIXME: hack around evas rendering bug (only fix makes evas bitch-slow)
evas_object_map_enable_set(wd->front.content, 0);
evas_object_map_enable_set(wd->back.content, 0);
-// FIXME: XXX why does this bork interactive flip??
+// FIXME: XXX why does this bork interactive flip??
// evas_object_resize(wd->front.content, 0, 0);
// evas_object_resize(wd->back.content, 0, 0);
evas_smart_objects_calculate(evas_object_evas_get(data));
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
ELM_SET_WIDTYPE(widtype, "flip");
elm_widget_can_focus_set(obj, EINA_FALSE);
wd->obj = obj;
-
+
wd->clip = evas_object_rectangle_add(e);
evas_object_static_clip_set(wd->clip, 1);
evas_object_color_set(wd->clip, 255, 255, 255, 255);
wd->state = 1;
wd->intmode = ELM_FLIP_INTERACTION_NONE;
-
+
_sizing_eval(obj);
return obj;
/**
* Set the interactive flip mode
- *
+ *
* @param obj The flip object
* @param mode The interactive flip mode to use
- *
+ *
* This sets if the flip should be interactive (allow user to click and
* drag a side of the flip to reveal the back page and cause it to flip).
* By default a flip is not interactive. You may also need to set which
* sides of the flip are "active" for flipping and how much space they use
* (a minimum of a finger size) with elm_flip_interacton_direction_enabled_set()
* and elm_flip_interacton_direction_hitsize_set()
- *
+ *
* @ingroup Flip
*/
EAPI void
/**
* Get the interactive flip mode
- *
+ *
* @param obj The flip object
* @return The interactive flip mode
- *
+ *
* Returns the interactive flip mode set by elm_flip_interaction_set()
- *
+ *
* @ingroup Flip
*/
EAPI Elm_Flip_Interaction
/**
* Set which directions of the flip respond to interactive flip
- *
+ *
* @param obj The flip object
* @param dir The direction to change
* @param enabled If that direction is enabled or not
- *
+ *
* By default all directions are disabled, so you may want to enable the
* desired directions for flipping if you need interactive flipping.
- *
+ *
* @ingroup Flip
*/
EAPI void
/**
* Get the enabled state of that flip direction
- *
+ *
* @param obj The flip object
* @param dir The direction to check
* @return If that direction is enabled or not
- *
+ *
* Gets the enabled state set by elm_flip_interacton_direction_enabled_set()
- *
+ *
* @ingroup Flip
*/
EAPI Eina_Bool
/**
* Set the amount of the flip that is sensitive to interactive flip
- *
+ *
* @param obj The flip object
* @param dir The direction to modify
* @param hitsize The amount of that dimension (0.0 to 1.0) to use
- *
+ *
* @ingroup Flip
*/
EAPI void
/**
* Get the amount of the flip that is sensitive to interactive flip
- *
+ *
* @param obj The flip object
* @param dir The direction to check
* @return The size set for that direction
- *
+ *
* Returns the amount os sensitive area set by elm_flip_interacton_direction_hitsize_set().
- *
+ *
* @ingroup Flip
*/
EAPI double
Eina_Bool top = EINA_FALSE;
Elm_Genlist_Item *reorder_it = it->wd->reorder_it;
if (!reorder_it) return 0;
-
+
evas_object_geometry_get(it->wd->pan_smart, NULL, &oy, NULL, &oh);
evas_object_geometry_get(it->wd->reorder_it->base.view, &rox, &roy, &row, &roh);
-
- if ((it->wd->reorder_start_y < it->block->y) &&
+
+ if ((it->wd->reorder_start_y < it->block->y) &&
(roy - oy + (roh / 2) >= it->block->y - it->wd->pan_y))
{
it->block->reorder_offset = it->wd->reorder_it->h * -1;
if (it->block->count == 1)
it->wd->reorder_rel = it;
}
- else if ((it->wd->reorder_start_y >= it->block->y) &&
+ else if ((it->wd->reorder_start_y >= it->block->y) &&
(roy - oy + (roh / 2) <= it->block->y - it->wd->pan_y))
{
it->block->reorder_offset = it->wd->reorder_it->h;
}
else
it->block->reorder_offset = 0;
-
+
it->scrl_y += it->block->reorder_offset;
-
+
top = (ELM_RECTS_INTERSECT(it->scrl_x, it->scrl_y, it->w, it->h,
rox, roy + (roh / 2), row, 1));
if (top)
double time, t;
int y, dy = it->h / 10 * _elm_config->scale, diff;
time = REORDER_EFFECT_TIME;
-
+
t = ((0.0 > (t = ecore_loop_time_get()-it->wd->start_time)) ? 0.0 : t);
-
+
if (t <= time) y = (1 * sin((t / time) * (M_PI / 2)) * dy);
else y = dy;
-
+
diff = abs(it->old_scrl_y - it->scrl_y);
if (diff > it->h) y = diff / 2;
-
+
if (it->old_scrl_y < it->scrl_y)
{
it->old_scrl_y += y;
}
_item_position(it, it->base.view, it->scrl_x, it->old_scrl_y);
_group_items_recalc(it->wd);
-
+
if ((it->wd->reorder_pan_move) ||
- (down && it->old_scrl_y >= it->scrl_y) ||
+ (down && it->old_scrl_y >= it->scrl_y) ||
(!down && it->old_scrl_y <= it->scrl_y))
{
it->old_scrl_y = it->scrl_y;