Upgrade to 2.60.1
[platform/upstream/glib-networking.git] / proxy / gnome / gnome-proxy-module.c
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * GIO - GLib Input, Output and Streaming Library
4  *
5  * Copyright 2010 Red Hat, Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General
18  * Public License along with this library; if not, see
19  * <http://www.gnu.org/licenses/>.
20  */
21
22 #include "config.h"
23
24 #include <glib/gi18n-lib.h>
25
26 #include "gproxyresolvergnome.h"
27
28
29 G_MODULE_EXPORT void
30 g_io_gnomeproxy_load (GIOModule *module)
31 {
32   gchar *locale_dir;
33 #ifdef G_OS_WIN32
34   gchar *base_dir;
35 #endif
36
37   g_proxy_resolver_gnome_register (module);
38
39 #ifdef G_OS_WIN32
40   base_dir = g_win32_get_package_installation_directory_of_module (NULL);
41   locale_dir = g_build_filename (base_dir, "share", "locale", NULL);
42   g_free (base_dir);
43 #else
44   locale_dir = g_strdup (LOCALE_DIR);
45 #endif
46
47   bindtextdomain (GETTEXT_PACKAGE, locale_dir);
48   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
49   g_free (locale_dir);
50 }
51
52 G_MODULE_EXPORT void
53 g_io_gnomeproxy_unload (GIOModule *module)
54 {
55 }
56
57 G_MODULE_EXPORT gchar **
58 g_io_gnomeproxy_query (void)
59 {
60   gchar *eps[] = {
61     G_PROXY_RESOLVER_EXTENSION_POINT_NAME,
62     NULL
63   };
64   return g_strdupv (eps);
65 }