diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-01-01 18:27:09 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2012-01-01 18:27:09 +0100 |
commit | c203b3a83d1cb2c8936d8b2e310b47ef207a84ac (patch) | |
tree | e38476f251e800123d2af833a78fc89a5c636637 /tests | |
parent | 4c236e110b29cf1ede23eb618d500d547dd04dc8 (diff) |
font: move font handling into new subsystem
We use a new font factory which is used to create a new font. It will later also
be used to cache fonts and select proper system fonts.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_console.c | 9 | ||||
-rw-r--r-- | tests/test_terminal.c | 8 |
2 files changed, 15 insertions, 2 deletions
diff --git a/tests/test_console.c b/tests/test_console.c index b8a1c31..810e5c7 100644 --- a/tests/test_console.c +++ b/tests/test_console.c @@ -55,6 +55,7 @@ #include <GL/glext.h> #include "console.h" #include "eloop.h" +#include "font.h" #include "log.h" #include "output.h" #include "unicode.h" @@ -68,6 +69,7 @@ struct console { struct kmscon_signal *sig_int; struct kmscon_fd *stdin_fd; struct kmscon_symbol_table *st; + struct kmscon_font_factory *ff; struct kmscon_compositor *comp; struct kmscon_vt *vt; struct kmscon_console *con; @@ -239,6 +241,7 @@ static void destroy_eloop(struct console *con) kmscon_console_unref(con->con); kmscon_compositor_unref(con->comp); kmscon_vt_unref(con->vt); + kmscon_font_factory_unref(con->ff); kmscon_symbol_table_unref(con->st); kmscon_eloop_rm_fd(con->stdin_fd); kmscon_eloop_rm_signal(con->sig_int); @@ -273,6 +276,10 @@ static int setup_eloop(struct console *con) if (ret) goto err_loop; + ret = kmscon_font_factory_new(&con->ff, con->st); + if (ret) + goto err_loop; + ret = kmscon_compositor_new(&con->comp); if (ret) goto err_loop; @@ -289,7 +296,7 @@ static int setup_eloop(struct console *con) if (ret) goto err_loop; - ret = kmscon_console_new(&con->con, con->st); + ret = kmscon_console_new(&con->con, con->ff); if (ret) goto err_loop; diff --git a/tests/test_terminal.c b/tests/test_terminal.c index c4e8859..48d30ba 100644 --- a/tests/test_terminal.c +++ b/tests/test_terminal.c @@ -49,6 +49,7 @@ struct app { struct kmscon_signal *sig_term; struct kmscon_signal *sig_int; struct kmscon_symbol_table *st; + struct kmscon_font_factory *ff; struct kmscon_compositor *comp; struct kmscon_input *input; struct kmscon_vt *vt; @@ -128,6 +129,7 @@ static void destroy_app(struct app *app) kmscon_vt_unref(app->vt); kmscon_input_unref(app->input); kmscon_compositor_unref(app->comp); + kmscon_font_factory_unref(app->ff); kmscon_symbol_table_unref(app->st); kmscon_eloop_rm_signal(app->sig_int); kmscon_eloop_rm_signal(app->sig_term); @@ -156,6 +158,10 @@ static int setup_app(struct app *app) if (ret) goto err_loop; + ret = kmscon_font_factory_new(&app->ff, app->st); + if (ret) + goto err_loop; + ret = kmscon_compositor_new(&app->comp); if (ret) goto err_loop; @@ -176,7 +182,7 @@ static int setup_app(struct app *app) if (ret) goto err_loop; - ret = kmscon_terminal_new(&app->term, app->st); + ret = kmscon_terminal_new(&app->term, app->ff); if (ret) goto err_loop; |