Top |
TpProxy subclasses and mixinsTpProxy subclasses and mixins — Providing extra functionality for a TpProxy or subclass, or subclassing it |
The implementations of TpProxy subclasses and "mixin" functions need access to the underlying GDBus objects used to implement the TpProxy API.
Mixin functions to implement particular D-Bus interfaces should usually be auto-generated, by copying tools/glib-client-gen.py from telepathy-glib.
void tp_proxy_add_interface_by_id (TpProxy *self
,GQuark iface
);
Declare that this proxy supports a given interface.
To use methods and signals of that interface, use the tp_cli_* wrapper functions or GDBus.
If the interface is the proxy's "main interface", or has already been added, then do nothing.
self |
the TpProxy, which must not have become “invalidated”. |
|
iface |
quark representing the interface to be added |
Since 0.7.1
void tp_proxy_add_interfaces (TpProxy *self
,const gchar * const *interfaces
);
Declare that this proxy supports the given interfaces. Equivalent to calling
g_quark_from_string()
followed by tp_proxy_add_interface_by_id()
for each
of the interface names.
self |
the TpProxy, which must not have become “invalidated”. |
|
interfaces |
the names of the interfaces to be added |
Since 0.14.4
gboolean tp_proxy_check_interface_by_id (gpointer proxy
,GQuark iface
,GError **error
);
Return whether this proxy is known to have a particular interface, by its quark ID.
proxy |
the TpProxy (or subclass) |
|
iface |
quark representing the D-Bus interface required |
|
error |
used to raise an error in the TP_DBUS_ERRORS domain if |
void tp_proxy_invalidate (TpProxy *self
,const GError *error
);
Mark self
as having been invalidated - no further calls will work, and
if not already invalidated, the “invalidated” signal will be emitted
with the given error.
Since 0.7.1
void (*TpProxyWrapperFunc) (TpProxy *self
,const GError *error
,GVariant *args
,GCallback callback
,gpointer user_data
,GObject *weak_object
);
A simplified reinvention of GClosureMarshal for TpProxy subclasses. Functions with this signature are intended to be programmatically-generated; there should be no need to use it in hand-written code, other than the implementation of TpProxy.
TpProxyPendingCall * tp_proxy_pending_call_v1_new (TpProxy *self
,gint timeout_ms
,GQuark iface
,const gchar *member
,GVariant *args
,const GVariantType *reply_type
,TpProxyWrapperFunc wrapper
,GCallback callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
Make a D-Bus call. If it is not cancelled, call wrapper
when it completes.
The wrapper
will usually call callback
, but is not required to do so.
If the call is cancelled with tp_proxy_pending_call_cancel()
or by
finalization of the weak_object
, then wrapper
is not called at all,
but destroy
will still be called.
This function is intended to be called by generated code. If possible,
use g_dbus_connection_call()
or g_dbus_proxy_call()
instead.
self |
the proxy |
|
timeout_ms |
the timeout in milliseconds, usually -1 to use a default |
|
iface |
a quark representing the D-Bus interface name |
|
member |
the method name |
|
args |
arguments for the call; if this is a floating reference, this
method will take ownership as if via |
|
reply_type |
the expected type of the reply, which must be a tuple type |
|
wrapper |
a wrapper function to call when the call completes,
or |
[allow-none] |
callback |
callback to pass to the wrapper function. If it
is non- |
[allow-none] |
user_data |
user data to pass to the wrapper function. |
[allow-none] |
destroy |
callback to destroy |
[allow-none] |
weak_object |
object to pass to the wrapper function; if this
object is finalized before the call completes, |
[allow-none] |
TpProxySignalConnection * tp_proxy_signal_connection_v1_new (TpProxy *self
,GQuark iface
,const gchar *member
,const GVariantType *expected_types
,TpProxyWrapperFunc wrapper
,GCallback callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
,GError **error
);
Allocate a new structure representing a signal connection, and connect to
the signal, arranging for wrapper
to be called when it arrives.
This function is for use by TpProxy subclass implementations only, and should usually only be called from code generated by tools/glib-client-gen.py.
self |
a proxy |
|
iface |
a quark whose string value is the D-Bus interface |
|
member |
the name of the signal to which we're connecting |
|
expected_types |
an array of expected GTypes for the arguments, terminated
by |
|
wrapper |
a function which will be called with |
|
callback |
user callback to be invoked by |
|
user_data |
user-supplied data for the callback |
|
destroy |
user-supplied destructor for the data, which will be called when the signal connection is disconnected for any reason, or will be called before this function returns if an error occurs |
|
weak_object |
if not |
|
error |
a signal connection structure, or NULL
if the proxy does not
have the desired interface or has become invalid
Since 0.7.1