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")
|
const char *state ///< The name of the 'part state' (ex. "default 0.00")
|
||||||
);
|
);
|
||||||
|
|
||||||
/**Get the spectra id used by part state.*/
|
/**Get the spectra used by part state. Remember to free the string with edje_edit_string_free()*/
|
||||||
EAPI int ///@return The spectra id
|
EAPI const char * ///@return The spectra name used in state
|
||||||
edje_edit_state_gradient_spectra_id_get(
|
edje_edit_state_gradient_spectra_get(
|
||||||
Evas_Object *obj, ///< The edje object
|
Evas_Object *obj, ///< The edje object
|
||||||
const char *part, ///< The name of the part
|
const char *part, ///< The name of the part
|
||||||
const char *state ///< The name of the 'part state' (ex. "default 0.00")
|
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.*/
|
/**Set the spectra used by part state.*/
|
||||||
EAPI unsigned char ///@return 1 on success, 0 otherwise
|
EAPI unsigned char ///@return 1 on success, 0 otherwise
|
||||||
edje_edit_state_gradient_spectra_set(
|
edje_edit_state_gradient_spectra_set(
|
||||||
|
|
|
@ -555,19 +555,42 @@ _edje_edit_spectrum_entry_get(Edje *ed, const char* spectra)
|
||||||
{
|
{
|
||||||
Edje_Spectrum_Directory_Entry *s;
|
Edje_Spectrum_Directory_Entry *s;
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
|
|
||||||
if (!ed->file || !spectra || !ed->file->spectrum_dir)
|
if (!ed->file || !spectra || !ed->file->spectrum_dir)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (l = ed->file->spectrum_dir->entries; l; l = l->next)
|
for (l = ed->file->spectrum_dir->entries; l; l = l->next)
|
||||||
{
|
{
|
||||||
|
Edje_Spectrum_Directory_Entry *s;
|
||||||
|
|
||||||
s = l->data;
|
s = l->data;
|
||||||
if (!strcmp(s->entry, spectra))
|
if (!strcmp(s->entry, spectra))
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
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 */
|
/* 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)
|
for (l = ed->file->spectrum_dir->entries; l; l = l->next)
|
||||||
{
|
{
|
||||||
s = l->data;
|
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));
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI const char *
|
||||||
edje_edit_state_gradient_spectra_id_get(Evas_Object *obj, const char *part, const char *state)
|
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;
|
||||||
|
|
||||||
|
GET_PD_OR_RETURN(0);
|
||||||
|
|
||||||
//if (!pd->gradient.type)
|
//printf("GET GRADIENT SPECTRA for part: %s state: %s\n", part, state);
|
||||||
// return NULL;
|
s = _edje_edit_spectrum_entry_get_by_id(ed, pd->gradient.id);
|
||||||
|
if (!s) return 0;
|
||||||
printf("GET GRADIENT SPECTRA ID for part: %s state: %s [%d]\n", part, state, pd->gradient.id);
|
|
||||||
|
return evas_stringshare_add(s->entry);
|
||||||
return pd->gradient.id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//~ 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
|
EAPI unsigned char
|
||||||
edje_edit_state_gradient_spectra_set(Evas_Object *obj, const char *part, const char *state, const char* spectra)
|
edje_edit_state_gradient_spectra_set(Evas_Object *obj, const char *part, const char *state, const char* spectra)
|
||||||
{
|
{
|
||||||
|
@ -3080,9 +3090,8 @@ edje_edit_state_gradient_spectra_set(Evas_Object *obj, const char *part, const c
|
||||||
|
|
||||||
s = _edje_edit_spectrum_entry_get(ed, spectra);
|
s = _edje_edit_spectrum_entry_get(ed, spectra);
|
||||||
if (!s) return 0;
|
if (!s) return 0;
|
||||||
|
|
||||||
pd->gradient.id = s->id;
|
pd->gradient.id = s->id;
|
||||||
|
|
||||||
edje_object_calc_force(obj);
|
edje_object_calc_force(obj);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue