summaryrefslogtreecommitdiff
path: root/gdk/gdki18n.h
diff options
context:
space:
mode:
authorGnome CVS User <gnomecvs@src.gnome.org>1997-11-27 04:16:39 +0000
committerGnome CVS User <gnomecvs@src.gnome.org>1997-11-27 04:16:39 +0000
commitdd34bcca5e6627c8a269c9232a8906e3bd8947df (patch)
tree5309f2ead99fbef5a4138556854079f68df48645 /gdk/gdki18n.h
parente522ad46baaef62bb639a3a120c59203cb0af847 (diff)
downloadgdk-pixbuf-dd34bcca5e6627c8a269c9232a8906e3bd8947df.tar.gz
Patches to support internationalized input by:
Takashi Matsuda <matsu@arch.comp.kyutech.ac.jp> TANAKA Shinya <shinya@race.u-tokyo.ac.jp> See ChangeLog entries for further details. Also some small fixes to event handling in gdk/gdk.c; sending clear events in gtk/gtkselection.c and cut-and-paste in gtk/gtkentry.c
Diffstat (limited to 'gdk/gdki18n.h')
-rw-r--r--gdk/gdki18n.h144
1 files changed, 144 insertions, 0 deletions
diff --git a/gdk/gdki18n.h b/gdk/gdki18n.h
new file mode 100644
index 000000000..776a7e4be
--- /dev/null
+++ b/gdk/gdki18n.h
@@ -0,0 +1,144 @@
+/* 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 Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __GDK_I18N_H__
+#define __GDK_I18N_H__
+
+/* international string support */
+
+#include <stdlib.h>
+#include <wchar.h>
+
+#ifdef X_LOCALE
+
+#include <X11/Xfuncproto.h>
+#include <X11/Xosdefs.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_XFUNCPROTOBEGIN
+extern int _Xmblen (
+#if NeedFunctionPrototypes
+ const char *s, size_t n
+#endif
+);
+_XFUNCPROTOEND
+
+_XFUNCPROTOBEGIN
+extern int _Xmbtowc (
+#if NeedFunctionPrototypes
+ wchar_t *wstr, const char *str, size_t len
+#endif
+);
+_XFUNCPROTOEND
+
+_XFUNCPROTOBEGIN
+extern int _Xwctomb (
+#if NeedFunctionPrototypes
+ char *str, wchar_t wc
+#endif
+);
+_XFUNCPROTOEND
+
+_XFUNCPROTOBEGIN
+extern size_t _Xmbstowcs (
+#if NeedFunctionPrototypes
+ wchar_t *wstr, const char *str, size_t len
+#endif
+);
+_XFUNCPROTOEND
+
+_XFUNCPROTOBEGIN
+extern size_t _Xwcstombs (
+#if NeedFunctionPrototypes
+ char *str, const wchar_t *wstr, size_t len
+#endif
+);
+_XFUNCPROTOEND
+
+_XFUNCPROTOBEGIN
+extern size_t _Xwcslen (
+#if NeedFunctionPrototypes
+ const wchar_t *wstr
+#endif
+);
+_XFUNCPROTOEND
+
+_XFUNCPROTOBEGIN
+extern wchar_t* _Xwcscpy (
+#if NeedFunctionPrototypes
+ wchar_t *wstr1, const wchar_t *wstr2
+#endif
+);
+_XFUNCPROTOEND
+
+_XFUNCPROTOBEGIN
+extern wchar_t* _Xwcsncpy (
+#if NeedFunctionPrototypes
+ wchar_t *wstr1, const wchar_t *wstr2, size_t len
+#endif
+);
+_XFUNCPROTOEND
+
+_XFUNCPROTOBEGIN
+extern int _Xwcscmp (
+#if NeedFunctionPrototypes
+ const wchar_t *wstr1, const wchar_t *wstr2
+#endif
+);
+_XFUNCPROTOEND
+
+_XFUNCPROTOBEGIN
+extern int _Xwcsncmp (
+#if NeedFunctionPrototypes
+ const wchar_t *wstr1, const wchar_t *wstr2, size_t len
+#endif
+);
+_XFUNCPROTOEND
+
+/*
+ * mblen, mbtowc, and mbstowcs of the locale "ja_JP.eucJP" are buggy.
+ */
+
+#ifdef MB_CUR_MAX
+# undef MB_CUR_MAX
+#endif
+#define MB_CUR_MAX 4
+extern int _g_mbtowc (wchar_t *wstr, const char *str, size_t len);
+
+/* #define mblen _Xmblen */
+/* #define mbtowc _Xmbtowc */
+#define mblen(a,b) _g_mbtowc ((wchar_t *)(NULL), (a), (b))
+#define mbtowc(a,b,c) _g_mbtowc ((a),(b),(c))
+
+#define wctomb(a,b) _Xwctomb ((a),(b))
+#define mbstowcs(a,b,c) _Xmbstowcs ((a),(b),(c))
+#define wcstombs(a,b,c) _Xwcstombs ((a),(b),(c))
+#define wcslen(a) _Xwcslen ((a))
+#define wcscpy(a,b) _Xwcscpy ((a),(b))
+#define wcsncpy(a,b,c) _Xwcsnpy ((a),(b),(c))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* X_LOCALE */
+
+#endif __GDK_I18N_H__