summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-05-06 16:37:47 +0200
committerAlexander Larsson <alexl@redhat.com>2016-05-09 09:00:20 +0200
commit6a613d1fabce5e93656cfbcb6815cc9bc98f437b (patch)
tree0cd0258d16ef75e15287d7e1288af117f20d6751 /lib
parentce20be26f80dbb9769e8b758b3483edc827e7aaa (diff)
downloadxdg-app-6a613d1fabce5e93656cfbcb6815cc9bc98f437b.tar.gz
Rename all non-autogenerated symbols to flatpak
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am.inc20
-rw-r--r--lib/test-lib.c262
-rw-r--r--lib/xdg-app-bundle-ref.c102
-rw-r--r--lib/xdg-app-bundle-ref.h46
-rw-r--r--lib/xdg-app-enum-types.h.template6
-rw-r--r--lib/xdg-app-error.c2
-rw-r--r--lib/xdg-app-error.h22
-rw-r--r--lib/xdg-app-installation.c770
-rw-r--r--lib/xdg-app-installation.h318
-rw-r--r--lib/xdg-app-installed-ref-private.h24
-rw-r--r--lib/xdg-app-installed-ref.c112
-rw-r--r--lib/xdg-app-installed-ref.h48
-rw-r--r--lib/xdg-app-ref.c144
-rw-r--r--lib/xdg-app-ref.h54
-rw-r--r--lib/xdg-app-remote-private.h12
-rw-r--r--lib/xdg-app-remote-ref-private.h14
-rw-r--r--lib/xdg-app-remote-ref.c62
-rw-r--r--lib/xdg-app-remote-ref.h30
-rw-r--r--lib/xdg-app-remote.c160
-rw-r--r--lib/xdg-app-remote.h46
-rw-r--r--lib/xdg-app-version-macros.h.in18
-rw-r--r--lib/xdg-app.h10
22 files changed, 1141 insertions, 1141 deletions
diff --git a/lib/Makefile.am.inc b/lib/Makefile.am.inc
index 4a96f52..bfd2b51 100644
--- a/lib/Makefile.am.inc
+++ b/lib/Makefile.am.inc
@@ -64,7 +64,7 @@ libxdg_app_la_SOURCES = \
libxdg_app_la_CFLAGS = \
$(HIDDEN_VISIBILITY_CFLAGS) \
- -DXDG_APP_COMPILATION \
+ -DFLATPAK_COMPILATION \
-I$(top_srcdir)/lib \
-I$(top_builddir)/lib \
$(AM_CFLAGS) \
@@ -107,23 +107,23 @@ test_libxdg_app_LDADD = \
INTROSPECTION_GIRS =
if HAVE_INTROSPECTION
-XdgApp-1.0.gir: libxdg-app.la Makefile
+Flatpak-1.0.gir: libxdg-app.la Makefile
introspected_headers = $(public_headers)
introspected_sources = $(filter-out %-private.h,$(sources))
-XdgApp_1_0_gir_NAMESPACE = XdgApp
-XdgApp_1_0_gir_VERSION = 1.0
-XdgApp_1_0_gir_LIBS = libxdg-app.la
-XdgApp_1_0_gir_FILES = $(introspected_headers) $(introspected_sources)
-XdgApp_1_0_gir_CFLAGS = $(libxdg_app_la_CFLAGS)
-XdgApp_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
-XdgApp_1_0_gir_SCANNERFLAGS = \
+Flatpak_1_0_gir_NAMESPACE = Flatpak
+Flatpak_1_0_gir_VERSION = 1.0
+Flatpak_1_0_gir_LIBS = libxdg-app.la
+Flatpak_1_0_gir_FILES = $(introspected_headers) $(introspected_sources)
+Flatpak_1_0_gir_CFLAGS = $(libxdg_app_la_CFLAGS)
+Flatpak_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
+Flatpak_1_0_gir_SCANNERFLAGS = \
--warn-all \
--c-include='xdg-app.h' \
--pkg-export=xdg-app
-INTROSPECTION_GIRS += XdgApp-1.0.gir
+INTROSPECTION_GIRS += Flatpak-1.0.gir
girdir = $(datadir)/gir-1.0
nodist_gir_DATA = $(INTROSPECTION_GIRS)
diff --git a/lib/test-lib.c b/lib/test-lib.c
index 2526764..16599fb 100644
--- a/lib/test-lib.c
+++ b/lib/test-lib.c
@@ -28,16 +28,16 @@ monitor_callback (GFileMonitor * monitor,
int
main (int argc, char *argv[])
{
- XdgAppInstallation *installation;
- XdgAppInstalledRef *app1;
- XdgAppInstalledRef *app2;
- XdgAppRemoteRef *remote_ref;
+ FlatpakInstallation *installation;
+ FlatpakInstalledRef *app1;
+ FlatpakInstalledRef *app2;
+ FlatpakRemoteRef *remote_ref;
g_autoptr(GPtrArray) remotes = NULL;
GError *error = NULL;
int i, j;
- installation = xdg_app_installation_new_user (NULL, &error);
+ installation = flatpak_installation_new_user (NULL, &error);
if (installation == NULL)
{
g_print ("error: %s\n", error->message);
@@ -46,7 +46,7 @@ main (int argc, char *argv[])
if (argc == 4)
{
- GFileMonitor * monitor = xdg_app_installation_create_monitor (installation, NULL, NULL);
+ GFileMonitor * monitor = flatpak_installation_create_monitor (installation, NULL, NULL);
GMainLoop *main_loop;
g_signal_connect (monitor, "changed", (GCallback) monitor_callback, NULL);
@@ -56,9 +56,9 @@ main (int argc, char *argv[])
if (argc == 3)
{
- app1 = xdg_app_installation_install (installation,
+ app1 = flatpak_installation_install (installation,
argv[1],
- XDG_APP_REF_KIND_APP,
+ FLATPAK_REF_KIND_APP,
argv[2],
NULL, NULL,
progress_cb, (gpointer) 0xdeadbeef,
@@ -67,16 +67,16 @@ main (int argc, char *argv[])
g_print ("Error: %s\n", error->message);
else
g_print ("Installed %s: %s\n", argv[2],
- xdg_app_ref_get_commit (XDG_APP_REF (app1)));
+ flatpak_ref_get_commit (FLATPAK_REF (app1)));
return 0;
}
if (argc == 2)
{
- app1 = xdg_app_installation_update (installation,
- XDG_APP_UPDATE_FLAGS_NONE,
- XDG_APP_REF_KIND_APP,
+ app1 = flatpak_installation_update (installation,
+ FLATPAK_UPDATE_FLAGS_NONE,
+ FLATPAK_REF_KIND_APP,
argv[1],
NULL, NULL,
progress_cb, (gpointer) 0xdeadbeef,
@@ -85,7 +85,7 @@ main (int argc, char *argv[])
g_print ("Error: %s\n", error->message);
else
g_print ("Updated %s: %s\n", argv[1],
- xdg_app_ref_get_commit (XDG_APP_REF (app1)));
+ flatpak_ref_get_commit (FLATPAK_REF (app1)));
return 0;
}
@@ -93,7 +93,7 @@ main (int argc, char *argv[])
g_print ("\n**** Loading bundle\n");
{
g_autoptr(GFile) f = g_file_new_for_commandline_arg ("tests/hello.xdgapp");
- g_autoptr(XdgAppBundleRef) bundle = xdg_app_bundle_ref_new (f, &error);
+ g_autoptr(FlatpakBundleRef) bundle = flatpak_bundle_ref_new (f, &error);
if (bundle == NULL)
{
g_print ("Error loading bundle: %s\n", error->message);
@@ -101,17 +101,17 @@ main (int argc, char *argv[])
}
else
{
- g_autofree char *path = g_file_get_path (xdg_app_bundle_ref_get_file (bundle));
- g_autoptr(GBytes) metadata = xdg_app_bundle_ref_get_metadata (bundle);
- g_autoptr(GBytes) appdata = xdg_app_bundle_ref_get_appstream (bundle);
+ g_autofree char *path = g_file_get_path (flatpak_bundle_ref_get_file (bundle));
+ g_autoptr(GBytes) metadata = flatpak_bundle_ref_get_metadata (bundle);
+ g_autoptr(GBytes) appdata = flatpak_bundle_ref_get_appstream (bundle);
g_print ("%d %s %s %s %s %s %"G_GUINT64_FORMAT "\n%s\n",
- xdg_app_ref_get_kind (XDG_APP_REF (bundle)),
- xdg_app_ref_get_name (XDG_APP_REF (bundle)),
- xdg_app_ref_get_arch (XDG_APP_REF (bundle)),
- xdg_app_ref_get_branch (XDG_APP_REF (bundle)),
- xdg_app_ref_get_commit (XDG_APP_REF (bundle)),
+ flatpak_ref_get_kind (FLATPAK_REF (bundle)),
+ flatpak_ref_get_name (FLATPAK_REF (bundle)),
+ flatpak_ref_get_arch (FLATPAK_REF (bundle)),
+ flatpak_ref_get_branch (FLATPAK_REF (bundle)),
+ flatpak_ref_get_commit (FLATPAK_REF (bundle)),
path,
- xdg_app_bundle_ref_get_installed_size (bundle),
+ flatpak_bundle_ref_get_installed_size (bundle),
(char *) g_bytes_get_data (metadata, NULL));
if (appdata != NULL)
@@ -139,7 +139,7 @@ main (int argc, char *argv[])
g_print ("\n**** Checking for updates\n");
{
g_autoptr(GPtrArray) updates =
- xdg_app_installation_list_installed_refs_for_update (installation,
+ flatpak_installation_list_installed_refs_for_update (installation,
NULL, &error);
if (updates == NULL)
@@ -151,18 +151,18 @@ main (int argc, char *argv[])
{
for (i = 0; i < updates->len; i++)
{
- XdgAppInstalledRef *ref = g_ptr_array_index (updates, i);
+ FlatpakInstalledRef *ref = g_ptr_array_index (updates, i);
g_print ("%d %s %s %s %s %s %s %s %d %"G_GUINT64_FORMAT "\n",
- xdg_app_ref_get_kind (XDG_APP_REF (ref)),
- xdg_app_ref_get_name (XDG_APP_REF (ref)),
- xdg_app_ref_get_arch (XDG_APP_REF (ref)),
- xdg_app_ref_get_branch (XDG_APP_REF (ref)),
- xdg_app_ref_get_commit (XDG_APP_REF (ref)),
- xdg_app_installed_ref_get_latest_commit (ref),
- xdg_app_installed_ref_get_origin (ref),
- xdg_app_installed_ref_get_deploy_dir (ref),
- xdg_app_installed_ref_get_is_current (ref),
- xdg_app_installed_ref_get_installed_size (ref));
+ flatpak_ref_get_kind (FLATPAK_REF (ref)),
+ flatpak_ref_get_name (FLATPAK_REF (ref)),
+ flatpak_ref_get_arch (FLATPAK_REF (ref)),
+ flatpak_ref_get_branch (FLATPAK_REF (ref)),
+ flatpak_ref_get_commit (FLATPAK_REF (ref)),
+ flatpak_installed_ref_get_latest_commit (ref),
+ flatpak_installed_ref_get_origin (ref),
+ flatpak_installed_ref_get_deploy_dir (ref),
+ flatpak_installed_ref_get_is_current (ref),
+ flatpak_installed_ref_get_installed_size (ref));
}
}
}
@@ -171,23 +171,23 @@ main (int argc, char *argv[])
{
g_autoptr(GPtrArray) refs = NULL;
- refs = xdg_app_installation_list_installed_refs (installation,
+ refs = flatpak_installation_list_installed_refs (installation,
NULL, NULL);
for (i = 0; i < refs->len; i++)
{
- XdgAppInstalledRef *ref = g_ptr_array_index (refs, i);
+ FlatpakInstalledRef *ref = g_ptr_array_index (refs, i);
g_print ("%d %s %s %s %s %s %s %s %d %"G_GUINT64_FORMAT "\n",
- xdg_app_ref_get_kind (XDG_APP_REF (ref)),
- xdg_app_ref_get_name (XDG_APP_REF (ref)),
- xdg_app_ref_get_arch (XDG_APP_REF (ref)),
- xdg_app_ref_get_branch (XDG_APP_REF (ref)),
- xdg_app_ref_get_commit (XDG_APP_REF (ref)),
- xdg_app_installed_ref_get_latest_commit (ref),
- xdg_app_installed_ref_get_origin (ref),
- xdg_app_installed_ref_get_deploy_dir (ref),
- xdg_app_installed_ref_get_is_current (ref),
- xdg_app_installed_ref_get_installed_size (ref));
+ flatpak_ref_get_kind (FLATPAK_REF (ref)),
+ flatpak_ref_get_name (FLATPAK_REF (ref)),
+ flatpak_ref_get_arch (FLATPAK_REF (ref)),
+ flatpak_ref_get_branch (FLATPAK_REF (ref)),
+ flatpak_ref_get_commit (FLATPAK_REF (ref)),
+ flatpak_installed_ref_get_latest_commit (ref),
+ flatpak_installed_ref_get_origin (ref),
+ flatpak_installed_ref_get_deploy_dir (ref),
+ flatpak_installed_ref_get_is_current (ref),
+ flatpak_installed_ref_get_installed_size (ref));
}
}
@@ -195,26 +195,26 @@ main (int argc, char *argv[])
{
g_autoptr(GPtrArray) apps = NULL;
- apps = xdg_app_installation_list_installed_refs_by_kind (installation,
- XDG_APP_REF_KIND_APP,
+ apps = flatpak_installation_list_installed_refs_by_kind (installation,
+ FLATPAK_REF_KIND_APP,
NULL, NULL);
for (i = 0; i < apps->len; i++)
{
- XdgAppInstalledRef *app = g_ptr_array_index (apps, i);
+ FlatpakInstalledRef *app = g_ptr_array_index (apps, i);
g_print ("%d %s %s %s %s %s %s %s %d %"G_GUINT64_FORMAT "\n",
- xdg_app_ref_get_kind (XDG_APP_REF (app)),
- xdg_app_ref_get_name (XDG_APP_REF (app)),
- xdg_app_ref_get_arch (XDG_APP_REF (app)),
- xdg_app_ref_get_branch (XDG_APP_REF (app)),
- xdg_app_ref_get_commit (XDG_APP_REF (app)),
- xdg_app_installed_ref_get_latest_commit (app),
- xdg_app_installed_ref_get_origin (app),
- xdg_app_installed_ref_get_deploy_dir (app),
- xdg_app_installed_ref_get_is_current (app),
- xdg_app_installed_ref_get_installed_size (app));
- g_print ("metadata:\n%s\n", (char *) g_bytes_get_data (xdg_app_installed_ref_load_metadata (app, NULL, NULL), NULL));
+ flatpak_ref_get_kind (FLATPAK_REF (app)),
+ flatpak_ref_get_name (FLATPAK_REF (app)),
+ flatpak_ref_get_arch (FLATPAK_REF (app)),
+ flatpak_ref_get_branch (FLATPAK_REF (app)),
+ flatpak_ref_get_commit (FLATPAK_REF (app)),
+ flatpak_installed_ref_get_latest_commit (app),
+ flatpak_installed_ref_get_origin (app),
+ flatpak_installed_ref_get_deploy_dir (app),
+ flatpak_installed_ref_get_is_current (app),
+ flatpak_installed_ref_get_installed_size (app));
+ g_print ("metadata:\n%s\n", (char *) g_bytes_get_data (flatpak_installed_ref_load_metadata (app, NULL, NULL), NULL));
}
}
@@ -222,43 +222,43 @@ main (int argc, char *argv[])
{
g_autoptr(GPtrArray) runtimes = NULL;
- runtimes = xdg_app_installation_list_installed_refs_by_kind (installation,
- XDG_APP_REF_KIND_RUNTIME,
+ runtimes = flatpak_installation_list_installed_refs_by_kind (installation,
+ FLATPAK_REF_KIND_RUNTIME,
NULL, NULL);
for (i = 0; i < runtimes->len; i++)
{
- XdgAppInstalledRef *runtime = g_ptr_array_index (runtimes, i);
+ FlatpakInstalledRef *runtime = g_ptr_array_index (runtimes, i);
g_print ("%d %s %s %s %s %s %s %d\n",
- xdg_app_ref_get_kind (XDG_APP_REF (runtime)),
- xdg_app_ref_get_name (XDG_APP_REF (runtime)),
- xdg_app_ref_get_arch (XDG_APP_REF (runtime)),
- xdg_app_ref_get_branch (XDG_APP_REF (runtime)),
- xdg_app_ref_get_commit (XDG_APP_REF (runtime)),
- xdg_app_installed_ref_get_origin (runtime),
- xdg_app_installed_ref_get_deploy_dir (runtime),
- xdg_app_installed_ref_get_is_current (runtime));
+ flatpak_ref_get_kind (FLATPAK_REF (runtime)),
+ flatpak_ref_get_name (FLATPAK_REF (runtime)),
+ flatpak_ref_get_arch (FLATPAK_REF (runtime)),
+ flatpak_ref_get_branch (FLATPAK_REF (runtime)),
+ flatpak_ref_get_commit (FLATPAK_REF (runtime)),
+ flatpak_installed_ref_get_origin (runtime),
+ flatpak_installed_ref_get_deploy_dir (runtime),
+ flatpak_installed_ref_get_is_current (runtime));
}
}
g_print ("\n**** Getting installed gedit master\n");
- app1 = xdg_app_installation_get_installed_ref (installation,
- XDG_APP_REF_KIND_APP,
+ app1 = flatpak_installation_get_installed_ref (installation,
+ FLATPAK_REF_KIND_APP,
"org.gnome.gedit",
NULL, "master", NULL, NULL);
if (app1)
{
g_print ("gedit master: %d %s %s %s %s %s %s %d\n",
- xdg_app_ref_get_kind (XDG_APP_REF (app1)),
- xdg_app_ref_get_name (XDG_APP_REF (app1)),
- xdg_app_ref_get_arch (XDG_APP_REF (app1)),
- xdg_app_ref_get_branch (XDG_APP_REF (app1)),
- xdg_app_ref_get_commit (XDG_APP_REF (app1)),
- xdg_app_installed_ref_get_origin (app1),
- xdg_app_installed_ref_get_deploy_dir (app1),
- xdg_app_installed_ref_get_is_current (app1));
+ flatpak_ref_get_kind (FLATPAK_REF (app1)),
+ flatpak_ref_get_name (FLATPAK_REF (app1)),
+ flatpak_ref_get_arch (FLATPAK_REF (app1)),
+ flatpak_ref_get_branch (FLATPAK_REF (app1)),
+ flatpak_ref_get_commit (FLATPAK_REF (app1)),
+ flatpak_installed_ref_get_origin (app1),
+ flatpak_installed_ref_get_deploy_dir (app1),
+ flatpak_installed_ref_get_is_current (app1));
}
- if (!xdg_app_installation_launch (installation,
+ if (!flatpak_installation_launch (installation,
"org.gnome.gedit",
NULL, NULL, NULL,
NULL, &error))
@@ -268,63 +268,63 @@ main (int argc, char *argv[])
}
g_print ("\n**** Getting current installed gedit\n");
- app2 = xdg_app_installation_get_current_installed_app (installation,
+ app2 = flatpak_installation_get_current_installed_app (installation,
"org.gnome.gedit",
NULL, NULL);
if (app2)
{
g_print ("gedit current: %d %s %s %s %s %s %s %d\n",
- xdg_app_ref_get_kind (XDG_APP_REF (app2)),
- xdg_app_ref_get_name (XDG_APP_REF (app2)),
- xdg_app_ref_get_arch (XDG_APP_REF (app2)),
- xdg_app_ref_get_branch (XDG_APP_REF (app2)),
- xdg_app_ref_get_commit (XDG_APP_REF (app2)),
- xdg_app_installed_ref_get_origin (app2),
- xdg_app_installed_ref_get_deploy_dir (app2),
- xdg_app_installed_ref_get_is_current (app2));
+ flatpak_ref_get_kind (FLATPAK_REF (app2)),
+ flatpak_ref_get_name (FLATPAK_REF (app2)),
+ flatpak_ref_get_arch (FLATPAK_REF (app2)),
+ flatpak_ref_get_branch (FLATPAK_REF (app2)),
+ flatpak_ref_get_commit (FLATPAK_REF (app2)),
+ flatpak_installed_ref_get_origin (app2),
+ flatpak_installed_ref_get_deploy_dir (app2),
+ flatpak_installed_ref_get_is_current (app2));
}
g_print ("\n**** Listing remotes\n");
- remotes = xdg_app_installation_list_remotes (installation,
+ remotes = flatpak_installation_list_remotes (installation,
NULL, NULL);
for (i = 0; i < remotes->len; i++)
{
- XdgAppRemote *remote = g_ptr_array_index (remotes, i);
+ FlatpakRemote *remote = g_ptr_array_index (remotes, i);
g_autoptr(GPtrArray) refs = NULL;
g_print ("\nRemote: %s %d %s %s %d %d %s\n",
- xdg_app_remote_get_name (remote),
- xdg_app_remote_get_prio (remote),
- xdg_app_remote_get_url (remote),
- xdg_app_remote_get_title (remote),
- xdg_app_remote_get_gpg_verify (remote),
- xdg_app_remote_get_noenumerate (remote),
- g_file_get_path (xdg_app_remote_get_appstream_dir (remote, NULL)));
-
- g_print ("\n**** Listing remote refs on %s\n", xdg_app_remote_get_name (remote));
- refs = xdg_app_installation_list_remote_refs_sync (installation, xdg_app_remote_get_name (remote),
+ flatpak_remote_get_name (remote),
+ flatpak_remote_get_prio (remote),
+ flatpak_remote_get_url (remote),
+ flatpak_remote_get_title (remote),
+ flatpak_remote_get_gpg_verify (remote),
+ flatpak_remote_get_noenumerate (remote),
+ g_file_get_path (flatpak_remote_get_appstream_dir (remote, NULL)));
+
+ g_print ("\n**** Listing remote refs on %s\n", flatpak_remote_get_name (remote));
+ refs = flatpak_installation_list_remote_refs_sync (installation, flatpak_remote_get_name (remote),
NULL, NULL);
if (refs)
{
for (j = 0; j < refs->len; j++)
{
- XdgAppRemoteRef *ref = g_ptr_array_index (refs, j);
+ FlatpakRemoteRef *ref = g_ptr_array_index (refs, j);
g_print ("%d %s %s %s %s %s\n",
- xdg_app_ref_get_kind (XDG_APP_REF (ref)),
- xdg_app_ref_get_name (XDG_APP_REF (ref)),
- xdg_app_ref_get_arch (XDG_APP_REF (ref)),
- xdg_app_ref_get_branch (XDG_APP_REF (ref)),
- xdg_app_ref_get_commit (XDG_APP_REF (ref)),
- xdg_app_remote_ref_get_remote_name (ref));
+ flatpak_ref_get_kind (FLATPAK_REF (ref)),
+ flatpak_ref_get_name (FLATPAK_REF (ref)),
+ flatpak_ref_get_arch (FLATPAK_REF (ref)),
+ flatpak_ref_get_branch (FLATPAK_REF (ref)),
+ flatpak_ref_get_commit (FLATPAK_REF (ref)),
+ flatpak_remote_ref_get_remote_name (ref));
if (j == 0)
{
guint64 download_size;
guint64 installed_size;
- if (!xdg_app_installation_fetch_remote_size_sync (installation,
- xdg_app_remote_get_name (remote),
- xdg_app_ref_get_commit (XDG_APP_REF (ref)),
+ if (!flatpak_installation_fetch_remote_size_sync (installation,
+ flatpak_remote_get_name (remote),
+ flatpak_ref_get_commit (FLATPAK_REF (ref)),
&download_size,
&installed_size,
NULL, &error))
@@ -338,9 +338,9 @@ main (int argc, char *argv[])
download_size, installed_size);
}
- if (!xdg_app_installation_fetch_remote_size_sync2 (installation,
- xdg_app_remote_get_name (remote),
- XDG_APP_REF (ref),
+ if (!flatpak_installation_fetch_remote_size_sync2 (installation,
+ flatpak_remote_get_name (remote),
+ FLATPAK_REF (ref),
&download_size,
&installed_size,
NULL, &error))
@@ -358,10 +358,10 @@ main (int argc, char *argv[])
}
}
- g_print ("\n**** Getting remote platform 3.20 on %s\n", xdg_app_remote_get_name (remote));
+ g_print ("\n**** Getting remote platform 3.20 on %s\n", flatpak_remote_get_name (remote));
error = NULL;
- remote_ref = xdg_app_installation_fetch_remote_ref_sync (installation, xdg_app_remote_get_name (remote),
- XDG_APP_REF_KIND_RUNTIME,
+ remote_ref = flatpak_installation_fetch_remote_ref_sync (installation, flatpak_remote_get_name (remote),
+ FLATPAK_REF_KIND_RUNTIME,
"org.gnome.Platform", NULL, "3.20",
NULL, &error);
if (remote_ref)
@@ -370,15 +370,15 @@ main (int argc, char *argv[])
GBytes *metadata2;
g_print ("%d %s %s %s %s %s\n",
- xdg_app_ref_get_kind (XDG_APP_REF (remote_ref)),
- xdg_app_ref_get_name (XDG_APP_REF (remote_ref)),
- xdg_app_ref_get_arch (XDG_APP_REF (remote_ref)),
- xdg_app_ref_get_branch (XDG_APP_REF (remote_ref)),
- xdg_app_ref_get_commit (XDG_APP_REF (remote_ref)),
- xdg_app_remote_ref_get_remote_name (remote_ref));
-
- metadata = xdg_app_installation_fetch_remote_metadata_sync (installation, xdg_app_remote_get_name (remote),
- xdg_app_ref_get_commit (XDG_APP_REF (remote_ref)), NULL, &error);
+ flatpak_ref_get_kind (FLATPAK_REF (remote_ref)),
+ flatpak_ref_get_name (FLATPAK_REF (remote_ref)),
+ flatpak_ref_get_arch (FLATPAK_REF (remote_ref)),
+ flatpak_ref_get_branch (FLATPAK_REF (remote_ref)),
+ flatpak_ref_get_commit (FLATPAK_REF (remote_ref)),
+ flatpak_remote_ref_get_remote_name (remote_ref));
+
+ metadata = flatpak_installation_fetch_remote_metadata_sync (installation, flatpak_remote_get_name (remote),
+ flatpak_ref_get_commit (FLATPAK_REF (remote_ref)), NULL, &error);
if (metadata)
{
g_print ("metadata: %s\n", (char *) g_bytes_get_data (metadata, NULL));
@@ -390,8 +390,8 @@ main (int argc, char *argv[])
g_clear_error (&error);
}
- metadata2 = xdg_app_installation_fetch_remote_metadata_sync2 (installation, xdg_app_remote_get_name (remote),
- XDG_APP_REF (remote_ref), NULL, &error);
+ metadata2 = flatpak_installation_fetch_remote_metadata_sync2 (installation, flatpak_remote_get_name (remote),
+ FLATPAK_REF (remote_ref), NULL, &error);
if (metadata2)
{
g_print ("metadata2: %s\n", (char *) g_bytes_get_data (metadata2, NULL));
diff --git a/lib/xdg-app-bundle-ref.c b/lib/xdg-app-bundle-ref.c
index 512eab9..44e9c75 100644
--- a/lib/xdg-app-bundle-ref.c
+++ b/lib/xdg-app-bundle-ref.c
@@ -26,9 +26,9 @@
#include "xdg-app-bundle-ref.h"
#include "xdg-app-enum-types.h"
-typedef struct _XdgAppBundleRefPrivate XdgAppBundleRefPrivate;
+typedef struct _FlatpakBundleRefPrivate FlatpakBundleRefPrivate;
-struct _XdgAppBundleRefPrivate
+struct _FlatpakBundleRefPrivate
{
GFile *file;
char *origin;
@@ -39,7 +39,7 @@ struct _XdgAppBundleRefPrivate
guint64 installed_size;
};
-G_DEFINE_TYPE_WITH_PRIVATE (XdgAppBundleRef, xdg_app_bundle_ref, XDG_APP_TYPE_REF)
+G_DEFINE_TYPE_WITH_PRIVATE (FlatpakBundleRef, flatpak_bundle_ref, FLATPAK_TYPE_REF)
enum {
PROP_0,
@@ -48,10 +48,10 @@ enum {
};
static void
-xdg_app_bundle_ref_finalize (GObject *object)
+flatpak_bundle_ref_finalize (GObject *object)
{
- XdgAppBundleRef *self = XDG_APP_BUNDLE_REF (object);
- XdgAppBundleRefPrivate *priv = xdg_app_bundle_ref_get_instance_private (self);
+ FlatpakBundleRef *self = FLATPAK_BUNDLE_REF (object);
+ FlatpakBundleRefPrivate *priv = flatpak_bundle_ref_get_instance_private (self);
g_clear_object (&priv->file);
@@ -61,17 +61,17 @@ xdg_app_bundle_ref_finalize (GObject *object)
g_bytes_unref (priv->icon_128);
g_free (priv->origin);
- G_OBJECT_CLASS (xdg_app_bundle_ref_parent_class)->finalize (object);
+ G_OBJECT_CLASS (flatpak_bundle_ref_parent_class)->finalize (object);
}
static void
-xdg_app_bundle_ref_set_property (GObject *object,
+flatpak_bundle_ref_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- XdgAppBundleRef *self = XDG_APP_BUNDLE_REF (object);
- XdgAppBundleRefPrivate *priv = xdg_app_bundle_ref_get_instance_private (self);
+ FlatpakBundleRef *self = FLATPAK_BUNDLE_REF (object);
+ FlatpakBundleRefPrivate *priv = flatpak_bundle_ref_get_instance_private (self);
switch (prop_id)
{
@@ -86,13 +86,13 @@ xdg_app_bundle_ref_set_property (GObject *object,
}
static void
-xdg_app_bundle_ref_get_property (GObject *object,
+flatpak_bundle_ref_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- XdgAppBundleRef *self = XDG_APP_BUNDLE_REF (object);
- XdgAppBundleRefPrivate *priv = xdg_app_bundle_ref_get_instance_private (self);
+ FlatpakBundleRef *self = FLATPAK_BUNDLE_REF (object);
+ FlatpakBundleRefPrivate *priv = flatpak_bundle_ref_get_instance_private (self);
switch (prop_id)
{
@@ -107,13 +107,13 @@ xdg_app_bundle_ref_get_property (GObject *object,
}
static void
-xdg_app_bundle_ref_class_init (XdgAppBundleRefClass *klass)
+flatpak_bundle_ref_class_init (FlatpakBundleRefClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->get_property = xdg_app_bundle_ref_get_property;
- object_class->set_property = xdg_app_bundle_ref_set_property;
- object_class->finalize = xdg_app_bundle_ref_finalize;
+ object_class->get_property = flatpak_bundle_ref_get_property;
+ object_class->set_property = flatpak_bundle_ref_set_property;
+ object_class->finalize = flatpak_bundle_ref_finalize;
g_object_class_install_property (object_class,
PROP_FILE,
@@ -125,38 +125,38 @@ xdg_app_bundle_ref_class_init (XdgAppBundleRefClass *klass)
}
static void
-xdg_app_bundle_ref_init (XdgAppBundleRef *self)
+flatpak_bundle_ref_init (FlatpakBundleRef *self)
{
}
/**
- * xdg_app_bundle_ref_get_file:
- * @self: a #XdgAppInstallation
+ * flatpak_bundle_ref_get_file:
+ * @self: a #FlatpakInstallation
*
* Get the file this bundle is stored in.
*
* Returns: (transfer full) : an #GFile
*/
GFile *
-xdg_app_bundle_ref_get_file (XdgAppBundleRef *self)
+flatpak_bundle_ref_get_file (FlatpakBundleRef *self)
{
- XdgAppBundleRefPrivate *priv = xdg_app_bundle_ref_get_instance_private (self);
+ FlatpakBundleRefPrivate *priv = flatpak_bundle_ref_get_instance_private (self);
return g_object_ref (priv->file);
}
/**
- * xdg_app_bundle_ref_get_metadata:
- * @self: a #XdgAppInstallation
+ * flatpak_bundle_ref_get_metadata:
+ * @self: a #FlatpakInstallation
*
* Get the metadata for the app/runtime
*
* Returns: (transfer full) : an #GBytes with the metadata contents, or %NULL
*/
GBytes *
-xdg_app_bundle_ref_get_metadata (XdgAppBundleRef *self)
+flatpak_bundle_ref_get_metadata (FlatpakBundleRef *self)
{
- XdgAppBundleRefPrivate *priv = xdg_app_bundle_ref_get_instance_private (self);
+ FlatpakBundleRefPrivate *priv = flatpak_bundle_ref_get_instance_private (self);
if (priv->metadata)
return g_bytes_ref (priv->metadata);
@@ -164,17 +164,17 @@ xdg_app_bundle_ref_get_metadata (XdgAppBundleRef *self)
}
/**
- * xdg_app_bundle_ref_get_appstream:
- * @self: a #XdgAppInstallation
+ * flatpak_bundle_ref_get_appstream:
+ * @self: a #FlatpakInstallation
*
* Get the compressed appstream for the app/runtime
*
* Returns: (transfer full) : an #GBytes with the appstream contents, or %NULL
*/
GBytes *
-xdg_app_bundle_ref_get_appstream (XdgAppBundleRef *self)
+flatpak_bundle_ref_get_appstream (FlatpakBundleRef *self)
{
- XdgAppBundleRefPrivate *priv = xdg_app_bundle_ref_get_instance_private (self);
+ FlatpakBundleRefPrivate *priv = flatpak_bundle_ref_get_instance_private (self);
if (priv->appstream)
return g_bytes_ref (priv->appstream);
@@ -182,8 +182,8 @@ xdg_app_bundle_ref_get_appstream (XdgAppBundleRef *self)
}
/**
- * xdg_app_bundle_ref_get_icon:
- * @self: a #XdgAppInstallation
+ * flatpak_bundle_ref_get_icon:
+ * @self: a #FlatpakInstallation
* @size: 64 or 128
*
* Get the icon png data for the app/runtime
@@ -191,10 +191,10 @@ xdg_app_bundle_ref_get_appstream (XdgAppBundleRef *self)
* Returns: (transfer full) : an #GBytes with png contents
*/
GBytes *
-xdg_app_bundle_ref_get_icon (XdgAppBundleRef *self,
- int size)
+flatpak_bundle_ref_get_icon (FlatpakBundleRef *self,
+ int size)
{
- XdgAppBundleRefPrivate *priv = xdg_app_bundle_ref_get_instance_private (self);
+ FlatpakBundleRefPrivate *priv = flatpak_bundle_ref_get_instance_private (self);
if (size == 64 && priv->icon_64)
return g_bytes_ref (priv->icon_64);
@@ -206,39 +206,39 @@ xdg_app_bundle_ref_get_icon (XdgAppBundleRef *self,
}
/**
- * xdg_app_bundle_ref_get_origin:
- * @self: a #XdgAppInstallation
+ * flatpak_bundle_ref_get_origin:
+ * @self: a #FlatpakInstallation
*
* Get the origin url stored in the bundle
*
* Returns: (transfer full) : an url string, or %NULL
*/
char *
-xdg_app_bundle_ref_get_origin (XdgAppBundleRef *self)
+flatpak_bundle_ref_get_origin (FlatpakBundleRef *self)
{
- XdgAppBundleRefPrivate *priv = xdg_app_bundle_ref_get_instance_private (self);
+ FlatpakBundleRefPrivate *priv = flatpak_bundle_ref_get_instance_private (self);
return g_strdup (priv->origin);
}
guint64
-xdg_app_bundle_ref_get_installed_size (XdgAppBundleRef *self)
+flatpak_bundle_ref_get_installed_size (FlatpakBundleRef *self)
{
- XdgAppBundleRefPrivate *priv = xdg_app_bundle_ref_get_instance_private (self);
+ FlatpakBundleRefPrivate *priv = flatpak_bundle_ref_get_instance_private (self);
return priv->installed_size;
}
-XdgAppBundleRef *
-xdg_app_bundle_ref_new (GFile *file,
+FlatpakBundleRef *
+flatpak_bundle_ref_new (GFile *file,
GError **error)
{
- XdgAppRefKind kind = XDG_APP_REF_KIND_APP;
- XdgAppBundleRefPrivate *priv;
+ FlatpakRefKind kind = FLATPAK_REF_KIND_APP;
+ FlatpakBundleRefPrivate *priv;
g_auto(GStrv) parts = NULL;
- XdgAppBundleRef *ref;
+ FlatpakBundleRef *ref;
g_autoptr(GVariant) metadata = NULL;
g_autofree char *commit = NULL;
g_autofree char *full_ref = NULL;
@@ -249,12 +249,12 @@ xdg_app_bundle_ref_new (GFile *file,
g_autoptr(GVariant) icon_128 = NULL;
guint64 installed_size;
- metadata = xdg_app_bundle_load (file, &commit, &full_ref, &origin, &installed_size,
+ metadata = flatpak_bundle_load (file, &commit, &full_ref, &origin, &installed_size,
NULL, error);
if (metadata == NULL)
return NULL;
- parts = xdg_app_decompose_ref (full_ref, error);
+ parts = flatpak_decompose_ref (full_ref, error);
if (parts == NULL)
return NULL;
@@ -262,9 +262,9 @@ xdg_app_bundle_ref_new (GFile *file,
metadata_contents = NULL;
if (strcmp (parts[0], "app") != 0)
- kind = XDG_APP_REF_KIND_RUNTIME;
+ kind = FLATPAK_REF_KIND_RUNTIME;
- ref = g_object_new (XDG_APP_TYPE_BUNDLE_REF,
+ ref = g_object_new (FLATPAK_TYPE_BUNDLE_REF,
"kind", kind,
"name", parts[1],
"arch", parts[2],
@@ -272,7 +272,7 @@ xdg_app_bundle_ref_new (GFile *file,
"commit", commit,
"file", file,
NULL);
- priv = xdg_app_bundle_ref_get_instance_private (ref);
+ priv = flatpak_bundle_ref_get_instance_private (ref);
if (metadata_contents)
priv->metadata = g_bytes_new_take (metadata_contents,
diff --git a/lib/xdg-app-bundle-ref.h b/lib/xdg-app-bundle-ref.h
index 33bddc4..32b7875 100644
--- a/lib/xdg-app-bundle-ref.h
+++ b/lib/xdg-app-bundle-ref.h
@@ -18,47 +18,47 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#if !defined(__XDG_APP_H_INSIDE__) && !defined(XDG_APP_COMPILATION)
+#if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION)
#error "Only <xdg-app.h> can be included directly."
#endif
-#ifndef __XDG_APP_BUNDLE_REF_H__
-#define __XDG_APP_BUNDLE_REF_H__
+#ifndef __FLATPAK_BUNDLE_REF_H__
+#define __FLATPAK_BUNDLE_REF_H__
-typedef struct _XdgAppBundleRef XdgAppBundleRef;
+typedef struct _FlatpakBundleRef FlatpakBundleRef;
#include <gio/gio.h>
#include <xdg-app-ref.h>
-#define XDG_APP_TYPE_BUNDLE_REF xdg_app_bundle_ref_get_type ()
-#define XDG_APP_BUNDLE_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XDG_APP_TYPE_BUNDLE_REF, XdgAppBundleRef))
-#define XDG_APP_IS_BUNDLE_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XDG_APP_TYPE_BUNDLE_REF))
+#define FLATPAK_TYPE_BUNDLE_REF flatpak_bundle_ref_get_type ()
+#define FLATPAK_BUNDLE_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_BUNDLE_REF, FlatpakBundleRef))
+#define FLATPAK_IS_BUNDLE_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_BUNDLE_REF))
-XDG_APP_EXTERN GType xdg_app_bundle_ref_get_type (void);
+FLATPAK_EXTERN GType flatpak_bundle_ref_get_type (void);
-struct _XdgAppBundleRef
+struct _FlatpakBundleRef
{
- XdgAppRef parent;
+ FlatpakRef parent;
};
typedef struct
{
- XdgAppRefClass parent_class;
-} XdgAppBundleRefClass;
+ FlatpakRefClass parent_class;
+} FlatpakBundleRefClass;
-XDG_APP_EXTERN XdgAppBundleRef *xdg_app_bundle_ref_new (GFile *file,
- GError **error);
-XDG_APP_EXTERN GFile *xdg_app_bundle_ref_get_file (XdgAppBundleRef *self);
-XDG_APP_EXTERN GBytes *xdg_app_bundle_ref_get_metadata (XdgAppBundleRef *self);
-XDG_APP_EXTERN GBytes *xdg_app_bundle_ref_get_appstream (XdgAppBundleRef *self);
-XDG_APP_EXTERN GBytes *xdg_app_bundle_ref_get_icon (XdgAppBundleRef *self,
- int size);
-XDG_APP_EXTERN char *xdg_app_bundle_ref_get_origin (XdgAppBundleRef *self);
-XDG_APP_EXTERN guint64 xdg_app_bundle_ref_get_installed_size (XdgAppBundleRef *self);
+FLATPAK_EXTERN FlatpakBundleRef *flatpak_bundle_ref_new (GFile *file,
+ GError **error);
+FLATPAK_EXTERN GFile *flatpak_bundle_ref_get_file (FlatpakBundleRef *self);
+FLATPAK_EXTERN GBytes *flatpak_bundle_ref_get_metadata (FlatpakBundleRef *self);
+FLATPAK_EXTERN GBytes *flatpak_bundle_ref_get_appstream (FlatpakBundleRef *self);
+FLATPAK_EXTERN GBytes *flatpak_bundle_ref_get_icon (FlatpakBundleRef *self,
+ int size);
+FLATPAK_EXTERN char *flatpak_bundle_ref_get_origin (FlatpakBundleRef *self);
+FLATPAK_EXTERN guint64 flatpak_bundle_ref_get_installed_size (FlatpakBundleRef *self);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (XdgAppBundleRef, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakBundleRef, g_object_unref)
#endif
-#endif /* __XDG_APP_BUNDLE_REF_H__ */
+#endif /* __FLATPAK_BUNDLE_REF_H__ */
diff --git a/lib/xdg-app-enum-types.h.template b/lib/xdg-app-enum-types.h.template
index 867d7c8..5b67b9c 100644
--- a/lib/xdg-app-enum-types.h.template
+++ b/lib/xdg-app-enum-types.h.template
@@ -1,6 +1,6 @@
/*** BEGIN file-header ***/
-#ifndef __XDG_APP_ENUM_TYPES_H__
-#define __XDG_APP_ENUM_TYPES_H__
+#ifndef __FLATPAK_ENUM_TYPES_H__
+#define __FLATPAK_ENUM_TYPES_H__
#include <glib-object.h>
@@ -13,7 +13,7 @@ G_BEGIN_DECLS
/*** END file-production ***/
/*** BEGIN value-header ***/
-XDG_APP_EXTERN GType @enum_name@_get_type (void) G_GNUC_CONST;
+FLATPAK_EXTERN GType @enum_name@_get_type (void) G_GNUC_CONST;
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
/*** END value-header ***/
diff --git a/lib/xdg-app-error.c b/lib/xdg-app-error.c
index e74c8a1..47ffeba 100644
--- a/lib/xdg-app-error.c
+++ b/lib/xdg-app-error.c
@@ -31,4 +31,4 @@
*
*/
-G_DEFINE_QUARK (xdg - app - error - quark, xdg_app_error)
+G_DEFINE_QUARK (xdg - app - error - quark, flatpak_error)
diff --git a/lib/xdg-app-error.h b/lib/xdg-app-error.h
index 149ef97..9c7b593 100644
--- a/lib/xdg-app-error.h
+++ b/lib/xdg-app-error.h
@@ -19,29 +19,29 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#ifndef XDG_APP_ERROR_H
-#define XDG_APP_ERROR_H
+#ifndef FLATPAK_ERROR_H
+#define FLATPAK_ERROR_H
#include <glib.h>
G_BEGIN_DECLS
/**
- * XdgAppError:
- * @XDG_APP_ERROR_ALREADY_INSTALLED: App/runtime is already installed
- * @XDG_APP_ERROR_NOT_INSTALLED: App/runtime is not installed
+ * FlatpakError:
+ * @FLATPAK_ERROR_ALREADY_INSTALLED: App/runtime is already installed
+ * @FLATPAK_ERROR_NOT_INSTALLED: App/runtime is not installed
*
* Error codes for library functions.
*/
typedef enum {
- XDG_APP_ERROR_ALREADY_INSTALLED,
- XDG_APP_ERROR_NOT_INSTALLED,
-} XdgAppError;
+ FLATPAK_ERROR_ALREADY_INSTALLED,
+ FLATPAK_ERROR_NOT_INSTALLED,
+} FlatpakError;
-#define XDG_APP_ERROR xdg_app_error_quark ()
+#define FLATPAK_ERROR flatpak_error_quark ()
-XDG_APP_EXTERN GQuark xdg_app_error_quark (void);
+FLATPAK_EXTERN GQuark flatpak_error_quark (void);
G_END_DECLS
-#endif /* XDG_APP_ERROR_H */
+#endif /* FLATPAK_ERROR_H */
diff --git a/lib/xdg-app-installation.c b/lib/xdg-app-installation.c
index 9f0a7da..ca9c14c 100644
--- a/lib/xdg-app-installation.c
+++ b/lib/xdg-app-installation.c
@@ -35,47 +35,47 @@
/**
* SECTION:xdg-app-installation
- * @Title: XdgAppInstallation
+ * @Title: FlatpakInstallation
* @Short_description: Installation information
*
- * XdgAppInstallation is the toplevel object that software installers
+ * FlatpakInstallation is the toplevel object that software installers
* should use to operate on an xdg-apps.
*
- * An XdgAppInstallation object provides information about an installation
+ * An FlatpakInstallation object provides information about an installation
* location for xdg-app applications. Typical installation locations are either
* system-wide (in /var/lib/xdg-app) or per-user (in ~/.local/share/xdg-app).
*
- * XdgAppInstallation can list configured remotes as well as installed application
+ * FlatpakInstallation can list configured remotes as well as installed application
* and runtime references (in short: refs). It can also run, install, update and
* uninstall applications and runtimes.
*/
-typedef struct _XdgAppInstallationPrivate XdgAppInstallationPrivate;
+typedef struct _FlatpakInstallationPrivate FlatpakInstallationPrivate;
-struct _XdgAppInstallationPrivate
+struct _FlatpakInstallationPrivate
{
- XdgAppDir *dir;
+ FlatpakDir *dir;
};
-G_DEFINE_TYPE_WITH_PRIVATE (XdgAppInstallation, xdg_app_installation, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (FlatpakInstallation, flatpak_installation, G_TYPE_OBJECT)
enum {
PROP_0,
};
static void
-xdg_app_installation_finalize (GObject *object)
+flatpak_installation_finalize (GObject *object)
{
- XdgAppInstallation *self = XDG_APP_INSTALLATION (object);
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallation *self = FLATPAK_INSTALLATION (object);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_object_unref (priv->dir);
- G_OBJECT_CLASS (xdg_app_installation_parent_class)->finalize (object);
+ G_OBJECT_CLASS (flatpak_installation_parent_class)->finalize (object);
}
static void
-xdg_app_installation_set_property (GObject *object,
+flatpak_installation_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
@@ -90,7 +90,7 @@ xdg_app_installation_set_property (GObject *object,
}
static void
-xdg_app_installation_get_property (GObject *object,
+flatpak_installation_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
@@ -105,37 +105,37 @@ xdg_app_installation_get_property (GObject *object,
}
static void
-xdg_app_installation_class_init (XdgAppInstallationClass *klass)
+flatpak_installation_class_init (FlatpakInstallationClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->get_property = xdg_app_installation_get_property;
- object_class->set_property = xdg_app_installation_set_property;
- object_class->finalize = xdg_app_installation_finalize;
+ object_class->get_property = flatpak_installation_get_property;
+ object_class->set_property = flatpak_installation_set_property;
+ object_class->finalize = flatpak_installation_finalize;
}
static void
-xdg_app_installation_init (XdgAppInstallation *self)
+flatpak_installation_init (FlatpakInstallation *self)
{
}
-static XdgAppInstallation *
-xdg_app_installation_new_for_dir (XdgAppDir *dir,
+static FlatpakInstallation *
+flatpak_installation_new_for_dir (FlatpakDir *dir,
GCancellable *cancellable,
GError **error)
{
- XdgAppInstallation *self;
- XdgAppInstallationPrivate *priv;
+ FlatpakInstallation *self;
+ FlatpakInstallationPrivate *priv;
- if (!xdg_app_dir_ensure_repo (dir, NULL, error))
+ if (!flatpak_dir_ensure_repo (dir, NULL, error))
{
g_object_unref (dir);
return NULL;
}
- self = g_object_new (XDG_APP_TYPE_INSTALLATION, NULL);
- priv = xdg_app_installation_get_instance_private (self);
+ self = g_object_new (FLATPAK_TYPE_INSTALLATION, NULL);
+ priv = flatpak_installation_get_instance_private (self);
priv->dir = dir;
@@ -143,104 +143,104 @@ xdg_app_installation_new_for_dir (XdgAppDir *dir,
}
/**
- * xdg_app_get_default_arch:
+ * flatpak_get_default_arch:
*
* Returns the canonical name for the arch of the current machine.
*
* Returns: an arch string
*/
const char *
-xdg_app_get_default_arch (void)
+flatpak_get_default_arch (void)
{
- return xdg_app_get_arch ();
+ return flatpak_get_arch ();
}
/**
- * xdg_app_installation_new_system:
+ * flatpak_installation_new_system:
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
- * Creates a new #XdgAppInstallation for the system-wide installation.
+ * Creates a new #FlatpakInstallation for the system-wide installation.
*
- * Returns: (transfer full): a new #XdgAppInstallation
+ * Returns: (transfer full): a new #FlatpakInstallation
*/
-XdgAppInstallation *
-xdg_app_installation_new_system (GCancellable *cancellable,
+FlatpakInstallation *
+flatpak_installation_new_system (GCancellable *cancellable,
GError **error)
{
- return xdg_app_installation_new_for_dir (xdg_app_dir_get_system (), cancellable, error);
+ return flatpak_installation_new_for_dir (flatpak_dir_get_system (), cancellable, error);
}
/**
- * xdg_app_installation_new_user:
+ * flatpak_installation_new_user:
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
- * Creates a new #XdgAppInstallation for the per-user installation.
+ * Creates a new #FlatpakInstallation for the per-user installation.
*
- * Returns: (transfer full): a new #XdgAppInstallation
+ * Returns: (transfer full): a new #FlatpakInstallation
*/
-XdgAppInstallation *
-xdg_app_installation_new_user (GCancellable *cancellable,
+FlatpakInstallation *
+flatpak_installation_new_user (GCancellable *cancellable,
GError **error)
{
- return xdg_app_installation_new_for_dir (xdg_app_dir_get_user (), cancellable, error);
+ return flatpak_installation_new_for_dir (flatpak_dir_get_user (), cancellable, error);
}
/**
- * xdg_app_installation_new_for_path:
+ * flatpak_installation_new_for_path:
* @path: a #GFile
* @user: whether this is a user-specific location
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
- * Creates a new #XdgAppInstallation for the installation at the given @path.
+ * Creates a new #FlatpakInstallation for the installation at the given @path.
*
- * Returns: (transfer full): a new #XdgAppInstallation
+ * Returns: (transfer full): a new #FlatpakInstallation
*/
-XdgAppInstallation *
-xdg_app_installation_new_for_path (GFile *path, gboolean user,
+FlatpakInstallation *
+flatpak_installation_new_for_path (GFile *path, gboolean user,
GCancellable *cancellable,
GError **error)
{
- return xdg_app_installation_new_for_dir (xdg_app_dir_new (path, user), cancellable, error);
+ return flatpak_installation_new_for_dir (flatpak_dir_new (path, user), cancellable, error);
}
/**
- * xdg_app_installation_get_is_user:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_get_is_user:
+ * @self: a #FlatpakInstallation
*
* Returns whether the installation is for a user-specific location.
*
* Returns: %TRUE if @self is a per-user installation
*/
gboolean
-xdg_app_installation_get_is_user (XdgAppInstallation *self)
+flatpak_installation_get_is_user (FlatpakInstallation *self)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
- return xdg_app_dir_is_user (priv->dir);
+ return flatpak_dir_is_user (priv->dir);
}
/**
- * xdg_app_installation_get_path:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_get_path:
+ * @self: a #FlatpakInstallation
*
* Returns the installation location for @self.
*
* Returns: (transfer full): an #GFile
*/
GFile *
-xdg_app_installation_get_path (XdgAppInstallation *self)
+flatpak_installation_get_path (FlatpakInstallation *self)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
- return g_object_ref (xdg_app_dir_get_path (priv->dir));
+ return g_object_ref (flatpak_dir_get_path (priv->dir));
}
/**
- * xdg_app_installation_launch:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_launch:
+ * @self: a #FlatpakInstallation
* @name: name of the app to launch
* @arch: (nullable): which architecture to launch (default: current architecture)
* @branch: (nullable): which branch of the application (default: "master")
@@ -250,53 +250,53 @@ xdg_app_installation_get_path (XdgAppInstallation *self)
*
* Launch an installed application.
*
- * You can use xdg_app_installation_get_installed_ref() or
- * xdg_app_installation_get_current_installed_app() to find out what builds
+ * You can use flatpak_installation_get_installed_ref() or
+ * flatpak_installation_get_current_installed_app() to find out what builds
* are available, in order to get a value for @commit.
*
* Returns: %TRUE, unless an error occurred
*/
gboolean
-xdg_app_installation_launch (XdgAppInstallation *self,
- const char *name,
- const char *arch,
- const char *branch,
- const char *commit,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_launch (FlatpakInstallation *self,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ const char *commit,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autofree char *app_ref = NULL;
- g_autoptr(XdgAppDeploy) app_deploy = NULL;
+ g_autoptr(FlatpakDeploy) app_deploy = NULL;
app_ref =
- xdg_app_build_app_ref (name, branch, arch);
+ flatpak_build_app_ref (name, branch, arch);
app_deploy =
- xdg_app_dir_load_deployed (priv->dir, app_ref,
+ flatpak_dir_load_deployed (priv->dir, app_ref,
commit,
cancellable, error);
if (app_deploy == NULL)
return FALSE;
- return xdg_app_run_app (app_ref,
+ return flatpak_run_app (app_ref,
app_deploy,
NULL, NULL,
NULL,
- XDG_APP_RUN_FLAG_BACKGROUND,
+ FLATPAK_RUN_FLAG_BACKGROUND,
NULL,
NULL, 0,
cancellable, error);
}
-static XdgAppInstalledRef *
-get_ref (XdgAppInstallation *self,
- const char *full_ref,
- GCancellable *cancellable)
+static FlatpakInstalledRef *
+get_ref (FlatpakInstallation *self,
+ const char *full_ref,
+ GCancellable *cancellable)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_auto(GStrv) parts = NULL;
const char *origin = NULL;
@@ -312,27 +312,27 @@ get_ref (XdgAppInstallation *self,
parts = g_strsplit (full_ref, "/", -1);
- deploy_data = xdg_app_dir_get_deploy_data (priv->dir, full_ref, cancellable, NULL);
- origin = xdg_app_deploy_data_get_origin (deploy_data);
- commit = xdg_app_deploy_data_get_commit (deploy_data);
- subpaths = xdg_app_deploy_data_get_subpaths (deploy_data);
- installed_size = xdg_app_deploy_data_get_installed_size (deploy_data);
+ deploy_data = flatpak_dir_get_deploy_data (priv->dir, full_ref, cancellable, NULL);
+ origin = flatpak_deploy_data_get_origin (deploy_data);
+ commit = flatpak_deploy_data_get_commit (deploy_data);
+ subpaths = flatpak_deploy_data_get_subpaths (deploy_data);
+ installed_size = flatpak_deploy_data_get_installed_size (deploy_data);
- deploy_dir = xdg_app_dir_get_deploy_dir (priv->dir, full_ref);
+ deploy_dir = flatpak_dir_get_deploy_dir (priv->dir, full_ref);
deploy_subdir = g_file_get_child (deploy_dir, commit);
deploy_path = g_file_get_path (deploy_subdir);
if (strcmp (parts[0], "app") == 0)
{
g_autofree char *current =
- xdg_app_dir_current_ref (priv->dir, parts[1], cancellable);
+ flatpak_dir_current_ref (priv->dir, parts[1], cancellable);
if (current && strcmp (full_ref, current) == 0)
is_current = TRUE;
}
- latest_commit = xdg_app_dir_read_latest (priv->dir, origin, full_ref, NULL, NULL);
+ latest_commit = flatpak_dir_read_latest (priv->dir, origin, full_ref, NULL, NULL);
- return xdg_app_installed_ref_new (full_ref,
+ return flatpak_installed_ref_new (full_ref,
commit,
latest_commit,
origin, subpaths,
@@ -342,8 +342,8 @@ get_ref (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_get_installed_ref:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_get_installed_ref:
+ * @self: a #FlatpakInstallation
* @kind: whether this is an app or runtime
* @name: name of the app/runtime to fetch
* @arch: (nullable): which architecture to fetch (default: current architecture)
@@ -354,32 +354,32 @@ get_ref (XdgAppInstallation *self,
* Returns information about an installed ref, such as the available builds,
* its size, location, etc.
*
- * Returns: (transfer full): an #XdgAppInstalledRef, or %NULL if an error occurred
+ * Returns: (transfer full): an #FlatpakInstalledRef, or %NULL if an error occurred
*/
-XdgAppInstalledRef *
-xdg_app_installation_get_installed_ref (XdgAppInstallation *self,
- XdgAppRefKind kind,
- const char *name,
- const char *arch,
- const char *branch,
- GCancellable *cancellable,
- GError **error)
+FlatpakInstalledRef *
+flatpak_installation_get_installed_ref (FlatpakInstallation *self,
+ FlatpakRefKind kind,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autoptr(GFile) deploy = NULL;
g_autofree char *ref = NULL;
if (arch == NULL)
- arch = xdg_app_get_arch ();
+ arch = flatpak_get_arch ();
- if (kind == XDG_APP_REF_KIND_APP)
- ref = xdg_app_build_app_ref (name, branch, arch);
+ if (kind == FLATPAK_REF_KIND_APP)
+ ref = flatpak_build_app_ref (name, branch, arch);
else
- ref = xdg_app_build_runtime_ref (name, branch, arch);
+ ref = flatpak_build_runtime_ref (name, branch, arch);
- deploy = xdg_app_dir_get_if_deployed (priv->dir,
+ deploy = flatpak_dir_get_if_deployed (priv->dir,
ref, NULL, cancellable);
if (deploy == NULL)
{
@@ -392,32 +392,32 @@ xdg_app_installation_get_installed_ref (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_get_current_installed_app:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_get_current_installed_app:
+ * @self: a #FlatpakInstallation
* @name: the name of the app
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
* Get the last build of reference @name that was installed with
- * xdg_app_installation_install(), or %NULL if the reference has
+ * flatpak_installation_install(), or %NULL if the reference has
* never been installed locally.
*
- * Returns: (transfer full): an #XdgAppInstalledRef
+ * Returns: (transfer full): an #FlatpakInstalledRef
*/
-XdgAppInstalledRef *
-xdg_app_installation_get_current_installed_app (XdgAppInstallation *self,
- const char *name,
- GCancellable *cancellable,
- GError **error)
+FlatpakInstalledRef *
+flatpak_installation_get_current_installed_app (FlatpakInstallation *self,
+ const char *name,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autoptr(GFile) deploy = NULL;
g_autofree char *current =
- xdg_app_dir_current_ref (priv->dir, name, cancellable);
+ flatpak_dir_current_ref (priv->dir, name, cancellable);
if (current)
- deploy = xdg_app_dir_get_if_deployed (priv->dir,
+ deploy = flatpak_dir_get_if_deployed (priv->dir,
current, NULL, cancellable);
if (deploy == NULL)
@@ -431,29 +431,29 @@ xdg_app_installation_get_current_installed_app (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_list_installed_refs:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_list_installed_refs:
+ * @self: a #FlatpakInstallation
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
* Lists the installed references.
*
- * Returns: (transfer container) (element-type XdgAppInstalledRef): an GPtrArray of
- * #XdgAppInstalledRef instances
+ * Returns: (transfer container) (element-type FlatpakInstalledRef): an GPtrArray of
+ * #FlatpakInstalledRef instances
*/
GPtrArray *
-xdg_app_installation_list_installed_refs (XdgAppInstallation *self,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_list_installed_refs (FlatpakInstallation *self,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_auto(GStrv) raw_refs_app = NULL;
g_auto(GStrv) raw_refs_runtime = NULL;
g_autoptr(GPtrArray) refs = g_ptr_array_new_with_free_func (g_object_unref);
int i;
- if (!xdg_app_dir_list_refs (priv->dir,
+ if (!flatpak_dir_list_refs (priv->dir,
"app",
&raw_refs_app,
cancellable, error))
@@ -463,7 +463,7 @@ xdg_app_installation_list_installed_refs (XdgAppInstallation *self,
g_ptr_array_add (refs,
get_ref (self, raw_refs_app[i], cancellable));
- if (!xdg_app_dir_list_refs (priv->dir,
+ if (!flatpak_dir_list_refs (priv->dir,
"runtime",
&raw_refs_runtime,
cancellable, error))
@@ -477,31 +477,31 @@ xdg_app_installation_list_installed_refs (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_list_installed_refs_by_kind:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_list_installed_refs_by_kind:
+ * @self: a #FlatpakInstallation
* @kind: the kind of installation
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
* Lists the installed references of a specific kind.
*
- * Returns: (transfer container) (element-type XdgAppInstalledRef): an GPtrArray of
- * #XdgAppInstalledRef instances
+ * Returns: (transfer container) (element-type FlatpakInstalledRef): an GPtrArray of
+ * #FlatpakInstalledRef instances
*/
GPtrArray *
-xdg_app_installation_list_installed_refs_by_kind (XdgAppInstallation *self,
- XdgAppRefKind kind,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_list_installed_refs_by_kind (FlatpakInstallation *self,
+ FlatpakRefKind kind,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_auto(GStrv) raw_refs = NULL;
g_autoptr(GPtrArray) refs = g_ptr_array_new_with_free_func (g_object_unref);
int i;
- if (!xdg_app_dir_list_refs (priv->dir,
- kind == XDG_APP_REF_KIND_APP ? "app" : "runtime",
+ if (!flatpak_dir_list_refs (priv->dir,
+ kind == FLATPAK_REF_KIND_APP ? "app" : "runtime",
&raw_refs,
cancellable, error))
return NULL;
@@ -514,8 +514,8 @@ xdg_app_installation_list_installed_refs_by_kind (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_list_installed_refs_for_update:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_list_installed_refs_for_update:
+ * @self: a #FlatpakInstallation
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
@@ -524,13 +524,13 @@ xdg_app_installation_list_installed_refs_by_kind (XdgAppInstallation *self,
* it can have local updates available that has not been deployed. Look
* at commit vs latest_commit on installed apps for this.
*
- * Returns: (transfer container) (element-type XdgAppInstalledRef): an GPtrArray of
- * #XdgAppInstalledRef instances
+ * Returns: (transfer container) (element-type FlatpakInstalledRef): an GPtrArray of
+ * #FlatpakInstalledRef instances
*/
GPtrArray *
-xdg_app_installation_list_installed_refs_for_update (XdgAppInstallation *self,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_list_installed_refs_for_update (FlatpakInstallation *self,
+ GCancellable *cancellable,
+ GError **error)
{
g_autoptr(GPtrArray) updates = NULL;
g_autoptr(GPtrArray) installed = NULL;
@@ -539,42 +539,42 @@ xdg_app_installation_list_installed_refs_for_update (XdgAppInstallation *self,
int i, j;
ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
- remotes = xdg_app_installation_list_remotes (self, cancellable, error);
+ remotes = flatpak_installation_list_remotes (self, cancellable, error);
if (remotes == NULL)
return NULL;
for (i = 0; i < remotes->len; i++)
{
- XdgAppRemote *remote = g_ptr_array_index (remotes, i);
+ FlatpakRemote *remote = g_ptr_array_index (remotes, i);
g_autoptr(GPtrArray) refs = NULL;
g_autoptr(GError) local_error = NULL;
/* We ignore errors here. we don't want one remote to fail us */
- refs = xdg_app_installation_list_remote_refs_sync (self,
- xdg_app_remote_get_name (remote),
+ refs = flatpak_installation_list_remote_refs_sync (self,
+ flatpak_remote_get_name (remote),
cancellable, &local_error);
if (refs != NULL)
{
for (j = 0; j < refs->len; j++)
{
- XdgAppRemoteRef *remote_ref = g_ptr_array_index (refs, j);
- g_autofree char *full_ref = xdg_app_ref_format_ref (XDG_APP_REF (remote_ref));
- g_autofree char *key = g_strdup_printf ("%s:%s", xdg_app_remote_get_name (remote),
+ FlatpakRemoteRef *remote_ref = g_ptr_array_index (refs, j);
+ g_autofree char *full_ref = flatpak_ref_format_ref (FLATPAK_REF (remote_ref));
+ g_autofree char *key = g_strdup_printf ("%s:%s", flatpak_remote_get_name (remote),
full_ref);
g_hash_table_insert (ht, g_steal_pointer (&key),
- g_strdup (xdg_app_ref_get_commit (XDG_APP_REF (remote_ref))));
+ g_strdup (flatpak_ref_get_commit (FLATPAK_REF (remote_ref))));
}
}
else
{
g_debug ("Update: Failed to read remote %s: %s\n",
- xdg_app_remote_get_name (remote),
+ flatpak_remote_get_name (remote),
local_error->message);
}
}
- installed = xdg_app_installation_list_installed_refs (self, cancellable, error);
+ installed = flatpak_installation_list_installed_refs (self, cancellable, error);
if (installed == NULL)
return NULL;
@@ -582,15 +582,15 @@ xdg_app_installation_list_installed_refs_for_update (XdgAppInstallation *self,
for (i = 0; i < installed->len; i++)
{
- XdgAppInstalledRef *installed_ref = g_ptr_array_index (installed, i);
- g_autofree char *full_ref = xdg_app_ref_format_ref (XDG_APP_REF (installed_ref));
- g_autofree char *key = g_strdup_printf ("%s:%s", xdg_app_installed_ref_get_origin (installed_ref),
+ FlatpakInstalledRef *installed_ref = g_ptr_array_index (installed, i);
+ g_autofree char *full_ref = flatpak_ref_format_ref (FLATPAK_REF (installed_ref));
+ g_autofree char *key = g_strdup_printf ("%s:%s", flatpak_installed_ref_get_origin (installed_ref),
full_ref);
const char *remote_ref = g_hash_table_lookup (ht, key);
if (remote_ref != NULL &&
g_strcmp0 (remote_ref,
- xdg_app_installed_ref_get_latest_commit (installed_ref)) != 0)
+ flatpak_installed_ref_get_latest_commit (installed_ref)) != 0)
g_ptr_array_add (updates, g_object_ref (installed_ref));
}
@@ -599,69 +599,69 @@ xdg_app_installation_list_installed_refs_for_update (XdgAppInstallation *self,
/**
- * xdg_app_installation_list_remotes:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_list_remotes:
+ * @self: a #FlatpakInstallation
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
* Lists the remotes, in priority (highest first) order. For same priority,
* an earlier added remote comes before a later added one.
*
- * Returns: (transfer container) (element-type XdgAppRemote): an GPtrArray of
- * #XdgAppRemote instances
+ * Returns: (transfer container) (element-type FlatpakRemote): an GPtrArray of
+ * #FlatpakRemote instances
*/
GPtrArray *
-xdg_app_installation_list_remotes (XdgAppInstallation *self,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_list_remotes (FlatpakInstallation *self,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_auto(GStrv) remote_names = NULL;
g_autoptr(GPtrArray) remotes = g_ptr_array_new_with_free_func (g_object_unref);
int i;
- remote_names = xdg_app_dir_list_remotes (priv->dir, cancellable, error);
+ remote_names = flatpak_dir_list_remotes (priv->dir, cancellable, error);
if (remote_names == NULL)
return NULL;
for (i = 0; remote_names[i] != NULL; i++)
g_ptr_array_add (remotes,
- xdg_app_remote_new (priv->dir, remote_names[i]));
+ flatpak_remote_new (priv->dir, remote_names[i]));
return g_steal_pointer (&remotes);
}
/**
- * xdg_app_installation_get_remote_by_name:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_get_remote_by_name:
+ * @self: a #FlatpakInstallation
* @name: a remote name
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
* Looks up a remote by name.
*
- * Returns: (transfer full): a #XdgAppRemote instances, or %NULL error
+ * Returns: (transfer full): a #FlatpakRemote instances, or %NULL error
*/
-XdgAppRemote *
-xdg_app_installation_get_remote_by_name (XdgAppInstallation *self,
- const gchar *name,
- GCancellable *cancellable,
- GError **error)
+FlatpakRemote *
+flatpak_installation_get_remote_by_name (FlatpakInstallation *self,
+ const gchar *name,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_auto(GStrv) remote_names = NULL;
int i;
- remote_names = xdg_app_dir_list_remotes (priv->dir, cancellable, error);
+ remote_names = flatpak_dir_list_remotes (priv->dir, cancellable, error);
if (remote_names == NULL)
return NULL;
for (i = 0; remote_names[i] != NULL; i++)
{
if (strcmp (remote_names[i], name) == 0)
- return xdg_app_remote_new (priv->dir, remote_names[i]);
+ return flatpak_remote_new (priv->dir, remote_names[i]);
}
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
@@ -670,8 +670,8 @@ xdg_app_installation_get_remote_by_name (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_load_app_overrides:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_load_app_overrides:
+ * @self: a #FlatpakInstallation
* @app_id: an application id
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
@@ -682,16 +682,16 @@ xdg_app_installation_get_remote_by_name (XdgAppInstallation *self,
* or %NULL if an error occurred
*/
char *
-xdg_app_installation_load_app_overrides (XdgAppInstallation *self,
- const char *app_id,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_load_app_overrides (FlatpakInstallation *self,
+ const char *app_id,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autofree char *metadata_contents = NULL;
gsize metadata_size;
- metadata_contents = xdg_app_dir_load_override (priv->dir, app_id, &metadata_size, error);
+ metadata_contents = flatpak_dir_load_override (priv->dir, app_id, &metadata_size, error);
if (metadata_contents == NULL)
return NULL;
@@ -701,7 +701,7 @@ xdg_app_installation_load_app_overrides (XdgAppInstallation *self,
static void
progress_cb (OstreeAsyncProgress *progress, gpointer user_data)
{
- XdgAppProgressCallback progress_cb = g_object_get_data (G_OBJECT (progress), "callback");
+ FlatpakProgressCallback progress_cb = g_object_get_data (G_OBJECT (progress), "callback");
guint last_progress = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (progress), "last_progress"));
GString *buf;
g_autofree char *status = NULL;
@@ -802,8 +802,8 @@ progress_cb (OstreeAsyncProgress *progress, gpointer user_data)
}
/**
- * xdg_app_installation_install_bundle:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_install_bundle:
+ * @self: a #FlatpakInstallation
* @file: a #GFile that is an xdg-app bundle
* @progress: (scope call): progress callback
* @progress_data: user data passed to @progress
@@ -815,21 +815,21 @@ progress_cb (OstreeAsyncProgress *progress, gpointer user_data)
*
* Returns: (transfer full): The ref for the newly installed app or %NULL on failure
*/
-XdgAppInstalledRef *
-xdg_app_installation_install_bundle (XdgAppInstallation *self,
- GFile *file,
- XdgAppProgressCallback progress,
- gpointer progress_data,
- GCancellable *cancellable,
- GError **error)
+FlatpakInstalledRef *
+flatpak_installation_install_bundle (FlatpakInstallation *self,
+ GFile *file,
+ FlatpakProgressCallback progress,
+ gpointer progress_data,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autofree char *ref = NULL;
gboolean added_remote = FALSE;
g_autoptr(GFile) deploy_base = NULL;
- g_autoptr(XdgAppDir) dir_clone = NULL;
- XdgAppInstalledRef *result = NULL;
+ g_autoptr(FlatpakDir) dir_clone = NULL;
+ FlatpakInstalledRef *result = NULL;
g_autoptr(GError) local_error = NULL;
g_auto(GLnxLockFile) lock = GLNX_LOCK_FILE_INIT;
g_autoptr(GVariant) metadata = NULL;
@@ -840,7 +840,7 @@ xdg_app_installation_install_bundle (XdgAppInstallation *self,
g_autofree char *to_checksum = NULL;
g_autofree char *remote = NULL;
- metadata = xdg_app_bundle_load (file, &to_checksum,
+ metadata = flatpak_bundle_load (file, &to_checksum,
&ref,
&origin,
NULL,
@@ -849,23 +849,23 @@ xdg_app_installation_install_bundle (XdgAppInstallation *self,
if (metadata == NULL)
return FALSE;
- parts = xdg_app_decompose_ref (ref, error);
+ parts = flatpak_decompose_ref (ref, error);
if (parts == NULL)
return FALSE;
- deploy_base = xdg_app_dir_get_deploy_dir (priv->dir, ref);
+ deploy_base = flatpak_dir_get_deploy_dir (priv->dir, ref);
if (g_file_query_exists (deploy_base, cancellable))
{
g_set_error (error,
- XDG_APP_ERROR, XDG_APP_ERROR_ALREADY_INSTALLED,
+ FLATPAK_ERROR, FLATPAK_ERROR_ALREADY_INSTALLED,
"%s branch %s already installed", parts[1], parts[3]);
return NULL;
}
/* Add a remote for later updates */
basename = g_file_get_basename (file);
- remote = xdg_app_dir_create_origin_remote (priv->dir,
+ remote = flatpak_dir_create_origin_remote (priv->dir,
origin,
parts[1],
basename,
@@ -879,12 +879,12 @@ xdg_app_installation_install_bundle (XdgAppInstallation *self,
added_remote = TRUE;
/* Pull, prune, etc are not threadsafe, so we work on a copy */
- dir_clone = xdg_app_dir_clone (priv->dir);
+ dir_clone = flatpak_dir_clone (priv->dir);
- if (!xdg_app_dir_ensure_repo (dir_clone, cancellable, error))
+ if (!flatpak_dir_ensure_repo (dir_clone, cancellable, error))
goto out;
- if (!xdg_app_pull_from_bundle (xdg_app_dir_get_repo (dir_clone),
+ if (!flatpak_pull_from_bundle (flatpak_dir_get_repo (dir_clone),
file,
remote,
ref,
@@ -893,7 +893,7 @@ xdg_app_installation_install_bundle (XdgAppInstallation *self,
error))
goto out;
- if (!xdg_app_dir_deploy_install (dir_clone, ref, remote, NULL, cancellable, error))
+ if (!flatpak_dir_deploy_install (dir_clone, ref, remote, NULL, cancellable, error))
goto out;
result = get_ref (self, ref, cancellable);
@@ -901,16 +901,16 @@ xdg_app_installation_install_bundle (XdgAppInstallation *self,
out:
if (added_remote && result == NULL)
- ostree_repo_remote_delete (xdg_app_dir_get_repo (priv->dir), remote, NULL, NULL);
+ ostree_repo_remote_delete (flatpak_dir_get_repo (priv->dir), remote, NULL, NULL);
return result;
}
/**
- * xdg_app_installation_install:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_install:
+ * @self: a #FlatpakInstallation
* @remote_name: name of the remote to use
- * @kind: what this ref contains (an #XdgAppRefKind)
+ * @kind: what this ref contains (an #FlatpakRefKind)
* @name: name of the app/runtime to fetch
* @arch: (nullable): which architecture to fetch (default: current architecture)
* @branch: (nullable): which branch to fetch (default: 'master')
@@ -923,44 +923,44 @@ out:
*
* Returns: (transfer full): The ref for the newly installed app or %NULL on failure
*/
-XdgAppInstalledRef *
-xdg_app_installation_install (XdgAppInstallation *self,
- const char *remote_name,
- XdgAppRefKind kind,
- const char *name,
- const char *arch,
- const char *branch,
- XdgAppProgressCallback progress,
- gpointer progress_data,
- GCancellable *cancellable,
- GError **error)
+FlatpakInstalledRef *
+flatpak_installation_install (FlatpakInstallation *self,
+ const char *remote_name,
+ FlatpakRefKind kind,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ FlatpakProgressCallback progress,
+ gpointer progress_data,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autofree char *ref = NULL;
g_autoptr(GFile) deploy_base = NULL;
- g_autoptr(XdgAppDir) dir_clone = NULL;
+ g_autoptr(FlatpakDir) dir_clone = NULL;
g_autoptr(GMainContext) main_context = NULL;
g_autoptr(OstreeAsyncProgress) ostree_progress = NULL;
- XdgAppInstalledRef *result = NULL;
+ FlatpakInstalledRef *result = NULL;
g_autoptr(GError) local_error = NULL;
g_auto(GLnxLockFile) lock = GLNX_LOCK_FILE_INIT;
- ref = xdg_app_compose_ref (kind == XDG_APP_REF_KIND_APP, name, branch, arch, error);
+ ref = flatpak_compose_ref (kind == FLATPAK_REF_KIND_APP, name, branch, arch, error);
if (ref == NULL)
return NULL;
- deploy_base = xdg_app_dir_get_deploy_dir (priv->dir, ref);
+ deploy_base = flatpak_dir_get_deploy_dir (priv->dir, ref);
if (g_file_query_exists (deploy_base, cancellable))
{
g_set_error (error,
- XDG_APP_ERROR, XDG_APP_ERROR_ALREADY_INSTALLED,
+ FLATPAK_ERROR, FLATPAK_ERROR_ALREADY_INSTALLED,
"%s branch %s already installed", name, branch ? branch : "master");
goto out;
}
/* Pull, prune, etc are not threadsafe, so we work on a copy */
- dir_clone = xdg_app_dir_clone (priv->dir);
+ dir_clone = flatpak_dir_clone (priv->dir);
/* Work around ostree-pull spinning the default main context for the sync calls */
main_context = g_main_context_new ();
@@ -973,7 +973,7 @@ xdg_app_installation_install (XdgAppInstallation *self,
g_object_set_data (G_OBJECT (ostree_progress), "last_progress", GUINT_TO_POINTER (0));
}
- if (!xdg_app_dir_install (dir_clone, FALSE, FALSE, ref, remote_name, NULL,
+ if (!flatpak_dir_install (dir_clone, FALSE, FALSE, ref, remote_name, NULL,
ostree_progress, cancellable, error))
goto out;
@@ -990,9 +990,9 @@ out:
}
/**
- * xdg_app_installation_update:
- * @self: a #XdgAppInstallation
- * @flags: an #XdgAppUpdateFlags variable
+ * flatpak_installation_update:
+ * @self: a #FlatpakInstallation
+ * @flags: an #FlatpakUpdateFlags variable
* @kind: whether this is an app or runtime
* @name: name of the app or runtime to update
* @arch: (nullable): architecture of the app or runtime to update (default: current architecture)
@@ -1006,52 +1006,52 @@ out:
*
* Returns: (transfer full): The ref for the newly updated app (or the same if no update) or %NULL on failure
*/
-XdgAppInstalledRef *
-xdg_app_installation_update (XdgAppInstallation *self,
- XdgAppUpdateFlags flags,
- XdgAppRefKind kind,
- const char *name,
- const char *arch,
- const char *branch,
- XdgAppProgressCallback progress,
- gpointer progress_data,
- GCancellable *cancellable,
- GError **error)
+FlatpakInstalledRef *
+flatpak_installation_update (FlatpakInstallation *self,
+ FlatpakUpdateFlags flags,
+ FlatpakRefKind kind,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ FlatpakProgressCallback progress,
+ gpointer progress_data,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autofree char *ref = NULL;
g_autoptr(GFile) deploy_base = NULL;
- g_autoptr(XdgAppDir) dir_clone = NULL;
+ g_autoptr(FlatpakDir) dir_clone = NULL;
g_autoptr(GMainContext) main_context = NULL;
g_autoptr(OstreeAsyncProgress) ostree_progress = NULL;
g_autofree char *remote_name = NULL;
- XdgAppInstalledRef *result = NULL;
+ FlatpakInstalledRef *result = NULL;
g_auto(GStrv) subpaths = NULL;
- ref = xdg_app_compose_ref (kind == XDG_APP_REF_KIND_APP, name, branch, arch, error);
+ ref = flatpak_compose_ref (kind == FLATPAK_REF_KIND_APP, name, branch, arch, error);
if (ref == NULL)
return NULL;
- deploy_base = xdg_app_dir_get_deploy_dir (priv->dir, ref);
+ deploy_base = flatpak_dir_get_deploy_dir (priv->dir, ref);
if (!g_file_query_exists (deploy_base, cancellable))
{
g_set_error (error,
- XDG_APP_ERROR, XDG_APP_ERROR_NOT_INSTALLED,
+ FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED,
"%s branch %s is not installed", name, branch ? branch : "master");
return NULL;
}
- remote_name = xdg_app_dir_get_origin (priv->dir, ref, cancellable, error);
+ remote_name = flatpak_dir_get_origin (priv->dir, ref, cancellable, error);
if (remote_name == NULL)
return NULL;
- subpaths = xdg_app_dir_get_subpaths (priv->dir, ref, cancellable, error);
+ subpaths = flatpak_dir_get_subpaths (priv->dir, ref, cancellable, error);
if (subpaths == NULL)
return FALSE;
/* Pull, prune, etc are not threadsafe, so we work on a copy */
- dir_clone = xdg_app_dir_clone (priv->dir);
+ dir_clone = flatpak_dir_clone (priv->dir);
/* Work around ostree-pull spinning the default main context for the sync calls */
main_context = g_main_context_new ();
@@ -1064,9 +1064,9 @@ xdg_app_installation_update (XdgAppInstallation *self,
g_object_set_data (G_OBJECT (ostree_progress), "last_progress", GUINT_TO_POINTER (0));
}
- if (!xdg_app_dir_update (dir_clone,
- (flags & XDG_APP_UPDATE_FLAGS_NO_PULL) != 0,
- (flags & XDG_APP_UPDATE_FLAGS_NO_DEPLOY) != 0,
+ if (!flatpak_dir_update (dir_clone,
+ (flags & FLATPAK_UPDATE_FLAGS_NO_PULL) != 0,
+ (flags & FLATPAK_UPDATE_FLAGS_NO_DEPLOY) != 0,
remote_name, ref, NULL, subpaths,
ostree_progress, cancellable, error))
goto out;
@@ -1084,9 +1084,9 @@ out:
}
/**
- * xdg_app_installation_uninstall:
- * @self: a #XdgAppInstallation
- * @kind: what this ref contains (an #XdgAppRefKind)
+ * flatpak_installation_uninstall:
+ * @self: a #FlatpakInstallation
+ * @kind: what this ref contains (an #FlatpakRefKind)
* @name: name of the app or runtime to uninstall
* @arch: architecture of the app or runtime to uninstall
* @branch: name of the branch of the app or runtime to uninstall
@@ -1099,92 +1099,92 @@ out:
*
* Returns: %TRUE on success
*/
-XDG_APP_EXTERN gboolean
-xdg_app_installation_uninstall (XdgAppInstallation *self,
- XdgAppRefKind kind,
- const char *name,
- const char *arch,
- const char *branch,
- XdgAppProgressCallback progress,
- gpointer progress_data,
- GCancellable *cancellable,
- GError **error)
+FLATPAK_EXTERN gboolean
+flatpak_installation_uninstall (FlatpakInstallation *self,
+ FlatpakRefKind kind,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ FlatpakProgressCallback progress,
+ gpointer progress_data,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autofree char *ref = NULL;
g_autofree char *remote_name = NULL;
g_autofree char *current_ref = NULL;
g_autoptr(GFile) deploy_base = NULL;
- g_autoptr(XdgAppDir) dir_clone = NULL;
+ g_autoptr(FlatpakDir) dir_clone = NULL;
gboolean was_deployed = FALSE;
g_auto(GLnxLockFile) lock = GLNX_LOCK_FILE_INIT;
- ref = xdg_app_compose_ref (kind == XDG_APP_REF_KIND_APP, name, branch, arch, error);
+ ref = flatpak_compose_ref (kind == FLATPAK_REF_KIND_APP, name, branch, arch, error);
if (ref == NULL)
return FALSE;
/* prune, etc are not threadsafe, so we work on a copy */
- dir_clone = xdg_app_dir_clone (priv->dir);
+ dir_clone = flatpak_dir_clone (priv->dir);
- if (!xdg_app_dir_lock (dir_clone, &lock,
+ if (!flatpak_dir_lock (dir_clone, &lock,
cancellable, error))
return FALSE;
- deploy_base = xdg_app_dir_get_deploy_dir (priv->dir, ref);
+ deploy_base = flatpak_dir_get_deploy_dir (priv->dir, ref);
if (!g_file_query_exists (deploy_base, cancellable))
{
g_set_error (error,
- XDG_APP_ERROR, XDG_APP_ERROR_NOT_INSTALLED,
+ FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED,
"%s branch %s is not installed", name, branch ? branch : "master");
return FALSE;
}
- remote_name = xdg_app_dir_get_origin (priv->dir, ref, cancellable, error);
+ remote_name = flatpak_dir_get_origin (priv->dir, ref, cancellable, error);
if (remote_name == NULL)
return FALSE;
g_debug ("dropping active ref");
- if (!xdg_app_dir_set_active (dir_clone, ref, NULL, cancellable, error))
+ if (!flatpak_dir_set_active (dir_clone, ref, NULL, cancellable, error))
return FALSE;
- if (kind == XDG_APP_REF_KIND_APP)
+ if (kind == FLATPAK_REF_KIND_APP)
{
- current_ref = xdg_app_dir_current_ref (dir_clone, name, cancellable);
+ current_ref = flatpak_dir_current_ref (dir_clone, name, cancellable);
if (current_ref != NULL && strcmp (ref, current_ref) == 0)
{
g_debug ("dropping current ref");
- if (!xdg_app_dir_drop_current_ref (dir_clone, name, cancellable, error))
+ if (!flatpak_dir_drop_current_ref (dir_clone, name, cancellable, error))
return FALSE;
}
}
- if (!xdg_app_dir_undeploy_all (dir_clone, ref, FALSE, &was_deployed, cancellable, error))
+ if (!flatpak_dir_undeploy_all (dir_clone, ref, FALSE, &was_deployed, cancellable, error))
return FALSE;
- if (!xdg_app_dir_remove_ref (dir_clone, remote_name, ref, cancellable, error))
+ if (!flatpak_dir_remove_ref (dir_clone, remote_name, ref, cancellable, error))
return FALSE;
glnx_release_lock_file (&lock);
- if (!xdg_app_dir_prune (dir_clone, cancellable, error))
+ if (!flatpak_dir_prune (dir_clone, cancellable, error))
return FALSE;
- xdg_app_dir_cleanup_removed (dir_clone, cancellable, NULL);
+ flatpak_dir_cleanup_removed (dir_clone, cancellable, NULL);
- if (kind == XDG_APP_REF_KIND_APP)
+ if (kind == FLATPAK_REF_KIND_APP)
{
- if (!xdg_app_dir_update_exports (dir_clone, name, cancellable, error))
+ if (!flatpak_dir_update_exports (dir_clone, name, cancellable, error))
return FALSE;
}
- if (!xdg_app_dir_mark_changed (dir_clone, error))
+ if (!flatpak_dir_mark_changed (dir_clone, error))
return FALSE;
if (!was_deployed)
{
g_set_error (error,
- XDG_APP_ERROR, XDG_APP_ERROR_NOT_INSTALLED,
+ FLATPAK_ERROR, FLATPAK_ERROR_NOT_INSTALLED,
"%s branch %s is not installed", name, branch ? branch : "master");
return FALSE;
}
@@ -1193,8 +1193,8 @@ xdg_app_installation_uninstall (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_fetch_remote_size_sync:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_fetch_remote_size_sync:
+ * @self: a #FlatpakInstallation
* @remote_name: the name of the remote
* @commit: the commit
* @download_size: (out): return location for the download size
@@ -1206,25 +1206,25 @@ xdg_app_installation_uninstall (XdgAppInstallation *self,
* to pull a commit from a remote repository, and about the amount of
* local disk space that is required to check out this commit.
*
- * This is deprectated, use xdg_app_installation_fetch_remote_size_sync2 instead.
+ * This is deprectated, use flatpak_installation_fetch_remote_size_sync2 instead.
*
* Returns: %TRUE, unless an error occurred
*/
gboolean
-xdg_app_installation_fetch_remote_size_sync (XdgAppInstallation *self,
- const char *remote_name,
- const char *commit,
- guint64 *download_size,
- guint64 *installed_size,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_fetch_remote_size_sync (FlatpakInstallation *self,
+ const char *remote_name,
+ const char *commit,
+ guint64 *download_size,
+ guint64 *installed_size,
+ GCancellable *cancellable,
+ GError **error)
{
- return xdg_app_fail (error, "Deprecated function call xdg_app_installation_fetch_remote_size_sync");
+ return flatpak_fail (error, "Deprecated function call flatpak_installation_fetch_remote_size_sync");
}
/**
- * xdg_app_installation_fetch_remote_size_sync2:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_fetch_remote_size_sync2:
+ * @self: a #FlatpakInstallation
* @remote_name: the name of the remote
* @ref: the ref
* @download_size: (out): return location for the (maximum) download size
@@ -1243,18 +1243,18 @@ xdg_app_installation_fetch_remote_size_sync (XdgAppInstallation *self,
* Returns: %TRUE, unless an error occurred
*/
gboolean
-xdg_app_installation_fetch_remote_size_sync2 (XdgAppInstallation *self,
- const char *remote_name,
- XdgAppRef *ref,
- guint64 *download_size,
- guint64 *installed_size,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_fetch_remote_size_sync2 (FlatpakInstallation *self,
+ const char *remote_name,
+ FlatpakRef *ref,
+ guint64 *download_size,
+ guint64 *installed_size,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
- g_autofree char *full_ref = xdg_app_ref_format_ref (ref);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
+ g_autofree char *full_ref = flatpak_ref_format_ref (ref);
- return xdg_app_dir_fetch_ref_cache (priv->dir, remote_name, full_ref,
+ return flatpak_dir_fetch_ref_cache (priv->dir, remote_name, full_ref,
download_size, installed_size,
NULL,
cancellable,
@@ -1262,8 +1262,8 @@ xdg_app_installation_fetch_remote_size_sync2 (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_fetch_remote_metadata_sync:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_fetch_remote_metadata_sync:
+ * @self: a #FlatpakInstallation
* @remote_name: the name of the remote
* @commit: the commit
* @cancellable: (nullable): a #GCancellable
@@ -1271,23 +1271,23 @@ xdg_app_installation_fetch_remote_size_sync2 (XdgAppInstallation *self,
*
* Obtains the metadata file from a commit.
*
- * This is deprecated, use xdg_app_installation_fetch_remote_metadata_sync2
+ * This is deprecated, use flatpak_installation_fetch_remote_metadata_sync2
*
* Returns: (transfer full): a #GBytes containing the xdg-app metadata file,
* or %NULL if an error occurred
*/
GBytes *
-xdg_app_installation_fetch_remote_metadata_sync (XdgAppInstallation *self,
- const char *remote_name,
- const char *commit,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_fetch_remote_metadata_sync (FlatpakInstallation *self,
+ const char *remote_name,
+ const char *commit,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autoptr(GBytes) bytes = NULL;
- bytes = xdg_app_dir_fetch_metadata (priv->dir,
+ bytes = flatpak_dir_fetch_metadata (priv->dir,
remote_name,
commit,
cancellable,
@@ -1299,8 +1299,8 @@ xdg_app_installation_fetch_remote_metadata_sync (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_fetch_remote_metadata_sync2:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_fetch_remote_metadata_sync2:
+ * @self: a #FlatpakInstallation
* @remote_name: the name of the remote
* @ref: the ref
* @cancellable: (nullable): a #GCancellable
@@ -1312,17 +1312,17 @@ xdg_app_installation_fetch_remote_metadata_sync (XdgAppInstallation *self,
* or %NULL if an error occurred
*/
GBytes *
-xdg_app_installation_fetch_remote_metadata_sync2 (XdgAppInstallation *self,
- const char *remote_name,
- XdgAppRef *ref,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_fetch_remote_metadata_sync2 (FlatpakInstallation *self,
+ const char *remote_name,
+ FlatpakRef *ref,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
- g_autofree char *full_ref = xdg_app_ref_format_ref (ref);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
+ g_autofree char *full_ref = flatpak_ref_format_ref (ref);
char *res = NULL;
- if (!xdg_app_dir_fetch_ref_cache (priv->dir, remote_name, full_ref,
+ if (!flatpak_dir_fetch_ref_cache (priv->dir, remote_name, full_ref,
NULL, NULL,
&res,
cancellable, error))
@@ -1332,24 +1332,24 @@ xdg_app_installation_fetch_remote_metadata_sync2 (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_list_remote_refs_sync:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_list_remote_refs_sync:
+ * @self: a #FlatpakInstallation
* @remote_name: the name of the remote
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
* Lists all the applications and runtimes in a remote.
*
- * Returns: (transfer container) (element-type XdgAppRemoteRef): an GPtrArray of
- * #XdgAppRemoteRef instances
+ * Returns: (transfer container) (element-type FlatpakRemoteRef): an GPtrArray of
+ * #FlatpakRemoteRef instances
*/
GPtrArray *
-xdg_app_installation_list_remote_refs_sync (XdgAppInstallation *self,
- const char *remote_name,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_list_remote_refs_sync (FlatpakInstallation *self,
+ const char *remote_name,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autoptr(GPtrArray) refs = g_ptr_array_new_with_free_func (g_object_unref);
g_autoptr(GHashTable) ht = NULL;
@@ -1357,7 +1357,7 @@ xdg_app_installation_list_remote_refs_sync (XdgAppInstallation *self,
gpointer key;
gpointer value;
- if (!xdg_app_dir_list_remote_refs (priv->dir,
+ if (!flatpak_dir_list_remote_refs (priv->dir,
remote_name,
&ht,
cancellable,
@@ -1369,9 +1369,9 @@ xdg_app_installation_list_remote_refs_sync (XdgAppInstallation *self,
{
const char *refspec = key;
const char *checksum = value;
- XdgAppRemoteRef *ref;
+ FlatpakRemoteRef *ref;
- ref = xdg_app_remote_ref_new (refspec, checksum, remote_name);
+ ref = flatpak_remote_ref_new (refspec, checksum, remote_name);
if (ref)
g_ptr_array_add (refs, ref);
@@ -1381,10 +1381,10 @@ xdg_app_installation_list_remote_refs_sync (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_fetch_remote_ref_sync:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_fetch_remote_ref_sync:
+ * @self: a #FlatpakInstallation
* @remote_name: the name of the remote
- * @kind: what this ref contains (an #XdgAppRefKind)
+ * @kind: what this ref contains (an #FlatpakRefKind)
* @name: name of the app/runtime to fetch
* @arch: (nullable): which architecture to fetch (default: current architecture)
* @branch: (nullable): which branch to fetch (default: 'master')
@@ -1393,19 +1393,19 @@ xdg_app_installation_list_remote_refs_sync (XdgAppInstallation *self,
*
* Gets the current remote branch of a ref in the remote.
*
- * Returns: (transfer full): a #XdgAppRemoteRef instance, or %NULL
+ * Returns: (transfer full): a #FlatpakRemoteRef instance, or %NULL
*/
-XdgAppRemoteRef *
-xdg_app_installation_fetch_remote_ref_sync (XdgAppInstallation *self,
- const char *remote_name,
- XdgAppRefKind kind,
- const char *name,
- const char *arch,
- const char *branch,
- GCancellable *cancellable,
- GError **error)
+FlatpakRemoteRef *
+flatpak_installation_fetch_remote_ref_sync (FlatpakInstallation *self,
+ const char *remote_name,
+ FlatpakRefKind kind,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autoptr(GHashTable) ht = NULL;
g_autofree char *ref = NULL;
@@ -1414,26 +1414,26 @@ xdg_app_installation_fetch_remote_ref_sync (XdgAppInstallation *self,
if (branch == NULL)
branch = "master";
- if (!xdg_app_dir_list_remote_refs (priv->dir,
+ if (!flatpak_dir_list_remote_refs (priv->dir,
remote_name,
&ht,
cancellable,
error))
return NULL;
- if (kind == XDG_APP_REF_KIND_APP)
- ref = xdg_app_build_app_ref (name,
+ if (kind == FLATPAK_REF_KIND_APP)
+ ref = flatpak_build_app_ref (name,
branch,
arch);
else
- ref = xdg_app_build_runtime_ref (name,
+ ref = flatpak_build_runtime_ref (name,
branch,
arch);
checksum = g_hash_table_lookup (ht, ref);
if (checksum != NULL)
- return xdg_app_remote_ref_new (ref, checksum, remote_name);
+ return flatpak_remote_ref_new (ref, checksum, remote_name);
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
"Reference %s doesn't exist in remote\n", ref);
@@ -1446,8 +1446,8 @@ no_progress_cb (OstreeAsyncProgress *progress, gpointer user_data)
}
/**
- * xdg_app_installation_update_appstream_sync:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_update_appstream_sync:
+ * @self: a #FlatpakInstallation
* @remote_name: the name of the remote
* @arch: Architecture to update, or %NULL for the local machine arch
* @out_changed: (nullable): Set to %TRUE if the contents of the appstream changed, %FALSE if nothing changed
@@ -1459,22 +1459,22 @@ no_progress_cb (OstreeAsyncProgress *progress, gpointer user_data)
* Returns: %TRUE on success, or %FALSE on error
*/
gboolean
-xdg_app_installation_update_appstream_sync (XdgAppInstallation *self,
- const char *remote_name,
- const char *arch,
- gboolean *out_changed,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_update_appstream_sync (FlatpakInstallation *self,
+ const char *remote_name,
+ const char *arch,
+ gboolean *out_changed,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
- g_autoptr(XdgAppDir) dir_clone = NULL;
+ g_autoptr(FlatpakDir) dir_clone = NULL;
g_autoptr(OstreeAsyncProgress) ostree_progress = NULL;
g_autoptr(GMainContext) main_context = NULL;
gboolean res;
/* Pull, prune, etc are not threadsafe, so we work on a copy */
- dir_clone = xdg_app_dir_clone (priv->dir);
+ dir_clone = flatpak_dir_clone (priv->dir);
if (main_context)
g_main_context_pop_thread_default (main_context);
@@ -1485,7 +1485,7 @@ xdg_app_installation_update_appstream_sync (XdgAppInstallation *self,
ostree_progress = ostree_async_progress_new_and_connect (no_progress_cb, NULL);
- res = xdg_app_dir_update_appstream (dir_clone,
+ res = flatpak_dir_update_appstream (dir_clone,
remote_name,
arch,
out_changed,
@@ -1502,8 +1502,8 @@ xdg_app_installation_update_appstream_sync (XdgAppInstallation *self,
}
/**
- * xdg_app_installation_create_monitor:
- * @self: a #XdgAppInstallation
+ * flatpak_installation_create_monitor:
+ * @self: a #FlatpakInstallation
* @cancellable: (nullable): a #GCancellable
* @error: return location for a #GError
*
@@ -1514,15 +1514,15 @@ xdg_app_installation_update_appstream_sync (XdgAppInstallation *self,
* Returns: (transfer full): a new #GFileMonitor instance, or %NULL on error
*/
GFileMonitor *
-xdg_app_installation_create_monitor (XdgAppInstallation *self,
- GCancellable *cancellable,
- GError **error)
+flatpak_installation_create_monitor (FlatpakInstallation *self,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstallationPrivate *priv = xdg_app_installation_get_instance_private (self);
+ FlatpakInstallationPrivate *priv = flatpak_installation_get_instance_private (self);
g_autoptr(GFile) path = NULL;
- path = xdg_app_dir_get_changed_path (priv->dir);
+ path = flatpak_dir_get_changed_path (priv->dir);
return g_file_monitor_file (path, G_FILE_MONITOR_NONE,
cancellable, error);
diff --git a/lib/xdg-app-installation.h b/lib/xdg-app-installation.h
index 7a8bea5..e30194b 100644
--- a/lib/xdg-app-installation.h
+++ b/lib/xdg-app-installation.h
@@ -18,26 +18,26 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#if !defined(__XDG_APP_H_INSIDE__) && !defined(XDG_APP_COMPILATION)
+#if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION)
#error "Only <xdg-app.h> can be included directly."
#endif
-#ifndef __XDG_APP_INSTALLATION_H__
-#define __XDG_APP_INSTALLATION_H__
+#ifndef __FLATPAK_INSTALLATION_H__
+#define __FLATPAK_INSTALLATION_H__
-typedef struct _XdgAppInstallation XdgAppInstallation;
+typedef struct _FlatpakInstallation FlatpakInstallation;
#include <gio/gio.h>
#include <xdg-app-installed-ref.h>
#include <xdg-app-remote.h>
-#define XDG_APP_TYPE_INSTALLATION xdg_app_installation_get_type ()
-#define XDG_APP_INSTALLATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XDG_APP_TYPE_INSTALLATION, XdgAppInstallation))
-#define XDG_APP_IS_INSTALLATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XDG_APP_TYPE_INSTALLATION))
+#define FLATPAK_TYPE_INSTALLATION flatpak_installation_get_type ()
+#define FLATPAK_INSTALLATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_INSTALLATION, FlatpakInstallation))
+#define FLATPAK_IS_INSTALLATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_INSTALLATION))
-XDG_APP_EXTERN GType xdg_app_installation_get_type (void);
+FLATPAK_EXTERN GType flatpak_installation_get_type (void);
-struct _XdgAppInstallation
+struct _FlatpakInstallation
{
GObject parent;
};
@@ -45,40 +45,40 @@ struct _XdgAppInstallation
typedef struct
{
GObjectClass parent_class;
-} XdgAppInstallationClass;
+} FlatpakInstallationClass;
/**
- * XdgAppUpdateFlags:
- * @XDG_APP_UPDATE_FLAGS_NONE: Fetch remote builds and install the latest one (default)
- * @XDG_APP_UPDATE_FLAGS_NO_DEPLOY: Don't install any new builds that might be fetched
- * @XDG_APP_UPDATE_FLAGS_NO_PULL: Don't try to fetch new builds from the remote repo
+ * FlatpakUpdateFlags:
+ * @FLATPAK_UPDATE_FLAGS_NONE: Fetch remote builds and install the latest one (default)
+ * @FLATPAK_UPDATE_FLAGS_NO_DEPLOY: Don't install any new builds that might be fetched
+ * @FLATPAK_UPDATE_FLAGS_NO_PULL: Don't try to fetch new builds from the remote repo
*
- * Flags to alter the behavior of xdg_app_installation_update().
+ * Flags to alter the behavior of flatpak_installation_update().
*/
typedef enum {
- XDG_APP_UPDATE_FLAGS_NONE = 0,
- XDG_APP_UPDATE_FLAGS_NO_DEPLOY = (1 << 0),
- XDG_APP_UPDATE_FLAGS_NO_PULL = (1 << 1),
-} XdgAppUpdateFlags;
+ FLATPAK_UPDATE_FLAGS_NONE = 0,
+ FLATPAK_UPDATE_FLAGS_NO_DEPLOY = (1 << 0),
+ FLATPAK_UPDATE_FLAGS_NO_PULL = (1 << 1),
+} FlatpakUpdateFlags;
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (XdgAppInstallation, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakInstallation, g_object_unref)
#endif
-XDG_APP_EXTERN const char *xdg_app_get_default_arch (void);
+FLATPAK_EXTERN const char *flatpak_get_default_arch (void);
-XDG_APP_EXTERN XdgAppInstallation *xdg_app_installation_new_system (GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN XdgAppInstallation *xdg_app_installation_new_user (GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN XdgAppInstallation *xdg_app_installation_new_for_path (GFile *path,
- gboolean user,
- GCancellable *cancellable,
- GError **error);
+FLATPAK_EXTERN FlatpakInstallation *flatpak_installation_new_system (GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN FlatpakInstallation *flatpak_installation_new_user (GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN FlatpakInstallation *flatpak_installation_new_for_path (GFile *path,
+ gboolean user,
+ GCancellable *cancellable,
+ GError **error);
/**
- * XdgAppProgressCallback:
+ * FlatpakProgressCallback:
* @status: A status string, suitable for display
* @progress: percentage of completion
* @estimating: whether @progress is just an estimate
@@ -90,132 +90,132 @@ XDG_APP_EXTERN XdgAppInstallation *xdg_app_installation_new_for_path (GFile
*
* The callback occurs in the thread-default context of the caller.
*/
-typedef void (*XdgAppProgressCallback)(const char *status,
- guint progress,
- gboolean estimating,
- gpointer user_data);
-
-XDG_APP_EXTERN gboolean xdg_app_installation_get_is_user (XdgAppInstallation *self);
-XDG_APP_EXTERN GFile *xdg_app_installation_get_path (XdgAppInstallation *self);
-XDG_APP_EXTERN gboolean xdg_app_installation_launch (XdgAppInstallation *self,
- const char *name,
- const char *arch,
- const char *branch,
- const char *commit,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN GFileMonitor *xdg_app_installation_create_monitor (XdgAppInstallation *self,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN GPtrArray *xdg_app_installation_list_installed_refs (XdgAppInstallation *self,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN GPtrArray *xdg_app_installation_list_installed_refs_by_kind (XdgAppInstallation *self,
- XdgAppRefKind kind,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN GPtrArray *xdg_app_installation_list_installed_refs_for_update (XdgAppInstallation *self,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN XdgAppInstalledRef * xdg_app_installation_get_installed_ref (XdgAppInstallation *self,
- XdgAppRefKind kind,
- const char *name,
- const char *arch,
- const char *branch,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN XdgAppInstalledRef * xdg_app_installation_get_current_installed_app (XdgAppInstallation *self,
- const char *name,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN GPtrArray *xdg_app_installation_list_remotes (XdgAppInstallation *self,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN XdgAppRemote *xdg_app_installation_get_remote_by_name (XdgAppInstallation *self,
- const gchar *name,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN char * xdg_app_installation_load_app_overrides (XdgAppInstallation *self,
- const char *app_id,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN XdgAppInstalledRef * xdg_app_installation_install (XdgAppInstallation *self,
- const char *remote_name,
- XdgAppRefKind kind,
- const char *name,
- const char *arch,
- const char *branch,
- XdgAppProgressCallback progress,
- gpointer progress_data,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN XdgAppInstalledRef * xdg_app_installation_update (XdgAppInstallation *self,
- XdgAppUpdateFlags flags,
- XdgAppRefKind kind,
- const char *name,
- const char *arch,
- const char *branch,
- XdgAppProgressCallback progress,
- gpointer progress_data,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN XdgAppInstalledRef * xdg_app_installation_install_bundle (XdgAppInstallation *self,
- GFile *file,
- XdgAppProgressCallback progress,
- gpointer progress_data,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN gboolean xdg_app_installation_uninstall (XdgAppInstallation *self,
- XdgAppRefKind kind,
- const char *name,
- const char *arch,
- const char *branch,
- XdgAppProgressCallback progress,
- gpointer progress_data,
- GCancellable *cancellable,
- GError **error);
-
-XDG_APP_EXTERN gboolean xdg_app_installation_fetch_remote_size_sync (XdgAppInstallation *self,
- const char *remote_name,
- const char *commit,
- guint64 *download_size,
- guint64 *installed_size,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN gboolean xdg_app_installation_fetch_remote_size_sync2 (XdgAppInstallation *self,
- const char *remote_name,
- XdgAppRef *ref,
- guint64 *download_size,
- guint64 *installed_size,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN GBytes * xdg_app_installation_fetch_remote_metadata_sync (XdgAppInstallation *self,
- const char *remote_name,
- const char *commit,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN GBytes * xdg_app_installation_fetch_remote_metadata_sync2 (XdgAppInstallation *self,
- const char *remote_name,
- XdgAppRef *ref,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN GPtrArray * xdg_app_installation_list_remote_refs_sync (XdgAppInstallation *self,
- const char *remote_name,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN XdgAppRemoteRef *xdg_app_installation_fetch_remote_ref_sync (XdgAppInstallation *self,
- const char *remote_name,
- XdgAppRefKind kind,
- const char *name,
- const char *arch,
- const char *branch,
- GCancellable *cancellable,
- GError **error);
-XDG_APP_EXTERN gboolean xdg_app_installation_update_appstream_sync (XdgAppInstallation *self,
- const char *remote_name,
- const char *arch,
- gboolean *out_changed,
- GCancellable *cancellable,
- GError **error);
-
-#endif /* __XDG_APP_INSTALLATION_H__ */
+typedef void (*FlatpakProgressCallback)(const char *status,
+ guint progress,
+ gboolean estimating,
+ gpointer user_data);
+
+FLATPAK_EXTERN gboolean flatpak_installation_get_is_user (FlatpakInstallation *self);
+FLATPAK_EXTERN GFile *flatpak_installation_get_path (FlatpakInstallation *self);
+FLATPAK_EXTERN gboolean flatpak_installation_launch (FlatpakInstallation *self,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ const char *commit,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN GFileMonitor *flatpak_installation_create_monitor (FlatpakInstallation *self,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN GPtrArray *flatpak_installation_list_installed_refs (FlatpakInstallation *self,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN GPtrArray *flatpak_installation_list_installed_refs_by_kind (FlatpakInstallation *self,
+ FlatpakRefKind kind,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN GPtrArray *flatpak_installation_list_installed_refs_for_update (FlatpakInstallation *self,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN FlatpakInstalledRef * flatpak_installation_get_installed_ref (FlatpakInstallation *self,
+ FlatpakRefKind kind,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN FlatpakInstalledRef * flatpak_installation_get_current_installed_app (FlatpakInstallation *self,
+ const char *name,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN GPtrArray *flatpak_installation_list_remotes (FlatpakInstallation *self,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN FlatpakRemote *flatpak_installation_get_remote_by_name (FlatpakInstallation *self,
+ const gchar *name,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN char * flatpak_installation_load_app_overrides (FlatpakInstallation *self,
+ const char *app_id,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN FlatpakInstalledRef * flatpak_installation_install (FlatpakInstallation *self,
+ const char *remote_name,
+ FlatpakRefKind kind,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ FlatpakProgressCallback progress,
+ gpointer progress_data,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN FlatpakInstalledRef * flatpak_installation_update (FlatpakInstallation *self,
+ FlatpakUpdateFlags flags,
+ FlatpakRefKind kind,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ FlatpakProgressCallback progress,
+ gpointer progress_data,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN FlatpakInstalledRef * flatpak_installation_install_bundle (FlatpakInstallation *self,
+ GFile *file,
+ FlatpakProgressCallback progress,
+ gpointer progress_data,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN gboolean flatpak_installation_uninstall (FlatpakInstallation *self,
+ FlatpakRefKind kind,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ FlatpakProgressCallback progress,
+ gpointer progress_data,
+ GCancellable *cancellable,
+ GError **error);
+
+FLATPAK_EXTERN gboolean flatpak_installation_fetch_remote_size_sync (FlatpakInstallation *self,
+ const char *remote_name,
+ const char *commit,
+ guint64 *download_size,
+ guint64 *installed_size,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN gboolean flatpak_installation_fetch_remote_size_sync2 (FlatpakInstallation *self,
+ const char *remote_name,
+ FlatpakRef *ref,
+ guint64 *download_size,
+ guint64 *installed_size,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN GBytes * flatpak_installation_fetch_remote_metadata_sync (FlatpakInstallation *self,
+ const char *remote_name,
+ const char *commit,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN GBytes * flatpak_installation_fetch_remote_metadata_sync2 (FlatpakInstallation *self,
+ const char *remote_name,
+ FlatpakRef *ref,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN GPtrArray * flatpak_installation_list_remote_refs_sync (FlatpakInstallation *self,
+ const char *remote_name,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN FlatpakRemoteRef *flatpak_installation_fetch_remote_ref_sync (FlatpakInstallation *self,
+ const char *remote_name,
+ FlatpakRefKind kind,
+ const char *name,
+ const char *arch,
+ const char *branch,
+ GCancellable *cancellable,
+ GError **error);
+FLATPAK_EXTERN gboolean flatpak_installation_update_appstream_sync (FlatpakInstallation *self,
+ const char *remote_name,
+ const char *arch,
+ gboolean *out_changed,
+ GCancellable *cancellable,
+ GError **error);
+
+#endif /* __FLATPAK_INSTALLATION_H__ */
diff --git a/lib/xdg-app-installed-ref-private.h b/lib/xdg-app-installed-ref-private.h
index af39531..e24acc3 100644
--- a/lib/xdg-app-installed-ref-private.h
+++ b/lib/xdg-app-installed-ref-private.h
@@ -18,23 +18,23 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#if !defined(__XDG_APP_H_INSIDE__) && !defined(XDG_APP_COMPILATION)
+#if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION)
#error "Only <xdg-app.h> can be included directly."
#endif
-#ifndef __XDG_APP_INSTALLED_REF_PRIVATE_H__
-#define __XDG_APP_INSTALLED_REF_PRIVATE_H__
+#ifndef __FLATPAK_INSTALLED_REF_PRIVATE_H__
+#define __FLATPAK_INSTALLED_REF_PRIVATE_H__
#include <xdg-app-installed-ref.h>
#include <xdg-app-dir.h>
-XdgAppInstalledRef *xdg_app_installed_ref_new (const char *full_ref,
- const char *commit,
- const char *latest_commit,
- const char *origin,
- const char **subpaths,
- const char *deploy_dir,
- guint64 installed_size,
- gboolean current);
+FlatpakInstalledRef *flatpak_installed_ref_new (const char *full_ref,
+ const char *commit,
+ const char *latest_commit,
+ const char *origin,
+ const char **subpaths,
+ const char *deploy_dir,
+ guint64 installed_size,
+ gboolean current);
-#endif /* __XDG_APP_INSTALLED_REF_PRIVATE_H__ */
+#endif /* __FLATPAK_INSTALLED_REF_PRIVATE_H__ */
diff --git a/lib/xdg-app-installed-ref.c b/lib/xdg-app-installed-ref.c
index e6f543d..0ed231a 100644
--- a/lib/xdg-app-installed-ref.c
+++ b/lib/xdg-app-installed-ref.c
@@ -28,17 +28,17 @@
/**
* SECTION:xdg-app-installed-ref
- * @Title: XdgAppInstalledRef
+ * @Title: FlatpakInstalledRef
* @Short_description: Installed application reference
*
- * A XdgAppInstalledRef provides information about an installed
+ * A FlatpakInstalledRef provides information about an installed
* application or runtime (in short: ref), such as the available
* builds, its size, location, etc.
*/
-typedef struct _XdgAppInstalledRefPrivate XdgAppInstalledRefPrivate;
+typedef struct _FlatpakInstalledRefPrivate FlatpakInstalledRefPrivate;
-struct _XdgAppInstalledRefPrivate
+struct _FlatpakInstalledRefPrivate
{
gboolean is_current;
char *origin;
@@ -48,7 +48,7 @@ struct _XdgAppInstalledRefPrivate
guint64 installed_size;
};
-G_DEFINE_TYPE_WITH_PRIVATE (XdgAppInstalledRef, xdg_app_installed_ref, XDG_APP_TYPE_REF)
+G_DEFINE_TYPE_WITH_PRIVATE (FlatpakInstalledRef, flatpak_installed_ref, FLATPAK_TYPE_REF)
enum {
PROP_0,
@@ -62,26 +62,26 @@ enum {
};
static void
-xdg_app_installed_ref_finalize (GObject *object)
+flatpak_installed_ref_finalize (GObject *object)
{
- XdgAppInstalledRef *self = XDG_APP_INSTALLED_REF (object);
- XdgAppInstalledRefPrivate *priv = xdg_app_installed_ref_get_instance_private (self);
+ FlatpakInstalledRef *self = FLATPAK_INSTALLED_REF (object);
+ FlatpakInstalledRefPrivate *priv = flatpak_installed_ref_get_instance_private (self);
g_free (priv->origin);
g_free (priv->deploy_dir);
g_strfreev (priv->subpaths);
- G_OBJECT_CLASS (xdg_app_installed_ref_parent_class)->finalize (object);
+ G_OBJECT_CLASS (flatpak_installed_ref_parent_class)->finalize (object);
}
static void
-xdg_app_installed_ref_set_property (GObject *object,
+flatpak_installed_ref_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- XdgAppInstalledRef *self = XDG_APP_INSTALLED_REF (object);
- XdgAppInstalledRefPrivate *priv = xdg_app_installed_ref_get_instance_private (self);
+ FlatpakInstalledRef *self = FLATPAK_INSTALLED_REF (object);
+ FlatpakInstalledRefPrivate *priv = flatpak_installed_ref_get_instance_private (self);
switch (prop_id)
{
@@ -120,13 +120,13 @@ xdg_app_installed_ref_set_property (GObject *object,
}
static void
-xdg_app_installed_ref_get_property (GObject *object,
+flatpak_installed_ref_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- XdgAppInstalledRef *self = XDG_APP_INSTALLED_REF (object);
- XdgAppInstalledRefPrivate *priv = xdg_app_installed_ref_get_instance_private (self);
+ FlatpakInstalledRef *self = FLATPAK_INSTALLED_REF (object);
+ FlatpakInstalledRefPrivate *priv = flatpak_installed_ref_get_instance_private (self);
switch (prop_id)
{
@@ -161,13 +161,13 @@ xdg_app_installed_ref_get_property (GObject *object,
}
static void
-xdg_app_installed_ref_class_init (XdgAppInstalledRefClass *klass)
+flatpak_installed_ref_class_init (FlatpakInstalledRefClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->get_property = xdg_app_installed_ref_get_property;
- object_class->set_property = xdg_app_installed_ref_set_property;
- object_class->finalize = xdg_app_installed_ref_finalize;
+ object_class->get_property = flatpak_installed_ref_get_property;
+ object_class->set_property = flatpak_installed_ref_set_property;
+ object_class->finalize = flatpak_installed_ref_finalize;
g_object_class_install_property (object_class,
PROP_IS_CURRENT,
@@ -214,109 +214,109 @@ xdg_app_installed_ref_class_init (XdgAppInstalledRefClass *klass)
}
static void
-xdg_app_installed_ref_init (XdgAppInstalledRef *self)
+flatpak_installed_ref_init (FlatpakInstalledRef *self)
{
}
/**
- * xdg_app_installed_ref_get_origin:
- * @self: a #XdgAppInstalledRef
+ * flatpak_installed_ref_get_origin:
+ * @self: a #FlatpakInstalledRef
*
* Gets the origin of the ref.
*
* Returns: (transfer none): the origin
*/
const char *
-xdg_app_installed_ref_get_origin (XdgAppInstalledRef *self)
+flatpak_installed_ref_get_origin (FlatpakInstalledRef *self)
{
- XdgAppInstalledRefPrivate *priv = xdg_app_installed_ref_get_instance_private (self);
+ FlatpakInstalledRefPrivate *priv = flatpak_installed_ref_get_instance_private (self);
return priv->origin;
}
/**
- * xdg_app_installed_ref_get_latest_commit:
- * @self: a #XdgAppInstalledRef
+ * flatpak_installed_ref_get_latest_commit:
+ * @self: a #FlatpakInstalledRef
*
* Gets the latest commit of the ref.
*
* Returns: (transfer none): the latest commit
*/
const char *
-xdg_app_installed_ref_get_latest_commit (XdgAppInstalledRef *self)
+flatpak_installed_ref_get_latest_commit (FlatpakInstalledRef *self)
{
- XdgAppInstalledRefPrivate *priv = xdg_app_installed_ref_get_instance_private (self);
+ FlatpakInstalledRefPrivate *priv = flatpak_installed_ref_get_instance_private (self);
return priv->latest_commit;
}
/**
- * xdg_app_installed_ref_get_deploy_dir:
- * @self: a #XdgAppInstalledRef
+ * flatpak_installed_ref_get_deploy_dir:
+ * @self: a #FlatpakInstalledRef
*
* Gets the deploy dir of the ref.
*
* Returns: (transfer none): the deploy dir
*/
const char *
-xdg_app_installed_ref_get_deploy_dir (XdgAppInstalledRef *self)
+flatpak_installed_ref_get_deploy_dir (FlatpakInstalledRef *self)
{
- XdgAppInstalledRefPrivate *priv = xdg_app_installed_ref_get_instance_private (self);
+ FlatpakInstalledRefPrivate *priv = flatpak_installed_ref_get_instance_private (self);
return priv->deploy_dir;
}
/**
- * xdg_app_installed_ref_get_is_current:
- * @self: a #XdgAppInstalledRef
+ * flatpak_installed_ref_get_is_current:
+ * @self: a #FlatpakInstalledRef
*
* Returns whether the ref is current.
*
* Returns: %TRUE if the ref is current
*/
gboolean
-xdg_app_installed_ref_get_is_current (XdgAppInstalledRef *self)
+flatpak_installed_ref_get_is_current (FlatpakInstalledRef *self)
{
- XdgAppInstalledRefPrivate *priv = xdg_app_installed_ref_get_instance_private (self);
+ FlatpakInstalledRefPrivate *priv = flatpak_installed_ref_get_instance_private (self);
return priv->is_current;
}
/**
- * xdg_app_installed_ref_get_subpaths:
- * @self: a #XdgAppInstalledRef
+ * flatpak_installed_ref_get_subpaths:
+ * @self: a #FlatpakInstalledRef
*
* Returns the subpaths that are installed, or %NULL if all files installed.
*
* Returns: (transfer none): A strv, or %NULL
*/
const char * const *
-xdg_app_installed_ref_get_subpaths (XdgAppInstalledRef *self)
+flatpak_installed_ref_get_subpaths (FlatpakInstalledRef *self)
{
- XdgAppInstalledRefPrivate *priv = xdg_app_installed_ref_get_instance_private (self);
+ FlatpakInstalledRefPrivate *priv = flatpak_installed_ref_get_instance_private (self);
return (const char * const *) priv->subpaths;
}
/**
- * xdg_app_installed_ref_get_installed_size:
- * @self: a #XdgAppInstalledRef
+ * flatpak_installed_ref_get_installed_size:
+ * @self: a #FlatpakInstalledRef
*
* Returns the installed size of the ref.
*
* Returns: the installed size
*/
guint64
-xdg_app_installed_ref_get_installed_size (XdgAppInstalledRef *self)
+flatpak_installed_ref_get_installed_size (FlatpakInstalledRef *self)
{
- XdgAppInstalledRefPrivate *priv = xdg_app_installed_ref_get_instance_private (self);
+ FlatpakInstalledRefPrivate *priv = flatpak_installed_ref_get_instance_private (self);
return priv->installed_size;
}
/**
- * xdg_app_installed_ref_load_metadata:
- * @self: a #XdgAppInstalledRef
+ * flatpak_installed_ref_load_metadata:
+ * @self: a #FlatpakInstalledRef
* @cancellable: (nullable): a #GCancellable
* @error: a return location for a #GError
*
@@ -326,11 +326,11 @@ xdg_app_installed_ref_get_installed_size (XdgAppInstalledRef *self)
* or %NULL if an error occurred
*/
GBytes *
-xdg_app_installed_ref_load_metadata (XdgAppInstalledRef *self,
- GCancellable *cancellable,
- GError **error)
+flatpak_installed_ref_load_metadata (FlatpakInstalledRef *self,
+ GCancellable *cancellable,
+ GError **error)
{
- XdgAppInstalledRefPrivate *priv = xdg_app_installed_ref_get_instance_private (self);
+ FlatpakInstalledRefPrivate *priv = flatpak_installed_ref_get_instance_private (self);
g_autofree char *path = NULL;
char *metadata;
gsize length;
@@ -349,8 +349,8 @@ xdg_app_installed_ref_load_metadata (XdgAppInstalledRef *self,
return g_bytes_new_take (metadata, length);
}
-XdgAppInstalledRef *
-xdg_app_installed_ref_new (const char *full_ref,
+FlatpakInstalledRef *
+flatpak_installed_ref_new (const char *full_ref,
const char *commit,
const char *latest_commit,
const char *origin,
@@ -359,21 +359,21 @@ xdg_app_installed_ref_new (const char *full_ref,
guint64 installed_size,
gboolean is_current)
{
- XdgAppRefKind kind = XDG_APP_REF_KIND_APP;
- XdgAppInstalledRef *ref;
+ FlatpakRefKind kind = FLATPAK_REF_KIND_APP;
+ FlatpakInstalledRef *ref;
g_auto(GStrv) parts = NULL;
parts = g_strsplit (full_ref, "/", -1);
if (strcmp (parts[0], "app") != 0)
- kind = XDG_APP_REF_KIND_RUNTIME;
+ kind = FLATPAK_REF_KIND_RUNTIME;
/* Canonicalize the "no subpaths" case */
if (subpaths && *subpaths == NULL)
subpaths = NULL;
- ref = g_object_new (XDG_APP_TYPE_INSTALLED_REF,
+ ref = g_object_new (FLATPAK_TYPE_INSTALLED_REF,
"kind", kind,
"name", parts[1],
"arch", parts[2],
diff --git a/lib/xdg-app-installed-ref.h b/lib/xdg-app-installed-ref.h
index f29c434..863a066 100644
--- a/lib/xdg-app-installed-ref.h
+++ b/lib/xdg-app-installed-ref.h
@@ -18,46 +18,46 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#if !defined(__XDG_APP_H_INSIDE__) && !defined(XDG_APP_COMPILATION)
+#if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION)
#error "Only <xdg-app.h> can be included directly."
#endif
-#ifndef __XDG_APP_INSTALLED_REF_H__
-#define __XDG_APP_INSTALLED_REF_H__
+#ifndef __FLATPAK_INSTALLED_REF_H__
+#define __FLATPAK_INSTALLED_REF_H__
-typedef struct _XdgAppInstalledRef XdgAppInstalledRef;
+typedef struct _FlatpakInstalledRef FlatpakInstalledRef;
#include <gio/gio.h>
#include <xdg-app-ref.h>
-#define XDG_APP_TYPE_INSTALLED_REF xdg_app_installed_ref_get_type ()
-#define XDG_APP_INSTALLED_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XDG_APP_TYPE_INSTALLED_REF, XdgAppInstalledRef))
-#define XDG_APP_IS_INSTALLED_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XDG_APP_TYPE_INSTALLED_REF))
+#define FLATPAK_TYPE_INSTALLED_REF flatpak_installed_ref_get_type ()
+#define FLATPAK_INSTALLED_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_INSTALLED_REF, FlatpakInstalledRef))
+#define FLATPAK_IS_INSTALLED_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_INSTALLED_REF))
-XDG_APP_EXTERN GType xdg_app_installed_ref_get_type (void);
+FLATPAK_EXTERN GType flatpak_installed_ref_get_type (void);
-struct _XdgAppInstalledRef
+struct _FlatpakInstalledRef
{
- XdgAppRef parent;
+ FlatpakRef parent;
};
typedef struct
{
- XdgAppRefClass parent_class;
-} XdgAppInstalledRefClass;
+ FlatpakRefClass parent_class;
+} FlatpakInstalledRefClass;
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (XdgAppInstalledRef, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakInstalledRef, g_object_unref)
#endif
-XDG_APP_EXTERN const char *xdg_app_installed_ref_get_origin (XdgAppInstalledRef * self);
-XDG_APP_EXTERN const char * const *xdg_app_installed_ref_get_subpaths (XdgAppInstalledRef *self);
-XDG_APP_EXTERN guint64 xdg_app_installed_ref_get_installed_size (XdgAppInstalledRef *self);
-XDG_APP_EXTERN const char *xdg_app_installed_ref_get_deploy_dir (XdgAppInstalledRef *self);
-XDG_APP_EXTERN const char *xdg_app_installed_ref_get_latest_commit (XdgAppInstalledRef *self);
-XDG_APP_EXTERN gboolean xdg_app_installed_ref_get_is_current (XdgAppInstalledRef *self);
-XDG_APP_EXTERN GBytes *xdg_app_installed_ref_load_metadata (XdgAppInstalledRef *self,
- GCancellable *cancellable,
- GError **error);
-
-#endif /* __XDG_APP_INSTALLED_REF_H__ */
+FLATPAK_EXTERN const char *flatpak_installed_ref_get_origin (FlatpakInstalledRef * self);
+FLATPAK_EXTERN const char * const *flatpak_installed_ref_get_subpaths (FlatpakInstalledRef *self);
+FLATPAK_EXTERN guint64 flatpak_installed_ref_get_installed_size (FlatpakInstalledRef *self);
+FLATPAK_EXTERN const char *flatpak_installed_ref_get_deploy_dir (FlatpakInstalledRef *self);
+FLATPAK_EXTERN const char *flatpak_installed_ref_get_latest_commit (FlatpakInstalledRef *self);
+FLATPAK_EXTERN gboolean flatpak_installed_ref_get_is_current (FlatpakInstalledRef *self);
+FLATPAK_EXTERN GBytes *flatpak_installed_ref_load_metadata (FlatpakInstalledRef *self,
+ GCancellable *cancellable,
+ GError **error);
+
+#endif /* __FLATPAK_INSTALLED_REF_H__ */
diff --git a/lib/xdg-app-ref.c b/lib/xdg-app-ref.c
index b450a5c..b5137f7 100644
--- a/lib/xdg-app-ref.c
+++ b/lib/xdg-app-ref.c
@@ -26,37 +26,37 @@
/**
* SECTION:xdg-app-ref
- * @Title: XdgAppRef
+ * @Title: FlatpakRef
* @Short_description: Application reference
*
* Currently xdg-app manages two types of binary artifacts: applications, and
* runtimes. Applications contain a program that desktop users can run, while
- * runtimes contain only libraries and data. An XdgAppRef object (or short: ref)
+ * runtimes contain only libraries and data. An FlatpakRef object (or short: ref)
* can refer to either of these.
*
* Both applications and runtimes are identified by a 4-tuple of strings: kind,
* name, arch and branch, e.g. app/org.gnome.evince/x86_64/master. The functions
- * xdg_app_ref_parse() and xdg_app_ref_format_ref() can be used to convert
- * XdgAppRef objects into this string representation and back.
+ * flatpak_ref_parse() and flatpak_ref_format_ref() can be used to convert
+ * FlatpakRef objects into this string representation and back.
*
* To uniquely identify a particular version of an application or runtime, you
* need a commit.
*
- * The subclasses #XdgAppInstalledRef and #XdgAppRemoteRef provide more information
+ * The subclasses #FlatpakInstalledRef and #FlatpakRemoteRef provide more information
* for artifacts that are locally installed or available from a remote repository.
*/
-typedef struct _XdgAppRefPrivate XdgAppRefPrivate;
+typedef struct _FlatpakRefPrivate FlatpakRefPrivate;
-struct _XdgAppRefPrivate
+struct _FlatpakRefPrivate
{
- char *name;
- char *arch;
- char *branch;
- char *commit;
- XdgAppRefKind kind;
+ char *name;
+ char *arch;
+ char *branch;
+ char *commit;
+ FlatpakRefKind kind;
};
-G_DEFINE_TYPE_WITH_PRIVATE (XdgAppRef, xdg_app_ref, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (FlatpakRef, flatpak_ref, G_TYPE_OBJECT)
enum {
PROP_0,
@@ -69,27 +69,27 @@ enum {
};
static void
-xdg_app_ref_finalize (GObject *object)
+flatpak_ref_finalize (GObject *object)
{
- XdgAppRef *self = XDG_APP_REF (object);
- XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
+ FlatpakRef *self = FLATPAK_REF (object);
+ FlatpakRefPrivate *priv = flatpak_ref_get_instance_private (self);
g_free (priv->name);
g_free (priv->arch);
g_free (priv->branch);
g_free (priv->commit);
- G_OBJECT_CLASS (xdg_app_ref_parent_class)->finalize (object);
+ G_OBJECT_CLASS (flatpak_ref_parent_class)->finalize (object);
}
static void
-xdg_app_ref_set_property (GObject *object,
+flatpak_ref_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- XdgAppRef *self = XDG_APP_REF (object);
- XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
+ FlatpakRef *self = FLATPAK_REF (object);
+ FlatpakRefPrivate *priv = flatpak_ref_get_instance_private (self);
switch (prop_id)
{
@@ -124,13 +124,13 @@ xdg_app_ref_set_property (GObject *object,
}
static void
-xdg_app_ref_get_property (GObject *object,
+flatpak_ref_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- XdgAppRef *self = XDG_APP_REF (object);
- XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
+ FlatpakRef *self = FLATPAK_REF (object);
+ FlatpakRefPrivate *priv = flatpak_ref_get_instance_private (self);
switch (prop_id)
{
@@ -161,13 +161,13 @@ xdg_app_ref_get_property (GObject *object,
}
static void
-xdg_app_ref_class_init (XdgAppRefClass *klass)
+flatpak_ref_class_init (FlatpakRefClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->get_property = xdg_app_ref_get_property;
- object_class->set_property = xdg_app_ref_set_property;
- object_class->finalize = xdg_app_ref_finalize;
+ object_class->get_property = flatpak_ref_get_property;
+ object_class->set_property = flatpak_ref_set_property;
+ object_class->finalize = flatpak_ref_finalize;
g_object_class_install_property (object_class,
PROP_NAME,
@@ -202,150 +202,150 @@ xdg_app_ref_class_init (XdgAppRefClass *klass)
g_param_spec_enum ("kind",
"Kind",
"The kind of artifact",
- XDG_TYPE_APP_REF_KIND,
- XDG_APP_REF_KIND_APP,
+ FLATPAK_TYPE_REF_KIND,
+ FLATPAK_REF_KIND_APP,
G_PARAM_READWRITE));
}
static void
-xdg_app_ref_init (XdgAppRef *self)
+flatpak_ref_init (FlatpakRef *self)
{
- XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
+ FlatpakRefPrivate *priv = flatpak_ref_get_instance_private (self);
- priv->kind = XDG_APP_REF_KIND_APP;
+ priv->kind = FLATPAK_REF_KIND_APP;
}
/**
- * xdg_app_ref_get_name:
- * @self: a #XdgAppRef
+ * flatpak_ref_get_name:
+ * @self: a #FlatpakRef
*
* Gets the name of the ref.
*
* Returns: (transfer none): the name
*/
const char *
-xdg_app_ref_get_name (XdgAppRef *self)
+flatpak_ref_get_name (FlatpakRef *self)
{
- XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
+ FlatpakRefPrivate *priv = flatpak_ref_get_instance_private (self);
return priv->name;
}
/**
- * xdg_app_ref_get_arch:
- * @self: a #XdgAppRef
+ * flatpak_ref_get_arch:
+ * @self: a #FlatpakRef
*
* Gets the arch or the ref.
*
* Returns: (transfer none): the arch
*/
const char *
-xdg_app_ref_get_arch (XdgAppRef *self)
+flatpak_ref_get_arch (FlatpakRef *self)
{
- XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
+ FlatpakRefPrivate *priv = flatpak_ref_get_instance_private (self);
return priv->arch;
}
/**
- * xdg_app_ref_get_branch:
- * @self: a #XdgAppRef
+ * flatpak_ref_get_branch:
+ * @self: a #FlatpakRef
*
* Gets the branch of the ref.
*
* Returns: (transfer none): the branch
*/
const char *
-xdg_app_ref_get_branch (XdgAppRef *self)
+flatpak_ref_get_branch (FlatpakRef *self)
{
- XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
+ FlatpakRefPrivate *priv = flatpak_ref_get_instance_private (self);
return priv->branch;
}
/**
- * xdg_app_ref_get_commit:
- * @self: a #XdgAppRef
+ * flatpak_ref_get_commit:
+ * @self: a #FlatpakRef
*
* Gets the commit of the ref.
*
* Returns: (transfer none): the commit
*/
const char *
-xdg_app_ref_get_commit (XdgAppRef *self)
+flatpak_ref_get_commit (FlatpakRef *self)
{
- XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
+ FlatpakRefPrivate *priv = flatpak_ref_get_instance_private (self);
return priv->commit;
}
/**
- * xdg_app_ref_get_kind:
- * @self: a #XdgAppRef
+ * flatpak_ref_get_kind:
+ * @self: a #FlatpakRef
*
* Gets the kind of artifact that this ref refers to.
*
* Returns: the kind of artifact
*/
-XdgAppRefKind
-xdg_app_ref_get_kind (XdgAppRef *self)
+FlatpakRefKind
+flatpak_ref_get_kind (FlatpakRef *self)
{
- XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
+ FlatpakRefPrivate *priv = flatpak_ref_get_instance_private (self);
return priv->kind;
}
/**
- * xdg_app_ref_format_ref:
- * @self: a #XdgAppRef
+ * flatpak_ref_format_ref:
+ * @self: a #FlatpakRef
*
- * Convert an XdgAppRef object into a string representation that
- * can be parsed by xdg_app_ref_parse().
+ * Convert an FlatpakRef object into a string representation that
+ * can be parsed by flatpak_ref_parse().
*
* Returns: (transfer full): string representation
*/
char *
-xdg_app_ref_format_ref (XdgAppRef *self)
+flatpak_ref_format_ref (FlatpakRef *self)
{
- XdgAppRefPrivate *priv = xdg_app_ref_get_instance_private (self);
+ FlatpakRefPrivate *priv = flatpak_ref_get_instance_private (self);
- if (priv->kind == XDG_APP_REF_KIND_APP)
- return xdg_app_build_app_ref (priv->name,
+ if (priv->kind == FLATPAK_REF_KIND_APP)
+ return flatpak_build_app_ref (priv->name,
priv->branch,
priv->arch);
else
- return xdg_app_build_runtime_ref (priv->name,
+ return flatpak_build_runtime_ref (priv->name,
priv->branch,
priv->arch);
}
/**
- * xdg_app_ref_parse:
+ * flatpak_ref_parse:
* @ref: A string ref name, such as "app/org.test.App/86_64/master"
* @error: return location for a #GError
*
- * Tries to parse a full ref name and return a #XdgAppRef (without a
+ * Tries to parse a full ref name and return a #FlatpakRef (without a
* commit set) or fail if the ref is invalid somehow.
*
- * Returns: (transfer full): an #XdgAppRef, or %NULL
+ * Returns: (transfer full): an #FlatpakRef, or %NULL
*/
-XdgAppRef *
-xdg_app_ref_parse (const char *ref, GError **error)
+FlatpakRef *
+flatpak_ref_parse (const char *ref, GError **error)
{
g_auto(GStrv) parts = NULL;
- parts = xdg_app_decompose_ref (ref, error);
+ parts = flatpak_decompose_ref (ref, error);
if (parts == NULL)
return NULL;
- XdgAppRefKind kind;
+ FlatpakRefKind kind;
if (g_strcmp0 (parts[0], "app") == 0)
{
- kind = XDG_APP_REF_KIND_APP;
+ kind = FLATPAK_REF_KIND_APP;
}
else if (g_strcmp0 (parts[0], "runtime") == 0)
{
- kind = XDG_APP_REF_KIND_RUNTIME;
+ kind = FLATPAK_REF_KIND_RUNTIME;
}
else
{
@@ -354,7 +354,7 @@ xdg_app_ref_parse (const char *ref, GError **error)
return NULL;
}
- return XDG_APP_REF (g_object_new (XDG_APP_TYPE_REF,
+ return FLATPAK_REF (g_object_new (FLATPAK_TYPE_REF,
"kind", kind,
"name", parts[1],
"arch", parts[2],
diff --git a/lib/xdg-app-ref.h b/lib/xdg-app-ref.h
index 9952f83..7e54739 100644
--- a/lib/xdg-app-ref.h
+++ b/lib/xdg-app-ref.h
@@ -18,24 +18,24 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#if !defined(__XDG_APP_H_INSIDE__) && !defined(XDG_APP_COMPILATION)
+#if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION)
#error "Only <xdg-app.h> can be included directly."
#endif
-#ifndef __XDG_APP_REF_H__
-#define __XDG_APP_REF_H__
+#ifndef __FLATPAK_REF_H__
+#define __FLATPAK_REF_H__
-typedef struct _XdgAppRef XdgAppRef;
+typedef struct _FlatpakRef FlatpakRef;
#include <glib-object.h>
-#define XDG_APP_TYPE_REF xdg_app_ref_get_type ()
-#define XDG_APP_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XDG_APP_TYPE_REF, XdgAppRef))
-#define XDG_APP_IS_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XDG_APP_TYPE_REF))
+#define FLATPAK_TYPE_REF flatpak_ref_get_type ()
+#define FLATPAK_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_REF, FlatpakRef))
+#define FLATPAK_IS_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_REF))
-XDG_APP_EXTERN GType xdg_app_ref_get_type (void);
+FLATPAK_EXTERN GType flatpak_ref_get_type (void);
-struct _XdgAppRef
+struct _FlatpakRef
{
GObject parent;
};
@@ -43,32 +43,32 @@ struct _XdgAppRef
typedef struct
{
GObjectClass parent_class;
-} XdgAppRefClass;
+} FlatpakRefClass;
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (XdgAppRef, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakRef, g_object_unref)
#endif
/**
- * XdgAppRefKind:
- * @XDG_APP_REF_KIND_APP: An application
- * @XDG_APP_REF_KIND_RUNTIME: A runtime that applications can use.
+ * FlatpakRefKind:
+ * @FLATPAK_REF_KIND_APP: An application
+ * @FLATPAK_REF_KIND_RUNTIME: A runtime that applications can use.
*
- * The kind of artifact that a XdgAppRef refers to.
+ * The kind of artifact that a FlatpakRef refers to.
*/
typedef enum {
- XDG_APP_REF_KIND_APP,
- XDG_APP_REF_KIND_RUNTIME,
-} XdgAppRefKind;
+ FLATPAK_REF_KIND_APP,
+ FLATPAK_REF_KIND_RUNTIME,
+} FlatpakRefKind;
-XDG_APP_EXTERN const char * xdg_app_ref_get_name (XdgAppRef *self);
-XDG_APP_EXTERN const char * xdg_app_ref_get_arch (XdgAppRef *self);
-XDG_APP_EXTERN const char * xdg_app_ref_get_branch (XdgAppRef *self);
-XDG_APP_EXTERN const char * xdg_app_ref_get_commit (XdgAppRef *self);
-XDG_APP_EXTERN XdgAppRefKind xdg_app_ref_get_kind (XdgAppRef *self);
-XDG_APP_EXTERN char * xdg_app_ref_format_ref (XdgAppRef *self);
-XDG_APP_EXTERN XdgAppRef * xdg_app_ref_parse (const char *ref,
- GError **error);
+FLATPAK_EXTERN const char * flatpak_ref_get_name (FlatpakRef *self);
+FLATPAK_EXTERN const char * flatpak_ref_get_arch (FlatpakRef *self);
+FLATPAK_EXTERN const char * flatpak_ref_get_branch (FlatpakRef *self);
+FLATPAK_EXTERN const char * flatpak_ref_get_commit (FlatpakRef *self);
+FLATPAK_EXTERN FlatpakRefKind flatpak_ref_get_kind (FlatpakRef *self);
+FLATPAK_EXTERN char * flatpak_ref_format_ref (FlatpakRef *self);
+FLATPAK_EXTERN FlatpakRef * flatpak_ref_parse (const char *ref,
+ GError **error);
-#endif /* __XDG_APP_REF_H__ */
+#endif /* __FLATPAK_REF_H__ */
diff --git a/lib/xdg-app-remote-private.h b/lib/xdg-app-remote-private.h
index 5cf2368..0a62841 100644
--- a/lib/xdg-app-remote-private.h
+++ b/lib/xdg-app-remote-private.h
@@ -18,18 +18,18 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#if !defined(__XDG_APP_H_INSIDE__) && !defined(XDG_APP_COMPILATION)
+#if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION)
#error "Only <xdg-app.h> can be included directly."
#endif
-#ifndef __XDG_APP_REMOTE_PRIVATE_H__
-#define __XDG_APP_REMOTE_PRIVATE_H__
+#ifndef __FLATPAK_REMOTE_PRIVATE_H__
+#define __FLATPAK_REMOTE_PRIVATE_H__
#include <xdg-app-remote.h>
#include <xdg-app-dir.h>
#include <ostree.h>
-XdgAppRemote *xdg_app_remote_new (XdgAppDir *dir,
- const char *name);
+FlatpakRemote *flatpak_remote_new (FlatpakDir *dir,
+ const char *name);
-#endif /* __XDG_APP_REMOTE_PRIVATE_H__ */
+#endif /* __FLATPAK_REMOTE_PRIVATE_H__ */
diff --git a/lib/xdg-app-remote-ref-private.h b/lib/xdg-app-remote-ref-private.h
index 668fc1c..1971711 100644
--- a/lib/xdg-app-remote-ref-private.h
+++ b/lib/xdg-app-remote-ref-private.h
@@ -18,18 +18,18 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#if !defined(__XDG_APP_H_INSIDE__) && !defined(XDG_APP_COMPILATION)
+#if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION)
#error "Only <xdg-app.h> can be included directly."
#endif
-#ifndef __XDG_APP_REMOTE_REF_PRIVATE_H__
-#define __XDG_APP_REMOTE_REF_PRIVATE_H__
+#ifndef __FLATPAK_REMOTE_REF_PRIVATE_H__
+#define __FLATPAK_REMOTE_REF_PRIVATE_H__
#include <xdg-app-remote-ref.h>
#include <xdg-app-dir.h>
-XdgAppRemoteRef *xdg_app_remote_ref_new (const char *full_ref,
- const char *commit,
- const char *remote_name);
+FlatpakRemoteRef *flatpak_remote_ref_new (const char *full_ref,
+ const char *commit,
+ const char *remote_name);
-#endif /* __XDG_APP_REMOTE_REF_PRIVATE_H__ */
+#endif /* __FLATPAK_REMOTE_REF_PRIVATE_H__ */
diff --git a/lib/xdg-app-remote-ref.c b/lib/xdg-app-remote-ref.c
index abed09c..081b11c 100644
--- a/lib/xdg-app-remote-ref.c
+++ b/lib/xdg-app-remote-ref.c
@@ -29,20 +29,20 @@
/**
* SECTION:xdg-app-remote-ref
- * @Title: XdgAppRemoteRef
+ * @Title: FlatpakRemoteRef
* @Short_description: Remote application reference
*
- * A XdgAppRemoteRef provides information about an application or runtime
+ * A FlatpakRemoteRef provides information about an application or runtime
* (in short: ref) that is available from a remote repository.
*/
-typedef struct _XdgAppRemoteRefPrivate XdgAppRemoteRefPrivate;
+typedef struct _FlatpakRemoteRefPrivate FlatpakRemoteRefPrivate;
-struct _XdgAppRemoteRefPrivate
+struct _FlatpakRemoteRefPrivate
{
char *remote_name;
};
-G_DEFINE_TYPE_WITH_PRIVATE (XdgAppRemoteRef, xdg_app_remote_ref, XDG_APP_TYPE_REF)
+G_DEFINE_TYPE_WITH_PRIVATE (FlatpakRemoteRef, flatpak_remote_ref, FLATPAK_TYPE_REF)
enum {
PROP_0,
@@ -51,24 +51,24 @@ enum {
};
static void
-xdg_app_remote_ref_finalize (GObject *object)
+flatpak_remote_ref_finalize (GObject *object)
{
- XdgAppRemoteRef *self = XDG_APP_REMOTE_REF (object);
- XdgAppRemoteRefPrivate *priv = xdg_app_remote_ref_get_instance_private (self);
+ FlatpakRemoteRef *self = FLATPAK_REMOTE_REF (object);
+ FlatpakRemoteRefPrivate *priv = flatpak_remote_ref_get_instance_private (self);
g_free (priv->remote_name);
- G_OBJECT_CLASS (xdg_app_remote_ref_parent_class)->finalize (object);
+ G_OBJECT_CLASS (flatpak_remote_ref_parent_class)->finalize (object);
}
static void
-xdg_app_remote_ref_set_property (GObject *object,
+flatpak_remote_ref_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- XdgAppRemoteRef *self = XDG_APP_REMOTE_REF (object);
- XdgAppRemoteRefPrivate *priv = xdg_app_remote_ref_get_instance_private (self);
+ FlatpakRemoteRef *self = FLATPAK_REMOTE_REF (object);
+ FlatpakRemoteRefPrivate *priv = flatpak_remote_ref_get_instance_private (self);
switch (prop_id)
{
@@ -84,13 +84,13 @@ xdg_app_remote_ref_set_property (GObject *object,
}
static void
-xdg_app_remote_ref_get_property (GObject *object,
+flatpak_remote_ref_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- XdgAppRemoteRef *self = XDG_APP_REMOTE_REF (object);
- XdgAppRemoteRefPrivate *priv = xdg_app_remote_ref_get_instance_private (self);
+ FlatpakRemoteRef *self = FLATPAK_REMOTE_REF (object);
+ FlatpakRemoteRefPrivate *priv = flatpak_remote_ref_get_instance_private (self);
switch (prop_id)
{
@@ -105,13 +105,13 @@ xdg_app_remote_ref_get_property (GObject *object,
}
static void
-xdg_app_remote_ref_class_init (XdgAppRemoteRefClass *klass)
+flatpak_remote_ref_class_init (FlatpakRemoteRefClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->get_property = xdg_app_remote_ref_get_property;
- object_class->set_property = xdg_app_remote_ref_set_property;
- object_class->finalize = xdg_app_remote_ref_finalize;
+ object_class->get_property = flatpak_remote_ref_get_property;
+ object_class->set_property = flatpak_remote_ref_set_property;
+ object_class->finalize = flatpak_remote_ref_finalize;
g_object_class_install_property (object_class,
PROP_REMOTE_NAME,
@@ -123,45 +123,45 @@ xdg_app_remote_ref_class_init (XdgAppRemoteRefClass *klass)
}
static void
-xdg_app_remote_ref_init (XdgAppRemoteRef *self)
+flatpak_remote_ref_init (FlatpakRemoteRef *self)
{
}
/**
- * xdg_app_remote_ref_get_remote_name:
- * @self: a #XdgAppRemoteRef
+ * flatpak_remote_ref_get_remote_name:
+ * @self: a #FlatpakRemoteRef
*
* Gets the remote name of the ref.
*
* Returns: (transfer none): the remote name
*/
const char *
-xdg_app_remote_ref_get_remote_name (XdgAppRemoteRef *self)
+flatpak_remote_ref_get_remote_name (FlatpakRemoteRef *self)
{
- XdgAppRemoteRefPrivate *priv = xdg_app_remote_ref_get_instance_private (self);
+ FlatpakRemoteRefPrivate *priv = flatpak_remote_ref_get_instance_private (self);
return priv->remote_name;
}
-XdgAppRemoteRef *
-xdg_app_remote_ref_new (const char *full_ref,
+FlatpakRemoteRef *
+flatpak_remote_ref_new (const char *full_ref,
const char *commit,
const char *remote_name)
{
- XdgAppRefKind kind = XDG_APP_REF_KIND_APP;
+ FlatpakRefKind kind = FLATPAK_REF_KIND_APP;
g_auto(GStrv) parts = NULL;
- XdgAppRemoteRef *ref;
+ FlatpakRemoteRef *ref;
- parts = xdg_app_decompose_ref (full_ref, NULL);
+ parts = flatpak_decompose_ref (full_ref, NULL);
if (parts == NULL)
return NULL;
if (strcmp (parts[0], "app") != 0)
- kind = XDG_APP_REF_KIND_RUNTIME;
+ kind = FLATPAK_REF_KIND_RUNTIME;
- ref = g_object_new (XDG_APP_TYPE_REMOTE_REF,
+ ref = g_object_new (FLATPAK_TYPE_REMOTE_REF,
"kind", kind,
"name", parts[1],
"arch", parts[2],
diff --git a/lib/xdg-app-remote-ref.h b/lib/xdg-app-remote-ref.h
index 25c5a83..da18f7e 100644
--- a/lib/xdg-app-remote-ref.h
+++ b/lib/xdg-app-remote-ref.h
@@ -18,38 +18,38 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#if !defined(__XDG_APP_H_INSIDE__) && !defined(XDG_APP_COMPILATION)
+#if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION)
#error "Only <xdg-app.h> can be included directly."
#endif
-#ifndef __XDG_APP_REMOTE_REF_H__
-#define __XDG_APP_REMOTE_REF_H__
+#ifndef __FLATPAK_REMOTE_REF_H__
+#define __FLATPAK_REMOTE_REF_H__
-typedef struct _XdgAppRemoteRef XdgAppRemoteRef;
+typedef struct _FlatpakRemoteRef FlatpakRemoteRef;
#include <gio/gio.h>
#include <xdg-app-ref.h>
-#define XDG_APP_TYPE_REMOTE_REF xdg_app_remote_ref_get_type ()
-#define XDG_APP_REMOTE_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XDG_APP_TYPE_REMOTE_REF, XdgAppRemoteRef))
-#define XDG_APP_IS_REMOTE_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XDG_APP_TYPE_REMOTE_REF))
+#define FLATPAK_TYPE_REMOTE_REF flatpak_remote_ref_get_type ()
+#define FLATPAK_REMOTE_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_REMOTE_REF, FlatpakRemoteRef))
+#define FLATPAK_IS_REMOTE_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_REMOTE_REF))
-XDG_APP_EXTERN GType xdg_app_remote_ref_get_type (void);
+FLATPAK_EXTERN GType flatpak_remote_ref_get_type (void);
-struct _XdgAppRemoteRef
+struct _FlatpakRemoteRef
{
- XdgAppRef parent;
+ FlatpakRef parent;
};
typedef struct
{
- XdgAppRefClass parent_class;
-} XdgAppRemoteRefClass;
+ FlatpakRefClass parent_class;
+} FlatpakRemoteRefClass;
-XDG_APP_EXTERN const char * xdg_app_remote_ref_get_remote_name (XdgAppRemoteRef *self);
+FLATPAK_EXTERN const char * flatpak_remote_ref_get_remote_name (FlatpakRemoteRef *self);
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (XdgAppRemoteRef, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakRemoteRef, g_object_unref)
#endif
-#endif /* __XDG_APP_REMOTE_REF_H__ */
+#endif /* __FLATPAK_REMOTE_REF_H__ */
diff --git a/lib/xdg-app-remote.c b/lib/xdg-app-remote.c
index a852643..6b73ac2 100644
--- a/lib/xdg-app-remote.c
+++ b/lib/xdg-app-remote.c
@@ -30,9 +30,9 @@
/**
* SECTION:xdg-app-remote
* @Short_description: Remote repository
- * @Title: XdgAppRemote
+ * @Title: FlatpakRemote
*
- * A #XdgAppRemote object provides information about a remote
+ * A #FlatpakRemote object provides information about a remote
* repository (or short: remote) that has been configured.
*
* At its most basic level, a remote has a name and the URL for
@@ -41,20 +41,20 @@
* in a UI, such as a title, a priority or a "don't enumerate"
* flags.
*
- * To obtain XdgAppRemote objects for the configured remotes
- * on a system, use xdg_app_installation_list_remotes() or
- * xdg_app_installation_get_remote_by_name().
+ * To obtain FlatpakRemote objects for the configured remotes
+ * on a system, use flatpak_installation_list_remotes() or
+ * flatpak_installation_get_remote_by_name().
*/
-typedef struct _XdgAppRemotePrivate XdgAppRemotePrivate;
+typedef struct _FlatpakRemotePrivate FlatpakRemotePrivate;
-struct _XdgAppRemotePrivate
+struct _FlatpakRemotePrivate
{
- char *name;
- XdgAppDir *dir;
+ char *name;
+ FlatpakDir *dir;
};
-G_DEFINE_TYPE_WITH_PRIVATE (XdgAppRemote, xdg_app_remote, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (FlatpakRemote, flatpak_remote, G_TYPE_OBJECT)
enum {
PROP_0,
@@ -63,25 +63,25 @@ enum {
};
static void
-xdg_app_remote_finalize (GObject *object)
+flatpak_remote_finalize (GObject *object)
{
- XdgAppRemote *self = XDG_APP_REMOTE (object);
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
+ FlatpakRemote *self = FLATPAK_REMOTE (object);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
g_free (priv->name);
g_object_unref (priv->dir);
- G_OBJECT_CLASS (xdg_app_remote_parent_class)->finalize (object);
+ G_OBJECT_CLASS (flatpak_remote_parent_class)->finalize (object);
}
static void
-xdg_app_remote_set_property (GObject *object,
+flatpak_remote_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- XdgAppRemote *self = XDG_APP_REMOTE (object);
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
+ FlatpakRemote *self = FLATPAK_REMOTE (object);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
switch (prop_id)
{
@@ -97,13 +97,13 @@ xdg_app_remote_set_property (GObject *object,
}
static void
-xdg_app_remote_get_property (GObject *object,
+flatpak_remote_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- XdgAppRemote *self = XDG_APP_REMOTE (object);
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
+ FlatpakRemote *self = FLATPAK_REMOTE (object);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
switch (prop_id)
{
@@ -118,13 +118,13 @@ xdg_app_remote_get_property (GObject *object,
}
static void
-xdg_app_remote_class_init (XdgAppRemoteClass *klass)
+flatpak_remote_class_init (FlatpakRemoteClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->get_property = xdg_app_remote_get_property;
- object_class->set_property = xdg_app_remote_set_property;
- object_class->finalize = xdg_app_remote_finalize;
+ object_class->get_property = flatpak_remote_get_property;
+ object_class->set_property = flatpak_remote_set_property;
+ object_class->finalize = flatpak_remote_finalize;
g_object_class_install_property (object_class,
PROP_NAME,
@@ -136,29 +136,29 @@ xdg_app_remote_class_init (XdgAppRemoteClass *klass)
}
static void
-xdg_app_remote_init (XdgAppRemote *self)
+flatpak_remote_init (FlatpakRemote *self)
{
}
/**
- * xdg_app_remote_get_name:
- * @self: a #XdgAppRemote
+ * flatpak_remote_get_name:
+ * @self: a #FlatpakRemote
*
* Returns the name of the remote repository.
*
* Returns: (transfer none): the name
*/
const char *
-xdg_app_remote_get_name (XdgAppRemote *self)
+flatpak_remote_get_name (FlatpakRemote *self)
{
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
return priv->name;
}
/**
- * xdg_app_remote_get_appstream_dir:
- * @self: a #XdgAppRemote
+ * flatpak_remote_get_appstream_dir:
+ * @self: a #FlatpakRemote
* @arch: (nullable): which architecture to fetch (default: current architecture)
*
* Returns the directory where this remote will store locally cached
@@ -167,23 +167,23 @@ xdg_app_remote_get_name (XdgAppRemote *self)
* Returns: (transfer full): a #GFile
**/
GFile *
-xdg_app_remote_get_appstream_dir (XdgAppRemote *self,
- const char *arch)
+flatpak_remote_get_appstream_dir (FlatpakRemote *self,
+ const char *arch)
{
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
g_autofree char *subdir = NULL;
if (arch == NULL)
- arch = xdg_app_get_arch ();
+ arch = flatpak_get_arch ();
subdir = g_strdup_printf ("appstream/%s/%s/active", priv->name, arch);
- return g_file_resolve_relative_path (xdg_app_dir_get_path (priv->dir),
+ return g_file_resolve_relative_path (flatpak_dir_get_path (priv->dir),
subdir);
}
/**
- * xdg_app_remote_get_appstream_timestamp:
- * @self: a #XdgAppRemote
+ * flatpak_remote_get_appstream_timestamp:
+ * @self: a #FlatpakRemote
* @arch: (nullable): which architecture to fetch (default: current architecture)
*
* Returns the timestamp file that will be updated whenever the appstream information
@@ -192,33 +192,33 @@ xdg_app_remote_get_appstream_dir (XdgAppRemote *self,
* Returns: (transfer full): a #GFile
**/
GFile *
-xdg_app_remote_get_appstream_timestamp (XdgAppRemote *self,
- const char *arch)
+flatpak_remote_get_appstream_timestamp (FlatpakRemote *self,
+ const char *arch)
{
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
g_autofree char *subdir = NULL;
if (arch == NULL)
- arch = xdg_app_get_arch ();
+ arch = flatpak_get_arch ();
subdir = g_strdup_printf ("appstream/%s/%s/.timestamp", priv->name, arch);
- return g_file_resolve_relative_path (xdg_app_dir_get_path (priv->dir),
+ return g_file_resolve_relative_path (flatpak_dir_get_path (priv->dir),
subdir);
}
/**
- * xdg_app_remote_get_url:
- * @self: a #XdgAppRemote
+ * flatpak_remote_get_url:
+ * @self: a #FlatpakRemote
*
* Returns the repository URL of this remote.
*
* Returns: (transfer full): the URL
*/
char *
-xdg_app_remote_get_url (XdgAppRemote *self)
+flatpak_remote_get_url (FlatpakRemote *self)
{
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
- OstreeRepo *repo = xdg_app_dir_get_repo (priv->dir);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
+ OstreeRepo *repo = flatpak_dir_get_repo (priv->dir);
char *url;
if (ostree_repo_remote_get_url (repo, priv->name, &url, NULL))
@@ -228,82 +228,82 @@ xdg_app_remote_get_url (XdgAppRemote *self)
}
/**
- * xdg_app_remote_get_title:
- * @self: a #XdgAppRemote
+ * flatpak_remote_get_title:
+ * @self: a #FlatpakRemote
*
* Returns the title of the remote.
*
* Returns: (transfer full): the title
*/
char *
-xdg_app_remote_get_title (XdgAppRemote *self)
+flatpak_remote_get_title (FlatpakRemote *self)
{
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
- return xdg_app_dir_get_remote_title (priv->dir, priv->name);
+ return flatpak_dir_get_remote_title (priv->dir, priv->name);
}
/**
- * xdg_app_remote_get_noenumerate:
- * @self: a #XdgAppRemote
+ * flatpak_remote_get_noenumerate:
+ * @self: a #FlatpakRemote
*
* Returns whether this remote should be used to list applications.
*
* Returns: whether the remote is marked as "don't enumerate"
*/
gboolean
-xdg_app_remote_get_noenumerate (XdgAppRemote *self)
+flatpak_remote_get_noenumerate (FlatpakRemote *self)
{
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
- return xdg_app_dir_get_remote_noenumerate (priv->dir, priv->name);
+ return flatpak_dir_get_remote_noenumerate (priv->dir, priv->name);
}
/**
- * xdg_app_remote_get_disable:
- * @self: a #XdgAppRemote
+ * flatpak_remote_get_disable:
+ * @self: a #FlatpakRemote
*
* Returns whether this remote is disabled.
*
* Returns: whether the remote is marked as "don't enumerate"
*/
gboolean
-xdg_app_remote_get_disabled (XdgAppRemote *self)
+flatpak_remote_get_disabled (FlatpakRemote *self)
{
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
- return xdg_app_dir_get_remote_disabled (priv->dir, priv->name);
+ return flatpak_dir_get_remote_disabled (priv->dir, priv->name);
}
/**
- * xdg_app_remote_get_prio:
- * @self: a #XdgAppRemote
+ * flatpak_remote_get_prio:
+ * @self: a #FlatpakRemote
*
* Returns the priority for the remote.
*
* Returns: the priority
*/
int
-xdg_app_remote_get_prio (XdgAppRemote *self)
+flatpak_remote_get_prio (FlatpakRemote *self)
{
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
- return xdg_app_dir_get_remote_prio (priv->dir, priv->name);
+ return flatpak_dir_get_remote_prio (priv->dir, priv->name);
}
/**
- * xdg_app_remote_get_gpg_verify:
- * @self: a #XdgAppRemote
+ * flatpak_remote_get_gpg_verify:
+ * @self: a #FlatpakRemote
*
* Returns whether GPG verification is enabled for the remote.
*
* Returns: whether GPG verification is enabled
*/
gboolean
-xdg_app_remote_get_gpg_verify (XdgAppRemote *self)
+flatpak_remote_get_gpg_verify (FlatpakRemote *self)
{
- XdgAppRemotePrivate *priv = xdg_app_remote_get_instance_private (self);
- OstreeRepo *repo = xdg_app_dir_get_repo (priv->dir);
+ FlatpakRemotePrivate *priv = flatpak_remote_get_instance_private (self);
+ OstreeRepo *repo = flatpak_dir_get_repo (priv->dir);
gboolean res;
if (ostree_repo_remote_get_gpg_verify (repo, priv->name, &res, NULL))
@@ -312,16 +312,16 @@ xdg_app_remote_get_gpg_verify (XdgAppRemote *self)
return FALSE;
}
-XdgAppRemote *
-xdg_app_remote_new (XdgAppDir *dir,
+FlatpakRemote *
+flatpak_remote_new (FlatpakDir *dir,
const char *name)
{
- XdgAppRemotePrivate *priv;
- XdgAppRemote *self = g_object_new (XDG_APP_TYPE_REMOTE,
- "name", name,
- NULL);
+ FlatpakRemotePrivate *priv;
+ FlatpakRemote *self = g_object_new (FLATPAK_TYPE_REMOTE,
+ "name", name,
+ NULL);
- priv = xdg_app_remote_get_instance_private (self);
+ priv = flatpak_remote_get_instance_private (self);
priv->dir = g_object_ref (dir);
return self;
diff --git a/lib/xdg-app-remote.h b/lib/xdg-app-remote.h
index 31154da..87e5149 100644
--- a/lib/xdg-app-remote.h
+++ b/lib/xdg-app-remote.h
@@ -18,25 +18,25 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#if !defined(__XDG_APP_H_INSIDE__) && !defined(XDG_APP_COMPILATION)
+#if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION)
#error "Only <xdg-app.h> can be included directly."
#endif
-#ifndef __XDG_APP_REMOTE_H__
-#define __XDG_APP_REMOTE_H__
+#ifndef __FLATPAK_REMOTE_H__
+#define __FLATPAK_REMOTE_H__
-typedef struct _XdgAppRemote XdgAppRemote;
+typedef struct _FlatpakRemote FlatpakRemote;
#include <gio/gio.h>
#include <xdg-app-remote-ref.h>
-#define XDG_APP_TYPE_REMOTE xdg_app_remote_get_type ()
-#define XDG_APP_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XDG_APP_TYPE_REMOTE, XdgAppRemote))
-#define XDG_APP_IS_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XDG_APP_TYPE_REMOTE))
+#define FLATPAK_TYPE_REMOTE flatpak_remote_get_type ()
+#define FLATPAK_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_REMOTE, FlatpakRemote))
+#define FLATPAK_IS_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_REMOTE))
-XDG_APP_EXTERN GType xdg_app_remote_get_type (void);
+FLATPAK_EXTERN GType flatpak_remote_get_type (void);
-struct _XdgAppRemote
+struct _FlatpakRemote
{
GObject parent;
};
@@ -44,22 +44,22 @@ struct _XdgAppRemote
typedef struct
{
GObjectClass parent_class;
-} XdgAppRemoteClass;
+} FlatpakRemoteClass;
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (XdgAppRemote, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakRemote, g_object_unref)
#endif
-XDG_APP_EXTERN const char * xdg_app_remote_get_name (XdgAppRemote * self);
-XDG_APP_EXTERN GFile * xdg_app_remote_get_appstream_dir (XdgAppRemote *self,
- const char *arch);
-XDG_APP_EXTERN GFile * xdg_app_remote_get_appstream_timestamp (XdgAppRemote *self,
- const char *arch);
-XDG_APP_EXTERN char * xdg_app_remote_get_url (XdgAppRemote *self);
-XDG_APP_EXTERN char * xdg_app_remote_get_title (XdgAppRemote *self);
-XDG_APP_EXTERN gboolean xdg_app_remote_get_gpg_verify (XdgAppRemote *self);
-XDG_APP_EXTERN gboolean xdg_app_remote_get_noenumerate (XdgAppRemote *self);
-XDG_APP_EXTERN gboolean xdg_app_remote_get_disabled (XdgAppRemote *self);
-XDG_APP_EXTERN int xdg_app_remote_get_prio (XdgAppRemote *self);
+FLATPAK_EXTERN const char * flatpak_remote_get_name (FlatpakRemote * self);
+FLATPAK_EXTERN GFile * flatpak_remote_get_appstream_dir (FlatpakRemote *self,
+ const char *arch);
+FLATPAK_EXTERN GFile * flatpak_remote_get_appstream_timestamp (FlatpakRemote *self,
+ const char *arch);
+FLATPAK_EXTERN char * flatpak_remote_get_url (FlatpakRemote *self);
+FLATPAK_EXTERN char * flatpak_remote_get_title (FlatpakRemote *self);
+FLATPAK_EXTERN gboolean flatpak_remote_get_gpg_verify (FlatpakRemote *self);
+FLATPAK_EXTERN gboolean flatpak_remote_get_noenumerate (FlatpakRemote *self);
+FLATPAK_EXTERN gboolean flatpak_remote_get_disabled (FlatpakRemote *self);
+FLATPAK_EXTERN int flatpak_remote_get_prio (FlatpakRemote *self);
-#endif /* __XDG_APP_REMOTE_H__ */
+#endif /* __FLATPAK_REMOTE_H__ */
diff --git a/lib/xdg-app-version-macros.h.in b/lib/xdg-app-version-macros.h.in
index e81e25f..74eb77a 100644
--- a/lib/xdg-app-version-macros.h.in
+++ b/lib/xdg-app-version-macros.h.in
@@ -18,19 +18,19 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#if !defined (__XDG_APP_H_INSIDE__) && !defined (XDG_APP_COMPILATION)
+#if !defined (__FLATPAK_H_INSIDE__) && !defined (FLATPAK_COMPILATION)
#error "Only <xdg-app.h> can be included directly."
#endif
-#ifndef __XDG_APP_VERSION_MACROS_H__
-#define __XDG_APP_VERSION_MACROS_H__
+#ifndef __FLATPAK_VERSION_MACROS_H__
+#define __FLATPAK_VERSION_MACROS_H__
-#define XDG_APP_MAJOR_VERSION (@XDG_APP_MAJOR_VERSION@)
-#define XDG_APP_MINOR_VERSION (@XDG_APP_MINOR_VERSION@)
-#define XDG_APP_MICRO_VERSION (@XDG_APP_MICRO_VERSION@)
+#define FLATPAK_MAJOR_VERSION (@FLATPAK_MAJOR_VERSION@)
+#define FLATPAK_MINOR_VERSION (@FLATPAK_MINOR_VERSION@)
+#define FLATPAK_MICRO_VERSION (@FLATPAK_MICRO_VERSION@)
-#ifndef XDG_APP_EXTERN
-#define XDG_APP_EXTERN extern
+#ifndef FLATPAK_EXTERN
+#define FLATPAK_EXTERN extern
#endif
/**
@@ -38,4 +38,4 @@
* @Title: Version information
*/
-#endif /* __XDG_APP_VERSION_MACROS_H__ */
+#endif /* __FLATPAK_VERSION_MACROS_H__ */
diff --git a/lib/xdg-app.h b/lib/xdg-app.h
index 3e21a94..f1cbee1 100644
--- a/lib/xdg-app.h
+++ b/lib/xdg-app.h
@@ -18,10 +18,10 @@
* Alexander Larsson <alexl@redhat.com>
*/
-#ifndef __XDG_APP_H__
-#define __XDG_APP_H__
+#ifndef __FLATPAK_H__
+#define __FLATPAK_H__
-#define __XDG_APP_H_INSIDE__
+#define __FLATPAK_H_INSIDE__
#include <gio/gio.h>
@@ -35,6 +35,6 @@
#include <xdg-app-remote.h>
#include <xdg-app-installation.h>
-#undef __XDG_APP_H_INSIDE__
+#undef __FLATPAK_H_INSIDE__
-#endif /* __XDG_APP_H__ */
+#endif /* __FLATPAK_H__ */