net-device-simple: Remove GObject boilerplate

Now that NetDeviceSimple is cleaned up, switch to
G_DECLARE_DERIVABLE_TYPE() and remove the old style
GObject boilerplate.
This commit is contained in:
Georges Basile Stavracas Neto 2018-10-31 21:04:29 -03:00
parent f72e6d2012
commit 66ed8916f0
No known key found for this signature in database
GPG key ID: 886C17EE170D1385
2 changed files with 4 additions and 19 deletions

View file

@ -31,11 +31,11 @@
#include "net-device-simple.h" #include "net-device-simple.h"
struct _NetDeviceSimplePrivate typedef struct
{ {
GtkBuilder *builder; GtkBuilder *builder;
gboolean updating_device; gboolean updating_device;
}; } NetDeviceSimplePrivate;
G_DEFINE_TYPE_WITH_PRIVATE (NetDeviceSimple, net_device_simple, NET_TYPE_DEVICE) G_DEFINE_TYPE_WITH_PRIVATE (NetDeviceSimple, net_device_simple, NET_TYPE_DEVICE)

View file

@ -29,21 +29,8 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define NET_TYPE_DEVICE_SIMPLE (net_device_simple_get_type ()) #define NET_TYPE_DEVICE_SIMPLE (net_device_simple_get_type ())
#define NET_DEVICE_SIMPLE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NET_TYPE_DEVICE_SIMPLE, NetDeviceSimple)) G_DECLARE_DERIVABLE_TYPE (NetDeviceSimple, net_device_simple, NET, DEVICE_SIMPLE, NetDevice)
#define NET_DEVICE_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NET_TYPE_DEVICE_SIMPLE, NetDeviceSimpleClass))
#define NET_IS_DEVICE_SIMPLE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), NET_TYPE_DEVICE_SIMPLE))
#define NET_IS_DEVICE_SIMPLE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), NET_TYPE_DEVICE_SIMPLE))
#define NET_DEVICE_SIMPLE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NET_TYPE_DEVICE_SIMPLE, NetDeviceSimpleClass))
typedef struct _NetDeviceSimplePrivate NetDeviceSimplePrivate;
typedef struct _NetDeviceSimple NetDeviceSimple;
typedef struct _NetDeviceSimpleClass NetDeviceSimpleClass;
struct _NetDeviceSimple
{
NetDevice parent;
};
struct _NetDeviceSimpleClass struct _NetDeviceSimpleClass
{ {
@ -52,8 +39,6 @@ struct _NetDeviceSimpleClass
char *(*get_speed) (NetDeviceSimple *device_simple); char *(*get_speed) (NetDeviceSimple *device_simple);
}; };
GType net_device_simple_get_type (void);
char *net_device_simple_get_speed (NetDeviceSimple *device_simple); char *net_device_simple_get_speed (NetDeviceSimple *device_simple);
void net_device_simple_add_row (NetDeviceSimple *device_simple, void net_device_simple_add_row (NetDeviceSimple *device_simple,