Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/gui-gtk-4.0/themes.c File Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Functions | Variables
themes.c File Reference
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <unistd.h>`
`#include <gtk/gtk.h>`
`#include "fc_dirent.h"`
`#include "mem.h"`
`#include "string_vector.h"`
`#include "themes_common.h"`
`#include "gui_main.h"`
`#include "themes_g.h"`

Go to the source code of this file.

## Functions

void | gui_load_theme (const char *directory, const char *theme_name)
void | gui_clear_theme (void)
char ** | get_gui_specific_themes_directories (int *count)
char ** | get_usable_themes_in_directory (const char *directory, int *count)

## Variables

static GtkCssProvider * | theme_provider = NULL

## Function Documentation

## ◆ get_gui_specific_themes_directories()

char ** get_gui_specific_themes_directories | ( | int * | count | ) |

Each gui has its own themes directories. For gtk4 these are:

- /usr/share/themes
- ~/.themes Returns an array containing these strings and sets array size in count. The caller is responsible for freeing the array and the paths.

Definition at line 99 of file themes.c.

## ◆ get_usable_themes_in_directory()

char ** get_usable_themes_in_directory | ( | const char * | directory,
|  | int * | count
| ) |  |

Return an array of names of usable themes in the given directory. Array size is stored in count. Usable theme for gtk is a directory which contains file gtk-4.0/gtk.css. The caller is responsible for freeing the array and the names

Definition at line 144 of file themes.c.

## ◆ gui_clear_theme()

void gui_clear_theme | ( | void |  | ) |

Clears a theme (sets default system theme)

Definition at line 67 of file themes.c.

## ◆ gui_load_theme()

void gui_load_theme | ( | const char * | directory,
|  | const char * | theme_name
| ) |  |

Loads a gtk theme directory/theme_name

Definition at line 45 of file themes.c.

## Variable Documentation

## ◆ theme_provider

GtkCssProvider* theme_provider = NULL

static

Definition at line 40 of file themes.c.