*
* @param obj The object being edited
* @param code The Embryo source
+ *
+ * @return EINA_TRUE if successful, EINA_FALSE otherwise.
*/
-EAPI void edje_edit_script_set(Evas_Object *obj, const char *code);
+EAPI Eina_Bool edje_edit_script_set(Evas_Object *obj, const char *code);
/**
* Get the Embryo script for the given program.
* @param obj The object being edited
* @param prog The program name.
* @param code The Embryo source
+ *
+ * @return EINA_TRUE if successful, EINA_FALSE otherwise.
*/
-EAPI void edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *code);
+EAPI Eina_Bool edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *code);
/**
* Compile the Embryo script for the given object
return strdup(eed->embryo_source);
}
-EAPI void
+EAPI Eina_Bool
edje_edit_script_set(Evas_Object *obj, const char *code)
{
- GET_EED_OR_RETURN();
+ GET_EED_OR_RETURN(EINA_FALSE);
free(eed->embryo_source);
free(eed->embryo_processed);
eed->embryo_source_dirty = EINA_TRUE;
_edje_edit_flag_script_dirty(eed, EINA_FALSE);
+ return EINA_TRUE;
}
EAPI char *
if (epr->action != EDJE_ACTION_TYPE_SCRIPT)
return NULL;
- ps = eina_hash_find(eed->program_scripts, prog);
+ ps = eina_hash_find(eed->program_scripts, &epr->id);
if (!ps) /* mmm? it should be there, even if empty */
return NULL;
return ps->code ? strdup(ps->code) : NULL;
}
-EAPI void
+EAPI Eina_Bool
edje_edit_script_program_set(Evas_Object *obj, const char *prog, const char *code)
{
Program_Script *ps;
- GET_EED_OR_RETURN();
- GET_EPR_OR_RETURN();
+ GET_EED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
if (epr->action != EDJE_ACTION_TYPE_SCRIPT)
- return;
+ return EINA_FALSE;
- ps = eina_hash_find(eed->program_scripts, prog);
+ ps = eina_hash_find(eed->program_scripts, &epr->id);
if (!ps) /* ???? how so? */
- return;
+ return EINA_FALSE;
free(ps->code);
free(ps->processed);
ps->dirty = EINA_TRUE;
_edje_edit_flag_script_dirty(eed, EINA_FALSE);
+ return EINA_TRUE;
}
static int