├── docs ├── .gitignore ├── sources │ ├── images │ │ ├── appstream-logo.png │ │ ├── architecture.png │ │ ├── architecture-small.png │ │ ├── pure_architecture.png │ │ └── scr-examples │ │ │ ├── geany-good.png │ │ │ ├── xmedcon-bad.png │ │ │ ├── xterm-bad.png │ │ │ ├── xonotic-good.png │ │ │ ├── wireshark-good.png │ │ │ └── gameconqueror-bad.png │ ├── AppStream.ent │ ├── Revision_History.xml │ ├── Manpages.xml │ ├── services │ │ ├── Services.xml │ │ ├── screenshots.xml │ │ └── urihandler.xml │ ├── Legal_Notice.xml │ ├── APIDoc.xml │ ├── collection │ │ ├── CollectionData.xml │ │ └── iconcache.xml │ ├── AppStream.xml │ ├── quickstart │ │ ├── Quickstart.xml │ │ └── packaging.xml │ ├── Author_Group.xml │ ├── Book_Info.xml │ ├── Project_Desc.xml │ └── metainfo │ │ ├── MetaInfo.xml │ │ └── addon.xml ├── publican.cfg └── api │ ├── meson.build │ └── appstream-docs.xml ├── tests ├── lsan.supp ├── samples │ ├── appstream-dxml.xml.gz │ ├── collection │ │ └── xml │ │ │ ├── merges.xml │ │ │ ├── suggestions.xml │ │ │ └── limba_6375db4bb7186c39a4860544884575f7.xml │ ├── os-release-1 │ ├── appdata.xml │ ├── appdata-legacy.xml │ └── appstream-dxml.xml ├── as-test-utils.h ├── ci │ ├── Dockerfile │ └── build_and_test.sh └── test-validate.c ├── contrib ├── vapi │ ├── appstream.deps │ ├── AppStream-1.0.metadata │ ├── AppStream-1.0-custom.vala │ └── meson.build ├── apt-conf │ ├── meson.build │ ├── 60icons-hidpi │ ├── 60icons-large-hidpi │ ├── 60icons-large │ ├── 60icons │ └── 50appstream ├── meson.build └── meson │ └── update-linguas.sh ├── MAINTAINERS ├── .gitignore ├── AUTHORS ├── data ├── desktop-environments.txt ├── its │ ├── metainfo.loc │ └── metainfo.its ├── appstream.conf ├── meson.build ├── org.freedesktop.appstream.cli.metainfo.xml └── xdg-category-names.txt ├── qt ├── tests │ ├── testpaths.h.in │ ├── meson.build │ └── asqt-pool-test.cpp ├── appstreamqt_export.h ├── cmake │ ├── AppStreamQtConfigVersion.cmake.in │ └── AppStreamQtConfig.cmake.in ├── utils.h ├── utils.cpp ├── spdx.h ├── category.h ├── spdx.cpp ├── translation.h ├── launchable.h ├── bundle.h ├── chelpers.h ├── suggested.h ├── provided.h ├── contentrating.h ├── meson.build ├── screenshot.h ├── icon.h └── suggested.cpp ├── po ├── LINGUAS ├── meson.build └── POTFILES.in ├── src ├── appstream.gresource.xml ├── as-tag-yaml.gperf ├── as-provided-private.h ├── as-distro-extras.h ├── as-tag-xml.gperf ├── as-distro-details-private.h ├── as-translation-private.h ├── as-settings-private.h ├── as-desktop-entry.h ├── as-stemmer.h ├── as-icon-private.h ├── as-spdx.h ├── as-pool-private.h ├── as-video-private.h ├── as-issue-private.h ├── as-bundle-private.h ├── as-checksum-private.h ├── as-image-private.h ├── as-launchable-private.h ├── as-artifact-private.h ├── as-suggested-private.h ├── as-utils.h ├── as-relation-private.h ├── as-release-private.h ├── appstream.h ├── as-screenshot-private.h ├── as-content-rating-private.h ├── as-agreement-private.h ├── as-agreement-section-private.h ├── as-distro-details.h ├── as-checksum.h ├── as-news-convert.h ├── as-issue.h ├── as-translation.h ├── as-validator.h ├── as-suggested.h ├── as-bundle.h ├── as-agreement-section.h ├── as-image.h ├── as-launchable.h ├── as-xml.h └── as-category.h ├── tools ├── meson.build ├── ascli-actions-pkgmgr.h ├── ascli-actions-misc.h ├── ascli-actions-validate.h ├── ascli-utils.h └── ascli-actions-mdata.h ├── .travis.yml ├── config.h.in ├── meson_options.txt ├── RELEASE └── release.sh /docs/.gitignore: -------------------------------------------------------------------------------- 1 | html/ 2 | -------------------------------------------------------------------------------- /tests/lsan.supp: -------------------------------------------------------------------------------- 1 | leak:libxml2.so 2 | -------------------------------------------------------------------------------- /contrib/vapi/appstream.deps: -------------------------------------------------------------------------------- 1 | gio-2.0 2 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | Matthias Klumpp 2 | E-mail: matthias@tenstral.net 3 | -------------------------------------------------------------------------------- /contrib/vapi/AppStream-1.0.metadata: -------------------------------------------------------------------------------- 1 | // Metadata for AppStream GIR 2 | 3 | AppStream name="AppStream" 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.bak 3 | *.o 4 | *.so 5 | *.user 6 | *.pc 7 | *.cache 8 | build 9 | Makefile 10 | .directory 11 | -------------------------------------------------------------------------------- /tests/samples/appstream-dxml.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/tests/samples/appstream-dxml.xml.gz -------------------------------------------------------------------------------- /docs/sources/images/appstream-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/docs/sources/images/appstream-logo.png -------------------------------------------------------------------------------- /docs/sources/images/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/docs/sources/images/architecture.png -------------------------------------------------------------------------------- /contrib/apt-conf/meson.build: -------------------------------------------------------------------------------- 1 | # Meson definition for apt-conf 2 | 3 | install_data ('50appstream', install_dir: '/etc/apt/apt.conf.d/') 4 | -------------------------------------------------------------------------------- /docs/sources/images/architecture-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/docs/sources/images/architecture-small.png -------------------------------------------------------------------------------- /docs/sources/images/pure_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/docs/sources/images/pure_architecture.png -------------------------------------------------------------------------------- /docs/sources/images/scr-examples/geany-good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/docs/sources/images/scr-examples/geany-good.png -------------------------------------------------------------------------------- /docs/sources/images/scr-examples/xmedcon-bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/docs/sources/images/scr-examples/xmedcon-bad.png -------------------------------------------------------------------------------- /docs/sources/images/scr-examples/xterm-bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/docs/sources/images/scr-examples/xterm-bad.png -------------------------------------------------------------------------------- /docs/sources/images/scr-examples/xonotic-good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/docs/sources/images/scr-examples/xonotic-good.png -------------------------------------------------------------------------------- /docs/sources/AppStream.ent: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/sources/images/scr-examples/wireshark-good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/docs/sources/images/scr-examples/wireshark-good.png -------------------------------------------------------------------------------- /docs/sources/images/scr-examples/gameconqueror-bad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/appstream/master/docs/sources/images/scr-examples/gameconqueror-bad.png -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Matthias Klumpp 2 | 3 | Sune Vuorela 4 | Richard Hughes 5 | Igor Gnatenko 6 | -------------------------------------------------------------------------------- /data/desktop-environments.txt: -------------------------------------------------------------------------------- 1 | # List of desktop environments 2 | GNOME 3 | KDE 4 | Plasma 5 | LXDE 6 | LXQt 7 | MATE 8 | Razor 9 | ROX 10 | Unity 11 | XFCE 12 | EDE 13 | Cinnamon 14 | Pantheon 15 | -------------------------------------------------------------------------------- /qt/tests/testpaths.h.in: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __TEST_DATAPATHS_H 3 | #define __TEST_DATAPATHS_H 4 | 5 | #define AS_SAMPLE_DATA_PATH "@CMAKE_SOURCE_DIR@/tests/samples/collection" 6 | 7 | #endif // __TEST_DATAPATHS_H 8 | -------------------------------------------------------------------------------- /contrib/meson.build: -------------------------------------------------------------------------------- 1 | # Meson definition for AppStream contrib 2 | 3 | if get_option('vapi') and get_option('gir') 4 | subdir('vapi/') 5 | endif 6 | if get_option('apt-support') 7 | subdir('apt-conf/') 8 | endif 9 | -------------------------------------------------------------------------------- /contrib/meson/update-linguas.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | find ${MESON_SOURCE_ROOT}/po \ 4 | -type f \ 5 | -iname "*.po" \ 6 | -printf '%f\n' \ 7 | | grep -oP '.*(?=[.])' | sort \ 8 | > ${MESON_SOURCE_ROOT}/po/LINGUAS 9 | -------------------------------------------------------------------------------- /docs/publican.cfg: -------------------------------------------------------------------------------- 1 | xml_lang: "en-US" 2 | type: Book 3 | brand: common 4 | doc_url: http://www.freedesktop.org/software/appstream/docs/ 5 | prod_url: http://www.freedesktop.org/wiki/Distributions/AppStream/ 6 | toc_section_depth: 1 7 | chunk_section_depth: 1 8 | -------------------------------------------------------------------------------- /tests/samples/collection/xml/merges.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.example.DeleteMe 5 | 6 | 7 | -------------------------------------------------------------------------------- /tests/samples/os-release-1: -------------------------------------------------------------------------------- 1 | PRETTY_NAME="Debian GNU/Linux buster/sid" 2 | NAME="Debian GNU/Linux" 3 | ID=debian 4 | HOME_URL="https://www.debian.org/" 5 | SUPPORT_URL="https://www.debian.org/support" 6 | BUG_REPORT_URL="https://bugs.debian.org/" 7 | VERSION_ID=10.0 8 | -------------------------------------------------------------------------------- /contrib/vapi/AppStream-1.0-custom.vala: -------------------------------------------------------------------------------- 1 | namespace AppStream { 2 | [CCode (cheader_filename = "appstream.h", cprefix = "AS_PROVIDED_KIND_", has_type_id = false)] 3 | public enum ProvidedKind { 4 | [Version (deprecated = true, replacement = "MEDIATYPE")] 5 | MIMETYPE 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | ar 2 | ca 3 | ckb 4 | cs 5 | da 6 | de 7 | en_GB 8 | es 9 | eu 10 | fi 11 | fr 12 | gd 13 | gl 14 | hu 15 | id 16 | it 17 | ja 18 | ko 19 | lt 20 | nb 21 | nl 22 | oc 23 | pl 24 | pt 25 | pt_BR 26 | ru 27 | sk 28 | sl 29 | sr 30 | sr@latin 31 | sv 32 | tr 33 | uk 34 | zh_CN 35 | zh_TW 36 | -------------------------------------------------------------------------------- /contrib/apt-conf/60icons-hidpi: -------------------------------------------------------------------------------- 1 | ## This file enables the download of 64x64px icons 2 | ## suitable for HiDPI displays for use in software 3 | ## centers like GNOME Software and Plasma Discover. 4 | 5 | Acquire::IndexTargets { 6 | deb::DEP-11-icons-hidpi { 7 | DefaultEnabled "true"; 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /contrib/apt-conf/60icons-large-hidpi: -------------------------------------------------------------------------------- 1 | ## This file enables the download of 128x128px icons 2 | ## suitable for HiDPI displays for use in software 3 | ## centers like GNOME Software and Plasma Discover. 4 | 5 | Acquire::IndexTargets { 6 | deb::DEP-11-icons-hidpi { 7 | DefaultEnabled "true"; 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /contrib/vapi/meson.build: -------------------------------------------------------------------------------- 1 | # Meson definition for AppStream VAPI 2 | 3 | glib.generate_vapi ('appstream', 4 | sources: [as_gir, 'AppStream-1.0-custom.vala'], 5 | packages: ['glib-2.0', 6 | 'gio-2.0', 7 | 'gobject-2.0'], 8 | install: true, 9 | metadata_dirs: ['.'], 10 | vapi_dirs: ['.'] 11 | ) 12 | -------------------------------------------------------------------------------- /src/appstream.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | xdg-category-names.txt 5 | iana-filtered-tld-list.txt 6 | spdx-license-ids.txt 7 | desktop-environments.txt 8 | 9 | 10 | -------------------------------------------------------------------------------- /data/its/metainfo.loc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /contrib/apt-conf/60icons-large: -------------------------------------------------------------------------------- 1 | ## This file enables the download of large 128x128px 2 | ## icons for use in software centers like GNOME Software 3 | ## and Plasma Discover. 4 | ## 5 | ## The icons speed up usage of the software centers, 6 | ## and would otherwise be downloaded on-deman for each user. 7 | 8 | Acquire::IndexTargets { 9 | deb::DEP-11-icons-large { 10 | DefaultEnabled "true"; 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /tests/as-test-utils.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __AS_TEST_UTILS_H 3 | #define __AS_TEST_UTILS_H 4 | 5 | #include 6 | #include 7 | 8 | G_BEGIN_DECLS 9 | 10 | gboolean as_test_compare_lines (const gchar *txt1, 11 | const gchar *txt2); 12 | 13 | void as_component_sort_values (AsComponent *cpt); 14 | void as_sort_components (GPtrArray *cpts); 15 | 16 | G_END_DECLS 17 | 18 | #endif /* __AS_TEST_UTILS_H */ 19 | -------------------------------------------------------------------------------- /docs/sources/Revision_History.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 | Revision History 8 | 9 | 10 | 11 | 0.0-0 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /contrib/apt-conf/60icons: -------------------------------------------------------------------------------- 1 | ## This file enables the download of small-size 64x64px 2 | ## icons for use in software centers like GNOME Software 3 | ## and Plasma Discover. 4 | ## 5 | ## The icons are required for software centers to function 6 | ## correctly. Applications without an icon will not be 7 | ## displayed at all. 8 | 9 | Acquire::IndexTargets { 10 | deb::DEP-11-icons-small { 11 | DefaultEnabled "true"; 12 | }; 13 | deb::DEP-11-icons { 14 | DefaultEnabled "true"; 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /docs/sources/Manpages.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 | 8 | Manual pages 9 | 10 | 11 | Manpages are available at the API documentation. 12 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tools/meson.build: -------------------------------------------------------------------------------- 1 | # Meson definition for appstreamcli 2 | 3 | ascli_src = [ 4 | 'appstream-cli.c', 5 | 'ascli-utils.c', 6 | 'ascli-actions-pkgmgr.c', 7 | 'ascli-actions-validate.c', 8 | 'ascli-actions-mdata.c', 9 | 'ascli-actions-misc.c' 10 | ] 11 | 12 | ascli_exe = executable('appstreamcli', 13 | [ascli_src], 14 | dependencies: [glib_dep, 15 | gobject_dep, 16 | gio_dep], 17 | link_with: [appstream_lib], 18 | include_directories: [appstream_lib_inc, 19 | include_directories ('..')], 20 | install: true 21 | ) 22 | -------------------------------------------------------------------------------- /docs/sources/services/Services.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 | Services 8 | 9 | AppStream provides some services to fetch additional data from. 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/sources/Legal_Notice.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Copyright &YEAR; Matthias Klumpp. This material may only be distributed subject to the terms and conditions set 7 | forth in the GNU Free Documentation License (GFDL), V1.2 with no invariant sections or later (the latest version is presently available at 8 | http://www.gnu.org/licenses/fdl.txt). 9 | 10 | 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Travis CI config for AppStream 2 | 3 | language: c 4 | sudo: required 5 | dist: trusty 6 | 7 | services: 8 | - docker 9 | 10 | compiler: 11 | - gcc 12 | #- clang -- Fails to compile GIR: clang: error: unknown argument: '-fdebug-prefix-map=..' (likely needs newer clang) 13 | 14 | before_script: 15 | - docker build -t appstream -f tests/ci/Dockerfile . 16 | - if [ "$CC" = "clang" ]; then export CVENDOR="clang" CXX="clang" CC="clang"; fi 17 | - if [ "$CC" = "gcc" ]; then export CVENDOR="gcc" CXX="g++" CC="gcc"; fi 18 | 19 | script: 20 | - docker run -t -e COMPILER_VENDOR=$CVENDOR -e CC=$CC -e CXX=$CXX --env-file <(env) -v `pwd`:/build appstream 21 | ./tests/ci/build_and_test.sh 22 | -------------------------------------------------------------------------------- /tests/samples/collection/xml/suggestions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | links2.desktop 5 | 6 | org.example.test1 7 | org.example.test2 8 | 9 | 10 | 11 | kiki.desktop 12 | Kiki (name changed by merge) 13 | 14 | 15 | literki.desktop 16 | 17 | org.example.test3 18 | org.example.test4 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/ci/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Docker file for AppStream CI tests 3 | # 4 | FROM debian:testing 5 | 6 | # prepare 7 | RUN apt-get update -qq 8 | 9 | # install build essentials 10 | RUN apt-get install -yq gcc g++ clang 11 | 12 | # install build dependencies 13 | RUN apt-get install -yq --no-install-recommends \ 14 | meson \ 15 | ninja-build \ 16 | gettext \ 17 | itstool \ 18 | libglib2.0-dev \ 19 | libxml2-dev \ 20 | libyaml-dev \ 21 | liblmdb-dev \ 22 | gtk-doc-tools \ 23 | libgirepository1.0-dev \ 24 | qt5-default \ 25 | xmlto \ 26 | publican \ 27 | gobject-introspection \ 28 | libstemmer-dev \ 29 | gperf \ 30 | valac \ 31 | wget \ 32 | curl 33 | 34 | # finish 35 | RUN mkdir /build 36 | WORKDIR /build 37 | -------------------------------------------------------------------------------- /qt/tests/meson.build: -------------------------------------------------------------------------------- 1 | # Meson definition for AppStream Qt Tests 2 | 3 | qt5_test_dep = dependency('qt5', modules: ['Core', 'Test']) 4 | 5 | testpaths_h = configuration_data() 6 | testpaths_h.set_quoted('AS_SAMPLE_DATA_PATH', join_paths(source_root, 'tests', 'samples', 'collection')) 7 | configure_file (output: 'testpaths.h', configuration: testpaths_h) 8 | 9 | asqt_test_src = [ 10 | 'asqt-pool-test.cpp' 11 | ] 12 | 13 | asqt_test_moc = qt.preprocess (moc_sources: asqt_test_src) 14 | 15 | as_test_qt_exe = executable ('as-test_qt', 16 | [asqt_test_src, 17 | asqt_test_moc], 18 | dependencies: [qt5_test_dep], 19 | include_directories: [include_directories('..')], 20 | link_with: [appstreamqt_lib], 21 | cpp_args: asqt_cpp_args 22 | ) 23 | test ('as-test_qt', 24 | as_test_qt_exe, 25 | env: as_test_env 26 | ) 27 | -------------------------------------------------------------------------------- /docs/sources/APIDoc.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | ]> 7 | 8 | 9 | AppStream API Reference 10 | 11 | 12 | A reference of AppStream's public API can be fount on the 13 | API reference pages. 14 | 15 | 16 | If you want to use the PackageKit API, look at 17 | the PackageKit reference manual. 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /data/appstream.conf: -------------------------------------------------------------------------------- 1 | # 2 | # This is the configuration file for AppStream. 3 | # If data for your distribution is missing, you can submit 4 | # a patch to include it upstream. 5 | # The distribution identifier is fetched from /etc/os-release 6 | # 7 | 8 | [general] 9 | 10 | # 11 | # Set this value to have AppStream always prefer data from a local metainfo file 12 | # over data provided from a network source. 13 | # This option is only useful in case one wants to test how data from local 14 | # metainfo files looks like in the software center prior to making a release 15 | # containing the new metadata. 16 | # 17 | #PreferLocalMetainfoData=true 18 | 19 | # 20 | # Distribution specific settings 21 | # 22 | [debian] 23 | ScreenshotUrl=http://screenshots.debian.net 24 | 25 | [opensuse] 26 | ScreenshotUrl=http://software.opensuse.org/package 27 | 28 | [ubuntu] 29 | ScreenshotUrl=http://screenshots.ubuntu.com 30 | -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | 2 | as_gettext_domain = 'appstream' 3 | i18n.gettext (as_gettext_domain, 4 | preset : 'glib', 5 | data_dirs: ['../data/its'], 6 | args: [ 7 | '--default-domain=' + as_gettext_domain, 8 | '--from-code=UTF-8', 9 | '-i', '-s', '--no-wrap', '-c', 10 | '--package-name=' + as_gettext_domain, 11 | '--copyright-holder=Matthias Klumpp', 12 | '--msgid-bugs-address=appstream@lists.freedesktop.org' 13 | ] 14 | ) 15 | 16 | run_target ('make-linguas', 17 | command: ['sh', 18 | join_paths(meson.source_root(), 'contrib/meson/update-linguas.sh')] 19 | ) 20 | 21 | # maintainer shortcut for updating l10n data 22 | run_target ('l10n-update', 23 | command: ['ninja', '-C', meson.build_root(), 24 | 'make-linguas', 25 | as_gettext_domain + '-pot', 26 | as_gettext_domain + '-update-po'] 27 | ) 28 | -------------------------------------------------------------------------------- /docs/sources/collection/CollectionData.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 | Collection Metadata 8 | 9 | Additionally to the metainfo files shipped by upstream projects, AppStream also provides an XML and YAML format 10 | to make information about not installed software components known to the system. 11 | 12 | 13 | This chapter documents this collection metadata format and icon cache used on the client side. 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files containing translatable strings. 2 | # 3 | # data 4 | data/org.freedesktop.appstream.cli.metainfo.xml 5 | # library sources 6 | src/as-agreement.c 7 | src/as-agreement-section.c 8 | src/as-bundle.c 9 | src/as-cache.c 10 | src/as-category.c 11 | src/as-checksum.c 12 | src/as-component.c 13 | src/as-desktop-entry.c 14 | src/as-distro-details.c 15 | src/as-distro-extras.c 16 | src/as-enums.c 17 | src/as-image.c 18 | src/as-issue.c 19 | src/as-metadata.c 20 | src/as-news-convert.c 21 | src/as-pool.c 22 | src/as-provided.c 23 | src/as-relation.c 24 | src/as-release.c 25 | src/as-screenshot.c 26 | src/as-suggested.c 27 | src/as-tag.c 28 | src/as-translation.c 29 | src/as-utils.c 30 | src/as-validator.c 31 | src/as-validator-issue.c 32 | src/as-validator-issue-tag.h 33 | src/as-video.c 34 | src/as-xml.c 35 | src/as-yaml.c 36 | # tool sources 37 | tools/appstream-cli.c 38 | tools/ascli-utils.c 39 | tools/ascli-actions-mdata.c 40 | tools/ascli-actions-pkgmgr.c 41 | tools/ascli-actions-validate.c 42 | tools/ascli-actions-misc.c 43 | -------------------------------------------------------------------------------- /docs/sources/AppStream.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | 6 | ]> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/sources/quickstart/Quickstart.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 | Metadata Quickstart 8 | 9 | These pages are designed to give upstream authors compressed information on how to write metadata 10 | for their applications. 11 | The documents describe just the basic information, and don't resemble the whole specification, to 12 | give upstreams an easy way to get started with AppStream. 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | # Meson definition for AppStream data 2 | 3 | install_data ('its/metainfo.its', install_dir: 'share/gettext/its') 4 | install_data ('its/metainfo.loc', install_dir: 'share/gettext/its') 5 | 6 | # NOTE: We do not translate the release notes on purpose here. 7 | # If you do want to give translators a chance to translate them, 8 | # ascli news-to-metainfo needs to produce a temporary file to translate 9 | # prior to running (x)gettext on the file. 10 | metainfo_with_relinfo = custom_target('gen-output', 11 | input : ['../NEWS', 'org.freedesktop.appstream.cli.metainfo.xml'], 12 | output : ['nol10n_withrelinfo_org.freedesktop.appstream.cli.metainfo.xml'], 13 | command : [ascli_exe, 'news-to-metainfo', '--limit=6', '@INPUT0@', '@INPUT1@', '@OUTPUT@'] 14 | ) 15 | 16 | i18n.merge_file ( 17 | input: metainfo_with_relinfo, 18 | output: 'org.freedesktop.appstream.cli.metainfo.xml', 19 | type: 'xml', 20 | data_dirs: [meson.current_source_dir()], 21 | po_dir: join_paths (source_root, 'po'), 22 | install: true, 23 | install_dir: join_paths (get_option ('datadir'), 'metainfo') 24 | ) 25 | 26 | install_data ('appstream.conf', install_dir: '/etc') 27 | -------------------------------------------------------------------------------- /docs/sources/Author_Group.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 | 8 | Matthias 9 | Klumpp 10 | 11 | Debian 12 | 13 | mak@debian.org 14 | 15 | 16 | Michael 17 | Vogt 18 | 19 | Canonical / Ubuntu / Debian 20 | 21 | mvo@ubuntu.com 22 | 23 | 24 | Richard 25 | Hughes 26 | 27 | Fedora / Red Hat 28 | 29 | richard@hughsie.com 30 | 31 | 32 | Vincent 33 | Untz 34 | 35 | OpenSUSE 36 | 37 | vuntz@opensuse.org 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/its/metainfo.its: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 9 | 18 | 19 | 21 | 23 | 24 | -------------------------------------------------------------------------------- /qt/appstreamqt_export.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef APPSTREAMQT_EXPORT_H 3 | #define APPSTREAMQT_EXPORT_H 4 | 5 | #ifdef APPSTREAMQT_STATIC_DEFINE 6 | # define APPSTREAMQT_EXPORT 7 | # define APPSTREAMQT_NO_EXPORT 8 | #else 9 | # ifndef APPSTREAMQT_EXPORT 10 | # ifdef AppStreamQt_EXPORTS 11 | /* We are building this library */ 12 | # define APPSTREAMQT_EXPORT __attribute__((visibility("default"))) 13 | # else 14 | /* We are using this library */ 15 | # define APPSTREAMQT_EXPORT __attribute__((visibility("default"))) 16 | # endif 17 | # endif 18 | 19 | # ifndef APPSTREAMQT_NO_EXPORT 20 | # define APPSTREAMQT_NO_EXPORT __attribute__((visibility("hidden"))) 21 | # endif 22 | #endif 23 | 24 | #ifndef APPSTREAMQT_DEPRECATED 25 | # define APPSTREAMQT_DEPRECATED __attribute__ ((__deprecated__)) 26 | #endif 27 | 28 | #ifndef APPSTREAMQT_DEPRECATED_EXPORT 29 | # define APPSTREAMQT_DEPRECATED_EXPORT APPSTREAMQT_EXPORT APPSTREAMQT_DEPRECATED 30 | #endif 31 | 32 | #ifndef APPSTREAMQT_DEPRECATED_NO_EXPORT 33 | # define APPSTREAMQT_DEPRECATED_NO_EXPORT APPSTREAMQT_NO_EXPORT APPSTREAMQT_DEPRECATED 34 | #endif 35 | 36 | #if 0 /* DEFINE_NO_DEPRECATED */ 37 | # ifndef APPSTREAMQT_NO_DEPRECATED 38 | # define APPSTREAMQT_NO_DEPRECATED 39 | # endif 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /docs/api/meson.build: -------------------------------------------------------------------------------- 1 | # Meson definition for AppStream API Documentation 2 | 3 | as_api_doc_target_dir = join_paths(as_doc_target_dir, 'html', 'api') 4 | 5 | glib.gtkdoc ( 6 | 'appstream', 7 | src_dir: join_paths(source_root, 'src'), 8 | main_xml: 'appstream-docs.xml', 9 | ignore_headers: aslib_priv_headers, 10 | install: true, 11 | install_dir: join_paths(get_option('prefix'), as_api_doc_target_dir), # requires an absolute path 12 | content_files: ['../sources/man/appstreamcli.1.xml'] 13 | ) 14 | 15 | # create symlink, so tools using gtk-doc can find the API documentation, without us 16 | # duplicating the data in two places. 17 | # We hardcore the gtk-doc path here, because gtkdoc_html_dir('appstream') creates a 18 | # wrong path due to a Meson bug at the moment 19 | # This code sucks until Meson gains the install_symlink command proposed by the systemd guys 20 | gtk_doc_root = join_paths(get_option('prefix'), get_option('datadir'), 'gtk-doc', 'html') 21 | meson.add_install_script ('sh', '-c', 22 | 'mkdir -p $DESTDIR@0@ && ln -sf ../../../@1@ $DESTDIR/@2@' 23 | .format(gtk_doc_root, 24 | as_api_doc_target_dir, 25 | join_paths(gtk_doc_root, 'appstream')) 26 | ) 27 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 3 | 4 | /* always defined to indicate that i18n is enabled */ 5 | #define ENABLE_NLS 1 6 | 7 | /* Gettext Package */ 8 | #define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@" 9 | 10 | /* Paths */ 11 | #define LOCALEDIR "@CMAKE_INSTALL_FULL_LOCALEDIR@" 12 | #define PKGLIBDIR "@CMAKE_INSTALL_FULL_LIBEXECDIR@/appstream" 13 | #define PREFIXDIR "@CMAKE_INSTALL_PREFIX@" 14 | #define DATADIR "@CMAKE_INSTALL_FULL_DATADIR@" 15 | #define LIBDIR "@CMAKE_INSTALL_FULL_LIBDIR@" 16 | #define BUILDDIR "@CMAKE_BINARY_DIR@" 17 | 18 | /* Define if the GNU gettext() function is already present or preinstalled. */ 19 | #define HAVE_GETTEXT 1 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #define HAVE_INTTYPES_H 1 23 | 24 | /* Define if your file defines LC_MESSAGES. */ 25 | #define HAVE_LC_MESSAGES 1 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #define HAVE_LOCALE_H 1 29 | 30 | /* Define to the version of this package. */ 31 | #define PACKAGE_VERSION "@VERSION@" 32 | 33 | /* Version number of package */ 34 | #define VERSION "@VERSION@" 35 | 36 | /* Set if we have APT support */ 37 | #cmakedefine HAVE_APT_SUPPORT 38 | 39 | /* Set if we have stemming support */ 40 | #cmakedefine HAVE_STEMMING 41 | 42 | #endif /* CONFIG_H */ 43 | -------------------------------------------------------------------------------- /tools/ascli-actions-pkgmgr.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2015-2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU General Public License Version 2 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 2 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef __ASCLI_ACTIONS_PKGMGR_H 22 | #define __ASCLI_ACTIONS_PKGMGR_H 23 | 24 | #include 25 | #include "appstream.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | int ascli_install_component (const gchar *identifier); 30 | int ascli_remove_component (const gchar *identifier); 31 | 32 | G_END_DECLS 33 | 34 | #endif /* __ASCLI_ACTIONS_PKGMGR_H */ 35 | -------------------------------------------------------------------------------- /qt/cmake/AppStreamQtConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | # This is a basic version file for the Config-mode of find_package(). 2 | # It is used by write_basic_package_version_file() as input file for configure_file() 3 | # to create a version-file which can be installed along a config.cmake file. 4 | # 5 | # The created file sets PACKAGE_VERSION_EXACT if the current version string and 6 | # the requested version string are exactly the same and it sets 7 | # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, 8 | # but only if the requested major version is the same as the current one. 9 | # The variable CVF_VERSION must be set before calling configure_file(). 10 | 11 | set(PACKAGE_VERSION "@VERSION@") 12 | 13 | if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) 14 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 15 | else() 16 | 17 | if("@VERSION@" MATCHES "^([0-9]+)\\.") 18 | set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") 19 | else() 20 | set(CVF_VERSION_MAJOR "@VERSION@") 21 | endif() 22 | 23 | if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) 24 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 25 | else() 26 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 27 | endif() 28 | 29 | if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) 30 | set(PACKAGE_VERSION_EXACT TRUE) 31 | endif() 32 | endif() 33 | -------------------------------------------------------------------------------- /src/as-tag-yaml.gperf: -------------------------------------------------------------------------------- 1 | %language=ANSI-C 2 | %enum 3 | %define hash-function-name _as_yaml_tag_hash 4 | %define lookup-function-name _as_yaml_tag_from_gperf 5 | %define string-pool-name yaml_tag_stringpool 6 | %readonly-tables 7 | %includes 8 | %pic 9 | %struct-type 10 | struct yaml_tag_data { int name; unsigned int etag; }; 11 | %% 12 | Type, AS_TAG_TYPE 13 | Priority, AS_TAG_PRIORITY 14 | Merge, AS_TAG_MERGE 15 | ID, AS_TAG_ID 16 | Package, AS_TAG_PKGNAME 17 | SourcePackage, AS_TAG_SOURCE_PKGNAME 18 | Name, AS_TAG_NAME 19 | Summary, AS_TAG_SUMMARY 20 | Description, AS_TAG_DESCRIPTION 21 | Icon, AS_TAG_ICON 22 | Url, AS_TAG_URL 23 | Categories, AS_TAG_CATEGORIES 24 | Keywords, AS_TAG_KEYWORDS 25 | Provides, AS_TAG_PROVIDES 26 | Screenshots, AS_TAG_SCREENSHOTS 27 | MetadataLicense, AS_TAG_METADATA_LICENSE 28 | ProjectLicense, AS_TAG_PROJECT_LICENSE 29 | ProjectGroup, AS_TAG_PROJECT_GROUP 30 | DeveloperName, AS_TAG_DEVELOPER_NAME 31 | CompulsoryForDesktops, AS_TAG_COMPULSORY_FOR_DESKTOP 32 | Releases, AS_TAG_RELEASES 33 | Extends, AS_TAG_EXTENDS 34 | Languages, AS_TAG_LANGUAGES 35 | Launchable, AS_TAG_LAUNCHABLE 36 | Bundles, AS_TAG_BUNDLE 37 | Suggests, AS_TAG_SUGGESTS 38 | Custom, AS_TAG_CUSTOM 39 | ContentRating, AS_TAG_CONTENT_RATING 40 | Recommends, AS_TAG_RECOMMENDS 41 | Requires, AS_TAG_REQUIRES 42 | Agreements, AS_TAG_AGREEMENT 43 | -------------------------------------------------------------------------------- /tests/samples/appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | firefox.desktop 4 | firefox-bin 5 | Firefox 6 | Firefoux 7 | Feuerfuchs 8 | Web browser 9 | Navigateur web 10 | 11 | internet 12 | web 13 | browser 14 | navigateur 15 | 16 | web-browser 17 | firefox_web-browser.png 18 | 19 | network 20 | web 21 | 22 | 23 | text/html 24 | text/xml 25 | application/xhtml+xml 26 | application/vnd.mozilla.xul+xml 27 | text/mml 28 | application/x-xpinstall 29 | x-scheme-handler/http 30 | x-scheme-handler/https 31 | 32 | http://www.mozilla.com 33 | firefox 34 | 35 | -------------------------------------------------------------------------------- /qt/utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Matthias Klumpp 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #ifndef APPSTREAMQT_UTILS_H 21 | #define APPSTREAMQT_UTILS_H 22 | 23 | #include 24 | #include "appstreamqt_export.h" 25 | 26 | namespace AppStream { 27 | 28 | namespace Utils { 29 | 30 | APPSTREAMQT_EXPORT QString currentDistroComponentId(); 31 | 32 | APPSTREAMQT_EXPORT QString currentAppStreamVersion(); 33 | 34 | APPSTREAMQT_EXPORT int compareVersions(const QString &a, const QString &b); 35 | 36 | } 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /data/org.freedesktop.appstream.cli.metainfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.freedesktop.appstream.cli 5 | FSFAP 6 | GPL-2.0+ 7 | 8 | AppStream CLI 9 | An utility to work with AppStream metadata 10 | 11 | 12 |

13 | AppStream is a cross-distribution specification to provide metadata about software components. 14 |

15 |

16 | This tool allows for reading, writing, validating and transformation of AppStream XML or YAML metadata. 17 | It also gives access to the system metadata pool, for example to query for software that provides a 18 | specific MIME-type, and installing it by its software component identifier. 19 |

20 |
21 | 22 | https://www.freedesktop.org/wiki/Distributions/AppStream/ 23 | https://www.freedesktop.org/software/appstream/docs/chap-AppStream-ManualPages.html 24 | 25 | Freedesktop 26 | 27 | appstream 28 | 29 | appstreamcli 30 | 31 |
32 | -------------------------------------------------------------------------------- /src/as-provided-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_PROVIDED_PRIVATE_H 22 | #define __AS_PROVIDED_PRIVATE_H 23 | 24 | #include "as-provided.h" 25 | 26 | G_BEGIN_DECLS 27 | #pragma GCC visibility push(hidden) 28 | 29 | /* NOTE: XML and YAML parsing is done in AsComponent, since we can not do it efficiently here */ 30 | 31 | #pragma GCC visibility pop 32 | G_END_DECLS 33 | 34 | #endif /* __AS_PROVIDED_PRIVATE_H */ 35 | -------------------------------------------------------------------------------- /src/as-distro-extras.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2016-2018 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_DISTRO_EXTRAS_H 22 | #define __AS_DISTRO_EXTRAS_H 23 | 24 | #include 25 | #include "as-pool.h" 26 | 27 | G_BEGIN_DECLS 28 | #pragma GCC visibility push(hidden) 29 | 30 | void as_pool_scan_apt (AsPool *pool, 31 | gboolean force, 32 | GError **error); 33 | 34 | #pragma GCC visibility pop 35 | G_END_DECLS 36 | 37 | #endif /* __AS_DISTRO_EXTRAS_H */ 38 | -------------------------------------------------------------------------------- /qt/utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Matthias Klumpp 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #include "utils.h" 21 | 22 | #include "appstream.h" 23 | #include "chelpers.h" 24 | 25 | QString AppStream::Utils::currentDistroComponentId() 26 | { 27 | return QString::fromUtf8(as_get_current_distro_component_id()); 28 | } 29 | 30 | 31 | QString AppStream::Utils::currentAppStreamVersion() 32 | { 33 | return QString::fromUtf8(as_get_appstream_version()); 34 | } 35 | 36 | 37 | int AppStream::Utils::compareVersions(const QString &a, const QString &b) 38 | { 39 | return as_utils_compare_versions (qPrintable(a), qPrintable(b)); 40 | } 41 | -------------------------------------------------------------------------------- /src/as-tag-xml.gperf: -------------------------------------------------------------------------------- 1 | %language=ANSI-C 2 | %enum 3 | %define hash-function-name _as_xml_tag_hash 4 | %define lookup-function-name _as_xml_tag_from_gperf 5 | %define string-pool-name xml_tag_stringpool 6 | %readonly-tables 7 | %includes 8 | %pic 9 | %struct-type 10 | struct xml_tag_data { int name; unsigned int etag; }; 11 | %% 12 | id, AS_TAG_ID 13 | pkgname, AS_TAG_PKGNAME 14 | source_pkgname, AS_TAG_SOURCE_PKGNAME 15 | name, AS_TAG_NAME 16 | summary, AS_TAG_SUMMARY 17 | description, AS_TAG_DESCRIPTION 18 | icon, AS_TAG_ICON 19 | url, AS_TAG_URL 20 | categories, AS_TAG_CATEGORIES 21 | keywords, AS_TAG_KEYWORDS 22 | mimetypes, AS_TAG_MIMETYPES 23 | provides, AS_TAG_PROVIDES 24 | screenshots, AS_TAG_SCREENSHOTS 25 | metadata_license, AS_TAG_METADATA_LICENSE 26 | project_license, AS_TAG_PROJECT_LICENSE 27 | project_group, AS_TAG_PROJECT_GROUP 28 | developer_name, AS_TAG_DEVELOPER_NAME 29 | compulsory_for_desktop, AS_TAG_COMPULSORY_FOR_DESKTOP 30 | releases, AS_TAG_RELEASES 31 | extends, AS_TAG_EXTENDS 32 | languages, AS_TAG_LANGUAGES 33 | launchable, AS_TAG_LAUNCHABLE 34 | bundle, AS_TAG_BUNDLE 35 | translation, AS_TAG_TRANSLATION 36 | suggests, AS_TAG_SUGGESTS 37 | custom, AS_TAG_CUSTOM 38 | content_rating, AS_TAG_CONTENT_RATING 39 | recommends, AS_TAG_RECOMMENDS 40 | requires, AS_TAG_REQUIRES 41 | agreement, AS_TAG_AGREEMENT 42 | p, AS_TAG_P 43 | li, AS_TAG_LI 44 | ul, AS_TAG_UL 45 | ol, AS_TAG_OL 46 | __asi_scope, AS_TAG_INTERNAL_SCOPE 47 | __asi_origin, AS_TAG_INTERNAL_ORIGIN 48 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('stemming', 2 | type : 'boolean', 3 | value : true, 4 | description : 'Use stemming while searching. Requires Snowball (libstemmer)' 5 | ) 6 | option('vapi', 7 | type : 'boolean', 8 | value : false, 9 | description : 'Create and install a Vala API file. Requires "gir" to be enabled as well' 10 | ) 11 | option('qt', 12 | type : 'boolean', 13 | value : false, 14 | description : 'Build libappstream-qt' 15 | ) 16 | option('docs', 17 | type : 'boolean', 18 | value : false, 19 | description : 'Build documentation for API and specification' 20 | ) 21 | option('apidocs', 22 | type : 'boolean', 23 | value : true, 24 | description : 'Build API documentation (automatically enabled when "-Ddocs=true" is passed)' 25 | ) 26 | option('install-docs', 27 | type : 'boolean', 28 | value : true, 29 | description : 'Install documentation for API and specification' 30 | ) 31 | option('apt-support', 32 | type : 'boolean', 33 | value : false, 34 | description : 'Enable integration with APT on Debian' 35 | ) 36 | option('gir', 37 | type : 'boolean', 38 | value : true, 39 | description : 'Build introspection data' 40 | ) 41 | 42 | # 43 | # For development 44 | # 45 | option('maintainer', 46 | type : 'boolean', 47 | value : false, 48 | description : 'Enable maintainer mode (use strict compiler flags, e.g. -Werror)' 49 | ) 50 | -------------------------------------------------------------------------------- /src/as-distro-details-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2018-2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_DISTRO_DETAILS_PRIVATE_H 22 | #define __AS_DISTRO_DETAILS_PRIVATE_H 23 | 24 | #include "as-distro-details.h" 25 | #include "as-settings-private.h" 26 | 27 | G_BEGIN_DECLS 28 | #pragma GCC visibility push(hidden) 29 | 30 | AS_INTERNAL_VISIBLE 31 | void 32 | as_distro_details_load_data (AsDistroDetails *distro, 33 | const gchar *os_release_fname, 34 | const gchar *as_config_fname); 35 | 36 | #pragma GCC visibility pop 37 | G_END_DECLS 38 | 39 | #endif /* __AS_DISTRO_DETAILS_PRIVATE_H */ 40 | -------------------------------------------------------------------------------- /qt/cmake/AppStreamQtConfig.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../" ABSOLUTE) 3 | 4 | # Use original install prefix when loaded through a "/usr move" 5 | # cross-prefix symbolic link such as /lib -> /usr/lib. 6 | get_filename_component(_realCurr "${CMAKE_CURRENT_LIST_DIR}" REALPATH) 7 | get_filename_component(_realOrig "@LIBDIR_FULL@/cmake/AppStreamQt" REALPATH) 8 | if(_realCurr STREQUAL _realOrig) 9 | set(PACKAGE_PREFIX_DIR "@PREFIX@") 10 | endif() 11 | unset(_realOrig) 12 | unset(_realCurr) 13 | 14 | macro(set_and_check _var _file) 15 | set(${_var} "${_file}") 16 | if(NOT EXISTS "${_file}") 17 | message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") 18 | endif() 19 | endmacro() 20 | 21 | macro(check_required_components _NAME) 22 | foreach(comp ${${_NAME}_FIND_COMPONENTS}) 23 | if(NOT ${_NAME}_${comp}_FOUND) 24 | if(${_NAME}_FIND_REQUIRED_${comp}) 25 | set(${_NAME}_FOUND FALSE) 26 | endif() 27 | endif() 28 | endforeach() 29 | endmacro() 30 | 31 | add_library(AppStreamQt SHARED IMPORTED) 32 | set_target_properties(AppStreamQt PROPERTIES 33 | INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/include/" 34 | INTERFACE_LINK_LIBRARIES "Qt5::Core" 35 | IMPORTED_LOCATION "@LIBDIR_FULL@/libAppStreamQt.so.${AppStreamQt_VERSION}" 36 | IMPORTED_SONAME "libAppStreamQt.${AppStreamQt_VERSION_MAJOR}" 37 | ) 38 | 39 | #################################################################################### 40 | 41 | check_required_components(Qt5Core) 42 | -------------------------------------------------------------------------------- /src/as-translation-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_TRANSLATION_PRIVATE_H 22 | #define __AS_TRANSLATION_PRIVATE_H 23 | 24 | #include "as-translation.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | gboolean as_translation_load_from_xml (AsTranslation *tr, 32 | AsContext *ctx, 33 | xmlNode *node, 34 | GError **error); 35 | 36 | void as_translation_to_xml_node (AsTranslation *tr, 37 | AsContext *ctx, 38 | xmlNode *root); 39 | 40 | #pragma GCC visibility pop 41 | G_END_DECLS 42 | 43 | #endif /* __AS_TRANSLATION_PRIVATE_H */ 44 | -------------------------------------------------------------------------------- /src/as-settings-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_SETTINGS_PRIVATE_H 22 | #define __AS_SETTINGS_PRIVATE_H 23 | 24 | #include 25 | #include "config.h" 26 | 27 | G_BEGIN_DECLS 28 | #pragma GCC visibility push(hidden) 29 | 30 | #define AS_INTERNAL_VISIBLE __attribute__((visibility("default"))) 31 | 32 | #define AS_CONFIG_NAME "/etc/appstream.conf" 33 | #define AS_APPSTREAM_CACHE_PATH "/var/cache/app-info/cache" 34 | 35 | /* declared in as-data-pool.c */ 36 | AS_INTERNAL_VISIBLE 37 | extern const gchar *AS_SYSTEM_COLLECTION_METADATA_PATHS[4]; 38 | 39 | #pragma GCC visibility pop 40 | G_END_DECLS 41 | 42 | #endif /* __AS_SETTINGS_PRIVATE_H */ 43 | -------------------------------------------------------------------------------- /src/as-desktop-entry.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_DESKTOP_ENTRY_H 22 | #define __AS_DESKTOP_ENTRY_H 23 | 24 | #include 25 | 26 | #include "as-component.h" 27 | #include "as-metadata.h" 28 | 29 | G_BEGIN_DECLS 30 | #pragma GCC visibility push(hidden) 31 | 32 | AsComponent *as_desktop_entry_parse_data (const gchar *data, 33 | const gchar *cid, 34 | AsFormatVersion fversion, 35 | GError **error); 36 | 37 | AsComponent *as_desktop_entry_parse_file (GFile *file, 38 | AsFormatVersion fversion, 39 | GError **error); 40 | 41 | #pragma GCC visibility pop 42 | G_END_DECLS 43 | 44 | #endif /* __AS_DESKTOP_ENTRY_H */ 45 | -------------------------------------------------------------------------------- /src/as-stemmer.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_STEMMER_H 26 | #define __AS_STEMMER_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define AS_TYPE_STEMMER (as_stemmer_get_type ()) 33 | G_DECLARE_FINAL_TYPE (AsStemmer, as_stemmer, AS, STEMMER, GObject) 34 | 35 | AsStemmer *as_stemmer_get (void); 36 | 37 | void as_stemmer_reload (AsStemmer *stemmer, 38 | const gchar *lang); 39 | gchar *as_stemmer_stem (AsStemmer *stemmer, 40 | const gchar *term); 41 | 42 | G_END_DECLS 43 | 44 | #endif /* __AS_STEMMER_H */ 45 | -------------------------------------------------------------------------------- /src/as-icon-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_ICON_PRIVATE_H 22 | #define __AS_ICON_PRIVATE_H 23 | 24 | #include "as-image.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | gboolean as_icon_load_from_xml (AsIcon *icon, 32 | AsContext *ctx, 33 | xmlNode *node, 34 | GError **error); 35 | void as_icon_to_xml_node (AsIcon *icon, 36 | AsContext *ctx, 37 | xmlNode *root); 38 | 39 | /* NOTE: For YAML, icons are loaded in AsComponent, because the YAML makes this the better option. */ 40 | 41 | #pragma GCC visibility pop 42 | G_END_DECLS 43 | 44 | #endif /* __AS_ICON_PRIVATE_H */ 45 | -------------------------------------------------------------------------------- /RELEASE: -------------------------------------------------------------------------------- 1 | AppStream Release Notes 2 | 3 | 1. Write NEWS entries for AppStream in the same format as usual. 4 | 5 | git shortlog v0.12.9.. | grep -i -v trivial | grep -v Merge > NEWS.new 6 | 7 | -------------------------------------------------------------------------------- 8 | Version 0.12.10 9 | ~~~~~~~~~~~~~~ 10 | Released: 2019-xx-xx 11 | 12 | Notes: 13 | 14 | Features: 15 | 16 | Specification: 17 | 18 | Bugfixes: 19 | -------------------------------------------------------------------------------- 20 | 21 | 2. Update library version if new ABI or API in meson.build 22 | 23 | 3. Commit changes in AppStream git: 24 | 25 | git commit -a -m "Release version 0.12.10" 26 | git tag -s -f -m "Release 0.12.10" v0.12.10 27 | git push --tags 28 | git push 29 | 30 | 4. run './release.sh --version=0.12.10 --git-tag=v0.12.10 --sign' 31 | 32 | 5. Upload tarball: scp -r *.tar.xz* annarchy.freedesktop.org:/srv/www.freedesktop.org/www/software/appstream/releases/ 33 | 34 | 6. Upload documentation: 35 | scp -r build/release_install/usr/local/share/doc/appstream/html/* annarchy.freedesktop.org:/srv/www.freedesktop.org/www/software/appstream/docs/ 36 | 37 | 7. Do post release version bump in meson.build, RELEASE 38 | 39 | 8. Commit trivial changes: 40 | 41 | git commit -a -m "trivial: post release version bump" 42 | git push 43 | 44 | 9. Send an email to appstream@lists.freedesktop.org 45 | 46 | ================================================= 47 | AppStream 0.12.10 released! 48 | 49 | Tarballs available here: https://www.freedesktop.org/software/appstream/releases/ 50 | 51 | ================================================= 52 | -------------------------------------------------------------------------------- /qt/spdx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Aleix Pol Gonzalez 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #ifndef APPSTREAMQT_SPDX_H 21 | #define APPSTREAMQT_SPDX_H 22 | 23 | #include 24 | #include "appstreamqt_export.h" 25 | 26 | namespace AppStream { 27 | 28 | namespace SPDX { 29 | APPSTREAMQT_EXPORT bool isLicenseId(const QString &license_id); 30 | APPSTREAMQT_EXPORT bool isLicenseExpression(const QString &license); 31 | APPSTREAMQT_EXPORT bool isMetadataLicense(const QString &license); 32 | 33 | APPSTREAMQT_EXPORT QStringList tokenizeLicense(const QString &license); 34 | APPSTREAMQT_EXPORT QString detokenizeLicense(const QStringList &license_tokens); 35 | 36 | APPSTREAMQT_EXPORT QString asSpdxId(const QString &license); 37 | 38 | APPSTREAMQT_EXPORT QString licenseUrl(const QString &license); 39 | 40 | } 41 | 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /tools/ascli-actions-misc.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2016-2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU General Public License Version 2 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 2 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef __ASCLI_ACTIONS_MISC_H 22 | #define __ASCLI_ACTIONS_MISC_H 23 | 24 | #include 25 | #include "appstream.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | int ascli_show_status (void); 30 | 31 | int ascli_make_desktop_entry_file (const gchar *mi_fname, 32 | const gchar *de_fname, 33 | const gchar *exec_line); 34 | 35 | int ascli_news_to_metainfo (const gchar *news_fname, 36 | const gchar *mi_fname, 37 | const gchar *out_fname, 38 | guint limit, 39 | const gchar *format_str); 40 | int ascli_metainfo_to_news (const gchar *mi_fname, 41 | const gchar *news_fname, 42 | const gchar *format_str); 43 | 44 | G_END_DECLS 45 | 46 | #endif /* __ASCLI_ACTIONS_MISC_H */ 47 | -------------------------------------------------------------------------------- /docs/sources/quickstart/packaging.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 |
8 | For distributors packaging Appstream metadata 9 | 10 |
11 | Guidelines for distributors 12 | 13 | Distributors of projects with AppStream metadata perform an important role 14 | by making the software available to more people. There are a few guidelines 15 | distributors should follow in order for software centers to present 16 | the correct information to users. 17 | 18 |
19 | 20 |
21 | Guidelines for distributors 22 | 23 | A binary package that contains AppStream desktop metadata () 24 | must also contain both the .desktop file for the application and the application itself. 25 | 26 | 27 | A binary package must not contain more than one AppStream metadata file. The one exception is 28 | that it is permissable for a binary package that is extended by addons to include those addons 29 | () and their AppStream metadata files. Note that users 30 | will be unable to remove those addons separately. 31 | 32 | 33 | Except for the extended package, no other package may contain more than one Appstream addon metadata file. 34 | 35 | 36 |
37 | 38 |
39 | -------------------------------------------------------------------------------- /src/as-spdx.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_SPDX_H 26 | #define __AS_SPDX_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | gboolean as_is_spdx_license_id (const gchar *license_id); 33 | gboolean as_is_spdx_license_expression (const gchar *license); 34 | 35 | gchar **as_spdx_license_tokenize (const gchar *license); 36 | gchar *as_spdx_license_detokenize (gchar **license_tokens); 37 | 38 | gchar *as_license_to_spdx_id (const gchar *license); 39 | 40 | gboolean as_license_is_metadata_license (const gchar *license); 41 | 42 | gchar *as_get_license_url (const gchar *license); 43 | 44 | G_END_DECLS 45 | 46 | #endif /* __AS_SPDX_H */ 47 | -------------------------------------------------------------------------------- /tools/ascli-actions-validate.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU General Public License Version 2 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 2 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef __ASCLI_ACTIONS_VALIDATE_H 22 | #define __ASCLI_ACTIONS_VALIDATE_H 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | gint ascli_validate_files (gchar **argv, 29 | gint argc, 30 | gboolean explain, 31 | gboolean pedantic, 32 | gboolean use_net); 33 | gint ascli_validate_files_format (gchar **argv, 34 | gint argc, 35 | const gchar *format, 36 | gboolean use_net); 37 | 38 | gint ascli_validate_tree (const gchar *root_dir, 39 | gboolean explain, 40 | gboolean pedantic, 41 | gboolean use_net); 42 | gint ascli_validate_tree_format (const gchar *root_dir, 43 | const gchar *format, 44 | gboolean use_net); 45 | 46 | G_END_DECLS 47 | 48 | #endif /* __ASCLI_ACTIONS_VALIDATE_H */ 49 | -------------------------------------------------------------------------------- /src/as-pool-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_POOL_PRIVATE_H 22 | #define __AS_POOL_PRIVATE_H 23 | 24 | #include "as-pool.h" 25 | #include "as-settings-private.h" 26 | 27 | G_BEGIN_DECLS 28 | #pragma GCC visibility push(hidden) 29 | 30 | time_t as_pool_get_system_cache_age (AsPool *pool); 31 | 32 | AS_INTERNAL_VISIBLE 33 | void as_cache_file_save (const gchar *fname, 34 | const gchar *locale, 35 | GPtrArray *cpts, 36 | GError **error); 37 | 38 | AS_INTERNAL_VISIBLE 39 | GPtrArray *as_cache_file_read (const gchar *fname, 40 | GError **error); 41 | 42 | AS_INTERNAL_VISIBLE 43 | gboolean as_pool_refresh_system_cache (AsPool *pool, 44 | gboolean force, 45 | GError **error); 46 | 47 | #pragma GCC visibility pop 48 | G_END_DECLS 49 | 50 | #endif /* __AS_POOL_PRIVATE_H */ 51 | -------------------------------------------------------------------------------- /src/as-video-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_VIDEO_PRIVATE_H 22 | #define __AS_VIDEO_PRIVATE_H 23 | 24 | #include "as-video.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | gboolean as_video_load_from_xml (AsVideo *video, 32 | AsContext *ctx, 33 | xmlNode *node, 34 | GError **error); 35 | void as_video_to_xml_node (AsVideo *video, 36 | AsContext *ctx, 37 | xmlNode *root); 38 | 39 | gboolean as_video_load_from_yaml (AsVideo *video, 40 | AsContext *ctx, 41 | GNode *node, 42 | GError **error); 43 | void as_video_emit_yaml (AsVideo *video, 44 | AsContext *ctx, 45 | yaml_emitter_t *emitter); 46 | 47 | #pragma GCC visibility pop 48 | G_END_DECLS 49 | 50 | #endif /* __AS_VIDEO_PRIVATE_H */ 51 | -------------------------------------------------------------------------------- /src/as-issue-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_ISSUE_PRIVATE_H 22 | #define __AS_ISSUE_PRIVATE_H 23 | 24 | #include "as-issue.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | gboolean as_issue_load_from_xml (AsIssue *issue, 32 | AsContext *ctx, 33 | xmlNode *node, 34 | GError **error); 35 | void as_issue_to_xml_node (AsIssue *issue, 36 | AsContext *ctx, 37 | xmlNode *root); 38 | 39 | gboolean as_issue_load_from_yaml (AsIssue *issue, 40 | AsContext *ctx, 41 | GNode *node, 42 | GError **error); 43 | void as_issue_emit_yaml (AsIssue *issue, 44 | AsContext *ctx, 45 | yaml_emitter_t *emitter); 46 | 47 | #pragma GCC visibility pop 48 | G_END_DECLS 49 | 50 | #endif /* __AS_ISSUE_PRIVATE_H */ 51 | -------------------------------------------------------------------------------- /src/as-bundle-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_BUNDLE_PRIVATE_H 22 | #define __AS_BUNDLE_PRIVATE_H 23 | 24 | #include "as-bundle.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | gboolean as_bundle_load_from_xml (AsBundle *bundle, 32 | AsContext *ctx, 33 | xmlNode *node, 34 | GError **error); 35 | void as_bundle_to_xml_node (AsBundle *bundle, 36 | AsContext *ctx, 37 | xmlNode *root); 38 | 39 | gboolean as_bundle_load_from_yaml (AsBundle *bundle, 40 | AsContext *ctx, 41 | GNode *node, 42 | GError **error); 43 | void as_bundle_emit_yaml (AsBundle *bundle, 44 | AsContext *ctx, 45 | yaml_emitter_t *emitter); 46 | 47 | #pragma GCC visibility pop 48 | G_END_DECLS 49 | 50 | #endif /* __AS_BUNDLE_PRIVATE_H */ 51 | -------------------------------------------------------------------------------- /src/as-checksum-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_CHECKSUM_PRIVATE_H 22 | #define __AS_CHECKSUM_PRIVATE_H 23 | 24 | #include "as-checksum.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | gboolean as_checksum_load_from_xml (AsChecksum *cs, 32 | AsContext *ctx, 33 | xmlNode *node, 34 | GError **error); 35 | void as_checksum_to_xml_node (AsChecksum *cs, 36 | AsContext *ctx, 37 | xmlNode *root); 38 | 39 | gboolean as_checksum_load_from_yaml (AsChecksum *cs, 40 | AsContext *ctx, 41 | GNode *node, 42 | GError **error); 43 | void as_checksum_emit_yaml (AsChecksum *cs, 44 | AsContext *ctx, 45 | yaml_emitter_t *emitter); 46 | 47 | #pragma GCC visibility pop 48 | G_END_DECLS 49 | 50 | #endif /* __AS_CHECKSUM_PRIVATE_H */ 51 | -------------------------------------------------------------------------------- /src/as-image-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_IMAGE_PRIVATE_H 22 | #define __AS_IMAGE_PRIVATE_H 23 | 24 | #include "as-image.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | gboolean as_image_load_from_xml (AsImage *image, 32 | AsContext *ctx, 33 | xmlNode *node, 34 | GError **error); 35 | void as_image_to_xml_node (AsImage *image, 36 | AsContext *ctx, 37 | xmlNode *root); 38 | 39 | gboolean as_image_load_from_yaml (AsImage *image, 40 | AsContext *ctx, 41 | GNode *node, 42 | AsImageKind kind, 43 | GError **error); 44 | void as_image_emit_yaml (AsImage *image, 45 | AsContext *ctx, 46 | yaml_emitter_t *emitter); 47 | 48 | #pragma GCC visibility pop 49 | G_END_DECLS 50 | 51 | #endif /* __AS_IMAGE_PRIVATE_H */ 52 | -------------------------------------------------------------------------------- /tests/samples/appdata-legacy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.gnome.Software.desktop 5 | FSFAP 6 | GPL-2.0+ 7 | Application manager for GNOME 8 | 9 |

10 | Software allows you to find and install new applications and system 11 | extensions and remove existing installed applications. 12 |

13 |

14 | GNOME Software showcases featured and popular applications with useful 15 | descriptions and multiple screenshots per application. 16 | Applications can be found either through browsing the list of categories 17 | or by searching. 18 | It also allows you to update your system using an offline update. 19 |

20 |
21 | 22 | https://git.gnome.org/browse/gnome-software/plain/data/appdata/ss-overview.png 23 | https://git.gnome.org/browse/gnome-software/plain/data/appdata/ss-details.png 24 | https://git.gnome.org/browse/gnome-software/plain/data/appdata/ss-installed.png 25 | https://git.gnome.org/browse/gnome-software/plain/data/appdata/ss-updates.png 26 | https://git.gnome.org/browse/gnome-software/plain/data/appdata/ss-updates-details.png 27 | 28 | https://wiki.gnome.org/Design/Apps/Software 29 | GNOME 30 |
31 | -------------------------------------------------------------------------------- /src/as-launchable-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_LAUNCHABLE_PRIVATE_H 22 | #define __AS_LAUNCHABLE_PRIVATE_H 23 | 24 | #include "as-launchable.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | /* NOTE: The AsComponent load the AsLaunchable from XML, because it needs to aggregate multiple tags in one object. */ 32 | 33 | void as_launchable_to_xml_node (AsLaunchable *launchable, 34 | AsContext *ctx, 35 | xmlNode *root); 36 | 37 | gboolean as_launchable_load_from_yaml (AsLaunchable *launch, 38 | AsContext *ctx, 39 | GNode *node, 40 | GError **error); 41 | void as_launchable_emit_yaml (AsLaunchable *launch, 42 | AsContext *ctx, 43 | yaml_emitter_t *emitter); 44 | 45 | #pragma GCC visibility pop 46 | G_END_DECLS 47 | 48 | #endif /* __AS_LAUNCHABLE_PRIVATE_H */ 49 | -------------------------------------------------------------------------------- /src/as-artifact-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2018-2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_ARTIFACT_PRIVATE_H 22 | #define __AS_ARTIFACT_PRIVATE_H 23 | 24 | #include "as-artifact.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | gboolean as_artifact_load_from_xml (AsArtifact *artifact, 32 | AsContext *ctx, 33 | xmlNode *node, 34 | GError **error); 35 | void as_artifact_to_xml_node (AsArtifact *artifact, 36 | AsContext *ctx, 37 | xmlNode *root); 38 | 39 | gboolean as_artifact_load_from_yaml (AsArtifact *artifact, 40 | AsContext *ctx, 41 | GNode *node, 42 | GError **error); 43 | void as_artifact_emit_yaml (AsArtifact *artifact, 44 | AsContext *ctx, 45 | yaml_emitter_t *emitter); 46 | 47 | #pragma GCC visibility pop 48 | G_END_DECLS 49 | 50 | #endif /* __AS_ARTIFACT_PRIVATE_H */ 51 | -------------------------------------------------------------------------------- /src/as-suggested-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_SUGGESTED_PRIVATE_H 22 | #define __AS_SUGGESTED_PRIVATE_H 23 | 24 | #include "as-suggested.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | gboolean as_suggested_load_from_xml (AsSuggested *suggested, 32 | AsContext *ctx, 33 | xmlNode *node, 34 | GError **error); 35 | void as_suggested_to_xml_node (AsSuggested *suggested, 36 | AsContext *ctx, 37 | xmlNode *root); 38 | 39 | gboolean as_suggested_load_from_yaml (AsSuggested *suggested, 40 | AsContext *ctx, 41 | GNode *node, 42 | GError **error); 43 | void as_suggested_emit_yaml (AsSuggested *suggested, 44 | AsContext *ctx, 45 | yaml_emitter_t *emitter); 46 | 47 | #pragma GCC visibility pop 48 | G_END_DECLS 49 | 50 | #endif /* __AS_SUGGESTED_PRIVATE_H */ 51 | -------------------------------------------------------------------------------- /tools/ascli-utils.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU General Public License Version 2 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 2 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef __ASCLI_UTILS_H 22 | #define __ASCLI_UTILS_H 23 | 24 | #include 25 | #include "appstream.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | gchar *ascli_format_long_output (const gchar *str, 30 | guint indent_level); 31 | void ascli_print_key_value (const gchar *key, 32 | const gchar *val, 33 | gboolean highlight); 34 | void ascli_print_separator (void); 35 | 36 | void ascli_print_stdout (const gchar *format, ...); 37 | void ascli_print_stderr (const gchar *format, ...); 38 | void ascli_print_highlight (const gchar* msg); 39 | 40 | void ascli_print_component (AsComponent *cpt, 41 | gboolean show_detailed); 42 | void ascli_print_components (GPtrArray *cpts, 43 | gboolean show_detailed); 44 | 45 | void ascli_set_output_colored (gboolean colored); 46 | gboolean ascli_get_output_colored (void); 47 | 48 | G_END_DECLS 49 | 50 | #endif /* __ASCLI_UTILS_H */ 51 | -------------------------------------------------------------------------------- /docs/sources/Book_Info.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 | AppStream 8 | Infrastructure for distro-agnostic software-centers and universal software component metadata 9 | AppStream 10 | 0.12 11 | 1 12 | 0 13 | 14 | 15 | AppStream is a collaborative effort for enhancing the way we interact with the software 16 | repositories provided by the distribution by standardizing sets of additional metadata. 17 | 18 | 19 | AppStream provides the foundation to build software-center applications. 20 | It additionally provides specifications for things like an unified software metadata database, 21 | screenshot services and various other things needed to create user-friendly application-centers 22 | for software distributions. 23 | 24 | 25 | You can find a C/GLib based reference implementation of the specification 26 | here and report bugs about the implementation 27 | as well as the specification itself at the issue tracker. 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /docs/sources/services/screenshots.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 |
8 | Screenshot service 9 | 10 |
11 | Introduction 12 | 13 | To make give users an impression on how the application they are about to install will look like, screenshots are provided in the AppStream spec. 14 | But since not all upstream authors ship screenshots, there is a way for distributors to specify a server for screenshots provided by a 3rd-party. 15 | 16 |
17 | 18 |
19 | Webservice 20 | 21 | Distributors provide a service like debshots. They can either use the original 22 | debshots web application, which does not only work for Debian but also any other distribution, or they can set up their own service 23 | which mimicks the debshots API (OpenSUSE does that). 24 | 25 | 26 | In order to make a new screenshot service known to software-centers, distributors need to place information about their webservice in the config 27 | file of libappstream, whis is usually located at /etc/appstream.conf. 28 | 29 | 30 | The screenshot data will be inserted transparently into AsScreenshot, if 31 | the distributor has set the configuration flag. 32 | Authors of software-centers don't need to take care of this implementation detail. 33 | 34 |
35 |
36 | -------------------------------------------------------------------------------- /src/as-utils.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_UTILS_H 26 | #define __AS_UTILS_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | gchar *as_markup_convert_simple (const gchar *markup, 33 | GError **error); 34 | 35 | gboolean as_utils_locale_is_compatible (const gchar *locale1, 36 | const gchar *locale2); 37 | gboolean as_utils_is_category_name (const gchar *category_name); 38 | gboolean as_utils_is_tld (const gchar *tld); 39 | gboolean as_utils_is_desktop_environment (const gchar *desktop); 40 | 41 | void as_utils_sort_components_into_categories (GPtrArray *cpts, 42 | GPtrArray *categories, 43 | gboolean check_duplicates); 44 | 45 | gint as_utils_compare_versions (const gchar* a, 46 | const gchar *b); 47 | 48 | const gchar *as_get_appstream_version (void); 49 | 50 | G_END_DECLS 51 | 52 | #endif /* __AS_UTILS_H */ 53 | -------------------------------------------------------------------------------- /src/as-relation-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2018 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_RELATION_PRIVATE_H 22 | #define __AS_RELATION_PRIVATE_H 23 | 24 | #include "as-relation.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | /* NOTE: Some XML/YAML parsing is done in AsComponent, the routines here load single entries from 32 | * a requires/recommends block */ 33 | 34 | gboolean as_relation_load_from_xml (AsRelation *relation, 35 | AsContext *ctx, 36 | xmlNode *node, 37 | GError **error); 38 | void as_relation_to_xml_node (AsRelation *relation, 39 | AsContext *ctx, 40 | xmlNode *root); 41 | 42 | gboolean as_relation_load_from_yaml (AsRelation *relation, 43 | AsContext *ctx, 44 | GNode *node, 45 | GError **error); 46 | void as_relation_emit_yaml (AsRelation *relation, 47 | AsContext *ctx, 48 | yaml_emitter_t *emitter); 49 | 50 | #pragma GCC visibility pop 51 | G_END_DECLS 52 | 53 | #endif /* __AS_RELATION_PRIVATE_H */ 54 | -------------------------------------------------------------------------------- /src/as-release-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2016-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_RELEASE_PRIVATE_H 22 | #define __AS_RELEASE_PRIVATE_H 23 | 24 | #include "as-release.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | AsContext *as_release_get_context (AsRelease *release); 32 | void as_release_set_context (AsRelease *release, 33 | AsContext *context); 34 | 35 | gboolean as_release_load_from_xml (AsRelease *release, 36 | AsContext *ctx, 37 | xmlNode *node, 38 | GError **error); 39 | void as_release_to_xml_node (AsRelease *release, 40 | AsContext *ctx, 41 | xmlNode *root); 42 | 43 | gboolean as_release_load_from_yaml (AsRelease *release, 44 | AsContext *ctx, 45 | GNode *node, 46 | GError **error); 47 | void as_release_emit_yaml (AsRelease *release, 48 | AsContext *ctx, 49 | yaml_emitter_t *emitter); 50 | 51 | #pragma GCC visibility pop 52 | G_END_DECLS 53 | 54 | #endif /* __AS_RELEASE_PRIVATE_H */ 55 | -------------------------------------------------------------------------------- /src/appstream.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __APPSTREAM_H 22 | #define __APPSTREAM_H 23 | 24 | #define __APPSTREAM_H_INSIDE__ 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | #include 52 | #include 53 | 54 | #include 55 | #include 56 | 57 | #ifdef __cplusplus 58 | }; 59 | #endif 60 | #undef __APPSTREAM_H_INSIDE__ 61 | 62 | #endif /* __APPSTREAM_H */ 63 | -------------------------------------------------------------------------------- /tests/samples/appstream-dxml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | firefox.desktop 5 | firefox-bin 6 | Firefox 7 | Firefoux 8 | Web browser 9 | Navigateur web 10 | MPL-2 11 | 12 | internet 13 | web 14 | browser 15 | navigateur 16 | 17 | web-browser 18 | firefox.png 19 | 20 | network 21 | web 22 | 23 | 24 | text/html 25 | text/xml 26 | application/xhtml+xml 27 | application/vnd.mozilla.xul+xml 28 | text/mml 29 | application/x-xpinstall 30 | x-scheme-handler/http 31 | x-scheme-handler/https 32 | 33 | http://www.mozilla.com 34 | 35 | 36 | Firefox displaying a kitten 37 | http://www.awesomedistro.example.org/en_US/firefox.desktop/main.png 38 | http://www.awesomedistro.example.org/en_US/firefox.desktop/main-small.png 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /tests/samples/collection/xml/limba_6375db4bb7186c39a4860544884575f7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.neverball.Neverball 5 | Neverball 6 | A 3D arcade game with a ball. 7 | 8 |

9 | Tilt the floor to roll a ball through an obstacle course before time runs 10 | out. 11 | Neverball is part puzzle game, part action game, and entirely a test of 12 | skill. 13 |

14 |

15 | The current version includes 141 Neverball levels and 134 Neverputt holes. 16 |

17 |
18 | 19 | neverball.desktop 20 | 21 | http://neverball.org/ 22 | neverball-1.6.0.png 23 | neverball-1.6.0 24 | 25 | 26 | 27 | https://example.com/releasenotes-1.6.1.html 28 | 29 | 30 | 31 | https://example.com/mytarball.bin.lpk 32 | f7dd28d23679b5cd6598534a27cd821cf3375c385a10a633f104d9e4841991a8 33 | 112358 34 | 42424242 35 | 36 | 37 | https://example.com/mytarball.tar.xz 38 | 95c0a7733b2ec76cf52ba2fa8db31cf3ad6ede7140d675e218c86720e97d9ac1 39 | 40 | 41 | 42 | 43 | 44 |
45 |
46 | -------------------------------------------------------------------------------- /src/as-screenshot-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2015-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_SCREENSHOT_PRIVATE_H 22 | #define __AS_SCREENSHOT_PRIVATE_H 23 | 24 | #include "as-screenshot.h" 25 | #include "as-xml.h" 26 | #include "as-yaml.h" 27 | 28 | G_BEGIN_DECLS 29 | #pragma GCC visibility push(hidden) 30 | 31 | AsContext *as_screenshot_get_context (AsScreenshot *screenshot); 32 | void as_screenshot_set_context (AsScreenshot *screenshot, 33 | AsContext *context); 34 | 35 | gboolean as_screenshot_load_from_xml (AsScreenshot *screenshot, 36 | AsContext *ctx, 37 | xmlNode *node, 38 | GError **error); 39 | void as_screenshot_to_xml_node (AsScreenshot *screenshot, 40 | AsContext *ctx, 41 | xmlNode *root); 42 | 43 | gboolean as_screenshot_load_from_yaml (AsScreenshot *screenshot, 44 | AsContext *ctx, 45 | GNode *node, 46 | GError **error); 47 | void as_screenshot_emit_yaml (AsScreenshot *screenshot, 48 | AsContext *ctx, 49 | yaml_emitter_t *emitter); 50 | 51 | #pragma GCC visibility pop 52 | G_END_DECLS 53 | 54 | #endif /* __AS_SCREENSHOT_PRIVATE_H */ 55 | -------------------------------------------------------------------------------- /src/as-content-rating-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef __AS_CONTENT_RATING_PRIVATE_H 22 | #define __AS_CONTENT_RATING_PRIVATE_H 23 | 24 | #include 25 | #include "as-content-rating.h" 26 | #include "as-xml.h" 27 | #include "as-yaml.h" 28 | 29 | G_BEGIN_DECLS 30 | #pragma GCC visibility push(hidden) 31 | 32 | typedef struct { 33 | gchar *id; 34 | AsContentRatingValue value; 35 | } AsContentRatingKey; 36 | 37 | gboolean as_content_rating_load_from_xml (AsContentRating *content_rating, 38 | AsContext *ctx, 39 | xmlNode *node, 40 | GError **error); 41 | void as_content_rating_to_xml_node (AsContentRating *content_rating, 42 | AsContext *ctx, 43 | xmlNode *root); 44 | 45 | gboolean as_content_rating_load_from_yaml (AsContentRating *content_rating, 46 | AsContext *ctx, 47 | GNode *node, 48 | GError **error); 49 | void as_content_rating_emit_yaml (AsContentRating *content_rating, 50 | AsContext *ctx, 51 | yaml_emitter_t *emitter); 52 | 53 | #pragma GCC visibility pop 54 | G_END_DECLS 55 | 56 | #endif /* __AS_CONTENT_RATING_PRIVATE_H */ 57 | -------------------------------------------------------------------------------- /tests/test-validate.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #include 22 | #include "appstream.h" 23 | #include "as-component-private.h" 24 | 25 | #include "as-test-utils.h" 26 | 27 | static gchar *datadir = NULL; 28 | 29 | /** 30 | * test_validator_create: 31 | * 32 | * Placeholder test function that just creates a validator and removes it again 33 | * for now. 34 | */ 35 | static void 36 | test_validator_create () 37 | { 38 | AsValidator *validator = as_validator_new (); 39 | g_object_unref (validator); 40 | } 41 | 42 | int 43 | main (int argc, char **argv) 44 | { 45 | int ret; 46 | 47 | if (argc == 0) { 48 | g_error ("No test directory specified!"); 49 | return 1; 50 | } 51 | 52 | g_assert (argv[1] != NULL); 53 | datadir = g_build_filename (argv[1], "samples", NULL); 54 | g_assert (g_file_test (datadir, G_FILE_TEST_EXISTS) != FALSE); 55 | 56 | g_setenv ("G_MESSAGES_DEBUG", "all", TRUE); 57 | g_test_init (&argc, &argv, NULL); 58 | 59 | /* only critical and error are fatal */ 60 | g_log_set_fatal_mask (NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL); 61 | 62 | g_test_add_func ("/AppStream/Validate/Create", test_validator_create); 63 | 64 | ret = g_test_run (); 65 | g_free (datadir); 66 | return ret; 67 | } 68 | -------------------------------------------------------------------------------- /src/as-agreement-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2018 Richard Hughes 4 | * Copyright (C) 2018 Matthias Klumpp 5 | * 6 | * Licensed under the GNU Lesser General Public License Version 2.1 7 | * 8 | * This library is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 2.1 of the license, or 11 | * (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this library. If not, see . 20 | */ 21 | 22 | #ifndef __AS_AGREEMENT_PRIVATE_H 23 | #define __AS_AGREEMENT_PRIVATE_H 24 | 25 | #include 26 | 27 | #include "as-context.h" 28 | #include "as-agreement.h" 29 | #include "as-xml.h" 30 | #include "as-yaml.h" 31 | 32 | G_BEGIN_DECLS 33 | #pragma GCC visibility push(hidden) 34 | 35 | AsContext *as_agreement_get_context (AsAgreement *agreement); 36 | void as_agreement_set_context (AsAgreement *agreement, 37 | AsContext *context); 38 | 39 | 40 | void as_agreement_to_xml_node (AsAgreement *agreement, 41 | AsContext *ctx, 42 | xmlNode *root); 43 | gboolean as_agreement_load_from_xml (AsAgreement *agreement, 44 | AsContext *ctx, 45 | xmlNode *node, 46 | GError **error); 47 | 48 | gboolean as_agreement_load_from_yaml (AsAgreement *agreement, 49 | AsContext *ctx, 50 | GNode *node, 51 | GError **error); 52 | void as_agreement_emit_yaml (AsAgreement *agreement, 53 | AsContext *ctx, 54 | yaml_emitter_t *emitter); 55 | 56 | #pragma GCC visibility pop 57 | G_END_DECLS 58 | 59 | #endif /* __AS_AGREEMENT_PRIVATE_H */ 60 | -------------------------------------------------------------------------------- /qt/category.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthias Klumpp 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #ifndef APPSTREAMQT_CATEGORY_H 21 | #define APPSTREAMQT_CATEGORY_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include "appstreamqt_export.h" 27 | 28 | struct _AsCategory; 29 | 30 | namespace AppStream { 31 | 32 | class CategoryData; 33 | 34 | class APPSTREAMQT_EXPORT Category { 35 | Q_GADGET 36 | public: 37 | Category(_AsCategory* category); 38 | Category(const Category& category); 39 | ~Category(); 40 | 41 | Category& operator=(const Category& category); 42 | bool operator==(const Category& r) const; 43 | 44 | /** 45 | * \returns the internally stored AsCategory 46 | */ 47 | _AsCategory *asCategory() const; 48 | 49 | QString id() const; 50 | QString name() const; 51 | QString summary() const; 52 | QString icon() const; 53 | 54 | QList children() const; 55 | QStringList desktopGroups() const; 56 | 57 | private: 58 | QSharedDataPointer d; 59 | }; 60 | } 61 | 62 | APPSTREAMQT_EXPORT QDebug operator<<(QDebug s, const AppStream::Category& category); 63 | 64 | QList getDefaultCategories(bool withSpecial); 65 | 66 | #endif // APPSTREAMQT_CATEGORY_H 67 | -------------------------------------------------------------------------------- /docs/sources/Project_Desc.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 | About AppStream 8 | 9 |
10 | What is AppStream? 11 | 12 | 13 | AppStream is a cross-distro effort for enhancing the metadata available about software components in the Linux and free-software ecosystem. 14 | One of the project's goals is to make building software-center applications possible, and make interaction with the package sources of a 15 | distribution smarter. 16 | AppStream provides specifications for meta-information which is shipped by upstream projects and can be consumed by other software. 17 | The meta-information includes data which is interesting to display in software centers and is mainly useful for end-users, as well as descriptions 18 | about the public interfaces a software component provides, which is mainly useful for developers, 3rd-party software installers and for automatically 19 | installing missing components on a distribution, for example missing firmware or mimetype-handlers. 20 | 21 | 22 | Distributors provide metadata as well, which describes all components available in a software repository. That data is composed of the upstream-metainfo 23 | and some other sources. 24 | AppStream also provides specifications for things like a screenshot-service, application ratings & reviews etc. 25 | 26 | 27 | All parts of AppStream are distribution-agnostic, and therefore it is easily possible to build software management tools with it that work 28 | on any distribution implementing the AppStream specification. 29 | 30 | 31 |
32 | Architecture 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
42 |
43 | 44 |
45 | -------------------------------------------------------------------------------- /tools/ascli-actions-mdata.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU General Public License Version 2 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 2 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef __ASCLI_ACTIONS_MDATA_H 22 | #define __ASCLI_ACTIONS_MDATA_H 23 | 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | int ascli_what_provides (const gchar *cachepath, 30 | const gchar *kind_str, 31 | const gchar *item, 32 | gboolean detailed); 33 | 34 | int ascli_search_component (const gchar *cachepath, 35 | const gchar *search_term, 36 | gboolean detailed, 37 | gboolean no_cache); 38 | 39 | int ascli_get_component (const gchar *cachepath, 40 | const gchar *identifier, 41 | gboolean detailed, 42 | gboolean no_cache); 43 | 44 | int ascli_refresh_cache (const gchar *cachepath, 45 | const gchar *datapath, 46 | gboolean forced); 47 | 48 | int ascli_dump_component (const gchar *cachepath, 49 | const gchar *identifier, 50 | AsFormatKind mformat, 51 | gboolean no_cache); 52 | 53 | int ascli_put_metainfo (const gchar *fname); 54 | 55 | int ascli_convert_data (const gchar *in_fname, 56 | const gchar *out_fname, 57 | AsFormatKind mformat); 58 | 59 | int ascli_create_metainfo_template (const gchar *out_fname, 60 | const gchar *cpt_kind_str, 61 | const gchar *desktop_file); 62 | 63 | 64 | G_END_DECLS 65 | 66 | #endif /* __ASCLI_ACTIONS_MDATA_H */ 67 | -------------------------------------------------------------------------------- /qt/tests/asqt-pool-test.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthias Klumpp 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include "pool.h" 24 | #include "testpaths.h" 25 | 26 | class PoolReadTest : public QObject { 27 | Q_OBJECT 28 | private Q_SLOTS: 29 | void testRead01(); 30 | }; 31 | 32 | using namespace AppStream; 33 | 34 | void PoolReadTest::testRead01() 35 | { 36 | // set up the data pool to read our sample data, without localization 37 | auto pool = new Pool(); 38 | 39 | pool->clearMetadataLocations(); 40 | pool->addMetadataLocation(AS_SAMPLE_DATA_PATH); 41 | pool->setLocale("C"); 42 | 43 | // don't load system metainfo/desktop files 44 | auto flags = pool->flags(); 45 | flags &= ~Pool::FlagReadDesktopFiles; 46 | flags &= ~Pool::FlagReadMetainfo; 47 | pool->setFlags(flags); 48 | 49 | // don't use caches 50 | pool->setCacheFlags(Pool::CacheFlagNone); 51 | 52 | // read metadata 53 | QVERIFY(pool->load()); 54 | 55 | auto cpts = pool->components(); 56 | QCOMPARE(cpts.size(), 19); 57 | 58 | cpts = pool->componentsById("org.neverball.Neverball"); 59 | QCOMPARE(cpts.size(), 1); 60 | 61 | auto cpt = cpts[0]; 62 | QVERIFY(!cpt.id().isEmpty()); 63 | 64 | QCOMPARE(cpt.name(), QLatin1String("Neverball")); 65 | 66 | delete pool; 67 | } 68 | 69 | QTEST_MAIN(PoolReadTest) 70 | 71 | #include "asqt-pool-test.moc" 72 | -------------------------------------------------------------------------------- /src/as-agreement-section-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2018 Richard Hughes 4 | * Copyright (C) 2018 Matthias Klumpp 5 | * 6 | * Licensed under the GNU Lesser General Public License Version 2.1 7 | * 8 | * This library is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 2.1 of the license, or 11 | * (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this library. If not, see . 20 | */ 21 | 22 | #ifndef __AS_AGREEMENT_SECTION_PRIVATE_H 23 | #define __AS_AGREEMENT_SECTION_PRIVATE_H 24 | 25 | #include 26 | 27 | #include "as-agreement-section.h" 28 | #include "as-xml.h" 29 | #include "as-yaml.h" 30 | 31 | G_BEGIN_DECLS 32 | #pragma GCC visibility push(hidden) 33 | 34 | AsContext *as_agreement_section_get_context (AsAgreementSection *agreement_section); 35 | void as_agreement_section_set_context (AsAgreementSection *agreement_section, 36 | AsContext *context); 37 | 38 | gboolean as_agreement_section_load_from_xml (AsAgreementSection *agreement_section, 39 | AsContext *ctx, 40 | xmlNode *node, 41 | GError **error); 42 | void as_agreement_section_to_xml_node (AsAgreementSection *agreement_section, 43 | AsContext *ctx, 44 | xmlNode *root); 45 | 46 | gboolean as_agreement_section_load_from_yaml (AsAgreementSection *agreement_section, 47 | AsContext *ctx, 48 | GNode *node, 49 | GError **error); 50 | void as_agreement_section_emit_yaml (AsAgreementSection *agreement_section, 51 | AsContext *ctx, 52 | yaml_emitter_t *emitter); 53 | 54 | #pragma GCC visibility pop 55 | G_END_DECLS 56 | 57 | #endif /* __AS_AGREEMENT_SECTION_PRIVATE_H */ 58 | -------------------------------------------------------------------------------- /data/xdg-category-names.txt: -------------------------------------------------------------------------------- 1 | # FreeDesktop Menu Categories 2 | # See https://specifications.freedesktop.org/menu-spec/menu-spec-1.0.html#category-registry 3 | 2DGraphics 4 | 3DGraphics 5 | Accessibility 6 | ActionGame 7 | Adult 8 | AdventureGame 9 | Amusement 10 | ArcadeGame 11 | Archiving 12 | Art 13 | ArtificialIntelligence 14 | Astronomy 15 | Audio 16 | AudioVideo 17 | AudioVideoEditing 18 | Biology 19 | BlocksGame 20 | BoardGame 21 | Building 22 | Calculator 23 | Calendar 24 | CardGame 25 | Chart 26 | Chat 27 | Chemistry 28 | Clock 29 | Compression 30 | ComputerScience 31 | ConsoleOnly 32 | Construction 33 | ContactManagement 34 | Core 35 | Database 36 | DataVisualization 37 | Debugger 38 | DesktopSettings 39 | Development 40 | Dialup 41 | Dictionary 42 | DiscBurning 43 | Documentation 44 | Economy 45 | Education 46 | Electricity 47 | Electronics 48 | Email 49 | Emulator 50 | Engineering 51 | Feed 52 | FileManager 53 | Filesystem 54 | FileTools 55 | FileTransfer 56 | Finance 57 | FlowChart 58 | Game 59 | Geography 60 | Geology 61 | Geoscience 62 | GNOME 63 | Graphics 64 | GTK 65 | GUIDesigner 66 | HamRadio 67 | HardwareSettings 68 | History 69 | Humanities 70 | IDE 71 | ImageProcessing 72 | InstantMessaging 73 | IRCClient 74 | Java 75 | KDE 76 | KidsGame 77 | Languages 78 | Literature 79 | LogicGame 80 | Maps 81 | Math 82 | MedicalSoftware 83 | Midi 84 | Mixer 85 | Monitor 86 | Motif 87 | Music 88 | Network 89 | News 90 | NumericalAnalysis 91 | OCR 92 | Office 93 | P2P 94 | PackageManager 95 | ParallelComputing 96 | PDA 97 | Photography 98 | Physics 99 | Player 100 | Presentation 101 | Printing 102 | Profiling 103 | ProjectManagement 104 | Publishing 105 | Qt 106 | RasterGraphics 107 | Recorder 108 | RemoteAccess 109 | RevisionControl 110 | Robotics 111 | RolePlaying 112 | Scanning 113 | Science 114 | Security 115 | Sequencer 116 | Settings 117 | Shooter 118 | Simulation 119 | Spirituality 120 | Sports 121 | SportsGame 122 | Spreadsheet 123 | StrategyGame 124 | System 125 | Telephony 126 | TelephonyTools 127 | TerminalEmulator 128 | TextEditor 129 | TextTools 130 | Translation 131 | Tuner 132 | TV 133 | Utility 134 | VectorGraphics 135 | Video 136 | VideoConference 137 | Viewer 138 | WebBrowser 139 | WebDevelopment 140 | WordProcessor 141 | XFCE 142 | -------------------------------------------------------------------------------- /qt/spdx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright(C) 2019 Aleix Pol Gonzalez 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | *(at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #include "spdx.h" 21 | 22 | #include "appstream.h" 23 | #include "chelpers.h" 24 | 25 | bool AppStream::SPDX::isLicenseId(const QString &license_id) 26 | { 27 | return as_is_spdx_license_id(qPrintable(license_id)); 28 | } 29 | 30 | bool AppStream::SPDX::isLicenseExpression(const QString &license) 31 | { 32 | return as_is_spdx_license_expression(qPrintable(license)); 33 | } 34 | 35 | bool AppStream::SPDX::isMetadataLicense(const QString &license) 36 | { 37 | return as_license_is_metadata_license(qPrintable(license)); 38 | } 39 | 40 | QStringList AppStream::SPDX::tokenizeLicense(const QString &license) 41 | { 42 | g_auto(GStrv) strv = as_spdx_license_tokenize(qPrintable(license)); 43 | return AppStream::valueWrap(strv); 44 | } 45 | 46 | QString AppStream::SPDX::detokenizeLicense(const QStringList &license_tokens) 47 | { 48 | g_autofree gchar *res = NULL; 49 | g_auto(GStrv) tokens = NULL; 50 | 51 | tokens = AppStream::stringListToCharArray(license_tokens); 52 | res = as_spdx_license_detokenize(tokens); 53 | return QString::fromUtf8(res); 54 | } 55 | 56 | QString AppStream::SPDX::asSpdxId(const QString &license) 57 | { 58 | g_autofree gchar *res = as_license_to_spdx_id(qPrintable(license)); 59 | return QString::fromUtf8(res); 60 | } 61 | 62 | QString AppStream::SPDX::licenseUrl(const QString &license) 63 | { 64 | g_autofree gchar *res = as_get_license_url(qPrintable(license)); 65 | return QString::fromUtf8(res); 66 | } 67 | -------------------------------------------------------------------------------- /qt/translation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Jan Grulich 3 | * Copyright (C) 2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef APPSTREAMQT_TRANSLATION_H 22 | #define APPSTREAMQT_TRANSLATION_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include "appstreamqt_export.h" 28 | 29 | struct _AsTranslation; 30 | 31 | namespace AppStream { 32 | 33 | class TranslationData; 34 | 35 | class APPSTREAMQT_EXPORT Translation { 36 | Q_GADGET 37 | public: 38 | enum Kind { 39 | KindUnknown, 40 | KindGettext, 41 | KindQt 42 | }; 43 | Q_ENUM(Kind) 44 | 45 | Translation(); 46 | Translation(_AsTranslation* category); 47 | Translation(const Translation& category); 48 | ~Translation(); 49 | 50 | static Kind stringToKind(const QString& kindString); 51 | static QString kindToString(Kind kind); 52 | 53 | Translation& operator=(const Translation& category); 54 | bool operator==(const Translation& r) const; 55 | 56 | /** 57 | * \returns the internally stored AsTranslation 58 | */ 59 | _AsTranslation *asTranslation() const; 60 | 61 | Kind kind() const; 62 | void setKind(Kind kind); 63 | 64 | QString id() const; 65 | void setId(const QString& id); 66 | 67 | private: 68 | QSharedDataPointer d; 69 | }; 70 | } 71 | 72 | APPSTREAMQT_EXPORT QDebug operator<<(QDebug s, const AppStream::Translation& category); 73 | 74 | #endif // APPSTREAMQT_TRANSLATION_H 75 | 76 | 77 | -------------------------------------------------------------------------------- /qt/launchable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Jan Grulich 3 | * Copyright (C) 2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef APPSTREAMQT_LAUNCHABLE_H 22 | #define APPSTREAMQT_LAUNCHABLE_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include "appstreamqt_export.h" 28 | 29 | struct _AsLaunchable; 30 | 31 | namespace AppStream { 32 | 33 | class LaunchableData; 34 | 35 | class APPSTREAMQT_EXPORT Launchable { 36 | Q_GADGET 37 | public: 38 | enum Kind { 39 | KindUnknown, 40 | KindDesktopId, 41 | KindService, 42 | KindCockpitManifest 43 | }; 44 | Q_ENUM(Kind) 45 | 46 | Launchable(); 47 | Launchable(_AsLaunchable* category); 48 | Launchable(const Launchable& category); 49 | ~Launchable(); 50 | 51 | static Kind stringToKind(const QString& kindString); 52 | static QString kindToString(Kind kind); 53 | 54 | Launchable& operator=(const Launchable& category); 55 | bool operator==(const Launchable& r) const; 56 | 57 | /** 58 | * \returns the internally stored AsLaunchable 59 | */ 60 | _AsLaunchable *asLaunchable() const; 61 | 62 | Kind kind() const; 63 | void setKind(Kind kind); 64 | 65 | QStringList entries() const; 66 | void addEntry(const QString& entry); 67 | 68 | private: 69 | QSharedDataPointer d; 70 | }; 71 | } 72 | 73 | APPSTREAMQT_EXPORT QDebug operator<<(QDebug s, const AppStream::Launchable& category); 74 | 75 | #endif // APPSTREAMQT_LAUNCHABLE_H 76 | 77 | -------------------------------------------------------------------------------- /src/as-distro-details.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_DISTRODETAILS_H 26 | #define __AS_DISTRODETAILS_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define AS_TYPE_DISTRO_DETAILS (as_distro_details_get_type ()) 33 | G_DECLARE_DERIVABLE_TYPE (AsDistroDetails, as_distro_details, AS, DISTRO_DETAILS, GObject) 34 | 35 | struct _AsDistroDetailsClass 36 | { 37 | GObjectClass parent_class; 38 | /*< private >*/ 39 | void (*_as_reserved1) (void); 40 | void (*_as_reserved2) (void); 41 | void (*_as_reserved3) (void); 42 | void (*_as_reserved4) (void); 43 | void (*_as_reserved5) (void); 44 | void (*_as_reserved6) (void); 45 | }; 46 | 47 | AsDistroDetails *as_distro_details_new (void); 48 | 49 | const gchar *as_distro_details_get_id (AsDistroDetails *distro); 50 | const gchar *as_distro_details_get_cid (AsDistroDetails *distro); 51 | const gchar *as_distro_details_get_name (AsDistroDetails *distro); 52 | const gchar *as_distro_details_get_version (AsDistroDetails *distro); 53 | const gchar *as_distro_details_get_homepage (AsDistroDetails *distro); 54 | 55 | gchar *as_distro_details_get_str (AsDistroDetails *distro, 56 | const gchar *key); 57 | gboolean as_distro_details_get_bool (AsDistroDetails *distro, 58 | const gchar *key, 59 | gboolean default_val); 60 | 61 | gchar *as_get_current_distro_component_id (void); 62 | 63 | G_END_DECLS 64 | 65 | #endif /* __AS_DISTRODETAILS_H */ 66 | -------------------------------------------------------------------------------- /qt/bundle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthias Klumpp 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #ifndef APPSTREAMQT_BUNDLE_H 21 | #define APPSTREAMQT_BUNDLE_H 22 | 23 | #include 24 | #include 25 | #include 26 | #include "appstreamqt_export.h" 27 | 28 | struct _AsBundle; 29 | namespace AppStream { 30 | 31 | class BundleData; 32 | class APPSTREAMQT_EXPORT Bundle { 33 | Q_GADGET 34 | public: 35 | Bundle(); 36 | Bundle(_AsBundle *bundle); 37 | Bundle(const Bundle& bundle); 38 | ~Bundle(); 39 | 40 | Bundle& operator=(const Bundle& bundle); 41 | bool operator==(const Bundle& r) const; 42 | 43 | /** 44 | * \returns the internally stored AsBundle 45 | */ 46 | _AsBundle *asBundle() const; 47 | 48 | enum Kind { 49 | KindUnknown, 50 | KindPackage, 51 | KindLimba, 52 | KindFlatpak, 53 | KindAppImage, 54 | KindSnap 55 | }; 56 | Q_ENUM(Kind) 57 | 58 | static Kind stringToKind(const QString& kindString); 59 | static QString kindToString(Kind kind); 60 | 61 | /** 62 | * \return the bundle kind. 63 | */ 64 | Kind kind() const; 65 | void setKind(Kind kind); 66 | 67 | /** 68 | * \return the bundle ID. 69 | */ 70 | QString id() const; 71 | void setId(const QString& id); 72 | 73 | bool isEmpty() const; 74 | 75 | private: 76 | QSharedDataPointer d; 77 | }; 78 | } 79 | 80 | APPSTREAMQT_EXPORT QDebug operator<<(QDebug s, const AppStream::Bundle& bundle); 81 | 82 | #endif // APPSTREAMQT_BUNDLE_H 83 | -------------------------------------------------------------------------------- /qt/chelpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthias Klumpp 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #ifndef APPSTREAMQT_CHELPERS_H 21 | #define APPSTREAMQT_CHELPERS_H 22 | 23 | #include 24 | #include 25 | 26 | namespace AppStream { 27 | 28 | inline QString valueWrap(const gchar *cstr) 29 | { 30 | return QString::fromUtf8(cstr); 31 | } 32 | 33 | inline QStringList valueWrap(gchar **strv) 34 | { 35 | QStringList res; 36 | if (strv == NULL) 37 | return res; 38 | for (uint i = 0; strv[i] != NULL; i++) { 39 | res.append (QString::fromUtf8(strv[i])); 40 | } 41 | return res; 42 | } 43 | 44 | inline QStringList valueWrap(GPtrArray *array) 45 | { 46 | QStringList res; 47 | res.reserve(array->len); 48 | for (uint i = 0; i < array->len; i++) { 49 | auto strval = (const gchar*) g_ptr_array_index (array, i); 50 | res.append (QString::fromUtf8(strval)); 51 | } 52 | return res; 53 | } 54 | 55 | inline QStringList valueWrap(GList *list) 56 | { 57 | GList *l; 58 | QStringList res; 59 | res.reserve(g_list_length(list)); 60 | for (l = list; l != NULL; l = l->next) { 61 | auto strval = (const gchar*) l->data; 62 | res.append (QString::fromUtf8(strval)); 63 | } 64 | return res; 65 | } 66 | 67 | inline char ** stringListToCharArray(const QStringList& list) 68 | { 69 | char **array = (char**) g_malloc(sizeof(char*) * list.size()); 70 | for (int i = 0; i < list.size(); ++i) { 71 | const QByteArray string = list[i].toLocal8Bit(); 72 | array[i] = (char*) g_malloc(sizeof(char) * (string.size() + 1)); 73 | strcpy(array[i], string.constData()); 74 | } 75 | return array; 76 | } 77 | 78 | } 79 | 80 | #endif // APPSTREAMQT_CHELPERS_H 81 | -------------------------------------------------------------------------------- /qt/suggested.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Aleix Pol Gonzalez 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #ifndef APPSTREAMQT_SUGGESTED_H 21 | #define APPSTREAMQT_SUGGESTED_H 22 | 23 | #include 24 | #include 25 | #include "appstreamqt_export.h" 26 | 27 | class QUrl; 28 | class QString; 29 | struct _AsSuggested; 30 | namespace AppStream { 31 | 32 | class SuggestedData; 33 | 34 | /** 35 | * This class provides a list of other component-ids suggested by a software component, as well 36 | * as an origin of the suggestion (manually suggested by the upstream project, or 37 | * automatically determined by heuristics).. 38 | */ 39 | class APPSTREAMQT_EXPORT Suggested { 40 | Q_GADGET 41 | public: 42 | enum Kind { 43 | KindUnknown, 44 | KindUpstream, 45 | KindHeuristic 46 | }; 47 | Q_ENUM(Kind) 48 | 49 | Suggested(); 50 | Suggested(_AsSuggested *suggested); 51 | Suggested(const Suggested& other); 52 | ~Suggested(); 53 | 54 | Suggested& operator=(const Suggested& other); 55 | 56 | /** 57 | * \returns the internally stored AsSuggested 58 | */ 59 | _AsSuggested *suggested() const; 60 | 61 | /** 62 | * \return the kind of suggestion 63 | */ 64 | Kind kind() const; 65 | void setKind(Kind kind); 66 | 67 | /** 68 | * \return the local or remote url for this suggested 69 | */ 70 | const QStringList ids() const; 71 | void addSuggested(const QString &id); 72 | 73 | private: 74 | QSharedDataPointer d; 75 | }; 76 | } 77 | 78 | APPSTREAMQT_EXPORT QDebug operator<<(QDebug s, const AppStream::Suggested& suggested); 79 | 80 | #endif // APPSTREAMQT_SUGGESTED_H 81 | -------------------------------------------------------------------------------- /src/as-checksum.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_CHECKSUM_H 26 | #define __AS_CHECKSUM_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define AS_TYPE_CHECKSUM (as_checksum_get_type ()) 33 | G_DECLARE_DERIVABLE_TYPE (AsChecksum, as_checksum, AS, CHECKSUM, GObject) 34 | 35 | struct _AsChecksumClass 36 | { 37 | GObjectClass parent_class; 38 | /*< private >*/ 39 | void (*_as_reserved1) (void); 40 | void (*_as_reserved2) (void); 41 | void (*_as_reserved3) (void); 42 | void (*_as_reserved4) (void); 43 | void (*_as_reserved5) (void); 44 | void (*_as_reserved6) (void); 45 | }; 46 | 47 | /** 48 | * AsChecksumKind: 49 | * @AS_CHECKSUM_KIND_NONE: No checksum 50 | * @AS_CHECKSUM_KIND_SHA1: SHA1 51 | * @AS_CHECKSUM_KIND_SHA256: SHA256 52 | * 53 | * Checksums supported by #AsRelease 54 | **/ 55 | typedef enum { 56 | AS_CHECKSUM_KIND_NONE, 57 | AS_CHECKSUM_KIND_SHA1, 58 | AS_CHECKSUM_KIND_SHA256, 59 | /*< private >*/ 60 | AS_CHECKSUM_KIND_LAST 61 | } AsChecksumKind; 62 | 63 | const gchar *as_checksum_kind_to_string (AsChecksumKind kind); 64 | AsChecksumKind as_checksum_kind_from_string (const gchar *kind_str); 65 | 66 | AsChecksum *as_checksum_new (void); 67 | 68 | AsChecksumKind as_checksum_get_kind (AsChecksum *cs); 69 | void as_checksum_set_kind (AsChecksum *cs, 70 | AsChecksumKind kind); 71 | 72 | const gchar *as_checksum_get_value (AsChecksum *cs); 73 | void as_checksum_set_value (AsChecksum *cs, 74 | const gchar *value); 75 | 76 | G_END_DECLS 77 | 78 | #endif /* __AS_CHECKSUM_H */ 79 | -------------------------------------------------------------------------------- /src/as-news-convert.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2018-2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_NEWS_CONVERT_H 26 | #define __AS_NEWS_CONVERT_H 27 | 28 | #include 29 | #include "as-release.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | /** 34 | * AsNewsFormatKind: 35 | * @AS_NEWS_FORMAT_KIND_UNKNOWN: Unknown release info format. 36 | * @AS_NEWS_FORMAT_KIND_YAML: YAML release information. 37 | * @AS_NEWS_FORMAT_KIND_TEXT: Pure text release information. 38 | * 39 | * Format of a NEWS file. 40 | **/ 41 | typedef enum { 42 | AS_NEWS_FORMAT_KIND_UNKNOWN, 43 | AS_NEWS_FORMAT_KIND_YAML, 44 | AS_NEWS_FORMAT_KIND_TEXT, 45 | /*< private >*/ 46 | AS_NEWS_FORMAT_KIND_LAST 47 | } AsNewsFormatKind; 48 | 49 | const gchar *as_news_format_kind_to_string (AsNewsFormatKind kind); 50 | AsNewsFormatKind as_news_format_kind_from_string (const gchar *kind_str); 51 | 52 | GPtrArray *as_news_to_releases_from_data (const gchar *data, 53 | AsNewsFormatKind kind, 54 | GError **error); 55 | GPtrArray *as_news_to_releases_from_file (const gchar *fname, 56 | AsNewsFormatKind kind, 57 | GError **error); 58 | 59 | gchar *as_releases_to_metainfo_xml_chunk (GPtrArray *releases, GError **error); 60 | 61 | gboolean as_releases_to_news_data (GPtrArray *releases, 62 | AsNewsFormatKind kind, 63 | gchar **news_data, 64 | GError **error); 65 | gboolean as_releases_to_news_file (GPtrArray *releases, 66 | const gchar *fname, 67 | AsNewsFormatKind kind, 68 | GError **error); 69 | 70 | G_END_DECLS 71 | 72 | #endif /* __AS_NEWS_CONVERT_H */ 73 | -------------------------------------------------------------------------------- /docs/sources/services/urihandler.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 |
8 | URI Handler 9 | 10 |
11 | Introduction 12 | 13 | In order to allow installation of AppStream components from websites, software-centers implementing AppStream 14 | may choose to also support the appstream: URIs. 15 | 16 | 17 | This allows upstream projects to trigger an installation of their application from their homepage on any supporting 18 | distribution. 19 | It also is helpful for web-based software-centers. 20 | 21 |
22 | 23 |
24 | URI schema 25 | 26 | Software-centers handling appstream: URIs must provide a handler for the x-scheme-handler/appstream 27 | mimetype. 28 | An AppStream URI follows the schema appstream:%{component-id}. 29 | 30 | 31 | Example HTML code: 32 | 33 | Install KDE Discover 34 | Install GNOME-Software 35 | Install libappstream]]> 36 |
37 | 38 |
39 | AppStream Buttons 40 | 41 | If you want to allow users to open your software in their local software center from your website, you might want to use 42 | one of the easily recognizable AppStream buttons for your appstream: link. 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | SVG 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | SVG 61 | 62 | 63 | 64 |
65 |
66 | -------------------------------------------------------------------------------- /qt/provided.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Sune Vuorela 3 | * Copyright (C) 2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef APPSTREAMQT_PROVIDED_H 22 | #define APPSTREAMQT_PROVIDED_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include "appstreamqt_export.h" 28 | 29 | struct _AsProvided; 30 | 31 | namespace AppStream { 32 | 33 | class ProvidedData; 34 | 35 | class APPSTREAMQT_EXPORT Provided { 36 | Q_GADGET 37 | public: 38 | Provided(); 39 | Provided(_AsProvided *prov); 40 | Provided(const Provided& other); 41 | ~Provided(); 42 | Provided& operator=(const Provided& other); 43 | bool operator==(const Provided& other) const; 44 | 45 | /** 46 | * \returns the internally stored AsProvided 47 | */ 48 | _AsProvided *asProvided() const; 49 | 50 | enum Kind { 51 | KindUnknown, 52 | KindLibrary, 53 | KindBinary, 54 | KindMimetype, 55 | KindFont, 56 | KindModalias, 57 | KindPython2Module, 58 | KindPython3Module, 59 | KindDBusSystemService, 60 | KindDBusUserService, 61 | KindFirmwareRuntime, 62 | KindFirmwareFlashed 63 | }; 64 | Q_ENUM(Kind) 65 | 66 | static Kind stringToKind(const QString& kind); 67 | static QString kindToString(Kind kind); 68 | 69 | Kind kind() const; 70 | 71 | QStringList items() const; 72 | bool hasItem(const QString &item) const; 73 | 74 | bool isEmpty() const; 75 | 76 | private: 77 | QSharedDataPointer d; 78 | }; 79 | } 80 | 81 | APPSTREAMQT_EXPORT QDebug operator<<(QDebug s, const AppStream::Provided& provides); 82 | 83 | #endif // APPSTREAMQT_PROVIDED_H 84 | -------------------------------------------------------------------------------- /docs/sources/collection/iconcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 |
8 | Icon Cache 9 | 10 |
11 | Introduction 12 | 13 | 14 | In order to display icons in software-centers, distributors should offer a repository of cached icons for applications defined in their AppStream XML files. 15 | The icons should be PNG files or vectorgraphics (PNG is preferred) and match the name referenced in the applications .desktop file. 16 | Their size should be 64x64px, it is okay to just provide one size. 17 | 18 |
19 | 20 |
21 | Filesystem locations 22 | 23 | All icons of type cached must be placed in /usr/share/app-info/icons/%{origin}/%{size}/ or /var/cache/app-info/icons/%{origin}/%{size}/, 24 | where origin is the AppStream data origin defined in the AppStream data file (see ), and size 25 | is 64x64 or 128x128 depending on the size of the icon. And icon might be present with different sizes in both directories. 26 | 27 | 28 | For example the cache icon krita.png of a component in a data file with the origin jessie should be stored in 29 | /usr/share/app-info/icons/jessie/64x64/krita.png (or in the /var/cache location). 30 | 31 | 32 | Icon sclaing factors commonly used for HiDPI display support are part of the size-directory filename and are separated from the regular size via an @ sign. 33 | If the scaling factor is 1, it must be omitted from the directory name. 34 | For example, if the icon scaling factor is 2 for icons of size 64x64 from origin jessie, the icon must be placed 35 | in /usr/share/app-info/icons/jessie/64x64@2/. 36 | 37 | 38 | Legacy Support 39 | 40 | In order to support the old icon cache layout, client applications may also look for icons in the folder below the size-directories, assuming 41 | that the icons placed there are of size 64x64 pixels. 42 | 43 | 44 |
45 | 46 |
47 | -------------------------------------------------------------------------------- /tests/ci/build_and_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "C compiler: $CC" 5 | echo "C++ compiler: $CXX" 6 | set -x 7 | 8 | # 9 | # This script is supposed to run inside the AppStream Docker container 10 | # on the CI system. 11 | # 12 | 13 | $CC --version 14 | 15 | # configure AppStream build with all flags enabled 16 | mkdir build && cd build 17 | meson --prefix /usr \ 18 | -Dmaintainer=false \ 19 | -Ddocs=true \ 20 | -Dqt=true \ 21 | -Dapt-support=true \ 22 | -Dvapi=true \ 23 | .. 24 | 25 | # Build, Test & Install 26 | # (the number of Ninja jobs needs to be limited, so Travis doesn't kill us) 27 | ninja -j4 28 | ninja documentation 29 | # ninja test -v # FIXME 30 | DESTDIR=/tmp/install_root/ ninja install 31 | 32 | # We need a desktop file 33 | mkdir -p /tmp/install_root/usr/share/applications/ 34 | cat > /tmp/install_root/usr/share/applications/appstreamcli.desktop <<\EOF 35 | [Desktop Entry] 36 | Type=Application 37 | Name=appstreamcli 38 | Comment=Handle AppStream metadata and the AppStream index 39 | Exec=appstreamcli 40 | Icon=appstreamcli 41 | Terminal=true 42 | Categories=Development; 43 | EOF 44 | 45 | # We need an icon 46 | wget -c "http://blog.tenstral.net/wp-content/uploads/2012/08/softwarecenter-work.png" -O /tmp/install_root/appstreamcli.png 47 | 48 | # We do not want to bundle the Qt library and its dependencies 49 | rm /tmp/install_root/usr/lib/x86_64-linux-gnu/libAppStreamQt* || true 50 | 51 | # Make and upload a standalone AppImage 52 | find /tmp/install_root/ 53 | wget -c -nv https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2) 54 | chmod +x ./appimagetool-*.AppImage 55 | ./appimagetool-*.AppImage deploy /tmp/install_root/usr/share/applications/appstreamcli.desktop --appimage-extract-and-run 56 | find /tmp/appimage_extracted_* || true # For https://github.com/AppImage/AppImageKit/issues/1013 57 | ./appimagetool-*.AppImage /tmp/install_root --appimage-extract-and-run 58 | find /tmp/appimage_extracted_* || true # For https://github.com/AppImage/AppImageKit/issues/1013 59 | 60 | # Rebuild everything with Sanitizers enabled 61 | # FIXME: Doesn't work properly with Clang at time, so we only run this test with GCC. 62 | cd .. && rm -rf build && mkdir build && cd build 63 | 64 | # FIXME: we can not build with sanitizers at the moment, because Meson/g-ir-scanner is buggy 65 | # Add -Db_sanitize=address,undefined to try the full thing. 66 | #meson -Dmaintainer=true \ 67 | # -Dqt=true \ 68 | # -Dapt-support=true \ 69 | # -Dvapi=true \ 70 | # -Db_sanitize=address \ 71 | # .. 72 | #if [ "$CC" != "clang" ]; then ninja -j4 && ninja test -v; fi 73 | -------------------------------------------------------------------------------- /src/as-issue.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_ISSUE_H 26 | #define __AS_ISSUE_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define AS_TYPE_ISSUE (as_issue_get_type ()) 33 | G_DECLARE_DERIVABLE_TYPE (AsIssue, as_issue, AS, ISSUE, GObject) 34 | 35 | struct _AsIssueClass 36 | { 37 | GObjectClass parent_class; 38 | /*< private >*/ 39 | void (*_as_reserved1) (void); 40 | void (*_as_reserved2) (void); 41 | void (*_as_reserved3) (void); 42 | void (*_as_reserved4) (void); 43 | void (*_as_reserved5) (void); 44 | void (*_as_reserved6) (void); 45 | }; 46 | 47 | /** 48 | * AsIssueKind: 49 | * @AS_ISSUE_KIND_UNKNOWN: Unknown issue type 50 | * @AS_ISSUE_KIND_GENERIC: Generic issue type 51 | * @AS_ISSUE_KIND_CVE: Common Vulnerabilities and Exposures issue 52 | * 53 | * Checksums supported by #AsRelease 54 | **/ 55 | typedef enum { 56 | AS_ISSUE_KIND_UNKNOWN, 57 | AS_ISSUE_KIND_GENERIC, 58 | AS_ISSUE_KIND_CVE, 59 | /*< private >*/ 60 | AS_ISSUE_KIND_LAST 61 | } AsIssueKind; 62 | 63 | const gchar *as_issue_kind_to_string (AsIssueKind kind); 64 | AsIssueKind as_issue_kind_from_string (const gchar *kind_str); 65 | 66 | AsIssue *as_issue_new (void); 67 | 68 | AsIssueKind as_issue_get_kind (AsIssue *issue); 69 | void as_issue_set_kind (AsIssue *issue, 70 | AsIssueKind kind); 71 | 72 | const gchar *as_issue_get_id (AsIssue *issue); 73 | void as_issue_set_id (AsIssue *issue, 74 | const gchar *id); 75 | 76 | const gchar *as_issue_get_url (AsIssue *issue); 77 | void as_issue_set_url (AsIssue *issue, 78 | const gchar *url); 79 | 80 | G_END_DECLS 81 | 82 | #endif /* __AS_ISSUE_H */ 83 | -------------------------------------------------------------------------------- /qt/contentrating.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (C) 2017 Jan Grulich 4 | * Copyright (C) 2016 Matthias Klumpp 5 | * 6 | * Licensed under the GNU Lesser General Public License Version 2.1 7 | * 8 | * This library is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 2.1 of the license, or 11 | * (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this library. If not, see . 20 | */ 21 | 22 | #ifndef APPSTREAMQT_CONTENT_RATING_H 23 | #define APPSTREAMQT_CONTENT_RATING_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include "appstreamqt_export.h" 29 | 30 | struct _AsContentRating; 31 | 32 | namespace AppStream { 33 | 34 | class ContentRatingData; 35 | 36 | class APPSTREAMQT_EXPORT ContentRating { 37 | Q_GADGET 38 | 39 | public: 40 | enum RatingValue { 41 | RatingValueUnknown, 42 | RatingValueNone, 43 | RatingValueMild, 44 | RatingValueModerate, 45 | RatingValueIntense 46 | }; 47 | Q_ENUM(RatingValue) 48 | 49 | ContentRating(); 50 | ContentRating(_AsContentRating* category); 51 | ContentRating(const ContentRating& category); 52 | ~ContentRating(); 53 | 54 | static RatingValue stringToRatingValue(const QString& ratingValue); 55 | static QString ratingValueToString(RatingValue ratingValue); 56 | 57 | ContentRating& operator=(const ContentRating& category); 58 | bool operator==(const ContentRating& r) const; 59 | 60 | /** 61 | * \returns the internally stored AsContentRating 62 | */ 63 | _AsContentRating *asContentRating() const; 64 | 65 | QString kind() const; 66 | void setKind(const QString& kind); 67 | 68 | uint minimumAge() const; 69 | 70 | RatingValue value(const QString& id) const; 71 | void setValue(const QString& id, RatingValue ratingValue); 72 | 73 | private: 74 | QSharedDataPointer d; 75 | }; 76 | } 77 | 78 | APPSTREAMQT_EXPORT QDebug operator<<(QDebug s, const AppStream::ContentRating& category); 79 | 80 | #endif // APPSTREAMQT_CONTENT_RATING_H 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/as-translation.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_TRANSLATION_H 26 | #define __AS_TRANSLATION_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define AS_TYPE_TRANSLATION (as_translation_get_type ()) 33 | G_DECLARE_DERIVABLE_TYPE (AsTranslation, as_translation, AS, TRANSLATION, GObject) 34 | 35 | struct _AsTranslationClass 36 | { 37 | GObjectClass parent_class; 38 | /*< private >*/ 39 | void (*_as_reserved1) (void); 40 | void (*_as_reserved2) (void); 41 | void (*_as_reserved3) (void); 42 | void (*_as_reserved4) (void); 43 | void (*_as_reserved5) (void); 44 | void (*_as_reserved6) (void); 45 | }; 46 | 47 | /** 48 | * AsTranslationKind: 49 | * @AS_TRANSLATION_KIND_UNKNOWN: Type invalid or not known 50 | * @AS_TRANSLATION_KIND_GETTEXT: Gettext translation domain 51 | * @AS_TRANSLATION_KIND_QT: Qt translation domain 52 | * 53 | * The translation type. 54 | **/ 55 | typedef enum { 56 | AS_TRANSLATION_KIND_UNKNOWN, 57 | AS_TRANSLATION_KIND_GETTEXT, 58 | AS_TRANSLATION_KIND_QT, 59 | /*< private >*/ 60 | AS_TRANSLATION_KIND_LAST 61 | } AsTranslationKind; 62 | 63 | const gchar *as_translation_kind_to_string (AsTranslationKind kind); 64 | AsTranslationKind as_translation_kind_from_string (const gchar *kind_str); 65 | 66 | AsTranslation *as_translation_new (void); 67 | 68 | AsTranslationKind as_translation_get_kind (AsTranslation *tr); 69 | void as_translation_set_kind (AsTranslation *tr, 70 | AsTranslationKind kind); 71 | 72 | const gchar *as_translation_get_id (AsTranslation *tr); 73 | void as_translation_set_id (AsTranslation *tr, 74 | const gchar *id); 75 | 76 | G_END_DECLS 77 | 78 | #endif /* __AS_TRANSLATION_H */ 79 | -------------------------------------------------------------------------------- /src/as-validator.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_VALIDATOR_H 26 | #define __AS_VALIDATOR_H 27 | 28 | #include 29 | #include "as-validator-issue.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define AS_TYPE_VALIDATOR (as_validator_get_type ()) 34 | G_DECLARE_DERIVABLE_TYPE (AsValidator, as_validator, AS, VALIDATOR, GObject) 35 | 36 | struct _AsValidatorClass 37 | { 38 | GObjectClass parent_class; 39 | /*< private >*/ 40 | void (*_as_reserved1) (void); 41 | void (*_as_reserved2) (void); 42 | void (*_as_reserved3) (void); 43 | void (*_as_reserved4) (void); 44 | void (*_as_reserved5) (void); 45 | void (*_as_reserved6) (void); 46 | }; 47 | 48 | AsValidator *as_validator_new (void); 49 | 50 | void as_validator_clear_issues (AsValidator *validator); 51 | gboolean as_validator_validate_file (AsValidator *validator, 52 | GFile* metadata_file); 53 | gboolean as_validator_validate_data (AsValidator *validator, 54 | const gchar *metadata); 55 | gboolean as_validator_validate_tree (AsValidator *validator, 56 | const gchar *root_dir); 57 | 58 | GList *as_validator_get_issues (AsValidator *validator); 59 | GHashTable *as_validator_get_issues_per_file (AsValidator *validator); 60 | gboolean as_validator_get_report_yaml (AsValidator *validator, 61 | gchar **yaml_report); 62 | 63 | gboolean as_validator_get_check_urls (AsValidator *validator); 64 | void as_validator_set_check_urls (AsValidator *validator, 65 | gboolean value); 66 | 67 | const gchar *as_validator_get_tag_explanation (AsValidator *validator, 68 | const gchar *tag); 69 | AsIssueSeverity as_validator_get_tag_severity (AsValidator *validator, 70 | const gchar *tag); 71 | gchar **as_validator_get_tags (AsValidator *validator); 72 | 73 | G_END_DECLS 74 | 75 | #endif /* __AS_VALIDATOR_H */ 76 | -------------------------------------------------------------------------------- /docs/sources/metainfo/MetaInfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 | Upstream Metadata 8 | 9 | AppStream allows upstream projects to define metadata about the components they provide using small XML files, 10 | metainfo files, which get installed into locations on the client system and are used by distribuors to enhance their 11 | metadata. 12 | 13 | 14 | A "component" is a piece of software, like an application, a library, a font or a codec. For several components, especially 15 | those which are shown in software-centers, we provide specialized metainfo files to define specific properties and data of these components. 16 | For example, applications and fonts support screenshots, while codecs don't. 17 | 18 | 19 | All metainfo files need to contain a minimal amount of information, defined in the "Generic Component" section, which also describes some optional 20 | elements which can be used. 21 | Specialized components might require more information to be complete and valid. 22 | 23 | 24 | The XML in metainfo files does not need any XML namespace, and adding one should generally be avoided. 25 | If you want to use a namespace though (maybe in case you want to embed the data in other contexts), the xmlns 26 | should be https://specifications.freedesktop.org/metainfo/1.0. 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/as-suggested.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2016 Lucas Moura 4 | * Copyright (C) 2017 Matthias Klumpp 5 | * 6 | * Licensed under the GNU Lesser General Public License Version 2.1 7 | * 8 | * This library is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 2.1 of the license, or 11 | * (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this library. If not, see . 20 | */ 21 | 22 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 23 | #error "Only can be included directly." 24 | #endif 25 | 26 | #ifndef __AS_SUGGESTED_H 27 | #define __AS_SUGGESTED_H 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define AS_TYPE_SUGGESTED (as_suggested_get_type ()) 34 | G_DECLARE_DERIVABLE_TYPE (AsSuggested, as_suggested, AS, SUGGESTED, GObject) 35 | 36 | struct _AsSuggestedClass 37 | { 38 | GObjectClass parent_class; 39 | /*< private >*/ 40 | void (*_as_reserved1) (void); 41 | void (*_as_reserved2) (void); 42 | void (*_as_reserved3) (void); 43 | void (*_as_reserved4) (void); 44 | void (*_as_reserved5) (void); 45 | void (*_as_reserved6) (void); 46 | }; 47 | 48 | /** 49 | * AsSuggestedKind: 50 | * @AS_SUGGESTED_KIND_UNKNOWN: Unknown suggested kind 51 | * @AS_SUGGESTED_KIND_UPSTREAM: Suggestions provided by the upstream project. 52 | * @AS_SUGGESTED_KIND_HEURISTIC: Suggestions provided by automatic heuristics. 53 | * 54 | * The suggested type. 55 | **/ 56 | typedef enum { 57 | AS_SUGGESTED_KIND_UNKNOWN, 58 | AS_SUGGESTED_KIND_UPSTREAM, 59 | AS_SUGGESTED_KIND_HEURISTIC, 60 | /*< private >*/ 61 | AS_SUGGESTED_KIND_LAST 62 | } AsSuggestedKind; 63 | 64 | AsSuggestedKind as_suggested_kind_from_string (const gchar *kind_str); 65 | const gchar *as_suggested_kind_to_string (AsSuggestedKind kind); 66 | 67 | AsSuggested *as_suggested_new (void); 68 | 69 | AsSuggestedKind as_suggested_get_kind (AsSuggested *suggested); 70 | void as_suggested_set_kind (AsSuggested *suggested, 71 | AsSuggestedKind kind); 72 | 73 | GPtrArray *as_suggested_get_ids (AsSuggested *suggested); 74 | void as_suggested_add_id (AsSuggested *suggested, 75 | const gchar *cid); 76 | 77 | gboolean as_suggested_is_valid (AsSuggested *suggested); 78 | 79 | G_END_DECLS 80 | 81 | #endif /* __AS_SUGGESTED_H */ 82 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Create AppStream release tarball from version control system 4 | # 5 | set -e 6 | OPTION_SPEC="version:,git-tag:,sign" 7 | PARSED_OPTIONS=$(getopt -n "$0" -a -o h --l "$OPTION_SPEC" -- "$@") 8 | 9 | eval set -- "$PARSED_OPTIONS" 10 | 11 | if [ $? != 0 ] ; then usage ; exit 1 ; fi 12 | 13 | while true ; do 14 | case "$1" in 15 | --version ) case "$2" in 16 | "") echo "version parameter needs an argument!"; exit 3 ;; 17 | *) export APPSTREAM_VERSION=$2 ; shift 2 ;; 18 | esac ;; 19 | --git-tag ) case "$2" in 20 | "") echo "git-tag parameter needs an argument!"; exit 3 ;; 21 | *) export GIT_TAG=$2 ; shift 2 ;; 22 | esac ;; 23 | --sign ) SIGN_RELEASE=1; shift; ;; 24 | --) shift ; break ;; 25 | * ) echo "ERROR: unknown flag $1"; exit 2;; 26 | esac 27 | done 28 | 29 | if [ "$APPSTREAM_VERSION" = "" ]; then 30 | echo "No AppStream version set!" 31 | exit 1 32 | fi 33 | if [ "$GIT_TAG" = "" ]; then 34 | echo "No Git tag set!" 35 | exit 1 36 | fi 37 | 38 | BUILD_DIR=$(pwd)/build/release/ 39 | INSTALL_DIR=$(pwd)/build/release_install 40 | 41 | rm -rf ./release-tar-tmp 42 | rm -rf $BUILD_DIR 43 | rm -rf $INSTALL_DIR 44 | 45 | mkdir -p $BUILD_DIR 46 | cd $BUILD_DIR 47 | meson -Dmaintainer=true \ 48 | -Ddocs=true \ 49 | -Dqt=true \ 50 | -Dapt-support=true \ 51 | -Dvapi=true \ 52 | ../.. 53 | cd ../.. 54 | 55 | # check if we can build AppStream 56 | ninja -C $BUILD_DIR 57 | ninja -C $BUILD_DIR documentation 58 | 59 | # fake install 60 | DESTDIR=$INSTALL_DIR ninja -C $BUILD_DIR install 61 | 62 | mkdir -p ./release-tar-tmp 63 | git archive --prefix="AppStream-$APPSTREAM_VERSION/" "$GIT_TAG^{tree}" | tar -x -C ./release-tar-tmp 64 | 65 | R_ROOT="./release-tar-tmp/AppStream-$APPSTREAM_VERSION" 66 | 67 | # add precompiled documentation to the release tarball 68 | rm -rf $R_ROOT/docs/html/ 69 | cp -dpr ./docs/html/ $R_ROOT/docs 70 | 71 | # cleanup files which should not go to the release tarball 72 | find ./release-tar-tmp -name .gitignore -type f -delete 73 | find ./release-tar-tmp -name '*~' -type f -delete 74 | find ./release-tar-tmp -name '*.bak' -type f -delete 75 | find ./release-tar-tmp -name '*.o' -type f -delete 76 | rm -f $R_ROOT/.travis.yml 77 | rm $R_ROOT/release.sh 78 | 79 | # create release tarball 80 | cd ./release-tar-tmp 81 | tar cvJf "AppStream-$APPSTREAM_VERSION.tar.xz" "./AppStream-$APPSTREAM_VERSION/" 82 | mv "AppStream-$APPSTREAM_VERSION.tar.xz" ../ 83 | cd .. 84 | 85 | # cleanup 86 | rm -r ./release-tar-tmp 87 | rm -r $BUILD_DIR 88 | 89 | # NOTE: we do not remove INSTALL_DIR here, because we want to upload the documentation that was generated 90 | # during the install process from this directory, as part of the release process. 91 | 92 | # sign release, if flag is set 93 | if [ "$SIGN_RELEASE" = "1" ]; then 94 | gpg --armor --sign --detach-sig "AppStream-$APPSTREAM_VERSION.tar.xz" 95 | fi 96 | -------------------------------------------------------------------------------- /contrib/apt-conf/50appstream: -------------------------------------------------------------------------------- 1 | ## This file is provided by appstreamcli(1) to download DEP-11 2 | ## metadata files. 3 | 4 | Acquire::IndexTargets { 5 | # The YAML metadata files 6 | deb::DEP-11 { 7 | MetaKey "$(COMPONENT)/dep11/Components-$(NATIVE_ARCHITECTURE).yml"; 8 | ShortDescription "Components-$(NATIVE_ARCHITECTURE)"; 9 | Description "$(RELEASE)/$(COMPONENT) $(NATIVE_ARCHITECTURE) DEP-11 Metadata"; 10 | 11 | KeepCompressed "true"; 12 | KeepCompressedAs "gz"; 13 | }; 14 | 15 | # Small icons for GUI components described in the DEP-11 16 | # YAML metadata. 17 | deb::DEP-11-icons-small { 18 | MetaKey "$(COMPONENT)/dep11/icons-48x48.tar"; 19 | ShortDescription "icons-48x48"; 20 | Description "$(RELEASE)/$(COMPONENT) DEP-11 48x48 Icons"; 21 | 22 | KeepCompressed "true"; 23 | KeepCompressedAs "gz"; 24 | DefaultEnabled "false"; 25 | }; 26 | 27 | # Normal-sized icons for GUI components described in the DEP-11 28 | # YAML metadata. 29 | deb::DEP-11-icons { 30 | MetaKey "$(COMPONENT)/dep11/icons-64x64.tar"; 31 | ShortDescription "icons-64x64"; 32 | Description "$(RELEASE)/$(COMPONENT) DEP-11 64x64 Icons"; 33 | 34 | KeepCompressed "true"; 35 | KeepCompressedAs "gz"; 36 | DefaultEnabled "false"; 37 | }; 38 | 39 | # Icons suitable for HiDPI displays, for GUI components described in 40 | # the DEP-11 YAML metadata. 41 | deb::DEP-11-icons-hidpi { 42 | MetaKey "$(COMPONENT)/dep11/icons-64x64@2.tar"; 43 | ShortDescription "icons-64x64@2"; 44 | Description "$(RELEASE)/$(COMPONENT) DEP-11 64x64@2 Icons"; 45 | 46 | KeepCompressed "true"; 47 | KeepCompressedAs "gz"; 48 | DefaultEnabled "false"; 49 | }; 50 | 51 | # Larger icons that are often used on HiDPI displays as fallback. 52 | deb::DEP-11-icons-large { 53 | MetaKey "$(COMPONENT)/dep11/icons-128x128.tar"; 54 | ShortDescription "icons-128x128"; 55 | Description "$(RELEASE)/$(COMPONENT) DEP-11 128x128 Icons"; 56 | 57 | KeepCompressed "true"; 58 | KeepCompressedAs "gz"; 59 | DefaultEnabled "false"; 60 | }; 61 | 62 | # Even larger icons that are used on HiDPI displays. 63 | deb::DEP-11-icons-large-hidpi { 64 | MetaKey "$(COMPONENT)/dep11/icons-128x128@2.tar"; 65 | ShortDescription "icons-128x128@2"; 66 | Description "$(RELEASE)/$(COMPONENT) DEP-11 128x128@2 Icons"; 67 | 68 | KeepCompressed "true"; 69 | KeepCompressedAs "gz"; 70 | DefaultEnabled "false"; 71 | }; 72 | }; 73 | 74 | # Refresh AppStream cache when APT's cache is updated (i.e. apt update) 75 | APT::Update::Post-Invoke-Success { 76 | "if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null || true; fi"; 77 | }; 78 | -------------------------------------------------------------------------------- /src/as-bundle.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_BUNDLE_H 26 | #define __AS_BUNDLE_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define AS_TYPE_BUNDLE (as_bundle_get_type ()) 33 | G_DECLARE_DERIVABLE_TYPE (AsBundle, as_bundle, AS, BUNDLE, GObject) 34 | 35 | struct _AsBundleClass 36 | { 37 | GObjectClass parent_class; 38 | /*< private >*/ 39 | void (*_as_reserved1) (void); 40 | void (*_as_reserved2) (void); 41 | void (*_as_reserved3) (void); 42 | void (*_as_reserved4) (void); 43 | void (*_as_reserved5) (void); 44 | void (*_as_reserved6) (void); 45 | }; 46 | 47 | /** 48 | * AsBundleKind: 49 | * @AS_BUNDLE_KIND_UNKNOWN: Type invalid or not known 50 | * @AS_BUNDLE_KIND_PACKAGE: A native package (currently not used) 51 | * @AS_BUNDLE_KIND_LIMBA: A Limba bundle 52 | * @AS_BUNDLE_KIND_FLATPAK: A Flatpak bundle 53 | * @AS_BUNDLE_KIND_APPIMAGE: An AppImageKit bundle 54 | * @AS_BUNDLE_KIND_SNAP: A Snap/Snappy bundle 55 | * @AS_BUNDLE_KIND_TARBALL: A (maybe compressed) tarball. 56 | * 57 | * The bundle type. 58 | **/ 59 | typedef enum { 60 | AS_BUNDLE_KIND_UNKNOWN, 61 | AS_BUNDLE_KIND_PACKAGE, 62 | AS_BUNDLE_KIND_LIMBA, 63 | AS_BUNDLE_KIND_FLATPAK, 64 | AS_BUNDLE_KIND_APPIMAGE, 65 | AS_BUNDLE_KIND_SNAP, 66 | AS_BUNDLE_KIND_TARBALL, 67 | /*< private >*/ 68 | AS_BUNDLE_KIND_LAST 69 | } AsBundleKind; 70 | 71 | const gchar *as_bundle_kind_to_string (AsBundleKind kind); 72 | AsBundleKind as_bundle_kind_from_string (const gchar *bundle_str); 73 | 74 | AsBundle *as_bundle_new (void); 75 | 76 | AsBundleKind as_bundle_get_kind (AsBundle *bundle); 77 | void as_bundle_set_kind (AsBundle *bundle, 78 | AsBundleKind kind); 79 | 80 | const gchar *as_bundle_get_id (AsBundle *bundle); 81 | void as_bundle_set_id (AsBundle *bundle, 82 | const gchar *id); 83 | 84 | G_END_DECLS 85 | 86 | #endif /* __AS_BUNDLE_H */ 87 | -------------------------------------------------------------------------------- /qt/meson.build: -------------------------------------------------------------------------------- 1 | # Meson definition for AppStream Qt 2 | 3 | asqt_api_level = '2' 4 | 5 | add_languages('cpp') 6 | 7 | qt = import('qt5') 8 | qt5_dep = dependency('qt5', modules: ['Core']) 9 | 10 | asqt_src = [ 11 | 'category.cpp', 12 | 'component.cpp', 13 | 'pool.cpp', 14 | 'image.cpp', 15 | 'video.cpp', 16 | 'screenshot.cpp', 17 | 'icon.cpp', 18 | 'provided.cpp', 19 | 'release.cpp', 20 | 'bundle.cpp', 21 | 'suggested.cpp', 22 | 'contentrating.cpp', 23 | 'launchable.cpp', 24 | 'translation.cpp', 25 | 'metadata.cpp', 26 | 'spdx.cpp', 27 | 'utils.cpp' 28 | ] 29 | 30 | asqt_pub_headers = [ 31 | 'appstreamqt_export.h', 32 | 'category.h', 33 | 'component.h', 34 | 'pool.h', 35 | 'image.h', 36 | 'video.h', 37 | 'screenshot.h', 38 | 'icon.h', 39 | 'provided.h', 40 | 'release.h', 41 | 'bundle.h', 42 | 'suggested.h', 43 | 'contentrating.h', 44 | 'launchable.h', 45 | 'translation.h', 46 | 'metadata.h', 47 | 'spdx.h', 48 | 'utils.h' 49 | ] 50 | 51 | asqt_priv_headers = [ 52 | ] 53 | 54 | asqt_moc = qt.preprocess ( 55 | moc_headers: asqt_pub_headers + asqt_priv_headers, 56 | #moc_sources: asqt_src 57 | ) 58 | 59 | asqt_cpp_args = [] 60 | if get_option('maintainer') 61 | asqt_cpp_args = ['-Wno-inline'] 62 | endif 63 | 64 | appstreamqt_lib = library ('AppStreamQt', 65 | [asqt_src, 66 | asqt_pub_headers, 67 | asqt_priv_headers, 68 | asqt_moc], 69 | soversion: asqt_api_level, 70 | version: as_version, 71 | dependencies: [qt5_dep, 72 | glib_dep, 73 | gobject_dep, 74 | gio_dep], 75 | link_with: [appstream_lib], 76 | include_directories: [appstream_lib_inc], 77 | cpp_args: asqt_cpp_args, 78 | install: true 79 | ) 80 | 81 | install_headers(asqt_pub_headers, subdir: 'AppStreamQt') 82 | 83 | subdir('tests/') 84 | 85 | # 86 | # CMake support 87 | # 88 | 89 | cmake_data = configuration_data() 90 | cmake_data.set('LIBDIR_FULL', join_paths(get_option('prefix'), get_option('libdir'))) 91 | cmake_data.set('PREFIX', get_option('prefix')) 92 | cmake_data.set('VERSION', as_version) 93 | 94 | configure_file (input: 'cmake/AppStreamQtConfig.cmake.in', 95 | output: 'AppStreamQtConfig.cmake', 96 | configuration: cmake_data 97 | ) 98 | configure_file (input: 'cmake/AppStreamQtConfigVersion.cmake.in', 99 | output: 'AppStreamQtConfigVersion.cmake', 100 | configuration: cmake_data 101 | ) 102 | 103 | install_data ( 104 | join_paths(meson.current_build_dir(), 'AppStreamQtConfig.cmake'), 105 | join_paths(meson.current_build_dir(), 'AppStreamQtConfigVersion.cmake'), 106 | install_dir: join_paths(get_option('libdir'), 'cmake', 'AppStreamQt') 107 | ) 108 | -------------------------------------------------------------------------------- /src/as-agreement-section.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2018 Richard Hughes 4 | * Copyright (C) 2018 Matthias Klumpp 5 | * 6 | * Licensed under the GNU Lesser General Public License Version 2.1 7 | * 8 | * This library is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 2.1 of the license, or 11 | * (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this library. If not, see . 20 | */ 21 | 22 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 23 | #error "Only can be included directly." 24 | #endif 25 | 26 | #ifndef __AS_AGREEMENT_SECTION_H 27 | #define __AS_AGREEMENT_SECTION_H 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define AS_TYPE_AGREEMENT_SECTION (as_agreement_section_get_type ()) 34 | G_DECLARE_DERIVABLE_TYPE (AsAgreementSection, as_agreement_section, AS, AGREEMENT_SECTION, GObject) 35 | 36 | struct _AsAgreementSectionClass 37 | { 38 | GObjectClass parent_class; 39 | /*< private >*/ 40 | void (*_as_reserved1) (void); 41 | void (*_as_reserved2) (void); 42 | void (*_as_reserved3) (void); 43 | void (*_as_reserved4) (void); 44 | void (*_as_reserved5) (void); 45 | void (*_as_reserved6) (void); 46 | void (*_as_reserved7) (void); 47 | void (*_as_reserved8) (void); 48 | }; 49 | 50 | AsAgreementSection *as_agreement_section_new (void); 51 | 52 | const gchar *as_agreement_section_get_kind (AsAgreementSection *agreement_section); 53 | void as_agreement_section_set_kind (AsAgreementSection *agreement_section, 54 | const gchar *kind); 55 | 56 | const gchar *as_agreement_section_get_name (AsAgreementSection *agreement_section); 57 | void as_agreement_section_set_name (AsAgreementSection *agreement_section, 58 | const gchar *name, 59 | const gchar *locale); 60 | 61 | const gchar *as_agreement_section_get_description (AsAgreementSection *agreement_section); 62 | void as_agreement_section_set_description (AsAgreementSection *agreement_section, 63 | const gchar *desc, 64 | const gchar *locale); 65 | 66 | const gchar *as_agreement_section_get_active_locale (AsAgreementSection *agreement_section); 67 | void as_agreement_section_set_active_locale (AsAgreementSection *agreement_section, 68 | const gchar *locale); 69 | 70 | G_END_DECLS 71 | 72 | #endif /* __AS_AGREEMENT_SECTION_H */ 73 | -------------------------------------------------------------------------------- /docs/api/appstream-docs.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | ]> 7 | 8 | 9 | AppStream Library Reference Manual 10 | 11 | The latest version of this documentation can be found on-line at 12 | freedesktop.org/software/appstream/docs/api. 13 | 14 | 15 | 16 | 17 | AppStream API Reference 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 60 | 61 | 62 | API Index 63 | 64 | 65 | 66 | 67 | Index of deprecated API 68 | 69 | 70 | 71 | 72 | 73 | 74 | AppStream Manual Pages 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/as-image.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2014-2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_IMAGE_H 26 | #define __AS_IMAGE_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define AS_TYPE_IMAGE (as_image_get_type ()) 33 | G_DECLARE_DERIVABLE_TYPE (AsImage, as_image, AS, IMAGE, GObject) 34 | 35 | struct _AsImageClass 36 | { 37 | GObjectClass parent_class; 38 | /*< private >*/ 39 | void (*_as_reserved1) (void); 40 | void (*_as_reserved2) (void); 41 | void (*_as_reserved3) (void); 42 | void (*_as_reserved4) (void); 43 | void (*_as_reserved5) (void); 44 | void (*_as_reserved6) (void); 45 | }; 46 | 47 | /** 48 | * AsImageKind: 49 | * @AS_IMAGE_KIND_UNKNOWN: Type invalid or not known 50 | * @AS_IMAGE_KIND_SOURCE: The source image at full resolution 51 | * @AS_IMAGE_KIND_THUMBNAIL: A thumbnail at reduced resolution 52 | * 53 | * The image type. 54 | **/ 55 | typedef enum { 56 | AS_IMAGE_KIND_UNKNOWN, 57 | AS_IMAGE_KIND_SOURCE, 58 | AS_IMAGE_KIND_THUMBNAIL, 59 | /*< private >*/ 60 | AS_IMAGE_KIND_LAST 61 | } AsImageKind; 62 | 63 | AsImageKind as_image_kind_from_string (const gchar *kind); 64 | const gchar *as_image_kind_to_string (AsImageKind kind); 65 | 66 | AsImage *as_image_new (void); 67 | 68 | AsImageKind as_image_get_kind (AsImage *image); 69 | void as_image_set_kind (AsImage *image, 70 | AsImageKind kind); 71 | 72 | const gchar *as_image_get_url (AsImage *image); 73 | void as_image_set_url (AsImage *image, 74 | const gchar *url); 75 | 76 | guint as_image_get_width (AsImage *image); 77 | void as_image_set_width (AsImage *image, 78 | guint width); 79 | 80 | guint as_image_get_height (AsImage *image); 81 | void as_image_set_height (AsImage *image, 82 | guint height); 83 | 84 | const gchar *as_image_get_locale (AsImage *image); 85 | void as_image_set_locale (AsImage *image, 86 | const gchar *locale); 87 | 88 | G_END_DECLS 89 | 90 | #endif /* __AS_IMAGE_H */ 91 | -------------------------------------------------------------------------------- /src/as-launchable.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_LAUNCHABLE_H 26 | #define __AS_LAUNCHABLE_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define AS_TYPE_LAUNCHABLE (as_launchable_get_type ()) 33 | G_DECLARE_DERIVABLE_TYPE (AsLaunchable, as_launchable, AS, LAUNCHABLE, GObject) 34 | 35 | struct _AsLaunchableClass 36 | { 37 | GObjectClass parent_class; 38 | /*< private >*/ 39 | void (*_as_reserved1) (void); 40 | void (*_as_reserved2) (void); 41 | void (*_as_reserved3) (void); 42 | void (*_as_reserved4) (void); 43 | void (*_as_reserved5) (void); 44 | void (*_as_reserved6) (void); 45 | }; 46 | 47 | /** 48 | * AsLaunchableKind: 49 | * @AS_LAUNCHABLE_KIND_UNKNOWN: Unknown kind 50 | * @AS_LAUNCHABLE_KIND_DESKTOP_ID: Launch by desktop-id 51 | * @AS_LAUNCHABLE_KIND_SERVICE: A systemd/SysV-init service name 52 | * @AS_LAUNCHABLE_KIND_COCKPIT_MANIFEST: A Cockpit manifest / package name 53 | * @AS_LAUNCHABLE_KIND_URL: A web HTTPS URL to launch a web application from 54 | * 55 | * Type of launch system the entries belong to. 56 | **/ 57 | typedef enum { 58 | AS_LAUNCHABLE_KIND_UNKNOWN, 59 | AS_LAUNCHABLE_KIND_DESKTOP_ID, 60 | AS_LAUNCHABLE_KIND_SERVICE, 61 | AS_LAUNCHABLE_KIND_COCKPIT_MANIFEST, 62 | AS_LAUNCHABLE_KIND_URL, 63 | /*< private >*/ 64 | AS_LAUNCHABLE_KIND_LAST 65 | } AsLaunchableKind; 66 | 67 | const gchar *as_launchable_kind_to_string (AsLaunchableKind kind); 68 | AsLaunchableKind as_launchable_kind_from_string (const gchar *kind_str); 69 | 70 | AsLaunchable *as_launchable_new (void); 71 | 72 | AsLaunchableKind as_launchable_get_kind (AsLaunchable *launch); 73 | void as_launchable_set_kind (AsLaunchable *launch, 74 | AsLaunchableKind kind); 75 | 76 | GPtrArray *as_launchable_get_entries (AsLaunchable *launch); 77 | void as_launchable_add_entry (AsLaunchable *launch, 78 | const gchar *entry); 79 | 80 | G_END_DECLS 81 | 82 | #endif /* __AS_LAUNCHABLE_H */ 83 | -------------------------------------------------------------------------------- /src/as-xml.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2017 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_XML_H 26 | #define __AS_XML_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include "as-context.h" 32 | #include "as-tag.h" 33 | 34 | G_BEGIN_DECLS 35 | #pragma GCC visibility push(hidden) 36 | 37 | gchar *as_xml_get_node_value (xmlNode *node); 38 | gchar *as_xmldata_get_node_locale (AsContext *ctx, 39 | xmlNode *node); 40 | 41 | void as_xml_add_children_values_to_array (xmlNode *node, 42 | const gchar *element_name, 43 | GPtrArray *array); 44 | 45 | GPtrArray *as_xml_get_children_as_string_list (xmlNode *node, 46 | const gchar *element_name); 47 | gchar **as_xml_get_children_as_strv (xmlNode *node, 48 | const gchar *element_name); 49 | 50 | void as_xml_parse_metainfo_description_node (AsContext *ctx, 51 | xmlNode *node, 52 | GHFunc func, 53 | gpointer entity); 54 | 55 | gchar *as_xml_dump_node_content (xmlNode *node); 56 | gchar *as_xml_dump_node_children (xmlNode *node); 57 | 58 | void as_xml_add_description_node (AsContext *ctx, 59 | xmlNode *root, 60 | GHashTable *desc_table); 61 | 62 | void as_xml_add_localized_text_node (xmlNode *root, 63 | const gchar *node_name, 64 | GHashTable *value_table); 65 | 66 | xmlNode *as_xml_add_node_list_strv (xmlNode *root, 67 | const gchar *name, 68 | const gchar *child_name, 69 | gchar **strv); 70 | 71 | void as_xml_add_node_list (xmlNode *root, 72 | const gchar *name, 73 | const gchar *child_name, 74 | GPtrArray *array); 75 | 76 | xmlNode *as_xml_add_text_node (xmlNode *root, 77 | const gchar *name, 78 | const gchar *value); 79 | 80 | xmlDoc *as_xml_parse_document (const gchar *data, 81 | gssize len, 82 | GError **error); 83 | 84 | gchar *as_xml_node_to_str (xmlNode *root, GError **error); 85 | 86 | #pragma GCC visibility pop 87 | G_END_DECLS 88 | 89 | #endif /* __AS_XML_H */ 90 | -------------------------------------------------------------------------------- /qt/screenshot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Sune Vuorela 3 | * Copyright (C) 2016-2019 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #ifndef APPSTREAMQT_SCREENSHOT_H 22 | #define APPSTREAMQT_SCREENSHOT_H 23 | 24 | #include 25 | #include 26 | #include "appstreamqt_export.h" 27 | 28 | #include 29 | #include 30 | 31 | 32 | struct _AsScreenshot; 33 | namespace AppStream { 34 | 35 | class Image; 36 | class Video; 37 | class ScreenshotData; 38 | 39 | /** 40 | * Class to represent a reference to a screenshot 41 | * A screenshot might appear in various resolutions 42 | */ 43 | 44 | class APPSTREAMQT_EXPORT Screenshot { 45 | Q_GADGET 46 | public: 47 | enum MediaKind { 48 | MediaKindUnknown, 49 | MediaKindImage, 50 | MediaKindVideo 51 | }; 52 | Q_ENUM(MediaKind) 53 | 54 | Screenshot(); 55 | Screenshot(_AsScreenshot *scr); 56 | Screenshot(const Screenshot& other); 57 | ~Screenshot(); 58 | Screenshot& operator=(const Screenshot& other); 59 | 60 | /** 61 | * \returns the internally stored AsScreenshot 62 | */ 63 | _AsScreenshot *asScreenshot() const; 64 | 65 | /** 66 | * \return true if it is the default screenshot 67 | * A \ref Component should in general only have one default 68 | */ 69 | bool isDefault() const; 70 | 71 | /** 72 | * \return the kind of media (image or video) that this screenshot consists of 73 | */ 74 | MediaKind mediaKind() const; 75 | 76 | /** 77 | * \return the images for this screenshot 78 | */ 79 | QList images() const; 80 | 81 | /** 82 | * \return the videos for this screenshot 83 | */ 84 | QList videos() const; 85 | 86 | /** 87 | * \return caption for this image or a null QString if no caption 88 | */ 89 | QString caption() const; 90 | void setCaption(const QString& caption, const QString& lang = {}); 91 | 92 | private: 93 | QSharedDataPointer d; 94 | 95 | }; 96 | } 97 | 98 | APPSTREAMQT_EXPORT QDebug operator<<(QDebug s, const AppStream::Screenshot& screenshot); 99 | 100 | #endif // APPSTREAMQT_SCREENSHOT_H 101 | -------------------------------------------------------------------------------- /docs/sources/metainfo/addon.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | %BOOK_ENTITIES; 5 | ]> 6 | 7 |
8 | Addons 9 | 10 |
11 | Introduction 12 | 13 | Some components are not standalone, but rather extend existing software installed on the system and can only be used 14 | together with it. 15 | The addon component type exists to reflect that. 16 | 17 | 18 | Software which provides addons can ship one or more files in /usr/share/metainfo/%{id}.metainfo.xml. 19 | 20 |
21 | 22 |
23 | Example file 24 | 25 | A addon meta-info file should look like this: 26 | 27 | 28 | 29 | 30 | org.gnome.gedit_code_assistance 31 | org.gnome.gedit 32 | Code Assistance 33 | Code assistance for C, C++ and Objective-C 34 | http://projects.gnome.org/gedit 35 | FSFAP 36 | GPL-3.0+ 37 | ]]> 38 |
39 | 40 |
41 | File specification 42 | 43 | Note that the XML root must have the type property set to addon. 44 | This clearly identifies this metainfo document as describing an addon to existing software. 45 | 46 | 47 | 48 | 49 | <id/> 50 | 51 | 52 | For addons, the component-ID must follow the generic naming conventions (see ). 53 | 54 | 55 | 56 | 57 | 58 | <extends/> 59 | 60 | 61 | This tag is refers to the ID of the component this addon is extending. 62 | 63 | 64 | For example, if there is a plugin "kipi" which extens the application "Gwenview", it needs to be referred to as: 65 | 66 | org.kde.Gwenview]]> 67 | 68 | The <extends/> tag may be specified multiple times. 69 | 70 | 71 | 72 | 73 | 74 | 75 | For a component of type addon, the following tags are required and must be present: , , , 76 | , . 77 | 78 | 79 |
80 |
81 | -------------------------------------------------------------------------------- /qt/icon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Matthias Klumpp 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #ifndef APPSTREAMQT_ICON_H 21 | #define APPSTREAMQT_ICON_H 22 | 23 | #include 24 | #include 25 | #include "appstreamqt_export.h" 26 | 27 | class QUrl; 28 | class QString; 29 | struct _AsIcon; 30 | namespace AppStream { 31 | 32 | class IconData; 33 | 34 | /** 35 | * A reference to n icon which can be loaded from a locale file 36 | * or remote URI. 37 | */ 38 | class APPSTREAMQT_EXPORT Icon { 39 | Q_GADGET 40 | public: 41 | enum Kind { 42 | KindUnknown, 43 | KindCached, 44 | KindStock, 45 | KindLocal, 46 | KindRemote 47 | }; 48 | Q_ENUM(Kind) 49 | 50 | Icon(); 51 | Icon(_AsIcon *icon); 52 | Icon(const Icon& other); 53 | ~Icon(); 54 | 55 | Icon& operator=(const Icon& other); 56 | 57 | /** 58 | * \returns the internally stored AsIcon 59 | */ 60 | _AsIcon *asIcon() const; 61 | 62 | /** 63 | * \return the kind of icon 64 | */ 65 | Kind kind() const; 66 | void setKind(Kind kind); 67 | 68 | /** 69 | * \return the local or remote url for this image 70 | */ 71 | const QUrl url() const; 72 | void setUrl(const QUrl& url); 73 | 74 | /** 75 | * \return the icon (stock) name 76 | */ 77 | const QString name() const; 78 | void setName(const QString& name); 79 | 80 | /** 81 | * \return the expected width of this image 82 | */ 83 | uint width() const; 84 | void setWidth(uint width); 85 | 86 | /** 87 | * \return the expected height of this image 88 | */ 89 | uint height() const; 90 | void setHeight(uint height); 91 | 92 | /** 93 | * \returns the expected size of the image 94 | */ 95 | QSize size() const; 96 | 97 | bool isEmpty() const; 98 | 99 | private: 100 | QSharedDataPointer d; 101 | }; 102 | } 103 | 104 | APPSTREAMQT_EXPORT QDebug operator<<(QDebug s, const AppStream::Icon& image); 105 | 106 | #endif // APPSTREAMQT_ICON_H 107 | -------------------------------------------------------------------------------- /qt/suggested.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Aleix Pol Gonzalez 3 | * 4 | * Licensed under the GNU Lesser General Public License Version 2.1 5 | * 6 | * This library is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 2.1 of the license, or 9 | * (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this library. If not, see . 18 | */ 19 | 20 | #include "appstream.h" 21 | #include "suggested.h" 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include "chelpers.h" 28 | 29 | using namespace AppStream; 30 | 31 | class AppStream::SuggestedData : public QSharedData { 32 | public: 33 | SuggestedData() 34 | { 35 | m_suggested = as_suggested_new(); 36 | } 37 | 38 | SuggestedData(AsSuggested *suggested) 39 | : m_suggested(suggested) 40 | { 41 | g_object_ref(m_suggested); 42 | } 43 | 44 | ~SuggestedData() 45 | { 46 | g_object_unref(m_suggested); 47 | } 48 | 49 | bool operator==(const SuggestedData& rd) const 50 | { 51 | return rd.m_suggested == m_suggested; 52 | } 53 | 54 | AsSuggested *suggested() const 55 | { 56 | return m_suggested; 57 | } 58 | 59 | AsSuggested *m_suggested; 60 | }; 61 | 62 | Suggested::Suggested(const Suggested& other) 63 | : d(other.d) 64 | {} 65 | 66 | Suggested::Suggested() 67 | : d(new SuggestedData) 68 | {} 69 | 70 | Suggested::Suggested(_AsSuggested *suggested) 71 | : d(new SuggestedData(suggested)) 72 | {} 73 | 74 | Suggested::~Suggested() 75 | {} 76 | 77 | Suggested& Suggested::operator=(const Suggested& other) 78 | { 79 | this->d = other.d; 80 | return *this; 81 | } 82 | 83 | _AsSuggested * AppStream::Suggested::suggested() const 84 | { 85 | return d->suggested(); 86 | } 87 | 88 | Suggested::Kind Suggested::kind() const 89 | { 90 | return Suggested::Kind(as_suggested_get_kind(d->m_suggested)); 91 | } 92 | 93 | void Suggested::setKind(Suggested::Kind kind) 94 | { 95 | as_suggested_set_kind(d->m_suggested, (AsSuggestedKind) kind); 96 | } 97 | 98 | const QStringList AppStream::Suggested::ids() const 99 | { 100 | return valueWrap(as_suggested_get_ids(d->m_suggested)); 101 | } 102 | 103 | void AppStream::Suggested::addSuggested(const QString& id) 104 | { 105 | as_suggested_add_id(d->m_suggested, qPrintable(id)); 106 | } 107 | 108 | QDebug operator<<(QDebug s, const AppStream::Suggested& suggested) 109 | { 110 | s.nospace() << "AppStream::Suggested(" << suggested.ids() << ")"; 111 | return s.space(); 112 | } 113 | -------------------------------------------------------------------------------- /src/as-category.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 | * 3 | * Copyright (C) 2012-2016 Matthias Klumpp 4 | * 5 | * Licensed under the GNU Lesser General Public License Version 2.1 6 | * 7 | * This library is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 2.1 of the license, or 10 | * (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with this library. If not, see . 19 | */ 20 | 21 | #if !defined (__APPSTREAM_H) && !defined (AS_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __AS_CATEGORY_H 26 | #define __AS_CATEGORY_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | typedef struct _AsComponent AsComponent; 33 | 34 | #define AS_TYPE_CATEGORY (as_category_get_type ()) 35 | G_DECLARE_DERIVABLE_TYPE (AsCategory, as_category, AS, CATEGORY, GObject) 36 | 37 | struct _AsCategoryClass 38 | { 39 | GObjectClass parent_class; 40 | /*< private >*/ 41 | void (*_as_reserved1) (void); 42 | void (*_as_reserved2) (void); 43 | void (*_as_reserved3) (void); 44 | void (*_as_reserved4) (void); 45 | }; 46 | 47 | AsCategory *as_category_new (void); 48 | 49 | const gchar *as_category_get_id (AsCategory *category); 50 | void as_category_set_id (AsCategory *category, 51 | const gchar *id); 52 | 53 | const gchar *as_category_get_name (AsCategory *category); 54 | void as_category_set_name (AsCategory *category, 55 | const gchar *value); 56 | 57 | const gchar *as_category_get_summary (AsCategory *category); 58 | void as_category_set_summary (AsCategory *category, 59 | const gchar *value); 60 | 61 | const gchar *as_category_get_icon (AsCategory *category); 62 | void as_category_set_icon (AsCategory *category, 63 | const gchar* value); 64 | 65 | GPtrArray *as_category_get_children (AsCategory *category); 66 | gboolean as_category_has_children (AsCategory *category); 67 | void as_category_add_child (AsCategory *category, 68 | AsCategory *subcat); 69 | void as_category_remove_child (AsCategory *category, 70 | AsCategory *subcat); 71 | 72 | GPtrArray *as_category_get_desktop_groups (AsCategory *category); 73 | void as_category_add_desktop_group (AsCategory *category, 74 | const gchar *group_name); 75 | 76 | GPtrArray *as_category_get_components (AsCategory *category); 77 | void as_category_add_component (AsCategory *category, 78 | AsComponent *cpt); 79 | gboolean as_category_has_component (AsCategory *category, 80 | AsComponent *cpt); 81 | 82 | GPtrArray *as_get_default_categories (gboolean with_special); 83 | 84 | G_END_DECLS 85 | 86 | #endif /* __AS_CATEGORY_H */ 87 | --------------------------------------------------------------------------------