rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=ea8f4486631711f945646596fddf0358b7fcfcaa

commit ea8f4486631711f945646596fddf0358b7fcfcaa
Author: Mykyta Biliavskyi <m.biliavs...@samsung.com>
Date:   Fri Jan 13 10:41:41 2017 +0200

    Property image: refactoring Image Item structure.
    
    Use anonymous structure "set" for attributes related to images set and
    images inside set of images.
---
 src/bin/ui/image_manager.c           | 12 +++++++-----
 src/bin/ui/main_window.h             | 22 +++++++++++++---------
 src/bin/ui/property/property_image.c | 18 +++++++++---------
 3 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/src/bin/ui/image_manager.c b/src/bin/ui/image_manager.c
index dac4ab8..a3c4ec3 100644
--- a/src/bin/ui/image_manager.c
+++ b/src/bin/ui/image_manager.c
@@ -228,14 +228,16 @@ _image_manager_image_set_grid_create(Evas_Object *parent,
         image_set_item->width = image_res->width;
         image_set_item->quality = image_res->quality;
         image_set_item->comp_type = image_res->comp_type;
+        image_set_item->set.name = eina_stringshare_add(res->common.name);
+        image_set_item->set.position = place;
         edje_edit_image_set_image_border_get(ap.project->global_object, 
res->common.name, place,
-                                             &image_set_item->border_l, 
&image_set_item->border_r,
-                                             &image_set_item->border_t, 
&image_set_item->border_b);
+                                             &image_set_item->set.border_l, 
&image_set_item->set.border_r,
+                                             &image_set_item->set.border_t, 
&image_set_item->set.border_b);
         edje_edit_image_set_image_max_get(ap.project->global_object, 
res->common.name, place,
-                                          &image_set_item->max_w, 
&image_set_item->max_h);
+                                          &image_set_item->set.max_w, 
&image_set_item->set.max_h);
         edje_edit_image_set_image_min_get(ap.project->global_object, 
res->common.name, place,
-                                          &image_set_item->min_w, 
&image_set_item->min_h);
-        image_set_item->border_scale = 
edje_edit_image_set_image_border_scale_get(ap.project->global_object,
+                                          &image_set_item->set.min_w, 
&image_set_item->set.min_h);
+        image_set_item->set.border_scale = 
edje_edit_image_set_image_border_scale_get(ap.project->global_object,
                                                                                
   res->common.name,
                                                                                
   place);
         elm_gengrid_item_append(images_set_grid, gic, image_set_item, 
_grid_image_set_image_sel , (void *)image_set_item);
diff --git a/src/bin/ui/main_window.h b/src/bin/ui/main_window.h
index 0534ed1..7894b6a 100644
--- a/src/bin/ui/main_window.h
+++ b/src/bin/ui/main_window.h
@@ -492,14 +492,6 @@ project_export_edc_group(void);
 
 struct _Image_Item
 {
-   int border_l;
-   int border_r;
-   int border_t;
-   int border_b;
-   int min_w;
-   int min_h;
-   int max_w;
-   int max_h;
    int id;
    const char* image_name;
    const char* source;
@@ -508,7 +500,19 @@ struct _Image_Item
    Eina_Bool is_used;
    int height, width;
    Image_Instance_Type type;
-   double border_scale;
+   struct {
+        int border_l;
+        int border_r;
+        int border_t;
+        int border_b;
+        int min_w;
+        int min_h;
+        int max_w;
+        int max_h;
+        const char *name;
+        int position;
+        double border_scale;
+   } set;
 };
 
 /**
diff --git a/src/bin/ui/property/property_image.c 
b/src/bin/ui/property/property_image.c
index 9f31607..03afb84 100644
--- a/src/bin/ui/property/property_image.c
+++ b/src/bin/ui/property/property_image.c
@@ -144,31 +144,31 @@ _update_cb(Property_Attribute *pa __UNUSED__, 
Property_Action *action)
          eina_stringshare_del(str);
          break;
       case ATTRIBUTE_IMAGE_ITEM_BORDER_L:
-         elm_spinner_value_set(action->control, image_pd.img->border_l);
+         elm_spinner_value_set(action->control, image_pd.img->set.border_l);
          break;
       case ATTRIBUTE_IMAGE_ITEM_BORDER_R:
-         elm_spinner_value_set(action->control, image_pd.img->border_r);
+         elm_spinner_value_set(action->control, image_pd.img->set.border_r);
          break;
       case ATTRIBUTE_IMAGE_ITEM_BORDER_T:
-         elm_spinner_value_set(action->control, image_pd.img->border_t);
+         elm_spinner_value_set(action->control, image_pd.img->set.border_t);
          break;
       case ATTRIBUTE_IMAGE_ITEM_BORDER_B:
-         elm_spinner_value_set(action->control, image_pd.img->border_b);
+         elm_spinner_value_set(action->control, image_pd.img->set.border_b);
          break;
       case ATTRIBUTE_IMAGE_ITEM_MIN_W:
-         elm_spinner_value_set(action->control, image_pd.img->min_w);
+         elm_spinner_value_set(action->control, image_pd.img->set.min_w);
          break;
       case ATTRIBUTE_IMAGE_ITEM_MIN_H:
-         elm_spinner_value_set(action->control, image_pd.img->min_h);
+         elm_spinner_value_set(action->control, image_pd.img->set.min_h);
          break;
       case ATTRIBUTE_IMAGE_ITEM_MAX_W:
-         elm_spinner_value_set(action->control, image_pd.img->max_w);
+         elm_spinner_value_set(action->control, image_pd.img->set.max_w);
          break;
       case ATTRIBUTE_IMAGE_ITEM_MAX_H:
-         elm_spinner_value_set(action->control, image_pd.img->max_h);
+         elm_spinner_value_set(action->control, image_pd.img->set.max_h);
          break;
       case ATTRIBUTE_IMAGE_ITEM_BORDER_SCALE:
-         elm_spinner_value_set(action->control, image_pd.img->border_scale);
+         elm_spinner_value_set(action->control, 
image_pd.img->set.border_scale);
          break;
       default:
          CRIT("Failed to update attribute [%s]", action->name ? action->name : 
"unknown");

-- 


Reply via email to