From: <enl...@li...> - 2006-01-31 11:06:06
|
Enlightenment CVS committal Author : handyande Project : e17 Module : libs/ecore Dir : e17/libs/ecore/src/lib/ecore_config Modified Files: Ecore_Config.h ecore_config.c ecore_config_private.h Log Message: addition of argbint convenience on argb - thanks Morten =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/Ecore_Config.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -3 -r1.48 -r1.49 --- Ecore_Config.h 8 Jan 2006 14:57:14 -0000 1.48 +++ Ecore_Config.h 31 Jan 2006 11:05:47 -0000 1.49 @@ -141,6 +141,7 @@ 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 @@ 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 @@ 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); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -3 -r1.73 -r1.74 --- ecore_config.c 18 Jan 2006 12:36:51 -0000 1.73 +++ ecore_config.c 31 Jan 2006 11:05:47 -0000 1.74 @@ -250,6 +250,28 @@ } /** + * 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. * @return A string of hexadecimal characters in the format #aarrggbb. @@ -768,6 +790,19 @@ /** * 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 * @param val Color value in ARGB format. * @return @c ECORE_CONFIG_ERR_SUCC if the property is set successfully. * @ingroup Ecore_Config_Set_Group @@ -1045,6 +1080,20 @@ * 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. + * @param key The property key. * @param val Color value in ARGB format. * @return @c ECORE_CONFIG_ERR_SUCC if there are no problems. * @ingroup Ecore_Config_Default_Group =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_private.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- ecore_config_private.h 6 Jan 2006 18:26:36 -0000 1.10 +++ ecore_config_private.h 31 Jan 2006 11:05:47 -0000 1.11 @@ -31,6 +31,7 @@ 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); |