2007-02-05 Tambet Ingo <tambet@ximian.com>
Make NMDevice abstract class, remove almost all references to it's subclasses (the last place gets removed with new policy manager). Add NMDeviceInterface (which NMDevice implements) so that when we have NMDevice exported over DBUS, there's a common NMDevice interface which all instances have, plus there's a device specific interface for each specific type. Remove functions (nm_device_is_802_3_ethernet) and (nm_device_is_802_11_wireless). There are already standard GObject macros for type safe checks. Use the updated supplican manager API. * src/nm-device-interface.h: * src/nm-device-interface.c: * src/nm-call-store.h: * src/nm-call-store.c: Implement. * src/supplicant-manager/nm-supplicant-interface.c: * src/supplicant-manager/nm-supplicant-interface.h: * src/supplicant-manager/nm-supplicant-manager.c: * src/supplicant-manager/nm-supplicant-manager.h: - Remove all private data type references from public header files. - Remove all references to other NM classes, this class is just a proxy between wpa_supplicant and NM so it doesn't have to know any internals. - Convert to dbus-glib bindings. - Type safe checks for public methods' arguments. - Store pending DBUS call ids to NMCallStore. * src/supplicant-manager/nm-supplicant-config.c: - Store config values in a GHashTable instead of GSList. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2285 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
55
src/nm-device-interface.h
Normal file
55
src/nm-device-interface.h
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
#ifndef NM_DEVICE_INTERFACE_H
|
||||
#define NM_DEVICE_INTERFACE_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "NetworkManager.h"
|
||||
|
||||
#define NM_TYPE_DEVICE_INTERFACE (nm_device_interface_get_type ())
|
||||
#define NM_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_INTERFACE, NmDeviceInterface))
|
||||
#define NM_IS_DEVICE_INTERFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_INTERFACE))
|
||||
#define NM_DEVICE_INTERFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_DEVICE_INTERFACE, NMDeviceInterface))
|
||||
|
||||
|
||||
#define NM_DEVICE_INTERFACE_UDI "udi"
|
||||
#define NM_DEVICE_INTERFACE_IFACE "interface"
|
||||
#define NM_DEVICE_INTERFACE_DRIVER "driver"
|
||||
#define NM_DEVICE_INTERFACE_CAPABILITIES "capabilities"
|
||||
#define NM_DEVICE_INTERFACE_IP4_ADDRESS "ip4_address"
|
||||
#define NM_DEVICE_INTERFACE_USE_DHCP "use_dhcp"
|
||||
#define NM_DEVICE_INTERFACE_STATE "state"
|
||||
#define NM_DEVICE_INTERFACE_APP_DATA "app_data" /* Ugh */
|
||||
#define NM_DEVICE_INTERFACE_DEVICE_TYPE "device_type" /* ugh */
|
||||
|
||||
typedef enum {
|
||||
NM_DEVICE_INTERFACE_PROP_FIRST = 0x1000,
|
||||
|
||||
NM_DEVICE_INTERFACE_PROP_UDI = NM_DEVICE_INTERFACE_PROP_FIRST,
|
||||
NM_DEVICE_INTERFACE_PROP_IFACE,
|
||||
NM_DEVICE_INTERFACE_PROP_DRIVER,
|
||||
NM_DEVICE_INTERFACE_PROP_CAPABILITIES,
|
||||
NM_DEVICE_INTERFACE_PROP_IP4_ADDRESS,
|
||||
NM_DEVICE_INTERFACE_PROP_USE_DHCP,
|
||||
NM_DEVICE_INTERFACE_PROP_STATE,
|
||||
NM_DEVICE_INTERFACE_PROP_APP_DATA,
|
||||
NM_DEVICE_INTERFACE_PROP_DEVICE_TYPE
|
||||
} NMDeviceInterfaceProp;
|
||||
|
||||
|
||||
typedef struct _NMDeviceInterface NMDeviceInterface;
|
||||
|
||||
struct _NMDeviceInterface {
|
||||
GTypeInterface g_iface;
|
||||
|
||||
/* Methods */
|
||||
void (*deactivate) (NMDeviceInterface *device);
|
||||
|
||||
/* Signals */
|
||||
void (*state_changed) (NMDeviceInterface *device, NMDeviceState state);
|
||||
void (*carrier_changed) (NMDeviceInterface *device, gboolean carrier_on);
|
||||
};
|
||||
|
||||
GType nm_device_interface_get_type (void);
|
||||
|
||||
|
||||
#endif /* NM_DEVICE_INTERFACE_H */
|
Reference in New Issue
Block a user