[gvfs/wip/goa: 3/3] Add GVfsBackendGoogle



commit c1207cd2ec00a5d54b2e26be34decfb9fca574ac
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Oct 22 13:53:23 2014 +0200

    Add GVfsBackendGoogle
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739008

 client/Makefile.am         |    1 +
 client/gdaemonvfs.c        |    2 +
 client/googleuri.c         |  167 +++++++++++++++++++++
 configure.ac               |   23 +++
 daemon/Makefile.am         |   20 +++
 daemon/google.mount.in     |    4 +
 daemon/gvfsbackendgoogle.c |  357 ++++++++++++++++++++++++++++++++++++++++++++
 daemon/gvfsbackendgoogle.h |   62 ++++++++
 8 files changed, 636 insertions(+), 0 deletions(-)
---
diff --git a/client/Makefile.am b/client/Makefile.am
index 8c7b76a..c9aa1f6 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -22,6 +22,7 @@ gvfsclientinclude_HEADERS = \
 
 URI_PARSER_SOURCES = \
        smburi.c \
+       googleuri.c \
        httpuri.c \
        afpuri.c \
        $(NULL)
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index 9ab806b..002c992 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -1504,6 +1504,7 @@ g_daemon_vfs_class_init (GDaemonVfsClass *class)
 /* Module API */
 
 void g_vfs_uri_mapper_smb_register (GIOModule *module);
+void g_vfs_uri_mapper_google_register (GIOModule *module);
 void g_vfs_uri_mapper_http_register (GIOModule *module);
 void g_vfs_uri_mapper_afp_register (GIOModule *module);
 
@@ -1539,6 +1540,7 @@ g_io_module_load (GIOModule *module)
   
   g_vfs_uri_mapper_register (module);
   g_vfs_uri_mapper_smb_register (module);
+  g_vfs_uri_mapper_google_register (module);
   g_vfs_uri_mapper_http_register (module);
   g_vfs_uri_mapper_afp_register (module);
 }
diff --git a/client/googleuri.c b/client/googleuri.c
new file mode 100644
index 0000000..acd58fe
--- /dev/null
+++ b/client/googleuri.c
@@ -0,0 +1,167 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* gvfs - extensions for gio
+ *
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * Author: Debarshi Ray <debarshir gnome org>
+ */
+
+#include <config.h>
+
+#include <gio/gio.h>
+#include <gvfsurimapper.h>
+#include <gvfsuriutils.h>
+
+typedef struct _GVfsUriMapperGoogle GVfsUriMapperGoogle;
+typedef struct _GVfsUriMapperGoogleClass GVfsUriMapperGoogleClass;
+
+struct _GVfsUriMapperGoogle
+{
+  GVfsUriMapper parent;
+};
+
+struct _GVfsUriMapperGoogleClass
+{
+  GVfsUriMapperClass parent_class;
+};
+
+GType g_vfs_uri_mapper_google_get_type (void);
+void  g_vfs_uri_mapper_google_register (GIOModule *module);
+
+G_DEFINE_DYNAMIC_TYPE (GVfsUriMapperGoogle, g_vfs_uri_mapper_google, G_VFS_TYPE_URI_MAPPER)
+
+static const gchar * const *
+google_get_handled_schemes (GVfsUriMapper *mapper)
+{
+  static const gchar *schemes[] = {
+    "google-drive",
+    NULL
+  };
+  return schemes;
+}
+
+static GMountSpec *
+google_from_uri (GVfsUriMapper  *mapper,
+                 const char     *uri_str,
+                 gchar         **path)
+{
+  GMountSpec *spec = NULL;
+  GDecodedUri *uri = NULL;
+  gchar *identity = NULL;
+
+  uri = g_vfs_decode_uri (uri_str);
+
+  if (uri == NULL)
+    goto out;
+
+  if (g_ascii_strncasecmp (uri->scheme, "google-drive", 12) != 0)
+    goto out;
+
+  spec = g_mount_spec_new ("google-drive");
+  g_mount_spec_set (spec, "uri", uri_str);
+
+  identity = g_strconcat (uri->userinfo, "@", uri->host, NULL);
+  g_mount_spec_set (spec, "goa-identity", identity);
+
+  *path = uri->path;
+  uri->path = NULL;
+
+ out:
+  g_free (identity);
+  g_vfs_decoded_uri_free (uri);
+  return spec;
+}
+
+static GMountSpec *
+google_get_mount_spec_for_path (GVfsUriMapper *mapper,
+                                GMountSpec *spec,
+                                const gchar *old_path,
+                                const gchar *new_path)
+{
+  return NULL;
+}
+
+static const gchar * const *
+google_get_handled_mount_types (GVfsUriMapper *mapper)
+{
+  static const gchar *types[] = {
+    "google-drive",
+    NULL
+  };
+  return types;
+}
+
+static gchar *
+google_to_uri (GVfsUriMapper *mapper,
+               GMountSpec    *spec,
+               const gchar   *path,
+               gboolean       allow_utf8)
+{
+  const gchar *type;
+  gchar *res = NULL;
+
+  type = g_mount_spec_get (spec, "type");
+  if (g_strcmp0 (type, "google-drive") == 0)
+    {
+      const gchar *uri;
+
+      uri = g_mount_spec_get (spec, "uri");
+      res = g_strdup (uri);
+    }
+
+  return res;
+}
+
+static const gchar *
+google_to_uri_scheme (GVfsUriMapper *mapper,
+                      GMountSpec    *spec)
+{
+  const gchar *type;
+
+  type = g_mount_spec_get (spec, "type");
+  return (g_strcmp0 (type, "google-drive") == 0) ? type : NULL;
+}
+
+static void
+g_vfs_uri_mapper_google_class_finalize (GVfsUriMapperGoogleClass *klass)
+{
+}
+
+static void
+g_vfs_uri_mapper_google_class_init (GVfsUriMapperGoogleClass *class)
+{
+  GVfsUriMapperClass *mapper_class = G_VFS_URI_MAPPER_CLASS (class);
+
+  mapper_class->get_handled_schemes = google_get_handled_schemes;
+  mapper_class->from_uri = google_from_uri;
+  mapper_class->get_mount_spec_for_path = google_get_mount_spec_for_path;
+  mapper_class->get_handled_mount_types = google_get_handled_mount_types;
+  mapper_class->to_uri = google_to_uri;
+  mapper_class->to_uri_scheme = google_to_uri_scheme;
+}
+
+static void
+g_vfs_uri_mapper_google_init (GVfsUriMapperGoogle *vfs)
+{
+}
+
+void
+g_vfs_uri_mapper_google_register (GIOModule *module)
+{
+  g_vfs_uri_mapper_google_register_type (G_TYPE_MODULE (module));
+}
diff --git a/configure.ac b/configure.ac
index 92453f1..c08d5fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -407,6 +407,28 @@ AC_SUBST(GOA_CFLAGS)
 
 AM_CONDITIONAL(USE_GOA, [test "$msg_goa" = "yes"])
 
+dnl ****************************************************
+dnl *** Check if we should build with Google backend ***
+dnl ****************************************************
+AC_ARG_ENABLE(google, AS_HELP_STRING([--disable-google],[build without Google backend]))
+msg_google=no
+GOOGLE_LIBS=
+GOOGLE_CFLAGS=
+
+if test "x$enable_google" != "xno" ; then
+  PKG_CHECK_EXISTS(goa-1.0 >= 3.15.1 libgdata >= 0.13.1, msg_google=yes)
+
+  if test "x$msg_google" = "xyes"; then
+    PKG_CHECK_MODULES(GOOGLE, goa-1.0 libgdata)
+    AC_DEFINE(HAVE_GOOGLE, 1, [Define to 1 if Google is going to be built])
+  fi
+fi
+
+AC_SUBST(GOOGLE_LIBS)
+AC_SUBST(GOOGLE_CFLAGS)
+
+AM_CONDITIONAL(USE_GOOGLE, [test "$msg_google" = "yes"])
+
 dnl *****************************************************
 dnl *** Check if we should build with obexftp backend ***
 dnl *****************************************************
@@ -938,6 +960,7 @@ echo "
         hotplug backend:              $msg_hotplug_backend
 
        Blu-ray metadata support:     $msg_bluray
+       Google support:               $msg_google
         HTTP/WebDAV support:          $msg_http
         ObexFTP support               $msg_obexftp
        Samba support:                $msg_samba
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index a6a9ae1..5cb89ae 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -48,6 +48,12 @@ libexec_PROGRAMS=gvfsd gvfsd-sftp gvfsd-trash gvfsd-computer gvfsd-burn gvfsd-lo
 mount_in_files = sftp.mount.in ftp.mount.in trash.mount.in computer.mount.in burn.mount.in 
localtest.mount.in network.mount.in
 mount_DATA =  sftp.mount ftp.mount trash.mount computer.mount burn.mount localtest.mount network.mount
 
+mount_in_files +=google.mount.in
+if USE_GOOGLE
+mount_DATA += google.mount
+libexec_PROGRAMS += gvfsd-google
+endif
+
 mount_in_files +=recent.mount.in
 if USE_GTK
 mount_DATA += recent.mount
@@ -459,6 +465,20 @@ else
 gvfsd_cdda_LDADD = $(libraries) $(CDDA_LIBS) $(HAL_LIBS)
 endif
 
+gvfsd_google_SOURCES = \
+       gvfsbackendgoogle.c gvfsbackendgoogle.h \
+       daemon-main.c daemon-main.h \
+       daemon-main-generic.c
+
+gvfsd_google_CPPFLAGS = \
+       $(flags) \
+       -DBACKEND_HEADER=gvfsbackendgoogle.h \
+       -DDEFAULT_BACKEND_TYPE=google-drive \
+       -DBACKEND_TYPES='"google-drive", G_VFS_TYPE_BACKEND_GOOGLE,' \
+       $(GOOGLE_CFLAGS)
+
+gvfsd_google_LDADD = $(libraries) $(GOOGLE_LIBS)
+
 gvfsd_gphoto2_SOURCES = \
        gvfsbackendgphoto2.c gvfsbackendgphoto2.h \
        daemon-main.c daemon-main.h \
diff --git a/daemon/google.mount.in b/daemon/google.mount.in
new file mode 100644
index 0000000..059b228
--- /dev/null
+++ b/daemon/google.mount.in
@@ -0,0 +1,4 @@
+[Mount]
+Type=google-drive
+Exec= libexecdir@/gvfsd-google
+AutoMount=false
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c
new file mode 100644
index 0000000..a55bbb1
--- /dev/null
+++ b/daemon/gvfsbackendgoogle.c
@@ -0,0 +1,357 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* gvfs - extensions for gio
+ *
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * Author: Debarshi Ray <debarshir gnome org>
+ */
+
+#include <config.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gio/gio.h>
+
+#define GOA_API_IS_SUBJECT_TO_CHANGE
+#include <gdata/gdata.h>
+#include <goa/goa.h>
+
+#include "gvfsbackendgoogle.h"
+
+struct _GVfsBackendGoogle
+{
+  GVfsBackend parent;
+  GDataDocumentsService *service;
+  GDataGoaAuthorizer *authorizer;
+  GoaClient *client;
+};
+
+struct _GVfsBackendGoogleClass
+{
+  GVfsBackendClass parent_class;
+};
+
+G_DEFINE_TYPE(GVfsBackendGoogle, g_vfs_backend_google, G_VFS_TYPE_BACKEND)
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+#define CATEGORY_SCHEMA_KIND "http://schemas.google.com/g/2005#kind";
+#define CATEGORY_SCHEMA_KIND_FILE "http://schemas.google.com/docs/2007#file";
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static GoaClient *
+get_goa_client_sync (GError **error)
+{
+  static GoaClient *client = NULL;
+  static GError *_error = NULL;
+  static volatile gsize initialized = 0;
+
+  if (g_once_init_enter (&initialized))
+    {
+      client = goa_client_new_sync (NULL, &_error);
+      g_once_init_leave (&initialized, 1);
+    }
+
+  if (_error != NULL && error != NULL)
+    *error = g_error_copy (_error);
+
+  return client;
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
+static void
+g_vfs_backend_google_enumerate (GVfsBackend           *_self,
+                                GVfsJobEnumerate      *job,
+                                const gchar           *filename,
+                                GFileAttributeMatcher *matcher,
+                                GFileQueryInfoFlags    flags)
+{
+  GVfsBackendGoogle *self = G_VFS_BACKEND_GOOGLE (_self);
+  GCancellable *cancellable = G_VFS_JOB (job)->cancellable;
+  GDataDocumentsFeed *feed;
+  GDataDocumentsQuery *query;
+  GError *error;
+  GList *entries;
+  GList *l;
+
+  /* We are ignoring directories at the moment. */
+  query = gdata_documents_query_new (NULL);
+
+  error = NULL;
+  feed = gdata_documents_service_query_documents (self->service, query, cancellable, NULL, NULL, &error);
+  if (error != NULL)
+    {
+      g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+      g_error_free (error);
+      goto out;
+    }
+
+  entries = gdata_feed_get_entries (GDATA_FEED (feed));
+  for (l = entries; l != NULL; l = l->next)
+    {
+      GDataEntry *entry = GDATA_ENTRY (l->data);
+      GFileInfo *info;
+      GFileType file_type;
+      GList *authors;
+      const gchar *etag;
+      const gchar *id;
+      const gchar *mime_type = NULL;
+      const gchar *title;
+      gint64 atime;
+      gint64 ctime;
+      gint64 mtime;
+
+      info = g_file_info_new ();
+
+      file_type = G_FILE_TYPE_REGULAR;
+      g_file_info_set_file_type (info, file_type);
+
+      title = gdata_entry_get_title (entry);
+      g_file_info_set_name (info, title);
+      g_file_info_set_display_name (info, title);
+      g_file_info_set_edit_name (info, title);
+
+      atime = gdata_documents_entry_get_last_viewed (GDATA_DOCUMENTS_ENTRY (entry));
+      g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_ACCESS, (guint64) atime);
+
+      ctime = gdata_entry_get_published (entry);
+      g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_CREATED, (guint64) ctime);
+
+      mtime = gdata_entry_get_updated (entry);
+      g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED, (guint64) mtime);
+
+      authors = gdata_entry_get_authors (entry);
+      if (authors != NULL)
+        {
+          GDataAuthor *author = GDATA_AUTHOR (authors->data);
+          const gchar *email_address;
+          const gchar *name;
+
+          email_address = gdata_author_get_email_address (author);
+          g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_OWNER_USER, email_address);
+
+          name = gdata_author_get_name (author);
+          g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_OWNER_USER_REAL, name);
+        }
+
+      if (GDATA_IS_DOCUMENTS_PDF (entry))
+        {
+          mime_type = "application/pdf";
+        }
+      else
+        {
+          GList *categories;
+          GList *l;
+
+          categories = gdata_entry_get_categories (entry);
+          for (l = categories; l != NULL; l = l->next)
+            {
+              GDataCategory *category = GDATA_CATEGORY (l->data);
+              const gchar *scheme;
+              const gchar *term;
+
+              scheme = gdata_category_get_scheme (category);
+              term = gdata_category_get_term (category);
+              if (g_strcmp0 (scheme, CATEGORY_SCHEMA_KIND) == 0 &&
+                  g_strcmp0 (term, CATEGORY_SCHEMA_KIND_FILE) == 0)
+                {
+                  mime_type = gdata_category_get_label (category);
+                  break;
+                }
+            }
+        }
+
+      if (mime_type != NULL)
+        {
+          g_file_info_set_content_type (info, mime_type);
+          g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, mime_type);
+        }
+
+      etag = gdata_entry_get_etag (entry);
+      g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_ETAG_VALUE, etag);
+
+      id = gdata_entry_get_id (entry);
+      g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_ID_FILE, id);
+
+      g_vfs_job_enumerate_add_info (job, info);
+      g_object_unref (info);
+    }
+
+  g_vfs_job_succeeded (G_VFS_JOB (job));
+  g_vfs_job_enumerate_done (job);
+
+ out:
+  g_clear_object (&feed);
+  g_object_unref (query);
+}
+
+static void
+g_vfs_backend_google_mount (GVfsBackend  *_self,
+                            GVfsJobMount *job,
+                            GMountSpec   *spec,
+                            GMountSource *source,
+                            gboolean      is_automount)
+{
+  GVfsBackendGoogle *self = G_VFS_BACKEND_GOOGLE (_self);
+  GList *accounts = NULL;
+  GList *l;
+  gboolean account_found = FALSE;
+  const gchar *mount_identity;
+
+  if (self->client == NULL)
+    {
+      g_vfs_job_failed (G_VFS_JOB (job), G_IO_ERROR,
+                        G_IO_ERROR_FAILED,
+                        _("Failed to connect to GOA"));
+      goto out;
+    }
+
+  mount_identity = g_mount_spec_get (spec, "goa-identity");
+  if (mount_identity == NULL)
+    {
+      g_vfs_job_failed (G_VFS_JOB (job), G_IO_ERROR,
+                        G_IO_ERROR_INVALID_ARGUMENT,
+                        _("Invalid mount spec"));
+      goto out;
+    }
+
+  accounts = goa_client_get_accounts (self->client);
+  for (l = accounts; l != NULL && !account_found; l = l->next)
+    {
+      GoaAccount *account;
+      GoaObject *object = GOA_OBJECT (l->data);
+      gchar *account_identity;
+      gchar *provider_type;
+
+      account = goa_object_get_account (object);
+      account_identity = goa_account_dup_identity (account);
+      provider_type = goa_account_dup_provider_type (account);
+
+      if (g_strcmp0 (provider_type, "google") == 0 &&
+          g_strcmp0 (account_identity, mount_identity) == 0)
+        {
+          g_clear_object (&self->authorizer);
+          self->authorizer = gdata_goa_authorizer_new (object);
+
+          g_clear_object (&self->service);
+          self->service = gdata_documents_service_new (GDATA_AUTHORIZER (self->authorizer));
+
+          account_found = TRUE;
+        }
+
+      g_free (provider_type);
+      g_free (account_identity);
+      g_object_unref (account);
+    }
+
+  if (!account_found)
+    {
+      g_vfs_job_failed (G_VFS_JOB (job), G_IO_ERROR,
+                        G_IO_ERROR_INVALID_ARGUMENT,
+                        _("Failed to find a matching GOA account"));
+      goto out;
+    }
+
+  g_vfs_backend_set_mount_spec (_self, spec);
+  g_vfs_backend_set_display_name (_self, mount_identity);
+  g_vfs_job_succeeded (G_VFS_JOB (job));
+
+ out:
+  g_list_free_full (accounts, g_object_unref);
+}
+
+static gboolean
+g_vfs_backend_query_fs_info (GVfsBackend           *_self,
+                             GVfsJobQueryFsInfo    *job,
+                             const gchar           *filename,
+                             GFileInfo             *info,
+                             GFileAttributeMatcher *matcher)
+{
+  GMountSpec *spec;
+  const gchar *type;
+
+  g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, FALSE);
+
+  spec = g_vfs_backend_get_mount_spec (_self);
+  type = g_mount_spec_get_type (spec);
+  g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, type);
+
+  g_vfs_job_succeeded (G_VFS_JOB (job));
+
+  return TRUE;
+}
+
+static void
+g_vfs_backend_query_info (GVfsBackend           *_self,
+                          GVfsJobQueryInfo      *job,
+                          const gchar           *filename,
+                          GFileQueryInfoFlags    flags,
+                          GFileInfo             *info,
+                          GFileAttributeMatcher *matcher)
+{
+  g_message ("%s", filename);
+  g_vfs_job_succeeded (G_VFS_JOB (job));
+}
+
+static void
+g_vfs_backend_google_dispose (GObject *_self)
+{
+  GVfsBackendGoogle *self = G_VFS_BACKEND_GOOGLE (_self);
+
+  g_clear_object (&self->service);
+  g_clear_object (&self->authorizer);
+  g_clear_object (&self->client);
+
+  G_OBJECT_CLASS (g_vfs_backend_google_parent_class)->dispose (_self);
+}
+
+static void
+g_vfs_backend_google_class_init (GVfsBackendGoogleClass * klass)
+{
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  GVfsBackendClass *backend_class = G_VFS_BACKEND_CLASS (klass);
+
+  gobject_class->dispose = g_vfs_backend_google_dispose;
+
+  backend_class->enumerate = g_vfs_backend_google_enumerate;
+  backend_class->mount = g_vfs_backend_google_mount;
+  backend_class->try_query_fs_info = g_vfs_backend_query_fs_info;
+  backend_class->query_info = g_vfs_backend_query_info;
+}
+
+static void
+g_vfs_backend_google_init (GVfsBackendGoogle *self)
+{
+  GError *error;
+
+  error = NULL;
+  self->client = get_goa_client_sync (&error);
+  if (self->client == NULL)
+    {
+      g_warning ("Failed to connect to GOA: %s", error->message);
+      g_error_free (error);
+    }
+}
+
+GVfsBackend *
+g_vfs_backend_google_new (void)
+{
+  return g_object_new (G_VFS_TYPE_BACKEND_GOOGLE, NULL);
+}
diff --git a/daemon/gvfsbackendgoogle.h b/daemon/gvfsbackendgoogle.h
new file mode 100644
index 0000000..21b209f
--- /dev/null
+++ b/daemon/gvfsbackendgoogle.h
@@ -0,0 +1,62 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* gvfs - extensions for gio
+ *
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * Author: Debarshi Ray <debarshir gnome org>
+ */
+
+#ifndef __G_VFS_BACKEND_GOOGLE_H__
+#define __G_VFS_BACKEND_GOOGLE_H__
+
+#include <gvfsbackend.h>
+
+G_BEGIN_DECLS
+
+#define G_VFS_TYPE_BACKEND_GOOGLE (g_vfs_backend_google_get_type())
+
+#define G_VFS_BACKEND_GOOGLE(o) \
+  (G_TYPE_CHECK_INSTANCE_CAST((o), \
+   G_VFS_TYPE_BACKEND_GOOGLE, GVfsBackendGoogle))
+
+#define G_VFS_BACKEND_GOOGLE_CLASS(k) \
+  (G_TYPE_CHECK_CLASS_CAST((k), \
+   G_VFS_TYPE_BACKEND_GOOGLE, GVfsBackendGoogleClass))
+
+#define G_VFS_IS_BACKEND_GOOGLE(o) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((o), \
+   G_VFS_TYPE_BACKEND_GOOGLE))
+
+#define G_VFS_IS_BACKEND_GOOGLE_CLASS(k) \
+  (G_TYPE_CHECK_CLASS_TYPE((k), \
+   G_VFS_TYPE_BACKEND_GOOGLE))
+
+#define G_VFS_BACKEND_GOOGLE_GET_CLASS(o) \
+  (G_TYPE_INSTANCE_GET_CLASS((o), \
+   G_VFS_TYPE_BACKEND_GOOGLE, GVfsBackendGoogleClass))
+
+typedef struct _GVfsBackendGoogle GVfsBackendGoogle;
+typedef struct _GVfsBackendGoogleClass GVfsBackendGoogleClass;
+
+GType g_vfs_backend_google_get_type (void) G_GNUC_CONST;
+
+GVfsBackend *g_vfs_backend_google_new (void);
+
+G_END_DECLS
+
+#endif /* __G_VFS_BACKEND_GOOGLE_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]