forked from enlightenment/efl
edje_edit: add API for generate group source code without 'collection'
This commit is contained in:
parent
0d9b168146
commit
49689708a6
|
@ -8130,6 +8130,24 @@ EAPI const Eina_List *edje_edit_script_error_list_get(Evas_Object *obj);
|
||||||
|
|
||||||
EAPI const char *edje_edit_source_generate(Evas_Object *obj);
|
EAPI const char *edje_edit_source_generate(Evas_Object *obj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return source code of the current edje edit object.
|
||||||
|
*
|
||||||
|
* Remember to free the string with edje_edit_string_free()
|
||||||
|
*
|
||||||
|
* This function will return source code of the whole group, loaded previously.
|
||||||
|
* This function also will collect all possible resources that is required and
|
||||||
|
* mentioned in description blocks. For example: all images, fonts, styles and
|
||||||
|
* color_classes.
|
||||||
|
*
|
||||||
|
* @note A source code will be top block 'collection'.
|
||||||
|
*
|
||||||
|
* @param obj The object being edited
|
||||||
|
*
|
||||||
|
* @return Source code containing all resources required by the object.
|
||||||
|
*/
|
||||||
|
|
||||||
|
EAPI const char * edje_edit_object_source_generate(Evas_Object *obj);
|
||||||
/**
|
/**
|
||||||
* Return source code of all collections.
|
* Return source code of all collections.
|
||||||
*
|
*
|
||||||
|
|
|
@ -12459,8 +12459,8 @@ error:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
static const char *
|
||||||
edje_edit_source_generate(Evas_Object *obj)
|
_edje_edit_source_generate(Evas_Object *obj, Eina_Bool without_global_data)
|
||||||
{
|
{
|
||||||
Edje_Part_Collection_Directory_Entry *ce;
|
Edje_Part_Collection_Directory_Entry *ce;
|
||||||
Edje_Part *part;
|
Edje_Part *part;
|
||||||
|
@ -12588,7 +12588,7 @@ edje_edit_source_generate(Evas_Object *obj)
|
||||||
buf = eina_strbuf_new();
|
buf = eina_strbuf_new();
|
||||||
|
|
||||||
/* If data items exist, print them */
|
/* If data items exist, print them */
|
||||||
if (ed->file->data)
|
if (!without_global_data && ed->file->data)
|
||||||
{
|
{
|
||||||
Edje_String *es;
|
Edje_String *es;
|
||||||
size_t data_len = 0;
|
size_t data_len = 0;
|
||||||
|
@ -12706,7 +12706,7 @@ edje_edit_source_generate(Evas_Object *obj)
|
||||||
eina_list_free(fonts);
|
eina_list_free(fonts);
|
||||||
}
|
}
|
||||||
/* if color_classes were found, print them */
|
/* if color_classes were found, print them */
|
||||||
if (color_classes)
|
if (!without_global_data && color_classes)
|
||||||
{
|
{
|
||||||
BUF_APPEND(I0 "color_classes {\n");
|
BUF_APPEND(I0 "color_classes {\n");
|
||||||
|
|
||||||
|
@ -12719,7 +12719,7 @@ edje_edit_source_generate(Evas_Object *obj)
|
||||||
|
|
||||||
|
|
||||||
/* print the main code of group collections */
|
/* print the main code of group collections */
|
||||||
BUF_APPEND(I0 "collections {\n");
|
if (!without_global_data) BUF_APPEND(I0 "collections {\n");
|
||||||
/* if sounds were found, print them */
|
/* if sounds were found, print them */
|
||||||
if (sounds)
|
if (sounds)
|
||||||
{
|
{
|
||||||
|
@ -12764,7 +12764,7 @@ edje_edit_source_generate(Evas_Object *obj)
|
||||||
BUF_APPEND(I1 "}\n");
|
BUF_APPEND(I1 "}\n");
|
||||||
}
|
}
|
||||||
_edje_generate_source_of_group(ed, ce, buf);
|
_edje_generate_source_of_group(ed, ce, buf);
|
||||||
BUF_APPEND(I0 "}");
|
if (!without_global_data) BUF_APPEND(I0 "}");
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
|
@ -12779,6 +12779,18 @@ edje_edit_source_generate(Evas_Object *obj)
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI const char *
|
||||||
|
edje_edit_source_generate(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
return _edje_edit_source_generate(obj, EINA_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI const char *
|
||||||
|
edje_edit_object_source_generate(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
return _edje_edit_source_generate(obj, EINA_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
#undef COLLECT_RESOURCE
|
#undef COLLECT_RESOURCE
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
|
Loading…
Reference in New Issue