Commit 4d37f7a1 authored by Thomas Haller's avatar Thomas Haller

core: refactor private data in "src"

- use _NM_GET_PRIVATE() and _NM_GET_PRIVATE_PTR() everywhere.

- reorder statements, to have GObject related functions (init, dispose,
  constructed) at the bottom of each file and in a consistent order w.r.t.
  each other.

- unify whitespaces in signal and properties declarations.

- use NM_GOBJECT_PROPERTIES_DEFINE() and _notify()

- drop unused signal slots in class structures

- drop unused header files for device factories
parent 92e9822e
......@@ -24,26 +24,48 @@
#include <gudev/gudev.h>
#include <gmodule.h>
#include "nm-atm-manager.h"
#include "nm-setting-adsl.h"
#include "nm-device-adsl.h"
#include "nm-device-factory.h"
#include "nm-platform.h"
/*****************************************************************************/
#define NM_TYPE_ATM_MANAGER (nm_atm_manager_get_type ())
#define NM_ATM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ATM_MANAGER, NMAtmManager))
#define NM_ATM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_ATM_MANAGER, NMAtmManagerClass))
#define NM_IS_ATM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_ATM_MANAGER))
#define NM_IS_ATM_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_ATM_MANAGER))
#define NM_ATM_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_ATM_MANAGER, NMAtmManagerClass))
typedef struct _NMAtmManager NMAtmManager;
typedef struct _NMAtmManagerClass NMAtmManagerClass;
static GType nm_atm_manager_get_type (void);
/*****************************************************************************/
typedef struct {
GUdevClient *client;
GSList *devices;
} NMAtmManagerPrivate;
#define NM_ATM_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ATM_MANAGER, NMAtmManagerPrivate))
struct _NMAtmManager {
GObject parent;
NMAtmManagerPrivate _priv;
};
static GType nm_atm_manager_get_type (void);
struct _NMAtmManagerClass {
GObjectClass parent;
};
static void device_factory_interface_init (NMDeviceFactoryInterface *factory_iface);
G_DEFINE_TYPE_EXTENDED (NMAtmManager, nm_atm_manager, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_FACTORY, device_factory_interface_init))
#define NM_ATM_MANAGER_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMAtmManager, NM_IS_ATM_MANAGER)
/*****************************************************************************/
G_MODULE_EXPORT NMDeviceFactory *
......@@ -225,23 +247,6 @@ NM_DEVICE_FACTORY_DECLARE_TYPES (
/*****************************************************************************/
static void
nm_atm_manager_init (NMAtmManager *self)
{
NMAtmManagerPrivate *priv = NM_ATM_MANAGER_GET_PRIVATE (self);
const char *subsys[] = { "atm", NULL };
priv->client = g_udev_client_new (subsys);
g_signal_connect (priv->client, "uevent", G_CALLBACK (handle_uevent), self);
}
static void
device_factory_interface_init (NMDeviceFactoryInterface *factory_iface)
{
factory_iface->get_supported_types = get_supported_types;
factory_iface->start = start;
}
static void
dispose (GObject *object)
{
......@@ -249,9 +254,10 @@ dispose (GObject *object)
NMAtmManagerPrivate *priv = NM_ATM_MANAGER_GET_PRIVATE (self);
GSList *iter;
if (priv->client)
if (priv->client) {
g_signal_handlers_disconnect_by_func (priv->client, handle_uevent, self);
g_clear_object (&priv->client);
g_clear_object (&priv->client);
}
for (iter = priv->devices; iter; iter = iter->next)
g_object_weak_unref (G_OBJECT (iter->data), device_destroyed, self);
......@@ -265,8 +271,24 @@ nm_atm_manager_class_init (NMAtmManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (NMAtmManagerPrivate));
/* virtual methods */
object_class->dispose = dispose;
}
/*****************************************************************************/
static void
nm_atm_manager_init (NMAtmManager *self)
{
NMAtmManagerPrivate *priv = NM_ATM_MANAGER_GET_PRIVATE (self);
const char *subsys[] = { "atm", NULL };
priv->client = g_udev_client_new (subsys);
g_signal_connect (priv->client, "uevent", G_CALLBACK (handle_uevent), self);
}
static void
device_factory_interface_init (NMDeviceFactoryInterface *factory_iface)
{
factory_iface->get_supported_types = get_supported_types;
factory_iface->start = start;
}
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager -- Network link manager
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2007 - 2008 Novell, Inc.
* Copyright (C) 2007 - 2014 Red Hat, Inc.
*/
#ifndef __NETWORKMANAGER_ATM_MANAGER_H__
#define __NETWORKMANAGER_ATM_MANAGER_H__
#define NM_TYPE_ATM_MANAGER (nm_atm_manager_get_type ())
#define NM_ATM_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ATM_MANAGER, NMAtmManager))
typedef struct {
GObject parent;
} NMAtmManager;
typedef struct {
GObjectClass parent;
} NMAtmManagerClass;
#endif /* __NETWORKMANAGER_ATM_MANAGER_H__ */
......@@ -20,24 +20,23 @@
#include "nm-default.h"
#include "nm-device-adsl.h"
#include <sys/socket.h>
#include <linux/atmdev.h>
#include <linux/atmbr2684.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include "nm-device-adsl.h"
#include "nm-device-private.h"
#include "nm-enum-types.h"
#include "nm-platform.h"
#include "ppp-manager/nm-ppp-manager.h"
#include "ppp-manager/nm-ppp-status.h"
#include "nm-setting-adsl.h"
#include "nm-utils.h"
......@@ -46,18 +45,11 @@
#include "nm-device-logging.h"
_LOG_DECLARE_SELF (NMDeviceAdsl);
G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE)
#define NM_DEVICE_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_ADSL, NMDeviceAdslPrivate))
/*****************************************************************************/
enum {
PROP_0,
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
PROP_ATM_INDEX,
LAST_PROP
};
/*****************************************************************************/
);
typedef struct {
guint carrier_poll_id;
......@@ -74,6 +66,19 @@ typedef struct {
guint nas_update_count;
} NMDeviceAdslPrivate;
struct _NMDeviceAdsl {
NMDevice parent;
NMDeviceAdslPrivate _priv;
};
struct _NMDeviceAdslClass {
NMDeviceClass parent;
};
G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE)
#define NM_DEVICE_ADSL_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMDeviceAdsl, NM_IS_DEVICE_ADSL)
/*****************************************************************************/
static NMDeviceCapabilities
......@@ -547,57 +552,13 @@ carrier_update_cb (gpointer user_data)
/*****************************************************************************/
NMDevice *
nm_device_adsl_new (const char *udi,
const char *iface,
const char *driver,
int atm_index)
{
g_return_val_if_fail (udi != NULL, NULL);
g_return_val_if_fail (atm_index >= 0, NULL);
return (NMDevice *) g_object_new (NM_TYPE_DEVICE_ADSL,
NM_DEVICE_UDI, udi,
NM_DEVICE_IFACE, iface,
NM_DEVICE_DRIVER, driver,
NM_DEVICE_ADSL_ATM_INDEX, atm_index,
NM_DEVICE_TYPE_DESC, "ADSL",
NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_ADSL,
NULL);
}
static void
constructed (GObject *object)
{
NMDeviceAdsl *self = NM_DEVICE_ADSL (object);
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE (self);
G_OBJECT_CLASS (nm_device_adsl_parent_class)->constructed (object);
priv->carrier_poll_id = g_timeout_add_seconds (5, carrier_update_cb, self);
_LOGD (LOGD_ADSL, "ATM device index %d", priv->atm_index);
g_return_if_fail (priv->atm_index >= 0);
}
static void
dispose (GObject *object)
{
adsl_cleanup (NM_DEVICE_ADSL (object));
nm_clear_g_source (&NM_DEVICE_ADSL_GET_PRIVATE (object)->carrier_poll_id);
G_OBJECT_CLASS (nm_device_adsl_parent_class)->dispose (object);
}
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
switch (prop_id) {
case PROP_ATM_INDEX:
g_value_set_int (value, NM_DEVICE_ADSL_GET_PRIVATE (object)->atm_index);
g_value_set_int (value, NM_DEVICE_ADSL_GET_PRIVATE ((NMDeviceAdsl *) object)->atm_index);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -612,7 +573,7 @@ set_property (GObject *object, guint prop_id,
switch (prop_id) {
case PROP_ATM_INDEX:
/* construct only */
NM_DEVICE_ADSL_GET_PRIVATE (object)->atm_index = g_value_get_int (value);
NM_DEVICE_ADSL_GET_PRIVATE ((NMDeviceAdsl *) object)->atm_index = g_value_get_int (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -620,19 +581,63 @@ set_property (GObject *object, guint prop_id,
}
}
/*****************************************************************************/
static void
nm_device_adsl_init (NMDeviceAdsl *self)
{
}
static void
constructed (GObject *object)
{
NMDeviceAdsl *self = NM_DEVICE_ADSL (object);
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE (self);
G_OBJECT_CLASS (nm_device_adsl_parent_class)->constructed (object);
priv->carrier_poll_id = g_timeout_add_seconds (5, carrier_update_cb, self);
_LOGD (LOGD_ADSL, "ATM device index %d", priv->atm_index);
g_return_if_fail (priv->atm_index >= 0);
}
NMDevice *
nm_device_adsl_new (const char *udi,
const char *iface,
const char *driver,
int atm_index)
{
g_return_val_if_fail (udi != NULL, NULL);
g_return_val_if_fail (atm_index >= 0, NULL);
return (NMDevice *) g_object_new (NM_TYPE_DEVICE_ADSL,
NM_DEVICE_UDI, udi,
NM_DEVICE_IFACE, iface,
NM_DEVICE_DRIVER, driver,
NM_DEVICE_ADSL_ATM_INDEX, atm_index,
NM_DEVICE_TYPE_DESC, "ADSL",
NM_DEVICE_DEVICE_TYPE, NM_DEVICE_TYPE_ADSL,
NULL);
}
static void
dispose (GObject *object)
{
adsl_cleanup (NM_DEVICE_ADSL (object));
nm_clear_g_source (&NM_DEVICE_ADSL_GET_PRIVATE ((NMDeviceAdsl *) object)->carrier_poll_id);
G_OBJECT_CLASS (nm_device_adsl_parent_class)->dispose (object);
}
static void
nm_device_adsl_class_init (NMDeviceAdslClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
NMDeviceClass *parent_class = NM_DEVICE_CLASS (klass);
g_type_class_add_private (object_class, sizeof (NMDeviceAdslPrivate));
object_class->constructed = constructed;
object_class->dispose = dispose;
object_class->get_property = get_property;
......@@ -647,13 +652,13 @@ nm_device_adsl_class_init (NMDeviceAdslClass *klass)
parent_class->act_stage3_ip4_config_start = act_stage3_ip4_config_start;
parent_class->deactivate = deactivate;
/* properties */
g_object_class_install_property
(object_class, PROP_ATM_INDEX,
g_param_spec_int (NM_DEVICE_ADSL_ATM_INDEX, "", "",
-1, G_MAXINT, -1,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
obj_properties[PROP_ATM_INDEX] =
g_param_spec_int (NM_DEVICE_ADSL_ATM_INDEX, "", "",
-1, G_MAXINT, -1,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_ADSL_SKELETON,
......
......@@ -22,7 +22,6 @@
#ifndef __NETWORKMANAGER_DEVICE_ADSL_H__
#define __NETWORKMANAGER_DEVICE_ADSL_H__
// Parent class
#include "nm-device.h"
#define NM_TYPE_DEVICE_ADSL (nm_device_adsl_get_type ())
......@@ -34,13 +33,8 @@
#define NM_DEVICE_ADSL_ATM_INDEX "atm-index"
typedef struct {
NMDevice parent;
} NMDeviceAdsl;
typedef struct {
NMDeviceClass parent;
} NMDeviceAdslClass;
typedef struct _NMDeviceAdsl NMDeviceAdsl;
typedef struct _NMDeviceAdslClass NMDeviceAdslClass;
GType nm_device_adsl_get_type (void);
......
......@@ -33,7 +33,6 @@ SYMBOL_VIS_FILE=$(srcdir)/exports.ver
libnm_device_plugin_bluetooth_la_SOURCES = \
nm-bluez-manager.c \
nm-bluez-manager.h \
nm-bluez-common.h \
nm-bluez-device.c \
nm-bluez-device.h \
......
......@@ -39,5 +39,6 @@
#define BLUEZ4_SERIAL_INTERFACE "org.bluez.Serial"
#define BLUEZ4_NETWORK_INTERFACE "org.bluez.Network"
#endif /* NM_BLUEZ_COMMON_H */
#define NM_BLUEZ_MANAGER_BDADDR_ADDED "bdaddr-added"
#endif /* NM_BLUEZ_COMMON_H */
This diff is collapsed.
......@@ -41,18 +41,8 @@
/* Signals */
#define NM_BLUEZ_DEVICE_REMOVED "removed"
typedef struct {
GObject parent;
} NMBluezDevice;
typedef struct {
GObjectClass parent;
/* virtual functions */
void (*initialized) (NMBluezDevice *self, gboolean success);
void (*removed) (NMBluezDevice *self);
} NMBluezDeviceClass;
typedef struct _NMBluezDevice NMBluezDevice;
typedef struct _NMBluezDeviceClass NMBluezDeviceClass;
GType nm_bluez_device_get_type (void);
......
......@@ -20,8 +20,6 @@
#include "nm-default.h"
#include "nm-bluez-manager.h"
#include <signal.h>
#include <string.h>
#include <stdlib.h>
......@@ -39,15 +37,21 @@
#include "nm-platform.h"
#include "nm-dbus-compat.h"
#define _NMLOG_DOMAIN LOGD_BT
#define _NMLOG_PREFIX_NAME "bluez"
#define _NMLOG(level, ...) \
G_STMT_START { \
nm_log ((level), _NMLOG_DOMAIN, \
"%s" _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
_NMLOG_PREFIX_NAME": " \
_NM_UTILS_MACRO_REST(__VA_ARGS__)); \
} G_STMT_END
/*****************************************************************************/
#define NM_TYPE_BLUEZ_MANAGER (nm_bluez_manager_get_type ())
#define NM_BLUEZ_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_BLUEZ_MANAGER, NMBluezManager))
#define NM_BLUEZ_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_BLUEZ_MANAGER, NMBluezManagerClass))
#define NM_IS_BLUEZ_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_BLUEZ_MANAGER))
#define NM_IS_BLUEZ_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_BLUEZ_MANAGER))
#define NM_BLUEZ_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_BLUEZ_MANAGER, NMBluezManagerClass))
typedef struct _NMBluezManager NMBluezManager;
typedef struct _NMBluezManagerClass NMBluezManagerClass;
static GType nm_bluez_manager_get_type (void);
/*****************************************************************************/
typedef struct {
int bluez_version;
......@@ -62,24 +66,37 @@ typedef struct {
GCancellable *async_cancellable;
} NMBluezManagerPrivate;
#define NM_BLUEZ_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_BLUEZ_MANAGER, NMBluezManagerPrivate))
struct _NMBluezManager {
GObject parent;
NMBluezManagerPrivate _priv;
};
static GType nm_bluez_manager_get_type (void);
struct _NMBluezManagerClass {
GObjectClass parent;
};
static void device_factory_interface_init (NMDeviceFactoryInterface *factory_iface);
G_DEFINE_TYPE_EXTENDED (NMBluezManager, nm_bluez_manager, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_FACTORY, device_factory_interface_init))
static void check_bluez_and_try_setup (NMBluezManager *self);
#define NM_BLUEZ_MANAGER_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMBluezManager, NM_IS_BLUEZ_MANAGER)
/*****************************************************************************/
G_MODULE_EXPORT NMDeviceFactory *
nm_device_factory_create (GError **error)
{
return (NMDeviceFactory *) g_object_new (NM_TYPE_BLUEZ_MANAGER, NULL);
}
#define _NMLOG_DOMAIN LOGD_BT
#define _NMLOG_PREFIX_NAME "bluez"
#define _NMLOG(level, ...) \
G_STMT_START { \
nm_log ((level), _NMLOG_DOMAIN, \
"%s" _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
_NMLOG_PREFIX_NAME": " \
_NM_UTILS_MACRO_REST(__VA_ARGS__)); \
} G_STMT_END
/*****************************************************************************/
static void check_bluez_and_try_setup (NMBluezManager *self);
/*****************************************************************************/
......@@ -382,6 +399,18 @@ start (NMDeviceFactory *factory)
check_bluez_and_try_setup (NM_BLUEZ_MANAGER (factory));
}
static NMDevice *
create_device (NMDeviceFactory *factory,
const char *iface,
const NMPlatformLink *plink,
NMConnection *connection,
gboolean *out_ignore)
{
g_warn_if_fail (plink->type == NM_LINK_TYPE_BNEP);
*out_ignore = TRUE;
return NULL;
}
NM_DEVICE_FACTORY_DECLARE_TYPES (
NM_DEVICE_FACTORY_DECLARE_LINK_TYPES (NM_LINK_TYPE_BNEP)
NM_DEVICE_FACTORY_DECLARE_SETTING_TYPES (NM_SETTING_BLUETOOTH_SETTING_NAME)
......@@ -389,6 +418,14 @@ NM_DEVICE_FACTORY_DECLARE_TYPES (
/*****************************************************************************/
static void
nm_bluez_manager_init (NMBluezManager *self)
{
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self);
priv->settings = g_object_ref (NM_SETTINGS_GET);
}
static void
dispose (GObject *object)
{
......@@ -414,23 +451,11 @@ dispose (GObject *object)
}
static void
nm_bluez_manager_init (NMBluezManager *self)
nm_bluez_manager_class_init (NMBluezManagerClass *klass)
{
NMBluezManagerPrivate *priv = NM_BLUEZ_MANAGER_GET_PRIVATE (self);
priv->settings = g_object_ref (NM_SETTINGS_GET);
}
GObjectClass *object_class = G_OBJECT_CLASS (klass);
static NMDevice *
create_device (NMDeviceFactory *factory,
const char *iface,
const NMPlatformLink *plink,
NMConnection *connection,
gboolean *out_ignore)
{
g_warn_if_fail (plink->type == NM_LINK_TYPE_BNEP);
*out_ignore = TRUE;
return NULL;
object_class->dispose = dispose;
}
static void
......@@ -441,14 +466,10 @@ device_factory_interface_init (NMDeviceFactoryInterface *factory_iface)
factory_iface->start = start;
}
static void
nm_bluez_manager_class_init (NMBluezManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (NMBluezManagerPrivate));
/*****************************************************************************/
/* virtual methods */
object_class->dispose = dispose;
G_MODULE_EXPORT NMDeviceFactory *
nm_device_factory_create (GError **error)
{
return (NMDeviceFactory *) g_object_new (NM_TYPE_BLUEZ_MANAGER, NULL);
}
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager -- Network link manager
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2007 - 2008 Novell, Inc.
* Copyright (C) 2007 - 2014 Red Hat, Inc.
*/
#ifndef __NETWORKMANAGER_BLUEZ_MANAGER_H__
#define __NETWORKMANAGER_BLUEZ_MANAGER_H__
#define NM_TYPE_BLUEZ_MANAGER (nm_bluez_manager_get_type ())
#define NM_BLUEZ_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_BLUEZ_MANAGER, NMBluezManager))
#define NM_BLUEZ_MANAGER_BDADDR_ADDED "bdaddr-added"
typedef struct {
GObject parent;
} NMBluezManager;
typedef struct {
GObjectClass parent;
} NMBluezManagerClass;
#endif /* __NETWORKMANAGER_BLUEZ_MANAGER_H__ */
......@@ -30,9 +30,21 @@
#include "nm-core-internal.h"
#include "nm-settings.h"
G_DEFINE_TYPE (NMBluez4Adapter, nm_bluez4_adapter, G_TYPE_OBJECT)
/*****************************************************************************/
#define NM_BLUEZ4_ADAPTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_BLUEZ4_ADAPTER, NMBluez4AdapterPrivate))
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
PROP_PATH,
PROP_ADDRESS,
);
enum {
INITIALIZED,
DEVICE_ADDED,
DEVICE_REMOVED,
LAST_SIGNAL,
};
static guint signals[LAST_SIGNAL] = { 0 };
typedef struct {
char *path;
......@@ -46,26 +58,25 @@ typedef struct {
NMSettings *settings;
} NMBluez4AdapterPrivate;
enum {
PROP_0,
PROP_PATH,
PROP_ADDRESS,
LAST_PROP