]> Pileus Git - ~andy/gtk/commitdiff
Drop g[dt]k_set_locale
authorMatthias Clasen <mclasen@redhat.com>
Thu, 16 Dec 2010 16:33:43 +0000 (11:33 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 21 Dec 2010 17:07:02 +0000 (12:07 -0500)
These functions were essentially just calling setlocale anyway.
The X11 version was also setting a gdk_use_mb variable that
is not used anywhere.

14 files changed:
docs/reference/gdk/gdk3-sections.txt
docs/reference/gtk/gtk3-sections.txt
gdk/Makefile.am
gdk/gdk.symbols
gdk/gdkmain.h
gdk/x11/Makefile.am
gdk/x11/gdkdisplay-x11.c
gdk/x11/gdkdnd-x11.c
gdk/x11/gdkim-x11.c [deleted file]
gdk/x11/gdkmain-x11.c
gdk/x11/gdkprivate-x11.h
gtk/gtk.symbols
gtk/gtkmain.c
gtk/gtkmain.h

index 0b45b1609a6408ccb5e077eb07f3ea3ca09c9383..90cf828c5f5600d0c9ff1b9231dbc13f2ef3cb3e 100644 (file)
@@ -8,8 +8,6 @@ gdk_init
 gdk_init_check
 gdk_parse_args
 gdk_get_display_arg_name
-gdk_set_locale
-gdk_set_sm_client_id
 gdk_notify_startup_complete
 gdk_notify_startup_complete_with_id
 
index 41dbae93eef93686826392582388494e8d3fc747..b9e6387f01036521ef15cc7a585a1c79d06e48df 100644 (file)
@@ -5282,7 +5282,6 @@ gtk_window_group_get_type
 <SECTION>
 <FILE>gtkmain</FILE>
 <TITLE>General</TITLE>
-gtk_set_locale
 gtk_disable_setlocale
 gtk_get_default_language
 gtk_parse_args
index 12b6fd6340d5257ebf8cae8a8b40b45713d3427a..b07af094cb292f6530a45e390a6729fc0ef52c0c 100644 (file)
@@ -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           \
index fb0ed55e28ce335a7a5a22039def917875f525c7..15f28c24cdc389ed73127ebe03a535440bd49e55 100644 (file)
@@ -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
index b9915a3bcfd3f1632be94d5f9bb5b4ea9075c4d6..28b587791c50131b95f772ff1ad3510b8d6ea590 100644 (file)
@@ -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);
index 72487ae51841c669c5f8af616a61d6787cc02a63..4422b2b7d3006ffe80541ec3fd2ec6753f08664f 100644 (file)
@@ -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       \
index f24614a5166c632335bc79695f40822e70554fc8..7bcb5dec74a8ad5e96e682079786572d46abaf81 100644 (file)
@@ -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]);
index 4be4e9c0b962983667c106865a4ff825ab97ef3c..eff8bd39db1ad8487caee9b2ecce9d399f2c828c 100644 (file)
@@ -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 (file)
index 4d43ea1..0000000
+++ /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);
-}
index f629da16d587185dc5913e09b75eab02ba45c1db..13434db79256347bd88fdf387b1388155d50283e 100644 (file)
@@ -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);
 }
index 67e23a1e860d1c2c41ac1b9c9bfee9eeb590c914..4dc341c346d108f502886370d9a7cbcb4460d206 100644 (file)
@@ -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);
index 3c768c41d3a3b274e9d06e06b455c7f1e5dc0b0f..ff655c745bcac249fa3a6b6459ce667afb098fc7 100644 (file)
@@ -2305,7 +2305,6 @@ gtk_separator_tool_item_get_type G_GNUC_CONST
 gtk_separator_tool_item_new
 gtk_separator_tool_item_set_draw
 gtk_set_debug_flags
-gtk_set_locale
 gtk_settings_get_default
 gtk_settings_get_for_screen
 gtk_settings_get_type G_GNUC_CONST
index dc272600fe2cc10c9e958f6d43c424b3eb341af1..afacd3fb6b3666044300a50a6f79fb5e40129f2e 100644 (file)
@@ -1169,37 +1169,6 @@ gtk_init_check_abi_check (int *argc, char ***argv, int num_checks, size_t sizeof
 
 #endif
 
-/**
- * gtk_set_locale:
- *
- * Initializes internationalization support for GTK+. gtk_init()
- * automatically does this, so there is typically no point
- * in calling this function.
- *
- * If you are calling this function because you changed the locale
- * after GTK+ is was initialized, then calling this function
- * may help a bit. (Note, however, that changing the locale
- * after GTK+ is initialized may produce inconsistent results and
- * is not really supported.)
- * 
- * In detail - sets the current locale according to the
- * program environment. This is the same as calling the C library function
- * <literal>setlocale (LC_ALL, "")</literal> but also takes care of the 
- * locale specific setup of the windowing system used by GDK.
- * 
- * Returns: a string corresponding to the locale set, typically in the
- * form lang_COUNTRY, where lang is an ISO-639 language code, and
- * COUNTRY is an ISO-3166 country code. On Unix, this form matches the
- * result of the setlocale(); it is also used on other machines, such as 
- * Windows, where the C library returns a different result. The string is 
- * owned by GTK+ and should not be modified or freed.
- **/
-gchar *
-gtk_set_locale (void)
-{
-  return gdk_set_locale ();
-}
-
 /**
  * _gtk_get_lc_ctype:
  *
index 1549d9586fbb1873ac6d35471d1624cf22be29d3..050b18c93c48583ac30fa950440e37b9d557c3ba 100644 (file)
@@ -112,7 +112,6 @@ gboolean gtk_init_check_abi_check (int        *argc,
 #endif
 
 void           gtk_disable_setlocale    (void);
-gchar *        gtk_set_locale           (void);
 PangoLanguage *gtk_get_default_language (void);
 gboolean       gtk_events_pending       (void);