summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-12-16 11:33:43 -0500
committerMatthias Clasen <mclasen@redhat.com>2010-12-21 12:07:02 -0500
commitfdabc9585d4d8616926c4acf09f114f8e00c383b (patch)
tree951827ba8bcaf82b8fd88cf4728d734aa924525f /gdk
parent2211e52ec5facb192cd07d06bf8175ed1ba26c2d (diff)
downloadgtk+-fdabc9585d4d8616926c4acf09f114f8e00c383b.tar.gz
Drop g[dt]k_set_locale
These functions were essentially just calling setlocale anyway. The X11 version was also setting a gdk_use_mb variable that is not used anywhere.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/Makefile.am1
-rw-r--r--gdk/gdk.symbols1
-rw-r--r--gdk/gdkmain.h24
-rw-r--r--gdk/x11/Makefile.am1
-rw-r--r--gdk/x11/gdkdisplay-x11.c6
-rw-r--r--gdk/x11/gdkdnd-x11.c5
-rw-r--r--gdk/x11/gdkim-x11.c103
-rw-r--r--gdk/x11/gdkmain-x11.c2
-rw-r--r--gdk/x11/gdkprivate-x11.h5
9 files changed, 6 insertions, 142 deletions
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 12b6fd6340..b07af094cb 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -201,7 +201,6 @@ x11_introspection_files = \
x11/gdkeventsource.c \
x11/gdkeventtranslator.c \
x11/gdkgeometry-x11.c \
- x11/gdkim-x11.c \
x11/gdkkeys-x11.c \
x11/gdkmain-x11.c \
x11/gdkproperty-x11.c \
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index fb0ed55e28..15f28c24cd 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -317,7 +317,6 @@ gdk_selection_property_get
gdk_selection_send_notify
gdk_selection_send_notify_for_display
gdk_set_double_click_time
-gdk_set_locale
gdk_set_pointer_hooks
gdk_set_program_class
gdk_set_show_events
diff --git a/gdk/gdkmain.h b/gdk/gdkmain.h
index b9915a3bcf..28b587791c 100644
--- a/gdk/gdkmain.h
+++ b/gdk/gdkmain.h
@@ -50,29 +50,7 @@ gboolean gdk_init_check (gint *argc,
void gdk_add_option_entries_libgtk_only (GOptionGroup *group);
void gdk_pre_parse_libgtk_only (void);
-/**
- * gdk_set_locale:
- *
- * Initializes the support for internationalization by calling the <function>setlocale()</function>
- * system call. This function is called by gtk_set_locale() and so GTK+
- * applications should use that instead.
- *
- * The locale to use is determined by the <envar>LANG</envar> environment variable,
- * so to run an application in a certain locale you can do something like this:
- * <informalexample>
- * <programlisting>
- * export LANG="fr"
- * ... run application ...
- * </programlisting>
- * </informalexample>
- *
- * If the locale is not supported by X then it is reset to the standard "C"
- * locale.
- *
- * Returns: the resulting locale.
- */
-gchar* gdk_set_locale (void);
-void gdk_disable_multidevice (void);
+void gdk_enable_multidevice (void);
G_CONST_RETURN gchar *gdk_get_program_class (void);
void gdk_set_program_class (const gchar *program_class);
diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
index 72487ae518..4422b2b7d3 100644
--- a/gdk/x11/Makefile.am
+++ b/gdk/x11/Makefile.am
@@ -36,7 +36,6 @@ libgdk_x11_la_SOURCES = \
gdkeventtranslator.c \
gdkeventtranslator.h \
gdkgeometry-x11.c \
- gdkim-x11.c \
gdkkeys-x11.c \
gdkmain-x11.c \
gdkproperty-x11.c \
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index f24614a516..7bcb5dec74 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1117,7 +1117,7 @@ gdk_event_init (GdkDisplay *display)
}
static void
-gdk_input_init (GdkDisplay *display)
+gdk_x11_display_init_input (GdkDisplay *display)
{
GdkDisplayX11 *display_x11;
GdkDeviceManager *device_manager;
@@ -1446,8 +1446,8 @@ _gdk_x11_display_open (const gchar *display_name)
}
#endif
- gdk_input_init (display);
- _gdk_x11_dnd_init (display);
+ gdk_x11_display_init_input (display);
+ _gdk_x11_display_init_dnd (display);
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)
_gdk_x11_screen_setup (display_x11->screens[i]);
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index 4be4e9c0b9..eff8bd39db 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -3072,11 +3072,8 @@ xdnd_drop_filter (GdkXEvent *xev,
return GDK_FILTER_REMOVE;
}
-/*************************************************************
- ************************** Public API ***********************
- *************************************************************/
void
-_gdk_x11_dnd_init (GdkDisplay *display)
+_gdk_x11_display_init_dnd (GdkDisplay *display)
{
int i;
init_byte_order ();
diff --git a/gdk/x11/gdkim-x11.c b/gdk/x11/gdkim-x11.c
deleted file mode 100644
index 4d43ea1144..0000000000
--- a/gdk/x11/gdkim-x11.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#include "config.h"
-
-#include "gdkmain.h"
-#include "gdkinternals.h"
-#include "gdkdisplay-x11.h"
-#include "gdkprivate-x11.h"
-
-#include <locale.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-/* If this variable is FALSE, it indicates that we should
- * avoid trying to use multibyte conversion functions and
- * assume everything is 1-byte per character
- */
-static gboolean gdk_use_mb;
-
-void
-_gdk_x11_initialize_locale (void)
-{
- wchar_t result;
- gchar *current_locale;
- static char *last_locale = NULL;
-
- gdk_use_mb = FALSE;
-
- current_locale = setlocale (LC_ALL, NULL);
-
- if (last_locale && strcmp (last_locale, current_locale) == 0)
- return;
-
- g_free (last_locale);
- last_locale = g_strdup (current_locale);
-
- if (XSupportsLocale ())
- XSetLocaleModifiers ("");
-
- if ((strcmp (current_locale, "C")) && (strcmp (current_locale, "POSIX")))
- {
- gdk_use_mb = TRUE;
-
-#ifndef X_LOCALE
- /* Detect ancient GNU libc, where mb == UTF8. Not useful unless it's
- * really a UTF8 locale. The below still probably will
- * screw up on Greek, Cyrillic, etc, encoded as UTF8.
- */
-
- if ((MB_CUR_MAX == 2) &&
- (mbstowcs (&result, "\xdd\xa5", 1) > 0) &&
- result == 0x765)
- {
- if ((strlen (current_locale) < 4) ||
- g_ascii_strcasecmp (current_locale + strlen(current_locale) - 4,
- "utf8"))
- gdk_use_mb = FALSE;
- }
-#endif /* X_LOCALE */
- }
-
- GDK_NOTE (XIM,
- g_message ("%s multi-byte string functions.",
- gdk_use_mb ? "Using" : "Not using"));
-
- return;
-}
-
-gchar*
-gdk_set_locale (void)
-{
- if (!setlocale (LC_ALL,""))
- g_warning ("locale not supported by C library");
-
- _gdk_x11_initialize_locale ();
-
- return setlocale (LC_ALL, NULL);
-}
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index f629da16d5..13434db792 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -80,8 +80,6 @@ static int gdk_x_io_error (Display *display);
void
_gdk_x11_windowing_init (void)
{
- _gdk_x11_initialize_locale ();
-
XSetErrorHandler (gdk_x_error);
XSetIOErrorHandler (gdk_x_io_error);
}
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index 67e23a1e86..4dc341c346 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -149,7 +149,6 @@ void _gdk_x11_keymap_add_virt_mods (GdkKeymap *keymap,
gboolean _gdk_x11_keymap_key_is_modifier (GdkKeymap *keymap,
guint keycode);
-void _gdk_x11_initialize_locale (void);
void _gdk_x11_windowing_init (void);
void _gdk_x11_window_grab_check_unmap (GdkWindow *window,
@@ -214,9 +213,7 @@ void _gdk_x11_precache_atoms (GdkDisplay *display,
const gchar * const *atom_names,
gint n_atoms);
-void _gdk_events_init (GdkDisplay *display);
-void _gdk_events_uninit (GdkDisplay *display);
-void _gdk_x11_dnd_init (GdkDisplay *display);
+void _gdk_x11_display_init_dnd (GdkDisplay *display);
void _gdk_x11_screen_init_root_window (GdkScreen *screen);
void _gdk_x11_screen_init_visuals (GdkScreen *screen);