1 /* this file is part of evince, a gnome document viewer
3 * Copyright © 2009 Christian Persch
5 * Evince is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; either version 2.1 of the License, or
8 * (at your option) any later version.
10 * Evince is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
13 * General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
23 #include <glib/gi18n-lib.h>
26 #include "ev-backends-manager.h"
28 #include "ev-file-helpers.h"
30 static int ev_init_count;
35 * Initializes the evince document library, and binds the evince
38 * You must call this before calling any other function in the evince
41 * Returns: %TRUE if any backends were found; %FALSE otherwise
46 static gboolean have_backends;
48 if (ev_init_count++ > 0)
51 /* set up translation catalog */
52 bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
53 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
56 _ev_file_helpers_init ();
57 have_backends = _ev_backends_manager_init ();
65 * Shuts the evince document library down.
70 g_assert (_ev_is_initialized ());
72 if (--ev_init_count > 0)
75 _ev_backends_manager_shutdown ();
76 _ev_file_helpers_shutdown ();
77 _ev_debug_shutdown ();
83 * Returns: %TRUE if the evince document library has been initialized
86 _ev_is_initialized (void)
88 return ev_init_count > 0;