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"
41 #include <Ecore_Wayland.h>
44 static int _ewkInitCount = 0;
48 * @brief the log domain identifier that is used with EINA's macros
50 int _ewk_log_dom = -1;
58 return ++_ewkInitCount;
63 _ewk_log_dom = eina_log_domain_register("ewebkit2", EINA_COLOR_ORANGE);
64 if (_ewk_log_dom < 0) {
65 EINA_LOG_CRIT("could not register log domain 'ewebkit2'");
66 goto error_log_domain;
70 CRITICAL("could not init evas.");
75 CRITICAL("could not init ecore.");
79 if (!ecore_evas_init()) {
80 CRITICAL("could not init ecore_evas.");
81 goto error_ecore_evas;
84 if (!ecore_imf_init()) {
85 CRITICAL("could not init ecore_imf.");
90 if (!ecore_x_init(0)) {
91 CRITICAL("could not init ecore_x.");
95 if(!ecore_wl_init(0)) {
96 CRITICAL("could not init ecore_wl.");
103 if (!ecore_main_loop_glib_integrate()) {
104 WARN("Ecore was not compiled with GLib support, some plugins will not "
105 "work (ie: Adobe Flash)");
108 return ++_ewkInitCount;
112 ecore_imf_shutdown();
115 ecore_imf_shutdown();
118 ecore_evas_shutdown();
124 eina_log_domain_unregister(_ewk_log_dom);
132 int ewk_shutdown(void)
135 return _ewkInitCount;
137 #if ENABLE(TIZEN_CACHE_DUMP_SYNC)
138 // FIXME : ewk_context_cache_dump() is called on deconstructor of Ewk_Context.
139 // But, I helplessly adds it here because the deconstructor is not called for default ewk context.
140 ewk_context_default_get()->dumpCache();
146 ecore_imf_shutdown();
147 ecore_evas_shutdown();
150 eina_log_domain_unregister(_ewk_log_dom);
157 void ewk_set_arguments(int argc, char** argv)