diff options
author | Günther Wagner <info@gunibert.de> | 2021-12-22 23:14:51 +0100 |
---|---|---|
committer | Günther Wagner <info@gunibert.de> | 2022-01-12 19:45:23 +0100 |
commit | 6698699242508f40fee8079ecf8e8bbc8a493fbf (patch) | |
tree | 0ed2cc1b13538eeb933f9c539f3f2aed6a897c61 /rest-extras/flickr-proxy.h | |
parent | 64a7444adc6d811733582462c1ae89f9d9526531 (diff) | |
download | librest-6698699242508f40fee8079ecf8e8bbc8a493fbf.tar.gz |
flickr: modernized
Diffstat (limited to 'rest-extras/flickr-proxy.h')
-rw-r--r-- | rest-extras/flickr-proxy.h | 93 |
1 files changed, 30 insertions, 63 deletions
diff --git a/rest-extras/flickr-proxy.h b/rest-extras/flickr-proxy.h index 5cff622..bc13149 100644 --- a/rest-extras/flickr-proxy.h +++ b/rest-extras/flickr-proxy.h @@ -4,6 +4,7 @@ * * Authors: Rob Bradford <rob@linux.intel.com> * Ross Burton <ross@linux.intel.com> + * Günther Wagner <info@gunibert.de> * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU Lesser General Public License, @@ -20,81 +21,47 @@ * */ -#ifndef _FLICKR_PROXY -#define _FLICKR_PROXY +#pragma once #include <rest/rest-proxy.h> #include <rest/rest-xml-parser.h> G_BEGIN_DECLS +#define FLICKR_PROXY_ERROR flickr_proxy_error_quark() #define FLICKR_TYPE_PROXY flickr_proxy_get_type() -#define FLICKR_PROXY(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLICKR_TYPE_PROXY, FlickrProxy)) - -#define FLICKR_PROXY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), FLICKR_TYPE_PROXY, FlickrProxyClass)) - -#define FLICKR_IS_PROXY(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLICKR_TYPE_PROXY)) - -#define FLICKR_IS_PROXY_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), FLICKR_TYPE_PROXY)) +G_DECLARE_DERIVABLE_TYPE (FlickrProxy, flickr_proxy, FLICKR, PROXY, RestProxy) -#define FLICKR_PROXY_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), FLICKR_TYPE_PROXY, FlickrProxyClass)) - -typedef struct _FlickrProxyPrivate FlickrProxyPrivate; - -/** - * FlickrProxy: - * - * #FlickrProxy has no publicly available members. - */ -typedef struct { - RestProxy parent; - FlickrProxyPrivate *priv; -} FlickrProxy; - -typedef struct { +struct _FlickrProxyClass { RestProxyClass parent_class; + /*< private >*/ /* padding for future expansion */ gpointer _padding_dummy[8]; -} FlickrProxyClass; - -#define FLICKR_PROXY_ERROR flickr_proxy_error_quark() - -GType flickr_proxy_get_type (void); - -RestProxy* flickr_proxy_new (const char *api_key, - const char *shared_secret); - -RestProxy* flickr_proxy_new_with_token (const char *api_key, - const char *shared_secret, - const char *token); - -const char * flickr_proxy_get_api_key (FlickrProxy *proxy); - -const char * flickr_proxy_get_shared_secret (FlickrProxy *proxy); - -const char * flickr_proxy_get_token (FlickrProxy *proxy); - -void flickr_proxy_set_token (FlickrProxy *proxy, const char *token); - -char * flickr_proxy_sign (FlickrProxy *proxy, GHashTable *params); - -char * flickr_proxy_build_login_url (FlickrProxy *proxy, - const char *frob, - const char *perms); - -gboolean flickr_proxy_is_successful (RestXmlNode *root, GError **error); - -RestProxyCall * flickr_proxy_new_upload (FlickrProxy *proxy); - -RestProxyCall * flickr_proxy_new_upload_for_file (FlickrProxy *proxy, const char *filename, GError **error); +}; + + +RestProxy *flickr_proxy_new (const char *api_key, + const char *shared_secret); +RestProxy *flickr_proxy_new_with_token (const char *api_key, + const char *shared_secret, + const char *token); +const char *flickr_proxy_get_api_key (FlickrProxy *proxy); +const char *flickr_proxy_get_shared_secret (FlickrProxy *proxy); +const char *flickr_proxy_get_token (FlickrProxy *proxy); +void flickr_proxy_set_token (FlickrProxy *proxy, + const char *token); +char *flickr_proxy_sign (FlickrProxy *proxy, + GHashTable *params); +char *flickr_proxy_build_login_url (FlickrProxy *proxy, + const char *frob, + const char *perms); +gboolean flickr_proxy_is_successful (RestXmlNode *root, + GError **error); +RestProxyCall *flickr_proxy_new_upload (FlickrProxy *proxy); +RestProxyCall *flickr_proxy_new_upload_for_file (FlickrProxy *proxy, + const char *filename, + GError **error); G_END_DECLS - -#endif /* _FLICKR_PROXY */ |