summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_embryo.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-05-09 10:26:40 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-05-09 10:26:40 +0100
commitf224eaae11fff1e5036ad969a5d2c859d4fbc239 (patch)
tree97f460934121bdbec582fbf117f9f225d0e3bbb0 /src/lib/edje/edje_embryo.c
parentb58cd308171408fa198a2377bbf6d70ec579c3bf (diff)
add embryo fill support for proxy parts
Diffstat (limited to 'src/lib/edje/edje_embryo.c')
-rw-r--r--src/lib/edje/edje_embryo.c140
1 files changed, 105 insertions, 35 deletions
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
index 85ba7f5e54..7259adf979 100644
--- a/src/lib/edje/edje_embryo.c
+++ b/src/lib/edje/edje_embryo.c
@@ -2011,45 +2011,79 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params)
2011 case EDJE_STATE_PARAM_FILL_SMOOTH: 2011 case EDJE_STATE_PARAM_FILL_SMOOTH:
2012 { 2012 {
2013 Edje_Part_Description_Image *img; 2013 Edje_Part_Description_Image *img;
2014 Edje_Part_Description_Proxy *proxy;
2014 2015
2015 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; 2016 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) && (rp->part->type != EDJE_PART_TYPE_PROXY) ) return 0;
2016 CHKPARAM(3); 2017 CHKPARAM(3);
2017 2018
2018 img = (Edje_Part_Description_Image*) rp->custom->description; 2019 if (rp->part->type == EDJE_PART_TYPE_IMAGE)
2019 2020 {
2020 GETINT(img->image.fill.smooth, params[3]); 2021 img = (Edje_Part_Description_Image*) rp->custom->description;
2022 GETINT(img->image.fill.smooth, params[3]);
2023 }
2024 else
2025 {
2026 proxy = (Edje_Part_Description_Proxy*) rp->custom->description;
2027 GETINT(proxy->proxy.fill.smooth, params[3]);
2028 }
2021 2029
2022 break; 2030 break;
2023 } 2031 }
2024 case EDJE_STATE_PARAM_FILL_POS: 2032 case EDJE_STATE_PARAM_FILL_POS:
2025 { 2033 {
2026 Edje_Part_Description_Image *img; 2034 Edje_Part_Description_Image *img;
2035 Edje_Part_Description_Proxy *proxy;
2027 2036
2028 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; 2037 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) && (rp->part->type != EDJE_PART_TYPE_PROXY) ) return 0;
2029 CHKPARAM(6); 2038 CHKPARAM(6);
2030 2039
2031 img = (Edje_Part_Description_Image*) rp->custom->description; 2040 if (rp->part->type == EDJE_PART_TYPE_IMAGE)
2032 2041 {
2033 GETFLOAT_T(img->image.fill.pos_rel_x, params[3]); 2042 img = (Edje_Part_Description_Image*) rp->custom->description;
2034 GETFLOAT_T(img->image.fill.pos_rel_y, params[4]); 2043
2035 GETINT(img->image.fill.pos_abs_x, params[5]); 2044 GETFLOAT_T(img->image.fill.pos_rel_x, params[3]);
2036 GETINT(img->image.fill.pos_abs_y, params[6]); 2045 GETFLOAT_T(img->image.fill.pos_rel_y, params[4]);
2046 GETINT(img->image.fill.pos_abs_x, params[5]);
2047 GETINT(img->image.fill.pos_abs_y, params[6]);
2048 }
2049 else
2050 {
2051 proxy = (Edje_Part_Description_Proxy*) rp->custom->description;
2052
2053 GETFLOAT_T(proxy->proxy.fill.pos_rel_x, params[3]);
2054 GETFLOAT_T(proxy->proxy.fill.pos_rel_y, params[4]);
2055 GETINT(proxy->proxy.fill.pos_abs_x, params[5]);
2056 GETINT(proxy->proxy.fill.pos_abs_y, params[6]);
2057 }
2037 2058
2038 break; 2059 break;
2039 } 2060 }
2040 case EDJE_STATE_PARAM_FILL_SIZE: 2061 case EDJE_STATE_PARAM_FILL_SIZE:
2041 { 2062 {
2042 Edje_Part_Description_Image *img; 2063 Edje_Part_Description_Image *img;
2064 Edje_Part_Description_Proxy *proxy;
2043 2065
2044 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; 2066 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) && (rp->part->type != EDJE_PART_TYPE_PROXY) ) return 0;
2045 CHKPARAM(6); 2067 CHKPARAM(6);
2046 2068
2047 img = (Edje_Part_Description_Image*) rp->custom->description; 2069 if (rp->part->type == EDJE_PART_TYPE_IMAGE)
2048 2070 {
2049 GETFLOAT_T(img->image.fill.rel_x, params[3]); 2071 img = (Edje_Part_Description_Image*) rp->custom->description;
2050 GETFLOAT_T(img->image.fill.rel_y, params[4]); 2072
2051 GETINT(img->image.fill.abs_x, params[5]); 2073 GETFLOAT_T(img->image.fill.rel_x, params[3]);
2052 GETINT(img->image.fill.abs_y, params[6]); 2074 GETFLOAT_T(img->image.fill.rel_y, params[4]);
2075 GETINT(img->image.fill.abs_x, params[5]);
2076 GETINT(img->image.fill.abs_y, params[6]);
2077 }
2078 else
2079 {
2080 proxy = (Edje_Part_Description_Proxy*) rp->custom->description;
2081
2082 GETFLOAT_T(proxy->proxy.fill.rel_x, params[3]);
2083 GETFLOAT_T(proxy->proxy.fill.rel_y, params[4]);
2084 GETINT(proxy->proxy.fill.abs_x, params[5]);
2085 GETINT(proxy->proxy.fill.abs_y, params[6]);
2086 }
2053 2087
2054 break; 2088 break;
2055 } 2089 }
@@ -2540,45 +2574,81 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params)
2540 case EDJE_STATE_PARAM_FILL_SMOOTH: 2574 case EDJE_STATE_PARAM_FILL_SMOOTH:
2541 { 2575 {
2542 Edje_Part_Description_Image *img; 2576 Edje_Part_Description_Image *img;
2577 Edje_Part_Description_Proxy *proxy;
2543 2578
2544 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; 2579 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) && (rp->part->type != EDJE_PART_TYPE_PROXY) ) return 0;
2545 CHKPARAM(3); 2580 CHKPARAM(3);
2546 2581
2547 img = (Edje_Part_Description_Image*) rp->custom->description; 2582 if (rp->part->type == EDJE_PART_TYPE_IMAGE)
2583 {
2584 img = (Edje_Part_Description_Image*) rp->custom->description;
2585
2586 SETINT(img->image.fill.smooth, params[3]);
2587 }
2588 else
2589 {
2590 proxy = (Edje_Part_Description_Proxy*) rp->custom->description;
2548 2591
2549 SETINT(img->image.fill.smooth, params[3]); 2592 SETINT(proxy->proxy.fill.smooth, params[3]);
2593 }
2550 2594
2551 break; 2595 break;
2552 } 2596 }
2553 case EDJE_STATE_PARAM_FILL_POS: 2597 case EDJE_STATE_PARAM_FILL_POS:
2554 { 2598 {
2555 Edje_Part_Description_Image *img; 2599 Edje_Part_Description_Image *img;
2600 Edje_Part_Description_Proxy *proxy;
2556 2601
2557 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; 2602 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) && (rp->part->type != EDJE_PART_TYPE_PROXY) ) return 0;
2558 CHKPARAM(6); 2603 CHKPARAM(6);
2559 2604
2560 img = (Edje_Part_Description_Image*) rp->custom->description; 2605 if (rp->part->type == EDJE_PART_TYPE_IMAGE)
2561 2606 {
2562 SETFLOAT_T(img->image.fill.pos_rel_x, params[3]); 2607 img = (Edje_Part_Description_Image*) rp->custom->description;
2563 SETFLOAT_T(img->image.fill.pos_rel_y, params[4]); 2608
2564 SETINT(img->image.fill.pos_abs_x, params[5]); 2609 SETFLOAT_T(img->image.fill.pos_rel_x, params[3]);
2565 SETINT(img->image.fill.pos_abs_y, params[6]); 2610 SETFLOAT_T(img->image.fill.pos_rel_y, params[4]);
2611 SETINT(img->image.fill.pos_abs_x, params[5]);
2612 SETINT(img->image.fill.pos_abs_y, params[6]);
2613 }
2614 else
2615 {
2616 proxy = (Edje_Part_Description_Proxy*) rp->custom->description;
2617
2618 SETFLOAT_T(proxy->proxy.fill.pos_rel_x, params[3]);
2619 SETFLOAT_T(proxy->proxy.fill.pos_rel_y, params[4]);
2620 SETINT(proxy->proxy.fill.pos_abs_x, params[5]);
2621 SETINT(proxy->proxy.fill.pos_abs_y, params[6]);
2622 }
2566 2623
2567 break; 2624 break;
2568 } 2625 }
2569 case EDJE_STATE_PARAM_FILL_SIZE: 2626 case EDJE_STATE_PARAM_FILL_SIZE:
2570 { 2627 {
2571 Edje_Part_Description_Image *img; 2628 Edje_Part_Description_Image *img;
2629 Edje_Part_Description_Proxy *proxy;
2572 2630
2573 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) ) return 0; 2631 if ( (rp->part->type != EDJE_PART_TYPE_IMAGE) && (rp->part->type != EDJE_PART_TYPE_PROXY) ) return 0;
2574 CHKPARAM(6); 2632 CHKPARAM(6);
2575 2633
2576 img = (Edje_Part_Description_Image*) rp->custom->description; 2634 if (rp->part->type == EDJE_PART_TYPE_IMAGE)
2577 2635 {
2578 SETFLOAT_T(img->image.fill.rel_x, params[3]); 2636 img = (Edje_Part_Description_Image*) rp->custom->description;
2579 SETFLOAT_T(img->image.fill.rel_y, params[4]); 2637
2580 SETINT(img->image.fill.abs_x, params[5]); 2638 SETFLOAT_T(img->image.fill.rel_x, params[3]);
2581 SETINT(img->image.fill.abs_y, params[6]); 2639 SETFLOAT_T(img->image.fill.rel_y, params[4]);
2640 SETINT(img->image.fill.abs_x, params[5]);
2641 SETINT(img->image.fill.abs_y, params[6]);
2642 }
2643 else
2644 {
2645 proxy = (Edje_Part_Description_Proxy*) rp->custom->description;
2646
2647 SETFLOAT_T(proxy->proxy.fill.rel_x, params[3]);
2648 SETFLOAT_T(proxy->proxy.fill.rel_y, params[4]);
2649 SETINT(proxy->proxy.fill.abs_x, params[5]);
2650 SETINT(proxy->proxy.fill.abs_y, params[6]);
2651 }
2582 2652
2583 break; 2653 break;
2584 } 2654 }