From 1b5bab9c1820e0d6574ea0c579c27dcbd473fe12 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 18 Aug 2011 11:48:18 +0900 Subject: [PATCH] Add eek_init(). --- eek/Makefile.am | 1 + eek/eek.c | 14 ++++++++++++++ eek/eek.h | 2 ++ src/client-main.c | 7 +------ src/server-main.c | 9 ++------- 5 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 eek/eek.c diff --git a/eek/Makefile.am b/eek/Makefile.am index 6ab5e4bf..236a2643 100644 --- a/eek/Makefile.am +++ b/eek/Makefile.am @@ -54,6 +54,7 @@ libeek_private_headers = \ $(srcdir)/eek-theme-node.h libeek_sources = \ + $(srcdir)/eek.c \ $(srcdir)/eek-layout.c \ $(srcdir)/eek-element.c \ $(srcdir)/eek-container.c \ diff --git a/eek/eek.c b/eek/eek.c new file mode 100644 index 00000000..b4211fcd --- /dev/null +++ b/eek/eek.c @@ -0,0 +1,14 @@ +#include "eek.h" + +void +eek_init (void) +{ + g_type_init (); + + /* preload Eek* types for EekKeyboard deserialization */ + g_type_class_ref (EEK_TYPE_KEYBOARD); + g_type_class_ref (EEK_TYPE_SECTION); + g_type_class_ref (EEK_TYPE_KEY); + g_type_class_ref (EEK_TYPE_SYMBOL); + g_type_class_ref (EEK_TYPE_KEYSYM); +} diff --git a/eek/eek.h b/eek/eek.h index e7c5dec4..0fd8ca7f 100644 --- a/eek/eek.h +++ b/eek/eek.h @@ -32,4 +32,6 @@ #include "eek-serializable.h" #include "eek-theme.h" +void eek_init (void); + #endif /* EEK_H */ diff --git a/src/client-main.c b/src/client-main.c index 31218b07..58e7f3f3 100644 --- a/src/client-main.c +++ b/src/client-main.c @@ -122,12 +122,7 @@ main (int argc, char **argv) exit (1); } - /* preload Eek* types for EekKeyboard deserialization */ - g_type_class_ref (EEK_TYPE_KEYBOARD); - g_type_class_ref (EEK_TYPE_SECTION); - g_type_class_ref (EEK_TYPE_KEY); - g_type_class_ref (EEK_TYPE_SYMBOL); - g_type_class_ref (EEK_TYPE_KEYSYM); + eek_init (); option_context = g_option_context_new ("eekboard-desktop-client"); g_option_context_add_main_entries (option_context, options, NULL); diff --git a/src/server-main.c b/src/server-main.c index e5d5db48..387c0589 100644 --- a/src/server-main.c +++ b/src/server-main.c @@ -91,14 +91,9 @@ main (int argc, char **argv) } #endif - g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL); + eek_init (); - /* preload Eek* types for EekKeyboard deserialization */ - g_type_class_ref (EEK_TYPE_KEYBOARD); - g_type_class_ref (EEK_TYPE_SECTION); - g_type_class_ref (EEK_TYPE_KEY); - g_type_class_ref (EEK_TYPE_SYMBOL); - g_type_class_ref (EEK_TYPE_KEYSYM); + g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL); if (opt_system) bus_type = G_BUS_TYPE_SYSTEM;