addition of argbint convenience on argb - thanks Morten

SVN revision: 20141
This commit is contained in:
handyande 2006-01-31 11:05:47 +00:00 committed by handyande
parent 852c800117
commit 108fbe6a7f
3 changed files with 53 additions and 0 deletions

View File

@ -141,6 +141,7 @@ extern "C"
EAPI long ecore_config_int_get(const char *key);
EAPI int ecore_config_argb_get(const char *key, int *a, int *r,
int *g, int *b);
EAPI long ecore_config_argbint_get(const char *key);
EAPI char *ecore_config_argbstr_get(const char *key);
EAPI float ecore_config_float_get(const char *key);
EAPI char *ecore_config_theme_get(const char *key);
@ -158,6 +159,7 @@ extern "C"
EAPI int ecore_config_string_set(const char *key, char *val);
EAPI int ecore_config_int_set(const char *key, int val);
EAPI int ecore_config_argb_set(const char *key, int a, int r, int g, int b);
EAPI int ecore_config_argbint_set(const char *key, long argb);
EAPI int ecore_config_argbstr_set(const char *key, char *val);
EAPI int ecore_config_float_set(const char *key, float val);
EAPI int ecore_config_theme_set(const char *key, char *val);
@ -179,6 +181,7 @@ extern "C"
float val, float lo,
float hi, float step);
EAPI int ecore_config_argb_default(const char *key, int a, int r, int g, int b);
EAPI int ecore_config_argbint_default(const char *key, long argb);
EAPI int ecore_config_argbstr_default(const char *key, char *val);
EAPI int ecore_config_theme_default(const char *key, char *val);

View File

@ -249,6 +249,28 @@ _ecore_config_argb_get(Ecore_Config_Prop *e, int *a, int *r, int *g, int *b)
return ECORE_CONFIG_ERR_FAIL;
}
/**
* Returns a color property as a long
* @param key The property key.
* @return ARGB data as long
* @ingroup Ecore_Config_Get_Group
*/
EAPI long
ecore_config_argbint_get(const char *key)
{
return _ecore_config_argbint_get( ecore_config_get(key) );
}
EAPI long
_ecore_config_argbint_get(Ecore_Config_Prop *e)
{
if (e && ((e->type == ECORE_CONFIG_RGB)))
{
return e->val;
}
return 0L;
}
/**
* Returns a color property as a string of hexadecimal characters.
* @param key The property key.
@ -765,6 +787,19 @@ ecore_config_argb_set(const char *key, int a, int r, int g, int b)
return ecore_config_typed_set(key, __ecore_argb_to_long(a,r,g,b, &v), ECORE_CONFIG_RGB);
}
/**
* Sets the indicated property to a color value.
* @param key The property key
* @param argb ARGB data as long
* @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully.
* @ingroup Ecore_Config_Set_Group
*/
EAPI int
ecore_config_argbint_set(const char *key, long argb)
{
return ecore_config_typed_set(key, (void *)&argb, ECORE_CONFIG_RGB);
}
/**
* Sets the indicated property to a color value.
* @param key The property key
@ -1041,6 +1076,20 @@ ecore_config_argb_default(const char *key, int a, int r, int g, int b)
return ecore_config_typed_default(key, __ecore_argb_to_long(a,r,g,b, &v), ECORE_CONFIG_RGB);
}
/**
* Sets the indicated property to a color value if the property has not yet
* been set.
* @param key The property key.
* @param argb ARGB data as long
* @return @c ECORE_CONFIG_ERR_SUCC if there are no problems.
* @ingroup Ecore_Config_Default_Group
*/
EAPI int
ecore_config_argbint_default(const char *key, long argb)
{
return ecore_config_typed_default(key, (void *)&argb, ECORE_CONFIG_RGB);
}
/**
* Sets the indicated property to a color value if the property has not yet
* been set.

View File

@ -31,6 +31,7 @@ long _ecore_config_int_get(Ecore_Config_Prop *e);
int _ecore_config_argb_get(Ecore_Config_Prop *e, int *a, int *r,
int *g, int *b);
char *_ecore_config_argbstr_get(Ecore_Config_Prop *e);
long _ecore_config_argbint_get(Ecore_Config_Prop *e);
float _ecore_config_float_get(Ecore_Config_Prop *e);
char *_ecore_config_theme_get(Ecore_Config_Prop *e);