From 8c079ae052cf49c7cdc7874909f8eb6bdd87627c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Sat, 21 Sep 2013 22:26:10 -0700 Subject: [PATCH] window.c: Port to use weston_config instead of old parser --- clients/window.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/clients/window.c b/clients/window.c index 6854745..8d4ee3a 100644 --- a/clients/window.c +++ b/clients/window.c @@ -1307,23 +1307,22 @@ static const struct cursor_alternatives cursors[] = { 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]); -- 2.7.4