diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-04-27 14:14:44 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-05-12 12:40:16 +0200 |
commit | 28d3db1f6ef2481ddeb40bb3b141b3f68070a1dc (patch) | |
tree | d918e221699a76e0898bea781cf82e0ef74a7d3b | |
parent | 55b12c5bf85c2cbee872f9ab39568843336826f9 (diff) |
Move TpProxyFeature as public API (#31583)
-rw-r--r-- | docs/reference/telepathy-glib-sections.txt | 2 | ||||
-rw-r--r-- | telepathy-glib/proxy-internal.h | 26 | ||||
-rw-r--r-- | telepathy-glib/proxy.c | 32 | ||||
-rw-r--r-- | telepathy-glib/proxy.h | 26 |
4 files changed, 56 insertions, 30 deletions
diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt index f6b15414..723d1d59 100644 --- a/docs/reference/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib-sections.txt @@ -2940,6 +2940,7 @@ tp_iface_quark_connection_interface_service_point <TITLE>proxy</TITLE> <INCLUDE>telepathy-glib/proxy.h</INCLUDE> TpProxy +TpProxyPrepareAsync TpProxyFeature TpProxyClassFeatureListFunc TpProxyClass @@ -2973,6 +2974,7 @@ TP_IS_PROXY_CLASS TP_PROXY TP_PROXY_CLASS TP_PROXY_GET_CLASS +TpProxyFeaturePrivate </SECTION> <SECTION> diff --git a/telepathy-glib/proxy-internal.h b/telepathy-glib/proxy-internal.h index 775779ff..4fce531f 100644 --- a/telepathy-glib/proxy-internal.h +++ b/telepathy-glib/proxy-internal.h @@ -27,32 +27,6 @@ GError *_tp_proxy_take_and_remap_error (TpProxy *self, GError *error) typedef void (*TpProxyProc) (TpProxy *); -typedef void (* TpProxyPrepareAsync) (TpProxy *proxy, - const TpProxyFeature *feature, - GAsyncReadyCallback callback, - gpointer user_data); - -typedef struct _TpProxyFeaturePrivate TpProxyFeaturePrivate; - -struct _TpProxyFeature { - /*<public>*/ - GQuark name; - gboolean core; - - TpProxyPrepareAsync prepare_async; - TpProxyPrepareAsync prepare_before_signalling_connected_async; - - const GQuark *interfaces_needed; - /* Features we depend on */ - const GQuark *depends_on; - - gboolean can_retry; - - /*<private>*/ - GCallback _reserved[4]; - TpProxyFeaturePrivate *priv; -}; - gboolean _tp_proxy_is_preparing (gpointer self, GQuark feature); void _tp_proxy_set_feature_prepared (TpProxy *self, diff --git a/telepathy-glib/proxy.c b/telepathy-glib/proxy.c index 7be78d10..b64e9190 100644 --- a/telepathy-glib/proxy.c +++ b/telepathy-glib/proxy.c @@ -208,10 +208,36 @@ tp_dbus_errors_quark (void) */ /** + * TpProxyPrepareAsync: + * @proxy: the object on which @feature has to be prepared + * @feature: a #GQuark representing the feature to prepare + * @callback: called when the feature has been prepared, or the preparation + * failed + * @user_data: data to pass to @callback + * + * Function called when @feature has to be prepared for @proxy. + */ + +/** * TpProxyFeature: - * - * Structure representing a feature. This is currently opaque to code outside - * telepathy-glib itself. + * @name: a #GQuark representing the name of the feature + * @core: if %TRUE, every non-core feature of the class depends on this one, + * and every feature (core or not) in subclasses depends on this one + * @prepare_async: called when the feature has to be prepared + * @prepare_before_signalling_connected_async: only relevant for + * TpConnection sub-classes; same as @prepare_async but for + * features wanting to have a chance to prepare themself before the + * TpConnection object announce its %TP_CONNECTION_STATUS_CONNECTED status + * @interfaces_needed: an array of #GQuark representing interfaces which have + * to be implemented on the object in order to be able to prepare the feature + * @depends_on: an array of #GQuark representing other features which have to + * be prepared before trying to prepare this feature + * @can_retry: If %TRUE, allow retrying preparation of this feature even if it + * failed once already; if %FALSE any attempt of preparing the feature after + * the preparation already failed once will immediately fail with re-calling + * @prepare_async + * + * Structure representing a feature. * * Since: 0.11.3 */ diff --git a/telepathy-glib/proxy.h b/telepathy-glib/proxy.h index 0f350d8d..8b0cdfb3 100644 --- a/telepathy-glib/proxy.h +++ b/telepathy-glib/proxy.h @@ -71,8 +71,32 @@ struct _TpProxy { typedef struct _TpProxyClass TpProxyClass; -/* defined in proxy-internal.h for now */ typedef struct _TpProxyFeature TpProxyFeature; +typedef struct _TpProxyFeaturePrivate TpProxyFeaturePrivate; + +typedef void (* TpProxyPrepareAsync) (TpProxy *proxy, + const TpProxyFeature *feature, + GAsyncReadyCallback callback, + gpointer user_data); + +struct _TpProxyFeature { + /*<public>*/ + GQuark name; + gboolean core; + + TpProxyPrepareAsync prepare_async; + TpProxyPrepareAsync prepare_before_signalling_connected_async; + + const GQuark *interfaces_needed; + /* Features we depend on */ + const GQuark *depends_on; + + gboolean can_retry; + + /*<private>*/ + GCallback _reserved[4]; + TpProxyFeaturePrivate *priv; +}; /* XXX: hide this from the g-i scanner, since vapigen can't cope */ #ifndef __GI_SCANNER__ |