diff --git a/ChangeLog b/ChangeLog index 8b4f899f83..a872e55d9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2007-08-14 Tambet Ingo + + * libnm-glib/Makefile.am: Use nm-manager-client.xml to produce nm-client-bindings. + + * introspection/nm-manager-client.xml: Add a horrible horrbile hack to work around + an issue with dbus-glib bindings generator. The issue is, the generated C caller + functions for dbus methods "Sleep(bool)" and "sleep()" both have the same function + name and different arguments and it won't compile anymore. To fix this, we now have + two copies of nm-manager.xml file. nm-manager.xml contains the actual interface, + that is new API + compatibility API and used by the daemon. The other, + nm-manager-client.xml is only the new API without compatibility bits and is used + by libnm-glib to make it compile. + + * introspection/nm-manager.xml: Define compatibility methods (sleep, wake, state). + + * src/nm-manager.c (impl_manager_legacy_sleep) + (impl_manager_legacy_wake, impl_manager_legacy_state): Implement the compatibility + interface functions for 0.6 branch. + 2007-08-14 Dan Williams * src/NetworkManagerAP.c diff --git a/introspection/nm-manager-client.xml b/introspection/nm-manager-client.xml new file mode 100644 index 0000000000..99d499cade --- /dev/null +++ b/introspection/nm-manager-client.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml index 5a43e752c3..b66089a8df 100644 --- a/introspection/nm-manager.xml +++ b/introspection/nm-manager.xml @@ -1,5 +1,12 @@ + + @@ -27,5 +34,19 @@ + + + + + + + + + + + + + + diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index eb2f0a330d..e7f34aa443 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -77,8 +77,8 @@ nm-marshal.c: Makefile.am nm-marshal.list nm-marshal-main.c: nm-marshal.c nm-marshal.h -nm-client-bindings.h: $(top_srcdir)/introspection/nm-manager.xml - dbus-binding-tool --prefix=nm_client --mode=glib-client --output=nm-client-bindings.h $(top_srcdir)/introspection/nm-manager.xml +nm-client-bindings.h: $(top_srcdir)/introspection/nm-manager-client.xml + dbus-binding-tool --prefix=nm_client --mode=glib-client --output=nm-client-bindings.h $(top_srcdir)/introspection/nm-manager-client.xml nm-device-bindings.h: $(top_srcdir)/introspection/nm-device.xml dbus-binding-tool --prefix=nm_device --mode=glib-client --output=nm-device-bindings.h $(top_srcdir)/introspection/nm-device.xml diff --git a/src/nm-manager.c b/src/nm-manager.c index 0ce8294e64..58cd44ed34 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1,3 +1,5 @@ +/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */ + #include #include "nm-manager.h" @@ -11,6 +13,12 @@ static gboolean impl_manager_get_devices (NMManager *manager, GPtrArray **devices, GError **err); static gboolean impl_manager_sleep (NMManager *manager, gboolean sleep, GError **err); +/* Legacy 0.6 compatibility interface */ + +static gboolean impl_manager_legacy_sleep (NMManager *manager, GError **err); +static gboolean impl_manager_legacy_wake (NMManager *manager, GError **err); +static gboolean impl_manager_legacy_state (NMManager *manager, GError **err); + #include "nm-manager-glue.h" static void nm_manager_connections_destroy (NMManager *manager); @@ -473,6 +481,27 @@ nm_manager_get_active_device (NMManager *manager) return NULL; } +/* Legacy 0.6 compatibility interface */ + +static gboolean +impl_manager_legacy_sleep (NMManager *manager, GError **err) +{ + return impl_manager_sleep (manager, TRUE, err); +} + +static gboolean +impl_manager_legacy_wake (NMManager *manager, GError **err) +{ + return impl_manager_sleep (manager, FALSE, err); +} + +static gboolean +impl_manager_legacy_state (NMManager *manager, GError **err) +{ + return nm_manager_get_state (manager); +} + + /* Connections */ GSList *