summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2016-04-04 19:56:01 +0900
committerJee-Yong Um <jc9.um@samsung.com>2016-04-04 19:56:01 +0900
commit2ab8869dd7a9534ec20fe407167190acfff84d55 (patch)
tree7fbe6f7c18f66442d0b6543b798fbdf52328f7f7
parentcf2804a220c492674b219c2db65b18a502083aff (diff)
downloadefl-devs/conr2d/edje_part_file.tar.gz
edje: add edje_object_part_file_set/get()devs/conr2d/edje_part_file
-rw-r--r--src/lib/edje/edje_object.eo24
-rw-r--r--src/lib/edje/edje_smart.c56
2 files changed, 80 insertions, 0 deletions
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 305684c3c7..0b1fbe2e2e 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -2221,6 +2221,30 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
scale: double; [[The transition duration factor]]
}
}
+ @property part_file {
+ set {
+ [[Set the EDJ file (and group within it) the part of the given edje object.
+
+ This has no effect if the type of part is not EDJE_PART_TYPE_GROUP.
+
+ @since 1.18]]
+ return: bool;
+ }
+ get {
+ [[Retrieve the file and group name that the part of the given edje object is bound to.
+
+ This has no effect if the type of part is not EDJE_PART_TYPE_GROUP.
+
+ @since 1.18]]
+ }
+ keys {
+ part: const(char)*; [[The part name]]
+ }
+ values {
+ file: const(char)*; [[The file path]]
+ group: const(char)*; [[The group name]]
+ }
+ }
}
implements {
Eo.Base.constructor;
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index 2e905bf2ac..31d761f462 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -350,6 +350,62 @@ _edje_object_evas_object_smart_calculate(Eo *obj EINA_UNUSED, Edje *ed)
_edje_recalc_do(ed);
}
+EOLIAN static void
+_edje_object_part_file_get(Eo *obj EINA_UNUSED, Edje *ed,
+ const char *part,
+ const char **file,
+ const char **group)
+{
+ unsigned int i;
+
+ for (i = 0; i < ed->table_parts_size; i++)
+ {
+ if (!strcmp(ed->table_parts[i]->part->name, part))
+ {
+ if ((ed->table_parts[i]->part->type == EDJE_PART_TYPE_GROUP) &&
+ (ed->table_parts[i]->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ed->table_parts[i]->typedata.swallow) &&
+ (ed->table_parts[i]->typedata.swallow->swallowed_object))
+ {
+ efl_file_get(ed->table_parts[i]->typedata.swallow->swallowed_object,
+ file, group);
+ return;
+ }
+ break;
+ }
+ }
+
+ if (file) *file = NULL;
+ if (group) *group = NULL;
+}
+
+EOLIAN static Eina_Bool
+_edje_object_part_file_set(Eo *obj EINA_UNUSED, Edje *ed,
+ const char *part,
+ const char *file,
+ const char *group)
+{
+ unsigned int i;
+
+ for (i = 0; i < ed->table_parts_size; i++)
+ {
+ if (!strcmp(ed->table_parts[i]->part->name, part))
+ {
+ if ((ed->table_parts[i]->part->type == EDJE_PART_TYPE_GROUP) &&
+ (ed->table_parts[i]->type == EDJE_RP_TYPE_SWALLOW) &&
+ (ed->table_parts[i]->typedata.swallow) &&
+ (ed->table_parts[i]->typedata.swallow->swallowed_object))
+ {
+ return efl_file_set(ed->table_parts[i]->typedata.swallow->swallowed_object,
+ file, group);
+ }
+ break;
+ }
+ }
+
+ return EINA_FALSE;
+}
+
EOLIAN static Eina_Bool
_edje_object_efl_file_file_set(Eo *obj, Edje *ed, const char *file, const char *group)
{