2 Copyright (C) 2009-2010 ProFUSION embedded systems
3 Copyright (C) 2009-2011 Samsung Electronics
4 Copyright (C) 2012 Intel Corporation
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
25 #include "ewk_private.h"
27 #include <Ecore_Evas.h>
28 #include <Ecore_IMF.h>
32 #include <glib-object.h>
34 #if ENABLE(TIZEN_CACHE_DUMP_SYNC)
35 #include "ewk_context_private.h"
42 static int _ewkInitCount = 0;
46 * @brief the log domain identifier that is used with EINA's macros
48 int _ewk_log_dom = -1;
56 return ++_ewkInitCount;
61 _ewk_log_dom = eina_log_domain_register("ewebkit2", EINA_COLOR_ORANGE);
62 if (_ewk_log_dom < 0) {
63 EINA_LOG_CRIT("could not register log domain 'ewebkit2'");
64 goto error_log_domain;
68 CRITICAL("could not init evas.");
73 CRITICAL("could not init ecore.");
77 if (!ecore_evas_init()) {
78 CRITICAL("could not init ecore_evas.");
79 goto error_ecore_evas;
82 if (!ecore_imf_init()) {
83 CRITICAL("could not init ecore_imf.");
88 if (!ecore_x_init(0)) {
89 CRITICAL("could not init ecore_x.");
96 if (!ecore_main_loop_glib_integrate()) {
97 WARN("Ecore was not compiled with GLib support, some plugins will not "
98 "work (ie: Adobe Flash)");
101 return ++_ewkInitCount;
105 ecore_imf_shutdown();
108 ecore_evas_shutdown();
114 eina_log_domain_unregister(_ewk_log_dom);
122 int ewk_shutdown(void)
125 return _ewkInitCount;
127 #if ENABLE(TIZEN_CACHE_DUMP_SYNC)
128 // FIXME : ewk_context_cache_dump() is called on deconstructor of Ewk_Context.
129 // But, I helplessly adds it here because the deconstructor is not called for default ewk context.
130 ewk_context_default_get()->dumpCache();
136 ecore_imf_shutdown();
137 ecore_evas_shutdown();
140 eina_log_domain_unregister(_ewk_log_dom);
147 void ewk_set_arguments(int argc, char** argv)