handle cases without default values and add missing functions.

SVN revision: 47640
This commit is contained in:
Gustavo Sverzut Barbieri 2010-04-01 03:48:07 +00:00
parent fdedaedea0
commit f10ffca9c4
2 changed files with 70 additions and 2 deletions

View File

@ -1535,6 +1535,16 @@ edje_edit_state_external_param_int_get( ///@return True if succesful, False if n
int *value
);
/**Get external parameter of type BOOL*/
EAPI Eina_Bool
edje_edit_state_external_param_bool_get( ///@return True if succesful, False if not found or is of different type
Evas_Object *obj, ///< The edje object
const char *part, ///< The name of the part
const char *state, ///< The name of the 'part state' (ex. "default 0.00")
const char *param, ///< The name of the parameter
Eina_Bool *value
);
/**Get external parameter of type DOUBLE*/
EAPI Eina_Bool
edje_edit_state_external_param_double_get( ///@return True if succesful, False if not found or is of different type
@ -1555,6 +1565,16 @@ edje_edit_state_external_param_string_get( ///@return True if succesful, False i
const char **value
);
/**Get external parameter of type CHOICE*/
EAPI Eina_Bool
edje_edit_state_external_param_choice_get( ///@return True if succesful, False if not found or is of different type
Evas_Object *obj, ///< The edje object
const char *part, ///< The name of the part
const char *state, ///< The name of the 'part state' (ex. "default 0.00")
const char *param, ///< The name of the parameter
const char **value
);
/**Set the external parameter type and value, adding it if it didn't exist before*/
EAPI Eina_Bool
edje_edit_state_external_param_set( ///@return True if it was set
@ -1576,6 +1596,16 @@ edje_edit_state_external_param_int_set( ///@return True if it was set
int value
);
/**Set external parameter of type BOOL*/
EAPI Eina_Bool
edje_edit_state_external_param_bool_set( ///@return True if it was set
Evas_Object *obj, ///< The edje object
const char *part, ///< The name of the part
const char *state, ///< The name of the 'part state' (ex. "default 0.00")
const char *param, ///< The name of the parameter
Eina_Bool value
);
/**Set external parameter of type DOUBLE*/
EAPI Eina_Bool
edje_edit_state_external_param_double_set( ///@return True if it was set
@ -1596,6 +1626,16 @@ edje_edit_state_external_param_string_set( ///@return True if it was set
const char *value
);
/**Set external parameter of type CHOICE*/
EAPI Eina_Bool
edje_edit_state_external_param_choice_set( ///@return True if it was set
Evas_Object *obj, ///< The edje object
const char *part, ///< The name of the part
const char *state, ///< The name of the 'part state' (ex. "default 0.00")
const char *param, ///< The name of the parameter
const char *value
);
//@}
/******************************************************************************/

View File

@ -2655,10 +2655,12 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name)
{
case EDJE_EXTERNAL_PARAM_TYPE_INT:
case EDJE_EXTERNAL_PARAM_TYPE_BOOL:
p->i = pi->info.i.def;
if (pi->info.i.def != EDJE_EXTERNAL_INT_UNSET)
p->i = pi->info.i.def;
break;
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
p->d = pi->info.d.def;
if (pi->info.d.def != EDJE_EXTERNAL_DOUBLE_UNSET)
p->d = pi->info.d.def;
break;
case EDJE_EXTERNAL_PARAM_TYPE_CHOICE:
if (pi->info.c.def)
@ -3659,6 +3661,26 @@ edje_edit_state_external_param_int_get(Evas_Object *obj, const char *part, const
return EINA_FALSE;
}
EAPI Eina_Bool
edje_edit_state_external_param_bool_get(Evas_Object *obj, const char *part, const char *state, const char *param, Eina_Bool *value)
{
Eina_List *l;
Edje_External_Param *p;
GET_PD_OR_RETURN(EINA_FALSE);
EINA_LIST_FOREACH(pd->external_params, l, p)
if (!strcmp(p->name, param))
{
if (p->type != EDJE_EXTERNAL_PARAM_TYPE_INT)
return EINA_FALSE;
if (value)
*value = p->i;
return EINA_TRUE;
}
return EINA_FALSE;
}
EAPI Eina_Bool
edje_edit_state_external_param_double_get(Evas_Object *obj, const char *part, const char *state, const char *param, double *value)
{
@ -3802,6 +3824,12 @@ edje_edit_state_external_param_int_set(Evas_Object *obj, const char *part, const
return edje_edit_state_external_param_set(obj, part, state, param, EDJE_EXTERNAL_PARAM_TYPE_INT, value);
}
EAPI Eina_Bool
edje_edit_state_external_param_bool_set(Evas_Object *obj, const char *part, const char *state, const char *param, Eina_Bool value)
{
return edje_edit_state_external_param_set(obj, part, state, param, EDJE_EXTERNAL_PARAM_TYPE_BOOL, (int)value);
}
EAPI Eina_Bool
edje_edit_state_external_param_double_set(Evas_Object *obj, const char *part, const char *state, const char *param, double value)
{