edje_pick: copy block 'data' 76/82076/2
authorVyacheslav Reutskiy <v.reutskiy@samsung.com>
Tue, 26 Jul 2016 12:25:01 +0000 (15:25 +0300)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Wed, 3 Aug 2016 09:30:10 +0000 (02:30 -0700)
Copy global data from files. Main resoan for it - elementary.
Elementary needs data "version" for load widget styles.

@fix

Change-Id: Ied2584e1bf3a1bbe05246f782fe508545b979eeb

src/bin/edje/edje_pick.c

index e8163ca..c89950b 100644 (file)
@@ -530,6 +530,7 @@ _edje_pick_output_prepare(Edje_File *o, Edje_File *edf, char *name)
         o->minor = edf->minor;
         o->feature_ver = edf->feature_ver;
         o->collection = eina_hash_string_small_new(NULL);
+        o->data = eina_hash_string_small_new(NULL);
 
         /* Open output file */
         o->ef = eet_open(name, EET_FILE_MODE_WRITE);
@@ -622,6 +623,24 @@ _edje_pick_header_dependencies_check(Edje_File *out_file, Edje_File *edf, Edje_P
 }
 
 static int
+_edje_pick_data_update(Edje_File *out_file , Edje_File *edf)
+{
+   Eina_Bool status = EDJE_PICK_NO_ERROR;
+   Eina_Iterator *i;
+   Eina_Stringshare *key, *value;
+
+   i = eina_hash_iterator_key_new(edf->data);
+   EINA_ITERATOR_FOREACH(i, key)
+     {
+        if (eina_hash_find(out_file->data, key)) continue;
+        value = eina_hash_find(edf->data, key);
+        eina_hash_direct_add(out_file->data, key, value);
+     }
+
+   return status;
+}
+
+static int
 _edje_pick_header_make(Edje_File *out_file , Edje_File *edf, Eina_List *ifs)
 {
    static int current_group_id = 0;
@@ -1493,6 +1512,7 @@ main(int argc, char **argv)
         _Edje_Pick_Fonts_add(edf);   /* Add fonts from file to fonts list */
 
         /* Copy styles, color class */
+        _edje_pick_data_update(out_file, edf);
         _edje_pick_styles_update(out_file, edf);
         _edje_pick_color_class_update(out_file, edf);