diff options
author | Dan Williams <dcbw@redhat.com> | 2011-04-18 22:08:19 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-04-18 22:08:19 -0500 |
commit | 8333fb657ab6e30e51aec8f4449dc4c505fea6f4 (patch) | |
tree | 2aca93c0b471dfb61cd9ae2c001873beed9fede3 /plugins/mm-modem-icera.h | |
parent | 74b1503c602e1268b5199ef36c9611d7cb08adc1 (diff) |
icera: fix abuse of GInterface
The GInterface structure for MMModemIcera isn't instance data, thus we
shouldn't be storing an instance pointer in it. Instead, make implemtors
store the intstance data in their private structure, and have them
implement an accessor for the Icera-private data. This makes everone
(especially GObject) happy. It's a bit of additional indirection, but
we still get to use the MM_MODEM_ICERA_GET_PRIVATE() and we still
get to cast the passed-in GInterface MMModemIcera into the various
GSM MMModem subclasses, which is all we ever wanted anyway.
Diffstat (limited to 'plugins/mm-modem-icera.h')
-rw-r--r-- | plugins/mm-modem-icera.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/mm-modem-icera.h b/plugins/mm-modem-icera.h index 71258d2a..aefa8414 100644 --- a/plugins/mm-modem-icera.h +++ b/plugins/mm-modem-icera.h @@ -37,12 +37,16 @@ typedef struct _MMModemIcera MMModemIcera; struct _MMModemIcera { GTypeInterface g_iface; - MMModemIceraPrivate *priv; + /* Returns the implementing object's pointer to an internal + * MMModemIceraPrivate pointer. + */ + MMModemIceraPrivate * (*get_private) (MMModemIcera *icera); }; GType mm_modem_icera_get_type (void); -void mm_modem_icera_prepare (MMModemIcera *self); +MMModemIceraPrivate *mm_modem_icera_init_private (void); +void mm_modem_icera_dispose_private (MMModemIcera *self); void mm_modem_icera_cleanup (MMModemIcera *self); |