shared-telit: use G_DECLARE|DEFINE_INTERFACE() macros
This commit is contained in:
@@ -30,8 +30,8 @@
|
||||
#include "mm-modem-helpers-telit.h"
|
||||
#include "mm-shared-telit.h"
|
||||
|
||||
static void iface_modem_init (MMIfaceModemInterface *iface);
|
||||
static void shared_telit_init (MMSharedTelit *iface);
|
||||
static void iface_modem_init (MMIfaceModemInterface *iface);
|
||||
static void shared_telit_init (MMSharedTelitInterface *iface);
|
||||
|
||||
static MMIfaceModemInterface *iface_modem_parent;
|
||||
|
||||
@@ -258,7 +258,7 @@ peek_parent_modem_interface (MMSharedTelit *self)
|
||||
}
|
||||
|
||||
static void
|
||||
shared_telit_init (MMSharedTelit *iface)
|
||||
shared_telit_init (MMSharedTelitInterface *iface)
|
||||
{
|
||||
iface->peek_parent_modem_interface = peek_parent_modem_interface;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
static void iface_modem_init (MMIfaceModemInterface *iface);
|
||||
static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface);
|
||||
static void shared_telit_init (MMSharedTelit *iface);
|
||||
static void shared_telit_init (MMSharedTelitInterface *iface);
|
||||
static void iface_modem_location_init (MMIfaceModemLocationInterface *iface);
|
||||
|
||||
static MMIfaceModemInterface *iface_modem_parent;
|
||||
@@ -1592,7 +1592,7 @@ iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface)
|
||||
}
|
||||
|
||||
static void
|
||||
shared_telit_init (MMSharedTelit *iface)
|
||||
shared_telit_init (MMSharedTelitInterface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include "mm-modem-helpers-telit.h"
|
||||
#include "mm-shared-telit.h"
|
||||
|
||||
G_DEFINE_INTERFACE (MMSharedTelit, mm_shared_telit, MM_TYPE_IFACE_MODEM)
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Private data context */
|
||||
|
||||
@@ -113,8 +115,8 @@ get_private (MMSharedTelit *self)
|
||||
if (!priv) {
|
||||
priv = g_slice_new0 (Private);
|
||||
|
||||
if (MM_SHARED_TELIT_GET_INTERFACE (self)->peek_parent_modem_interface)
|
||||
priv->iface_modem_parent = MM_SHARED_TELIT_GET_INTERFACE (self)->peek_parent_modem_interface (self);
|
||||
if (MM_SHARED_TELIT_GET_IFACE (self)->peek_parent_modem_interface)
|
||||
priv->iface_modem_parent = MM_SHARED_TELIT_GET_IFACE (self)->peek_parent_modem_interface (self);
|
||||
|
||||
g_object_set_qdata_full (G_OBJECT (self), private_quark, priv, (GDestroyNotify)private_free);
|
||||
}
|
||||
@@ -792,25 +794,6 @@ mm_shared_telit_modem_load_revision (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
shared_telit_init (gpointer g_iface)
|
||||
mm_shared_telit_default_init (MMSharedTelitInterface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
GType
|
||||
mm_shared_telit_get_type (void)
|
||||
{
|
||||
static GType shared_telit_type = 0;
|
||||
|
||||
if (!G_UNLIKELY (shared_telit_type)) {
|
||||
static const GTypeInfo info = {
|
||||
sizeof (MMSharedTelit), /* class_size */
|
||||
shared_telit_init, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
};
|
||||
|
||||
shared_telit_type = g_type_register_static (G_TYPE_INTERFACE, "MMSharedTelit", &info, 0);
|
||||
g_type_interface_add_prerequisite (shared_telit_type, MM_TYPE_IFACE_MODEM);
|
||||
}
|
||||
|
||||
return shared_telit_type;
|
||||
}
|
||||
|
||||
@@ -27,22 +27,16 @@
|
||||
#include "mm-iface-modem-location.h"
|
||||
#include "mm-modem-helpers-telit.h"
|
||||
|
||||
#define MM_TYPE_SHARED_TELIT (mm_shared_telit_get_type ())
|
||||
#define MM_SHARED_TELIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SHARED_TELIT, MMSharedTelit))
|
||||
#define MM_IS_SHARED_TELIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SHARED_TELIT))
|
||||
#define MM_SHARED_TELIT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_SHARED_TELIT, MMSharedTelit))
|
||||
#define MM_TYPE_SHARED_TELIT mm_shared_telit_get_type ()
|
||||
G_DECLARE_INTERFACE (MMSharedTelit, mm_shared_telit, MM, SHARED_TELIT, MMIfaceModem)
|
||||
|
||||
typedef struct _MMSharedTelit MMSharedTelit;
|
||||
|
||||
struct _MMSharedTelit {
|
||||
struct _MMSharedTelitInterface {
|
||||
GTypeInterface g_iface;
|
||||
|
||||
/* Peek modem interface of the parent class of the object */
|
||||
MMIfaceModemInterface * (* peek_parent_modem_interface) (MMSharedTelit *self);
|
||||
};
|
||||
|
||||
GType mm_shared_telit_get_type (void);
|
||||
|
||||
void mm_shared_telit_store_supported_modes (MMSharedTelit *self,
|
||||
GArray *modes);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user