pax_global_header 0000666 0000000 0000000 00000000064 13200162720 0014503 g ustar 00root root 0000000 0000000 52 comment=66dcdc07085237592c3849e3ffcc63a5c6f49e4d
appstream-generator-0.6.8/ 0000775 0000000 0000000 00000000000 13200162720 0015476 5 ustar 00root root 0000000 0000000 appstream-generator-0.6.8/.gitignore 0000664 0000000 0000000 00000000112 13200162720 0017460 0 ustar 00root root 0000000 0000000 build/
.dub
docs.json
dub.selections.json
__dummy.html
*.o
*.obj
*.so
*.a
appstream-generator-0.6.8/.travis.yml 0000664 0000000 0000000 00000000506 13200162720 0017610 0 ustar 00root root 0000000 0000000 # Travis CI config for the AppStream Generator
language: d
sudo: required
dist: trusty
services:
- docker
d:
- gdc
- ldc
matrix:
allow_failures:
- d: gdc
before_script:
- docker build -t asgen -f test/ci/Dockerfile .
script:
- docker run -t -e DC=$DC -v `pwd`:/build asgen
./test/ci/build_and_test.sh
appstream-generator-0.6.8/LICENSE 0000664 0000000 0000000 00000016743 13200162720 0016516 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
appstream-generator-0.6.8/MAINTAINERS 0000664 0000000 0000000 00000000047 13200162720 0017174 0 ustar 00root root 0000000 0000000 Matthias Klumpp
E-mail: mak@debian.org
appstream-generator-0.6.8/NEWS 0000664 0000000 0000000 00000033145 13200162720 0016203 0 ustar 00root root 0000000 0000000 Version 0.6.8
~~~~~~~~~~~~~~
Released: 2017-11-06
Notes:
* The -Ddownload_js build flag is now -Ddownload-js to follow the naming
of other Meson flags more closely.
Features:
* Encode AppStream library version in version info string on reports
* Don't require an install candidate for a webapp
* Update hicolor theme fallback definition
* Try to filter out symbolic icons for apps
* Allow processing only one section in a suite
* Relax icon scaling rules
Bugfixes:
* Move time graph legend to the top left
* ci: Use the packaged gir-to-d
* Drop an unused gdc conditional
* Ensure the validator never tests web URLs for validity
* Drop LLVM DC bug workaround and allow cross-module inlining
* Make D GIR interface build work again with recent Meson versions
* Don't fail if we have a dupe ID with no pkgname, can happen now with webapps
Version 0.6.7
~~~~~~~~~~~~~~
Released: 2017-10-02
Features:
* ci: Enable gdc again for testing (Matthias Klumpp)
* Make rpmmd backend work (Matthias Klumpp)
* Make an empty main function for embedded unittests (Matthias Klumpp)
* Add a metainfo file (Matthias Klumpp)
* Add a manual page (Matthias Klumpp)
* Sort suite names on the index page (Matthias Klumpp)
Bugfixes:
* use file.exists to check file existence (Antonio Rojas)
* arch: Don't ref generator results (Matthias Klumpp)
* Improve the icon tarball generation code (Matthias Klumpp)
* Resolve deprecation warning (Matthias Klumpp)
Version 0.6.6
~~~~~~~~~~~~~~
Released: 2017-09-22
Features:
* Add basic HiDPI support (Corentin Noël)
* Generate the HiDPI tarball (Corentin Noël)
* Add an 'info' command to dump package information (Matthias Klumpp)
* Handle the "Hidden" property in .desktop files and complain about it (Matthias Klumpp)
Bugfixes:
* arch: XML-escape package descriptions (Matthias Klumpp)
* Check for availability of a component-id at the right time (Matthias Klumpp)
* Make writing compressed results a bit more robust (Matthias Klumpp)
* Resolve all deprecation warnings and slightly improve code (Matthias Klumpp)
Version 0.6.5
~~~~~~~~~~~~~~
Released: 2017-07-02
Features:
* Generate type=codec metadata for gstreamer packages (Iain Lane)
* Add a feature flag for GStreamer processing (Iain Lane)
* ci: Switch to using upstream GirToD (Matthias Klumpp)
* Set asgen version in defines.d by Meson as well (Matthias Klumpp)
* Format graphs a bit nicer (Matthias Klumpp)
Bugfixes:
* Find files in DATADIR - not relative to the executable (Iain Lane)
* Fix typo in metadata-path hint (Matthias Klumpp)
* Try to be more informative when a component has no ID (Matthias Klumpp)
* Ensure the rDNS scheme is really followed before editing an ID (Matthias Klumpp)
Version 0.6.4
~~~~~~~~~~~~~~
Released: 2017-05-25
Features:
* Automatically generate GIR D bindings at build-time (Matthias Klumpp)
* Remove dub build file (Matthias Klumpp)
* Use Meson subproject/wrap to fetch mustache-d in case it is missing (Matthias Klumpp)
* Add a launchable tag to output if we can add one (Matthias Klumpp)
* Make legacy metainfo dir a warning (Matthias Klumpp)
* Validate launchable entries and add heuristics in case they aren't present (Matthias Klumpp)
Bugfixes:
* Import buildPath directly from std.path (Antonio Rojas)
* Remove spurious std.stream import (Matthias Klumpp)
Version 0.6.3
~~~~~~~~~~~~~~
Released: 2017-03-08
Features:
* Experiment with scoped classes (Matthias Klumpp)
* Drop embedded generator copy (Matthias Klumpp)
* Use final classes whenever possible (Matthias Klumpp)
* Centralize all export-dir locations in base config class (Matthias Klumpp)
* Allow to manually configure data export locations (Matthias Klumpp)
Bugfixes:
* Fix some quirks and make the tests work again (Matthias Klumpp)
* ci: Don't build with GDC (Matthias Klumpp)
* Don't fail if a suite has no base suite (Matthias Klumpp)
* engine: Process base suite packages for contents only (Iain Lane)
* Update README.md (#39) (Blake Kostner)
* debian: Only select the most recent packages for a scan (Matthias Klumpp)
* Streamline final component validity check, resolve a crash (Matthias Klumpp)
Version 0.6.2
~~~~~~~~~~~~~~
Released: 2017-01-24
Notes:
* GDC 6.x can't compile the project at time due to a GDC bug.
See https://bugzilla.gdcproject.org/show_bug.cgi?id=251 for more
information.
Features:
* Support desktop-app metainfo files without .desktop file if they have an icon set
* Write log entry when starting/finishing icon tarball write
* Update AppStream bindings
* Allow to specify allowed keys
* Don't show pedantic validator hints
* Allow metainfo file to specify sample texts for fonts
* Process XPM icons if they are large enough
Bugfixes:
* Safeguard against TLD checks with empty-or-null string
* Ensure desktop-apps have at least one valid category set
* Don't override metainfo name/summary with .desktop values
* Quit immediately if the component type is unknown
* Correctly read a font's full-name
* Don't needlessly reprocess fonts
Version 0.6.1
~~~~~~~~~~~~~~
Released: 2016-12-26
Features:
* Add a symlink so that Ubuntu uses the same template as Debian (Iain Lane)
* Support linking to "old suites" in the HTML index (Iain Lane)
* hints: icon-not-found: Explain the symlink problem for Debian & Ubuntu (Iain Lane)
* Add preliminary new asgen logo (Matthias Klumpp)
* Use struct for archive (Matthias Klumpp)
* Reuse AsMetadata while processing metainfo files (Matthias Klumpp)
Bugfixes:
* Correctly install templates with Meson (Matthias Klumpp)
* meson: Make finding mustache-d more robust (Matthias Klumpp)
* Fix build with DMD (Antonio Rojas)
* engine: Don't clean packages in base suites (Iain Lane)
* download: If we have a last-modified date, set the mtime of the target file (Iain Lane)
* Simplify zarchive code a little (Matthias Klumpp)
* Use module initializer to initialize global static data (Matthias Klumpp)
* Fix build on Debian with GDC (Matthias Klumpp)
Version 0.6.0
~~~~~~~~~~~~~~
Released: 2016-10-03
Notes:
* If possible, you should build Meson with the LLVM D compiler and the
Meson build system now.
Features:
* Produce better error messages on failed libarchive actions (Matthias Klumpp)
* Add a hook to the desktop file parser to run backend specific code (Iain Lane)
* Add an Ubuntu backend to retrieve langpack translations (Iain Lane)
* Open databases with NOTLS (Matthias Klumpp)
* Tweak the issue messages a bit (Matthias Klumpp)
* Complain about stuff in legacy paths (Matthias Klumpp)
* Only search for .desktop files if we have a DESKTOP_APP component (Matthias Klumpp)
* Create new Font class to read font metadata (Matthias Klumpp)
* Render an icon for fonts (Matthias Klumpp)
* Add dependencies on Pango, FreeType and Fontconfig (Matthias Klumpp)
* Determine languages a font supports (Matthias Klumpp)
* Reorganize code for proper namespacing (Matthias Klumpp)
* Render font screenshots (Matthias Klumpp)
* Map font full names to files in a spec-compliant way (Matthias Klumpp)
* Enable fonts support by default (Matthias Klumpp)
* Share ContentsStore between threads again (Matthias Klumpp)
* Make Meson a first-class buildsystem for asgen (Matthias Klumpp)
* Update README (Matthias Klumpp)
Bugfixes:
* Fix build on non-64-bit architectures (Matthias Klumpp)
* Work around LDC bug (Matthias Klumpp)
* fclose() the memstream when we are done with it (Iain Lane)
* debpkgindex: Be less noisy about translations in debug mode (Iain Lane)
* Use getTestSamplesDir (Iain Lane)
* Retry on all curl errors, not just timeouts (Iain Lane)
* Synchronise downloading of files (Iain Lane)
* ubuntu: Don't reference all packages, just the ones we need (langpacks) (Iain Lane)
* Use an ugly mutex to work around Fontconfig issues (Matthias Klumpp)
* Make FC mutex a bit more fine-grained (Matthias Klumpp)
Version 0.5.0
~~~~~~~~~~~~~~
Released: 2016-08-30
Features:
* Add more speed and style optimizations, make Package an abstract class (Matthias Klumpp)
* Use a string appender instead of a string array for writing output (Matthias Klumpp)
* debian: Support downloading files from a mirror, instead of having them local (Iain Lane)
* debian: Support DDTP translations (Iain Lane)
* Ignore some more useless categories (Matthias Klumpp)
* Add skeleton for RPMMD (Matthias Klumpp)
* Add a few optimizations using immutable and appender (Matthias Klumpp)
* Do not spawn compressors anymore, use libarchive directly (Matthias Klumpp)
* Make compiling with LDC easier (Matthias Klumpp)
* Add example for cruft collection script (Matthias Klumpp)
* Allow cleaning up statistical data retroactively (Matthias Klumpp)
* Rehash hash tables that we query often (Matthias Klumpp)
* Always optimize debug builds (Matthias Klumpp)
* Make a splitbuild with Meson and Ninja possible (Matthias Klumpp)
* Use AppStream's knowledge about TLDs to build smarter global-component-ids (Matthias Klumpp)
* Allow specifying the format version metadata should be built for (Matthias Klumpp)
* Adjust for AppStream 0.10 release (Matthias Klumpp)
* Perform legal checks before allowing metadata to be added to the pool (Matthias Klumpp)
Bugfixes:
* Fix dataUseJSTime in section overview template (Blake Kostner)
* debian: Only retrieve DDTP translations from the section we're looking at (Iain Lane)
* Fix deprecation warnings from LDC (Matthias Klumpp)
* Work around some weird JSON parser quirk (int incompatible with uint) (Matthias Klumpp)
* Prevent creating excess statistic entries (Matthias Klumpp)
* Fix potential crash (Matthias Klumpp)
* Use native generator when not compiling with GDC (Matthias Klumpp)
* Work correctly if CIDs omit the .desktop suffix (Matthias Klumpp)
* Only add valid category names to output (Matthias Klumpp)
* Don't emit description-from-package multiple times per package. (Matthias Klumpp)
Version 0.4.0
~~~~~~~~~~~~~~
Released: 2016-07-12
Features:
* README: Add link to D tour
* Run optipng with standard settings
* Add command to forget extracted data for a package
* Implement immutable suites
* Use appender more often and apply some style fixes
* Build with parallel by default when using Makefile
* Drop some deprecated stuff
Bugfixes:
* Display an error when processing a suite without section or arch
* debian: Fix exception message if directory does not exist
* Code improvements: More pure, more safe, more trusted
* Drop global data validation result box
* Don't crash if media pool directory does not exist and immutable suites are used
Version 0.3.0
~~~~~~~~~~~~~~
Released: 2016-05-24
Features:
* Register new backend for Arch Linux (Matthias Klumpp)
* arch: Add reader for lists index file and skeleton for PackageIndex (Matthias Klumpp)
* Make generic archive class work well with non-Debian packages (Matthias Klumpp)
* Add HTML anchors for maintainers on report pages (Matthias Klumpp)
* html: Show suite name in section overview (Matthias Klumpp)
* Allow not setting a MediaBaseUrl (Matthias Klumpp)
* Add some font rendering experiments (Matthias Klumpp)
* Allow storing multiple statitics entries per point in time (Matthias Klumpp)
* Make icon tarball build reproducible (Matthias Klumpp)
* Make ArchiveDecompressor API more powerful and always return const(ubyte)[] (Matthias Klumpp)
* arch: Speed up backend by loading all data in one go (Matthias Klumpp)
* Split "handleScreenshots" into more useful, fine-grained flags (Matthias Klumpp)
* Add timestamp to output and only touch it if something has changed (Matthias Klumpp)
* Only update metadata if the indices have been changed (Matthias Klumpp)
* Store media in pool subdirectory (Matthias Klumpp)
* Add flag to enforce metadata processing, even if nothing changed (Matthias Klumpp)
* Allow disabling metadata timestamps (Matthias Klumpp)
* Improve scan-skipping code (Matthias Klumpp)
Bugfixes:
* Fix build on non-64bit arches (Matthias Klumpp)
* Handle compressed empty files correctly (Neil Mayhew)
* Drop other, non-UTF-8 encodings from language codes too (Matthias Klumpp)
* Drop non-printable characters from .desktop file values (Matthias Klumpp)
* Loop over more things by-reference to reduce RAM usage (Matthias Klumpp)
* debian: Read Packages.xz files if no .gz file is available (Matthias Klumpp)
* Don't lie about thumbnail sizes in their filename (Matthias Klumpp)
* Don't duplicate architecture tag if there are multiple issues (Matthias Klumpp)
* Catch data serialization errors (Matthias Klumpp)
* Run bower with allow root to be able to make js as root (Harald Sitter)
Version 0.2.0
~~~~~~~~~~~~~~
Released: 2016-04-24
Features:
* Don't ship minified JS
* Get rid of (almost) all the embedded JS copies, use Bower
* Add makefile for convenience
* Use Flot for drawing graphs
* Update README
* Document all asgen-config settings
* Reserve subdb in contents database to cache icon data
* Make IconHandler use a pre-filtered list of icons
* Allow templates to override only parts of the default branding
* Add some default branding for Debian
* Show logo on generated HTML pages
* debian: Link some interesting resources from the main page
Bugfixes:
* Find aliased icons correctly
* Keep priority sorting of themes
* Make the hicolor theme always-available, using an embedded index copy if necessary
* Fix counting of issues
* Do not accidentally upscale screenshots while creating thumbnails
* debian: Don't make a missing package index fatal
* Don't fail if we are trying to add statistics too quickly
* Rename remove-valid to reflect what it actually does
* Ignore errors if we are trying to decompress a 0-byte gzip file
* Suite arguments aren't optional for process/remove-found
* Demote screenshot-no-thumbnails to info
Version 0.1.0
~~~~~~~~~~~~~~
Released: 2016-04-18
Notes:
* Initial release
appstream-generator-0.6.8/README.md 0000664 0000000 0000000 00000005721 13200162720 0016762 0 ustar 00root root 0000000 0000000 # AppStream Generator
AppStream is an effort to provide additional metadata and unique IDs for all software available in a Linux system.
This repository contains the server-side of the AppStream infrastructure, a tool to generate metadata from distribution packages. You can find out more about AppStream collection metadata at [Freedesktop](https://www.freedesktop.org/software/appstream/docs/chap-CollectionData.html).
The AppStream generator is currently primarily used by Debian, but is written in a distribution agnostic way. Backends only need to implement [two interfaces](src/asgen/backends/interfaces.d) to to be ready.
If you are looking for the AppStream client-tools, the [AppStream repository](https://github.com/ximion/appstream) is where you want to go.

## Development
[](https://travis-ci.org/ximion/appstream-generator)
### Build dependencies
* LDC[1]
* Meson (>= 0.34) [2]
* glib2 (>= 2.46)
* AppStream [3]
* libarchive (>= 3.2) [4]
* LMDB [5]
* mustache-d [6]
* GirToD [7]
* Cairo
* GdkPixbuf 2.0
* RSvg 2.0
* FreeType
* Fontconfig
* Pango
* Bower (optional) [8]
[1]: https://github.com/ldc-developers/ldc/releases
[2]: http://mesonbuild.com/
[3]: https://github.com/ximion/appstream
[4]: http://www.libarchive.org/
[5]: http://symas.com/mdb/
[6]: https://github.com/repeatedly/mustache-d
[7]: https://github.com/gtkd-developers/GIR-D-Generator
[8]: http://bower.io/
On Debian and derivatives of it, all build requirements can be installed using the following command:
```ShellSession
sudo apt install meson ldc gir-to-d libappstream-dev libgdk-pixbuf2.0-dev libarchive-dev \
librsvg2-dev liblmdb-dev libglib2.0-dev libcairo2-dev libcurl4-gnutls-dev \
libfreetype6-dev libfontconfig1-dev libpango1.0-dev libmustache-d-dev
```
### Build instructions
To build the tool with Meson, create a `build` subdirectory, change into it and run `meson .. && ninja` to build.
In summary:
```ShellSession
$ mkdir build && cd build
$ meson -Ddownload-js=true ..
$ ninja
$ sudo ninja install
```
We support several options to be set to influence the build. Change into the build directory and run `mesonconf` to see them all.
You might want to perform an optimized debug build by passing `--buildtype=debugoptimized` to `meson` or just do a release build straight
away with `--buildtype=release` in case you want to use the resulting binaries productively. By default, the build happens without optimizations
which slows down the generator.
## Usage
Take a look at the `docs/` directory in the source tree for information on how to use the generator and write configuration files for it.
## Hacking
Pull-requests and patches are very welcome! If you are new to D, it is highly recommended to take a few minutes to look at the D tour to get a feeling of what the language can do: http://tour.dlang.org/
appstream-generator-0.6.8/RELEASE 0000664 0000000 0000000 00000001621 13200162720 0016501 0 ustar 00root root 0000000 0000000 AppStream Generator Release Notes
1. Write NEWS entries for AppStream Generator in the same format as usual.
git shortlog v0.6.7.. | grep -i -v trivial | grep -v Merge > NEWS.new
--------------------------------------------------------------------------------
Version 0.6.8
~~~~~~~~~~~~~~
Released: 2017-xx-xx
Notes:
Features:
Bugfixes:
--------------------------------------------------------------------------------
2. Commit changes in Git:
git commit -a -m "Release version 0.6.8"
git tag -s -f -m "Release 0.6.8" v0.6.8
git push --tags
git push
3. Do post release version bump in meson.build, RELEASE
4. Commit trivial changes:
git commit -a -m "trivial: post release version bump"
git push
5. Send an email to appstream@lists.freedesktop.org
=================================================
AppStream Generator 0.6.8 released!
=================================================
appstream-generator-0.6.8/TODO 0000664 0000000 0000000 00000000507 13200162720 0016170 0 ustar 00root root 0000000 0000000 = AppStream Generator TODO List =
=== Known issues ===
* No persistent problems at time :-)
=== Planned Features ===
* Extract localization status for AppStream components and add them as
`Languages` field.
=== Whishlist / Random Ideas ===
* Add an icon-cache so we don't render SVG icons in themes multiple times.
appstream-generator-0.6.8/contrib/ 0000775 0000000 0000000 00000000000 13200162720 0017136 5 ustar 00root root 0000000 0000000 appstream-generator-0.6.8/contrib/cleanup-cruft.sh.example 0000664 0000000 0000000 00000001351 13200162720 0023674 0 ustar 00root root 0000000 0000000 #!/bin/bash
#
# Script cleaning up the AppStream metadata pool and cache.
# This script should be run by a cronjob (e.g. every week).
#
set -e
set -o pipefail
set -u
WORKSPACE_DIR="/srv/appstream/workspace"
# only run one instance of the script
LOCKFILE="$WORKSPACE_DIR/.lock"
cleanup() {
rm -f "$LOCKFILE"
}
if ! lockfile -r8 $LOCKFILE; then
echo "aborting AppStream metadata cleanup because $LOCKFILE has already been locked"
exit 0
fi
trap cleanup 0
# Start logging
logdir="$WORKSPACE_DIR/logs/`date "+%Y/%m"`"
mkdir -p $logdir
NOW=`date "+%d_%H%M"`
LOGFILE="$logdir/${NOW}_cleanup.log"
exec >> "$LOGFILE" 2>&1
cd $WORKSPACE_DIR
# Cleanup superseded data
appstream-generator cleanup
# finish logging
exec > /dev/null 2>&1
appstream-generator-0.6.8/contrib/girwrap/ 0000775 0000000 0000000 00000000000 13200162720 0020611 5 ustar 00root root 0000000 0000000 appstream-generator-0.6.8/contrib/girwrap/APILookup.txt 0000664 0000000 0000000 00000006417 13200162720 0023165 0 ustar 00root root 0000000 0000000 #
# Licensed under the GNU Lesser General Public License Version 3
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the license, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library. If not, see .
# define the license to use
license: start
/*
* Licensed under the GNU Lesser General Public License Version 3
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the license, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see .
*/
// generated automatically - do not change
license: end
includeComments: y
# defines the simple token substitution
# TODO allow to create real aliases on the code and simple static token replacement
alias: volatile
alias: G_CONST_RETURN
alias: gint int
alias: guint uint
alias: gboolean bool
alias: gpointer void*
alias: gconstpointer void*
alias: gchar char
alias: guchar char
alias: gshort short
alias: gushort ushort
alias: gint8 byte
alias: guint8 ubyte
alias: gint16 short
alias: guint16 ushort
alias: gint32 int
alias: gint64 long
alias: guint32 uint
alias: guint64 ulong
alias: guintptr size_t
alias: gfloat float
alias: gdouble double
alias: goffset long
alias: gsize size_t
alias: gssize ptrdiff_t
alias: va_list void*
alias: unichar dchar
alias: unichar2 wchar
alias: uchar ubyte
alias: XID uint
alias: gunichar dchar
alias: gunichar2 wchar
alias: time_t uint
alias: uid_t uid_t
alias: alias alias_
alias: align alig
alias: body bod
alias: continue continu
alias: debug dbg
alias: default defaulx
alias: delete delet
alias: export expor
alias: foreach foreac
alias: function funct
alias: Function Funct
alias: in inn
alias: instance instanc
alias: interface iface
alias: module modul
alias: out output
alias: package p
alias: ref doref
alias: scope scop
alias: string str
alias: switch switc
alias: union unio
alias: version versio
alias: GLIB_SYSDEF_POLLIN =1
alias: GLIB_SYSDEF_POLLOUT =4
alias: GLIB_SYSDEF_POLLPRI =2
alias: GLIB_SYSDEF_POLLHUP =16
alias: GLIB_SYSDEF_POLLERR =8
alias: GLIB_SYSDEF_POLLNVAL =32
###########################################################
### predifined: lib
###########################################################
srcDir: .
lookup: APILookupAppStream.txt
lookup: APILookupGLib.txt
lookup: APILookupGObject.txt
lookup: APILookupGio.txt
#lookup: APILookupGdkPixbuf.txt
appstream-generator-0.6.8/contrib/girwrap/APILookupAppStream.txt 0000664 0000000 0000000 00000002141 13200162720 0024770 0 ustar 00root root 0000000 0000000 #
# Licensed under the GNU Lesser General Public License Version 3
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the license, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library. If not, see .
#############################################
### Definitions for wrapping Gtk+ ###########
#############################################
# must start with wrap
wrap: appstream
file: AppStream-1.0.gir
addAliases: start
public import glib.c.types;
public import gobject.c.types;
public import gio.c.types;
public import core.stdc.stdio;
public import core.stdc.string;
addAliases: end
appstream-generator-0.6.8/contrib/girwrap/APILookupGLib.txt 0000664 0000000 0000000 00000127433 13200162720 0023725 0 ustar 00root root 0000000 0000000 #
# Licensed under the GNU Lesser General Public License Version 3
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the license, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library. If not, see .
#############################################
### Definitions for wrapping Gtk+ ###########
#############################################
# must start with wrap
wrap: glib
file: GLib-2.0.gir
file: GModule-2.0.gir
addAliases: start
public alias uint uid_t;
public alias int pid_t;
version( Windows )
{
alias int glong;
alias uint gulong;
}
else version( X86_64 )
{
alias long glong;
alias ulong gulong;
}
else
{
alias int glong;
alias uint gulong;
}
version( Windows )
enum _utfPostfix = "_utf8";
else
enum _utfPostfix = "";
version (Windows)
{
private import core.stdc.stdio;
static if( !is(typeof(fdopen(0, null))) )
{
extern (C) FILE* fdopen(int, char*);
}
}
static if ( __VERSION__ >= 2063 )
{
public import std.typecons : scoped;
template Scoped(T)
{
alias typeof(scoped!T(cast(typeof(T.tupleof[0]))null)) Scoped;
}
}
else
{
// I'm getting the following error on the older dmd versions:
// this for Scoped_store needs to be type Scoped not type inout(Scoped!(T)).
// Unlike the phobos version this does use GC alocated memory for the object.
// Within GtkD this is used to make sure destroy is called on the object
// so it releases the resources it holds.
struct Scoped(T)
{
T payload;
alias payload this;
@disable this();
@disable this(this);
~this()
{
.destroy(payload);
}
}
auto scoped(T, Args...)(auto ref Args args) if (is(T == class))
{
Scoped!(T) result = void;
result.payload = new T(args);
return result;
}
}
/**
* Get the length of a zero terminated array.
*/
size_t getArrayLength(T)(T* arr)
{
size_t len;
for ( ; arr[len]; len++ ){}
return len;
}
unittest
{
assert(getArrayLength("aaaaaaaaa\0".ptr) == 9);
}
Type* gMalloc(Type)()
{
import glib.c.functions;
return cast(Type*)g_malloc0(Type.sizeof);
}
alias void* GIConv;
addAliases: end
addEnums: start
enum GPriority
{
HIGH = -100,
DEFAULT = 0,
HIGH_IDLE = 100,
DEFAULT_IDLE = 200,
LOW = 300
}
addEnums: end
struct: Array
class: ArrayG
struct: Base64
move: base64_decode_step Base64 decode_step
move: base64_decode_inplace Base64 decode_inplace
noCode: decode_step
array: decode_inplace Return out_len
code: start
/**
* Incrementally decode a sequence of binary data from its Base-64 stringified
* representation. By calling this function multiple times you can convert
* data in chunks to avoid having to have the full encoded data in memory.
*
* The output buffer must be large enough to fit all the data that will
* be written to it. Since base64 encodes 3 bytes in 4 chars you need
* at least: (@len / 4) * 3 + 3 bytes (+ 3 may be needed in case of non-zero
* state).
*
* Params:
* inn = binary input data
* len = max length of @in data to decode
* output = output buffer
* state = Saved state between steps, initialize to 0
* save = Saved state between steps, initialize to 0
*
* Return: The number of bytes of output that was written
*
* Since: 2.12
*/
public static size_t decodeStep(string inn, ref ubyte[] output, ref int state, ref uint save)
{
auto p = g_base64_decode_step(Str.toStringz(inn), cast(int)inn.length, cast(char*)output.ptr, &state, &save);
return p;
}
code: end
struct: BookmarkFile
out: load_from_data_dirs full_path
array: set_groups groups length
struct: ByteArray
class: ByteArray
struct: Bytes
noCode: new_take
noCode: new_static
struct: Checksum
noCode: get_digest
code: start
/**
* Gets the digest from checksum as a raw binary vector and places it
* into buffer. The size of the digest depends on the type of checksum.
*
* Once this function has been called, the Checksum is closed and can
* no longer be updated with update().
*
* Params:
* buffer = output buffer
* digestLen = an inout parameter. The caller initializes it to the size of buffer.
* After the call it contains the length of the digest.
*
* Since: 2.16
*/
public void getDigest(ref ubyte[] buffer)
{
size_t digestLen = buffer.length;
g_checksum_get_digest(gChecksum, buffer.ptr, &digestLen);
buffer = buffer[0 .. digestLen];
}
code: end
struct: ConstructionException
namespace:
code: start
class ConstructionException : Exception
{
this(string message)
{
super(message);
}
override string toString()
{
return "Construction failure, " ~ msg;
}
}
code: end
struct: DateTime
structWrap: gpointer DateTime
noCode: new_now_utc
noCode: new_now_local
noCode: new_from_unix_local
noCode: new_from_unix_utc
noCode: new_from_timeval_local
noCode: new_from_timeval_utc
noCode: new_local
noCode: new_utc
noCode: hash
code: start
/**
* Creates a DateTime corresponding to the given Unix time t
* Unix time is the number of seconds that have elapsed since 1970-01-01
* 00:00:00 UTC, regardless of the local time offset.
*
* This call can fail (ConstructionException) if t represents a time outside
* of the supported range of GDateTime.
* You should release the return value by calling unref()
* when you are done with it
*
* Params:
* t = the Unix time
* utc = If true use utc else use the local timezone.
*
* Throws: ConstructionException GTK+ fails to create the object.
*
* Since: 2.26
*/
public this (long t, bool utc = true)
{
GDateTime* p;
if ( utc )
{
p = g_date_time_new_from_unix_utc(t);
}
else
{
p = g_date_time_new_from_unix_local(t);
}
if(p is null)
{
throw new ConstructionException("null returned by g_date_time_new_from_unix_local(t)");
}
this(cast(GDateTime*) p);
}
/**
* Creates a DateTime corresponding to the given TimeVal tv.
* The time contained in a TimeVal is always stored in the form of
* seconds elapsed since 1970-01-01 00:00:00 UTC, regardless of the
* local time offset.
*
* This call can fail (ConstructionException) if tv represents a time outside
* of the supported range of DateTime.
* You should release the return value by calling unref()
* when you are done with it.
*
* Params:
* tv = a GTimeVal
* utc = If true use utc else use the local timezone.
*
* Throws: ConstructionException GTK+ fails to create the object.
*
* Since: 2.26
*/
public this (ref GTimeVal tv, bool utc = true)
{
GDateTime* p;
if ( utc )
{
p = g_date_time_new_from_timeval_utc(&tv);
}
else
{
p = g_date_time_new_from_timeval_local(&tv);
}
if(p is null)
{
throw new ConstructionException("null returned by g_date_time_new_from_timeval_local((tv is null) ? null : tv.getTimeValStruct())");
}
this(cast(GDateTime*) p);
}
/** */
override bool opEquals(Object rhs)
{
DateTime date = cast(DateTime)rhs;
if ( date is null )
return false;
return equal(this, date) != 0;
}
/** */
override int opCmp(Object rhs)
{
DateTime date = cast(DateTime)rhs;
if ( date is null )
return int.min;
return compare(this, date);
}
/** */
override nothrow @trusted hash_t toHash()
{
return hash();
}
/**
* Hashes datetime into a guint, suitable for use within GHashTable.
* Since 2.26
* Params:
* datetime = a GDateTime
* Returns: a guint containing the hash
*/
public nothrow @trusted uint hash()
{
try
{
return g_date_time_hash(gDateTime);
}
catch(Exception e)
{
return 0;
}
}
code: end
struct: Dir
class: Directory
struct: Error
class: ErrorG
move: propagate_error Error
move: set_error_literal Error
out: set_error_literal err
out: propagate_error dest
struct: GException
namespace:
import: glib.ErrorG
import: glib.Str
code: start
class GException : Exception
{
ErrorG error;
this(ErrorG error)
{
super( Str.toString(error.getErrorGStruct().message) );
this.error = error;
}
}
code: end
struct: GLib
namespace:
code: start
static import glib.Version;
deprecated("moves to the glib.Version module")
alias glib.Version.Version Version;
code: end
struct: HashTable
class: HashTable
struct: Hmac
noCode: get_digest
move: compute_hmac_for_data Hmac
move: compute_hmac_for_string Hmac
array: compute_hmac_for_data data length
array: compute_hmac_for_string str length
code: start
/**
* Gets the digest from checksum as a raw binary array and places it
* into buffer. The size of the digest depends on the type of checksum.
*
* Once this function has been called, the Hmac is closed and can
* no longer be updated with update().
*
* Params:
* buffer = output buffer
*
* Since: 2.30
*/
public void getDigest(ref ubyte[] buffer)
{
size_t digestLen = buffer.length;
g_hmac_get_digest(gHmac, buffer.ptr, &digestLen);
buffer = buffer[0 .. digestLen];
}
code: end
struct: IConv
namespace:
noStruct: true
ref: iconv inbuf
out: iconv inbytes_left
array: iconv inbuf inbytes_left
ref: iconv outbuf
out: iconv outbytes_left
array: iconv outbuf outbytes_left
struct: Idle
class: Idle
cType:
code: start
/** Holds all idle delegates */
bool delegate()[] idleListeners;
/** our idle ID */
uint idleID;
/**
* Creates a new idle cycle.
* Params:
* interval = the idle in milieconds
* dlg = the delegate to be executed
* fireNow = When true the delegate will be executed emmidiatly
*/
this(bool delegate() dlg, bool fireNow=false)
{
idleListeners ~= dlg;
idleID = g_idle_add(cast(GSourceFunc)&idleCallback, cast(void*)this);
if ( fireNow )
{
if ( !dlg() )
{
idleListeners.length = 0;
}
}
}
/**
* Creates a new idle cycle.
* Params:
* dlg = the delegate to be executed
* priority = Priority for the idle function
* fireNow = When true the delegate will be executed emmidiatly
*/
this(bool delegate() dlg, GPriority priority, bool fireNow=false)
{
idleListeners ~= dlg;
idleID = g_idle_add_full(priority, cast(GSourceFunc)&idleCallback, cast(void*)this, null);
if ( fireNow )
{
if ( !dlg() )
{
idleListeners.length = 0;
}
}
}
/** */
public void stop()
{
if ( idleID > 0 )
{
g_source_remove(idleID);
}
idleListeners.length = 0;
}
/**
* Removes the idle from gtk
*/
~this()
{
stop();
}
/**
* Adds a new delegate to this idle cycle
* Params:
* dlg =
* fireNow =
*/
public void addListener(bool delegate() dlg, bool fireNow=false)
{
idleListeners ~= dlg;
if ( fireNow )
{
if ( !dlg() )
{
idleListeners.length = idleListeners.length - 1;
}
}
}
/**
* The callback execution from glib
* Params:
* idle =
* Returns:
*/
extern(C) static bool idleCallback(Idle idle)
{
return idle.callAllListeners();
}
/**
* Executes all delegates on the execution list
* Returns:
*/
private bool callAllListeners()
{
bool runAgain = false;
int i = 0;
while ( i 0 ) --l;
return line[0..l];
}
extern(C) static void childWatchCallback(int pid, int status, Spawn spawn)
{
//writefln("Spawn.childWatchCallback %s %s", pid, status);
spawn.exitStatus = status;
if ( spawn.externalWatch !is null )
{
spawn.externalWatch(spawn);
}
spawn.close();
}
public bool endOfOutput()
{
if ( standardOutput is null ) return true;
return feof(standardOutput) != 0;
}
public bool endOfError()
{
if ( standardError is null ) return true;
return feof(standardError) != 0;
}
string getOutputString()
{
return Str.toString(strOutput);
}
string getErrorString()
{
return Str.toString(strError);
}
int getExitStatus()
{
return exitStatus;
}
/**
* Executes a command synchronasly and
* optionally calls delegates for sysout, syserr and end of job
*
*/
public int commandLineSync(
ChildWatch externalWatch = null,
bool delegate(string) readOutput = null,
bool delegate(string) readError = null )
{
string commandLine;
foreach ( int count, string arg; argv)
{
if ( count > 0 )
{
commandLine ~= ' ';
}
commandLine ~= arg;
}
int status = g_spawn_command_line_sync(
Str.toStringz(commandLine),
&strOutput,
&strError,
&exitStatus,
&error);
if ( readOutput != null )
{
foreach ( string line ; splitLines(Str.toString(strOutput)) )
{
readOutput(line);
}
}
if ( readError != null )
{
foreach ( string line ; splitLines(Str.toString(strError)) )
{
readError(line);
}
}
if ( externalWatch != null )
{
externalWatch(this);
}
return status;
}
code: end
struct: Str
import: core.stdc.stdio
import: core.stdc.string
import: gobject.c.types
code: start
/*
* Convert C-style 0 terminated string s to char[] string.
* copied from phobos
*/
public static string toString(const(char)* s, size_t len = 0)
{
if ( s is null )
return cast(string)null;
if ( len == 0 )
len = strlen(s);
return s[0 .. len].idup;
}
/*
* Convert array of chars s[] to a C-style 0 terminated string.
* copied from phobos
*/
public static char* toStringz(string s)
{
if ( s is null ) return null;
char[] copy;
if (s.length == 0)
{
copy = "\0".dup;
}
else
{
// Need to make a copy
copy = new char[s.length + 1];
copy[0..s.length] = s[];
copy[s.length] = 0;
}
return copy.ptr;
}
/** */
public static char** toStringzArray(string[] args)
{
if ( args is null )
{
return null;
}
char** argv = (new char*[args.length]).ptr;
int argc = 0;
foreach (string p; args)
{
argv[argc++] = cast(char*)(p.dup~'\0');
}
argv[argc] = null;
return argv;
}
/** */
public static char*** toStringzArray(string[][] args)
{
if ( args is null )
{
return null;
}
char**[] argv = new char**[args.length];
int argc = 0;
foreach( string[] p; args )
{
argv[argc++] = toStringzArray(p);
}
argv[argc] = null;
return argv.ptr;
}
/** */
public static string[] toStringArray(const(char*)* args)
{
if ( args is null )
{
return null;
}
string[] argv;
while ( *args !is null )
{
argv ~= toString(*args);
args++;
}
return argv;
}
/** */
public static string[] toStringArray(const(char*)* args, size_t len)
{
string[] argv = new string[len];
for ( int i; i < len; i++ )
{
argv[i] = toString(args[i]);
}
return argv;
}
/** */
public static string[][] toStringArray(char*** args)
{
string[][] argv;
if ( args is null )
{
return null;
}
while ( *args !is null )
{
argv ~= toStringArray(*args);
args++;
}
return argv;
}
/** */
public static void freeString(char* str)
{
g_free(str);
}
/** */
public static void freeStringArray(char** str)
{
g_strfreev(str);
}
/** */
public static void freeStringArray(char*** str)
{
while ( *str !is null )
{
g_strfreev(*str);
str++;
}
g_free(str);
}
code: end
struct: String
class: StringG
struct: Thread
noCode: new
struct: Timeout
class: Timeout
cType:
code: start
/** Holds all timeout delegates */
bool delegate()[] timeoutListeners;
/** our gtk timeout ID */
uint timeoutID;
/**
* Creates a new timeout cycle with the default priority, GPriority.DEFAULT.
*
* Note that timeout functions may be delayed, due to the processing of other
* event sources. Thus they should not be relied on for precise timing.
* After each call to the timeout function, the time of the next timeout is
* recalculated based on the current time and the given interval
* (it does not try to 'catch up' time lost in delays).
* Params:
* interval = the timeout in milieconds
* delegate() = the delegate to be executed
* fireNow = When true the delegate will be executed emmidiatly
*/
this(uint interval, bool delegate() dlg, bool fireNow=false)
{
timeoutListeners ~= dlg;
timeoutID = g_timeout_add(interval, cast(GSourceFunc)&timeoutCallback, cast(void*)this);
if ( fireNow )
{
if ( !dlg() )
{
timeoutListeners.length = 0;
}
}
}
/**
* Creates a new timeout cycle.
* Params:
* interval = the timeout in milieconds
* delegate() = the delegate to be executed
* priority = Priority for the timeout function
* fireNow = When true the delegate will be executed emmidiatly
*/
this(uint interval, bool delegate() dlg, GPriority priority, bool fireNow=false)
{
timeoutListeners ~= dlg;
timeoutID = g_timeout_add_full(priority, interval, cast(GSourceFunc)&timeoutCallback, cast(void*)this, null);
if ( fireNow )
{
if ( !dlg() )
{
timeoutListeners.length = 0;
}
}
}
/**
* Creates a new timeout cycle with the default priority, GPriority.DEFAULT.
* Params:
* delegate() = the delegate to be executed
* seconds = interval in seconds.
* fireNow = When true the delegate will be executed emmidiatly
*/
this(bool delegate() dlg, uint seconds, bool fireNow=false)
{
timeoutListeners ~= dlg;
timeoutID = g_timeout_add_seconds(seconds, cast(GSourceFunc)&timeoutCallback, cast(void*)this);
if ( fireNow )
{
if ( !dlg() )
{
timeoutListeners.length = 0;
}
}
}
/**
* Creates a new timeout cycle.
* Params:
* delegate() = the delegate to be executed
* seconds = interval in seconds.
* priority = Priority for the timeout function
* fireNow = When true the delegate will be executed emmidiatly
*/
this(bool delegate() dlg, uint seconds, GPriority priority, bool fireNow=false)
{
timeoutListeners ~= dlg;
timeoutID = g_timeout_add_seconds_full(priority, seconds, cast(GSourceFunc)&timeoutCallback, cast(void*)this, null);
if ( fireNow )
{
if ( !dlg() )
{
timeoutListeners.length = 0;
}
}
}
/** */
public void stop()
{
if ( timeoutID > 0 )
{
g_source_remove(timeoutID);
}
timeoutID = 0;
timeoutListeners.length = 0;
}
/**
* Removes the timeout from gtk
*/
~this()
{
stop();
}
/**
* Adds a new delegate to this timeout cycle
* Params:
* dlg =
* fireNow =
*/
public void addListener(bool delegate() dlg, bool fireNow=false)
{
timeoutListeners ~= dlg;
if ( fireNow )
{
if ( !dlg() )
{
timeoutListeners.length = timeoutListeners.length - 1;
}
}
}
/**
* The callback execution from glib
* Params:
* timeout =
* Returns:
*/
extern(C) static bool timeoutCallback(Timeout timeout)
{
return timeout.callAllListeners();
}
/**
* Executes all delegates on the execution list
* Returns:
*/
private bool callAllListeners()
{
bool runAgain = false;
int i = 0;
while ( i