summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-10-31 18:27:32 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-10-31 18:27:32 +0000
commit904d80e0aef57196cd217598a29e999d5f6309fe (patch)
tree50225067fa095b435d46861a10428092e7dfb9ca
parentcf0df4872deed8af3e031cc8a6000f560c4c10e6 (diff)
elm - palette - add api to check if palette has a system version
-rw-r--r--src/lib/elementary/elm_config.c11
-rw-r--r--src/lib/elementary/elm_config.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 9b570822d8..cb9cd3ffd4 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -1036,6 +1036,17 @@ elm_config_palette_delete(const char *palette)
1036 ecore_file_unlink(buf); 1036 ecore_file_unlink(buf);
1037} 1037}
1038 1038
1039EAPI Eina_Bool
1040elm_config_palette_system_has(const char *palette)
1041{
1042 char buf[PATH_MAX];
1043
1044 if (!palette) return EINA_TRUE;
1045 if (strchr(palette, '/')) return EINA_FALSE;
1046 _elm_data_dir_snprintf(buf, sizeof(buf), "colors/%s.pal", palette);
1047 return ecore_file_exists(buf);
1048}
1049
1039EAPI Eina_List * 1050EAPI Eina_List *
1040elm_config_palette_list(void) 1051elm_config_palette_list(void)
1041{ 1052{
diff --git a/src/lib/elementary/elm_config.h b/src/lib/elementary/elm_config.h
index a437c31e4a..6f61aa0ad8 100644
--- a/src/lib/elementary/elm_config.h
+++ b/src/lib/elementary/elm_config.h
@@ -1138,6 +1138,7 @@ EAPI void elm_config_palette_color_unset(Elm_Palette *pal, const char *n
1138EAPI void elm_config_palette_save(Elm_Palette *pal, const char *palette); 1138EAPI void elm_config_palette_save(Elm_Palette *pal, const char *palette);
1139EAPI void elm_config_palette_free(Elm_Palette *pal); 1139EAPI void elm_config_palette_free(Elm_Palette *pal);
1140EAPI void elm_config_palette_delete(const char *palette); 1140EAPI void elm_config_palette_delete(const char *palette);
1141EAPI Eina_Bool elm_config_palette_system_has(const char *palette);
1141EAPI Eina_List *elm_config_palette_list(void); 1142EAPI Eina_List *elm_config_palette_list(void);
1142EAPI void elm_config_palette_list_free(Eina_List *list); 1143EAPI void elm_config_palette_list_free(Eina_List *list);
1143/** end new palette code **/ 1144/** end new palette code **/