rimmed pushed a commit to branch master.

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

commit 2103fbc085da0926438157758f7394cda95dcbc3
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Wed Sep 14 21:08:53 2016 +0300

    group_manager: move gm_part_type_text_get and rename into appropriate 
position
---
 src/bin/common/string_common.c          | 32 ++++++++++++++++++++++++++++++++
 src/bin/common/string_common.h          |  3 +++
 src/bin/project_manager/group_manager.c | 32 --------------------------------
 src/bin/ui/property/property_group.c    |  3 ++-
 src/bin/ui/workspace/group_navigator.c  |  8 ++++----
 5 files changed, 41 insertions(+), 37 deletions(-)

diff --git a/src/bin/common/string_common.c b/src/bin/common/string_common.c
index 7309e74..459a5f4 100644
--- a/src/bin/common/string_common.c
+++ b/src/bin/common/string_common.c
@@ -97,3 +97,35 @@ string_rstr(const char *str1, const char *str2)
      }
    return NULL;
 }
+
+/**
+ * ref http://docs.enlightenment.org/auto/edje/group__Edje__Object__Part.html
+ */
+static char *part_types[] = {
+     "None",
+     "Rectangle",
+     "Text",
+     "Image",
+     "Swallow",
+     "Textblock",
+     "Gradient",
+     "Group",
+     "Box",
+     "Table",
+     "External",
+     "Proxy",
+     "Spacer",
+     "Mesh node",
+     "Light",
+     "Camera",
+     "Snapshot"
+};
+static unsigned int part_types_count = 16;
+
+const char *
+part_type_text_get(Edje_Part_Type part_type)
+{
+   assert(part_type <= part_types_count);
+
+   return part_types[part_type];
+}
diff --git a/src/bin/common/string_common.h b/src/bin/common/string_common.h
index a358c8f..3a4d62e 100644
--- a/src/bin/common/string_common.h
+++ b/src/bin/common/string_common.h
@@ -65,4 +65,7 @@ string_cat(const char *str1, const char *str2);
 const char *
 string_rstr(const char *str1, const char *str2);
 
+const char *
+part_type_text_get(Edje_Part_Type part_type);
+
 #endif /* STRING_MACRO_H */
diff --git a/src/bin/project_manager/group_manager.c 
b/src/bin/project_manager/group_manager.c
index ada111f..479a68e 100644
--- a/src/bin/project_manager/group_manager.c
+++ b/src/bin/project_manager/group_manager.c
@@ -1112,35 +1112,3 @@ gm_group_data_rename(Project *pro, Group *group, 
Resource* group_data, const cha
    group_data->name = eina_stringshare_add(new_data_name);
    resource_insert(&group->data_items, group_data);
 }
-
-/**
- * ref http://docs.enlightenment.org/auto/edje/group__Edje__Object__Part.html
- */
-static char *part_types[] = {
-     "None",
-     "Rectangle",
-     "Text",
-     "Image",
-     "Swallow",
-     "Textblock",
-     "Gradient",
-     "Group",
-     "Box",
-     "Table",
-     "External",
-     "Proxy",
-     "Spacer",
-     "Mesh node",
-     "Light",
-     "Camera",
-     "Snapshot"
-};
-static unsigned int part_types_count = 16;
-
-const char *
-gm_part_type_text_get(Edje_Part_Type part_type)
-{
-   assert(part_type <= part_types_count);
-
-   return part_types[part_type];
-}
diff --git a/src/bin/ui/property/property_group.c 
b/src/bin/ui/property/property_group.c
index 71a57e5..79dccc8 100644
--- a/src/bin/ui/property/property_group.c
+++ b/src/bin/ui/property/property_group.c
@@ -29,6 +29,7 @@
 #include "project_manager.h"
 #include "validator.h"
 #include "shortcuts.h"
+#include "string_common.h"
 
 #define PART_MASK(TYPE) (1u << TYPE)
 #define PART_RECTANGLE PART_MASK(EDJE_PART_TYPE_RECTANGLE)
@@ -1798,7 +1799,7 @@ _update_cb(Property_Attribute *pa, Property_Action 
*action)
          edje_edit_string_free(str_val1);
          return true;
       case ATTRIBUTE_PART_TYPE:
-         elm_layout_text_set(action->control, NULL, 
gm_part_type_text_get(((Part *)group_pd.group->current_selected)->type));
+         elm_layout_text_set(action->control, NULL, part_type_text_get(((Part 
*)group_pd.group->current_selected)->type));
          return true;
       case ATTRIBUTE_PROGRAM_ACTION:
          elm_layout_text_set(action->control, NULL, action_type[((Part 
*)group_pd.group->current_selected)->type]);
diff --git a/src/bin/ui/workspace/group_navigator.c 
b/src/bin/ui/workspace/group_navigator.c
index 4b744bf..9dbd02c 100644
--- a/src/bin/ui/workspace/group_navigator.c
+++ b/src/bin/ui/workspace/group_navigator.c
@@ -983,12 +983,12 @@ _part_selected_cb(void *data,
    if (item->index != 0)
      {
         type = edje_edit_part_type_get(pl->group->edit_object, 
elm_object_text_get(pl->popup.combobox_copy));
-        elm_object_text_set(pl->popup.combobox, gm_part_type_text_get(type));
+        elm_object_text_set(pl->popup.combobox, part_type_text_get(type));
         elm_object_disabled_set(pl->popup.combobox, true);
      }
    else
      {
-        elm_object_text_set(pl->popup.combobox, 
gm_part_type_text_get(pl->popup.part_type));
+        elm_object_text_set(pl->popup.combobox, 
part_type_text_get(pl->popup.part_type));
         elm_object_disabled_set(pl->popup.combobox, false);
      }
 }
@@ -1083,13 +1083,13 @@ _add_part_content_get(void *data, Evas_Object *popup 
__UNUSED__, Evas_Object **t
    for (i = 0; part_types[i] != EDJE_PART_TYPE_NONE; i++)
      {
         combobox_item = mem_malloc(sizeof(Combobox_Item));
-        combobox_item->data = 
eina_stringshare_add(gm_part_type_text_get(part_types[i]));
+        combobox_item->data = 
eina_stringshare_add(part_type_text_get(part_types[i]));
         combobox_item->index = part_types[i];
         elm_genlist_item_append(pl->popup.combobox, pl->popup.itc,
                                 combobox_item, NULL,
                                 ELM_GENLIST_ITEM_NONE, NULL, NULL);
      }
-   elm_object_text_set(pl->popup.combobox, 
gm_part_type_text_get(part_types[0]));
+   elm_object_text_set(pl->popup.combobox, part_type_text_get(part_types[0]));
    elm_object_part_content_set(item, "elm.swallow.content", 
pl->popup.combobox);
    evas_object_smart_callback_add(pl->popup.combobox, 
signals.elm.combobox.item_selected, _type_selected_cb, pl);
    elm_box_pack_end(box, item);

-- 


Reply via email to