libmm-glib,object: `MMObject' is now a real object
Not just a typedef of the gdbus-codegen generated `MmGdbusObject'.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "ModemManager.h"
|
||||
#include <mm-gdbus-manager.h>
|
||||
#include "mm-manager.h"
|
||||
#include "mm-object.h"
|
||||
|
||||
/**
|
||||
* SECTION: mm-manager
|
||||
@@ -67,7 +68,7 @@ get_proxy_type (GDBusObjectManagerClient *manager,
|
||||
GType ret;
|
||||
|
||||
if (interface_name == NULL)
|
||||
return MM_GDBUS_TYPE_OBJECT_PROXY;
|
||||
return MM_TYPE_OBJECT;
|
||||
if (g_once_init_enter (&once_init_value))
|
||||
{
|
||||
lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
+226
-156
@@ -18,13 +18,29 @@
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2011 - 2012 Aleksander Morgado <aleksander@gnu.org>
|
||||
* Copyright (C) Google, Inc.
|
||||
* Copyright (C) 2012 Google, Inc.
|
||||
*/
|
||||
|
||||
#include "mm-object.h"
|
||||
|
||||
/**
|
||||
* mm_object_get_path:
|
||||
* SECTION: mm-object
|
||||
* @title: MMObject
|
||||
* @short_description: Generic object representing a modem in ModemManager
|
||||
*
|
||||
* The #MMObject is a generic object which represents any kind of modem exposed
|
||||
* in ModemManager, and allows accessing the exported interfaces one by one.
|
||||
*
|
||||
* When this object is available, it is ensured that at least the Modem
|
||||
* interface is also available.
|
||||
*/
|
||||
|
||||
G_DEFINE_TYPE (MMObject, mm_object, MM_GDBUS_TYPE_OBJECT_PROXY)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_object_get_path: (skip)
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Gets the DBus path of the #MMObject object.
|
||||
@@ -34,7 +50,7 @@
|
||||
const gchar *
|
||||
mm_object_get_path (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (G_IS_DBUS_OBJECT (self), NULL);
|
||||
g_return_val_if_fail (MM_IS_OBJECT (self), NULL);
|
||||
|
||||
return g_dbus_object_get_object_path (G_DBUS_OBJECT (self));
|
||||
}
|
||||
@@ -52,7 +68,7 @@ mm_object_dup_path (MMObject *self)
|
||||
{
|
||||
gchar *value;
|
||||
|
||||
g_return_val_if_fail (G_IS_DBUS_OBJECT_PROXY (self), NULL);
|
||||
g_return_val_if_fail (MM_IS_OBJECT (self), NULL);
|
||||
|
||||
g_object_get (G_OBJECT (self),
|
||||
"g-object-path", &value,
|
||||
@@ -61,256 +77,310 @@ mm_object_dup_path (MMObject *self)
|
||||
return value;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_object_get_modem:
|
||||
* @object: A #MMModem
|
||||
* @self: A #MMModem
|
||||
*
|
||||
* Gets the #MMModem instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-ModemManager1-Modem.top_of_page">org.freedesktop.ModemManager1.Modem</link> on @object, if any.
|
||||
* Gets the #MMModem instance for the D-Bus interface org.freedesktop.ModemManager1.Modem on @self, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModem that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
|
||||
* Returns: (transfer full): A #MMModem that must be freed with g_object_unref() or %NULL if @self does not implement the interface.
|
||||
*/
|
||||
MMModem *
|
||||
mm_object_get_modem (MMObject *object)
|
||||
mm_object_get_modem (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
MMModem *modem;
|
||||
|
||||
return mm_gdbus_object_get_modem (object);
|
||||
}
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_3gpp:
|
||||
* @object: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModem3gpp instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-ModemManager1-Modem-Modem3gpp.top_of_page">org.freedesktop.ModemManager1.Modem.Modem3gpp</link> on @object, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModem3gpp that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
|
||||
*/
|
||||
MMModem3gpp *
|
||||
mm_object_get_modem_3gpp (MMObject *object)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
|
||||
return mm_gdbus_object_get_modem3gpp (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_3gpp_ussd:
|
||||
* @object: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModem3gppUssd instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-ModemManager1-Modem-Modem3gpp-Ussd.top_of_page">org.freedesktop.ModemManager1.Modem.Modem3gpp-Ussd</link> on @object, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModem3gppUssd that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
|
||||
*/
|
||||
MMModem3gppUssd *
|
||||
mm_object_get_modem_3gpp_ussd (MMObject *object)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
|
||||
return mm_gdbus_object_get_modem3gpp_ussd (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_cdma:
|
||||
* @object: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemCdma instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-ModemManager1-Modem-ModemCdma.top_of_page">org.freedesktop.ModemManager1.Modem.ModemCdma</link> on @object, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemCdma that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
|
||||
*/
|
||||
MMModemCdma *
|
||||
mm_object_get_modem_cdma (MMObject *object)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
|
||||
return mm_gdbus_object_get_modem_cdma (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_simple:
|
||||
* @object: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemSimple instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-ModemManager1-Modem-Modemsimple.top_of_page">org.freedesktop.ModemManager1.Modem.Modemsimple</link> on @object, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemSimple that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
|
||||
*/
|
||||
MMModemSimple *
|
||||
mm_object_get_modem_simple (MMObject *object)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
|
||||
return mm_gdbus_object_get_modem_simple (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_location:
|
||||
* @object: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemLocation instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-ModemManager1-Modem-Modemlocation.top_of_page">org.freedesktop.ModemManager1.Modem.Modemlocation</link> on @object, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemLocation that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
|
||||
*/
|
||||
MMModemLocation *
|
||||
mm_object_get_modem_location (MMObject *object)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
|
||||
return mm_gdbus_object_get_modem_location (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_messaging:
|
||||
* @object: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemMessaging instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-ModemManager1-Modem-Modemmessaging.top_of_page">org.freedesktop.ModemManager1.Modem.Modemmessaging</link> on @object, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemMessaging that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
|
||||
*/
|
||||
MMModemMessaging *
|
||||
mm_object_get_modem_messaging (MMObject *object)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
|
||||
return mm_gdbus_object_get_modem_messaging (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_time:
|
||||
* @object: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemTime instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-ModemManager1-Modem-Time.top_of_page">org.freedesktop.ModemManager1.Modem.Time</link> on @object, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemTime that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
|
||||
*/
|
||||
MMModemTime *
|
||||
mm_object_get_modem_time (MMObject *object)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
|
||||
return mm_gdbus_object_get_modem_time (object);
|
||||
modem = (MMModem *)mm_gdbus_object_get_modem (MM_GDBUS_OBJECT (self));
|
||||
g_warn_if_fail (MM_IS_MODEM (modem));
|
||||
return modem;
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_peek_modem: (skip)
|
||||
* @object: A #MMObject.
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Like mm_object_get_modem() but doesn't increase the reference count on the returned object.
|
||||
*
|
||||
* <warning>It is not safe to use the returned object if you are on another thread than the one where the #MMManager is running.</warning>
|
||||
*
|
||||
* Returns: (transfer none): A #MMModem or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
|
||||
* Returns: (transfer none): A #MMModem or %NULL if @self does not implement the interface. Do not free the returned object, it is owned by @self.
|
||||
*/
|
||||
MMModem *
|
||||
mm_object_peek_modem (MMObject *object)
|
||||
mm_object_peek_modem (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
MMModem *modem;
|
||||
|
||||
return mm_gdbus_object_peek_modem (object);
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
modem = (MMModem *) mm_gdbus_object_peek_modem (MM_GDBUS_OBJECT (self));
|
||||
g_warn_if_fail (MM_IS_MODEM (modem));
|
||||
return modem;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_3gpp:
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModem3gpp instance for the D-Bus interface org.freedesktop.ModemManager1.Modem.Modem3gpp on @self, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModem3gpp that must be freed with g_object_unref() or %NULL if @self does not implement the interface.
|
||||
*/
|
||||
MMModem3gpp *
|
||||
mm_object_get_modem_3gpp (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return (MMModem3gpp *)mm_gdbus_object_get_modem3gpp (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_peek_modem_3gpp: (skip)
|
||||
* @object: A #MMObject.
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Like mm_object_get_modem_3gpp() but doesn't increase the reference count on the returned object.
|
||||
*
|
||||
* <warning>It is not safe to use the returned object if you are on another thread than the one where the #MMManager is running.</warning>
|
||||
*
|
||||
* Returns: (transfer none): A #MMModem3gpp or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
|
||||
* Returns: (transfer none): A #MMModem3gpp or %NULL if @self does not implement the interface. Do not free the returned object, it is owned by @self.
|
||||
*/
|
||||
MMModem3gpp *
|
||||
mm_object_peek_modem_3gpp (MMObject *object)
|
||||
mm_object_peek_modem_3gpp (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return mm_gdbus_object_peek_modem3gpp (object);
|
||||
return (MMModem3gpp *)mm_gdbus_object_peek_modem3gpp (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_3gpp_ussd:
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModem3gppUssd instance for the D-Bus interface org.freedesktop.ModemManager1.Modem.Modem3gpp-Ussd on @self, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModem3gppUssd that must be freed with g_object_unref() or %NULL if @self does not implement the interface.
|
||||
*/
|
||||
MMModem3gppUssd *
|
||||
mm_object_get_modem_3gpp_ussd (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return (MMModem3gppUssd *)mm_gdbus_object_get_modem3gpp_ussd (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_peek_modem_3gpp_ussd: (skip)
|
||||
* @object: A #MMObject.
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Like mm_object_get_modem_3gpp_ussd() but doesn't increase the reference count on the returned object.
|
||||
*
|
||||
* <warning>It is not safe to use the returned object if you are on another thread than the one where the #MMManager is running.</warning>
|
||||
*
|
||||
* Returns: (transfer none): A #MMModem3gppUssd or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
|
||||
* Returns: (transfer none): A #MMModem3gppUssd or %NULL if @self does not implement the interface. Do not free the returned object, it is owned by @self.
|
||||
*/
|
||||
MMModem3gppUssd *
|
||||
mm_object_peek_modem_3gpp_ussd (MMObject *object)
|
||||
mm_object_peek_modem_3gpp_ussd (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return mm_gdbus_object_peek_modem3gpp_ussd (object);
|
||||
return (MMModem3gppUssd *)mm_gdbus_object_peek_modem3gpp_ussd (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_cdma:
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemCdma instance for the D-Bus interface org.freedesktop.ModemManager1.Modem.ModemCdma on @self, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemCdma that must be freed with g_object_unref() or %NULL if @self does not implement the interface.
|
||||
*/
|
||||
MMModemCdma *
|
||||
mm_object_get_modem_cdma (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return (MMModemCdma *)mm_gdbus_object_get_modem_cdma (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_peek_modem_cdma: (skip)
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Like mm_object_get_modem_cdma() but doesn't increase the reference count on the returned object.
|
||||
*
|
||||
* <warning>It is not safe to use the returned object if you are on another thread than the one where the #MMManager is running.</warning>
|
||||
*
|
||||
* Returns: (transfer none): A #MMModemCdma or %NULL if @self does not implement the interface. Do not free the returned object, it is owned by @self.
|
||||
*/
|
||||
MMModemCdma *
|
||||
mm_object_peek_modem_cdma (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return (MMModemCdma *)mm_gdbus_object_peek_modem_cdma (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_simple:
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemSimple instance for the D-Bus interface org.freedesktop.ModemManager1.Modem.Modemsimple on @self, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemSimple that must be freed with g_object_unref() or %NULL if @self does not implement the interface.
|
||||
*/
|
||||
MMModemSimple *
|
||||
mm_object_get_modem_simple (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return (MMModemSimple *)mm_gdbus_object_get_modem_simple (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_peek_modem_simple: (skip)
|
||||
* @object: A #MMObject.
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Like mm_object_get_modem_simple() but doesn't increase the reference count on the returned object.
|
||||
*
|
||||
* <warning>It is not safe to use the returned object if you are on another thread than the one where the #MMManager is running.</warning>
|
||||
*
|
||||
* Returns: (transfer none): A #MMModemSimple or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
|
||||
* Returns: (transfer none): A #MMModemSimple or %NULL if @self does not implement the interface. Do not free the returned object, it is owned by @self.
|
||||
*/
|
||||
MMModemSimple *
|
||||
mm_object_peek_modem_simple (MMObject *object)
|
||||
mm_object_peek_modem_simple (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return mm_gdbus_object_peek_modem_simple (object);
|
||||
return (MMModemSimple *)mm_gdbus_object_peek_modem_simple (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_location:
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemLocation instance for the D-Bus interface org.freedesktop.ModemManager1.Modem.Modemlocation on @self, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemLocation that must be freed with g_object_unref() or %NULL if @self does not implement the interface.
|
||||
*/
|
||||
MMModemLocation *
|
||||
mm_object_get_modem_location (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return (MMModemLocation *)mm_gdbus_object_get_modem_location (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_peek_modem_location: (skip)
|
||||
* @object: A #MMObject.
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Like mm_object_get_modem_location() but doesn't increase the reference count on the returned object.
|
||||
*
|
||||
* <warning>It is not safe to use the returned object if you are on another thread than the one where the #MMManager is running.</warning>
|
||||
*
|
||||
* Returns: (transfer none): A #MMModemLocation or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
|
||||
* Returns: (transfer none): A #MMModemLocation or %NULL if @self does not implement the interface. Do not free the returned object, it is owned by @self.
|
||||
*/
|
||||
MMModemLocation *
|
||||
mm_object_peek_modem_location (MMObject *object)
|
||||
mm_object_peek_modem_location (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return mm_gdbus_object_peek_modem_location (object);
|
||||
return (MMModemLocation *)mm_gdbus_object_peek_modem_location (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_messaging:
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemMessaging instance for the D-Bus interface org.freedesktop.ModemManager1.Modem.Modemmessaging on @self, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemMessaging that must be freed with g_object_unref() or %NULL if @self does not implement the interface.
|
||||
*/
|
||||
MMModemMessaging *
|
||||
mm_object_get_modem_messaging (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return (MMModemMessaging *)mm_gdbus_object_get_modem_messaging (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_peek_modem_messaging: (skip)
|
||||
* @object: A #MMObject.
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Like mm_object_get_modem_messaging() but doesn't increase the reference count on the returned object.
|
||||
*
|
||||
* <warning>It is not safe to use the returned object if you are on another thread than the one where the #MMManager is running.</warning>
|
||||
*
|
||||
* Returns: (transfer none): A #MMModemMessaging or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
|
||||
* Returns: (transfer none): A #MMModemMessaging or %NULL if @self does not implement the interface. Do not free the returned object, it is owned by @self.
|
||||
*/
|
||||
MMModemMessaging *
|
||||
mm_object_peek_modem_messaging (MMObject *object)
|
||||
mm_object_peek_modem_messaging (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return mm_gdbus_object_peek_modem_messaging (object);
|
||||
return (MMModemMessaging *)mm_gdbus_object_peek_modem_messaging (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_object_get_modem_time:
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Gets the #MMModemTime instance for the D-Bus interface org.freedesktop.ModemManager1.Modem.Time on @self, if any.
|
||||
*
|
||||
* Returns: (transfer full): A #MMModemTime that must be freed with g_object_unref() or %NULL if @self does not implement the interface.
|
||||
*/
|
||||
MMModemTime *
|
||||
mm_object_get_modem_time (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return (MMModemTime *)mm_gdbus_object_get_modem_time (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/**
|
||||
* mm_object_peek_modem_time: (skip)
|
||||
* @object: A #MMObject.
|
||||
* @self: A #MMObject.
|
||||
*
|
||||
* Like mm_object_get_modem_time() but doesn't increase the reference count on the returned object.
|
||||
*
|
||||
* <warning>It is not safe to use the returned object if you are on another thread than the one where the #MMManager is running.</warning>
|
||||
*
|
||||
* Returns: (transfer none): A #MMModemTime or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
|
||||
* Returns: (transfer none): A #MMModemTime or %NULL if @self does not implement the interface. Do not free the returned object, it is owned by @self.
|
||||
*/
|
||||
MMModemTime *
|
||||
mm_object_peek_modem_time (MMObject *object)
|
||||
mm_object_peek_modem_time (MMObject *self)
|
||||
{
|
||||
g_return_val_if_fail (MM_GDBUS_IS_OBJECT (object), NULL);
|
||||
g_return_val_if_fail (MM_IS_OBJECT (MM_GDBUS_OBJECT (self)), NULL);
|
||||
|
||||
return mm_gdbus_object_peek_modem_time (object);
|
||||
return (MMModemTime *)mm_gdbus_object_peek_modem_time (MM_GDBUS_OBJECT (self));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
mm_object_init (MMObject *self)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
mm_object_class_init (MMObjectClass *object_class)
|
||||
{
|
||||
}
|
||||
|
||||
+44
-20
@@ -38,31 +38,55 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef MmGdbusObject MMObject;
|
||||
#define MM_TYPE_OBJECT(o) MM_GDBUS_TYPE_OBJECT (o)
|
||||
#define MM_OBJECT(o) MM_GDBUS_OBJECT(o)
|
||||
#define MM_IS_OBJECT(o) MM_GDBUS_IS_OBJECT(o)
|
||||
#define MM_TYPE_OBJECT (mm_object_get_type ())
|
||||
#define MM_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_OBJECT, MMObject))
|
||||
#define MM_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_OBJECT, MMObjectClass))
|
||||
#define MM_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_OBJECT))
|
||||
#define MM_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), MM_TYPE_OBJECT))
|
||||
#define MM_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_OBJECT, MMObjectClass))
|
||||
|
||||
typedef struct _MMObject MMObject;
|
||||
typedef struct _MMObjectClass MMObjectClass;
|
||||
|
||||
/**
|
||||
* MMObject:
|
||||
*
|
||||
* The #MMObject structure contains private data and should only be accessed
|
||||
* using the provided API.
|
||||
*/
|
||||
struct _MMObject {
|
||||
/*< private >*/
|
||||
MmGdbusObjectProxy parent;
|
||||
gpointer unused;
|
||||
};
|
||||
|
||||
struct _MMObjectClass {
|
||||
/*< private >*/
|
||||
MmGdbusObjectProxyClass parent;
|
||||
};
|
||||
|
||||
GType mm_object_get_type (void);
|
||||
|
||||
const gchar *mm_object_get_path (MMObject *self);
|
||||
gchar *mm_object_dup_path (MMObject *self);
|
||||
|
||||
MMModem *mm_object_get_modem (MMObject *object);
|
||||
MMModem3gpp *mm_object_get_modem_3gpp (MMObject *object);
|
||||
MMModem3gppUssd *mm_object_get_modem_3gpp_ussd (MMObject *object);
|
||||
MMModemCdma *mm_object_get_modem_cdma (MMObject *object);
|
||||
MMModemSimple *mm_object_get_modem_simple (MMObject *object);
|
||||
MMModemLocation *mm_object_get_modem_location (MMObject *object);
|
||||
MMModemMessaging *mm_object_get_modem_messaging (MMObject *object);
|
||||
MMModemTime *mm_object_get_modem_time (MMObject *object);
|
||||
MMModem *mm_object_get_modem (MMObject *self);
|
||||
MMModem3gpp *mm_object_get_modem_3gpp (MMObject *self);
|
||||
MMModem3gppUssd *mm_object_get_modem_3gpp_ussd (MMObject *self);
|
||||
MMModemCdma *mm_object_get_modem_cdma (MMObject *self);
|
||||
MMModemSimple *mm_object_get_modem_simple (MMObject *self);
|
||||
MMModemLocation *mm_object_get_modem_location (MMObject *self);
|
||||
MMModemMessaging *mm_object_get_modem_messaging (MMObject *self);
|
||||
MMModemTime *mm_object_get_modem_time (MMObject *self);
|
||||
|
||||
MMModem *mm_object_peek_modem (MMObject *object);
|
||||
MMModem3gpp *mm_object_peek_modem_3gpp (MMObject *object);
|
||||
MMModem3gppUssd *mm_object_peek_modem_3gpp_ussd (MMObject *object);
|
||||
MMModemCdma *mm_object_peek_modem_cdma (MMObject *object);
|
||||
MMModemSimple *mm_object_peek_modem_simple (MMObject *object);
|
||||
MMModemLocation *mm_object_peek_modem_location (MMObject *object);
|
||||
MMModemMessaging *mm_object_peek_modem_messaging (MMObject *object);
|
||||
MMModemTime *mm_object_peek_modem_time (MMObject *object);
|
||||
MMModem *mm_object_peek_modem (MMObject *self);
|
||||
MMModem3gpp *mm_object_peek_modem_3gpp (MMObject *self);
|
||||
MMModem3gppUssd *mm_object_peek_modem_3gpp_ussd (MMObject *self);
|
||||
MMModemCdma *mm_object_peek_modem_cdma (MMObject *self);
|
||||
MMModemSimple *mm_object_peek_modem_simple (MMObject *self);
|
||||
MMModemLocation *mm_object_peek_modem_location (MMObject *self);
|
||||
MMModemMessaging *mm_object_peek_modem_messaging (MMObject *self);
|
||||
MMModemTime *mm_object_peek_modem_time (MMObject *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user