[gnome-builder] plugins: rename xdg-app to flatpak



commit 79b49b896ae60f0c5800e8eb8340308ac1083c3f
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 20 14:27:26 2016 +0300

    plugins: rename xdg-app to flatpak

 configure.ac                                       |    4 +-
 plugins/Makefile.am                                |    2 +-
 plugins/flatpak/Makefile.am                        |   28 +++++++
 plugins/flatpak/configure.ac                       |   24 ++++++
 .../xdg-app.plugin => flatpak/flatpak.plugin}      |    6 +-
 .../gbp-flatpak-plugin.c}                          |    6 +-
 .../gbp-flatpak-runtime-provider.c}                |   78 +++++++++---------
 .../gbp-flatpak-runtime-provider.h}                |   12 ++--
 .../gbp-flatpak-runtime.c}                         |   86 ++++++++++----------
 .../gbp-flatpak-runtime.h}                         |   12 ++--
 plugins/xdg-app/Makefile.am                        |   28 -------
 plugins/xdg-app/configure.ac                       |   24 ------
 12 files changed, 155 insertions(+), 155 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 726438a..0343479 100644
--- a/configure.ac
+++ b/configure.ac
@@ -286,6 +286,7 @@ m4_include([plugins/create-project/configure.ac])
 m4_include([plugins/ctags/configure.ac])
 m4_include([plugins/devhelp/configure.ac])
 m4_include([plugins/file-search/configure.ac])
+m4_include([plugins/flatpak/configure.ac])
 m4_include([plugins/fpaste/configure.ac])
 m4_include([plugins/gcc/configure.ac])
 m4_include([plugins/gettext/configure.ac])
@@ -306,7 +307,6 @@ m4_include([plugins/sysmon/configure.ac])
 m4_include([plugins/todo/configure.ac])
 m4_include([plugins/terminal/configure.ac])
 m4_include([plugins/vala-pack/configure.ac])
-m4_include([plugins/xdg-app/configure.ac])
 m4_include([plugins/xml-pack/configure.ac])
 
 
@@ -604,7 +604,7 @@ echo "  Symbol Tree .......................... : ${enable_symbol_tree_plugin}"
 echo "  Todo ................................. : ${enable_todo_plugin}"
 echo "  Terminal ............................. : ${enable_terminal_plugin}"
 echo "  Vala Language Pack ................... : ${enable_vala_pack_plugin}"
-echo "  Xdg-App .............................. : ${enable_xdg_app_plugin}"
+echo "  Flatpak .............................. : ${enable_flatpak_plugin}"
 echo "  XML Language Pack .................... : ${enable_xml_pack_plugin}"
 echo ""
 echo " Example Plugins"
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 3d6980c..ca2af88 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -11,6 +11,7 @@ SUBDIRS = \
        ctags \
        devhelp \
        file-search \
+       flatpak \
        fpaste \
        gcc \
        gettext \
@@ -31,7 +32,6 @@ SUBDIRS = \
        terminal \
        todo \
        vala-pack \
-       xdg-app \
        xml-pack \
        $(NULL)
 
diff --git a/plugins/flatpak/Makefile.am b/plugins/flatpak/Makefile.am
new file mode 100644
index 0000000..302e6d6
--- /dev/null
+++ b/plugins/flatpak/Makefile.am
@@ -0,0 +1,28 @@
+if ENABLE_FLATPAK_PLUGIN
+
+DISTCLEANFILES =
+BUILT_SOURCES =
+CLEANFILES =
+EXTRA_DIST = $(plugin_DATA)
+
+plugindir = $(libdir)/gnome-builder/plugins
+plugin_LTLIBRARIES = libflatpak-plugin.la
+dist_plugin_DATA = flatpak.plugin
+
+libflatpak_plugin_la_SOURCES = \
+       gbp-flatpak-runtime-provider.c \
+       gbp-flatpak-runtime-provider.h \
+       gbp-flatpak-runtime.c \
+       gbp-flatpak-runtime.h \
+       gbp-flatpak-plugin.c \
+       $(NULL)
+
+libflatpak_plugin_la_CFLAGS = $(PLUGIN_CFLAGS) $(FLATPAK_CFLAGS)
+libflatpak_plugin_la_LIBADD = $(FLATPAK_LIBS)
+libflatpak_plugin_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+
+include $(top_srcdir)/plugins/Makefile.plugin
+
+endif
+
+-include $(top_srcdir)/git.mk
diff --git a/plugins/flatpak/configure.ac b/plugins/flatpak/configure.ac
new file mode 100644
index 0000000..77d1fea
--- /dev/null
+++ b/plugins/flatpak/configure.ac
@@ -0,0 +1,24 @@
+m4_define([flatpak_required_version], [0.6.0])
+
+# --enable-flatpak-plugin=yes/no/auto
+AC_ARG_ENABLE([flatpak-plugin],
+              [AS_HELP_STRING([--enable-flatpak-plugin=@<:@yes/no/auto@:>@],
+                              [Build with support for flatpak.])],
+              [enable_flatpak_plugin=$enableval],
+              [enable_flatpak_plugin=auto])
+
+AS_IF([test "$enable_flatpak_plugin" != no],[
+       PKG_CHECK_MODULES(FLATPAK,
+                         [flatpak >= flatpak_required_version],
+                         [have_flatpak=yes],
+                         [have_flatpak=no])
+
+       AS_IF([test "$enable_flatpak_plugin" = "yes" && "$have_flatpak" = "no"],[
+              AC_MSG_ERROR([--enable-flatpak-plugin requires flatpak >= flatpak_required_version])
+       ])
+
+       enable_flatpak_plugin=$have_flatpak
+])
+
+AM_CONDITIONAL(ENABLE_FLATPAK_PLUGIN, [test "x$enable_flatpak_plugin" = "xyes"])
+AC_CONFIG_FILES([plugins/flatpak/Makefile])
diff --git a/plugins/xdg-app/xdg-app.plugin b/plugins/flatpak/flatpak.plugin
similarity index 56%
rename from plugins/xdg-app/xdg-app.plugin
rename to plugins/flatpak/flatpak.plugin
index b8b3d19..03e199a 100644
--- a/plugins/xdg-app/xdg-app.plugin
+++ b/plugins/flatpak/flatpak.plugin
@@ -1,7 +1,7 @@
 [Plugin]
-Module=xdg-app-plugin
-Name=Xdg-App
-Description=Provides support for building with Xdg-App
+Module=flatpak-plugin
+Name=Flatpak
+Description=Provides support for building with Flatpak
 Authors=Christian Hergert <christian hergert me>
 Copyright=Copyright © 2016 Christian Hergert
 Builtin=true
diff --git a/plugins/xdg-app/gbp-xdg-plugin.c b/plugins/flatpak/gbp-flatpak-plugin.c
similarity index 86%
rename from plugins/xdg-app/gbp-xdg-plugin.c
rename to plugins/flatpak/gbp-flatpak-plugin.c
index 5fb941f..d0815d8 100644
--- a/plugins/xdg-app/gbp-xdg-plugin.c
+++ b/plugins/flatpak/gbp-flatpak-plugin.c
@@ -1,4 +1,4 @@
-/* gbp-xdg-plugin.c
+/* gbp-flatpak-plugin.c
  *
  * Copyright (C) 2016 Christian Hergert <chergert redhat com>
  *
@@ -19,12 +19,12 @@
 #include <libpeas/peas.h>
 #include <ide.h>
 
-#include "gbp-xdg-runtime-provider.h"
+#include "gbp-flatpak-runtime-provider.h"
 
 void
 peas_register_types (PeasObjectModule *module)
 {
   peas_object_module_register_extension_type (module,
                                               IDE_TYPE_RUNTIME_PROVIDER,
-                                              GBP_TYPE_XDG_RUNTIME_PROVIDER);
+                                              GBP_TYPE_FLATPAK_RUNTIME_PROVIDER);
 }
diff --git a/plugins/xdg-app/gbp-xdg-runtime-provider.c b/plugins/flatpak/gbp-flatpak-runtime-provider.c
similarity index 71%
rename from plugins/xdg-app/gbp-xdg-runtime-provider.c
rename to plugins/flatpak/gbp-flatpak-runtime-provider.c
index 42b944a..c4f39ab 100644
--- a/plugins/xdg-app/gbp-xdg-runtime-provider.c
+++ b/plugins/flatpak/gbp-flatpak-runtime-provider.c
@@ -1,4 +1,4 @@
-/* gbp-xdg-runtime-provider.c
+/* gbp-flatpak-runtime-provider.c
  *
  * Copyright (C) 2016 Christian Hergert <chergert redhat com>
  *
@@ -17,25 +17,25 @@
  */
 
 #include <string.h>
-#include <xdg-app.h>
+#include <flatpak.h>
 
 #include "util/ide-posix.h"
 
-#include "gbp-xdg-runtime.h"
-#include "gbp-xdg-runtime-provider.h"
+#include "gbp-flatpak-runtime.h"
+#include "gbp-flatpak-runtime-provider.h"
 
-struct _GbpXdgRuntimeProvider
+struct _GbpFlatpakRuntimeProvider
 {
   GObject             parent_instance;
   IdeRuntimeManager  *manager;
-  XdgAppInstallation *installation;
+  FlatpakInstallation *installation;
   GCancellable       *cancellable;
   GPtrArray          *runtimes;
 };
 
 static void runtime_provider_iface_init (IdeRuntimeProviderInterface *);
 
-G_DEFINE_TYPE_EXTENDED (GbpXdgRuntimeProvider, gbp_xdg_runtime_provider, G_TYPE_OBJECT, 0,
+G_DEFINE_TYPE_EXTENDED (GbpFlatpakRuntimeProvider, gbp_flatpak_runtime_provider, G_TYPE_OBJECT, 0,
                         G_IMPLEMENT_INTERFACE (IDE_TYPE_RUNTIME_PROVIDER,
                                                runtime_provider_iface_init))
 
@@ -49,12 +49,12 @@ sanitize_name (gchar *name)
 }
 
 static void
-gbp_xdg_runtime_provider_load_worker (GTask        *task,
-                                      gpointer      source_object,
-                                      gpointer      task_data,
-                                      GCancellable *cancellable)
+gbp_flatpak_runtime_provider_load_worker (GTask        *task,
+                                          gpointer      source_object,
+                                          gpointer      task_data,
+                                          GCancellable *cancellable)
 {
-  GbpXdgRuntimeProvider *self = source_object;
+  GbpFlatpakRuntimeProvider *self = source_object;
   g_autofree gchar *host_type = NULL;
   IdeContext *context;
   GPtrArray *ret;
@@ -63,13 +63,13 @@ gbp_xdg_runtime_provider_load_worker (GTask        *task,
   guint i;
 
   g_assert (G_IS_TASK (task));
-  g_assert (GBP_IS_XDG_RUNTIME_PROVIDER (self));
+  g_assert (GBP_IS_FLATPAK_RUNTIME_PROVIDER (self));
   g_assert (IDE_IS_RUNTIME_MANAGER (self->manager));
 
   context = ide_object_get_context (IDE_OBJECT (self->manager));
   host_type = ide_get_system_arch ();
 
-  self->installation = xdg_app_installation_new_user (cancellable, &error);
+  self->installation = flatpak_installation_new_user (cancellable, &error);
 
   if (self->installation == NULL)
     {
@@ -77,8 +77,8 @@ gbp_xdg_runtime_provider_load_worker (GTask        *task,
       return;
     }
 
-  ar = xdg_app_installation_list_installed_refs_by_kind (self->installation,
-                                                         XDG_APP_REF_KIND_RUNTIME,
+  ar = flatpak_installation_list_installed_refs_by_kind (self->installation,
+                                                         FLATPAK_REF_KIND_RUNTIME,
                                                          cancellable,
                                                          &error);
 
@@ -92,7 +92,7 @@ gbp_xdg_runtime_provider_load_worker (GTask        *task,
 
   for (i = 0; i < ar->len; i++)
     {
-      XdgAppInstalledRef *ref = g_ptr_array_index (ar, i);
+      FlatpakInstalledRef *ref = g_ptr_array_index (ar, i);
       g_autofree gchar *str = NULL;
       g_autofree gchar *id = NULL;
       g_autofree gchar *name = NULL;
@@ -104,23 +104,23 @@ gbp_xdg_runtime_provider_load_worker (GTask        *task,
       const gchar *metadata_data;
       gsize metadata_len;
 
-      g_assert (XDG_APP_IS_INSTALLED_REF (ref));
+      g_assert (FLATPAK_IS_INSTALLED_REF (ref));
 
-      name = g_strdup (xdg_app_ref_get_name (XDG_APP_REF (ref)));
+      name = g_strdup (flatpak_ref_get_name (FLATPAK_REF (ref)));
 
       sanitize_name (name);
 
-      arch = xdg_app_ref_get_arch (XDG_APP_REF (ref));
-      branch = xdg_app_ref_get_branch (XDG_APP_REF (ref));
+      arch = flatpak_ref_get_arch (FLATPAK_REF (ref));
+      branch = flatpak_ref_get_branch (FLATPAK_REF (ref));
 
-      id = g_strdup_printf ("xdg-app:%s/%s/%s", name, branch, arch);
+      id = g_strdup_printf ("flatpak-app:%s/%s/%s", name, branch, arch);
 
       if (g_strcmp0 (host_type, arch) == 0)
         str = g_strdup_printf ("%s <b>%s</b>", name, branch);
       else
         str = g_strdup_printf ("%s <b>%s</b> <sup>%s</sup>", name, branch, arch);
 
-      metadata = xdg_app_installed_ref_load_metadata (XDG_APP_INSTALLED_REF (ref),
+      metadata = flatpak_installed_ref_load_metadata (FLATPAK_INSTALLED_REF (ref),
                                                       cancellable, &error);
 
       if (metadata == NULL)
@@ -157,7 +157,7 @@ gbp_xdg_runtime_provider_load_worker (GTask        *task,
       sanitize_name (sdk);
 
       g_ptr_array_add (ret,
-                       g_object_new (GBP_TYPE_XDG_RUNTIME,
+                       g_object_new (GBP_TYPE_FLATPAK_RUNTIME,
                                      "branch", branch,
                                      "sdk", sdk,
                                      "platform", name,
@@ -173,16 +173,16 @@ gbp_xdg_runtime_provider_load_worker (GTask        *task,
 }
 
 static void
-gbp_xdg_runtime_provider_load_cb (GObject      *object,
+gbp_flatpak_runtime_provider_load_cb (GObject      *object,
                                   GAsyncResult *result,
                                   gpointer      user_data)
 {
-  GbpXdgRuntimeProvider *self = (GbpXdgRuntimeProvider *)object;
+  GbpFlatpakRuntimeProvider *self = (GbpFlatpakRuntimeProvider *)object;
   GPtrArray *ret;
   GError *error = NULL;
   guint i;
 
-  g_assert (GBP_IS_XDG_RUNTIME_PROVIDER (self));
+  g_assert (GBP_IS_FLATPAK_RUNTIME_PROVIDER (self));
   g_assert (G_IS_TASK (result));
 
   if (!(ret = g_task_propagate_pointer (G_TASK (result), &error)))
@@ -203,30 +203,30 @@ gbp_xdg_runtime_provider_load_cb (GObject      *object,
 }
 
 static void
-gbp_xdg_runtime_provider_load (IdeRuntimeProvider *provider,
+gbp_flatpak_runtime_provider_load (IdeRuntimeProvider *provider,
                                IdeRuntimeManager  *manager)
 {
-  GbpXdgRuntimeProvider *self = (GbpXdgRuntimeProvider *)provider;
+  GbpFlatpakRuntimeProvider *self = (GbpFlatpakRuntimeProvider *)provider;
   g_autoptr(GTask) task = NULL;
 
-  g_assert (GBP_IS_XDG_RUNTIME_PROVIDER (self));
+  g_assert (GBP_IS_FLATPAK_RUNTIME_PROVIDER (self));
   g_assert (IDE_IS_RUNTIME_MANAGER (manager));
 
   ide_set_weak_pointer (&self->manager, manager);
 
   self->cancellable = g_cancellable_new ();
 
-  task = g_task_new (self, self->cancellable, gbp_xdg_runtime_provider_load_cb, NULL);
-  g_task_run_in_thread (task, gbp_xdg_runtime_provider_load_worker);
+  task = g_task_new (self, self->cancellable, gbp_flatpak_runtime_provider_load_cb, NULL);
+  g_task_run_in_thread (task, gbp_flatpak_runtime_provider_load_worker);
 }
 
 static void
-gbp_xdg_runtime_provider_unload (IdeRuntimeProvider *provider,
+gbp_flatpak_runtime_provider_unload (IdeRuntimeProvider *provider,
                                  IdeRuntimeManager  *manager)
 {
-  GbpXdgRuntimeProvider *self = (GbpXdgRuntimeProvider *)provider;
+  GbpFlatpakRuntimeProvider *self = (GbpFlatpakRuntimeProvider *)provider;
 
-  g_assert (GBP_IS_XDG_RUNTIME_PROVIDER (self));
+  g_assert (GBP_IS_FLATPAK_RUNTIME_PROVIDER (self));
   g_assert (IDE_IS_RUNTIME_MANAGER (manager));
 
   if (self->runtimes != NULL)
@@ -251,18 +251,18 @@ gbp_xdg_runtime_provider_unload (IdeRuntimeProvider *provider,
 }
 
 static void
-gbp_xdg_runtime_provider_class_init (GbpXdgRuntimeProviderClass *klass)
+gbp_flatpak_runtime_provider_class_init (GbpFlatpakRuntimeProviderClass *klass)
 {
 }
 
 static void
-gbp_xdg_runtime_provider_init (GbpXdgRuntimeProvider *self)
+gbp_flatpak_runtime_provider_init (GbpFlatpakRuntimeProvider *self)
 {
 }
 
 static void
 runtime_provider_iface_init (IdeRuntimeProviderInterface *iface)
 {
-  iface->load = gbp_xdg_runtime_provider_load;
-  iface->unload = gbp_xdg_runtime_provider_unload;
+  iface->load = gbp_flatpak_runtime_provider_load;
+  iface->unload = gbp_flatpak_runtime_provider_unload;
 }
diff --git a/plugins/xdg-app/gbp-xdg-runtime-provider.h b/plugins/flatpak/gbp-flatpak-runtime-provider.h
similarity index 68%
rename from plugins/xdg-app/gbp-xdg-runtime-provider.h
rename to plugins/flatpak/gbp-flatpak-runtime-provider.h
index d1440e6..6adef34 100644
--- a/plugins/xdg-app/gbp-xdg-runtime-provider.h
+++ b/plugins/flatpak/gbp-flatpak-runtime-provider.h
@@ -1,4 +1,4 @@
-/* gbp-xdg-runtime-provider.h
+/* gbp-flatpak-runtime-provider.h
  *
  * Copyright (C) 2016 Christian Hergert <chergert redhat com>
  *
@@ -16,17 +16,17 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef GBP_XDG_RUNTIME_PROVIDER_H
-#define GBP_XDG_RUNTIME_PROVIDER_H
+#ifndef GBP_FLATPAK_RUNTIME_PROVIDER_H
+#define GBP_FLATPAK_RUNTIME_PROVIDER_H
 
 #include <ide.h>
 
 G_BEGIN_DECLS
 
-#define GBP_TYPE_XDG_RUNTIME_PROVIDER (gbp_xdg_runtime_provider_get_type())
+#define GBP_TYPE_FLATPAK_RUNTIME_PROVIDER (gbp_flatpak_runtime_provider_get_type())
 
-G_DECLARE_FINAL_TYPE (GbpXdgRuntimeProvider, gbp_xdg_runtime_provider, GBP, XDG_RUNTIME_PROVIDER, GObject)
+G_DECLARE_FINAL_TYPE (GbpFlatpakRuntimeProvider, gbp_flatpak_runtime_provider, GBP, 
FLATPAK_RUNTIME_PROVIDER, GObject)
 
 G_END_DECLS
 
-#endif /* GBP_XDG_RUNTIME_PROVIDER_H */
+#endif /* GBP_FLATPAK_RUNTIME_PROVIDER_H */
diff --git a/plugins/xdg-app/gbp-xdg-runtime.c b/plugins/flatpak/gbp-flatpak-runtime.c
similarity index 74%
rename from plugins/xdg-app/gbp-xdg-runtime.c
rename to plugins/flatpak/gbp-flatpak-runtime.c
index 3befc16..9b96410 100644
--- a/plugins/xdg-app/gbp-xdg-runtime.c
+++ b/plugins/flatpak/gbp-flatpak-runtime.c
@@ -1,4 +1,4 @@
-/* gb-xdg-runtime.c
+/* gb-flatpak-runtime.c
  *
  * Copyright (C) 2016 Christian Hergert <chergert redhat com>
  *
@@ -16,9 +16,9 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "gbp-xdg-runtime.h"
+#include "gbp-flatpak-runtime.h"
 
-struct _GbpXdgRuntime
+struct _GbpFlatpakRuntime
 {
   IdeRuntime parent_instance;
 
@@ -27,7 +27,7 @@ struct _GbpXdgRuntime
   gchar *branch;
 };
 
-G_DEFINE_TYPE (GbpXdgRuntime, gbp_xdg_runtime, IDE_TYPE_RUNTIME)
+G_DEFINE_TYPE (GbpFlatpakRuntime, gbp_flatpak_runtime, IDE_TYPE_RUNTIME)
 
 enum {
   PROP_0,
@@ -40,12 +40,12 @@ enum {
 static GParamSpec *properties [LAST_PROP];
 
 static gchar *
-get_build_directory (GbpXdgRuntime *self)
+get_build_directory (GbpFlatpakRuntime *self)
 {
   IdeContext *context;
   IdeProject *project;
 
-  g_assert (GBP_IS_XDG_RUNTIME (self));
+  g_assert (GBP_IS_FLATPAK_RUNTIME (self));
 
   context = ide_object_get_context (IDE_OBJECT (self));
   project = ide_context_get_project (context);
@@ -54,13 +54,13 @@ get_build_directory (GbpXdgRuntime *self)
                            "gnome-builder",
                            "builds",
                            ide_project_get_name (project),
-                           "xdg-app",
+                           "flatpak-app",
                            ide_runtime_get_id (IDE_RUNTIME (self)),
                            NULL);
 }
 
 static gboolean
-gbp_xdg_runtime_contains_program_in_path (IdeRuntime   *runtime,
+gbp_flatpak_runtime_contains_program_in_path (IdeRuntime   *runtime,
                                           const gchar  *program,
                                           GCancellable *cancellable)
 {
@@ -82,12 +82,12 @@ gbp_xdg_runtime_contains_program_in_path (IdeRuntime   *runtime,
 }
 
 static void
-gbp_xdg_runtime_prebuild_worker (GTask        *task,
+gbp_flatpak_runtime_prebuild_worker (GTask        *task,
                                  gpointer      source_object,
                                  gpointer      task_data,
                                  GCancellable *cancellable)
 {
-  GbpXdgRuntime *self = source_object;
+  GbpFlatpakRuntime *self = source_object;
   g_autofree gchar *build_path = NULL;
   g_autoptr(GFile) build_dir = NULL;
   g_autoptr(GSubprocessLauncher) launcher = NULL;
@@ -96,7 +96,7 @@ gbp_xdg_runtime_prebuild_worker (GTask        *task,
   GError *error = NULL;
 
   g_assert (G_IS_TASK (task));
-  g_assert (GBP_IS_XDG_RUNTIME (self));
+  g_assert (GBP_IS_FLATPAK_RUNTIME (self));
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
   build_path = get_build_directory (self);
@@ -121,14 +121,14 @@ gbp_xdg_runtime_prebuild_worker (GTask        *task,
 
   launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE);
   subprocess = g_subprocess_launcher_spawn (launcher, &error,
-                                            "xdg-app",
+                                            "flatpak-app",
                                             "build-init",
                                             build_path,
                                             /* XXX: Fake name, probably okay, but
                                              * can be proper once we get IdeConfiguration
                                              * in place.
                                              */
-                                            "org.gnome.Builder.XdgApp.Build",
+                                            "org.gnome.Builder.FlatpakApp.Build",
                                             self->sdk,
                                             self->platform,
                                             self->branch,
@@ -138,50 +138,50 @@ gbp_xdg_runtime_prebuild_worker (GTask        *task,
 }
 
 static void
-gbp_xdg_runtime_prebuild_async (IdeRuntime          *runtime,
+gbp_flatpak_runtime_prebuild_async (IdeRuntime          *runtime,
                                 GCancellable        *cancellable,
                                 GAsyncReadyCallback  callback,
                                 gpointer             user_data)
 {
-  GbpXdgRuntime *self = (GbpXdgRuntime *)runtime;
+  GbpFlatpakRuntime *self = (GbpFlatpakRuntime *)runtime;
   g_autoptr(GTask) task = NULL;
 
-  g_assert (GBP_IS_XDG_RUNTIME (self));
+  g_assert (GBP_IS_FLATPAK_RUNTIME (self));
   g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
 
   task = g_task_new (self, cancellable, callback, user_data);
-  g_task_run_in_thread (task, gbp_xdg_runtime_prebuild_worker);
+  g_task_run_in_thread (task, gbp_flatpak_runtime_prebuild_worker);
 }
 
 static gboolean
-gbp_xdg_runtime_prebuild_finish (IdeRuntime    *runtime,
+gbp_flatpak_runtime_prebuild_finish (IdeRuntime    *runtime,
                                  GAsyncResult  *result,
                                  GError       **error)
 {
-  GbpXdgRuntime *self = (GbpXdgRuntime *)runtime;
+  GbpFlatpakRuntime *self = (GbpFlatpakRuntime *)runtime;
 
-  g_assert (GBP_IS_XDG_RUNTIME (self));
+  g_assert (GBP_IS_FLATPAK_RUNTIME (self));
   g_assert (G_IS_TASK (result));
 
   return g_task_propagate_boolean (G_TASK (result), error);
 }
 
 static IdeSubprocessLauncher *
-gbp_xdg_runtime_create_launcher (IdeRuntime  *runtime,
+gbp_flatpak_runtime_create_launcher (IdeRuntime  *runtime,
                                  GError     **error)
 {
   IdeSubprocessLauncher *ret;
-  GbpXdgRuntime *self = (GbpXdgRuntime *)runtime;
+  GbpFlatpakRuntime *self = (GbpFlatpakRuntime *)runtime;
 
-  g_return_val_if_fail (GBP_IS_XDG_RUNTIME (self), NULL);
+  g_return_val_if_fail (GBP_IS_FLATPAK_RUNTIME (self), NULL);
 
-  ret = IDE_RUNTIME_CLASS (gbp_xdg_runtime_parent_class)->create_launcher (runtime, error);
+  ret = IDE_RUNTIME_CLASS (gbp_flatpak_runtime_parent_class)->create_launcher (runtime, error);
 
   if (ret != NULL)
     {
       g_autofree gchar *build_path = get_build_directory (self);
 
-      ide_subprocess_launcher_push_argv (ret, "xdg-app");
+      ide_subprocess_launcher_push_argv (ret, "flatpak-app");
       ide_subprocess_launcher_push_argv (ret, "build");
       ide_subprocess_launcher_push_argv (ret, build_path);
     }
@@ -190,7 +190,7 @@ gbp_xdg_runtime_create_launcher (IdeRuntime  *runtime,
 }
 
 static void
-gbp_xdg_runtime_prepare_configuration (IdeRuntime       *runtime,
+gbp_flatpak_runtime_prepare_configuration (IdeRuntime       *runtime,
                                        IdeConfiguration *configuration)
 {
   g_assert (IDE_IS_RUNTIME (runtime));
@@ -200,12 +200,12 @@ gbp_xdg_runtime_prepare_configuration (IdeRuntime       *runtime,
 }
 
 static void
-gbp_xdg_runtime_get_property (GObject    *object,
+gbp_flatpak_runtime_get_property (GObject    *object,
                               guint       prop_id,
                               GValue     *value,
                               GParamSpec *pspec)
 {
-  GbpXdgRuntime *self = GBP_XDG_RUNTIME(object);
+  GbpFlatpakRuntime *self = GBP_FLATPAK_RUNTIME(object);
 
   switch (prop_id)
     {
@@ -227,12 +227,12 @@ gbp_xdg_runtime_get_property (GObject    *object,
 }
 
 static void
-gbp_xdg_runtime_set_property (GObject      *object,
+gbp_flatpak_runtime_set_property (GObject      *object,
                               guint         prop_id,
                               const GValue *value,
                               GParamSpec   *pspec)
 {
-  GbpXdgRuntime *self = GBP_XDG_RUNTIME(object);
+  GbpFlatpakRuntime *self = GBP_FLATPAK_RUNTIME(object);
 
   switch (prop_id)
     {
@@ -254,32 +254,32 @@ gbp_xdg_runtime_set_property (GObject      *object,
 }
 
 static void
-gbp_xdg_runtime_finalize (GObject *object)
+gbp_flatpak_runtime_finalize (GObject *object)
 {
-  GbpXdgRuntime *self = (GbpXdgRuntime *)object;
+  GbpFlatpakRuntime *self = (GbpFlatpakRuntime *)object;
 
   g_clear_pointer (&self->sdk, g_free);
   g_clear_pointer (&self->platform, g_free);
   g_clear_pointer (&self->branch, g_free);
 
-  G_OBJECT_CLASS (gbp_xdg_runtime_parent_class)->finalize (object);
+  G_OBJECT_CLASS (gbp_flatpak_runtime_parent_class)->finalize (object);
 }
 
 static void
-gbp_xdg_runtime_class_init (GbpXdgRuntimeClass *klass)
+gbp_flatpak_runtime_class_init (GbpFlatpakRuntimeClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   IdeRuntimeClass *runtime_class = IDE_RUNTIME_CLASS (klass);
 
-  object_class->finalize = gbp_xdg_runtime_finalize;
-  object_class->get_property = gbp_xdg_runtime_get_property;
-  object_class->set_property = gbp_xdg_runtime_set_property;
+  object_class->finalize = gbp_flatpak_runtime_finalize;
+  object_class->get_property = gbp_flatpak_runtime_get_property;
+  object_class->set_property = gbp_flatpak_runtime_set_property;
 
-  runtime_class->prebuild_async = gbp_xdg_runtime_prebuild_async;
-  runtime_class->prebuild_finish = gbp_xdg_runtime_prebuild_finish;
-  runtime_class->create_launcher = gbp_xdg_runtime_create_launcher;
-  runtime_class->contains_program_in_path = gbp_xdg_runtime_contains_program_in_path;
-  runtime_class->prepare_configuration = gbp_xdg_runtime_prepare_configuration;
+  runtime_class->prebuild_async = gbp_flatpak_runtime_prebuild_async;
+  runtime_class->prebuild_finish = gbp_flatpak_runtime_prebuild_finish;
+  runtime_class->create_launcher = gbp_flatpak_runtime_create_launcher;
+  runtime_class->contains_program_in_path = gbp_flatpak_runtime_contains_program_in_path;
+  runtime_class->prepare_configuration = gbp_flatpak_runtime_prepare_configuration;
 
   properties [PROP_BRANCH] =
     g_param_spec_string ("branch",
@@ -312,6 +312,6 @@ gbp_xdg_runtime_class_init (GbpXdgRuntimeClass *klass)
 }
 
 static void
-gbp_xdg_runtime_init (GbpXdgRuntime *self)
+gbp_flatpak_runtime_init (GbpFlatpakRuntime *self)
 {
 }
diff --git a/plugins/xdg-app/gbp-xdg-runtime.h b/plugins/flatpak/gbp-flatpak-runtime.h
similarity index 73%
rename from plugins/xdg-app/gbp-xdg-runtime.h
rename to plugins/flatpak/gbp-flatpak-runtime.h
index d2abc7a..feecd97 100644
--- a/plugins/xdg-app/gbp-xdg-runtime.h
+++ b/plugins/flatpak/gbp-flatpak-runtime.h
@@ -1,4 +1,4 @@
-/* gbp-xdg-runtime.h
+/* gbp-flatpak-runtime.h
  *
  * Copyright (C) 2016 Christian Hergert <chergert redhat com>
  *
@@ -16,17 +16,17 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef GBP_XDG_RUNTIME_H
-#define GBP_XDG_RUNTIME_H
+#ifndef GBP_FLATPAK_RUNTIME_H
+#define GBP_FLATPAK_RUNTIME_H
 
 #include <ide.h>
 
 G_BEGIN_DECLS
 
-#define GBP_TYPE_XDG_RUNTIME (gbp_xdg_runtime_get_type())
+#define GBP_TYPE_FLATPAK_RUNTIME (gbp_flatpak_runtime_get_type())
 
-G_DECLARE_FINAL_TYPE (GbpXdgRuntime, gbp_xdg_runtime, GBP, XDG_RUNTIME, IdeRuntime)
+G_DECLARE_FINAL_TYPE (GbpFlatpakRuntime, gbp_flatpak_runtime, GBP, FLATPAK_RUNTIME, IdeRuntime)
 
 G_END_DECLS
 
-#endif /* GBP_XDG_RUNTIME_H */
+#endif /* GBP_FLATPAK_RUNTIME_H */


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