[gnome-software/wip/hughsie/libgnomesoftware: 2/2] Create an experimental libgnomesoftware shared library
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/hughsie/libgnomesoftware: 2/2] Create an experimental libgnomesoftware shared library
- Date: Tue, 10 May 2016 08:42:36 +0000 (UTC)
commit 25b493a129a3f48333560aa9c15e703345690c22
Author: Richard Hughes <richard hughsie com>
Date: Thu May 5 21:09:31 2016 +0100
Create an experimental libgnomesoftware shared library
This allows us to create vendor-specific plugins for RHEL.
Makefile.am | 2 +
configure.ac | 66 ++-
doc/Makefile.am | 4 +
doc/api/Makefile.am | 83 ++
doc/api/clean.sh | 6 +
doc/api/gnome-software-docs.sgml | 63 ++
doc/api/version.xml.in | 1 +
libgnomesoftware/Makefile.am | 71 ++
.../gnome-software.h | 40 +-
libgnomesoftware/gnome-software.pc.in | 12 +
{src => libgnomesoftware}/gs-app-list.c | 45 +-
{src => libgnomesoftware}/gs-app-list.h | 0
{src => libgnomesoftware}/gs-app.c | 825 +++++++++++++++++---
{src => libgnomesoftware}/gs-app.h | 24 +-
{src => libgnomesoftware}/gs-category.c | 74 ++-
{src => libgnomesoftware}/gs-category.h | 2 +-
{src => libgnomesoftware}/gs-os-release.c | 0
{src => libgnomesoftware}/gs-os-release.h | 0
{src => libgnomesoftware}/gs-plugin-private.h | 0
{src => libgnomesoftware}/gs-plugin.c | 198 +++++-
{src => libgnomesoftware}/gs-plugin.h | 64 ++
{src => libgnomesoftware}/gs-review.c | 151 ++++-
{src => libgnomesoftware}/gs-review.h | 30 +-
libgnomesoftware/gs-utils.c | 306 ++++++++
{src => libgnomesoftware}/gs-utils.h | 57 +-
.../gs-version.h.in | 46 +-
po/POTFILES.in | 6 +-
src/Makefile.am | 46 +-
src/gs-app-row.c | 2 +-
src/gs-app-tile.c | 2 +-
src/{gs-utils.c => gs-common.c} | 236 +------
src/{gs-utils.h => gs-common.h} | 30 +-
src/gs-feature-tile.c | 2 +-
src/gs-history-dialog.c | 2 +-
src/gs-page.c | 2 +-
src/gs-plugin-loader.c | 2 +-
src/gs-popular-tile.c | 2 +-
src/gs-screenshot-image.c | 3 +-
src/gs-shell-category.c | 2 +-
src/gs-shell-details.c | 4 +-
src/gs-shell-extras.c | 2 +-
src/gs-shell-installed.c | 2 +-
src/gs-shell-moderate.c | 2 +-
src/gs-shell-overview.c | 2 +-
src/gs-shell-search.c | 2 +-
src/gs-shell-updates.c | 2 +-
src/gs-shell.c | 2 +-
src/gs-sources-dialog.c | 2 +-
src/gs-update-dialog.c | 2 +-
src/gs-upgrade-banner.c | 2 +-
src/plugins/Makefile.am | 4 +-
src/plugins/gs-appstream.c | 3 +-
src/plugins/gs-appstream.h | 4 +-
src/plugins/gs-plugin-appstream.c | 10 +-
src/plugins/gs-plugin-dpkg.c | 4 +-
src/plugins/gs-plugin-dummy.c | 2 +-
src/plugins/gs-plugin-epiphany.c | 6 +-
src/plugins/gs-plugin-fedora-distro-upgrades.c | 5 +-
src/plugins/gs-plugin-fedora-tagger-usage.c | 4 +-
src/plugins/gs-plugin-fwupd.c | 5 +-
src/plugins/gs-plugin-hardcoded-blacklist.c | 3 +-
src/plugins/gs-plugin-icons.c | 7 +-
src/plugins/gs-plugin-key-colors.c | 2 +-
src/plugins/gs-plugin-limba.c | 3 +-
src/plugins/gs-plugin-menu-spec-categories.c | 2 +-
src/plugins/gs-plugin-menu-spec-refine.c | 2 +-
src/plugins/gs-plugin-odrs.c | 8 +-
src/plugins/gs-plugin-ostree.c | 4 +-
src/plugins/gs-plugin-packagekit-history.c | 2 +-
src/plugins/gs-plugin-packagekit-local.c | 4 +-
src/plugins/gs-plugin-packagekit-offline.c | 2 +-
src/plugins/gs-plugin-packagekit-origin.c | 4 +-
src/plugins/gs-plugin-packagekit-proxy.c | 4 +-
src/plugins/gs-plugin-packagekit-refine.c | 5 +-
src/plugins/gs-plugin-packagekit-refresh.c | 5 +-
src/plugins/gs-plugin-packagekit-upgrade.c | 2 +-
src/plugins/gs-plugin-packagekit.c | 3 +-
src/plugins/gs-plugin-provenance-license.c | 3 +-
src/plugins/gs-plugin-provenance.c | 3 +-
src/plugins/gs-plugin-rpm.c | 2 +-
src/plugins/gs-plugin-shell-extensions.c | 6 +-
src/plugins/gs-plugin-steam.c | 6 +-
src/plugins/gs-plugin-systemd-updates.c | 3 +-
src/plugins/gs-plugin-ubuntu-reviews.c | 9 +-
src/plugins/gs-plugin-xdg-app.c | 4 +-
src/plugins/packagekit-common.c | 2 +-
src/plugins/packagekit-common.h | 2 +-
87 files changed, 1993 insertions(+), 687 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index eeff83f..37c2b28 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,9 @@
SUBDIRS = \
data \
po \
+ libgnomesoftware \
src \
+ doc \
tests
snapshot:
diff --git a/configure.ac b/configure.ac
index 70c5cbe..a4ee37c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,16 @@
-# Copyright (C) 2010-2015 Richard Hughes <richard hughsie com>
+# Copyright (C) 2010-2016 Richard Hughes <richard hughsie com>
+
+m4_define([gs_major_version], [3])
+m4_define([gs_minor_version], [21])
+m4_define([gs_micro_version], [2])
+m4_define([gs_version],
+ [gs_major_version.gs_minor_version.gs_micro_version])
+
AC_PREREQ(2.63)
-AC_INIT([gnome-software],[3.21.2],[http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-software])
+AC_INIT([gnome-software],
+ [gs_version],
+ [http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-software])
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar serial-tests foreign])
AC_CONFIG_HEADERS([config.h])
@@ -10,14 +19,47 @@ AC_CONFIG_MACRO_DIR([m4])
# enable nice build output on automake1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
+GS_MAJOR_VERSION=gs_major_version
+GS_MINOR_VERSION=gs_minor_version
+GS_MICRO_VERSION=gs_micro_version
+GS_VERSION=gs_version
+AC_SUBST(GS_MAJOR_VERSION)
+AC_SUBST(GS_MINOR_VERSION)
+AC_SUBST(GS_MICRO_VERSION)
+AC_SUBST(GS_VERSION)
+
+# libtool versioning - this applies to libgnomesoftware
+#
+# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
+#
+# - If interfaces have been changed or added, but binary compatibility
+# has been preserved, change:
+# CURRENT += 1
+# REVISION = 0
+# AGE += 1
+# - If binary compatibility has been broken (eg removed or changed
+# interfaces), change:
+# CURRENT += 1
+# REVISION = 0
+# AGE = 0
+# - If the interface is the same as the previous version, but bugs are
+# fixed, change:
+# REVISION += 1
+LT_CURRENT=10
+LT_REVISION=0
+LT_AGE=0
+AC_SUBST(LT_CURRENT)
+AC_SUBST(LT_REVISION)
+AC_SUBST(LT_AGE)
+
AC_PROG_CC
AC_PROG_INSTALL
LT_INIT
AM_PROG_CC_C_O
IT_PROG_INTLTOOL([0.35.0])
-#YELP_HELP_INIT
-#GNOME_DOC_INIT
+# set up gtk-doc
+GTK_DOC_CHECK([1.11],[--flavour no-tmpl])
dnl ---------------------------------------------------------------------------
dnl - Extra verbose warning switches
@@ -299,19 +341,25 @@ dnl - Makefiles, etc.
dnl ---------------------------------------------------------------------------
AC_CONFIG_FILES([
Makefile
-po/Makefile.in
data/appdata/Makefile
-data/Makefile
-data/icons/Makefile
-data/icons/hicolor/Makefile
data/icons/hicolor/16x16/Makefile
data/icons/hicolor/22x22/Makefile
data/icons/hicolor/24x24/Makefile
+data/icons/hicolor/256x256/Makefile
data/icons/hicolor/32x32/Makefile
data/icons/hicolor/48x48/Makefile
-data/icons/hicolor/256x256/Makefile
+data/icons/hicolor/Makefile
data/icons/hicolor/scalable/Makefile
+data/icons/Makefile
+data/Makefile
data/tests/Makefile
+libgnomesoftware/Makefile
+libgnomesoftware/gnome-software.pc
+libgnomesoftware/gs-version.h
+doc/Makefile
+doc/api/Makefile
+doc/api/version.xml
+po/Makefile.in
src/Makefile
src/plugins/Makefile
tests/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..6019028
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,4 @@
+SUBDIRS = \
+ api
+
+-include $(top_srcdir)/git.mk
diff --git a/doc/api/Makefile.am b/doc/api/Makefile.am
new file mode 100644
index 0000000..b4d4696
--- /dev/null
+++ b/doc/api/Makefile.am
@@ -0,0 +1,83 @@
+## Process this file with automake to produce Makefile.in
+
+# We require automake 1.6 at least.
+AUTOMAKE_OPTIONS = 1.6
+
+# The name of the module, e.g. 'glib'.
+DOC_MODULE=gnome-software
+
+# The top-level SGML file.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
+
+# The directory containing the source code.
+# gtk-doc will search all .c & .h files beneath here for inline comments
+# documenting the functions and macros.
+DOC_SOURCE_DIR=$(top_srcdir)/libgnomesoftware
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS=
+
+# Extra options to supply to gtkdoc-scan.
+SCAN_OPTIONS=
+
+# Extra options to supply to gtkdoc-mkdb.
+MKDB_OPTIONS=--sgml-mode --output-format=xml
+
+# Extra options to supply to gtkdoc-mktmpl
+MKTMPL_OPTIONS=
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+FIXXREF_OPTIONS=
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+HFILE_GLOB=$(top_srcdir)/libgnomesoftware/gs-*.h
+CFILE_GLOB=$(top_srcdir)/libgnomesoftware/gs-*.c
+
+# Header files to ignore when scanning.
+IGNORE_HFILES = \
+ config.h
+
+# Images to copy into HTML directory.
+HTML_IMAGES =
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+content_files = \
+ version.xml
+
+# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
+# These files must be listed here *and* in content_files
+expand_content_files=
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+# Only needed if you are using gtkdoc-scangobj to dynamically query widget
+# signals and properties.
+AM_CPPFLAGS = \
+ $(GLIB_CFLAGS) \
+ -I$(top_builddir)/libgnomesoftware \
+ -I$(top_srcdir)/libgnomesoftware
+
+GNOME_SOFTWARE_LIBS = \
+ $(top_builddir)/libgnomesoftware/libgnomesoftware.la
+
+GTKDOC_LIBS = \
+ $(GLIB_LIBS) \
+ $(GNOME_SOFTWARE_LIBS)
+
+# This includes the standard gtk-doc make rules, copied by gtkdocize.
+include $(top_srcdir)/gtk-doc.make
+
+# Other files to distribute
+EXTRA_DIST += version.xml.in
+
+CLEANFILES += \
+ *.txt \
+ *.types \
+ *.args \
+ *.hierarchy \
+ *.interfaces \
+ *.prerequisites \
+ *.signals \
+ *.stamp \
+ tmpl
+
+-include $(top_srcdir)/git.mk
diff --git a/doc/api/clean.sh b/doc/api/clean.sh
new file mode 100755
index 0000000..4e2009b
--- /dev/null
+++ b/doc/api/clean.sh
@@ -0,0 +1,6 @@
+rm -f *.txt
+rm -f gnome-software-scan.*
+rm -f gnome-software.types
+rm -f html/*.html
+rm -f html/*.png
+rm -f tmpl/*
diff --git a/doc/api/gnome-software-docs.sgml b/doc/api/gnome-software-docs.sgml
new file mode 100644
index 0000000..b5870c6
--- /dev/null
+++ b/doc/api/gnome-software-docs.sgml
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+<!ENTITY version SYSTEM "version.xml">
+]>
+<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
+ <bookinfo>
+ <title>GNOME Software Reference Manual</title>
+ <releaseinfo>
+ for &version;
+ </releaseinfo>
+ <authorgroup>
+ <author>
+ <firstname>Richard</firstname>
+ <surname>Hughes</surname>
+ <affiliation>
+ <address>
+ <email>richard hughsie com</email>
+ </address>
+ </affiliation>
+ </author>
+ </authorgroup>
+ <copyright>
+ <year>2013-2016</year>
+ <holder>The GNOME Software Authors</holder>
+ </copyright>
+ </bookinfo>
+
+ <reference id="api-reference">
+ <title>GNOME Software Plugin API Reference</title>
+ <partintro>
+ <para>
+ This document explains the interfaces that plugins can use.
+ </para>
+ <para>
+ Plugins are modules that are loaded at runtime to provide information
+ about requests and to service user actions like installing, removing
+ and updating.
+ This allows different distributions to pick and choose how the
+ application installer gathers data.
+ </para>
+ <para>
+ Plugins also have a priority system where the largest number gets
+ run first.
+ That means if one plugin requires some property or metadata set
+ by another plugin then it must depend on the other plugin to be
+ run in the correct order.
+ </para>
+ <para>
+ As a general rule, try to make plugins as small and self-contained
+ as possible and remember to cache as much data as possible for speed.
+ Memory is cheap, time less so.
+ </para>
+ </partintro>
+ <xi:include href="xml/gs-app-list.xml"/>
+ <xi:include href="xml/gs-app.xml"/>
+ <xi:include href="xml/gs-category.xml"/>
+ <xi:include href="xml/gs-review.xml"/>
+ <xi:include href="xml/gs-utils.xml"/>
+ </reference>
+
+</book>
+
diff --git a/doc/api/version.xml.in b/doc/api/version.xml.in
new file mode 100644
index 0000000..d78bda9
--- /dev/null
+++ b/doc/api/version.xml.in
@@ -0,0 +1 @@
+ VERSION@
diff --git a/libgnomesoftware/Makefile.am b/libgnomesoftware/Makefile.am
new file mode 100644
index 0000000..b71049c
--- /dev/null
+++ b/libgnomesoftware/Makefile.am
@@ -0,0 +1,71 @@
+AM_CPPFLAGS = \
+ $(APPSTREAM_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(GTK_CFLAGS) \
+ $(POLKIT_CFLAGS) \
+ $(SOUP_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/libgnomesoftware \
+ -I$(top_builddir)/libgnomesoftware \
+ -I. \
+ -DLOCALSTATEDIR=\""$(localstatedir)"\" \
+ -DDATADIR=\"$(datadir)\" \
+ -DGS_COMPILATION
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = \
+ gnome-software.pc
+
+lib_LTLIBRARIES = \
+ libgnomesoftware.la
+
+libgnomesoftware_includedir = $(includedir)/libgnomesoftware
+
+libgnomesoftware_include_HEADERS = \
+ gnome-software.h \
+ gs-app.h \
+ gs-app-list.h \
+ gs-category.h \
+ gs-os-release.h \
+ gs-plugin.h \
+ gs-review.h \
+ gs-utils.h \
+ gs-version.h
+
+libgnomesoftware_la_SOURCES = \
+ gs-app.c \
+ gs-app-list.c \
+ gs-category.c \
+ gs-os-release.c \
+ gs-plugin.c \
+ gs-plugin-private.h \
+ gs-review.c \
+ gs-utils.c
+
+libgnomesoftware_la_LIBADD = \
+ $(APPSTREAM_LIBS) \
+ $(GLIB_LIBS) \
+ $(POLKIT_LIBS) \
+ $(GTK_LIBS) \
+ $(SOUP_LIBS)
+
+libgnomesoftware_la_LDFLAGS = \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -export-dynamic \
+ -no-undefined \
+ -export-symbols-regex '^gs_.*'
+
+libgnomesoftware_la_CFLAGS = \
+ $(WARNINGFLAGS_C)
+
+EXTRA_DIST = \
+ gnome-software.pc.in \
+ gs-version.h.in
+
+CLEANFILES = $(BUILT_SOURCES) *.a
+
+clean-local:
+ rm -f *~
+ rm -f $(CLEANFILES)
+
+-include $(top_srcdir)/git.mk
diff --git a/src/gs-app-list.h b/libgnomesoftware/gnome-software.h
similarity index 53%
copy from src/gs-app-list.h
copy to libgnomesoftware/gnome-software.h
index ae4afca..c25cfac 100644
--- a/src/gs-app-list.h
+++ b/libgnomesoftware/gnome-software.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2012-2016 Richard Hughes <richard hughsie com>
+ * Copyright (C) 2016 Richard Hughes <richard hughsie com>
*
* Licensed under the GNU General Public License Version 2
*
@@ -19,32 +19,24 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_APP_LIST_H
-#define __GS_APP_LIST_H
+#ifndef __GNOME_SOFTWARE_H__
+#define __GNOME_SOFTWARE_H__
-#include "gs-app.h"
+#ifndef I_KNOW_THE_GNOME_SOFTWARE_API_IS_SUBJECT_TO_CHANGE
+#error You have to define I_KNOW_THE_GNOME_SOFTWARE_API_IS_SUBJECT_TO_CHANGE
+#endif
-G_BEGIN_DECLS
+#define __GNOME_SOFTWARE_INSIDE__
-typedef GList GsAppList;
+#include <libgnomesoftware/gs-app.h>
+#include <libgnomesoftware/gs-app-list.h>
+#include <libgnomesoftware/gs-category.h>
+#include <libgnomesoftware/gs-utils.h>
+#include <libgnomesoftware/gs-os-release.h>
+#include <libgnomesoftware/gs-plugin.h>
+#include <libgnomesoftware/gs-version.h>
-typedef gboolean (*GsAppListFilterFunc) (GsApp *app,
- gpointer user_data);
+#undef __GNOME_SOFTWARE_INSIDE__
-void gs_app_list_add (GsAppList **list,
- GsApp *app);
-void gs_app_list_free (GsAppList *list);
-GList *gs_app_list_copy (GsAppList *list);
-void gs_app_list_filter (GsAppList **list,
- GsAppListFilterFunc func,
- gpointer user_data);
-void gs_app_list_filter_duplicates (GsAppList **list);
-void gs_app_list_randomize (GsAppList **list);
+#endif /* __GNOME_SOFTWARE_H__ */
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GsAppList, gs_app_list_free)
-
-G_END_DECLS
-
-#endif /* __GS_APP_LIST_H */
-
-/* vim: set noexpandtab: */
diff --git a/libgnomesoftware/gnome-software.pc.in b/libgnomesoftware/gnome-software.pc.in
new file mode 100644
index 0000000..4b91659
--- /dev/null
+++ b/libgnomesoftware/gnome-software.pc.in
@@ -0,0 +1,12 @@
+prefix= prefix@
+exec_prefix= exec_prefix@
+libdir= libdir@
+includedir= includedir@
+
+Name: gnome-software
+Description: GNOME Software is a software center for GNOME
+Version: @VERSION@
+Requires.private: gthread-2.0
+Requires: glib-2.0, gobject-2.0
+Libs: -L${libdir} -lsoup
+Cflags: -I${includedir}/libgnomesoftware
diff --git a/src/gs-app-list.c b/libgnomesoftware/gs-app-list.c
similarity index 83%
rename from src/gs-app-list.c
rename to libgnomesoftware/gs-app-list.c
index 5003bf5..19e4cd5 100644
--- a/src/gs-app-list.c
+++ b/libgnomesoftware/gs-app-list.c
@@ -19,22 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-/* Introduction:
- *
- * Plugins are modules that are loaded at runtime to provide information
- * about requests and to service user actions like installing, removing
- * and updating.
- * This allows different distributions to pick and choose how the
- * application installer gathers data.
- *
- * Plugins also have a priority system where the largest number gets
- * run first. That means if one plugin requires some property or
- * metadata set by another plugin then it **must** depend on the other
- * plugin to be run in the correct order.
+/**
+ * SECTION:gs-app-list
+ * @short_description: An application list
*
- * As a general rule, try to make plugins as small and self-contained
- * as possible and remember to cache as much data as possible for speed.
- * Memory is cheap, time less so.
+ * These functions provide a refcounted list of #GsApp objects.
*/
#include "config.h"
@@ -45,6 +34,10 @@
/**
* gs_app_list_add:
+ * @list: A pointer to a #GsAppList
+ * @app: A #GsApp
+ *
+ * Adds an application to the list, adding a reference.
**/
void
gs_app_list_add (GsAppList **list, GsApp *app)
@@ -56,6 +49,9 @@ gs_app_list_add (GsAppList **list, GsApp *app)
/**
* gs_app_list_free:
+ * @list: A #GsAppList
+ *
+ * Frees the application list.
**/
void
gs_app_list_free (GsAppList *list)
@@ -65,6 +61,9 @@ gs_app_list_free (GsAppList *list)
/**
* gs_app_list_filter:
+ * @list: A pointer to a #GsAppList
+ * @func: A #GsAppListFilterFunc
+ * @user_data: the user pointer to pass to @func
*
* If func() returns TRUE for the GsApp, then the app is kept.
**/
@@ -101,15 +100,17 @@ gs_app_list_randomize_cb (gconstpointer a, gconstpointer b, gpointer user_data)
g_autofree gchar *key = NULL;
key = g_strdup_printf ("Plugin::sort-key[%p]", user_data);
- k1 = gs_app_get_metadata_item (GS_APP (a), key);
- k2 = gs_app_get_metadata_item (GS_APP (b), key);
+ k1 = gs_app_get_metadata_item ((GsApp *) a, key);
+ k2 = gs_app_get_metadata_item ((GsApp *) b, key);
return g_strcmp0 (k1, k2);
}
/**
* gs_app_list_randomize:
+ * @list: A pointer to a #GsAppList
*
- * Randomize the order of the list, but don't change the order until the next day
+ * Randomize the order of the list, but don't change the order until
+ * the next day.
**/
void
gs_app_list_randomize (GsAppList **list)
@@ -144,6 +145,9 @@ gs_app_list_randomize (GsAppList **list)
/**
* gs_app_list_filter_duplicates:
+ * @list: A pointer to a #GsAppList
+ *
+ * Filter any duplicate applications from the list.
**/
void
gs_app_list_filter_duplicates (GsAppList **list)
@@ -183,6 +187,11 @@ gs_app_list_filter_duplicates (GsAppList **list)
/**
* gs_app_list_copy:
+ * @list: A #GsAppList
+ *
+ * Returns a deep copy of the application list.
+ *
+ * Returns: A newly allocated #GsAppList
**/
GsAppList *
gs_app_list_copy (GsAppList *list)
diff --git a/src/gs-app-list.h b/libgnomesoftware/gs-app-list.h
similarity index 100%
copy from src/gs-app-list.h
copy to libgnomesoftware/gs-app-list.h
diff --git a/src/gs-app.c b/libgnomesoftware/gs-app.c
similarity index 67%
rename from src/gs-app.c
rename to libgnomesoftware/gs-app.c
index 99e7abf..b59eef9 100644
--- a/src/gs-app.c
+++ b/libgnomesoftware/gs-app.c
@@ -31,12 +31,6 @@
* AS_APP_KIND_GENERIC, which don't correspond to desktop files, but instead
* represent a system update and its individual components.
*
- * The #GsPluginLoader de-duplicates the GsApp instances that are produced by
- * plugins to ensure that there is a single instance of GsApp for each id, making
- * the id the primary key for this object. This ensures that actions triggered on
- * a GsApp in different parts of gnome-software can be observed by connecting to
- * signals on the GsApp.
- *
* Information about other #GsApp objects can be stored in this object, for
* instance in the gs_app_add_related() method or gs_app_get_history().
*/
@@ -48,6 +42,7 @@
#include <glib/gi18n.h>
#include "gs-app.h"
+#include "gs-plugin.h"
#include "gs-utils.h"
struct _GsApp
@@ -164,6 +159,11 @@ gs_app_kv_printf (GString *str, const gchar *key, const gchar *fmt, ...)
/**
* gs_app_to_string:
+ * @app: a #GsApp
+ *
+ * Returns a string representation of the application.
+ *
+ * Returns: the string
**/
gchar *
gs_app_to_string (GsApp *app)
@@ -405,6 +405,11 @@ gs_app_queue_notify (GsApp *app, const gchar *property_name)
/**
* gs_app_get_id:
+ * @app: a #GsApp
+ *
+ * Returns the application ID.
+ *
+ * Returns: the ID, e.g. "user:gimp.desktop"
**/
const gchar *
gs_app_get_id (GsApp *app)
@@ -415,6 +420,11 @@ gs_app_get_id (GsApp *app)
/**
* gs_app_get_id_no_prefix:
+ * @app: a #GsApp
+ *
+ * Returns the application ID without a prefix if one is set.
+ *
+ * Returns: the ID, e.g. "gimp.desktop"
**/
const gchar *
gs_app_get_id_no_prefix (GsApp *app)
@@ -431,7 +441,11 @@ gs_app_get_id_no_prefix (GsApp *app)
/**
* gs_app_set_id:
- */
+ * @app: a #GsApp
+ * @id: the application ID, e.g. "gimp.desktop"
+ *
+ * Sets the application ID.
+ **/
void
gs_app_set_id (GsApp *app, const gchar *id)
{
@@ -442,7 +456,12 @@ gs_app_set_id (GsApp *app, const gchar *id)
/**
* gs_app_get_state:
- */
+ * @app: a #GsApp
+ *
+ * Gets the state of the application.
+ *
+ * Returns: the #AsAppState, e.g. %AS_APP_STATE_INSTALLED
+ **/
AsAppState
gs_app_get_state (GsApp *app)
{
@@ -452,7 +471,12 @@ gs_app_get_state (GsApp *app)
/**
* gs_app_get_progress:
- */
+ * @app: a #GsApp
+ *
+ * Gets the percentage completion.
+ *
+ * Returns: the percentage completion, or 0 for unknown
+ **/
guint
gs_app_get_progress (GsApp *app)
{
@@ -462,10 +486,11 @@ gs_app_get_progress (GsApp *app)
/**
* gs_app_set_state_recover:
+ * @app: a #GsApp
*
* Sets the application state to the last status value that was not
* transient.
- */
+ **/
void
gs_app_set_state_recover (GsApp *app)
{
@@ -611,9 +636,10 @@ gs_app_set_state_internal (GsApp *app, AsAppState state)
/**
* gs_app_set_progress:
+ * @app: a #GsApp
*
* This sets the progress completion of the application.
- */
+ **/
void
gs_app_set_progress (GsApp *app, guint percentage)
{
@@ -626,13 +652,14 @@ gs_app_set_progress (GsApp *app, guint percentage)
/**
* gs_app_set_state:
+ * @app: a #GsApp
+ * @state: a #AsAppState, e.g. AS_APP_STATE_UPDATABLE_LIVE
*
* This sets the state of the application. The following state diagram explains
* the typical states. All applications start in state %AS_APP_STATE_UNKNOWN,
* but the frontend is not supposed to see GsApps with this state, ever.
* Backend plugins are reponsible for changing the state to one of the other
- * states before the GsApp is passed to the frontend. This is enforced by the
- * #GsPluginLoader.
+ * states before the GsApp is passed to the frontend.
*
* UPDATABLE --> INSTALLING --> INSTALLED
* UPDATABLE --> REMOVING --> AVAILABLE
@@ -640,7 +667,7 @@ gs_app_set_progress (GsApp *app, guint percentage)
* AVAILABLE --> INSTALLING --> INSTALLED
* AVAILABLE <--> QUEUED --> INSTALLING --> INSTALLED
* UNKNOWN --> UNAVAILABLE
- */
+ **/
void
gs_app_set_state (GsApp *app, AsAppState state)
{
@@ -652,7 +679,12 @@ gs_app_set_state (GsApp *app, AsAppState state)
/**
* gs_app_get_kind:
- */
+ * @app: a #GsApp
+ *
+ * Gets the kind of the application.
+ *
+ * Returns: the #AsAppKind, e.g. %AS_APP_KIND_UNKNOWN
+ **/
AsAppKind
gs_app_get_kind (GsApp *app)
{
@@ -662,6 +694,8 @@ gs_app_get_kind (GsApp *app)
/**
* gs_app_set_kind:
+ * @app: a #GsApp
+ * @kind: a #AsAppKind, e.g. #AS_APP_KIND_DESKTOP
*
* This sets the kind of the application. The following state diagram explains
* the typical states. All applications start with kind %AS_APP_KIND_UNKNOWN.
@@ -669,7 +703,7 @@ gs_app_get_kind (GsApp *app)
* PACKAGE --> NORMAL
* PACKAGE --> SYSTEM
* NORMAL --> SYSTEM
- */
+ **/
void
gs_app_set_kind (GsApp *app, AsAppKind kind)
{
@@ -711,7 +745,12 @@ gs_app_set_kind (GsApp *app, AsAppKind kind)
/**
* gs_app_get_name:
- */
+ * @app: a #GsApp
+ *
+ * Gets the application name.
+ *
+ * Returns: a string, or %NULL for unset
+ **/
const gchar *
gs_app_get_name (GsApp *app)
{
@@ -721,10 +760,12 @@ gs_app_get_name (GsApp *app)
/**
* gs_app_set_name:
- * @app: A #GsApp instance
- * @quality: A data quality, e.g. %GS_APP_QUALITY_LOWEST
- * @name: The short localized name, e.g. "Calculator"
- */
+ * @app: a #GsApp
+ * @quality: A data quality, e.g. %GS_APP_QUALITY_LOWEST
+ * @name: The short localized name, e.g. "Calculator"
+ *
+ * Sets the application name.
+ **/
void
gs_app_set_name (GsApp *app, GsAppQuality quality, const gchar *name)
{
@@ -741,7 +782,14 @@ gs_app_set_name (GsApp *app, GsAppQuality quality, const gchar *name)
/**
* gs_app_get_source_default:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_source_default (GsApp *app)
{
@@ -753,7 +801,12 @@ gs_app_get_source_default (GsApp *app)
/**
* gs_app_add_source:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_add_source (GsApp *app, const gchar *source)
{
@@ -773,7 +826,14 @@ gs_app_add_source (GsApp *app, const gchar *source)
/**
* gs_app_get_sources:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GPtrArray *
gs_app_get_sources (GsApp *app)
{
@@ -789,7 +849,12 @@ gs_app_get_sources (GsApp *app)
* This name is used for the update page if the application is collected into
* the 'OS Updates' group. It is typically the package names, although this
* should not be relied upon.
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_sources (GsApp *app, GPtrArray *sources)
{
@@ -801,7 +866,14 @@ gs_app_set_sources (GsApp *app, GPtrArray *sources)
/**
* gs_app_get_source_id_default:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_source_id_default (GsApp *app)
{
@@ -813,7 +885,14 @@ gs_app_get_source_id_default (GsApp *app)
/**
* gs_app_get_source_ids:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GPtrArray *
gs_app_get_source_ids (GsApp *app)
{
@@ -823,7 +902,12 @@ gs_app_get_source_ids (GsApp *app)
/**
* gs_app_clear_source_ids:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_clear_source_ids (GsApp *app)
{
@@ -838,7 +922,12 @@ gs_app_clear_source_ids (GsApp *app)
* or ["/home/hughsie/.local/share/applications/0ad.desktop"]
*
* This ID is used internally to the controlling plugin.
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_source_ids (GsApp *app, GPtrArray *source_ids)
{
@@ -850,7 +939,12 @@ gs_app_set_source_ids (GsApp *app, GPtrArray *source_ids)
/**
* gs_app_add_source_id:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_add_source_id (GsApp *app, const gchar *source_id)
{
@@ -870,7 +964,14 @@ gs_app_add_source_id (GsApp *app, const gchar *source_id)
/**
* gs_app_get_project_group:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_project_group (GsApp *app)
{
@@ -882,7 +983,12 @@ gs_app_get_project_group (GsApp *app)
* gs_app_set_project_group:
* @app: A #GsApp instance
* @project_group: The non-localized project group, e.g. "GNOME" or "KDE"
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_project_group (GsApp *app, const gchar *project_group)
{
@@ -893,6 +999,13 @@ gs_app_set_project_group (GsApp *app, const gchar *project_group)
/**
* gs_app_is_addon_id_kind
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
**/
static gboolean
gs_app_is_addon_id_kind (GsApp *app)
@@ -942,7 +1055,14 @@ icon_theme_add_path (const gchar *path)
/**
* gs_app_get_pixbuf:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GdkPixbuf *
gs_app_get_pixbuf (GsApp *app)
{
@@ -1000,7 +1120,14 @@ gs_app_get_pixbuf (GsApp *app)
/**
* gs_app_get_icon:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
AsIcon *
gs_app_get_icon (GsApp *app)
{
@@ -1010,7 +1137,12 @@ gs_app_get_icon (GsApp *app)
/**
* gs_app_set_icon:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_icon (GsApp *app, AsIcon *icon)
{
@@ -1020,7 +1152,14 @@ gs_app_set_icon (GsApp *app, AsIcon *icon)
/**
* gs_app_get_local_file:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GFile *
gs_app_get_local_file (GsApp *app)
{
@@ -1030,7 +1169,12 @@ gs_app_get_local_file (GsApp *app)
/**
* gs_app_set_local_file:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_local_file (GsApp *app, GFile *local_file)
{
@@ -1040,7 +1184,14 @@ gs_app_set_local_file (GsApp *app, GFile *local_file)
/**
* gs_app_get_runtime:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GsApp *
gs_app_get_runtime (GsApp *app)
{
@@ -1050,7 +1201,12 @@ gs_app_get_runtime (GsApp *app)
/**
* gs_app_set_runtime:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_runtime (GsApp *app, GsApp *runtime)
{
@@ -1060,7 +1216,14 @@ gs_app_set_runtime (GsApp *app, GsApp *runtime)
/**
* gs_app_load_icon:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
gboolean
gs_app_load_icon (GsApp *app, gint scale, GError **error)
{
@@ -1116,7 +1279,12 @@ gs_app_load_icon (GsApp *app, gint scale, GError **error)
/**
* gs_app_set_pixbuf:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_pixbuf (GsApp *app, GdkPixbuf *pixbuf)
{
@@ -1135,6 +1303,13 @@ typedef enum {
* gs_app_get_ui_version:
*
* convert 1:1.6.2-7.fc17 into "Version 1.6.2"
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
**/
static gchar *
gs_app_get_ui_version (const gchar *version, guint64 flags)
@@ -1233,7 +1408,14 @@ gs_app_ui_versions_populate (GsApp *app)
/**
* gs_app_get_version:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_version (GsApp *app)
{
@@ -1243,7 +1425,14 @@ gs_app_get_version (GsApp *app)
/**
* gs_app_get_version_ui:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_version_ui (GsApp *app)
{
@@ -1265,7 +1454,12 @@ gs_app_get_version_ui (GsApp *app)
*
* This saves the version after stripping out any non-friendly parts, such as
* distro tags, git revisions and that kind of thing.
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_version (GsApp *app, const gchar *version)
{
@@ -1278,7 +1472,14 @@ gs_app_set_version (GsApp *app, const gchar *version)
/**
* gs_app_get_summary:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_summary (GsApp *app)
{
@@ -1291,7 +1492,12 @@ gs_app_get_summary (GsApp *app)
* @app: A #GsApp instance
* @quality: A data quality, e.g. %GS_APP_QUALITY_LOWEST
* @summary: The medium length localized name, e.g. "A graphical calculator for GNOME"
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_summary (GsApp *app, GsAppQuality quality, const gchar *summary)
{
@@ -1308,7 +1514,14 @@ gs_app_set_summary (GsApp *app, GsAppQuality quality, const gchar *summary)
/**
* gs_app_get_description:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_description (GsApp *app)
{
@@ -1321,7 +1534,12 @@ gs_app_get_description (GsApp *app)
* @app: A #GsApp instance
* @quality: A data quality, e.g. %GS_APP_QUALITY_LOWEST
* @summary: The multiline localized description, e.g. "GNOME Calculator is a graphical calculator for
GNOME....."
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_description (GsApp *app, GsAppQuality quality, const gchar *description)
{
@@ -1338,7 +1556,14 @@ gs_app_set_description (GsApp *app, GsAppQuality quality, const gchar *descripti
/**
* gs_app_get_url:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_url (GsApp *app, AsUrlKind kind)
{
@@ -1348,7 +1573,12 @@ gs_app_get_url (GsApp *app, AsUrlKind kind)
/**
* gs_app_set_url:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_url (GsApp *app, AsUrlKind kind, const gchar *url)
{
@@ -1360,7 +1590,14 @@ gs_app_set_url (GsApp *app, AsUrlKind kind, const gchar *url)
/**
* gs_app_get_license:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_license (GsApp *app)
{
@@ -1370,7 +1607,14 @@ gs_app_get_license (GsApp *app)
/**
* gs_app_get_license_is_free:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
gboolean
gs_app_get_license_is_free (GsApp *app)
{
@@ -1400,7 +1644,12 @@ gs_app_get_license_token_is_nonfree (const gchar *token)
/**
* gs_app_set_license:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_license (GsApp *app, GsAppQuality quality, const gchar *license)
{
@@ -1519,7 +1768,14 @@ gs_app_set_license (GsApp *app, GsAppQuality quality, const gchar *license)
/**
* gs_app_get_summary_missing:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_summary_missing (GsApp *app)
{
@@ -1529,7 +1785,12 @@ gs_app_get_summary_missing (GsApp *app)
/**
* gs_app_set_summary_missing:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_summary_missing (GsApp *app, const gchar *summary_missing)
{
@@ -1546,7 +1807,14 @@ gs_app_set_summary_missing (GsApp *app, const gchar *summary_missing)
* modified or freed.
*
* Returns: a %NULL-terminated array of strings.
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
gchar **
gs_app_get_menu_path (GsApp *app)
{
@@ -1560,7 +1828,12 @@ gs_app_get_menu_path (GsApp *app)
*
* Sets the new menu path. The menu path is an array of path elements.
* This function creates a deep copy of the path.
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_menu_path (GsApp *app, gchar **menu_path)
{
@@ -1571,7 +1844,14 @@ gs_app_set_menu_path (GsApp *app, gchar **menu_path)
/**
* gs_app_get_origin:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_origin (GsApp *app)
{
@@ -1583,7 +1863,12 @@ gs_app_get_origin (GsApp *app)
* gs_app_set_origin:
*
* The origin is the original source of the application e.g. "fedora-updates"
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_origin (GsApp *app, const gchar *origin)
{
@@ -1594,7 +1879,14 @@ gs_app_set_origin (GsApp *app, const gchar *origin)
/**
* gs_app_get_origin_ui:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_origin_ui (GsApp *app)
{
@@ -1607,7 +1899,12 @@ gs_app_get_origin_ui (GsApp *app)
*
* The origin is the original source of the application to show in the UI,
* e.g. "Fedora"
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_origin_ui (GsApp *app, const gchar *origin_ui)
{
@@ -1618,7 +1915,12 @@ gs_app_set_origin_ui (GsApp *app, const gchar *origin_ui)
/**
* gs_app_add_screenshot:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_add_screenshot (GsApp *app, AsScreenshot *screenshot)
{
@@ -1628,7 +1930,14 @@ gs_app_add_screenshot (GsApp *app, AsScreenshot *screenshot)
/**
* gs_app_get_screenshots:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GPtrArray *
gs_app_get_screenshots (GsApp *app)
{
@@ -1638,7 +1947,14 @@ gs_app_get_screenshots (GsApp *app)
/**
* gs_app_get_update_version:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_update_version (GsApp *app)
{
@@ -1648,7 +1964,14 @@ gs_app_get_update_version (GsApp *app)
/**
* gs_app_get_update_version_ui:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_update_version_ui (GsApp *app)
{
@@ -1676,7 +1999,12 @@ gs_app_set_update_version_internal (GsApp *app, const gchar *update_version)
/**
* gs_app_set_update_version:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_update_version (GsApp *app, const gchar *update_version)
{
@@ -1687,7 +2015,14 @@ gs_app_set_update_version (GsApp *app, const gchar *update_version)
/**
* gs_app_get_update_details:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_update_details (GsApp *app)
{
@@ -1697,7 +2032,12 @@ gs_app_get_update_details (GsApp *app)
/**
* gs_app_set_update_details:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_update_details (GsApp *app, const gchar *update_details)
{
@@ -1708,7 +2048,14 @@ gs_app_set_update_details (GsApp *app, const gchar *update_details)
/**
* gs_app_get_update_urgency:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
AsUrgencyKind
gs_app_get_update_urgency (GsApp *app)
{
@@ -1718,7 +2065,12 @@ gs_app_get_update_urgency (GsApp *app)
/**
* gs_app_set_update_urgency:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_update_urgency (GsApp *app, AsUrgencyKind update_urgency)
{
@@ -1728,7 +2080,14 @@ gs_app_set_update_urgency (GsApp *app, AsUrgencyKind update_urgency)
/**
* gs_app_get_management_plugin:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_management_plugin (GsApp *app)
{
@@ -1741,7 +2100,12 @@ gs_app_get_management_plugin (GsApp *app)
*
* The management plugin is the plugin that can handle doing install and remove
* operations on the #GsApp. Typical values include "PackageKit" and "jhbuild"
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_management_plugin (GsApp *app, const gchar *management_plugin)
{
@@ -1752,7 +2116,14 @@ gs_app_set_management_plugin (GsApp *app, const gchar *management_plugin)
/**
* gs_app_get_rating:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
gint
gs_app_get_rating (GsApp *app)
{
@@ -1762,7 +2133,12 @@ gs_app_get_rating (GsApp *app)
/**
* gs_app_set_rating:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_rating (GsApp *app, gint rating)
{
@@ -1773,7 +2149,14 @@ gs_app_set_rating (GsApp *app, gint rating)
/**
* gs_app_get_review_ratings:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GArray *
gs_app_get_review_ratings (GsApp *app)
{
@@ -1783,7 +2166,12 @@ gs_app_get_review_ratings (GsApp *app)
/**
* gs_app_set_review_ratings:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_review_ratings (GsApp *app, GArray *review_ratings)
{
@@ -1795,7 +2183,14 @@ gs_app_set_review_ratings (GsApp *app, GArray *review_ratings)
/**
* gs_app_get_reviews:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GPtrArray *
gs_app_get_reviews (GsApp *app)
{
@@ -1805,7 +2200,12 @@ gs_app_get_reviews (GsApp *app)
/**
* gs_app_add_review:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_add_review (GsApp *app, GsReview *review)
{
@@ -1815,7 +2215,12 @@ gs_app_add_review (GsApp *app, GsReview *review)
/**
* gs_app_remove_review:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_remove_review (GsApp *app, GsReview *review)
{
@@ -1833,7 +2238,14 @@ gs_app_remove_review (GsApp *app, GsReview *review)
* If there is a runtime not yet installed then this is also added.
*
* Returns: number of bytes, 0 for unknown, or %GS_APP_SIZE_UNKNOWABLE for invalid.
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
guint64
gs_app_get_size_download (GsApp *app)
{
@@ -1855,7 +2267,12 @@ gs_app_get_size_download (GsApp *app)
/**
* gs_app_set_size_download:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_size_download (GsApp *app, guint64 size_download)
{
@@ -1872,7 +2289,14 @@ gs_app_set_size_download (GsApp *app, guint64 size_download)
* If there is a runtime not yet installed then this is also added.
*
* Returns: size in bytes, 0 for unknown, or %GS_APP_SIZE_UNKNOWABLE for invalid.
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
guint64
gs_app_get_size_installed (GsApp *app)
{
@@ -1894,7 +2318,12 @@ gs_app_get_size_installed (GsApp *app)
/**
* gs_app_set_size_installed:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_size_installed (GsApp *app, guint64 size_installed)
{
@@ -1904,7 +2333,14 @@ gs_app_set_size_installed (GsApp *app, guint64 size_installed)
/**
* gs_app_get_metadata_item:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
const gchar *
gs_app_get_metadata_item (GsApp *app, const gchar *key)
{
@@ -1914,7 +2350,12 @@ gs_app_get_metadata_item (GsApp *app, const gchar *key)
/**
* gs_app_set_metadata:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_metadata (GsApp *app, const gchar *key, const gchar *value)
{
@@ -1947,7 +2388,14 @@ gs_app_set_metadata (GsApp *app, const gchar *key, const gchar *value)
/**
* gs_app_get_addons:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GPtrArray *
gs_app_get_addons (GsApp *app)
{
@@ -1957,7 +2405,12 @@ gs_app_get_addons (GsApp *app)
/**
* gs_app_add_addon:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_add_addon (GsApp *app, GsApp *addon)
{
@@ -1978,7 +2431,14 @@ gs_app_add_addon (GsApp *app, GsApp *addon)
/**
* gs_app_get_related:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GPtrArray *
gs_app_get_related (GsApp *app)
{
@@ -1988,7 +2448,12 @@ gs_app_get_related (GsApp *app)
/**
* gs_app_add_related:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_add_related (GsApp *app, GsApp *app2)
{
@@ -2019,7 +2484,14 @@ gs_app_add_related (GsApp *app, GsApp *app2)
/**
* gs_app_get_history:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GPtrArray *
gs_app_get_history (GsApp *app)
{
@@ -2029,7 +2501,12 @@ gs_app_get_history (GsApp *app)
/**
* gs_app_add_history:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_add_history (GsApp *app, GsApp *app2)
{
@@ -2053,7 +2530,14 @@ gs_app_set_install_date (GsApp *app, guint64 install_date)
/**
* gs_app_get_categories:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GPtrArray *
gs_app_get_categories (GsApp *app)
{
@@ -2063,7 +2547,14 @@ gs_app_get_categories (GsApp *app)
/**
* gs_app_has_category:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
gboolean
gs_app_has_category (GsApp *app, const gchar *category)
{
@@ -2083,7 +2574,12 @@ gs_app_has_category (GsApp *app, const gchar *category)
/**
* gs_app_set_categories:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_categories (GsApp *app, GPtrArray *categories)
{
@@ -2096,7 +2592,12 @@ gs_app_set_categories (GsApp *app, GPtrArray *categories)
/**
* gs_app_add_category:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_add_category (GsApp *app, const gchar *category)
{
@@ -2107,7 +2608,14 @@ gs_app_add_category (GsApp *app, const gchar *category)
/**
* gs_app_get_key_colors:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GPtrArray *
gs_app_get_key_colors (GsApp *app)
{
@@ -2117,7 +2625,12 @@ gs_app_get_key_colors (GsApp *app)
/**
* gs_app_set_key_colors:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_key_colors (GsApp *app, GPtrArray *key_colors)
{
@@ -2130,7 +2643,12 @@ gs_app_set_key_colors (GsApp *app, GPtrArray *key_colors)
/**
* gs_app_add_key_color:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_add_key_color (GsApp *app, GdkRGBA *key_color)
{
@@ -2141,7 +2659,14 @@ gs_app_add_key_color (GsApp *app, GdkRGBA *key_color)
/**
* gs_app_get_keywords:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
GPtrArray *
gs_app_get_keywords (GsApp *app)
{
@@ -2151,7 +2676,12 @@ gs_app_get_keywords (GsApp *app)
/**
* gs_app_set_keywords:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_keywords (GsApp *app, GPtrArray *keywords)
{
@@ -2164,7 +2694,12 @@ gs_app_set_keywords (GsApp *app, GPtrArray *keywords)
/**
* gs_app_add_kudo:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_add_kudo (GsApp *app, GsAppKudo kudo)
{
@@ -2174,7 +2709,14 @@ gs_app_add_kudo (GsApp *app, GsAppKudo kudo)
/**
* gs_app_get_kudos:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
guint64
gs_app_get_kudos (GsApp *app)
{
@@ -2184,7 +2726,14 @@ gs_app_get_kudos (GsApp *app)
/**
* gs_app_get_kudos_percentage:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
guint
gs_app_get_kudos_percentage (GsApp *app)
{
@@ -2230,7 +2779,14 @@ gs_app_get_kudos_percentage (GsApp *app)
/**
* gs_app_get_to_be_installed:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
gboolean
gs_app_get_to_be_installed (GsApp *app)
{
@@ -2241,7 +2797,12 @@ gs_app_get_to_be_installed (GsApp *app)
/**
* gs_app_set_to_be_installed:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_to_be_installed (GsApp *app, gboolean to_be_installed)
{
@@ -2252,6 +2813,13 @@ gs_app_set_to_be_installed (GsApp *app, gboolean to_be_installed)
/**
* gs_app_has_quirk:
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
**/
gboolean
gs_app_has_quirk (GsApp *app, AsAppQuirk quirk)
@@ -2263,6 +2831,11 @@ gs_app_has_quirk (GsApp *app, AsAppQuirk quirk)
/**
* gs_app_add_quirk:
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
**/
void
gs_app_add_quirk (GsApp *app, AsAppQuirk quirk)
@@ -2275,6 +2848,11 @@ gs_app_add_quirk (GsApp *app, AsAppQuirk quirk)
/**
* gs_app_remove_quirk:
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
**/
void
gs_app_remove_quirk (GsApp *app, AsAppQuirk quirk)
@@ -2287,7 +2865,12 @@ gs_app_remove_quirk (GsApp *app, AsAppQuirk quirk)
/**
* gs_app_set_match_value:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_match_value (GsApp *app, guint match_value)
{
@@ -2297,7 +2880,14 @@ gs_app_set_match_value (GsApp *app, guint match_value)
/**
* gs_app_get_match_value:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: the xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ **/
guint
gs_app_get_match_value (GsApp *app)
{
@@ -2307,7 +2897,14 @@ gs_app_get_match_value (GsApp *app)
/**
* gs_app_get_last_error:
- */
+ * @app: a #GsApp
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ * @xxxxxxxxxxxxxxxxxxxxxx: a xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ *
+ * Returns: a #GError, or %NULL
+ **/
GError *
gs_app_get_last_error (GsApp *app)
{
@@ -2316,7 +2913,11 @@ gs_app_get_last_error (GsApp *app)
/**
* gs_app_set_last_error:
- */
+ * @app: a #GsApp
+ * @error: a #GError
+ *
+ * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx.
+ **/
void
gs_app_set_last_error (GsApp *app, GError *error)
{
@@ -2632,6 +3233,12 @@ gs_app_init (GsApp *app)
* gs_app_new:
*
* Return value: a new GsApp object.
+ * @app: a #GsApp
+ * @id: an ID, or %NULL
+ *
+ * Creates a new application object.
+ *
+ * Returns: a new #GsApp
**/
GsApp *
gs_app_new (const gchar *id)
diff --git a/src/gs-app.h b/libgnomesoftware/gs-app.h
similarity index 95%
rename from src/gs-app.h
rename to libgnomesoftware/gs-app.h
index 5584eba..328e319 100644
--- a/src/gs-app.h
+++ b/libgnomesoftware/gs-app.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2013-2014 Richard Hughes <richard hughsie com>
+ * Copyright (C) 2013-2016 Richard Hughes <richard hughsie com>
*
* Licensed under the GNU General Public License Version 2
*
@@ -35,11 +35,12 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GsApp, gs_app, GS, APP, GObject)
-typedef enum {
- GS_APP_ERROR_FAILED,
- GS_APP_ERROR_LAST
-} GsAppError;
-
+/**
+ * GsAppKudo:
+ * @GS_APP_KUDO_MY_LANGUAGE: The app is localised in my language
+ *
+ * Any awards given to the application.
+ **/
typedef enum {
GS_APP_KUDO_MY_LANGUAGE = 1 << 0,
GS_APP_KUDO_RECENT_RELEASE = 1 << 1,
@@ -56,6 +57,7 @@ typedef enum {
GS_APP_KUDO_PERFECT_SCREENSHOTS = 1 << 12,
GS_APP_KUDO_HIGH_CONTRAST = 1 << 13,
GS_APP_KUDO_HI_DPI_ICON = 1 << 14,
+ /*< private >*/
GS_APP_KUDO_LAST
} GsAppKudo;
@@ -63,11 +65,21 @@ typedef enum {
#define GS_APP_INSTALL_DATE_UNKNOWN 1 /* 1s past the epoch */
#define GS_APP_SIZE_UNKNOWABLE G_MAXUINT64
+/**
+ * GsAppQuality:
+ * @GS_APP_QUALITY_UNKNOWN: The quality value is unknown
+ * @GS_APP_QUALITY_LOWEST: Lowest quality
+ * @GS_APP_QUALITY_NORMAL: Normal quality
+ * @GS_APP_QUALITY_HIGHEST: Highest quality
+ *
+ * Any awards given to the application.
+ **/
typedef enum {
GS_APP_QUALITY_UNKNOWN,
GS_APP_QUALITY_LOWEST,
GS_APP_QUALITY_NORMAL,
GS_APP_QUALITY_HIGHEST,
+ /*< private >*/
GS_APP_QUALITY_LAST
} GsAppQuality;
diff --git a/src/gs-category.c b/libgnomesoftware/gs-category.c
similarity index 79%
rename from src/gs-category.c
rename to libgnomesoftware/gs-category.c
index 5d10c19..68c8d94 100644
--- a/src/gs-category.c
+++ b/libgnomesoftware/gs-category.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2013 Richard Hughes <richard hughsie com>
+ * Copyright (C) 2013-2016 Richard Hughes <richard hughsie com>
* Copyright (C) 2013 Matthias Clasen <mclasen redhat com>
*
* Licensed under the GNU General Public License Version 2
@@ -20,6 +20,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+/**
+ * SECTION:gs-category
+ * @short_description: An category that contains applications
+ *
+ * This object provides functionality that allows a plugin to create
+ * a tree structure of categories that each contain #GsApp's.
+ */
+
#include "config.h"
#include <glib/gi18n.h>
@@ -41,11 +49,14 @@ G_DEFINE_TYPE (GsCategory, gs_category, G_TYPE_OBJECT)
/**
* gs_category_get_size:
+ * @category: a #GsCategory
*
* Returns how many applications the category could contain.
*
* NOTE: This may over-estimate the number if duplicate applications are
* filtered or core applications are not shown.
+ *
+ * Returns: the number of apps in the category
**/
guint
gs_category_get_size (GsCategory *category)
@@ -56,6 +67,11 @@ gs_category_get_size (GsCategory *category)
/**
* gs_category_set_size:
+ * @category: a #GsCategory
+ * @size: the number of applications
+ *
+ * Sets the number of applications in the category.
+ * Most plugins do not need to call this function.
**/
void
gs_category_set_size (GsCategory *category, guint size)
@@ -66,6 +82,7 @@ gs_category_set_size (GsCategory *category, guint size)
/**
* gs_category_increment_size:
+ * @category: a #GsCategory
*
* Adds one to the size count if an application is available
**/
@@ -76,6 +93,14 @@ gs_category_increment_size (GsCategory *category)
category->size++;
}
+/**
+ * gs_category_get_id:
+ * @category: a #GsCategory
+ *
+ * Gets the category ID.
+ *
+ * Returns: the string, e.g. "other"
+ **/
const gchar *
gs_category_get_id (GsCategory *category)
{
@@ -83,6 +108,14 @@ gs_category_get_id (GsCategory *category)
return category->id;
}
+/**
+ * gs_category_get_name:
+ * @category: a #GsCategory
+ *
+ * Gets the category name.
+ *
+ * Returns: the string, or %NULL
+ **/
const gchar *
gs_category_get_name (GsCategory *category)
{
@@ -90,6 +123,15 @@ gs_category_get_name (GsCategory *category)
return category->name;
}
+/**
+ * gs_category_find_child:
+ * @category: a #GsCategory
+ * @id: a category ID, e.g. "other"
+ *
+ * Find a child category with a specific ID.
+ *
+ * Returns: the #GsCategory, or %NULL
+ **/
GsCategory *
gs_category_find_child (GsCategory *category, const gchar *id)
{
@@ -107,6 +149,14 @@ gs_category_find_child (GsCategory *category, const gchar *id)
return NULL;
}
+/**
+ * gs_category_get_parent:
+ * @category: a #GsCategory
+ *
+ * Gets the parent category.
+ *
+ * Returns: the #GsCategory or %NULL
+ **/
GsCategory *
gs_category_get_parent (GsCategory *category)
{
@@ -116,6 +166,9 @@ gs_category_get_parent (GsCategory *category)
/**
* gs_category_get_subcategories:
+ * @category: a #GsCategory
+ *
+ * Gets the list if subcategories for a category.
*
* Return value: (element-type GsApp) (transfer container): A list of subcategories
**/
@@ -128,13 +181,17 @@ gs_category_get_subcategories (GsCategory *category)
/**
* gs_category_add_subcategory:
+ * @category: a #GsCategory
+ * @subcategory: a #GsCategory
+ *
+ * Adds a child category to a parent category.
**/
void
gs_category_add_subcategory (GsCategory *category, GsCategory *subcategory)
{
g_return_if_fail (GS_IS_CATEGORY (category));
category->subcategories = g_list_prepend (category->subcategories,
- g_object_ref (subcategory));
+ g_object_ref (subcategory));
}
/**
@@ -170,6 +227,9 @@ gs_category_sort_subcategories_cb (gconstpointer a, gconstpointer b)
/**
* gs_category_sort_subcategories:
+ * @category: a #GsCategory
+ *
+ * Sorts the list of subcategories.
**/
void
gs_category_sort_subcategories (GsCategory *category)
@@ -223,6 +283,16 @@ gs_category_init (GsCategory *category)
{
}
+/**
+ * gs_category_new:
+ * @parent: a #GsCategory
+ * @id: an ID, e.g. "all"
+ * @name: a localised name
+ *
+ * Creates a new category object.
+ *
+ * Returns: the new #GsCategory
+ **/
GsCategory *
gs_category_new (GsCategory *parent, const gchar *id, const gchar *name)
{
diff --git a/src/gs-category.h b/libgnomesoftware/gs-category.h
similarity index 96%
rename from src/gs-category.h
rename to libgnomesoftware/gs-category.h
index 126ff7b..9ac2ff3 100644
--- a/src/gs-category.h
+++ b/libgnomesoftware/gs-category.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2013 Richard Hughes <richard hughsie com>
+ * Copyright (C) 2013-2016 Richard Hughes <richard hughsie com>
* Copyright (C) 2013 Matthias Clasen <mclasen redhat com>
*
* Licensed under the GNU General Public License Version 2
diff --git a/src/gs-os-release.c b/libgnomesoftware/gs-os-release.c
similarity index 100%
rename from src/gs-os-release.c
rename to libgnomesoftware/gs-os-release.c
diff --git a/src/gs-os-release.h b/libgnomesoftware/gs-os-release.h
similarity index 100%
rename from src/gs-os-release.h
rename to libgnomesoftware/gs-os-release.h
diff --git a/src/gs-plugin-private.h b/libgnomesoftware/gs-plugin-private.h
similarity index 100%
rename from src/gs-plugin-private.h
rename to libgnomesoftware/gs-plugin-private.h
diff --git a/src/gs-plugin.c b/libgnomesoftware/gs-plugin.c
similarity index 80%
rename from src/gs-plugin.c
rename to libgnomesoftware/gs-plugin.c
index 75e9da0..b73720e 100644
--- a/src/gs-plugin.c
+++ b/libgnomesoftware/gs-plugin.c
@@ -87,7 +87,12 @@ typedef const gchar **(*GsPluginGetDepsFunc) (GsPlugin *plugin);
/**
* gs_plugin_status_to_string:
- */
+ * @status: a #GsPluginStatus, e.g. %GS_PLUGIN_STATUS_DOWNLOADING
+ *
+ * Converts the #GsPluginStatus enum to a string.
+ *
+ * Returns: the string representation, or "unknown"
+ **/
const gchar *
gs_plugin_status_to_string (GsPluginStatus status)
{
@@ -109,6 +114,12 @@ gs_plugin_status_to_string (GsPluginStatus status)
}
/**
* gs_plugin_create:
+ * @filename: an absolute filename
+ * @error: a #GError, or %NULL
+ *
+ * Creates a new plugin from an external module.
+ *
+ * Returns: the #GsPlugin or %NULL
**/
GsPlugin *
gs_plugin_create (const gchar *filename, GError **error)
@@ -188,6 +199,12 @@ gs_plugin_finalize (GObject *object)
/**
* gs_plugin_get_data:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the private data for the plugin if gs_plugin_alloc_data() has
+ * been called.
+ *
+ * Returns: the #GsPluginData, or %NULL
**/
GsPluginData *
gs_plugin_get_data (GsPlugin *plugin)
@@ -199,6 +216,15 @@ gs_plugin_get_data (GsPlugin *plugin)
/**
* gs_plugin_alloc_data:
+ * @plugin: a #GsPlugin
+ * @sz: the size of data to allocate, e.g. `sizeof(FooPluginPrivate)`
+ *
+ * Allocates a private data area for the plugin which can be retrieved
+ * using gs_plugin_get_data().
+ * This is normally called in gs_plugin_initialize() and the data should
+ * not be manually freed.
+ *
+ * Returns: the #GsPluginData, cleared to NUL butes
**/
GsPluginData *
gs_plugin_alloc_data (GsPlugin *plugin, gsize sz)
@@ -211,8 +237,10 @@ gs_plugin_alloc_data (GsPlugin *plugin, gsize sz)
/**
* gs_plugin_action_start:
+ * @plugin: a #GsPlugin
+ * @exclusive: if the plugin action should be performed exclusively
*
- * FIXME: unexport soon
+ * Starts a plugin action.
**/
void
gs_plugin_action_start (GsPlugin *plugin, gboolean exclusive)
@@ -248,8 +276,9 @@ gs_plugin_action_delay_cb (gpointer user_data)
/**
* gs_plugin_action_stop:
+ * @plugin: a #GsPlugin
*
- * FIXME: unexport soon
+ * Stops an plugin action.
**/
void
gs_plugin_action_stop (GsPlugin *plugin)
@@ -278,8 +307,11 @@ gs_plugin_action_stop (GsPlugin *plugin)
/**
* gs_plugin_get_module:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the external module that backs the plugin.
*
- * FIXME: unexport soon
+ * Returns: the #GModule, or %NULL
**/
GModule *
gs_plugin_get_module (GsPlugin *plugin)
@@ -290,6 +322,11 @@ gs_plugin_get_module (GsPlugin *plugin)
/**
* gs_plugin_get_enabled:
+ * @plugin: a #GsPlugin
+ *
+ * Gets if the plugin is enabled.
+ *
+ * Returns: %TRUE if enabled
**/
gboolean
gs_plugin_get_enabled (GsPlugin *plugin)
@@ -300,6 +337,11 @@ gs_plugin_get_enabled (GsPlugin *plugin)
/**
* gs_plugin_set_enabled:
+ * @plugin: a #GsPlugin
+ * @enabled: the enabled state
+ *
+ * Enables or disables a plugin.
+ * This is normally only called from gs_plugin_initialize().
**/
void
gs_plugin_set_enabled (GsPlugin *plugin, gboolean enabled)
@@ -309,7 +351,12 @@ gs_plugin_set_enabled (GsPlugin *plugin, gboolean enabled)
}
/**
- * gs_plugin_set_enabled:
+ * gs_plugin_get_name:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the plugin name.
+ *
+ * Returns: a string, e.g. "fwupd"
**/
const gchar *
gs_plugin_get_name (GsPlugin *plugin)
@@ -320,6 +367,11 @@ gs_plugin_get_name (GsPlugin *plugin)
/**
* gs_plugin_get_scale:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the window scale factor.
+ *
+ * Returns: the factor, usually 1 for standard screens or 2 for HiDPI
**/
guint
gs_plugin_get_scale (GsPlugin *plugin)
@@ -330,6 +382,10 @@ gs_plugin_get_scale (GsPlugin *plugin)
/**
* gs_plugin_set_scale:
+ * @plugin: a #GsPlugin
+ * @scale: the window scale factor, usually 1 for standard screens or 2 for HiDPI
+ *
+ * Sets the window scale factor.
**/
void
gs_plugin_set_scale (GsPlugin *plugin, guint scale)
@@ -340,6 +396,12 @@ gs_plugin_set_scale (GsPlugin *plugin, guint scale)
/**
* gs_plugin_get_priority:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the plugin priority, where higher numbers are run after lower
+ * numbers.
+ *
+ * Returns: the integer value
**/
guint
gs_plugin_get_priority (GsPlugin *plugin)
@@ -350,6 +412,11 @@ gs_plugin_get_priority (GsPlugin *plugin)
/**
* gs_plugin_set_priority:
+ * @plugin: a #GsPlugin
+ * @priority: a integer value
+ *
+ * Sets the plugin priority, where higher numbers are run after lower
+ * numbers.
**/
void
gs_plugin_set_priority (GsPlugin *plugin, guint priority)
@@ -360,6 +427,11 @@ gs_plugin_set_priority (GsPlugin *plugin, guint priority)
/**
* gs_plugin_get_locale:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the user locale.
+ *
+ * Returns: the locale string, e.g. "en_GB"
**/
const gchar *
gs_plugin_get_locale (GsPlugin *plugin)
@@ -370,6 +442,10 @@ gs_plugin_get_locale (GsPlugin *plugin)
/**
* gs_plugin_set_locale:
+ * @plugin: a #GsPlugin
+ * @locale: a locale string, e.g. "en_GB"
+ *
+ * Sets the plugin locale.
**/
void
gs_plugin_set_locale (GsPlugin *plugin, const gchar *locale)
@@ -381,6 +457,13 @@ gs_plugin_set_locale (GsPlugin *plugin, const gchar *locale)
/**
* gs_plugin_get_profile:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the profile object to be used for the plugin.
+ * This can be used to make plugin actions appear in the global profile
+ * output.
+ *
+ * Returns: the #AsProfile
**/
AsProfile *
gs_plugin_get_profile (GsPlugin *plugin)
@@ -391,6 +474,10 @@ gs_plugin_get_profile (GsPlugin *plugin)
/**
* gs_plugin_set_profile:
+ * @plugin: a #GsPlugin
+ * @profile: a #AsProfile
+ *
+ * Sets the profile object to be used for the plugin.
**/
void
gs_plugin_set_profile (GsPlugin *plugin, AsProfile *profile)
@@ -401,6 +488,11 @@ gs_plugin_set_profile (GsPlugin *plugin, AsProfile *profile)
/**
* gs_plugin_get_soup_session:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the soup session that plugins can use when downloading.
+ *
+ * Returns: the #SoupSession
**/
SoupSession *
gs_plugin_get_soup_session (GsPlugin *plugin)
@@ -411,6 +503,10 @@ gs_plugin_get_soup_session (GsPlugin *plugin)
/**
* gs_plugin_set_soup_session:
+ * @plugin: a #GsPlugin
+ * @soup_session: a #SoupSession
+ *
+ * Sets the soup session that plugins will use when downloading.
**/
void
gs_plugin_set_soup_session (GsPlugin *plugin, SoupSession *soup_session)
@@ -421,6 +517,12 @@ gs_plugin_set_soup_session (GsPlugin *plugin, SoupSession *soup_session)
/**
* gs_plugin_has_flags:
+ * @plugin: a #GsPlugin
+ * @flags: a #GsPluginFlags, e.g. %GS_PLUGIN_FLAGS_RUNNING_SELF
+ *
+ * Finds out if a plugin has a specific flag set.
+ *
+ * Returns: TRUE if the flag is set
**/
gboolean
gs_plugin_has_flags (GsPlugin *plugin, GsPluginFlags flags)
@@ -431,6 +533,10 @@ gs_plugin_has_flags (GsPlugin *plugin, GsPluginFlags flags)
/**
* gs_plugin_set_running_other:
+ * @plugin: a #GsPlugin
+ * @running_other: %TRUE if another plugin is running
+ *
+ * Inform the plugin that another plugin is running in the loader.
**/
void
gs_plugin_set_running_other (GsPlugin *plugin, gboolean running_other)
@@ -444,6 +550,11 @@ gs_plugin_set_running_other (GsPlugin *plugin, gboolean running_other)
/**
* gs_plugin_get_order_after:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the plugin IDs that should be run after this plugin.
+ *
+ * Returns: the NULL terminated list of IDs, e.g. ['appstream']
**/
const gchar **
gs_plugin_get_order_after (GsPlugin *plugin)
@@ -454,6 +565,11 @@ gs_plugin_get_order_after (GsPlugin *plugin)
/**
* gs_plugin_get_order_before:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the plugin IDs that should be run before this plugin.
+ *
+ * Returns: the NULL terminated list of IDs, e.g. ['appstream']
**/
const gchar **
gs_plugin_get_order_before (GsPlugin *plugin)
@@ -464,6 +580,11 @@ gs_plugin_get_order_before (GsPlugin *plugin)
/**
* gs_plugin_get_conflicts:
+ * @plugin: a #GsPlugin
+ *
+ * Gets the plugin IDs that should be disabled if this plugin is enabled.
+ *
+ * Returns: the NULL terminated list of IDs, e.g. ['appstream']
**/
const gchar **
gs_plugin_get_conflicts (GsPlugin *plugin)
@@ -474,6 +595,12 @@ gs_plugin_get_conflicts (GsPlugin *plugin)
/**
* gs_plugin_check_distro_id:
+ * @plugin: a #GsPlugin
+ * @distro_id: a distro ID, e.g. "fedora"
+ *
+ * Checks if the distro is compatible.
+ *
+ * Returns: %TRUE if compatible
**/
gboolean
gs_plugin_check_distro_id (GsPlugin *plugin, const gchar *distro_id)
@@ -517,6 +644,11 @@ gs_plugin_status_update_cb (gpointer user_data)
/**
* gs_plugin_status_update:
+ * @plugin: a #GsPlugin
+ * @app: a #GsApp, or %NULL
+ * @status: a #GsPluginStatus, e.g. %GS_PLUGIN_STATUS_DOWNLOADING
+ *
+ * Update the state of the plugin so any UI can be updated.
**/
void
gs_plugin_status_update (GsPlugin *plugin, GsApp *app, GsPluginStatus status)
@@ -553,6 +685,13 @@ gs_plugin_app_launch_cb (gpointer user_data)
/**
* gs_plugin_app_launch:
+ * @plugin: a #GsPlugin
+ * @app: a #GsApp
+ * @error: a #GError, or %NULL
+ *
+ * Launches the application using GAppInfo.
+ *
+ * Returns: %TRUE for success
**/
gboolean
gs_plugin_app_launch (GsPlugin *plugin, GsApp *app, GError **error)
@@ -598,6 +737,10 @@ gs_plugin_updates_changed_cb (gpointer user_data)
/**
* gs_plugin_updates_changed:
+ * @plugin: a #GsPlugin
+ *
+ * Emit a signal that tells the plugin loader that the list of updates
+ * may have changed.
**/
void
gs_plugin_updates_changed (GsPlugin *plugin)
@@ -659,7 +802,16 @@ gs_plugin_download_chunk_cb (SoupMessage *msg, SoupBuffer *chunk,
/**
* gs_plugin_download_data:
- */
+ * @plugin: a #GsPlugin
+ * @app: a #GsApp, or %NULL
+ * @uri: a remote URI
+ * @cancellable: a #GCancellable, or %NULL
+ * @error: a #GError, or %NULL
+ *
+ * Downloads data.
+ *
+ * Returns: the downloaded data, or %NULL
+ **/
GBytes *
gs_plugin_download_data (GsPlugin *plugin,
GsApp *app,
@@ -697,7 +849,17 @@ gs_plugin_download_data (GsPlugin *plugin,
/**
* gs_plugin_download_file:
- */
+ * @plugin: a #GsPlugin
+ * @app: a #GsApp, or %NULL
+ * @uri: a remote URI
+ * @filename: a local filename
+ * @cancellable: a #GCancellable, or %NULL
+ * @error: a #GError, or %NULL
+ *
+ * Downloads data and saves it to a file.
+ *
+ * Returns: %TRUE for success
+ **/
gboolean
gs_plugin_download_file (GsPlugin *plugin,
GsApp *app,
@@ -747,7 +909,13 @@ gs_plugin_download_file (GsPlugin *plugin,
/**
* gs_plugin_cache_lookup:
- */
+ * @plugin: a #GsPlugin
+ * @key: a string
+ *
+ * Looks up an application object from the per-plugin cache
+ *
+ * Returns: the #GsApp, or %NULL
+ **/
GsApp *
gs_plugin_cache_lookup (GsPlugin *plugin, const gchar *key)
{
@@ -760,7 +928,13 @@ gs_plugin_cache_lookup (GsPlugin *plugin, const gchar *key)
/**
* gs_plugin_cache_add:
- */
+ * @plugin: a #GsPlugin
+ * @key: a string
+ * @app: a #GsApp
+ *
+ * Adds an application to the per-plugin cache. This is optional,
+ * and the plugin can use the cache however it likes.
+ **/
void
gs_plugin_cache_add (GsPlugin *plugin, const gchar *key, GsApp *app)
{
@@ -858,7 +1032,11 @@ gs_plugin_init (GsPlugin *plugin)
/**
* gs_plugin_new:
- */
+ *
+ * Creates a new plugin.
+ *
+ * Returns: a #GsPlugin
+ **/
GsPlugin *
gs_plugin_new (void)
{
diff --git a/src/gs-plugin.h b/libgnomesoftware/gs-plugin.h
similarity index 80%
rename from src/gs-plugin.h
rename to libgnomesoftware/gs-plugin.h
index e48a9af..5a71f65 100644
--- a/src/gs-plugin.h
+++ b/libgnomesoftware/gs-plugin.h
@@ -50,6 +50,19 @@ struct _GsPluginClass
typedef struct GsPluginData GsPluginData;
+/**
+ * GsPluginStatus:
+ * @GS_PLUGIN_STATUS_UNKNOWN: Unknown status
+ * @GS_PLUGIN_STATUS_WAITING: Waiting
+ * @GS_PLUGIN_STATUS_FINISHED: Finished
+ * @GS_PLUGIN_STATUS_SETUP: Setup in progress
+ * @GS_PLUGIN_STATUS_DOWNLOADING: Downloading in progress
+ * @GS_PLUGIN_STATUS_QUERYING: Querying in progress
+ * @GS_PLUGIN_STATUS_INSTALLING: Installing in progress
+ * @GS_PLUGIN_STATUS_REMOVING: Removing in progress
+ *
+ * The ststus of the plugin.
+ **/
typedef enum {
GS_PLUGIN_STATUS_UNKNOWN,
GS_PLUGIN_STATUS_WAITING,
@@ -59,18 +72,41 @@ typedef enum {
GS_PLUGIN_STATUS_QUERYING,
GS_PLUGIN_STATUS_INSTALLING,
GS_PLUGIN_STATUS_REMOVING,
+ /*< private >*/
GS_PLUGIN_STATUS_LAST
} GsPluginStatus;
+/**
+ * GsPluginFlags:
+ * @GS_PLUGIN_FLAGS_NONE: No flags set
+ * @GS_PLUGIN_FLAGS_RUNNING_SELF: The plugin is running
+ * @GS_PLUGIN_FLAGS_RUNNING_OTHER: Another plugin is running
+ * @GS_PLUGIN_FLAGS_EXCLUSIVE: An exclusive action is running
+ * @GS_PLUGIN_FLAGS_RECENT: This plugin recently ran
+ *
+ * The flags for the plugin at this point in time.
+ **/
typedef enum {
GS_PLUGIN_FLAGS_NONE = 0,
GS_PLUGIN_FLAGS_RUNNING_SELF = 1 << 0,
GS_PLUGIN_FLAGS_RUNNING_OTHER = 1 << 1,
GS_PLUGIN_FLAGS_EXCLUSIVE = 1 << 2,
GS_PLUGIN_FLAGS_RECENT = 1 << 3,
+ /*< private >*/
GS_PLUGIN_FLAGS_LAST
} GsPluginFlags;
+/**
+ * GsPluginError:
+ * @GS_PLUGIN_ERROR_FAILED: Generic failure
+ * @GS_PLUGIN_ERROR_NOT_SUPPORTED: Action not supported
+ * @GS_PLUGIN_ERROR_CANCELLED: Action was cancelled
+ * @GS_PLUGIN_ERROR_NO_NETWORK: No network connection available
+ * @GS_PLUGIN_ERROR_NO_SECURITY: Security policy forbid action
+ * @GS_PLUGIN_ERROR_NO_SPACE: No disk space to allow action
+ *
+ * The failure error types.
+ **/
typedef enum {
GS_PLUGIN_ERROR_FAILED,
GS_PLUGIN_ERROR_NOT_SUPPORTED,
@@ -78,9 +114,37 @@ typedef enum {
GS_PLUGIN_ERROR_NO_NETWORK,
GS_PLUGIN_ERROR_NO_SECURITY,
GS_PLUGIN_ERROR_NO_SPACE,
+ /*< private >*/
GS_PLUGIN_ERROR_LAST
} GsPluginError;
+/**
+ * GsPluginRefineFlags:
+ * @GS_PLUGIN_REFINE_FLAGS_DEFAULT: No explicit flags set
+ * @GS_PLUGIN_REFINE_FLAGS_USE_HISTORY: Get the historical view
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE: Require the license
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL: Require the URL
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION: Require the long description
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_SIZE: Require the installed and download sizes
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING: Require the rating
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION: Require the version
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY: Require the history
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION: Require enough to install or remove the package
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_DETAILS: Require update details
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN: Require the origin
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED: Require related packages
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_MENU_PATH: Require the menu path
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS: Require available addons
+ * @GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES: Allow packages to be returned
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_SEVERITY: Require update severity
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPGRADE_REMOVED: Require distro upgrades
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE: Require the provenance
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS: Require user-reviews
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS: Require user-ratings
+ * @GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS: Require the key colors
+ *
+ * The refine flags.
+ **/
typedef enum {
GS_PLUGIN_REFINE_FLAGS_DEFAULT = 0,
GS_PLUGIN_REFINE_FLAGS_USE_HISTORY = 1 << 0,
diff --git a/src/gs-review.c b/libgnomesoftware/gs-review.c
similarity index 72%
rename from src/gs-review.c
rename to libgnomesoftware/gs-review.c
index f4d4323..50a1551 100644
--- a/src/gs-review.c
+++ b/libgnomesoftware/gs-review.c
@@ -19,6 +19,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+/**
+ * SECTION:gs-review
+ * @short_description: An application user review
+ *
+ * This object represents a user-submitted application review.
+ */
+
#include "config.h"
#include "gs-review.h"
@@ -56,6 +63,12 @@ G_DEFINE_TYPE (GsReview, gs_review, G_TYPE_OBJECT)
/**
* gs_review_get_karma:
+ * @review: a #GsReview
+ *
+ * Gets the karma for the review, where positive numbers indicate
+ * more positive feedback for the review.
+ *
+ * Returns: the karma value, or 0 for unset.
*/
gint
gs_review_get_karma (GsReview *review)
@@ -66,6 +79,13 @@ gs_review_get_karma (GsReview *review)
/**
* gs_review_set_karma:
+ * @review: a #GsReview
+ * @karma: a karma value
+ *
+ * Sets the karma for the review, where positive numbers indicate
+ * more positive feedback for the review.
+ *
+ * Karma can be positive or negative, or 0 for unset.
*/
void
gs_review_set_karma (GsReview *review, gint karma)
@@ -76,9 +96,12 @@ gs_review_set_karma (GsReview *review, gint karma)
/**
* gs_review_get_score:
+ * @review: a #GsReview
*
* This allows the UI to sort reviews into the correct order.
* Higher numbers indicate a more important or relevant review.
+ *
+ * Returns: the review score, or 0 for unset.
*/
gint
gs_review_get_score (GsReview *review)
@@ -89,6 +112,11 @@ gs_review_get_score (GsReview *review)
/**
* gs_review_set_score:
+ * @review: a #GsReview
+ * @score: a score value
+ *
+ * Sets the score for the review, where positive numbers indicate
+ * a better review for the specific user.
*/
void
gs_review_set_score (GsReview *review, gint score)
@@ -99,6 +127,11 @@ gs_review_set_score (GsReview *review, gint score)
/**
* gs_review_get_summary:
+ * @review: a #GsReview
+ *
+ * Gets the review summary.
+ *
+ * Returns: the one-line summary, e.g. "Awesome application"
*/
const gchar *
gs_review_get_summary (GsReview *review)
@@ -109,6 +142,10 @@ gs_review_get_summary (GsReview *review)
/**
* gs_review_set_summary:
+ * @review: a #GsReview
+ * @summary: a one-line summary, e.g. "Awesome application"
+ *
+ * Sets the one-line summary that may be displayed in bold.
*/
void
gs_review_set_summary (GsReview *review, const gchar *summary)
@@ -120,6 +157,11 @@ gs_review_set_summary (GsReview *review, const gchar *summary)
/**
* gs_review_get_text:
+ * @review: a #GsReview
+ *
+ * Gets the multi-line review text that forms the body of the review.
+ *
+ * Returns: the string, or %NULL
**/
const gchar *
gs_review_get_text (GsReview *review)
@@ -130,6 +172,10 @@ gs_review_get_text (GsReview *review)
/**
* gs_review_set_text:
+ * @review: a #GsReview
+ * @text: multi-line text
+ *
+ * Sets the multi-line review text that forms the body of the review.
*/
void
gs_review_set_text (GsReview *review, const gchar *text)
@@ -141,6 +187,11 @@ gs_review_set_text (GsReview *review, const gchar *text)
/**
* gs_review_get_rating:
+ * @review: a #GsReview
+ *
+ * Gets the star rating of the review, where 100 is 5 stars.
+ *
+ * Returns: integer as a percentage, or -1 for unset
*/
gint
gs_review_get_rating (GsReview *review)
@@ -151,6 +202,10 @@ gs_review_get_rating (GsReview *review)
/**
* gs_review_set_rating:
+ * @review: a #GsReview
+ * @rating: a integer as a percentage, or -1 for unset
+ *
+ * Sets the star rating of the review, where 100 is 5 stars..
*/
void
gs_review_set_rating (GsReview *review, gint rating)
@@ -161,6 +216,12 @@ gs_review_set_rating (GsReview *review, gint rating)
/**
* gs_review_get_flags:
+ * @review: a #GsReview
+ *
+ * Gets any flags set on the review, for example if the user has already
+ * voted on the review or if the user wrote the review themselves.
+ *
+ * Returns: a #GsReviewFlags, e.g. %GS_REVIEW_FLAG_SELF
*/
GsReviewFlags
gs_review_get_flags (GsReview *review)
@@ -171,6 +232,11 @@ gs_review_get_flags (GsReview *review)
/**
* gs_review_set_flags:
+ * @review: a #GsReview
+ * @flags: a #GsReviewFlags, e.g. %GS_REVIEW_FLAG_SELF
+ *
+ * Gets any flags set on the review, for example if the user has already
+ * voted on the review or if the user wrote the review themselves.
*/
void
gs_review_set_flags (GsReview *review, GsReviewFlags flags)
@@ -181,6 +247,10 @@ gs_review_set_flags (GsReview *review, GsReviewFlags flags)
/**
* gs_review_add_flags:
+ * @review: a #GsReview
+ * @flags: a #GsReviewFlags, e.g. %GS_REVIEW_FLAG_SELF
+ *
+ * Adds flags to an existing review without replacing the other flags.
*/
void
gs_review_add_flags (GsReview *review, GsReviewFlags flags)
@@ -191,6 +261,11 @@ gs_review_add_flags (GsReview *review, GsReviewFlags flags)
/**
* gs_review_get_reviewer:
+ * @review: a #GsReview
+ *
+ * Gets the name of the reviewer.
+ *
+ * Returns: the reviewer name, e.g. "David Smith", or %NULL
**/
const gchar *
gs_review_get_reviewer (GsReview *review)
@@ -200,7 +275,26 @@ gs_review_get_reviewer (GsReview *review)
}
/**
+ * gs_review_set_reviewer:
+ * @review: a #GsReview
+ * @reviewer: the reviewer name, e.g. "David Smith"
+ *
+ * Sets the name of the reviewer, which can be left unset.
+ */
+void
+gs_review_set_reviewer (GsReview *review, const gchar *reviewer)
+{
+ g_return_if_fail (GS_IS_REVIEW (review));
+ g_free (review->reviewer);
+ review->reviewer = g_strdup (reviewer);
+}
+
+/**
* gs_review_set_version:
+ * @review: a #GsReview
+ * @version: a version string, e.g. "0.1.2"
+ *
+ * Sets the version string for the application being reviewed.
*/
void
gs_review_set_version (GsReview *review, const gchar *version)
@@ -212,6 +306,11 @@ gs_review_set_version (GsReview *review, const gchar *version)
/**
* gs_review_get_version:
+ * @review: a #GsReview
+ *
+ * Gets the version string for the application being reviewed..
+ *
+ * Returns: the version string, e.g. "0.1.2", or %NULL for unset
**/
const gchar *
gs_review_get_version (GsReview *review)
@@ -221,18 +320,12 @@ gs_review_get_version (GsReview *review)
}
/**
- * gs_review_set_reviewer:
- */
-void
-gs_review_set_reviewer (GsReview *review, const gchar *reviewer)
-{
- g_return_if_fail (GS_IS_REVIEW (review));
- g_free (review->reviewer);
- review->reviewer = g_strdup (reviewer);
-}
-
-/**
* gs_review_get_date:
+ * @review: a #GsReview
+ *
+ * Gets the date the review was originally submitted.
+ *
+ * Returns: the #GDateTime, or %NULL for unset
**/
GDateTime *
gs_review_get_date (GsReview *review)
@@ -243,6 +336,10 @@ gs_review_get_date (GsReview *review)
/**
* gs_review_set_date:
+ * @review: a #GsReview
+ * @date: a #GDateTime, or %NULL
+ *
+ * Sets the date the review was originally submitted.
*/
void
gs_review_set_date (GsReview *review, GDateTime *date)
@@ -255,16 +352,32 @@ gs_review_set_date (GsReview *review, GDateTime *date)
/**
* gs_review_get_metadata_item:
+ * @review: a #GsReview
+ * @key: a string
+ *
+ * Gets some metadata from a review object.
+ * It is left for the the plugin to use this method as required, but a
+ * typical use would be to retrieve some secure authentication token.
+ *
+ * Returns: A string value, or %NULL for not found
*/
const gchar *
gs_review_get_metadata_item (GsReview *review, const gchar *key)
{
g_return_val_if_fail (GS_IS_REVIEW (review), NULL);
+ g_return_val_if_fail (key != NULL, NULL);
return g_hash_table_lookup (review->metadata, key);
}
/**
* gs_review_add_metadata:
+ * @review: a #GsReview
+ * @key: a string
+ * @value: a string
+ *
+ * Adds metadata to the review object.
+ * It is left for the the plugin to use this method as required, but a
+ * typical use would be to store some secure authentication token.
*/
void
gs_review_add_metadata (GsReview *review, const gchar *key, const gchar *value)
@@ -381,7 +494,7 @@ gs_review_class_init (GsReviewClass *klass)
object_class->set_property = gs_review_set_property;
/**
- * GsApp:karma:
+ * GsReview:karma:
*/
pspec = g_param_spec_int ("karma", NULL, NULL,
G_MININT, G_MAXINT, 0,
@@ -389,7 +502,7 @@ gs_review_class_init (GsReviewClass *klass)
g_object_class_install_property (object_class, PROP_KARMA, pspec);
/**
- * GsApp:summary:
+ * GsReview:summary:
*/
pspec = g_param_spec_string ("summary", NULL, NULL,
NULL,
@@ -397,7 +510,7 @@ gs_review_class_init (GsReviewClass *klass)
g_object_class_install_property (object_class, PROP_SUMMARY, pspec);
/**
- * GsApp:text:
+ * GsReview:text:
*/
pspec = g_param_spec_string ("text", NULL, NULL,
NULL,
@@ -405,7 +518,7 @@ gs_review_class_init (GsReviewClass *klass)
g_object_class_install_property (object_class, PROP_TEXT, pspec);
/**
- * GsApp:rating:
+ * GsReview:rating:
*/
pspec = g_param_spec_int ("rating", NULL, NULL,
-1, 100, -1,
@@ -413,7 +526,7 @@ gs_review_class_init (GsReviewClass *klass)
g_object_class_install_property (object_class, PROP_RATING, pspec);
/**
- * GsApp:flags:
+ * GsReview:flags:
*/
pspec = g_param_spec_uint64 ("flags", NULL, NULL,
GS_REVIEW_FLAG_NONE,
@@ -423,7 +536,7 @@ gs_review_class_init (GsReviewClass *klass)
g_object_class_install_property (object_class, PROP_FLAGS, pspec);
/**
- * GsApp:version:
+ * GsReview:version:
*/
pspec = g_param_spec_string ("version", NULL, NULL,
NULL,
@@ -431,7 +544,7 @@ gs_review_class_init (GsReviewClass *klass)
g_object_class_install_property (object_class, PROP_VERSION, pspec);
/**
- * GsApp:reviewer:
+ * GsReview:reviewer:
*/
pspec = g_param_spec_string ("reviewer", NULL, NULL,
NULL,
@@ -439,7 +552,7 @@ gs_review_class_init (GsReviewClass *klass)
g_object_class_install_property (object_class, PROP_REVIEWER, pspec);
/**
- * GsApp:date:
+ * GsReview:date:
*/
pspec = g_param_spec_object ("date", NULL, NULL,
GS_TYPE_REVIEW,
diff --git a/src/gs-review.h b/libgnomesoftware/gs-review.h
similarity index 77%
rename from src/gs-review.h
rename to libgnomesoftware/gs-review.h
index aadfd38..78f169b 100644
--- a/src/gs-review.h
+++ b/libgnomesoftware/gs-review.h
@@ -1,6 +1,7 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2016 Canonical Ltd.
+ * Copyright (C) 2016 Richard Hughes <richard hughsie com>
*
* Licensed under the GNU General Public License Version 2
*
@@ -30,6 +31,17 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GsReview, gs_review, GS, REVIEW, GObject)
+/**
+ * GsReviewAction:
+ * @GS_REVIEW_ACTION_SUBMIT: Submit a new review
+ * @GS_REVIEW_ACTION_UPVOTE: Upvote an existing review
+ * @GS_REVIEW_ACTION_DOWNVOTE: Downvote an existing review
+ * @GS_REVIEW_ACTION_REPORT: Report an existing review
+ * @GS_REVIEW_ACTION_REMOVE: Remove a review written by the user
+ * @GS_REVIEW_ACTION_DISMISS: Dismiss (ignore) a review when moderating
+ *
+ * The review action.
+ **/
typedef enum {
GS_REVIEW_ACTION_SUBMIT,
GS_REVIEW_ACTION_UPVOTE,
@@ -37,13 +49,23 @@ typedef enum {
GS_REVIEW_ACTION_REPORT,
GS_REVIEW_ACTION_REMOVE,
GS_REVIEW_ACTION_DISMISS,
+ /*< private >*/
GS_REVIEW_ACTION_LAST
} GsReviewAction;
+/**
+ * GsReviewFlags:
+ * @GS_REVIEW_FLAG_NONE: No special flags set
+ * @GS_REVIEW_FLAG_SELF: The user wrote the review themselves
+ * @GS_REVIEW_FLAG_VOTED: The user voted on the review
+ *
+ * The flags for the review.
+ **/
typedef enum {
GS_REVIEW_FLAG_NONE = 0,
- GS_REVIEW_FLAG_SELF = 1 << 0, /* user wrote the review themselves */
- GS_REVIEW_FLAG_VOTED = 1 << 1, /* user voted on the review */
+ GS_REVIEW_FLAG_SELF = 1 << 0,
+ GS_REVIEW_FLAG_VOTED = 1 << 1,
+ /*< private >*/
GS_REVIEW_FLAG_LAST
} GsReviewFlags;
@@ -83,9 +105,9 @@ void gs_review_set_date (GsReview *review,
GsReviewFlags gs_review_get_flags (GsReview *review);
void gs_review_set_flags (GsReview *review,
- GsReviewFlags state);
+ GsReviewFlags flags);
void gs_review_add_flags (GsReview *review,
- GsReviewFlags state);
+ GsReviewFlags flags);
const gchar *gs_review_get_metadata_item (GsReview *review,
const gchar *key);
diff --git a/libgnomesoftware/gs-utils.c b/libgnomesoftware/gs-utils.c
new file mode 100644
index 0000000..6576491
--- /dev/null
+++ b/libgnomesoftware/gs-utils.c
@@ -0,0 +1,306 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2013-2016 Richard Hughes <richard hughsie com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/**
+ * SECTION:gs-utils
+ * @short_description: Utilities that plugins can use
+ *
+ * These functions provide useful functionality that makes it easy to
+ * add new plugin functions.
+ */
+
+#include "config.h"
+
+#include <errno.h>
+#include <fnmatch.h>
+
+#ifdef HAVE_POLKIT
+#include <polkit/polkit.h>
+#endif
+
+#include "gs-app.h"
+#include "gs-utils.h"
+#include "gs-plugin.h"
+
+/**
+ * gs_utils_mkdir:
+ * @path: A full pathname
+ * @error: A #GError, or %NULL
+ *
+ * Creates any required directories, including any parent directories.
+ *
+ * Returns: %TRUE for success
+ **/
+gboolean
+gs_utils_mkdir (const gchar *path, GError **error)
+{
+ g_autofree gchar *parent = NULL;
+
+ parent = g_path_get_dirname (path);
+ if (g_mkdir_with_parents (parent, 0755) == -1) {
+ g_set_error (error,
+ GS_PLUGIN_ERROR,
+ GS_PLUGIN_ERROR_FAILED,
+ "Failed to create '%s': %s",
+ parent, g_strerror (errno));
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/**
+ * gs_utils_get_file_age:
+ * @file: A #GFile
+ *
+ * Gets a file age.
+ *
+ * Returns: The time in seconds since the file was modified, or %G_MAXUINT for error
+ */
+guint
+gs_utils_get_file_age (GFile *file)
+{
+ guint64 now;
+ guint64 mtime;
+ g_autoptr(GFileInfo) info = NULL;
+
+ info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_TIME_MODIFIED,
+ G_FILE_QUERY_INFO_NONE,
+ NULL,
+ NULL);
+ if (info == NULL)
+ return G_MAXUINT;
+ mtime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
+ now = (guint64) g_get_real_time () / G_USEC_PER_SEC;
+ if (mtime > now)
+ return G_MAXUINT;
+ return now - mtime;
+}
+
+/**
+ * gs_utils_get_cache_filename:
+ * @kind: A cache kind, e.g. "firmware" or "screenshots/123x456"
+ * @basename: A filename basename, e.g. "system.bin"
+ * @flags: Some #GsUtilsCacheFlags, e.g. %GS_UTILS_CACHE_FLAG_WRITEABLE
+ * @error: A #GError, or %NULL
+ *
+ * Returns a filename that points into the cache.
+ * This may be per-system or per-user, the latter being more likely
+ * when %GS_UTILS_CACHE_FLAG_WRITEABLE is specified in @flags.
+ *
+ * Returns: The full path and filename, which may or may not exist, or %NULL
+ **/
+gchar *
+gs_utils_get_cache_filename (const gchar *kind,
+ const gchar *basename,
+ GsUtilsCacheFlags flags, /* ignored */
+ GError **error)
+{
+ g_autofree gchar *cachedir = NULL;
+ g_autofree gchar *vername = NULL;
+ g_auto(GStrv) version = g_strsplit (VERSION, ".", 3);
+ g_autoptr(GFile) cachedir_file = NULL;
+
+ /* not writable, so try the system cache first */
+ if ((flags & GS_UTILS_CACHE_FLAG_WRITEABLE) == 0) {
+ g_autofree gchar *cachefn = NULL;
+ cachefn = g_build_filename (LOCALSTATEDIR,
+ "cache",
+ "gnome-software",
+ basename,
+ NULL);
+ if (g_file_test (cachefn, G_FILE_TEST_EXISTS))
+ return g_steal_pointer (&cachefn);
+ }
+
+ /* not writable, so try the system cache first */
+ if ((flags & GS_UTILS_CACHE_FLAG_WRITEABLE) == 0) {
+ g_autofree gchar *cachefn = NULL;
+ cachefn = g_build_filename (DATADIR,
+ "gnome-software",
+ "cache",
+ kind,
+ basename,
+ NULL);
+ if (g_file_test (cachefn, G_FILE_TEST_EXISTS))
+ return g_steal_pointer (&cachefn);
+ }
+
+ /* create the cachedir in a per-release location, creating
+ * if it does not already exist */
+ vername = g_strdup_printf ("%s.%s", version[0], version[1]);
+ cachedir = g_build_filename (g_get_user_cache_dir (),
+ "gnome-software",
+ vername,
+ kind,
+ NULL);
+ cachedir_file = g_file_new_for_path (cachedir);
+ if (!g_file_query_exists (cachedir_file, NULL) &&
+ !g_file_make_directory_with_parents (cachedir_file, NULL, error))
+ return NULL;
+ return g_build_filename (cachedir, basename, NULL);
+}
+
+/**
+ * gs_utils_get_user_hash:
+ * @error: A #GError, or %NULL
+ *
+ * This SHA1 hash is composed of the contents of machine-id and your
+ * usename and is also salted with a hardcoded value.
+ *
+ * This provides an identifier that can be used to identify a specific
+ * user on a machine, allowing them to cast only one vote or perform
+ * one review on each application.
+ *
+ * There is no known way to calculate the machine ID or username from
+ * the machine hash and there should be no privacy issue.
+ *
+ * Returns: The user hash, or %NULL on error
+ */
+gchar *
+gs_utils_get_user_hash (GError **error)
+{
+ g_autofree gchar *data = NULL;
+ g_autofree gchar *salted = NULL;
+
+ if (!g_file_get_contents ("/etc/machine-id", &data, NULL, error))
+ return NULL;
+
+ salted = g_strdup_printf ("gnome-software[%s:%s]",
+ g_get_user_name (), data);
+ return g_compute_checksum_for_string (G_CHECKSUM_SHA1, salted, -1);
+}
+
+/**
+ * gs_utils_get_permission:
+ * @id: A PolicyKit ID, e.g. "org.gnome.Desktop"
+ *
+ * Gets a permission object for an ID.
+ *
+ * Returns: a #GPermission, or %NULL if this if not possible.
+ **/
+GPermission *
+gs_utils_get_permission (const gchar *id)
+{
+#ifdef HAVE_POLKIT
+ g_autoptr(GPermission) permission = NULL;
+ g_autoptr(GError) error = NULL;
+
+ permission = polkit_permission_new_sync (id, NULL, NULL, &error);
+ if (permission == NULL) {
+ g_warning ("Failed to create permission %s: %s", id, error->message);
+ return NULL;
+ }
+ return g_steal_pointer (&permission);
+#else
+ g_debug ("no PolicyKit, so can't return GPermission for %s", id);
+ return NULL;
+#endif
+}
+
+/**
+ * gs_utils_get_content_type:
+ * @file: A GFile
+ * @cancellable: A #GCancellable, or %NULL
+ * @error: A #GError, or %NULL
+ *
+ * Gets the standard content type for a file.
+ *
+ * Returns: the content type, or %NULL, e.g. "text/plain"
+ */
+gchar *
+gs_utils_get_content_type (GFile *file,
+ GCancellable *cancellable,
+ GError **error)
+{
+ const gchar *tmp;
+ g_autoptr(GFileInfo) info = NULL;
+
+ /* get content type */
+ info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ G_FILE_QUERY_INFO_NONE,
+ cancellable,
+ error);
+ if (info == NULL)
+ return NULL;
+ tmp = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
+ if (tmp == NULL)
+ return NULL;
+ return g_strdup (tmp);
+}
+
+/**
+ * gs_utils_strv_fnmatch:
+ * @strv: A NUL-terminated list of strings
+ * @str: A string
+ *
+ * Matches a string against a list of globs.
+ *
+ * Returns: %TRUE if the list matches
+ */
+gboolean
+gs_utils_strv_fnmatch (gchar **strv, const gchar *str)
+{
+ guint i;
+
+ /* empty */
+ if (strv == NULL)
+ return FALSE;
+
+ /* look at each one */
+ for (i = 0; strv[i] != NULL; i++) {
+ if (fnmatch (strv[i], str, 0) == 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
+ * gs_utils_get_desktop_app_info:
+ * @id: A desktop ID, e.g. "gimp.desktop"
+ *
+ * Gets a a #GDesktopAppInfo taking into account the kde4- prefix.
+ *
+ * Returns: a #GDesktopAppInfo for a specific ID, or %NULL
+ */
+GDesktopAppInfo *
+gs_utils_get_desktop_app_info (const gchar *id)
+{
+ GDesktopAppInfo *app_info;
+
+ /* try to get the standard app-id */
+ app_info = g_desktop_app_info_new (id);
+
+ /* KDE is a special project because it believes /usr/share/applications
+ * isn't KDE enough. For this reason we support falling back to the
+ * "kde4-" prefixed ID to avoid educating various self-righteous
+ * upstreams about the correct ID to use in the AppData file. */
+ if (app_info == NULL) {
+ g_autofree gchar *kde_id = NULL;
+ kde_id = g_strdup_printf ("%s-%s", "kde4", id);
+ app_info = g_desktop_app_info_new (kde_id);
+ }
+
+ return app_info;
+}
+
+/* vim: set noexpandtab: */
diff --git a/src/gs-utils.h b/libgnomesoftware/gs-utils.h
similarity index 54%
copy from src/gs-utils.h
copy to libgnomesoftware/gs-utils.h
index 828a90b..b583ee7 100644
--- a/src/gs-utils.h
+++ b/libgnomesoftware/gs-utils.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2013 Richard Hughes <richard hughsie com>
+ * Copyright (C) 2013-2016 Richard Hughes <richard hughsie com>
*
* Licensed under the GNU General Public License Version 2
*
@@ -26,64 +26,37 @@
#include <gtk/gtk.h>
#include "gs-app.h"
-#include "gs-plugin-loader.h"
G_BEGIN_DECLS
+/**
+ * GsUtilsCacheFlags:
+ * @GS_UTILS_CACHE_FLAG_NONE: No flags set
+ * @GS_UTILS_CACHE_FLAG_WRITEABLE: A writable directory is required
+ *
+ * The cache flags.
+ **/
typedef enum {
GS_UTILS_CACHE_FLAG_NONE = 0,
GS_UTILS_CACHE_FLAG_WRITEABLE = 1 << 0,
+ /*< private >*/
GS_UTILS_CACHE_FLAG_LAST
} GsUtilsCacheFlags;
-void gs_start_spinner (GtkSpinner *spinner);
-void gs_stop_spinner (GtkSpinner *spinner);
-void gs_container_remove_all (GtkContainer *container);
-void gs_grab_focus_when_mapped (GtkWidget *widget);
-
-guint gs_utils_get_file_age (GFile *file);
-gchar *gs_utils_get_content_type (GFile *file,
- GCancellable *cancellable,
- GError **error);
-
-void gs_app_notify_installed (GsApp *app);
-void gs_app_notify_failed_modal (GsApp *app,
- GtkWindow *parent_window,
- GsPluginLoaderAction action,
- const GError *error);
-GtkResponseType
- gs_app_notify_unavailable (GsApp *app,
- GtkWindow *parent);
-void gs_app_show_url (GsApp *app,
- AsUrlKind kind);
-
-gboolean gs_mkdir_parent (const gchar *path,
- GError **error);
-
-void gs_image_set_from_pixbuf_with_scale (GtkImage *image,
- const GdkPixbuf *pixbuf,
- gint scale);
-void gs_image_set_from_pixbuf (GtkImage *image,
- const GdkPixbuf *pixbuf);
-const gchar *gs_user_agent (void);
-
+guint gs_utils_get_file_age (GFile *file);
+gchar *gs_utils_get_content_type (GFile *file,
+ GCancellable *cancellable,
+ GError **error);
+gboolean gs_utils_mkdir (const gchar *path,
+ GError **error);
gchar *gs_utils_get_cache_filename (const gchar *kind,
const gchar *basename,
GsUtilsCacheFlags flags,
GError **error);
gchar *gs_utils_get_user_hash (GError **error);
GPermission *gs_utils_get_permission (const gchar *id);
-#if AS_CHECK_VERSION(0,5,12)
-const gchar *gs_utils_get_content_rating (void);
-#endif
-
-gboolean gs_utils_is_current_desktop (const gchar *name);
-void gs_utils_widget_set_custom_css (GsApp *app,
- GtkWidget *widget,
- const gchar *metadata_css);
gboolean gs_utils_strv_fnmatch (gchar **strv,
const gchar *str);
-
GDesktopAppInfo *gs_utils_get_desktop_app_info (const gchar *id);
G_END_DECLS
diff --git a/src/gs-app-list.h b/libgnomesoftware/gs-version.h.in
similarity index 52%
rename from src/gs-app-list.h
rename to libgnomesoftware/gs-version.h.in
index ae4afca..c35137a 100644
--- a/src/gs-app-list.h
+++ b/libgnomesoftware/gs-version.h.in
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2012-2016 Richard Hughes <richard hughsie com>
+ * Copyright (C) 2016 Richard Hughes <richard hughsie com>
*
* Licensed under the GNU General Public License Version 2
*
@@ -19,32 +19,26 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_APP_LIST_H
-#define __GS_APP_LIST_H
+#if !defined (__GNOME_SOFTWARE_INSIDE__) && !defined (GS_COMPILATION)
+#error "Only <gnome-software.h> can be included directly."
+#endif
-#include "gs-app.h"
+#ifndef __GS_VERSION_H
+#define __GS_VERSION_H
-G_BEGIN_DECLS
-
-typedef GList GsAppList;
-
-typedef gboolean (*GsAppListFilterFunc) (GsApp *app,
- gpointer user_data);
-
-void gs_app_list_add (GsAppList **list,
- GsApp *app);
-void gs_app_list_free (GsAppList *list);
-GList *gs_app_list_copy (GsAppList *list);
-void gs_app_list_filter (GsAppList **list,
- GsAppListFilterFunc func,
- gpointer user_data);
-void gs_app_list_filter_duplicates (GsAppList **list);
-void gs_app_list_randomize (GsAppList **list);
-
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GsAppList, gs_app_list_free)
-
-G_END_DECLS
+/* compile time version
+ */
+#define GS_MAJOR_VERSION (@GS_MAJOR_VERSION@)
+#define GS_MINOR_VERSION (@GS_MINOR_VERSION@)
+#define GS_MICRO_VERSION (@GS_MICRO_VERSION@)
-#endif /* __GS_APP_LIST_H */
+/* check whether a PackageKit version equal to or greater than
+ * major.minor.micro.
+ */
+#define GS_CHECK_VERSION(major,minor,micro) \
+ (GS_MAJOR_VERSION > (major) || \
+ (GS_MAJOR_VERSION == (major) && GS_MINOR_VERSION > (minor)) || \
+ (GS_MAJOR_VERSION == (major) && GS_MINOR_VERSION == (minor) && \
+ GS_MICRO_VERSION >= (micro)))
-/* vim: set noexpandtab: */
+#endif /* __GS_VERSION_H */
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0f37728..0885e85 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -7,13 +7,13 @@ data/org.gnome.software.gschema.xml
src/gnome-software-local-file.desktop.in
[type: gettext/glade]src/gnome-software.ui
src/gs-app-addon-row.c
-src/gs-app.c
+libgnomesoftware/gs-app.c
src/gs-app-folder-dialog.c
src/gs-application.c
src/gs-app-row.c
[type: gettext/glade]src/gs-app-row.ui
src/gs-app-tile.c
-src/gs-category.c
+libgnomesoftware/gs-category.c
src/gs-dbus-helper.c
src/gs-feature-tile.c
[type: gettext/glade]src/gs-first-run-dialog.ui
@@ -54,7 +54,7 @@ src/gs-update-list.c
src/gs-update-monitor.c
src/gs-upgrade-banner.c
[type: gettext/glade]src/gs-upgrade-banner.ui
-src/gs-utils.c
+src/gs-common.c
[type: gettext/glade]src/gs-menus.ui
src/org.gnome.Software.desktop.in
src/plugins/menu-spec-common.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 52d460c..7974d09 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,17 +9,21 @@ AM_CPPFLAGS = \
$(PACKAGEKIT_CFLAGS) \
$(GNOME_DESKTOP_CFLAGS) \
$(POLKIT_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/libgnomesoftware \
+ -DI_KNOW_THE_GNOME_SOFTWARE_API_IS_SUBJECT_TO_CHANGE \
+ -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \
-DG_LOG_DOMAIN=\"Gs\" \
- -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \
-DLIBDIR=\"$(libdir)\" \
-DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\" \
-DVERSION="\"$(VERSION)\"" \
-DLOCALEDIR=\""$(localedir)"\" \
- -DLOCALSTATEDIR=\""$(localstatedir)"\" \
-DTESTDATADIR=\""$(top_srcdir)/data"\" \
-DGS_DATA=\"$(pkgdatadir)\"
+GNOME_SOFTWARE_LIBS = $(top_builddir)/libgnomesoftware/libgnomesoftware.la
+
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_in_files = \
@@ -87,19 +91,14 @@ noinst_PROGRAMS = \
gnome-software-cmd
gnome_software_cmd_SOURCES = \
- gs-app.c \
- gs-app-list.c \
- gs-review.c \
gs-cmd.c \
+ gs-common.c \
gs-debug.c \
- gs-utils.c \
- gs-os-release.c \
gs-plugin-loader.c \
- gs-plugin-loader-sync.c \
- gs-category.c \
- gs-plugin.c
+ gs-plugin-loader-sync.c
gnome_software_cmd_LDADD = \
+ $(GNOME_SOFTWARE_LIBS) \
$(APPSTREAM_LIBS) \
$(POLKIT_LIBS) \
$(SOUP_LIBS) \
@@ -113,14 +112,6 @@ bin_PROGRAMS = \
gnome-software
gnome_software_SOURCES = \
- gs-utils.c \
- gs-utils.h \
- gs-app.c \
- gs-app.h \
- gs-app-list.c \
- gs-app-list.h \
- gs-category.c \
- gs-category.h \
gs-debug.c \
gs-debug.h \
gs-app-addon-row.c \
@@ -129,6 +120,8 @@ gnome_software_SOURCES = \
gs-app-row.h \
gs-star-widget.c \
gs-star-widget.h \
+ gs-common.c \
+ gs-common.h \
gs-popular-tile.c \
gs-popular-tile.h \
gs-feature-tile.c \
@@ -151,17 +144,10 @@ gnome_software_SOURCES = \
gs-info-bar.c \
gs-language.c \
gs-language.h \
- gs-os-release.c \
- gs-os-release.h \
gs-page.c \
gs-page.h \
- gs-plugin.c \
- gs-plugin.h \
- gs-plugin-private.h \
gs-progress-button.c \
gs-progress-button.h \
- gs-review.c \
- gs-review.h \
gs-review-bar.c \
gs-review-bar.h \
gs-review-dialog.c \
@@ -235,6 +221,7 @@ nodist_gnome_software_SOURCES += \
endif
gnome_software_LDADD = \
+ $(GNOME_SOFTWARE_LIBS) \
$(APPSTREAM_LIBS) \
$(GLIB_LIBS) \
$(GTK_LIBS) \
@@ -296,18 +283,13 @@ check_PROGRAMS = \
gs-self-test
gs_self_test_SOURCES = \
- gs-app.c \
- gs-app-list.c \
- gs-category.c \
- gs-os-release.c \
gs-plugin-loader-sync.c \
gs-plugin-loader.c \
- gs-plugin.c \
- gs-review.c \
- gs-utils.c \
+ gs-common.c \
gs-self-test.c
gs_self_test_LDADD = \
+ $(GNOME_SOFTWARE_LIBS) \
$(APPSTREAM_LIBS) \
$(POLKIT_LIBS) \
$(SOUP_LIBS) \
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 49a1fa4..28784e9 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -28,7 +28,7 @@
#include "gs-app-row.h"
#include "gs-star-widget.h"
#include "gs-progress-button.h"
-#include "gs-utils.h"
+#include "gs-common.h"
#include "gs-folders.h"
typedef struct
diff --git a/src/gs-app-tile.c b/src/gs-app-tile.c
index 5aefdfc..091e643 100644
--- a/src/gs-app-tile.c
+++ b/src/gs-app-tile.c
@@ -26,7 +26,7 @@
#include "gs-app-tile.h"
#include "gs-star-widget.h"
-#include "gs-utils.h"
+#include "gs-common.h"
struct _GsAppTile
{
diff --git a/src/gs-utils.c b/src/gs-common.c
similarity index 82%
rename from src/gs-utils.c
rename to src/gs-common.c
index 977f183..8253fba 100644
--- a/src/gs-utils.c
+++ b/src/gs-common.c
@@ -26,12 +26,8 @@
#include <errno.h>
#include <fnmatch.h>
-#ifdef HAVE_POLKIT
-#include <polkit/polkit.h>
-#endif
-
#include "gs-app.h"
-#include "gs-utils.h"
+#include "gs-common.h"
#include "gs-plugin.h"
#define SPINNER_DELAY 500
@@ -405,26 +401,6 @@ gs_app_show_url (GsApp *app, AsUrlKind kind)
}
/**
- * gs_mkdir_parent:
- **/
-gboolean
-gs_mkdir_parent (const gchar *path, GError **error)
-{
- g_autofree gchar *parent = NULL;
-
- parent = g_path_get_dirname (path);
- if (g_mkdir_with_parents (parent, 0755) == -1) {
- g_set_error (error,
- GS_PLUGIN_ERROR,
- GS_PLUGIN_ERROR_FAILED,
- "Failed to create '%s': %s",
- parent, g_strerror (errno));
- return FALSE;
- }
- return TRUE;
-}
-
-/**
* gs_image_set_from_pixbuf_with_scale:
**/
void
@@ -447,147 +423,6 @@ gs_image_set_from_pixbuf (GtkImage *image, const GdkPixbuf *pixbuf)
gs_image_set_from_pixbuf_with_scale (image, pixbuf, scale);
}
-/**
- * gs_utils_get_file_age:
- *
- * Returns: The time in seconds since the file was modified
- */
-guint
-gs_utils_get_file_age (GFile *file)
-{
- guint64 now;
- guint64 mtime;
- g_autoptr(GFileInfo) info = NULL;
-
- info = g_file_query_info (file,
- G_FILE_ATTRIBUTE_TIME_MODIFIED,
- G_FILE_QUERY_INFO_NONE,
- NULL,
- NULL);
- if (info == NULL)
- return G_MAXUINT;
- mtime = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
- now = (guint64) g_get_real_time () / G_USEC_PER_SEC;
- if (mtime > now)
- return G_MAXUINT;
- return now - mtime;
-}
-
-const gchar *
-gs_user_agent (void)
-{
- return PACKAGE_NAME "/" PACKAGE_VERSION;
-}
-
-/**
- * gs_utils_get_cache_filename:
- *
- * Returns a filename that points into the cache. This may be per-system
- * or per-user, the latter being more likely when %GS_UTILS_CACHE_FLAG_WRITEABLE
- * is specified in @flags.
- *
- * Returns: The full path and filename, which may or may not exist.
- **/
-gchar *
-gs_utils_get_cache_filename (const gchar *kind,
- const gchar *basename,
- GsUtilsCacheFlags flags, /* ignored */
- GError **error)
-{
- g_autofree gchar *cachedir = NULL;
- g_autofree gchar *vername = NULL;
- g_auto(GStrv) version = g_strsplit (VERSION, ".", 3);
- g_autoptr(GFile) cachedir_file = NULL;
-
- /* not writable, so try the system cache first */
- if ((flags & GS_UTILS_CACHE_FLAG_WRITEABLE) == 0) {
- g_autofree gchar *cachefn = NULL;
- cachefn = g_build_filename (LOCALSTATEDIR,
- "cache",
- "gnome-software",
- basename,
- NULL);
- if (g_file_test (cachefn, G_FILE_TEST_EXISTS))
- return g_steal_pointer (&cachefn);
- }
-
- /* not writable, so try the system cache first */
- if ((flags & GS_UTILS_CACHE_FLAG_WRITEABLE) == 0) {
- g_autofree gchar *cachefn = NULL;
- cachefn = g_build_filename (DATADIR,
- "gnome-software",
- "cache",
- kind,
- basename,
- NULL);
- if (g_file_test (cachefn, G_FILE_TEST_EXISTS))
- return g_steal_pointer (&cachefn);
- }
-
- /* create the cachedir in a per-release location, creating
- * if it does not already exist */
- vername = g_strdup_printf ("%s.%s", version[0], version[1]);
- cachedir = g_build_filename (g_get_user_cache_dir (),
- "gnome-software",
- vername,
- kind,
- NULL);
- cachedir_file = g_file_new_for_path (cachedir);
- if (!g_file_query_exists (cachedir_file, NULL) &&
- !g_file_make_directory_with_parents (cachedir_file, NULL, error))
- return NULL;
- return g_build_filename (cachedir, basename, NULL);
-}
-
-/**
- * gs_utils_get_user_hash:
- *
- * This SHA1 hash is composed of the contents of machine-id and your
- * usename and is also salted with a hardcoded value.
- *
- * This provides an identifier that can be used to identify a specific
- * user on a machine, allowing them to cast only one vote or perform
- * one review on each application.
- *
- * There is no known way to calculate the machine ID or username from
- * the machine hash and there should be no privacy issue.
- */
-gchar *
-gs_utils_get_user_hash (GError **error)
-{
- g_autofree gchar *data = NULL;
- g_autofree gchar *salted = NULL;
-
- if (!g_file_get_contents ("/etc/machine-id", &data, NULL, error))
- return NULL;
-
- salted = g_strdup_printf ("gnome-software[%s:%s]",
- g_get_user_name (), data);
- return g_compute_checksum_for_string (G_CHECKSUM_SHA1, salted, -1);
-}
-
-/**
- * gs_utils_get_permission:
- **/
-GPermission *
-gs_utils_get_permission (const gchar *id)
-{
-#ifdef HAVE_POLKIT
- g_autoptr(GPermission) permission = NULL;
- g_autoptr(GError) error = NULL;
-
- permission = polkit_permission_new_sync (id, NULL, NULL, &error);
- if (permission == NULL) {
- g_warning ("Failed to create permission %s: %s", id, error->message);
- return NULL;
- }
- return g_steal_pointer (&permission);
-#else
- g_debug ("no PolicyKit, so can't return GPermission for %s", id);
- return NULL;
-#endif
-}
-
#if AS_CHECK_VERSION(0,5,12)
/**
* gs_utils_get_content_rating:
@@ -810,31 +645,6 @@ gs_utils_get_content_rating (void)
#endif
/**
- * gs_utils_get_content_type:
- */
-gchar *
-gs_utils_get_content_type (GFile *file,
- GCancellable *cancellable,
- GError **error)
-{
- const gchar *tmp;
- g_autoptr(GFileInfo) info = NULL;
-
- /* get content type */
- info = g_file_query_info (file,
- G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
- G_FILE_QUERY_INFO_NONE,
- cancellable,
- error);
- if (info == NULL)
- return NULL;
- tmp = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
- if (tmp == NULL)
- return NULL;
- return g_strdup (tmp);
-}
-
-/**
* gs_utils_is_current_desktop:
*/
gboolean
@@ -931,48 +741,10 @@ gs_utils_widget_set_custom_css (GsApp *app, GtkWidget *widget, const gchar *meta
g_object_unref);
}
-/**
- * gs_utils_strv_fnmatch:
- */
-gboolean
-gs_utils_strv_fnmatch (gchar **strv, const gchar *str)
-{
- guint i;
-
- /* empty */
- if (strv == NULL)
- return FALSE;
-
- /* look at each one */
- for (i = 0; strv[i] != NULL; i++) {
- if (fnmatch (strv[i], str, 0) == 0)
- return TRUE;
- }
- return FALSE;
-}
-
-/**
- * gs_utils_get_desktop_app_info:
- */
-GDesktopAppInfo *
-gs_utils_get_desktop_app_info (const gchar *id)
+const gchar *
+gs_user_agent (void)
{
- GDesktopAppInfo *app_info;
-
- /* try to get the standard app-id */
- app_info = g_desktop_app_info_new (id);
-
- /* KDE is a special project because it believes /usr/share/applications
- * isn't KDE enough. For this reason we support falling back to the
- * "kde4-" prefixed ID to avoid educating various self-righteous
- * upstreams about the correct ID to use in the AppData file. */
- if (app_info == NULL) {
- g_autofree gchar *kde_id = NULL;
- kde_id = g_strdup_printf ("%s-%s", "kde4", id);
- app_info = g_desktop_app_info_new (kde_id);
- }
-
- return app_info;
+ return PACKAGE_NAME "/" PACKAGE_VERSION;
}
/* vim: set noexpandtab: */
diff --git a/src/gs-utils.h b/src/gs-common.h
similarity index 73%
rename from src/gs-utils.h
rename to src/gs-common.h
index 828a90b..6e7ea92 100644
--- a/src/gs-utils.h
+++ b/src/gs-common.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef __GS_UTILS_H
-#define __GS_UTILS_H
+#ifndef __GS_COMMON_H
+#define __GS_COMMON_H
#include <gio/gdesktopappinfo.h>
#include <gtk/gtk.h>
@@ -30,22 +30,11 @@
G_BEGIN_DECLS
-typedef enum {
- GS_UTILS_CACHE_FLAG_NONE = 0,
- GS_UTILS_CACHE_FLAG_WRITEABLE = 1 << 0,
- GS_UTILS_CACHE_FLAG_LAST
-} GsUtilsCacheFlags;
-
void gs_start_spinner (GtkSpinner *spinner);
void gs_stop_spinner (GtkSpinner *spinner);
void gs_container_remove_all (GtkContainer *container);
void gs_grab_focus_when_mapped (GtkWidget *widget);
-guint gs_utils_get_file_age (GFile *file);
-gchar *gs_utils_get_content_type (GFile *file,
- GCancellable *cancellable,
- GError **error);
-
void gs_app_notify_installed (GsApp *app);
void gs_app_notify_failed_modal (GsApp *app,
GtkWindow *parent_window,
@@ -57,26 +46,17 @@ GtkResponseType
void gs_app_show_url (GsApp *app,
AsUrlKind kind);
-gboolean gs_mkdir_parent (const gchar *path,
- GError **error);
-
void gs_image_set_from_pixbuf_with_scale (GtkImage *image,
const GdkPixbuf *pixbuf,
gint scale);
void gs_image_set_from_pixbuf (GtkImage *image,
const GdkPixbuf *pixbuf);
-const gchar *gs_user_agent (void);
-gchar *gs_utils_get_cache_filename (const gchar *kind,
- const gchar *basename,
- GsUtilsCacheFlags flags,
- GError **error);
-gchar *gs_utils_get_user_hash (GError **error);
-GPermission *gs_utils_get_permission (const gchar *id);
#if AS_CHECK_VERSION(0,5,12)
const gchar *gs_utils_get_content_rating (void);
#endif
+const gchar *gs_user_agent (void);
gboolean gs_utils_is_current_desktop (const gchar *name);
void gs_utils_widget_set_custom_css (GsApp *app,
GtkWidget *widget,
@@ -84,10 +64,8 @@ void gs_utils_widget_set_custom_css (GsApp *app,
gboolean gs_utils_strv_fnmatch (gchar **strv,
const gchar *str);
-GDesktopAppInfo *gs_utils_get_desktop_app_info (const gchar *id);
-
G_END_DECLS
-#endif /* __GS_UTILS_H */
+#endif /* __GS_COMMON_H */
/* vim: set noexpandtab: */
diff --git a/src/gs-feature-tile.c b/src/gs-feature-tile.c
index 77a122c..cba49e4 100644
--- a/src/gs-feature-tile.c
+++ b/src/gs-feature-tile.c
@@ -25,7 +25,7 @@
#include <gtk/gtk.h>
#include "gs-feature-tile.h"
-#include "gs-utils.h"
+#include "gs-common.h"
struct _GsFeatureTile
{
diff --git a/src/gs-history-dialog.c b/src/gs-history-dialog.c
index 194c1e6..287dbd1 100644
--- a/src/gs-history-dialog.c
+++ b/src/gs-history-dialog.c
@@ -26,7 +26,7 @@
#include <gtk/gtk.h>
#include "gs-history-dialog.h"
-#include "gs-utils.h"
+#include "gs-common.h"
struct _GsHistoryDialog
{
diff --git a/src/gs-page.c b/src/gs-page.c
index 5e8d2dc..49e4e30 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -27,7 +27,7 @@
#include "gs-app.h"
#include "gs-page.h"
#include "gs-shell.h"
-#include "gs-utils.h"
+#include "gs-common.h"
typedef struct
{
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 4a564f4..3190958 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -28,7 +28,7 @@
#include "gs-plugin-loader.h"
#include "gs-plugin.h"
#include "gs-plugin-private.h"
-#include "gs-utils.h"
+#include "gs-common.h"
#define GS_PLUGIN_LOADER_UPDATES_CHANGED_DELAY 3 /* s */
diff --git a/src/gs-popular-tile.c b/src/gs-popular-tile.c
index 2fcdb24..cec0bc9 100644
--- a/src/gs-popular-tile.c
+++ b/src/gs-popular-tile.c
@@ -26,7 +26,7 @@
#include "gs-popular-tile.h"
#include "gs-star-widget.h"
-#include "gs-utils.h"
+#include "gs-common.h"
struct _GsPopularTile
{
diff --git a/src/gs-screenshot-image.c b/src/gs-screenshot-image.c
index 5966645..8d17636 100644
--- a/src/gs-screenshot-image.c
+++ b/src/gs-screenshot-image.c
@@ -24,13 +24,14 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <gnome-software.h>
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnome-desktop/gnome-bg.h>
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#include "gs-screenshot-image.h"
-#include "gs-utils.h"
+#include "gs-common.h"
struct _GsScreenshotImage
{
diff --git a/src/gs-shell-category.c b/src/gs-shell-category.c
index bc3e445..b6ca31e 100644
--- a/src/gs-shell-category.c
+++ b/src/gs-shell-category.c
@@ -25,7 +25,7 @@
#include <string.h>
#include <glib/gi18n.h>
-#include "gs-utils.h"
+#include "gs-common.h"
#include "gs-app-tile.h"
#include "gs-shell-category.h"
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 945982f..4c9cc82 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -24,9 +24,9 @@
#include <string.h>
#include <glib/gi18n.h>
-#include <appstream-glib.h>
+#include <gnome-software.h>
-#include "gs-utils.h"
+#include "gs-common.h"
#include "gs-shell-details.h"
#include "gs-app-addon-row.h"
diff --git a/src/gs-shell-extras.c b/src/gs-shell-extras.c
index 9c36dce..0c8b576 100644
--- a/src/gs-shell-extras.c
+++ b/src/gs-shell-extras.c
@@ -27,7 +27,7 @@
#include "gs-app-row.h"
#include "gs-language.h"
#include "gs-shell.h"
-#include "gs-utils.h"
+#include "gs-common.h"
#include "gs-vendor.h"
#include <glib/gi18n.h>
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 39a2e81..8016370 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -29,7 +29,7 @@
#include "gs-shell.h"
#include "gs-shell-installed.h"
#include "gs-app.h"
-#include "gs-utils.h"
+#include "gs-common.h"
#include "gs-app-row.h"
#include "gs-app-folder-dialog.h"
#include "gs-folders.h"
diff --git a/src/gs-shell-moderate.c b/src/gs-shell-moderate.c
index 414b704..227f23f 100644
--- a/src/gs-shell-moderate.c
+++ b/src/gs-shell-moderate.c
@@ -30,7 +30,7 @@
#include "gs-review-row.h"
#include "gs-shell.h"
#include "gs-shell-moderate.h"
-#include "gs-utils.h"
+#include "gs-common.h"
struct _GsShellModerate
{
diff --git a/src/gs-shell-overview.c b/src/gs-shell-overview.c
index bd35014..2f91112 100644
--- a/src/gs-shell-overview.c
+++ b/src/gs-shell-overview.c
@@ -30,7 +30,7 @@
#include "gs-popular-tile.h"
#include "gs-feature-tile.h"
#include "gs-category-tile.h"
-#include "gs-utils.h"
+#include "gs-common.h"
#define N_TILES 8
diff --git a/src/gs-shell-search.c b/src/gs-shell-search.c
index a3ef887..0d2d3cb 100644
--- a/src/gs-shell-search.c
+++ b/src/gs-shell-search.c
@@ -27,7 +27,7 @@
#include "gs-shell-search.h"
#include "gs-shell.h"
#include "gs-app.h"
-#include "gs-utils.h"
+#include "gs-common.h"
#include "gs-app-row.h"
struct _GsShellSearch
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 80cc6cc..d1a8c09 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -26,7 +26,7 @@
#include "gs-shell.h"
#include "gs-shell-updates.h"
-#include "gs-utils.h"
+#include "gs-common.h"
#include "gs-app.h"
#include "gs-app-row.h"
#include "gs-update-dialog.h"
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 474401b..09b1b07 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -25,7 +25,7 @@
#include <string.h>
#include <glib/gi18n.h>
-#include "gs-utils.h"
+#include "gs-common.h"
#include "gs-shell.h"
#include "gs-shell-details.h"
#include "gs-shell-installed.h"
diff --git a/src/gs-sources-dialog.c b/src/gs-sources-dialog.c
index b78dd81..adc71c4 100644
--- a/src/gs-sources-dialog.c
+++ b/src/gs-sources-dialog.c
@@ -28,7 +28,7 @@
#include "gs-sources-dialog.h"
#include "gs-os-release.h"
#include "gs-sources-dialog-row.h"
-#include "gs-utils.h"
+#include "gs-common.h"
struct _GsSourcesDialog
{
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index 45bae7d..3f75cb9 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -27,7 +27,7 @@
#include "gs-update-dialog.h"
#include "gs-app-row.h"
#include "gs-update-list.h"
-#include "gs-utils.h"
+#include "gs-common.h"
typedef struct {
gchar *title;
diff --git a/src/gs-upgrade-banner.c b/src/gs-upgrade-banner.c
index 5772352..699c6a9 100644
--- a/src/gs-upgrade-banner.c
+++ b/src/gs-upgrade-banner.c
@@ -27,7 +27,7 @@
#include <stdlib.h>
#include "gs-upgrade-banner.h"
-#include "gs-utils.h"
+#include "gs-common.h"
typedef struct
{
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 7be0e5e..cc98cb9 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -15,6 +15,7 @@ AM_CPPFLAGS = \
$(OSTREE_CFLAGS) \
$(XDG_APP_CFLAGS) \
$(RPM_CFLAGS) \
+ -DI_KNOW_THE_GNOME_SOFTWARE_API_IS_SUBJECT_TO_CHANGE \
-DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\" \
-DG_LOG_DOMAIN=\"GsPlugin\" \
@@ -23,7 +24,8 @@ AM_CPPFLAGS = \
-DSBINDIR=\"$(sbindir)\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DTESTDATADIR=\""$(top_srcdir)/data/tests"\" \
- -I$(top_srcdir)/src
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/libgnomesoftware
plugindir = $(libdir)/gs-plugins-${GS_PLUGIN_API_VERSION}
plugin_LTLIBRARIES = \
diff --git a/src/plugins/gs-appstream.c b/src/plugins/gs-appstream.c
index c1f8c54..bfdb20c 100644
--- a/src/plugins/gs-appstream.c
+++ b/src/plugins/gs-appstream.c
@@ -21,8 +21,7 @@
#include "config.h"
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
#include "gs-appstream.h"
diff --git a/src/plugins/gs-appstream.h b/src/plugins/gs-appstream.h
index 386f077..b6ef2a8 100644
--- a/src/plugins/gs-appstream.h
+++ b/src/plugins/gs-appstream.h
@@ -22,9 +22,7 @@
#ifndef __APPSTREAM_COMMON_H
#define __APPSTREAM_COMMON_H
-#include <glib.h>
-#include <gs-plugin.h>
-#include <appstream-glib.h>
+#include <gnome-software.h>
G_BEGIN_DECLS
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 35d5987..1938490 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -20,12 +20,8 @@
*/
#include <config.h>
-#include <glib/gi18n.h>
-#include <appstream-glib.h>
-#include <gs-utils.h>
-#include <gs-plugin.h>
-#include <gs-plugin-loader.h>
+#include <gnome-software.h>
#include "gs-appstream.h"
@@ -186,8 +182,8 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
if (items->len == 0) {
g_warning ("No AppStream data, try 'make install-sample-data' in data/");
g_set_error (error,
- GS_PLUGIN_LOADER_ERROR,
- GS_PLUGIN_LOADER_ERROR_FAILED,
+ GS_PLUGIN_ERROR,
+ GS_PLUGIN_ERROR_FAILED,
"No AppStream data found");
return FALSE;
}
diff --git a/src/plugins/gs-plugin-dpkg.c b/src/plugins/gs-plugin-dpkg.c
index 77f43b6..c709c3b 100644
--- a/src/plugins/gs-plugin-dpkg.c
+++ b/src/plugins/gs-plugin-dpkg.c
@@ -22,9 +22,7 @@
#include <config.h>
#include <stdlib.h>
-
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
#define DPKG_DEB_BINARY "/usr/bin/dpkg-deb"
diff --git a/src/plugins/gs-plugin-dummy.c b/src/plugins/gs-plugin-dummy.c
index a07ba7b..2d3ff08 100644
--- a/src/plugins/gs-plugin-dummy.c
+++ b/src/plugins/gs-plugin-dummy.c
@@ -21,7 +21,7 @@
#include <config.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-epiphany.c b/src/plugins/gs-plugin-epiphany.c
index a4c77d0..e415d5b 100644
--- a/src/plugins/gs-plugin-epiphany.c
+++ b/src/plugins/gs-plugin-epiphany.c
@@ -24,11 +24,7 @@
#define _GNU_SOURCE
#include <string.h>
-#include <glib/gi18n.h>
-#include <libsoup/soup.h>
-
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-fedora-distro-upgrades.c b/src/plugins/gs-plugin-fedora-distro-upgrades.c
index 082f824..9b821cd 100644
--- a/src/plugins/gs-plugin-fedora-distro-upgrades.c
+++ b/src/plugins/gs-plugin-fedora-distro-upgrades.c
@@ -22,10 +22,7 @@
#include <config.h>
#include <json-glib/json-glib.h>
-
-#include <gs-plugin.h>
-#include <gs-os-release.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
#define FEDORA_PKGDB_COLLECTIONS_API_URI "https://admin.fedoraproject.org/pkgdb/api/collections/"
diff --git a/src/plugins/gs-plugin-fedora-tagger-usage.c b/src/plugins/gs-plugin-fedora-tagger-usage.c
index 7a96f9f..0be547e 100644
--- a/src/plugins/gs-plugin-fedora-tagger-usage.c
+++ b/src/plugins/gs-plugin-fedora-tagger-usage.c
@@ -24,9 +24,7 @@
#include <string.h>
#include <sqlite3.h>
#include <stdlib.h>
-
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-fwupd.c b/src/plugins/gs-plugin-fwupd.c
index 43aa785..0a3ea1e 100644
--- a/src/plugins/gs-plugin-fwupd.c
+++ b/src/plugins/gs-plugin-fwupd.c
@@ -22,15 +22,12 @@
#include <config.h>
#include <fwupd.h>
-#include <appstream-glib.h>
#include <fcntl.h>
#include <gio/gio.h>
#include <gio/gunixfdlist.h>
#include <glib/gstdio.h>
-#include <gs-plugin.h>
-
-#include "gs-utils.h"
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-hardcoded-blacklist.c b/src/plugins/gs-plugin-hardcoded-blacklist.c
index 85103b0..554caec 100644
--- a/src/plugins/gs-plugin-hardcoded-blacklist.c
+++ b/src/plugins/gs-plugin-hardcoded-blacklist.c
@@ -20,8 +20,9 @@
*/
#include <config.h>
+
#include <fnmatch.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-icons.c b/src/plugins/gs-plugin-icons.c
index e7fd022..43f7ab0 100644
--- a/src/plugins/gs-plugin-icons.c
+++ b/src/plugins/gs-plugin-icons.c
@@ -24,10 +24,7 @@
#define _GNU_SOURCE
#include <string.h>
-#include <glib/gi18n.h>
-
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
/*
* SECTION:
@@ -153,7 +150,7 @@ gs_plugin_refine_app (GsPlugin *plugin,
memcpy (found, ".png", 4);
/* create runtime dir and download */
- if (!gs_mkdir_parent (fn, error))
+ if (!gs_utils_mkdir (fn, error))
return FALSE;
if (!gs_plugin_icons_download (plugin, as_icon_get_url (ic), fn, error))
return FALSE;
diff --git a/src/plugins/gs-plugin-key-colors.c b/src/plugins/gs-plugin-key-colors.c
index 30f918c..3089712 100644
--- a/src/plugins/gs-plugin-key-colors.c
+++ b/src/plugins/gs-plugin-key-colors.c
@@ -21,7 +21,7 @@
#include <config.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
/**
* gs_plugin_order_after:
diff --git a/src/plugins/gs-plugin-limba.c b/src/plugins/gs-plugin-limba.c
index 816fa3e..71813e4 100644
--- a/src/plugins/gs-plugin-limba.c
+++ b/src/plugins/gs-plugin-limba.c
@@ -23,8 +23,7 @@
#include <config.h>
#include <limba.h>
-#include <appstream-glib.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-menu-spec-categories.c b/src/plugins/gs-plugin-menu-spec-categories.c
index f3b38bb..f7f3b4c 100644
--- a/src/plugins/gs-plugin-menu-spec-categories.c
+++ b/src/plugins/gs-plugin-menu-spec-categories.c
@@ -21,7 +21,7 @@
#include <config.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
#include <glib/gi18n.h>
#include "menu-spec-common.h"
diff --git a/src/plugins/gs-plugin-menu-spec-refine.c b/src/plugins/gs-plugin-menu-spec-refine.c
index affa9f7..cf10c7d 100644
--- a/src/plugins/gs-plugin-menu-spec-refine.c
+++ b/src/plugins/gs-plugin-menu-spec-refine.c
@@ -21,7 +21,7 @@
#include <config.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
#include <glib/gi18n.h>
#include "menu-spec-common.h"
diff --git a/src/plugins/gs-plugin-odrs.c b/src/plugins/gs-plugin-odrs.c
index 1a8a661..40f5ac8 100644
--- a/src/plugins/gs-plugin-odrs.c
+++ b/src/plugins/gs-plugin-odrs.c
@@ -21,16 +21,10 @@
#include <config.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
#include <json-glib/json-glib.h>
#include <string.h>
-#include "gs-app.h"
-#include "gs-os-release.h"
-#include "gs-plugin.h"
-#include "gs-review.h"
-#include "gs-utils.h"
-
/*
* SECTION:
* Provides review data from the Open Desktop Ratings Serice.
diff --git a/src/plugins/gs-plugin-ostree.c b/src/plugins/gs-plugin-ostree.c
index 8bd4523..8df8473 100644
--- a/src/plugins/gs-plugin-ostree.c
+++ b/src/plugins/gs-plugin-ostree.c
@@ -25,9 +25,7 @@
#include <gio/gio.h>
#include <glib/gstdio.h>
-#include <gs-plugin.h>
-
-#include "gs-utils.h"
+#include <gnome-software.h>
struct GsPluginData {
OstreeRepo *ostree_repo;
diff --git a/src/plugins/gs-plugin-packagekit-history.c b/src/plugins/gs-plugin-packagekit-history.c
index 8686879..52840bc 100644
--- a/src/plugins/gs-plugin-packagekit-history.c
+++ b/src/plugins/gs-plugin-packagekit-history.c
@@ -24,7 +24,7 @@
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
#define GS_PLUGIN_PACKAGEKIT_HISTORY_TIMEOUT 5000 /* ms */
diff --git a/src/plugins/gs-plugin-packagekit-local.c b/src/plugins/gs-plugin-packagekit-local.c
index d4638ac..8dc984f 100644
--- a/src/plugins/gs-plugin-packagekit-local.c
+++ b/src/plugins/gs-plugin-packagekit-local.c
@@ -25,9 +25,7 @@
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
-
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
#include "packagekit-common.h"
diff --git a/src/plugins/gs-plugin-packagekit-offline.c b/src/plugins/gs-plugin-packagekit-offline.c
index d756c2c..85c7653 100644
--- a/src/plugins/gs-plugin-packagekit-offline.c
+++ b/src/plugins/gs-plugin-packagekit-offline.c
@@ -24,7 +24,7 @@
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-packagekit-origin.c b/src/plugins/gs-plugin-packagekit-origin.c
index ccd8bba..38a6bc5 100644
--- a/src/plugins/gs-plugin-packagekit-origin.c
+++ b/src/plugins/gs-plugin-packagekit-origin.c
@@ -23,9 +23,7 @@
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
-
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
#include "packagekit-common.h"
diff --git a/src/plugins/gs-plugin-packagekit-proxy.c b/src/plugins/gs-plugin-packagekit-proxy.c
index 375f1bc..28699d5 100644
--- a/src/plugins/gs-plugin-packagekit-proxy.c
+++ b/src/plugins/gs-plugin-packagekit-proxy.c
@@ -26,9 +26,7 @@
#include <packagekit-glib2/packagekit.h>
#include <string.h>
#include <gsettings-desktop-schemas/gdesktop-enums.h>
-
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-packagekit-refine.c b/src/plugins/gs-plugin-packagekit-refine.c
index 9f60a54..e19aba0 100644
--- a/src/plugins/gs-plugin-packagekit-refine.c
+++ b/src/plugins/gs-plugin-packagekit-refine.c
@@ -23,10 +23,7 @@
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
-
-#include <gs-plugin.h>
-#include <gs-utils.h>
-#include <glib/gi18n.h>
+#include <gnome-software.h>
#include "gs-markdown.h"
#include "packagekit-common.h"
diff --git a/src/plugins/gs-plugin-packagekit-refresh.c b/src/plugins/gs-plugin-packagekit-refresh.c
index 5152cc9..266bb2c 100644
--- a/src/plugins/gs-plugin-packagekit-refresh.c
+++ b/src/plugins/gs-plugin-packagekit-refresh.c
@@ -23,10 +23,7 @@
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
-#include <glib/gi18n.h>
-
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
#include "packagekit-common.h"
diff --git a/src/plugins/gs-plugin-packagekit-upgrade.c b/src/plugins/gs-plugin-packagekit-upgrade.c
index 6d231c5..0759e01 100644
--- a/src/plugins/gs-plugin-packagekit-upgrade.c
+++ b/src/plugins/gs-plugin-packagekit-upgrade.c
@@ -24,7 +24,7 @@
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
#include "packagekit-common.h"
diff --git a/src/plugins/gs-plugin-packagekit.c b/src/plugins/gs-plugin-packagekit.c
index e549c32..4c8a767 100644
--- a/src/plugins/gs-plugin-packagekit.c
+++ b/src/plugins/gs-plugin-packagekit.c
@@ -23,9 +23,8 @@
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
-#include <glib/gi18n.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
#include "packagekit-common.h"
diff --git a/src/plugins/gs-plugin-provenance-license.c b/src/plugins/gs-plugin-provenance-license.c
index ec59c6f..0094c86 100644
--- a/src/plugins/gs-plugin-provenance-license.c
+++ b/src/plugins/gs-plugin-provenance-license.c
@@ -22,8 +22,7 @@
#include <config.h>
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-provenance.c b/src/plugins/gs-plugin-provenance.c
index 8b1ef72..0070ee4 100644
--- a/src/plugins/gs-plugin-provenance.c
+++ b/src/plugins/gs-plugin-provenance.c
@@ -21,8 +21,7 @@
#include <config.h>
-#include <gs-plugin.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-rpm.c b/src/plugins/gs-plugin-rpm.c
index b29715e..872699f 100644
--- a/src/plugins/gs-plugin-rpm.c
+++ b/src/plugins/gs-plugin-rpm.c
@@ -26,7 +26,7 @@
#include <rpm/rpmlib.h>
#include <rpm/rpmts.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
/**
* gs_plugin_order_after:
diff --git a/src/plugins/gs-plugin-shell-extensions.c b/src/plugins/gs-plugin-shell-extensions.c
index 208af11..d59f449 100644
--- a/src/plugins/gs-plugin-shell-extensions.c
+++ b/src/plugins/gs-plugin-shell-extensions.c
@@ -24,9 +24,7 @@
#include <errno.h>
#include <json-glib/json-glib.h>
-#include <gs-plugin.h>
-#include <gs-os-release.h>
-#include <gs-utils.h>
+#include <gnome-software.h>
#define SHELL_EXTENSIONS_API_URI "https://extensions.gnome.org/"
@@ -699,7 +697,7 @@ gs_plugin_refresh (GsPlugin *plugin,
}
/* save to disk */
- if (!gs_mkdir_parent (fn, error))
+ if (!gs_utils_mkdir (fn, error))
return FALSE;
g_debug ("saving to %s", fn);
return as_store_to_file (store, file,
diff --git a/src/plugins/gs-plugin-steam.c b/src/plugins/gs-plugin-steam.c
index 58465d5..bb5f2cd 100644
--- a/src/plugins/gs-plugin-steam.c
+++ b/src/plugins/gs-plugin-steam.c
@@ -21,11 +21,9 @@
#include <config.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
#include <string.h>
-#include "gs-utils.h"
-
#define GS_PLUGIN_STEAM_SCREENSHOT_URI "http://cdn.akamai.steamstatic.com/steam/apps"
/**
@@ -417,7 +415,7 @@ gs_plugin_steam_download_icon (GsPlugin *plugin,
if (!g_file_get_contents (cache_fn, &data, &data_len, error))
return FALSE;
} else {
- if (!gs_mkdir_parent (cache_fn, error))
+ if (!gs_utils_mkdir (cache_fn, error))
return FALSE;
if (!gs_plugin_download_file (plugin,
NULL, /* GsApp */
diff --git a/src/plugins/gs-plugin-systemd-updates.c b/src/plugins/gs-plugin-systemd-updates.c
index 1e819a5..bf1c1a0 100644
--- a/src/plugins/gs-plugin-systemd-updates.c
+++ b/src/plugins/gs-plugin-systemd-updates.c
@@ -20,12 +20,11 @@
*/
#include <config.h>
-#include <gio/gio.h>
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
/*
* SECTION:
diff --git a/src/plugins/gs-plugin-ubuntu-reviews.c b/src/plugins/gs-plugin-ubuntu-reviews.c
index ce0d916..5e038c2 100644
--- a/src/plugins/gs-plugin-ubuntu-reviews.c
+++ b/src/plugins/gs-plugin-ubuntu-reviews.c
@@ -23,14 +23,9 @@
#include <string.h>
#include <math.h>
-#include <libsoup/soup.h>
#include <json-glib/json-glib.h>
#include <sqlite3.h>
-
-#include <gs-plugin.h>
-#include <gs-utils.h>
-
-#include "gs-os-release.h"
+#include <gnome-software.h>
struct GsPluginData {
gchar *db_path;
@@ -382,7 +377,7 @@ load_database (GsPlugin *plugin, GError **error)
g_autoptr(GError) error_local = NULL;
g_debug ("trying to open database '%s'", priv->db_path);
- if (!gs_mkdir_parent (priv->db_path, error))
+ if (!gs_utils_mkdir (priv->db_path, error))
return FALSE;
result = sqlite3_open (priv->db_path, &priv->db);
if (result != SQLITE_OK) {
diff --git a/src/plugins/gs-plugin-xdg-app.c b/src/plugins/gs-plugin-xdg-app.c
index 155881c..d732ca1 100644
--- a/src/plugins/gs-plugin-xdg-app.c
+++ b/src/plugins/gs-plugin-xdg-app.c
@@ -33,11 +33,9 @@
#include <config.h>
#include <xdg-app.h>
-
-#include <gs-plugin.h>
+#include <gnome-software.h>
#include "gs-appstream.h"
-#include "gs-utils.h"
static gboolean gs_plugin_refine_item_metadata (GsPlugin *plugin,
GsApp *app,
diff --git a/src/plugins/packagekit-common.c b/src/plugins/packagekit-common.c
index c3bd09a..91ab368 100644
--- a/src/plugins/packagekit-common.c
+++ b/src/plugins/packagekit-common.c
@@ -24,7 +24,7 @@
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
#include "packagekit-common.h"
diff --git a/src/plugins/packagekit-common.h b/src/plugins/packagekit-common.h
index f8cbdd6..590e416 100644
--- a/src/plugins/packagekit-common.h
+++ b/src/plugins/packagekit-common.h
@@ -23,7 +23,7 @@
#define __APPSTREAM_CACHE_H
#include <glib.h>
-#include <gs-plugin.h>
+#include <gnome-software.h>
#define I_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE
#include <packagekit-glib2/packagekit.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]