diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/edje/Edje_Edit.h | 8 | ||||
-rw-r--r-- | src/lib/edje/edje_edit.c | 20 |
2 files changed, 17 insertions, 11 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 917dd79e94..23611da296 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h | |||
@@ -3744,8 +3744,10 @@ EAPI char *edje_edit_script_get(Evas_Object *obj); | |||
3744 | * | 3744 | * |
3745 | * @param obj The object being edited | 3745 | * @param obj The object being edited |
3746 | * @param code The Embryo source | 3746 | * @param code The Embryo source |
3747 | * | ||
3748 | * @return EINA_TRUE if successful, EINA_FALSE otherwise. | ||
3747 | */ | 3749 | */ |
3748 | EAPI void edje_edit_script_set(Evas_Object *obj, const char *code); | 3750 | EAPI Eina_Bool edje_edit_script_set(Evas_Object *obj, const char *code); |
3749 | 3751 | ||
3750 | /** | 3752 | /** |
3751 | * Get the Embryo script for the given program. | 3753 | * Get the Embryo script for the given program. |
@@ -3775,8 +3777,10 @@ EAPI char *edje_edit_script_program_get(Evas_Object *obj, const char *prog); | |||
3775 | * @param obj The object being edited | 3777 | * @param obj The object being edited |
3776 | * @param prog The program name. | 3778 | * @param prog The program name. |
3777 | * @param code The Embryo source | 3779 | * @param code The Embryo source |
3780 | * | ||
3781 | * @return EINA_TRUE if successful, EINA_FALSE otherwise. | ||
3778 | */ | 3782 | */ |
3779 | EAPI void edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *code); | 3783 | EAPI Eina_Bool edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *code); |
3780 | 3784 | ||
3781 | /** | 3785 | /** |
3782 | * Compile the Embryo script for the given object | 3786 | * Compile the Embryo script for the given object |
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 038414d9d2..be6972d43f 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c | |||
@@ -5746,10 +5746,10 @@ edje_edit_script_get(Evas_Object *obj) | |||
5746 | return strdup(eed->embryo_source); | 5746 | return strdup(eed->embryo_source); |
5747 | } | 5747 | } |
5748 | 5748 | ||
5749 | EAPI void | 5749 | EAPI Eina_Bool |
5750 | edje_edit_script_set(Evas_Object *obj, const char *code) | 5750 | edje_edit_script_set(Evas_Object *obj, const char *code) |
5751 | { | 5751 | { |
5752 | GET_EED_OR_RETURN(); | 5752 | GET_EED_OR_RETURN(EINA_FALSE); |
5753 | 5753 | ||
5754 | free(eed->embryo_source); | 5754 | free(eed->embryo_source); |
5755 | free(eed->embryo_processed); | 5755 | free(eed->embryo_processed); |
@@ -5763,6 +5763,7 @@ edje_edit_script_set(Evas_Object *obj, const char *code) | |||
5763 | eed->embryo_source_dirty = EINA_TRUE; | 5763 | eed->embryo_source_dirty = EINA_TRUE; |
5764 | 5764 | ||
5765 | _edje_edit_flag_script_dirty(eed, EINA_FALSE); | 5765 | _edje_edit_flag_script_dirty(eed, EINA_FALSE); |
5766 | return EINA_TRUE; | ||
5766 | } | 5767 | } |
5767 | 5768 | ||
5768 | EAPI char * | 5769 | EAPI char * |
@@ -5776,27 +5777,27 @@ edje_edit_script_program_get(Evas_Object *obj, const char *prog) | |||
5776 | if (epr->action != EDJE_ACTION_TYPE_SCRIPT) | 5777 | if (epr->action != EDJE_ACTION_TYPE_SCRIPT) |
5777 | return NULL; | 5778 | return NULL; |
5778 | 5779 | ||
5779 | ps = eina_hash_find(eed->program_scripts, prog); | 5780 | ps = eina_hash_find(eed->program_scripts, &epr->id); |
5780 | if (!ps) /* mmm? it should be there, even if empty */ | 5781 | if (!ps) /* mmm? it should be there, even if empty */ |
5781 | return NULL; | 5782 | return NULL; |
5782 | 5783 | ||
5783 | return ps->code ? strdup(ps->code) : NULL; | 5784 | return ps->code ? strdup(ps->code) : NULL; |
5784 | } | 5785 | } |
5785 | 5786 | ||
5786 | EAPI void | 5787 | EAPI Eina_Bool |
5787 | edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *code) | 5788 | edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *code) |
5788 | { | 5789 | { |
5789 | Program_Script *ps; | 5790 | Program_Script *ps; |
5790 | 5791 | ||
5791 | GET_EED_OR_RETURN(); | 5792 | GET_EED_OR_RETURN(EINA_FALSE); |
5792 | GET_EPR_OR_RETURN(); | 5793 | GET_EPR_OR_RETURN(EINA_FALSE); |
5793 | 5794 | ||
5794 | if (epr->action != EDJE_ACTION_TYPE_SCRIPT) | 5795 | if (epr->action != EDJE_ACTION_TYPE_SCRIPT) |
5795 | return; | 5796 | return EINA_FALSE; |
5796 | 5797 | ||
5797 | ps = eina_hash_find(eed->program_scripts, prog); | 5798 | ps = eina_hash_find(eed->program_scripts, &epr->id); |
5798 | if (!ps) /* ???? how so? */ | 5799 | if (!ps) /* ???? how so? */ |
5799 | return; | 5800 | return EINA_FALSE; |
5800 | 5801 | ||
5801 | free(ps->code); | 5802 | free(ps->code); |
5802 | free(ps->processed); | 5803 | free(ps->processed); |
@@ -5809,6 +5810,7 @@ edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *cod | |||
5809 | ps->dirty = EINA_TRUE; | 5810 | ps->dirty = EINA_TRUE; |
5810 | 5811 | ||
5811 | _edje_edit_flag_script_dirty(eed, EINA_FALSE); | 5812 | _edje_edit_flag_script_dirty(eed, EINA_FALSE); |
5813 | return EINA_TRUE; | ||
5812 | } | 5814 | } |
5813 | 5815 | ||
5814 | static int | 5816 | static int |