forked from enlightenment/efl
* remove spectra_id functions in favor of standard 'get/set-by-name' functions
SVN revision: 35096
This commit is contained in:
parent
464c92eece
commit
092f491d09
|
@ -1327,23 +1327,14 @@ edje_edit_state_gradient_use_fill_get(
|
|||
const char *state ///< The name of the 'part state' (ex. "default 0.00")
|
||||
);
|
||||
|
||||
/**Get the spectra id used by part state.*/
|
||||
EAPI int ///@return The spectra id
|
||||
edje_edit_state_gradient_spectra_id_get(
|
||||
/**Get the spectra used by part state. Remember to free the string with edje_edit_string_free()*/
|
||||
EAPI const char * ///@return The spectra name used in state
|
||||
edje_edit_state_gradient_spectra_get(
|
||||
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")
|
||||
);
|
||||
|
||||
//~ /**Set the spectra id used by part state.*/
|
||||
//~ EAPI unsigned char ///@return 1 on success, 0 otherwise
|
||||
//~ edje_edit_state_gradient_spectra_id_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")
|
||||
//~ int spectra_i
|
||||
//~ );
|
||||
|
||||
/**Set the spectra used by part state.*/
|
||||
EAPI unsigned char ///@return 1 on success, 0 otherwise
|
||||
edje_edit_state_gradient_spectra_set(
|
||||
|
|
|
@ -561,6 +561,8 @@ _edje_edit_spectrum_entry_get(Edje *ed, const char* spectra)
|
|||
|
||||
for (l = ed->file->spectrum_dir->entries; l; l = l->next)
|
||||
{
|
||||
Edje_Spectrum_Directory_Entry *s;
|
||||
|
||||
s = l->data;
|
||||
if (!strcmp(s->entry, spectra))
|
||||
return s;
|
||||
|
@ -568,6 +570,27 @@ _edje_edit_spectrum_entry_get(Edje *ed, const char* spectra)
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Edje_Spectrum_Directory_Entry *
|
||||
_edje_edit_spectrum_entry_get_by_id(Edje *ed, int spectra_id)
|
||||
{
|
||||
Evas_List *l;
|
||||
|
||||
if (!ed->file || !ed->file->spectrum_dir)
|
||||
return NULL;
|
||||
|
||||
for (l = ed->file->spectrum_dir->entries; l; l = l->next)
|
||||
{
|
||||
Edje_Spectrum_Directory_Entry *s;
|
||||
|
||||
s = l->data;
|
||||
if (s->id == spectra_id)
|
||||
return s;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*****************/
|
||||
/* GENERAL API */
|
||||
/*****************/
|
||||
|
@ -2811,7 +2834,7 @@ edje_edit_spectrum_list_get(Evas_Object *obj)
|
|||
for (l = ed->file->spectrum_dir->entries; l; l = l->next)
|
||||
{
|
||||
s = l->data;
|
||||
printf("SPECTRUM: %s\n", s->entry);
|
||||
printf("SPECTRUM: %s [id: %d]\n", s->entry, s->id);
|
||||
spectrums = evas_list_append(spectrums, evas_stringshare_add(s->entry));
|
||||
}
|
||||
|
||||
|
@ -3042,33 +3065,20 @@ edje_edit_state_gradient_use_fill_get(Evas_Object *obj, const char *part, const
|
|||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
edje_edit_state_gradient_spectra_id_get(Evas_Object *obj, const char *part, const char *state)
|
||||
EAPI const char *
|
||||
edje_edit_state_gradient_spectra_get(Evas_Object *obj, const char *part, const char *state)
|
||||
{
|
||||
GET_PD_OR_RETURN(-1);
|
||||
Edje_Spectrum_Directory_Entry *s;
|
||||
|
||||
//if (!pd->gradient.type)
|
||||
// return NULL;
|
||||
GET_PD_OR_RETURN(0);
|
||||
|
||||
printf("GET GRADIENT SPECTRA ID for part: %s state: %s [%d]\n", part, state, pd->gradient.id);
|
||||
//printf("GET GRADIENT SPECTRA for part: %s state: %s\n", part, state);
|
||||
s = _edje_edit_spectrum_entry_get_by_id(ed, pd->gradient.id);
|
||||
if (!s) return 0;
|
||||
|
||||
return pd->gradient.id;
|
||||
return evas_stringshare_add(s->entry);
|
||||
}
|
||||
|
||||
//~ EAPI unsigned char
|
||||
//~ edje_edit_state_gradient_spectra_id_set(Evas_Object *obj, const char *part, const char *state, int spectra_id)
|
||||
//~ {
|
||||
//~ GET_PD_OR_RETURN(0);
|
||||
|
||||
//~ printf("SET GRADIENT SPECTRA_ID for part: %s state: %s [%d]\n", part, state, spectra_id);
|
||||
|
||||
//~ pd->gradient.id = spectra_id;
|
||||
|
||||
//~ edje_object_calc_force(obj);
|
||||
|
||||
//~ return 1;
|
||||
//~ }
|
||||
|
||||
EAPI unsigned char
|
||||
edje_edit_state_gradient_spectra_set(Evas_Object *obj, const char *part, const char *state, const char* spectra)
|
||||
{
|
||||
|
@ -3082,7 +3092,6 @@ edje_edit_state_gradient_spectra_set(Evas_Object *obj, const char *part, const c
|
|||
if (!s) return 0;
|
||||
|
||||
pd->gradient.id = s->id;
|
||||
|
||||
edje_object_calc_force(obj);
|
||||
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue