17#ifdef FREECIV_HAVE_DIRENT_H
47 char buf[strlen(
directory) + strlen(theme_name) + 32];
51 gtk_style_context_add_provider_for_display(
54 GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
84 gtk_style_context_remove_provider_for_display(
111 char buf[strlen(dir_name) + strlen(
"/themes/gtk4") + 1];
113 fc_snprintf(buf,
sizeof(buf),
"%s/themes/gtk4", dir_name);
120 standard_dir =
"../share/themes";
122 standard_dir =
"/usr/share/themes";
129 char buf[strlen(home_dir) + 16];
131 fc_snprintf(buf,
sizeof(buf),
"%s/.themes/", home_dir);
147 struct dirent *
entry;
148 char **theme_names =
fc_malloc(
sizeof(
char *) * 2);
161 while ((
entry = readdir(dir))) {
163 struct stat stat_result;
168 if (
fc_stat(buf, &stat_result) != 0) {
173 if (!S_ISREG(stat_result.st_mode)) {
181 if (*count == t_size) {
182 theme_names =
fc_realloc(theme_names, t_size * 2 *
sizeof(
char *));
DIR * fc_opendir(const char *dir_to_open)
#define GUI_GTK_DEFAULT_THEME_NAME
#define GUI_GTK_OPTION(optname)
char ** get_gui_specific_themes_directories(int *count)
void gui_clear_theme(void)
void gui_load_theme(const char *directory, const char *theme_name)
static GtkCssProvider * theme_provider
#define fc_realloc(ptr, sz)
char * user_home_dir(void)
const struct strvec * get_data_dirs(void)
size_t strvec_size(const struct strvec *psv)
#define strvec_iterate(psv, str)
#define strvec_iterate_end
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_stat(const char *filename, struct stat *buf)
#define sz_strlcpy(dest, src)
struct theme_directory * directories
get_usable_themes_in_directory