net-device-wifi: Turn into a final class
Remove the old style GObject boilerplate and replace it by G_DECLARE_FINAL_TYPE(). Move the NetDeviceWifi structure definition to the .c file too.
This commit is contained in:
parent
e1dcf21979
commit
0ce486ecb5
2 changed files with 8 additions and 22 deletions
|
@ -52,7 +52,7 @@ static void show_wifi_list (NetDeviceWifi *device_wifi);
|
|||
static void populate_ap_list (NetDeviceWifi *device_wifi);
|
||||
static void show_hotspot_ui (NetDeviceWifi *device_wifi);
|
||||
|
||||
struct _NetDeviceWifiPrivate
|
||||
typedef struct
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *details_dialog;
|
||||
|
@ -63,6 +63,12 @@ struct _NetDeviceWifiPrivate
|
|||
gchar *selected_ap_id;
|
||||
guint scan_id;
|
||||
GCancellable *cancellable;
|
||||
} NetDeviceWifiPrivate;
|
||||
|
||||
struct _NetDeviceWifi
|
||||
{
|
||||
NetDevice parent;
|
||||
NetDeviceWifiPrivate *priv;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (NetDeviceWifi, net_device_wifi, NET_TYPE_DEVICE)
|
||||
|
|
|
@ -29,28 +29,8 @@
|
|||
G_BEGIN_DECLS
|
||||
|
||||
#define NET_TYPE_DEVICE_WIFI (net_device_wifi_get_type ())
|
||||
#define NET_DEVICE_WIFI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NET_TYPE_DEVICE_WIFI, NetDeviceWifi))
|
||||
#define NET_DEVICE_WIFI_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NET_TYPE_DEVICE_WIFI, NetDeviceWifiClass))
|
||||
#define NET_IS_DEVICE_WIFI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NET_TYPE_DEVICE_WIFI))
|
||||
#define NET_IS_DEVICE_WIFI_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NET_TYPE_DEVICE_WIFI))
|
||||
#define NET_DEVICE_WIFI_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NET_TYPE_DEVICE_WIFI, NetDeviceWifiClass))
|
||||
G_DECLARE_FINAL_TYPE (NetDeviceWifi, net_device_wifi, NET, DEVICE_WIFI, NetDevice)
|
||||
|
||||
typedef struct _NetDeviceWifiPrivate NetDeviceWifiPrivate;
|
||||
typedef struct _NetDeviceWifi NetDeviceWifi;
|
||||
typedef struct _NetDeviceWifiClass NetDeviceWifiClass;
|
||||
|
||||
struct _NetDeviceWifi
|
||||
{
|
||||
NetDevice parent;
|
||||
NetDeviceWifiPrivate *priv;
|
||||
};
|
||||
|
||||
struct _NetDeviceWifiClass
|
||||
{
|
||||
NetDeviceClass parent_class;
|
||||
};
|
||||
|
||||
GType net_device_wifi_get_type (void) G_GNUC_CONST;
|
||||
GtkWidget *net_device_wifi_get_header_widget (NetDeviceWifi *device_wifi);
|
||||
GtkWidget *net_device_wifi_get_title_widget (NetDeviceWifi *device_wifi);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue