gdm r6260 - in trunk: . gui/simple-greeter
- From: bcameron svn gnome org
- To: svn-commits-list gnome org
- Subject: gdm r6260 - in trunk: . gui/simple-greeter
- Date: Fri, 6 Jun 2008 04:31:34 +0000 (UTC)
Author: bcameron
Date: Fri Jun 6 04:31:33 2008
New Revision: 6260
URL: http://svn.gnome.org/viewvc/gdm?rev=6260&view=rev
Log:
2008-06-05 Brian Cameron <brian cameron sun com>
* configure.ac, gui/simple-greeter/Makefile.am,
gui/simple-greeter/gdm-layouts.c,
gui/simple-greeter/gdm-greeter-panel.c,
gui/simple-greeter/gdm-layout-chooser-widget.c: Make libxklavier an
optional dependency.
Modified:
trunk/ChangeLog
trunk/configure.ac
trunk/gui/simple-greeter/Makefile.am
trunk/gui/simple-greeter/gdm-greeter-panel.c
trunk/gui/simple-greeter/gdm-layout-chooser-widget.c
trunk/gui/simple-greeter/gdm-layouts.c
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Fri Jun 6 04:31:33 2008
@@ -99,11 +99,19 @@
gtk+-2.0 >= $GTK_REQUIRED_VERSION
libglade-2.0 >= $LIBGLADE_REQUIRED_VERSION
gconf-2.0 >= $GCONF_REQUIRED_VERSION
- libxklavier >= $LIBXKLAVIER_REQUIRED_VERSION
)
AC_SUBST(SIMPLE_GREETER_CFLAGS)
AC_SUBST(SIMPLE_GREETER_LIBS)
+PKG_CHECK_MODULES(LIBXKLAVIER,
+ libxklavier >= $LIBXKLAVIER_REQUIRED_VERSION,
+ have_libxklavier=yes,
+ have_libxklavier=no)
+AM_CONDITIONAL(HAVE_LIBXKLAVIER, test x$have_libxklavier = xyes)
+AC_SUBST(HAVE_LIBXKLAVIER)
+AC_SUBST(LIBXLKAVIER_CFLAGS)
+AC_SUBST(LIBXKALVIER_LIBS)
+
PKG_CHECK_MODULES(POLKIT_GNOME,
polkit-gnome >= $POLICYKIT_REQUIRED_VERSION,
have_polkit=yes,
Modified: trunk/gui/simple-greeter/Makefile.am
==============================================================================
--- trunk/gui/simple-greeter/Makefile.am (original)
+++ trunk/gui/simple-greeter/Makefile.am Fri Jun 6 04:31:33 2008
@@ -145,7 +145,7 @@
$(SIMPLE_GREETER_LIBS) \
$(GTK_LIBS) \
$(GCONF_LIBS) \
- -lxklavier \
+ $(LIBXKLAVIER_LIBS) \
$(NULL)
test_remote_login_window_SOURCES = \
Modified: trunk/gui/simple-greeter/gdm-greeter-panel.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-panel.c (original)
+++ trunk/gui/simple-greeter/gdm-greeter-panel.c Fri Jun 6 04:31:33 2008
@@ -721,6 +721,7 @@
gdm_greeter_panel_set_default_layout_name (GdmGreeterPanel *panel,
const char *layout_name)
{
+#ifdef HAVE_LIBXKLAVIER
g_return_if_fail (GDM_IS_GREETER_PANEL (panel));
if (layout_name != NULL &&
@@ -735,6 +736,7 @@
g_debug ("GdmGreeterPanel: activating layout: %s", layout_name);
gdm_layout_activate (layout_name);
+#endif
}
void
Modified: trunk/gui/simple-greeter/gdm-layout-chooser-widget.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-layout-chooser-widget.c (original)
+++ trunk/gui/simple-greeter/gdm-layout-chooser-widget.c Fri Jun 6 04:31:33 2008
@@ -122,6 +122,9 @@
layout_names = gdm_get_all_layout_names ();
+ if (layout_names == NULL)
+ return;
+
for (i = 0; layout_names[i] != NULL; i++) {
gdm_layout_chooser_widget_add_layout (widget,
layout_names[i]);
Modified: trunk/gui/simple-greeter/gdm-layouts.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-layouts.c (original)
+++ trunk/gui/simple-greeter/gdm-layouts.c Fri Jun 6 04:31:33 2008
@@ -26,11 +26,21 @@
#include <glib.h>
#include <gdk/gdkx.h>
+
+#ifdef HAVE_LIBXKLAVIER
#include <libxklavier/xklavier.h>
+#endif
+
#include <gconf/gconf-client.h>
#include "gdm-layouts.h"
+typedef struct {
+ GSList *list;
+ char *layout;
+} LayoutData;
+
+#ifdef HAVE_LIBXKLAVIER
static XklEngine *engine = NULL;
static XklConfigRegistry *config_registry = NULL;
static XklConfigRec *initial_config = NULL;
@@ -60,9 +70,34 @@
g_locale_to_utf8 (sd, -1, NULL, NULL, NULL);
}
+static void
+add_variant (XklConfigRegistry *config,
+ const XklConfigItem *item,
+ gpointer data)
+{
+ LayoutData *ldata = data;
+
+ ldata->list = g_slist_prepend (ldata->list, g_strdup_printf ("%s\t%s", ldata->layout, item->name));
+}
+
+static void
+add_layout (XklConfigRegistry *config,
+ const XklConfigItem *item,
+ gpointer data)
+{
+ LayoutData *ldata = data;
+
+ ldata->layout = item->name;
+ ldata->list = g_slist_prepend (ldata->list, g_strdup (item->name));
+ xkl_config_registry_foreach_layout_variant (config, item->name, add_variant, data);
+ ldata->layout = NULL;
+}
+#endif
+
gchar *
gdm_get_layout_from_name (const char *name)
{
+#ifdef HAVE_LIBXKLAVIER
XklConfigItem *item;
char *layout;
char *variant;
@@ -115,50 +150,26 @@
}
return result;
-}
-
-typedef struct {
- GSList *list;
- char *layout;
-} LayoutData;
-
-static void
-add_variant (XklConfigRegistry *config,
- const XklConfigItem *item,
- gpointer data)
-{
- LayoutData *ldata = data;
-
- ldata->list = g_slist_prepend (ldata->list, g_strdup_printf ("%s\t%s", ldata->layout, item->name));
-}
-
-static void
-add_layout (XklConfigRegistry *config,
- const XklConfigItem *item,
- gpointer data)
-{
- LayoutData *ldata = data;
-
- ldata->layout = item->name;
- ldata->list = g_slist_prepend (ldata->list, g_strdup (item->name));
- xkl_config_registry_foreach_layout_variant (config, item->name, add_variant, data);
- ldata->layout = NULL;
+#else
+ return NULL;
+#endif
}
char **
gdm_get_all_layout_names (void)
{
+#ifdef HAVE_LIBXKLAVIER
GSList *l;
int len;
int i;
char **layouts;
LayoutData data;
- init_xkl ();
-
data.list = NULL;
data.layout = NULL;
+ init_xkl ();
+
xkl_config_registry_foreach_layout (config_registry, add_layout, &data);
len = g_slist_length (data.list);
@@ -173,11 +184,15 @@
g_slist_free (data.list);
return layouts;
+#else
+ return NULL;
+#endif
}
void
gdm_layout_activate (const char *layout)
{
+#ifdef HAVE_LIBXKLAVIER
XklConfigRec *config;
char *p;
@@ -205,5 +220,6 @@
xkl_config_rec_activate (config, engine);
g_object_unref (config);
+#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]