summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-06-01 13:21:04 +0900
committerHermet Park <chuneon.park@samsung.com>2020-06-01 13:21:04 +0900
commitb981667d52b721fcde217abd8497ef2feba65690 (patch)
treec69e6d418286d862219b9c4488ea8f4955c1904c
parent0123c8b6fc7c35466bcd5e49b6ef82a3707b8052 (diff)
Efl.Gfx.Vg.Value_Provider: Move internal function changed_flag to eo.
Summary: changed_flag was declared in the private header for internal use(static_lib). However, as the meson script has been changed, it can no longer be used. changed_flag can display the property to which the changed among the properties of value_provider. there is no problem in providing it as an eo function, so move the function to eo. Test Plan: N/A Reviewers: Hermet, herb, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11894
-rw-r--r--src/lib/evas/canvas/efl_gfx_vg_value_provider.c18
-rw-r--r--src/lib/evas/canvas/efl_gfx_vg_value_provider.eo19
-rw-r--r--src/lib/evas/canvas/efl_gfx_vg_value_provider.h2
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h12
-rw-r--r--src/static_libs/vg_common/vg_common_json.c12
5 files changed, 33 insertions, 30 deletions
diff --git a/src/lib/evas/canvas/efl_gfx_vg_value_provider.c b/src/lib/evas/canvas/efl_gfx_vg_value_provider.c
index 3f49a8ddc0..c9fc15b3fb 100644
--- a/src/lib/evas/canvas/efl_gfx_vg_value_provider.c
+++ b/src/lib/evas/canvas/efl_gfx_vg_value_provider.c
@@ -8,7 +8,7 @@ _efl_gfx_vg_value_provider_efl_object_constructor(Eo *obj,
8{ 8{
9 obj = efl_constructor(efl_super(obj, MY_CLASS)); 9 obj = efl_constructor(efl_super(obj, MY_CLASS));
10 10
11 pd->flag = EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_NONE; 11 pd->flag = EFL_GFX_VG_VALUE_PROVIDER_FLAGS_NONE;
12 12
13 return obj; 13 return obj;
14} 14}
@@ -44,7 +44,7 @@ _efl_gfx_vg_value_provider_transform_set(Eo *obj EINA_UNUSED, Efl_Gfx_Vg_Value_P
44 pd->m = malloc(sizeof (Eina_Matrix4)); 44 pd->m = malloc(sizeof (Eina_Matrix4));
45 if (!pd->m) return; 45 if (!pd->m) return;
46 } 46 }
47 pd->flag = pd->flag | EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_TRANSFORM_MATRIX; 47 pd->flag = pd->flag | EFL_GFX_VG_VALUE_PROVIDER_FLAGS_TRANSFORM_MATRIX;
48 memcpy(pd->m, m, sizeof (Eina_Matrix4)); 48 memcpy(pd->m, m, sizeof (Eina_Matrix4));
49 } 49 }
50 else 50 else
@@ -63,7 +63,7 @@ _efl_gfx_vg_value_provider_transform_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Vg_V
63EOAPI void 63EOAPI void
64_efl_gfx_vg_value_provider_fill_color_set(Eo *obj EINA_UNUSED, Efl_Gfx_Vg_Value_Provider_Data *pd, int r, int g, int b, int a) 64_efl_gfx_vg_value_provider_fill_color_set(Eo *obj EINA_UNUSED, Efl_Gfx_Vg_Value_Provider_Data *pd, int r, int g, int b, int a)
65{ 65{
66 pd->flag = pd->flag | EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_FILL_COLOR; 66 pd->flag = pd->flag | EFL_GFX_VG_VALUE_PROVIDER_FLAGS_FILL_COLOR;
67 67
68 pd->fill.r = r; 68 pd->fill.r = r;
69 pd->fill.g = g; 69 pd->fill.g = g;
@@ -83,7 +83,7 @@ _efl_gfx_vg_value_provider_fill_color_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Vg_
83EOAPI void 83EOAPI void
84_efl_gfx_vg_value_provider_stroke_color_set(Eo *obj EINA_UNUSED, Efl_Gfx_Vg_Value_Provider_Data *pd, int r, int g, int b, int a) 84_efl_gfx_vg_value_provider_stroke_color_set(Eo *obj EINA_UNUSED, Efl_Gfx_Vg_Value_Provider_Data *pd, int r, int g, int b, int a)
85{ 85{
86 pd->flag = pd->flag | EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_STROKE_COLOR; 86 pd->flag = pd->flag | EFL_GFX_VG_VALUE_PROVIDER_FLAGS_STROKE_COLOR;
87 87
88 pd->stroke.r = r; 88 pd->stroke.r = r;
89 pd->stroke.g = g; 89 pd->stroke.g = g;
@@ -105,7 +105,7 @@ _efl_gfx_vg_value_provider_stroke_width_set(Eo *obj EINA_UNUSED, Efl_Gfx_Vg_Valu
105{ 105{
106 if (w < 0) return ; 106 if (w < 0) return ;
107 107
108 pd->flag = pd->flag | EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_STROKE_WIDTH; 108 pd->flag = pd->flag | EFL_GFX_VG_VALUE_PROVIDER_FLAGS_STROKE_WIDTH;
109 pd->stroke.width = w; 109 pd->stroke.width = w;
110} 110}
111 111
@@ -115,13 +115,9 @@ _efl_gfx_vg_value_provider_stroke_width_get(const Eo *obj EINA_UNUSED, Efl_Gfx_V
115 return pd->stroke.width; 115 return pd->stroke.width;
116} 116}
117 117
118/* This function only use in internal */ 118EOAPI Efl_Gfx_Vg_Value_Provider_Flags
119Efl_Gfx_Vg_Value_Provider_Change_Flag 119_efl_gfx_vg_value_provider_updated_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Vg_Value_Provider_Data *pd)
120efl_gfx_vg_value_provider_changed_flag_get(Eo *obj)
121{ 120{
122 EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(obj, MY_CLASS), EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_NONE);
123 Efl_Gfx_Vg_Value_Provider_Data *pd = efl_data_scope_get(obj, MY_CLASS);
124 if (!pd) return EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_NONE;
125 return pd->flag; 121 return pd->flag;
126} 122}
127 123
diff --git a/src/lib/evas/canvas/efl_gfx_vg_value_provider.eo b/src/lib/evas/canvas/efl_gfx_vg_value_provider.eo
index 7712acd4a8..2fe2516aad 100644
--- a/src/lib/evas/canvas/efl_gfx_vg_value_provider.eo
+++ b/src/lib/evas/canvas/efl_gfx_vg_value_provider.eo
@@ -1,5 +1,16 @@
1import eina_types; 1import eina_types;
2 2
3enum @beta Efl.Gfx.Vg_Value_Provider_Flags {
4 [[ Property information applied to value provider.
5 @since 1.24
6 ]]
7 none = 0, [[ Nothing changed.]]
8 fill_color = 1, [[ Fill color changed. ]]
9 stroke_color = 2, [[ Stroke color changed. ]]
10 stroke_width = 4, [[ Stroke width changed. ]]
11 transform_matrix = 8, [[ Transform matrix changed. ]]
12}
13
3class @beta Efl.Gfx.Vg.Value_Provider extends Efl.Object 14class @beta Efl.Gfx.Vg.Value_Provider extends Efl.Object
4{ 15{
5 [[Efl Vector Value Provider class. 16 [[Efl Vector Value Provider class.
@@ -66,6 +77,14 @@ class @beta Efl.Gfx.Vg.Value_Provider extends Efl.Object
66 width: double; [[ Width value of stroke. ]] 77 width: double; [[ Width value of stroke. ]]
67 } 78 }
68 } 79 }
80 @property updated {
81 [[ Flag of properties updated in value provider object. ]]
82 get {
83 }
84 values {
85 flag: Efl.Gfx.Vg_Value_Provider_Flags; [[ Flag of the changed property. ]]
86 }
87 }
69 } 88 }
70 implements { 89 implements {
71 Efl.Object.constructor; 90 Efl.Object.constructor;
diff --git a/src/lib/evas/canvas/efl_gfx_vg_value_provider.h b/src/lib/evas/canvas/efl_gfx_vg_value_provider.h
index cab00fc23d..afcf72eba9 100644
--- a/src/lib/evas/canvas/efl_gfx_vg_value_provider.h
+++ b/src/lib/evas/canvas/efl_gfx_vg_value_provider.h
@@ -8,7 +8,7 @@
8struct _Efl_Gfx_Vg_Value_Provider_Data 8struct _Efl_Gfx_Vg_Value_Provider_Data
9{ 9{
10 Eo* obj; 10 Eo* obj;
11 Efl_Gfx_Vg_Value_Provider_Change_Flag flag; 11 Efl_Gfx_Vg_Value_Provider_Flags flag;
12 12
13 Eina_Stringshare *keypath; 13 Eina_Stringshare *keypath;
14 14
diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h
index 811e1cb8b6..dcd5cb0356 100644
--- a/src/lib/evas/canvas/evas_vg_private.h
+++ b/src/lib/evas/canvas/evas_vg_private.h
@@ -9,8 +9,6 @@ typedef struct _Efl_Canvas_Vg_Gradient_Data Efl_Canvas_Vg_Gradient_Data;
9typedef struct _Efl_Canvas_Vg_Interpolation Efl_Canvas_Vg_Interpolation; 9typedef struct _Efl_Canvas_Vg_Interpolation Efl_Canvas_Vg_Interpolation;
10typedef struct _Efl_Canvas_Vg_Object_Data Efl_Canvas_Vg_Object_Data; 10typedef struct _Efl_Canvas_Vg_Object_Data Efl_Canvas_Vg_Object_Data;
11 11
12typedef enum _Efl_Gfx_Vg_Value_Provider_Change_Flag Efl_Gfx_Vg_Value_Provider_Change_Flag;
13
14typedef struct _Vg_Cache 12typedef struct _Vg_Cache
15{ 13{
16 Eina_Hash *vfd_hash; 14 Eina_Hash *vfd_hash;
@@ -131,16 +129,6 @@ struct _Efl_Canvas_Vg_Interpolation
131 Eina_Point_3D skew; 129 Eina_Point_3D skew;
132}; 130};
133 131
134enum _Efl_Gfx_Vg_Value_Provider_Change_Flag
135{
136 EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_NONE = 0,
137 EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_FILL_COLOR = 2,
138 EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_STROKE_COLOR = 4,
139 EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_STROKE_WIDTH = 8,
140 EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_TRANSFORM_MATRIX = 16
141};
142Efl_Gfx_Vg_Value_Provider_Change_Flag efl_gfx_vg_value_provider_changed_flag_get(Eo *obj);
143
144void evas_cache_vg_init(void); 132void evas_cache_vg_init(void);
145void evas_cache_vg_shutdown(void); 133void evas_cache_vg_shutdown(void);
146Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h); 134Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h);
diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c
index b9b2900ff8..dba226fabf 100644
--- a/src/static_libs/vg_common/vg_common_json.c
+++ b/src/static_libs/vg_common/vg_common_json.c
@@ -503,10 +503,10 @@ _value_provider_override(Vg_File_Data *vfd)
503 EINA_LIST_FOREACH(vfd->vp_list, l, vp) 503 EINA_LIST_FOREACH(vfd->vp_list, l, vp)
504 { 504 {
505 const char *keypath; 505 const char *keypath;
506 Efl_Gfx_Vg_Value_Provider_Change_Flag flag; 506 Efl_Gfx_Vg_Value_Provider_Flags flag;
507 flag = efl_gfx_vg_value_provider_changed_flag_get(vp); 507 flag = efl_gfx_vg_value_provider_updated_get(vp);
508 508
509 if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_FILL_COLOR) 509 if (flag & EFL_GFX_VG_VALUE_PROVIDER_FLAGS_FILL_COLOR)
510 { 510 {
511 int r, g, b, a; 511 int r, g, b, a;
512 r = g = b = a = 0; 512 r = g = b = a = 0;
@@ -516,7 +516,7 @@ _value_provider_override(Vg_File_Data *vfd)
516 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_FILLCOLOR, (char*)keypath, r / 255.0, g / 255.0, b / 255.0); 516 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_FILLCOLOR, (char*)keypath, r / 255.0, g / 255.0, b / 255.0);
517 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_FILLOPACITY, (char*)keypath, (a / 255.0) * 100.0); 517 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_FILLOPACITY, (char*)keypath, (a / 255.0) * 100.0);
518 } 518 }
519 if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_STROKE_COLOR) 519 if (flag & EFL_GFX_VG_VALUE_PROVIDER_FLAGS_STROKE_COLOR)
520 { 520 {
521 int r, g, b, a; 521 int r, g, b, a;
522 r = g = b = a = 0; 522 r = g = b = a = 0;
@@ -526,7 +526,7 @@ _value_provider_override(Vg_File_Data *vfd)
526 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_STROKECOLOR, (char*)keypath, r / 255.0, g / 255.0, b / 255.0); 526 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_STROKECOLOR, (char*)keypath, r / 255.0, g / 255.0, b / 255.0);
527 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_STROKEOPACITY, (char*)keypath, (a / 255.0) * 100.0); 527 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_STROKEOPACITY, (char*)keypath, (a / 255.0) * 100.0);
528 } 528 }
529 if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_STROKE_WIDTH) 529 if (flag & EFL_GFX_VG_VALUE_PROVIDER_FLAGS_STROKE_WIDTH)
530 { 530 {
531 double w; 531 double w;
532 w = efl_gfx_vg_value_provider_stroke_width_get(vp); 532 w = efl_gfx_vg_value_provider_stroke_width_get(vp);
@@ -534,7 +534,7 @@ _value_provider_override(Vg_File_Data *vfd)
534 534
535 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_STROKEWIDTH, (char*)keypath, w); 535 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_STROKEWIDTH, (char*)keypath, w);
536 } 536 }
537 if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_TRANSFORM_MATRIX) 537 if (flag & EFL_GFX_VG_VALUE_PROVIDER_FLAGS_TRANSFORM_MATRIX)
538 { 538 {
539 Eina_Matrix4 m, *orig_m; 539 Eina_Matrix4 m, *orig_m;
540 double tx, ty, sx, sy, radian_z, si, cs; 540 double tx, ty, sx, sy, radian_z, si, cs;