Commit 0b7aad2e authored by Álvaro Peña's avatar Álvaro Peña

Fixed coments for introspection

parent 79ac2c43
......@@ -6,7 +6,9 @@ lib_sources = \
gfbgraph-goa-authorizer.c \
gfbgraph-node.c \
gfbgraph-photo.c \
gfbgraph-simple-authorizer.c \
gfbgraph-user.c
lib_headers = \
gfbgraph.h \
gfbgraph-album.h \
......@@ -16,6 +18,7 @@ lib_headers = \
gfbgraph-goa-authorizer.h \
gfbgraph-node.h \
gfbgraph-photo.h \
gfbgraph-simple-authorizer.h \
gfbgraph-user.h
lib_LTLIBRARIES = libgfbgraph-@API_VERSION@.la
......@@ -44,7 +47,7 @@ libgfbgraph_@API_VERSION@_ladir = $(includedir)/gfbgraph-@API_VERSION@/gfbgraph
# Introspection
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
if HAVE_INTROSPECTION
......@@ -54,10 +57,11 @@ GFBGraph-@API_VERSION@.gir: libgfbgraph-@API_VERSION@.la Makefile
GFBGraph_@API_MAJOR@_@API_MINOR@_gir_INCLUDES = \
GLib-2.0 \
Gio-2.0 \
GObject-2.0 \
Rest-0.7 \
Json-1.0 \
Gio-2.0 \
Soup-2.4
GFBGraph_@API_MAJOR@_@API_MINOR@_gir_CFLAGS = \
......@@ -72,11 +76,10 @@ GFBGraph_@API_MAJOR@_@API_MINOR@_gir_LIBS = libgfbgraph-@API_VERSION@.la
GFBGraph_@API_MAJOR@_@API_MINOR@_gir_FILES = $(lib_sources) $(lib_headers)
GFBGraph_@API_MAJOR@_@API_MINOR@_gir_NAMESPACE = GFBGraph
GFBGraph_@API_MAJOR@_@API_MINOR@_gir_EXPORT_PACKAGES = libgfbgraph.@API_VERSION@
GFBGraph_@API_MAJOR@_@API_MINOR@_gir_SCANNER_FLAGS = \
--warn-all \
GFBGraph_@API_MAJOR@_@API_MINOR@_gir_SCANNERFLAGS = \
--nsversion=$(API_VERSION) \
--symbol-prefix=gfbgraph \
--identifier-prefix = GFBGraph \
--identifier-prefix=GFBGraph \
--c-include="gfbgraph/gfbgraph.h"
INTROSPECTION_GIRS += GFBGraph-@API_VERSION@.gir
......
......@@ -86,7 +86,7 @@ gfbgraph_album_class_init (GFBGraphAlbumClass *klass)
g_type_class_add_private (gobject_class, sizeof(GFBGraphAlbumPrivate));
/**
* GFBGraphAlbum:name
* GFBGraphAlbum:name:
*
* The album name.
**/
......@@ -98,7 +98,7 @@ gfbgraph_album_class_init (GFBGraphAlbumClass *klass)
G_PARAM_READABLE | G_PARAM_WRITABLE));
/**
* GFBGraphAlbum:description.
* GFBGraphAlbum:description:
*
* The album description given by the owner.
**/
......@@ -110,7 +110,7 @@ gfbgraph_album_class_init (GFBGraphAlbumClass *klass)
G_PARAM_READABLE | G_PARAM_WRITABLE));
/**
* GFBGraphAlbum:cover_photo.
* GFBGraphAlbum:cover_photo:
*
* The node ID for the album cover photo. It's an ID for a #GFBGraphPhoto node.
**/
......@@ -122,7 +122,7 @@ gfbgraph_album_class_init (GFBGraphAlbumClass *klass)
G_PARAM_READABLE | G_PARAM_WRITABLE));
/**
* GFBGraphAlbum:count
* GFBGraphAlbum:count:
*
* The number of photos in the album.
**/
......@@ -234,7 +234,7 @@ gfbgraph_album_get_connection_post_params (GFBGraphConnectable *self, GType node
*
* Creates a new #GFBGraphAlbum.
*
* Returns: a new #GFBGraphAlbum; unref with g_object_unref()
* Returns: (transfer full): a new #GFBGraphAlbum; unref with g_object_unref()
**/
GFBGraphAlbum*
gfbgraph_album_new (void)
......@@ -250,7 +250,7 @@ gfbgraph_album_new (void)
*
* Retrieves an album node from the Facebook Graph with the give ID.
*
* Returns: a new #GFBGraphAlbum; unref with g_object_unref()
* Returns: (transfer full): a new #GFBGraphAlbum; unref with g_object_unref()
**/
GFBGraphAlbum*
gfbgraph_album_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GError **error)
......
......@@ -39,6 +39,7 @@ typedef struct _GFBGraphAlbumPrivate GFBGraphAlbumPrivate;
struct _GFBGraphAlbum {
GFBGraphNode parent;
/*< private >*/
GFBGraphAlbumPrivate *priv;
};
......
......@@ -30,7 +30,7 @@
* Create a new #RestProxyCall pointing to the Facebook Graph API url (https://graph.facebook.com)
* and processed by the authorizer to allow queries.
*
* Returns: a new #RestProxyCall or %NULL in case of error.
* Returns: (transfer full): a new #RestProxyCall or %NULL in case of error.
**/
RestProxyCall*
gfbgraph_new_rest_call (GFBGraphAuthorizer *authorizer)
......
......@@ -70,7 +70,7 @@ get_connections (GFBGraphConnectableInterface *iface)
* Get the params to be inserted in a request to the Facebook Graph API
* in order to append the node @self to a node of type @node_type.
*
* Returns: A string based #GHashTable with the params and his values or %NULL.
* Returns: (transfer full): A string based #GHashTable with the params and his values or %NULL.
**/
GHashTable*
gfbgraph_connectable_get_connection_post_params (GFBGraphConnectable *self, GType node_type)
......@@ -96,7 +96,7 @@ gfbgraph_connectable_get_connection_post_params (GFBGraphConnectable *self, GTyp
* Parse the response contained in @payload when a gfbgraph_node_get_connection_nodes() was
* executed.
*
* Returns: a #GList of #GFBGraphNode created from the @payload or %NULL.
* Returns: (transfer full): a #GList of #GFBGraphNode created from the @payload or %NULL.
**/
GList*
gfbgraph_connectable_parse_connected_data (GFBGraphConnectable *self, const gchar *payload, GError **error)
......@@ -146,7 +146,7 @@ gfbgraph_connectable_is_connectable_to (GFBGraphConnectable *self, GType node_ty
* Get the Facebook Graph API function path to retrieve the nodes connected with @node_type
* managed by the #GFBGraphConnectable object.
*
* Returns: a const #gchar with the function path or %NULL.
* Returns: (transfer none): a const #gchar with the function path or %NULL.
**/
const gchar*
gfbgraph_connectable_get_connection_path (GFBGraphConnectable *self, GType node_type)
......@@ -177,7 +177,7 @@ gfbgraph_connectable_get_connection_path (GFBGraphConnectable *self, GType node_
* Normally, Facebook Graph API returns the connections in the same way, using JSON objects,
* with a root object called "data".
*
* Returns: a #GList of #GFBGraphNode with the same #GType as @self.
* Returns: (transfer full): a #GList of #GFBGraphNode with the same #GType as @self.
**/
GList*
gfbgraph_connectable_default_parse_connected_data (GFBGraphConnectable *self, const gchar *payload, GError **error)
......
......@@ -242,7 +242,7 @@ gfbgraph_goa_authorizer_set_goa_object (GFBGraphGoaAuthorizer *self, GoaObject *
*
* Creates a new #GFBGraphGoaAuthorizer using @goa_object as account.
*
* Returns: A new #GFBGraphGoaAuthorizer. Use g_object_unref() to free it.
* Returns: (transfer full): A new #GFBGraphGoaAuthorizer. Use g_object_unref() to free it.
*/
GFBGraphGoaAuthorizer*
gfbgraph_goa_authorizer_new (GoaObject *goa_object)
......
......@@ -39,6 +39,7 @@ typedef struct _GFBGraphGoaAuthorizerPrivate GFBGraphGoaAuthorizerPrivate;
struct _GFBGraphGoaAuthorizer {
GObject parent;
/*< private >*/
GFBGraphGoaAuthorizerPrivate *priv;
};
......
......@@ -92,7 +92,7 @@ gfbgraph_node_class_init (GFBGraphNodeClass *klass)
g_type_class_add_private (gobject_class, sizeof(GFBGraphNodePrivate));
/**
* GFBGraphNode:id
* GFBGraphNode:id:
*
* The node ID. All nodes have one of this.
**/
......@@ -187,7 +187,7 @@ gfbgraph_node_get_connection_nodes_async_thread (GSimpleAsyncResult *simple_asyn
*
* Creates a new #GFBGraphNode.
*
* Return value: a new #GFBGraphNode; unref with g_object_unref()
* Returns: (transfer full): a new #GFBGraphNode; unref with g_object_unref()
**/
GFBGraphNode*
gfbgraph_node_new (void)
......@@ -204,10 +204,10 @@ gfbgraph_node_new (void)
*
* Retrieve a node object as a #GFBgraphNode of #node_type type, with the given @id from the Facebook Graph.
*
* Returns: a #GFBGraphNode or %NULL.
* Returns: (transfer full): a #GFBGraphNode or %NULL.
**/
GFBGraphNode*
gfbgraph_node_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GType node_type, GError **error)
gfbgraph_node_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GType node_type, GError **error)
{
GFBGraphNode *node;
RestProxyCall *rest_call;
......@@ -244,13 +244,13 @@ GFBGraphNode*
* @node: a #GFBGraphNode object which retrieve the connected nodes.
* @node_type: a #GFBGraphNode type #GType that determines the kind of nodes to retrieve.
* @authorizer: a #GFBGraphAuthorizer.
* @error: (allow-none) a #GError or %NULL.
* @error: (allow-none): a #GError or %NULL.
*
* Retrieve the nodes of type @node_type connected to the @node object. The @node_type object must
* implement the #GFBGraphConnectionable interface and be connectable to @node type object.
* See gfbgraph_node_get_connection_nodes_async() for the asynchronous version of this call.
*
* Returns: a #GList of type @node_type objects with the found nodes.
* Returns: (transfer full): a #GList of type @node_type objects with the found nodes.
**/
GList*
gfbgraph_node_get_connection_nodes (GFBGraphNode *node, GType node_type, GFBGraphAuthorizer *authorizer, GError **error)
......@@ -315,7 +315,7 @@ gfbgraph_node_get_connection_nodes (GFBGraphNode *node, GType node_type, GFBGrap
* @authorizer: a #GFBGraphAuthorizer.
* @cancellable: (allow-none): An optional #GCancellable object, or %NULL.
* @callback: (scope async): A #GAsyncReadyCallback to call when the request is completed.
* @user_data: (closure); The data to pass to @callback.
* @user_data: (closure): The data to pass to @callback.
*
* Asynchronously retrieve the list of nodes of type @node_type connected to the @node object. See
* gfbgraph_node_get_connection_nodes() for the synchronous version of this call.
......@@ -357,7 +357,7 @@ gfbgraph_node_get_connection_nodes_async (GFBGraphNode *node, GType node_type, G
* Finishes an asynchronous operation started with
* gfbgraph_node_get_connection_nodes_async().
*
* Returns: a #GList of type #node_type objects with the found nodes.
* Returns: (transfer full): a #GList of type #node_type objects with the found nodes.
**/
GList*
gfbgraph_node_get_connection_nodes_async_finish (GFBGraphNode *node, GAsyncResult *result, GError **error)
......
......@@ -41,6 +41,7 @@ typedef struct _GFBGraphNodePrivate GFBGraphNodePrivate;
struct _GFBGraphNode {
GObject parent;
/*< private >*/
GFBGraphNodePrivate *priv;
};
......
......@@ -86,7 +86,7 @@ gfbgraph_photo_class_init (GFBGraphPhotoClass *klass)
g_type_class_add_private (gobject_class, sizeof(GFBGraphPhotoPrivate));
/**
* GFBGraphPhoto:name
* GFBGraphPhoto:name:
*
* The name of the photo given by his owner.
**/
......@@ -98,7 +98,7 @@ gfbgraph_photo_class_init (GFBGraphPhotoClass *klass)
G_PARAM_READABLE | G_PARAM_WRITABLE));
/**
* GFBGraphPhoto:source
* GFBGraphPhoto:source:
*
* An URI for the photo, with a maximum width or height of 720px.
**/
......@@ -110,7 +110,7 @@ gfbgraph_photo_class_init (GFBGraphPhotoClass *klass)
G_PARAM_READABLE | G_PARAM_WRITABLE));
/**
* GFBGraphPhoto:width
* GFBGraphPhoto:width:
*
* The default photo width, up to 720px.
**/
......@@ -122,7 +122,7 @@ gfbgraph_photo_class_init (GFBGraphPhotoClass *klass)
G_PARAM_READABLE | G_PARAM_WRITABLE));
/**
* GFBGraphPhoto:height
* GFBGraphPhoto:height:
*
* The default photo height, up to 720px.
**/
......@@ -225,11 +225,11 @@ gfbgraph_photo_get_connection_post_params (GFBGraphConnectable *self, GType node
}
/**
* gfbgraph_photo_new()
* gfbgraph_photo_new:
*
* Creates a new #GFBGraphPhoto.
*
* Returns: a new #GFBGraphPhoto; unref with g_object_unref()
* Returns: (transfer full): a new #GFBGraphPhoto; unref with g_object_unref()
**/
GFBGraphPhoto*
gfbgraph_photo_new (void)
......@@ -245,7 +245,7 @@ gfbgraph_photo_new (void)
*
* Retrieves an photo node from the Facebook Graph with the give ID.
*
* Returns: a new #GFBGraphPhoto; unref with g_object_unref()
* Returns: (transfer full): a new #GFBGraphPhoto; unref with g_object_unref()
**/
GFBGraphPhoto*
gfbgraph_photo_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GError **error)
......@@ -263,7 +263,7 @@ gfbgraph_photo_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GEr
* Download the default sized photo pointed by @photo, with a maximum width or height of 720px.
* The photo always is a JPEG.
*
* Returns: a #GInputStream with the photo content or %NULL in case of error.
* Returns: (transfer full): a #GInputStream with the photo content or %NULL in case of error.
**/
GInputStream*
gfbgraph_photo_download_default_size (GFBGraphPhoto *photo, GFBGraphAuthorizer *authorizer, GError **error)
......
......@@ -39,6 +39,7 @@ typedef struct _GFBGraphPhotoPrivate GFBGraphPhotoPrivate;
struct _GFBGraphPhoto {
GFBGraphNode parent;
/*< private >*/
GFBGraphPhotoPrivate *priv;
};
......
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- */
/*
* libgfbgraph - GObject library for Facebook Graph API
* Copyright (C) 2013 Álvaro Peña <alvaropg@gmail.com>
*
* This library is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* libgfbgraph is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* SECTION:gfbgraph-simple-authorizer
* @short_description: GFBGraph simple authorization interface
* @stability: Unstable
* @include: gfbgraph/gfbgraph-simple-authorizer.h
*
* #GFBGraphSimpleAuthorizer provides an implementation of the #GFBGraphAuthorizer interface
* for authorization using a access token provided in creation time, no refresh, just a simple
* authorizer for test purposes, don't use in final code.
**/
#include "gfbgraph-authorizer.h"
#include "gfbgraph-simple-authorizer.h"
#include "credentials.h"
#include <gfbgraph/gfbgraph-authorizer.h>
enum
{
PROP_0,
PROP_ACCESS_TOKEN
};
struct _GFBGraphSimpleAuthorizerPrivate {
GMutex mutex;
gchar *access_token;
};
static void gfbgraph_simple_authorizer_init (GFBGraphSimpleAuthorizer *obj);
static void gfbgraph_simple_authorizer_class_init (GFBGraphSimpleAuthorizerClass *klass);
static void gfbgraph_simple_authorizer_finalize (GObject *obj);
static void gfbgraph_simple_authorizer_init (GFBGraphSimpleAuthorizer *obj);
static void gfbgraph_simple_authorizer_class_init (GFBGraphSimpleAuthorizerClass *klass);
static void gfbgraph_simple_authorizer_finalize (GObject *obj);
static void gfbgraph_simple_authorizer_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gfbgraph_simple_authorizer_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static void gfbgraph_simple_authorizer_iface_init (GFBGraphAuthorizerInterface *iface);
......@@ -39,8 +77,23 @@ gfbgraph_simple_authorizer_class_init (GFBGraphSimpleAuthorizerClass *klass)
parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = gfbgraph_simple_authorizer_finalize;
gobject_class->set_property = gfbgraph_simple_authorizer_set_property;
gobject_class->get_property = gfbgraph_simple_authorizer_get_property;
g_type_class_add_private (gobject_class, sizeof(GFBGraphSimpleAuthorizerPrivate));
/**
* GFBGraphSimpleAuthorizer:access_token:
*
* The access token for the Facebook Graph API, normally, take it by hand in the
* Graph API explorer tool: https://developers.facebook.com/tools/explorer.
**/
g_object_class_install_property (gobject_class,
PROP_ACCESS_TOKEN,
g_param_spec_string ("access_token",
"The access token", "The access token for the Facebook Graph API.",
"",
G_PARAM_READABLE | G_PARAM_WRITABLE));
}
static void
......@@ -49,6 +102,42 @@ gfbgraph_simple_authorizer_finalize (GObject *obj)
G_OBJECT_CLASS(parent_class)->finalize (obj);
}
static void
gfbgraph_simple_authorizer_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GFBGraphSimpleAuthorizerPrivate *priv;
priv = GFBGRAPH_SIMPLE_AUTHORIZER_GET_PRIVATE (object);
switch (prop_id) {
case PROP_ACCESS_TOKEN:
if (priv->access_token)
g_free (priv->access_token);
priv->access_token = g_strdup (g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gfbgraph_simple_authorizer_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GFBGraphSimpleAuthorizerPrivate *priv;
priv = GFBGRAPH_SIMPLE_AUTHORIZER_GET_PRIVATE (object);
switch (prop_id) {
case PROP_ACCESS_TOKEN:
g_value_set_string (value, priv->access_token);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gfbgraph_simple_authorizer_iface_init (GFBGraphAuthorizerInterface *iface)
{
......@@ -65,7 +154,7 @@ gfbgraph_simple_authorizer_process_call (GFBGraphAuthorizer *iface, RestProxyCal
priv = GFBGRAPH_SIMPLE_AUTHORIZER_GET_PRIVATE (GFBGRAPH_SIMPLE_AUTHORIZER (iface));
g_mutex_lock (&priv->mutex);
rest_proxy_call_add_param (call, "access_token", GFBGRAPH_TEST_ACCESS_TOKEN);
rest_proxy_call_add_param (call, "access_token", priv->access_token);
g_mutex_unlock (&priv->mutex);
}
......@@ -81,7 +170,7 @@ gfbgraph_simple_authorizer_process_message (GFBGraphAuthorizer *iface, SoupMessa
g_mutex_lock (&priv->mutex);
uri = soup_message_get_uri (message);
auth_value = g_strconcat ("access_token=", GFBGRAPH_TEST_ACCESS_TOKEN, NULL);
auth_value = g_strconcat ("access_token=", priv->access_token, NULL);
soup_uri_set_query (uri, auth_value);
g_free (auth_value);
......@@ -95,8 +184,17 @@ gfbgraph_simple_authorizer_refresh_authorization (GFBGraphAuthorizer *iface, GCa
return FALSE;
}
/**
* gfbgraph_simple_authorizer_new:
* @access_token: a const @gchar.
*
* Creates a new #GFBGraphAuthorizer to use with the GFBGraph library using the @access_token as access token.
* It's only a test authorizer, don't use in final code.
*
* Returns: (transfer full): a #GFBGraphSimpleAuthorizer.
**/
GFBGraphSimpleAuthorizer*
gfbgraph_simple_authorizer_new (void)
gfbgraph_simple_authorizer_new (const gchar *access_token)
{
return GFBGRAPH_SIMPLE_AUTHORIZER (g_object_new (GFBGRAPH_TYPE_SIMPLE_AUTHORIZER, NULL));
return GFBGRAPH_SIMPLE_AUTHORIZER (g_object_new (GFBGRAPH_TYPE_SIMPLE_AUTHORIZER, "access_token", access_token));
}
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- */
/*
* libgfbgraph - GObject library for Facebook Graph API
* Copyright (C) 2013 Álvaro Peña <alvaropg@gmail.com>
*
* This library is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* libgfbgraph is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GFBGRAPH_SIMPLE_AUTHORIZER_H__
#define __GFBGRAPH_SIMPLE_AUTHORIZER_H__
......@@ -5,7 +24,6 @@
G_BEGIN_DECLS
/* convenience macros */
#define GFBGRAPH_TYPE_SIMPLE_AUTHORIZER (gfbgraph_simple_authorizer_get_type())
#define GFBGRAPH_SIMPLE_AUTHORIZER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GFBGRAPH_TYPE_SIMPLE_AUTHORIZER,GFBGraphSimpleAuthorizer))
#define GFBGRAPH_SIMPLE_AUTHORIZER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GFBGRAPH_TYPE_SIMPLE_AUTHORIZER,GFBGraphSimpleAuthorizerClass))
......@@ -20,6 +38,7 @@ typedef struct _GFBGraphSimpleAuthorizerPrivate GFBGraphSimpleAuthorizerPrivate;
struct _GFBGraphSimpleAuthorizer {
GObject parent;
/*< private >*/
GFBGraphSimpleAuthorizerPrivate *priv;
};
......@@ -28,7 +47,7 @@ struct _GFBGraphSimpleAuthorizerClass {
};
GType gfbgraph_simple_authorizer_get_type (void) G_GNUC_CONST;
GFBGraphSimpleAuthorizer* gfbgraph_simple_authorizer_new (void);
GFBGraphSimpleAuthorizer* gfbgraph_simple_authorizer_new (const gchar *access_token);
G_END_DECLS
......
......@@ -91,7 +91,7 @@ gfbgraph_user_class_init (GFBGraphUserClass *klass)
g_type_class_add_private (gobject_class, sizeof(GFBGraphUserPrivate));
/**
* GFBGraphUser:name
* GFBGraphUser:name:
*
* The full name of the user
**/
......@@ -210,7 +210,7 @@ gfbgraph_user_new (void)
*
* Retrieves a user from the Facebook Graph with the give ID.
*
* Returns: a new #GFBGraphUser; unref with g_object_unref()
* Returns: (transfer full): a new #GFBGraphUser; unref with g_object_unref()
**/
GFBGraphUser*
gfbgraph_user_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GError **error)
......@@ -226,7 +226,7 @@ gfbgraph_user_new_from_id (GFBGraphAuthorizer *authorizer, const gchar *id, GErr
* Retrieve the current user logged using the https://graph.facebook.com/me Graph API function.
* See gfbgraph_user_get_my_async() for the asynchronous version of this call.
*
* Returns: a #GFBGraphUser with the current user information.
* Returns: (transfer full): a #GFBGraphUser with the current user information.
**/
GFBGraphUser*
gfbgraph_user_get_me (GFBGraphAuthorizer *authorizer, GError **error)
......@@ -306,7 +306,7 @@ gfbgraph_user_get_me_async (GFBGraphAuthorizer *authorizer, GCancellable *cancel
* Finishes an asynchronous operation started with
* gfbgraph_user_get_me_async().
*
* Returns: a #GFBGraphUser for to the current user logged.
* Returns: (transfer full): a #GFBGraphUser for to the current user logged.
**/
GFBGraphUser*
gfbgraph_user_get_me_async_finish (GFBGraphAuthorizer *authorizer, GAsyncResult *result, GError **error)
......@@ -334,7 +334,7 @@ gfbgraph_user_get_me_async_finish (GFBGraphAuthorizer *authorizer, GAsyncResult
*
* Retrieve the albums nodes owned by the @user. This functions call the function ID/albums.
*
* Returns: a #GList with the albums nodes (#GFBGraphAlbums) owned by the given user.
* Returns: (transfer full): a #GList with the albums nodes (#GFBGraphAlbums) owned by the given user.
**/
GList*
gfbgraph_user_get_albums (GFBGraphUser *user, GFBGraphAuthorizer *authorizer, GError **error)
......@@ -393,7 +393,7 @@ gfbgraph_user_get_albums_async (GFBGraphUser *user, GFBGraphAuthorizer *authoriz
* Finishes an asynchronous operation started with
* gfbgraph_user_get_albums_async().
*
* Returns: a #GList of #GFBGraphAlbums owned by the @user.
* Returns: (transfer full): a #GList of #GFBGraphAlbums owned by the @user.
**/
GList*
gfbgraph_user_get_albums_async_finish (GFBGraphUser *user, GAsyncResult *result, GError **error)
......
......@@ -41,6 +41,7 @@ typedef struct _GFBGraphUserPrivate GFBGraphUserPrivate;
struct _GFBGraphUser {
GFBGraphNode parent;
/*< private >*/
GFBGraphUserPrivate *priv;
};
......
TESTS = gtestutils test test-async
COMMON_SRC = credentials.h gfbgraph-simple-authorizer.h gfbgraph-simple-authorizer.c
COMMON_SRC = credentials.h
AM_CPPFLAGS = -I$(top_srcdir) $(LIBGFBGRAPH_CFLAGS)
AM_LDFLAGS = $(top_srcdir)/gfbgraph/libgfbgraph-@API_VERSION@.la $(LIBGFBGRAPH_LIBS)
......
#define GFBGRAPH_TEST_CLIENT_ID ""
#define GFBGRAPH_TEST_ACCESS_TOKEN ""
#define GFBGRAPH_TEST_ACCESS_TOKEN "CAACTgyJojTcBAJelKI3WZCsI665G4qUjZCSSZCvgEW2l311UYYxn6WOWPZBYAOQUljOwOsEIUKE1xAUKndnPqZAp27f0srnZA59jCwu45HTo4Y3u7ZCLJIGmVDZCcZAB5uch7QM4Qp9ANomSEUDgsLkjkdlFm6CYA8sYZD"
#include "config.h"
#include "credentials.h"
#include <glib.h>
#include <gfbgraph/gfbgraph.h>
#include <gfbgraph/gfbgraph-simple-authorizer.h>
#include "gfbgraph-simple-authorizer.h"
int
main (int argc, char **argv)
......@@ -12,7 +13,7 @@ main (int argc, char **argv)
g_type_init ();
g_test_init (&argc, &argv, NULL);
authorizer = gfbgraph_simple_authorizer_new ();
authorizer = gfbgraph_simple_authorizer_new (GFBGRAPH_TEST_ACCESS_TOKEN);
//g_test_add_data_func ("/GInstapaper/Bookmarks/List", proxy, (GTestDataFunc) ginstapaper_test_bookmarks_list);
......
#include <gfbgraph/gfbgraph.h>
#include "gfbgraph-simple-authorizer.h"
#include <gfbgraph/gfbgraph-simple-authorizer.h>
#include "credentials.h"
static GMainLoop *main_loop;
......@@ -104,7 +105,7 @@ main (int argc, char **argv)
g_type_init ();
main_loop = g_main_loop_new (NULL, TRUE);
authorizer = gfbgraph_simple_authorizer_new ();
authorizer = gfbgraph_simple_authorizer_new (GFBGRAPH_TEST_ACCESS_TOKEN);
/* Get "me" user */
gfbgraph_user_get_me_async (GFBGRAPH_AUTHORIZER (authorizer), NULL, (GAsyncReadyCallback) me_async_cb, NULL);
......
#include <gfbgraph/gfbgraph.h>
#include "gfbgraph-simple-authorizer.h"
#include <gfbgraph/gfbgraph-simple-authorizer.h>
#include "credentials.h"
int
main (int argc, char **argv)
......@@ -12,7 +13,7 @@ main (int argc, char **argv)
g_type_init ();
authorizer = gfbgraph_simple_authorizer_new ();
authorizer = gfbgraph_simple_authorizer_new (GFBGRAPH_TEST_ACCESS_TOKEN);
/* Get "me" user */
me = gfbgraph_user_get_me (GFBGRAPH_AUTHORIZER (authorizer), &error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment