[imsettings/f17] Add MATE Desktop support. (#866328)

Akira TAGOH tagoh at fedoraproject.org
Wed Oct 17 11:25:44 UTC 2012


commit 4c4964c3951a0e3d2725eb55ab2b1e8896de24b8
Author: Akira TAGOH <tagoh at redhat.com>
Date:   Wed Oct 17 20:25:21 2012 +0900

    Add MATE Desktop support. (#866328)
    
    - Drop imsettings-*-disable-fallbackim.patch. no need to stop
      fallback anymore.

 imsettings-lxde-disable-fallbackim.patch |   20 --
 imsettings-mate.patch                    |  364 ++++++++++++++++++++++++++++++
 imsettings-xfce-disable-fallbackim.patch |   20 --
 imsettings.spec                          |   36 +++-
 4 files changed, 395 insertions(+), 45 deletions(-)
---
diff --git a/imsettings-mate.patch b/imsettings-mate.patch
new file mode 100644
index 0000000..6309b6c
--- /dev/null
+++ b/imsettings-mate.patch
@@ -0,0 +1,364 @@
+From 1eece68489c3dfe05ec448fce8f7179074281224 Mon Sep 17 00:00:00 2001
+From: Akira TAGOH <akira at tagoh.org>
+Date: Tue, 4 Sep 2012 14:03:14 +0900
+Subject: [PATCH 1/2] Add the MATE-Desktop support
+
+---
+ README                              |   4 ++
+ backends/Makefile.am                |   9 ++-
+ backends/mateconf/Makefile.am       |  47 +++++++++++++++
+ backends/mateconf/mateconf-module.c | 117 ++++++++++++++++++++++++++++++++++++
+ configure.ac                        |  25 ++++++--
+ data/xinput.sh.in.in                |   8 +++
+ 6 files changed, 201 insertions(+), 9 deletions(-)
+ create mode 100644 backends/mateconf/Makefile.am
+ create mode 100644 backends/mateconf/mateconf-module.c
+
+diff --git a/README b/README
+index 34c4fb0..58248a0 100644
+--- a/README
++++ b/README
+@@ -49,6 +49,7 @@ Supported Toolkits
+ ======================
+ * GTK+
+ * LXDE
++* MATE
+ * Qt
+ * XFCE
+ * X (with IMSettings XIM server; require libgxim)
+@@ -231,6 +232,9 @@ Backend modules
+ * libimsettings-lxde.so:
+   A LXDE backend to support LXDE Desktop.
+ 
++* libimsettings-mateconf.so:
++  A mateconf backend to support MATE Desktop.
++
+ * libimsettings-qt.so:
+   A Qt backend to support Qt applications.
+ 
+diff --git a/backends/Makefile.am b/backends/Makefile.am
+index 1b470b9..e60905c 100644
+--- a/backends/Makefile.am
++++ b/backends/Makefile.am
+@@ -7,15 +7,18 @@ endif
+ if ENABLE_GSETTINGS
+ SUBDIRS += gsettings
+ endif
++if ENABLE_LXDE
++SUBDIRS += lxde
++endif
++if ENABLE_MATE
++SUBDIRS += mateconf
++endif
+ if ENABLE_QT
+ SUBDIRS += qt
+ endif
+ if ENABLE_XFCE
+ SUBDIRS += xfce
+ endif
+-if ENABLE_LXDE
+-SUBDIRS += lxde
+-endif
+ if ENABLE_XIM
+ SUBDIRS += xim
+ endif
+diff --git a/backends/mateconf/Makefile.am b/backends/mateconf/Makefile.am
+new file mode 100644
+index 0000000..670e8e7
+--- /dev/null
++++ b/backends/mateconf/Makefile.am
+@@ -0,0 +1,47 @@
++##
++# Global definitions
++NULL =
++INCLUDES =						\
++	-DIMSETTINGS_LOCALEDIR="\"$(datadir)/locale\""	\
++	-I$(top_srcdir)/imsettings			\
++	$(MATE_CFLAGS)					\
++	$(NULL)
++LIBS =							\
++	@LDFLAGS@					\
++	$(top_builddir)/imsettings/libimsettings.la	\
++	$(MATE_LIBS)					\
++	$(NULL)
++EXTRA_DIST =						\
++	$(NULL)
++
++
++##
++# Local definitions
++
++##
++# Local Rules
++
++##
++# Target platform
++imsettingsdir = $(IMSETTINGS_MODULEDIR)
++imsettings_LTLIBRARIES =				\
++	libimsettings-mateconf.la			\
++	$(NULL)
++#
++libimsettings_mateconf_la_SOURCES =			\
++	mateconf-module.c				\
++	$(NULL)
++libimsettings_mateconf_la_CFLAGS =				\
++	-DG_LOG_DOMAIN="\"IMSettings-MATE-Conf backend\""	\
++	$(CFLAGS)						\
++	$(NULL)
++libimsettings_mateconf_la_LDFLAGS =			\
++	-avoid-version					\
++	-module						\
++	$(LDFLAGS)					\
++	$(NULL)
++libimsettings_mateconf_la_LIBADD =			\
++	$(LDADDS)					\
++	$(NULL)
++
++-include $(top_srcdir)/git.mk
+diff --git a/backends/mateconf/mateconf-module.c b/backends/mateconf/mateconf-module.c
+new file mode 100644
+index 0000000..bbbde21
+--- /dev/null
++++ b/backends/mateconf/mateconf-module.c
+@@ -0,0 +1,117 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
++/* 
++ * mateconf-module.c
++ * Copyright (C) 2008-2012 Red Hat, Inc. All rights reserved.
++ * 
++ * Authors:
++ *   Akira TAGOH  <tagoh at redhat.com>
++ * 
++ * 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.
++ */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#include <mateconf/mateconf-client.h>
++#include "imsettings-info.h"
++#include "imsettings-utils.h"
++
++#define MATECONF_SCHEMA_KEY	"/desktop/mate/interface/gtk-im-module"
++
++void   module_switch_im(IMSettingsInfo *info);
++gchar *module_dump_im  (void);
++
++/*< private >*/
++
++/*< public >*/
++void
++module_switch_im(IMSettingsInfo *info)
++{
++	MateConfEngine *engine;
++	MateConfValue *val = NULL;
++	const gchar *gtkimm = imsettings_info_get_gtkimm(info);
++	GError *err = NULL;
++	gchar *v = NULL;
++
++	engine = mateconf_engine_get_default();
++	if (!engine) {
++		g_warning("Unable to obtain MateConfEngine instance.");
++		return;
++	}
++	if (!gtkimm || gtkimm[0] == 0) {
++		g_warning("Invalid gtk immodule in: %s",
++			  imsettings_info_get_filename(info));
++		goto finalize;
++	}
++
++#ifdef ENABLE_FALLBACK_IM
++	v = g_strdup_printf("%s:xim", gtkimm);
++#else
++	v = g_strdup(gtkimm);
++#endif
++	val = mateconf_value_new_from_string(MATECONF_VALUE_STRING,
++					     v, &err);
++	if (err)
++		goto error;
++	g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO,
++	      "Setting up %s as gtk+ immodule",
++	      v);
++	mateconf_engine_set(engine, MATECONF_SCHEMA_KEY,
++			    val, &err);
++	if (err) {
++	  error:
++		g_warning("%s", err->message);
++		g_error_free(err);
++	}
++  finalize:
++	g_free(v);
++	if (val)
++		mateconf_value_free(val);
++	if (engine) {
++		mateconf_engine_unref(engine);
++	}
++	g_print("%d\n", mateconf_debug_shutdown());
++}
++
++gchar *
++module_dump_im(void)
++{
++	MateConfEngine *engine;
++	MateConfValue *val = NULL;
++	GError *err = NULL;
++	gchar *retval = NULL;
++
++	engine = mateconf_engine_get_default();
++	if (!engine) {
++		g_warning("Unable to obtain MateConfEngine instance.");
++		return NULL;
++	}
++	val = mateconf_engine_get(engine, MATECONF_SCHEMA_KEY, &err);
++	if (err) {
++		g_warning("%s", err->message);
++		g_error_free(err);
++	} else {
++		retval = g_strdup(mateconf_value_get_string(val));
++	}
++	if (val)
++		mateconf_value_free(val);
++	if (engine) {
++		mateconf_engine_unref(engine);
++	}
++	g_print("%d\n", mateconf_debug_shutdown());
++
++	return retval;
++}
+diff --git a/configure.ac b/configure.ac
+index e1b858e..9241dfc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -112,6 +112,10 @@ PKG_CHECK_MODULES(GSETTINGS, gio-2.0 >= $GIO_REQUIRED,
+ PKG_CHECK_MODULES(LXDE, glib-2.0,
+ 	[use_lxde="yes"],
+ 	[use_lxde="no"])
++# for mate backend
++PKG_CHECK_MODULES(MATE, mateconf-2.0,
++	[use_mate="yes"],
++	[use_mate="no"])
+ # for xfce backend
+ PKG_CHECK_MODULES(XFCE,	libxfconf-0,
+ 	[use_xfce="yes"],
+@@ -143,6 +147,8 @@ AC_SUBST(XFCE_CFLAGS)
+ AC_SUBST(XFCE_LIBS)
+ AC_SUBST(LXDE_CFLAGS)
+ AC_SUBST(LXDE_LIBS)
++AC_SUBST(MATE_CFLAGS)
++AC_SUBST(MATE_LIBS)
+ AC_SUBST(XIM_CFLAGS)
+ AC_SUBST(XIM_LIBS)
+ AC_SUBST(CHECK_CFLAGS)
+@@ -153,9 +159,10 @@ AC_SUBST(GTHREAD_LIBS)
+ AM_CONDITIONAL(ENABLE_UNIT_TEST, test x$use_check != xno)
+ AM_CONDITIONAL(ENABLE_GCONF, test x$use_gconf != xno)
+ AM_CONDITIONAL(ENABLE_GSETTINGS, test x$use_gsettings != xno)
++AM_CONDITIONAL(ENABLE_LXDE, test x$use_lxde != xno)
++AM_CONDITIONAL(ENABLE_MATE, test x$use_mate != xno)
+ AM_CONDITIONAL(ENABLE_QT, test x$use_qt != xno)
+ AM_CONDITIONAL(ENABLE_XFCE, test x$use_xfce != xno)
+-AM_CONDITIONAL(ENABLE_LXDE, test x$use_lxde != xno)
+ AM_CONDITIONAL(ENABLE_XIM, test x$use_xim != xno)
+ 
+ dnl ======================================================================
+@@ -306,6 +313,7 @@ AC_CONFIG_FILES([
+ 	backends/gconf/Makefile
+ 	backends/gsettings/Makefile
+ 	backends/lxde/Makefile
++	backends/mateconf/Makefile
+ 	backends/qt/Makefile
+ 	backends/xfce/Makefile
+ 	backends/xim/Makefile
+@@ -343,6 +351,16 @@ if test "x$use_gconf" = "xyes"; then
+    echo "   CFLAGS:               $GSETTINGS_CFLAGS"
+    echo "   LDFLAGS:              $GSETTINGS_LIBS"
+ fi
++echo " MATE support:           $use_mate"
++if test "x$use_mate" = "xyes"; then
++   echo "   CFLAGS:               $MATE_CFLAGS"
++   echo "   LDFLAGS:              $MATE_LIBS"
++fi
++echo " LXDE support:           $use_lxde"
++if test "x$use_lxde" = "xyes"; then
++   echo "   CFLAGS:               $LXDE_CFLAGS"
++   echo "   LDFLAGS:              $LXDE_LIBS"
++fi
+ echo " Qt support:             $use_qt"
+ if test "x$use_qt" = "xyes"; then
+    echo "   CFLAGS:               $GLIB_CFLAGS"
+@@ -353,11 +371,6 @@ if test "x$use_xfce" = "xyes"; then
+    echo "   CFLAGS:               $XFCE_CFLAGS"
+    echo "   LDFLAGS:              $XFCE_LIBS"
+ fi
+-echo " LXDE support:           $use_lxde"
+-if test "x$use_lxde" = "xyes"; then
+-   echo "   CFLAGS:               $LXDE_CFLAGS"
+-   echo "   LDFLAGS:              $LXDE_LIBS"
+-fi
+ echo " XIM support:            $use_xim"
+ if test "x$use_xim" = "xyes"; then
+    echo "   CFLAGS:               $XIM_CFLAGS"
+diff --git a/data/xinput.sh.in.in b/data/xinput.sh.in.in
+index 4f4baad..a402c26 100755
+--- a/data/xinput.sh.in.in
++++ b/data/xinput.sh.in.in
+@@ -56,6 +56,9 @@ function lookup_desktop() {
+ 	lxsession*)
+ 	    echo "LXDE"
+ 	    ;;
++	mate*)
++	    echo "mate"
++	    ;;
+ 	xfce*)
+ 	    echo "xfce"
+ 	    ;;
+@@ -105,6 +108,11 @@ function is_gtk_supported() {
+ 		return 0
+ 	    fi
+ 	    ;;
++	mate)
++	    if check_imsettings_capability mateconf; then
++		return 0
++	    fi
++	    ;;
+ 	xfce*)
+ 	    if check_imsettings_capability xfce; then
+ 		return 0
+-- 
+1.7.11.7
+
+From c4fe2a94441e0004ece4a43d6b81871dcc66df19 Mon Sep 17 00:00:00 2001
+From: Akira TAGOH <akira at tagoh.org>
+Date: Wed, 17 Oct 2012 19:01:21 +0900
+Subject: [PATCH 2/2] Add mateconf backend for testing
+
+---
+ tests/run.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/run.sh b/tests/run.sh
+index a2ca8a8..5180f69 100755
+--- a/tests/run.sh
++++ b/tests/run.sh
+@@ -9,4 +9,4 @@ if [ "x$1" = "x-d" ]; then
+ 	DB="libtool --mode=execute gdb --args "
+ fi
+ 
+-IMSETTINGS_HELPER_PATH=$topdir/data PATH=$topdir/backends/xim:$PATH $DB$topdir/imsettings-daemon/imsettings-daemon --replace --no-logfile --moduledir=$topdir/backends/gconf/.libs:$topdir/backends/gsettings/.libs:$topdir/backends/lxde/.libs:$topdir/backends/qt/.libs:$topdir/backends/xfce/.libs:$topdir/backends/xim/.libs $@
++IMSETTINGS_HELPER_PATH=$topdir/data PATH=$topdir/backends/xim:$PATH $DB$topdir/imsettings-daemon/imsettings-daemon --replace --no-logfile --moduledir=$topdir/backends/gconf/.libs:$topdir/backends/gsettings/.libs:$topdir/backends/lxde/.libs:$topdir/backends/mateconf/.libs:$topdir/backends/qt/.libs:$topdir/backends/xfce/.libs:$topdir/backends/xim/.libs $@
+-- 
+1.7.11.7
+
diff --git a/imsettings.spec b/imsettings.spec
index 6502b9a..18ff467 100644
--- a/imsettings.spec
+++ b/imsettings.spec
@@ -1,6 +1,6 @@
 Name:		imsettings
 Version:	1.2.9
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	LGPLv2+
 URL:		http://code.google.com/p/imsettings/
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -12,13 +12,13 @@ BuildRequires:	libnotify-devel
 BuildRequires:	libX11-devel, libgxim-devel >= 0.3.1
 %if !0%{?rhel}
 BuildRequires:	xfconf-devel
+BuildRequires:	mate-conf-devel
 %endif
 Source0:	http://imsettings.googlecode.com/files/%{name}-%{version}.tar.bz2
 Patch0:		imsettings-constraint-of-language.patch
 Patch1:		imsettings-disable-xim.patch
 Patch2:		imsettings-xinput-xcompose.patch
-Patch3:		imsettings-xfce-disable-fallbackim.patch
-Patch4:		imsettings-lxde-disable-fallbackim.patch
+Patch3:		imsettings-mate.patch
 
 Summary:	Delivery framework for general Input Method configuration
 Group:		Applications/System
@@ -144,6 +144,22 @@ immediately without any need to restart applications
 or the desktop.
 
 This package contains a module to get this working on LXDE.
+
+%package	mate
+Summary:	MATE support on imsettings
+Group:		Applications/System
+Requires:	%{name} = %{version}-%{release}
+Requires:	mate-settings-daemon
+Requires:	mate-session-manager
+Provides:	imsettings-desktop-module = %{version}-%{release}
+
+%description	mate
+IMSettings is a framework that delivers Input Method
+settings and applies the changes so they take effect
+immediately without any need to restart applications
+or the desktop.
+
+This package contains a module to get this working on MATE.
 %endif
 
 %prep
@@ -151,8 +167,8 @@ This package contains a module to get this working on LXDE.
 %patch0 -p1 -b .0-lang
 %patch1 -p1 -b .1-xim
 %patch2 -p1 -b .2-xcompose
-%patch3 -p1 -b .3-xfce-no-fallbackim
-%patch4 -p1 -b .4-lxde-no-fallbackim
+%patch3 -p1 -b .3-mate
+autoreconf
 
 %build
 %configure	\
@@ -259,10 +275,20 @@ fi
 %defattr(-, root, root, -)
 %doc AUTHORS COPYING ChangeLog NEWS README
 %{_libdir}/imsettings/libimsettings-lxde.so
+
+%files	mate
+%defattr(-, root, root, -)
+%doc AUTHORS COPYING ChangeLog NEWS README
+%{_libdir}/imsettings/libimsettings-mateconf.so
 %endif
 
 
 %changelog
+* Wed Oct 17 2012 Akira TAGOH <tagoh at redhat.com> - 1.2.9-2
+- Add MATE Desktop support. (#866328)
+- Drop imsettings-*-disable-fallbackim.patch. no need to stop
+  fallback anymore.
+
 * Mon Apr 23 2012 Akira TAGOH <tagoh at redhat.com> - 1.2.9-1
 - New upstream release.
   - fallback to lookup the default configuration on XDG dirs


More information about the scm-commits mailing list