415 lines
12 KiB
Diff
415 lines
12 KiB
Diff
From 9a6f41415b774541c69cb45cec96839b7228fe70 Mon Sep 17 00:00:00 2001
|
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
|
Date: Wed, 13 Oct 2010 14:05:02 +0900
|
|
Subject: [PATCH] Fix a build error with GTK3 gdkkeysyms.h
|
|
|
|
Fix a build error of IBus-1.0.gir with gobject-introspection 0.9.6
|
|
|
|
---
|
|
bus/dbusimpl.h | 4 ++--
|
|
bus/main.c | 1 +
|
|
bus/matchrule.c | 6 +++---
|
|
bus/matchrule.h | 4 ++--
|
|
bus/server.c | 1 +
|
|
client/gtk2/ibusimcontext.c | 47 +++++++++++++++++++++++++++++++++++++++++++
|
|
configure.ac | 13 +++++++++++++
|
|
src/Makefile.am | 2 +-
|
|
src/ibusdbus.h | 39 +++++++++++++++++++++++++++++++++++----
|
|
src/ibusenumtypes.c.template | 1 +
|
|
src/ibuserror.c | 2 +-
|
|
src/ibuserror.h | 12 +-----------
|
|
src/ibusmessage.h | 14 --------------
|
|
src/ibuspendingcall.h | 7 -------
|
|
14 files changed, 108 insertions(+), 45 deletions(-)
|
|
|
|
diff --git a/bus/dbusimpl.h b/bus/dbusimpl.h
|
|
index d3409fa..da332d0 100644
|
|
--- a/bus/dbusimpl.h
|
|
+++ b/bus/dbusimpl.h
|
|
@@ -80,10 +80,10 @@ BusConnection *bus_dbus_impl_get_connection_by_name
|
|
(BusDBusImpl *dbus,
|
|
const gchar *name);
|
|
void bus_dbus_impl_dispatch_message (BusDBusImpl *dbus,
|
|
- DBusMessage *message);
|
|
+ IBusMessage *message);
|
|
void bus_dbus_impl_dispatch_message_by_rule
|
|
(BusDBusImpl *dbus,
|
|
- DBusMessage *message,
|
|
+ IBusMessage *message,
|
|
BusConnection *skip_connection);
|
|
gboolean bus_dbus_impl_register_object (BusDBusImpl *dbus,
|
|
IBusService *object);
|
|
diff --git a/bus/main.c b/bus/main.c
|
|
index 852f6aa..c9821b8 100644
|
|
--- a/bus/main.c
|
|
+++ b/bus/main.c
|
|
@@ -20,6 +20,7 @@
|
|
* Boston, MA 02111-1307, USA.
|
|
*/
|
|
#include <config.h>
|
|
+#include <dbus/dbus.h>
|
|
#include <unistd.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
diff --git a/bus/matchrule.c b/bus/matchrule.c
|
|
index 1c0205d..eb51323 100644
|
|
--- a/bus/matchrule.c
|
|
+++ b/bus/matchrule.c
|
|
@@ -414,7 +414,7 @@ bus_match_rule_set_arg (BusMatchRule *rule,
|
|
|
|
gboolean
|
|
bus_match_rule_match (BusMatchRule *rule,
|
|
- DBusMessage *message)
|
|
+ IBusMessage *message)
|
|
{
|
|
g_assert (rule != NULL);
|
|
g_assert (message != NULL);
|
|
@@ -451,7 +451,7 @@ bus_match_rule_match (BusMatchRule *rule,
|
|
|
|
if (rule->flags & MATCH_ARGS) {
|
|
guint i;
|
|
- DBusMessageIter iter;
|
|
+ IBusMessageIter iter;
|
|
|
|
ibus_message_iter_init (message, &iter);
|
|
|
|
@@ -626,7 +626,7 @@ bus_match_rule_remove_recipient (BusMatchRule *rule,
|
|
|
|
GList *
|
|
bus_match_rule_get_recipients (BusMatchRule *rule,
|
|
- DBusMessage *message)
|
|
+ IBusMessage *message)
|
|
{
|
|
g_assert (BUS_IS_MATCH_RULE (rule));
|
|
g_assert (message != NULL);
|
|
diff --git a/bus/matchrule.h b/bus/matchrule.h
|
|
index ddaa7de..4743b81 100644
|
|
--- a/bus/matchrule.h
|
|
+++ b/bus/matchrule.h
|
|
@@ -107,7 +107,7 @@ gboolean bus_match_rule_set_arg (BusMatchRule *rule,
|
|
guint arg_i,
|
|
const gchar *arg);
|
|
gboolean bus_match_rule_match (BusMatchRule *rule,
|
|
- DBusMessage *message);
|
|
+ IBusMessage *message);
|
|
gboolean bus_match_rule_is_equal (BusMatchRule *a,
|
|
BusMatchRule *b);
|
|
void bus_match_rule_add_recipient
|
|
@@ -118,7 +118,7 @@ void bus_match_rule_remove_recipient
|
|
BusConnection *connection);
|
|
GList *bus_match_rule_get_recipients
|
|
(BusMatchRule *rule,
|
|
- DBusMessage *message);
|
|
+ IBusMessage *message);
|
|
|
|
G_END_DECLS
|
|
#endif
|
|
diff --git a/bus/server.c b/bus/server.c
|
|
index b611738..5af6dbf 100644
|
|
--- a/bus/server.c
|
|
+++ b/bus/server.c
|
|
@@ -19,6 +19,7 @@
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
* Boston, MA 02111-1307, USA.
|
|
*/
|
|
+#include <dbus/dbus.h>
|
|
#include <unistd.h>
|
|
#include <sys/stat.h>
|
|
#include <sys/types.h>
|
|
diff --git a/client/gtk3/ibusimcontext.c b/client/gtk3/ibusimcontext.c
|
|
index c104f38..a7a2c59 100644
|
|
--- a/client/gtk3/ibusimcontext.c
|
|
+++ b/client/gtk3/ibusimcontext.c
|
|
@@ -24,6 +24,7 @@
|
|
# include <config.h>
|
|
#endif
|
|
|
|
+#include <gtk/gtk.h>
|
|
#include <gdk/gdkkeysyms.h>
|
|
#include <gdk/gdkx.h>
|
|
#include <sys/types.h>
|
|
@@ -34,6 +35,10 @@
|
|
#include <ibus.h>
|
|
#include "ibusimcontext.h"
|
|
|
|
+#if !GTK_CHECK_VERSION (2, 90, 7)
|
|
+# define DEPRECATED_GDK_KEYSYMS 1
|
|
+#endif
|
|
+
|
|
#ifdef DEBUG
|
|
# define IDEBUG g_debug
|
|
#else
|
|
@@ -733,6 +738,7 @@ _key_is_modifier (guint keyval)
|
|
* really should be implemented */
|
|
|
|
switch (keyval) {
|
|
+#ifdef DEPRECATED_GDK_KEYSYMS
|
|
case GDK_Shift_L:
|
|
case GDK_Shift_R:
|
|
case GDK_Control_L:
|
|
@@ -759,6 +765,34 @@ _key_is_modifier (guint keyval)
|
|
case GDK_ISO_Group_Latch:
|
|
case GDK_ISO_Group_Lock:
|
|
return TRUE;
|
|
+#else
|
|
+ case GDK_KEY_Shift_L:
|
|
+ case GDK_KEY_Shift_R:
|
|
+ case GDK_KEY_Control_L:
|
|
+ case GDK_KEY_Control_R:
|
|
+ case GDK_KEY_Caps_Lock:
|
|
+ case GDK_KEY_Shift_Lock:
|
|
+ case GDK_KEY_Meta_L:
|
|
+ case GDK_KEY_Meta_R:
|
|
+ case GDK_KEY_Alt_L:
|
|
+ case GDK_KEY_Alt_R:
|
|
+ case GDK_KEY_Super_L:
|
|
+ case GDK_KEY_Super_R:
|
|
+ case GDK_KEY_Hyper_L:
|
|
+ case GDK_KEY_Hyper_R:
|
|
+ case GDK_KEY_ISO_Lock:
|
|
+ case GDK_KEY_ISO_Level2_Latch:
|
|
+ case GDK_KEY_ISO_Level3_Shift:
|
|
+ case GDK_KEY_ISO_Level3_Latch:
|
|
+ case GDK_KEY_ISO_Level3_Lock:
|
|
+ case GDK_KEY_ISO_Level5_Shift:
|
|
+ case GDK_KEY_ISO_Level5_Latch:
|
|
+ case GDK_KEY_ISO_Level5_Lock:
|
|
+ case GDK_KEY_ISO_Group_Shift:
|
|
+ case GDK_KEY_ISO_Group_Latch:
|
|
+ case GDK_KEY_ISO_Group_Lock:
|
|
+ return TRUE;
|
|
+#endif
|
|
default:
|
|
return FALSE;
|
|
}
|
|
@@ -789,7 +823,11 @@ _create_gdk_event (IBusIMContext *ibusimcontext,
|
|
event->group = 0;
|
|
event->is_modifier = _key_is_modifier (keyval);
|
|
|
|
+#ifdef DEPRECATED_GDK_KEYSYMS
|
|
if (keyval != GDK_VoidSymbol)
|
|
+#else
|
|
+ if (keyval != GDK_KEY_VoidSymbol)
|
|
+#endif
|
|
c = gdk_keyval_to_unicode (keyval);
|
|
|
|
if (c) {
|
|
@@ -819,12 +857,21 @@ _create_gdk_event (IBusIMContext *ibusimcontext,
|
|
NULL);
|
|
if (event->string)
|
|
event->length = bytes_written;
|
|
+#ifdef DEPRECATED_GDK_KEYSYMS
|
|
} else if (keyval == GDK_Escape) {
|
|
+#else
|
|
+ } else if (keyval == GDK_KEY_Escape) {
|
|
+#endif
|
|
event->length = 1;
|
|
event->string = g_strdup ("\033");
|
|
}
|
|
+#ifdef DEPRECATED_GDK_KEYSYMS
|
|
else if (keyval == GDK_Return ||
|
|
keyval == GDK_KP_Enter) {
|
|
+#else
|
|
+ else if (keyval == GDK_KEY_Return ||
|
|
+ keyval == GDK_KEY_KP_Enter) {
|
|
+#endif
|
|
event->length = 1;
|
|
event->string = g_strdup ("\r");
|
|
}
|
|
diff --git a/configure.ac b/configure.ac
|
|
index 3346d0c..3d87484 100644
|
|
--- a/configure.ac
|
|
+++ b/configure.ac
|
|
@@ -171,6 +171,18 @@ fi
|
|
# GObject introspection
|
|
GOBJECT_INTROSPECTION_CHECK([0.6.8])
|
|
|
|
+IBUS_GIR_SCANNERFLAGS=
|
|
+if test x"$found_introspection" = x"yes" ; then
|
|
+ IBUS_GIR_SCANNERFLAGS="--identifier-prefix=IBus --symbol-prefix=ibus"
|
|
+ PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 0.9.6],
|
|
+ [gir_symbol_prefix=yes],
|
|
+ [gir_symbol_prefix=no])
|
|
+ if test x"$gir_symbol_prefix" = x"no" ; then
|
|
+ IBUS_GIR_SCANNERFLAGS="--strip-prefix=IBus"
|
|
+ fi
|
|
+fi
|
|
+AC_SUBST(IBUS_GIR_SCANNERFLAGS)
|
|
+
|
|
# check for gtk-doc
|
|
GTK_DOC_CHECK(1.9)
|
|
if test x"$enable_gtk_doc" = x"no"; then
|
|
@@ -386,6 +398,7 @@ Build options:
|
|
Build gconf modules $enable_gconf
|
|
Build memconf modules $enable_memconf
|
|
Build introspection $found_introspection
|
|
+ IBus-1.0.gir scannerflags "$IBUS_GIR_SCANNERFLAGS"
|
|
Build vala binding $enable_vala
|
|
Build document $enable_gtk_doc
|
|
Enable key snooper $enable_key_snooper
|
|
diff --git a/src/Makefile.am b/src/Makefile.am
|
|
index 5fb24a4..c45a588 100644
|
|
--- a/src/Makefile.am
|
|
+++ b/src/Makefile.am
|
|
@@ -138,7 +138,7 @@ introspection_files = \
|
|
ibusenumtypes.h \
|
|
$(NULL)
|
|
IBus-1.0.gir: $(ibustargetlib) Makefile
|
|
-IBus_1_0_gir_SCANNERFLAGS = --strip-prefix=IBus --pkg=dbus-1,glib-2.0
|
|
+IBus_1_0_gir_SCANNERFLAGS = --pkg=glib-2.0 $(IBUS_GIR_SCANNERFLAGS)
|
|
IBus_1_0_gir_INCLUDES = GLib-2.0 GObject-2.0
|
|
IBus_1_0_gir_LIBS = $(ibustargetlib)
|
|
IBus_1_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_files))
|
|
diff --git a/src/ibusdbus.h b/src/ibusdbus.h
|
|
index 3cf99a2..88aa791 100644
|
|
--- a/src/ibusdbus.h
|
|
+++ b/src/ibusdbus.h
|
|
@@ -32,13 +32,44 @@
|
|
G_BEGIN_DECLS
|
|
|
|
#ifndef DBUS_H
|
|
-typedef struct DBusError DBusError;
|
|
-typedef struct DBusMessage DBusMessage;
|
|
-typedef struct DBusMessageIter DBusMessageIter;
|
|
-typedef struct DBusPendingCall DBusPendingCall;
|
|
+typedef struct IBusError IBusError;
|
|
+typedef struct IBusMessage IBusMessage;
|
|
+typedef struct IBusMessageIter IBusMessageIter;
|
|
+typedef struct IBusPendingCall IBusPendingCall;
|
|
typedef struct DBusServer DBusServer;
|
|
typedef struct DBusConnection DBusConnection;
|
|
#else
|
|
+/**
|
|
+ * IBusError:
|
|
+ *
|
|
+ * A data type representing an IBusError.
|
|
+ * An IBusError is actually a #DBusError.
|
|
+ *
|
|
+ * @see_also: #DBusError for detail structure definition.
|
|
+ */
|
|
+typedef DBusError IBusError;
|
|
+
|
|
+/**
|
|
+ * IBusMessage:
|
|
+ *
|
|
+ * An opaque data structure that represents IBusMessage.
|
|
+ */
|
|
+typedef DBusMessage IBusMessage;
|
|
+
|
|
+/**
|
|
+ * IBusMessageIter:
|
|
+ *
|
|
+ * An opaque data structure that represents IBusMessageIter.
|
|
+ */
|
|
+typedef DBusMessageIter IBusMessageIter;
|
|
+
|
|
+/**
|
|
+ * IBusPendingCall:
|
|
+ *
|
|
+ * An opaque data structure that represents IBusPendingCall.
|
|
+ */
|
|
+typedef DBusPendingCall IBusPendingCall;
|
|
+
|
|
#endif
|
|
|
|
G_END_DECLS
|
|
diff --git a/src/ibusenumtypes.c.template b/src/ibusenumtypes.c.template
|
|
index 9f607a0..a526bd1 100644
|
|
--- a/src/ibusenumtypes.c.template
|
|
+++ b/src/ibusenumtypes.c.template
|
|
@@ -1,4 +1,5 @@
|
|
/*** BEGIN file-header ***/
|
|
+#include <dbus/dbus.h>
|
|
#include "ibus.h"
|
|
|
|
/*** END file-header ***/
|
|
diff --git a/src/ibuserror.c b/src/ibuserror.c
|
|
index a721a47..e701a17 100644
|
|
--- a/src/ibuserror.c
|
|
+++ b/src/ibuserror.c
|
|
@@ -63,7 +63,7 @@ ibus_error_new_from_printf (const gchar *name,
|
|
}
|
|
|
|
IBusError *
|
|
-ibus_error_new_from_message (DBusMessage *message)
|
|
+ibus_error_new_from_message (IBusMessage *message)
|
|
{
|
|
g_assert (message != NULL);
|
|
|
|
diff --git a/src/ibuserror.h b/src/ibuserror.h
|
|
index a3f75f2..8de6ae0 100644
|
|
--- a/src/ibuserror.h
|
|
+++ b/src/ibuserror.h
|
|
@@ -36,16 +36,6 @@
|
|
G_BEGIN_DECLS
|
|
|
|
/**
|
|
- * IBusError:
|
|
- *
|
|
- * A data type representing an IBusError.
|
|
- * An IBusError is actually a #DBusError.
|
|
- *
|
|
- * @see_also: #DBusError for detail structure definition.
|
|
- */
|
|
-typedef DBusError IBusError;
|
|
-
|
|
-/**
|
|
* ibus_error_new:
|
|
* @returns: A newly allocated IBusError.
|
|
*
|
|
@@ -85,7 +75,7 @@ IBusError *ibus_error_new_from_printf (const gchar *name,
|
|
* New an IBusError from a #IBusMessage.
|
|
*/
|
|
IBusError *ibus_error_new_from_message
|
|
- (DBusMessage *message);
|
|
+ (IBusMessage *message);
|
|
|
|
/**
|
|
* ibus_error_free:
|
|
diff --git a/src/ibusmessage.h b/src/ibusmessage.h
|
|
index 584d497..f4bdb3a 100644
|
|
--- a/src/ibusmessage.h
|
|
+++ b/src/ibusmessage.h
|
|
@@ -77,20 +77,6 @@
|
|
G_BEGIN_DECLS
|
|
|
|
/**
|
|
- * IBusMessage:
|
|
- *
|
|
- * An opaque data structure that represents IBusMessage.
|
|
- */
|
|
-typedef DBusMessage IBusMessage;
|
|
-
|
|
-/**
|
|
- * IBusMessageIter:
|
|
- *
|
|
- * An opaque data structure that represents IBusMessageIter.
|
|
- */
|
|
-typedef DBusMessageIter IBusMessageIter;
|
|
-
|
|
-/**
|
|
* ibus_type_get_object_path:
|
|
* @returns: Type of object path.
|
|
*
|
|
diff --git a/src/ibuspendingcall.h b/src/ibuspendingcall.h
|
|
index d74c921..650ba4f 100644
|
|
--- a/src/ibuspendingcall.h
|
|
+++ b/src/ibuspendingcall.h
|
|
@@ -41,13 +41,6 @@
|
|
G_BEGIN_DECLS
|
|
|
|
/**
|
|
- * IBusPendingCall:
|
|
- *
|
|
- * An opaque data structure that represents IBusPendingCall.
|
|
- */
|
|
-typedef DBusPendingCall IBusPendingCall;
|
|
-
|
|
-/**
|
|
* IBusPendingCallNotifyFunction:
|
|
* @pending: An IBusPendingCall.
|
|
* @user_data: User data for the callback function.
|
|
--
|
|
1.7.2.1
|
|
|