static void
create_cursors(struct display *display)
{
- int config_fd;
+ struct weston_config *config;
+ struct weston_config_section *s;
+ int config_fd, size;
char *theme = NULL;
- unsigned int size = 32;
unsigned int i, j;
struct wl_cursor *cursor;
- struct config_key shell_keys[] = {
- { "cursor-theme", CONFIG_KEY_STRING, &theme },
- { "cursor-size", CONFIG_KEY_UNSIGNED_INTEGER, &size },
- };
- struct config_section cs[] = {
- { "shell", shell_keys, ARRAY_LENGTH(shell_keys), NULL },
- };
config_fd = open_config_file("weston.ini");
- parse_config_file(config_fd, cs, ARRAY_LENGTH(cs), NULL);
+ config = weston_config_parse(config_fd);
close(config_fd);
+ s = weston_config_get_section(config, "shell", NULL, NULL);
+ weston_config_section_get_string(s, "cursor-theme", &theme, NULL);
+ weston_config_section_get_int(s, "cursor-size", &size, 32);
+ weston_config_destroy(config);
+
display->cursor_theme = wl_cursor_theme_load(theme, size, display->shm);
display->cursors =
xmalloc(ARRAY_LENGTH(cursors) * sizeof display->cursors[0]);