17#ifdef FREECIV_HAVE_DIRENT_H
48 char buf[strlen(
directory) + strlen(theme_name) + 32];
52 gtk_style_context_add_provider_for_screen(
55 GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
65 g_warning(
"%s\n", error->message);
89 gtk_style_context_remove_provider_for_screen(
116 char buf[strlen(dir_name) + strlen(
"/themes/gtk3.22") + 1];
118 fc_snprintf(buf,
sizeof(buf),
"%s/themes/gtk3.22", dir_name);
125 standard_dir =
"../share/themes";
127 standard_dir =
"/usr/share/themes";
134 char buf[strlen(home_dir) + 16];
136 fc_snprintf(buf,
sizeof(buf),
"%s/.themes/", home_dir);
152 struct dirent *
entry;
153 char **theme_names =
fc_malloc(
sizeof(
char *) * 2);
166 while ((
entry = readdir(dir))) {
168 struct stat stat_result;
173 if (
fc_stat(buf, &stat_result) != 0) {
178 if (!S_ISREG(stat_result.st_mode)) {
186 if (*count == t_size) {
187 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