* edje: move code around.
authorcedric <cedric>
Fri, 6 Aug 2010 11:07:47 +0000 (11:07 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 6 Aug 2010 11:07:47 +0000 (11:07 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@50858 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_convert.c
src/lib/edje_convert.h
src/lib/edje_edit.c
src/lib/edje_private.h
src/lib/edje_util.c

index 354a53b..58dccc2 100644 (file)
@@ -251,31 +251,6 @@ _edje_collection_program_add(Edje_Program ***array,
    *array = tmp;
 }
 
-Eina_Bool
-edje_program_is_strncmp(const char *str)
-{
-   unsigned int length;
-
-   length = strlen(str);
-
-   if (strpbrk(str, "*?[\\") != str + length)
-     return EINA_FALSE;
-   if (str[length] == '['
-       || str[length] == '\\')
-     return EINA_FALSE;
-   return EINA_TRUE;
-}
-
-Eina_Bool
-edje_program_is_strrncmp(const char *str)
-{
-   if (*str != '*' && *str != '?')
-     return EINA_FALSE;
-   if (strpbrk(str + 1, "*?[\\") != NULL)
-     return EINA_FALSE;
-   return EINA_TRUE;
-}
-
 Edje_Part_Collection *
 _edje_collection_convert(Edje_File *file, Old_Edje_Part_Collection *oedc)
 {
index f954f68..fcc2781 100644 (file)
@@ -140,7 +140,4 @@ Edje_Part_Description_Common *_edje_description_convert(int type,
 const Edje_File *_edje_file_get(void);
 void _edje_file_set(const Edje_File *edf);
 
-Eina_Bool edje_program_is_strncmp(const char *str);
-Eina_Bool edje_program_is_strrncmp(const char *str);
-
 #endif
index b43cbe1..816b410 100644 (file)
@@ -4514,91 +4514,6 @@ edje_edit_program_add(Evas_Object *obj, const char *name)
    return EINA_TRUE;
 }
 
-static void
-_edje_edit_program_remove(Edje *ed, Edje_Program *p)
-{
-   Edje_Program ***array;
-   unsigned int *count;
-   unsigned int i;
-
-   if (!p->signal && !p->source)
-     {
-       array = &ed->collection->programs.nocmp;
-       count = &ed->collection->programs.nocmp_count;
-     }
-   else if (p->signal && strpbrk(p->signal, "*?[\\") == NULL
-           && p->source && strpbrk(p->source, "*?[\\") == NULL)
-     {
-       array = &ed->collection->programs.strcmp;
-       count = &ed->collection->programs.strcmp_count;
-     }
-   else if (p->signal && edje_program_is_strncmp(p->signal)
-           && p->source && edje_program_is_strncmp(p->source))
-     {
-       array = &ed->collection->programs.strncmp;
-       count = &ed->collection->programs.strncmp_count;
-     }
-   else if (p->signal && edje_program_is_strrncmp(p->signal)
-           && p->source && edje_program_is_strrncmp(p->source))
-     {
-       array = &ed->collection->programs.strrncmp;
-       count = &ed->collection->programs.strrncmp_count;
-     }
-   else
-     {
-       array = &ed->collection->programs.fnmatch;
-       count = &ed->collection->programs.fnmatch_count;
-     }
-
-   for (i = 0; i < *count; ++i)
-     if ((*array)[i] == p)
-       {
-         memmove(*array + i, *array + i + 1, sizeof (Edje_Program *) * (*count - i -1));
-         (*count)--;
-         break;
-       }
-}
-
-static void
-_edje_edit_program_insert(Edje *ed, Edje_Program *p)
-{
-   Edje_Program ***array;
-   unsigned int *count;
-
-   if (!p->signal && !p->source)
-     {
-       array = &ed->collection->programs.nocmp;
-       count = &ed->collection->programs.nocmp_count;
-     }
-   else if (p->signal && strpbrk(p->signal, "*?[\\") == NULL
-           && p->source && strpbrk(p->source, "*?[\\") == NULL)
-     {
-       array = &ed->collection->programs.strcmp;
-       count = &ed->collection->programs.strcmp_count;
-     }
-   else if (p->signal && edje_program_is_strncmp(p->signal)
-           && p->source && edje_program_is_strncmp(p->source))
-     {
-       array = &ed->collection->programs.strncmp;
-       count = &ed->collection->programs.strncmp_count;
-     }
-   else if (p->signal && edje_program_is_strrncmp(p->signal)
-           && p->source && edje_program_is_strrncmp(p->source))
-     {
-       array = &ed->collection->programs.strrncmp;
-       count = &ed->collection->programs.strrncmp_count;
-     }
-   else
-     {
-       array = &ed->collection->programs.fnmatch;
-       count = &ed->collection->programs.fnmatch_count;
-     }
-
-   *array = realloc(*array, sizeof (Edje_Program *) * (*count + 1));
-   (*array)[(*count)++] = p;
-
-}
-
 EAPI Eina_Bool
 edje_edit_program_del(Evas_Object *obj, const char *prog)
 {
@@ -4617,7 +4532,7 @@ edje_edit_program_del(Evas_Object *obj, const char *prog)
 
    //Remove program from programs list
    id = epr->id;
-   _edje_edit_program_remove(ed, epr);
+   edje_edit_program_remove(ed, epr);
 
    /* fix table program */
    if (epr->id != ed->table_programs_size - 1)
@@ -4736,12 +4651,12 @@ edje_edit_program_source_set(Evas_Object *obj, const char *prog, const char *sou
    if (!source) return EINA_FALSE;
 
    /* Remove from program array */
-   _edje_edit_program_remove(ed, epr);
+   edje_edit_program_remove(ed, epr);
    _edje_if_string_free(ed, epr->source);
 
    /* Insert it back */
    epr->source = eina_stringshare_add(source);
-   _edje_edit_program_insert(ed, epr);
+   edje_edit_program_insert(ed, epr);
 
    //Update patterns
    _edje_programs_patterns_clean(ed);
@@ -4815,12 +4730,12 @@ edje_edit_program_signal_set(Evas_Object *obj, const char *prog, const char *sig
    if (!signal) return EINA_FALSE;
 
    /* Remove from program array */
-   _edje_edit_program_remove(ed, epr);
+   edje_edit_program_remove(ed, epr);
    _edje_if_string_free(ed, epr->signal);
 
    /* Insert it back */
    epr->signal = eina_stringshare_add(signal);
-   _edje_edit_program_insert(ed, epr);
+   edje_edit_program_insert(ed, epr);
 
    //Update patterns
    _edje_programs_patterns_clean(ed);
index 47546c3..b95326b 100644 (file)
@@ -1731,11 +1731,10 @@ void _edje_external_parsed_params_free(Evas_Object *obj, void *params);
 void _edje_module_init();
 void _edje_module_shutdown();
 
-
-
-
-
-
+Eina_Bool edje_program_is_strncmp(const char *str);
+Eina_Bool edje_program_is_strrncmp(const char *str);
+void edje_edit_program_insert(Edje *ed, Edje_Program *p);
+void edje_edit_program_remove(Edje *ed, Edje_Program *p);
 
 // new lua stuff - supercedes the old
 #define LUA2 1
index 40ba71a..2876c78 100644 (file)
@@ -4824,3 +4824,112 @@ _edje_object_signal_preload_cb(void *data, Evas_Object *obj, __UNUSED__ const ch
    edje_object_signal_callback_del(obj, EDJE_PRELOAD_EMISSION, EDJE_PRELOAD_SOURCE, _edje_object_signal_preload_cb);
    _edje_object_preload(ed);
 }
+
+void
+edje_edit_program_remove(Edje *ed, Edje_Program *p)
+{
+   Edje_Program ***array;
+   unsigned int *count;
+   unsigned int i;
+
+   if (!p->signal && !p->source)
+     {
+       array = &ed->collection->programs.nocmp;
+       count = &ed->collection->programs.nocmp_count;
+     }
+   else if (p->signal && strpbrk(p->signal, "*?[\\") == NULL
+           && p->source && strpbrk(p->source, "*?[\\") == NULL)
+     {
+       array = &ed->collection->programs.strcmp;
+       count = &ed->collection->programs.strcmp_count;
+     }
+   else if (p->signal && edje_program_is_strncmp(p->signal)
+           && p->source && edje_program_is_strncmp(p->source))
+     {
+       array = &ed->collection->programs.strncmp;
+       count = &ed->collection->programs.strncmp_count;
+     }
+   else if (p->signal && edje_program_is_strrncmp(p->signal)
+           && p->source && edje_program_is_strrncmp(p->source))
+     {
+       array = &ed->collection->programs.strrncmp;
+       count = &ed->collection->programs.strrncmp_count;
+     }
+   else
+     {
+       array = &ed->collection->programs.fnmatch;
+       count = &ed->collection->programs.fnmatch_count;
+     }
+
+   for (i = 0; i < *count; ++i)
+     if ((*array)[i] == p)
+       {
+         memmove(*array + i, *array + i + 1, sizeof (Edje_Program *) * (*count - i -1));
+         (*count)--;
+         break;
+       }
+}
+
+void
+edje_edit_program_insert(Edje *ed, Edje_Program *p)
+{
+   Edje_Program ***array;
+   unsigned int *count;
+
+   if (!p->signal && !p->source)
+     {
+       array = &ed->collection->programs.nocmp;
+       count = &ed->collection->programs.nocmp_count;
+     }
+   else if (p->signal && strpbrk(p->signal, "*?[\\") == NULL
+           && p->source && strpbrk(p->source, "*?[\\") == NULL)
+     {
+       array = &ed->collection->programs.strcmp;
+       count = &ed->collection->programs.strcmp_count;
+     }
+   else if (p->signal && edje_program_is_strncmp(p->signal)
+           && p->source && edje_program_is_strncmp(p->source))
+     {
+       array = &ed->collection->programs.strncmp;
+       count = &ed->collection->programs.strncmp_count;
+     }
+   else if (p->signal && edje_program_is_strrncmp(p->signal)
+           && p->source && edje_program_is_strrncmp(p->source))
+     {
+       array = &ed->collection->programs.strrncmp;
+       count = &ed->collection->programs.strrncmp_count;
+     }
+   else
+     {
+       array = &ed->collection->programs.fnmatch;
+       count = &ed->collection->programs.fnmatch_count;
+     }
+
+   *array = realloc(*array, sizeof (Edje_Program *) * (*count + 1));
+   (*array)[(*count)++] = p;
+}
+
+Eina_Bool
+edje_program_is_strncmp(const char *str)
+{
+   unsigned int length;
+
+   length = strlen(str);
+
+   if (strpbrk(str, "*?[\\") != str + length)
+     return EINA_FALSE;
+   if (str[length] == '['
+       || str[length] == '\\')
+     return EINA_FALSE;
+   return EINA_TRUE;
+}
+
+Eina_Bool
+edje_program_is_strrncmp(const char *str)
+{
+   if (*str != '*' && *str != '?')
+     return EINA_FALSE;
+   if (strpbrk(str + 1, "*?[\\") != NULL)
+     return EINA_FALSE;
+   return EINA_TRUE;
+}