summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Fedoskin <afedoskin3@gmail.com>2016-07-26 21:41:27 (GMT)
committerArtem Fedoskin <afedoskin3@gmail.com>2016-07-26 22:10:21 (GMT)
commitd03d3fcc178442f053c91913f1c812b069dc6168 (patch)
tree496ad11c2880ab4cd95223f8fe6fd1fbdab85593
parent32b61546363013993a4eaaeef522f84e1067c774 (diff)
Added folder with Android (ARM) versions of some libraries (INDI, CFITSIO, LibNova, LibRaw) and changed folder with kirigami
-rw-r--r--android_lib/include/fitsio.h2000
-rw-r--r--android_lib/include/libnova.h134
-rwxr-xr-xandroid_lib/include/libraw/libraw.h377
-rw-r--r--android_lib/include/libraw/libraw_alloc.h99
-rw-r--r--android_lib/include/libraw/libraw_const.h298
-rw-r--r--android_lib/include/libraw/libraw_datastream.h297
-rw-r--r--android_lib/include/libraw/libraw_internal.h230
-rw-r--r--android_lib/include/libraw/libraw_types.h650
-rw-r--r--android_lib/include/libraw/libraw_version.h62
-rw-r--r--android_lib/include/longnam.h596
-rw-r--r--kstars/CMakeLists.txt2
m---------kstars/kstarslite/kirigami0
-rw-r--r--kstars/kstarslite/kirigami-lib/CMakeLists.txt124
-rw-r--r--kstars/kstarslite/kirigami-lib/KF5KirigamiConfig.cmake.in11
-rw-r--r--kstars/kstarslite/kirigami-lib/KF5KirigamiMacros.cmake85
-rw-r--r--kstars/kstarslite/kirigami-lib/LICENSE.GPL-2339
-rw-r--r--kstars/kstarslite/kirigami-lib/LICENSE.LGPL-2481
-rw-r--r--kstars/kstarslite/kirigami-lib/LICENSE.LGPL-2.1502
-rw-r--r--kstars/kstarslite/kirigami-lib/Mainpage.dox161
-rw-r--r--kstars/kstarslite/kirigami-lib/README.md27
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/CMakeLists.txt5
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/AndroidManifest.xml64
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/CMakeLists.txt14
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/kirigami.svgzbin0 -> 2926 bytes
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/main.cpp21
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/res/drawable-xxxhdpi/icon.pngbin0 -> 7430 bytes
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/res/drawable-xxxhdpi/kirigami_splash.9.pngbin0 -> 25055 bytes
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/res/drawable/icon.pngbin0 -> 7430 bytes
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/res/drawable/kirigami_splash.9.pngbin0 -> 13479 bytes
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/res/drawable/splash.xml12
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/res/values/apptheme.xml6
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/android/resources.qrc18
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/DesktopExampleApp.qml130
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/ExampleApp.qml141
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/MainPage.qml136
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/banner.jpgbin0 -> 146016 bytes
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ButtonGallery.qml220
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/CheckBoxGallery.qml110
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ListViewGallery.qml54
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/MultipleColumnsGallery.qml110
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/NonScrollableGallery.qml57
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ProgressBarGallery.qml131
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/RadioButtonGallery.qml108
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/SliderGallery.qml111
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/SwitchGallery.qml76
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/TextFieldGallery.qml68
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/gallery/metadata.desktop18
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/simpleexamples/AbstractApplicationWindow.qml166
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/simpleexamples/FixedSidebar.qml53
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/simpleexamples/MultipleColumnsGallery.qml88
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/simpleexamples/SplitDrawer.qml60
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/simpleexamples/TabBarHeader.qml53
-rw-r--r--kstars/kstarslite/kirigami-lib/examples/simpleexamples/minimal.qml69
-rw-r--r--kstars/kstarslite/kirigami-lib/kirigami.pri12
-rw-r--r--kstars/kstarslite/kirigami-lib/kirigami.pro28
-rw-r--r--kstars/kstarslite/kirigami-lib/kirigami.qrc47
-rw-r--r--kstars/kstarslite/kirigami-lib/metainfo.yaml12
-rw-r--r--kstars/kstarslite/kirigami-lib/src/CMakeLists.txt37
-rw-r--r--kstars/kstarslite/kirigami-lib/src/Messages.sh4
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/AbstractApplicationHeader.qml54
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/AbstractApplicationWindow.qml283
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/AbstractListItem.qml35
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/Action.qml57
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/ApplicationHeader.qml37
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/ApplicationWindow.qml175
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/BasicListItem.qml66
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/ContextDrawer.qml153
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/GlobalDrawer.qml373
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/Heading.qml82
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/Icon.qml50
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/Label.qml59
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/OverlayDrawer.qml133
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/OverlaySheet.qml106
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/Page.qml280
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/ScrollablePage.qml145
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/SplitDrawer.qml45
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/SwipeListItem.qml57
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/Theme.qml54
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/ToolBarApplicationHeader.qml204
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/Units.qml105
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/private/ActionButton.qml399
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/private/CornerShadow.qml72
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/private/DefaultListItemBackground.qml53
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/private/EdgeShadow.qml58
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/private/PageActionPropertyGroup.qml29
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/private/RefreshableScrollView.qml295
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/qmldir7
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/AbstractApplicationHeader.qml188
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/AbstractListItem.qml165
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/ApplicationHeader.qml230
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/OverlayDrawer.qml459
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/OverlaySheet.qml278
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/SplitDrawer.qml268
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/SwipeListItem.qml387
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/private/AbstractDrawer.qml51
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/private/BackButton.qml41
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/private/ContextIcon.qml70
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/private/MenuIcon.qml69
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/private/PageRow.qml511
-rw-r--r--kstars/kstarslite/kirigami-lib/src/controls/templates/private/PassiveNotification.qml151
-rw-r--r--kstars/kstarslite/kirigami-lib/src/kirigamiplugin.cpp92
-rw-r--r--kstars/kstarslite/kirigami-lib/src/kirigamiplugin.h101
-rw-r--r--kstars/kstarslite/kirigami-lib/src/qmldir23
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Desktop/AbstractApplicationHeader.qml54
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Desktop/AbstractListItem.qml30
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Desktop/ApplicationWindow.qml30
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Desktop/Icon.qml56
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Desktop/OverlayDrawer.qml129
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Desktop/SwipeListItem.qml30
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Desktop/Theme.qml62
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Desktop/Units.qml101
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Plasma/Icon.qml33
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Plasma/Theme.qml45
-rw-r--r--kstars/kstarslite/kirigami-lib/src/styles/Plasma/Units.qml102
114 files changed, 15935 insertions, 1 deletions
diff --git a/android_lib/include/fitsio.h b/android_lib/include/fitsio.h
new file mode 100644
index 0000000..cdfe8d2
--- /dev/null
+++ b/android_lib/include/fitsio.h
@@ -0,0 +1,2000 @@
+/* The FITSIO software was written by William Pence at the High Energy */
+/* Astrophysic Science Archive Research Center (HEASARC) at the NASA */
+/* Goddard Space Flight Center. */
+/*
+
+Copyright (Unpublished--all rights reserved under the copyright laws of
+the United States), U.S. Government as represented by the Administrator
+of the National Aeronautics and Space Administration. No copyright is
+claimed in the United States under Title 17, U.S. Code.
+
+Permission to freely use, copy, modify, and distribute this software
+and its documentation without fee is hereby granted, provided that this
+copyright notice and disclaimer of warranty appears in all copies.
+
+DISCLAIMER:
+
+THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND,
+EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO,
+ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY
+IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE
+DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE
+SOFTWARE WILL BE ERROR FREE. IN NO EVENT SHALL NASA BE LIABLE FOR ANY
+DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR
+CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY
+CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
+CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY
+PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED
+FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR
+SERVICES PROVIDED HEREUNDER."
+
+*/
+
+#ifndef _FITSIO_H
+#define _FITSIO_H
+
+#define CFITSIO_VERSION 3.39
+#define CFITSIO_MINOR 39
+#define CFITSIO_MAJOR 3
+#define CFITSIO_SONAME 5
+
+/* the SONAME is incremented in a new release if the binary shared */
+/* library (on linux and Mac systems) is not backward compatible */
+/* with the previous release of CFITSIO */
+
+
+/* CFITS_API is defined below for use on Windows systems. */
+/* It is used to identify the public functions which should be exported. */
+/* This has no effect on non-windows platforms where "WIN32" is not defined */
+
+#if defined (WIN32)
+ #if defined(cfitsio_EXPORTS)
+ #define CFITS_API __declspec(dllexport)
+ #else
+ #define CFITS_API /* __declspec(dllimport) */
+ #endif /* CFITS_API */
+#else /* defined (WIN32) */
+ #define CFITS_API
+#endif
+
+#include <stdio.h>
+
+/* the following was provided by Michael Greason (GSFC) to fix a */
+/* C/Fortran compatibility problem on an SGI Altix system running */
+/* SGI ProPack 4 [this is a Novell SuSE Enterprise 9 derivative] */
+/* and using the Intel C++ and Fortran compilers (version 9.1) */
+#if defined(__INTEL_COMPILER) && defined(__itanium__)
+# define mipsFortran 1
+# define _MIPS_SZLONG 64
+#endif
+
+#if defined(linux) || defined(__APPLE__) || defined(__sgi)
+# include <sys/types.h> /* apparently needed on debian linux systems */
+#endif /* to define off_t */
+
+#include <stdlib.h> /* apparently needed to define size_t with gcc 2.8.1 */
+#include <limits.h> /* needed for LLONG_MAX and INT64_MAX definitions */
+
+/* Define the datatype for variables which store file offset values. */
+/* The newer 'off_t' datatype should be used for this purpose, but some */
+/* older compilers do not recognize this type, in which case we use 'long' */
+/* instead. Note that _OFF_T is defined (or not) in stdio.h depending */
+/* on whether _LARGEFILE_SOURCE is defined in sys/feature_tests.h */
+/* (at least on Solaris platforms using cc) */
+
+/* Debian systems require: "(defined(linux) && defined(__off_t_defined))" */
+/* the mingw-w64 compiler requires: "(defined(__MINGW32__) && defined(_OFF_T_DEFINED))" */
+#if defined(_OFF_T) \
+ || (defined(linux) && defined(__off_t_defined)) \
+ || (defined(__MINGW32__) && defined(_OFF_T_DEFINED)) \
+ || defined(_MIPS_SZLONG) || defined(__APPLE__) || defined(_AIX)
+# define OFF_T off_t
+#elif defined(__BORLANDC__) || (_MSC_VER) && (_MSC_VER>= 1400)
+# define OFF_T long long
+#else
+# define OFF_T long
+#endif
+
+/* this block determines if the the string function name is
+ strtol or strtoll, and whether to use %ld or %lld in printf statements */
+
+/*
+ The following 2 cases for that Athon64 were removed on 4 Jan 2006;
+ they appear to be incorrect now that LONGLONG is always typedef'ed
+ to 'long long'
+ || defined(__ia64__) \
+ || defined(__x86_64__) \
+*/
+#if (defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) )) \
+ || defined(__sparcv9) || (defined(__sparc__) && defined(__arch64__)) \
+ || defined(__powerpc64__) || defined(__64BIT__) \
+ || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64) \
+ || defined( _MSC_VER)|| defined(__BORLANDC__)
+
+# define USE_LL_SUFFIX 0
+#else
+# define USE_LL_SUFFIX 1
+#endif
+
+/*
+ Determine what 8-byte integer data type is available.
+ 'long long' is now supported by most compilers, but
+ older MS Visual C++ compilers before V7.0 use '__int64' instead.
+*/
+
+#ifndef LONGLONG_TYPE /* this may have been previously defined */
+#if defined(_MSC_VER) /* Microsoft Visual C++ */
+
+#if (_MSC_VER < 1300) /* versions earlier than V7.0 do not have 'long long' */
+ typedef __int64 LONGLONG;
+#else /* newer versions do support 'long long' */
+ typedef long long LONGLONG;
+#endif
+
+#elif defined( __BORLANDC__) /* for the Borland 5.5 compiler, in particular */
+ typedef __int64 LONGLONG;
+#else
+ typedef long long LONGLONG;
+#endif
+
+#define LONGLONG_TYPE
+#endif
+
+#ifndef LONGLONG_MAX
+
+#ifdef LLONG_MAX
+/* Linux and Solaris definition */
+#define LONGLONG_MAX LLONG_MAX
+#define LONGLONG_MIN LLONG_MIN
+
+#elif defined(LONG_LONG_MAX)
+#define LONGLONG_MAX LONG_LONG_MAX
+#define LONGLONG_MIN LONG_LONG_MIN
+
+#elif defined(__LONG_LONG_MAX__)
+/* Mac OS X & CYGWIN defintion */
+#define LONGLONG_MAX __LONG_LONG_MAX__
+#define LONGLONG_MIN (-LONGLONG_MAX -1LL)
+
+#elif defined(INT64_MAX)
+/* windows definition */
+#define LONGLONG_MAX INT64_MAX
+#define LONGLONG_MIN INT64_MIN
+
+#elif defined(_I64_MAX)
+/* windows definition */
+#define LONGLONG_MAX _I64_MAX
+#define LONGLONG_MIN _I64_MIN
+
+#elif (defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) )) \
+ || defined(__sparcv9) \
+ || defined(__ia64__) \
+ || defined(__x86_64__) \
+ || defined(_SX) \
+ || defined(__powerpc64__) || defined(__64BIT__) \
+ || (defined(_MIPS_SZLONG) && _MIPS_SZLONG == 64)
+/* sizeof(long) = 64 */
+#define LONGLONG_MAX 9223372036854775807L /* max 64-bit integer */
+#define LONGLONG_MIN (-LONGLONG_MAX -1L) /* min 64-bit integer */
+
+#else
+/* define a default value, even if it is never used */
+#define LONGLONG_MAX 9223372036854775807LL /* max 64-bit integer */
+#define LONGLONG_MIN (-LONGLONG_MAX -1LL) /* min 64-bit integer */
+
+#endif
+#endif /* end of ndef LONGLONG_MAX section */
+
+
+/* ================================================================= */
+
+
+/* The following exclusion if __CINT__ is defined is needed for ROOT */
+#ifndef __CINT__
+#include "longnam.h"
+#endif
+
+#define NIOBUF 40 /* number of IO buffers to create (default = 40) */
+ /* !! Significantly increasing NIOBUF may degrade performance !! */
+
+#define IOBUFLEN 2880 /* size in bytes of each IO buffer (DONT CHANGE!) */
+
+/* global variables */
+
+#define FLEN_FILENAME 1025 /* max length of a filename */
+#define FLEN_KEYWORD 75 /* max length of a keyword (HIERARCH convention) */
+#define FLEN_CARD 81 /* length of a FITS header card */
+#define FLEN_VALUE 71 /* max length of a keyword value string */
+#define FLEN_COMMENT 73 /* max length of a keyword comment string */
+#define FLEN_ERRMSG 81 /* max length of a FITSIO error message */
+#define FLEN_STATUS 31 /* max length of a FITSIO status text string */
+
+#define TBIT 1 /* codes for FITS table data types */
+#define TBYTE 11
+#define TSBYTE 12
+#define TLOGICAL 14
+#define TSTRING 16
+#define TUSHORT 20
+#define TSHORT 21
+#define TUINT 30
+#define TINT 31
+#define TULONG 40
+#define TLONG 41
+#define TINT32BIT 41 /* used when returning datatype of a column */
+#define TFLOAT 42
+#define TLONGLONG 81
+#define TDOUBLE 82
+#define TCOMPLEX 83
+#define TDBLCOMPLEX 163
+
+#define TYP_STRUC_KEY 10
+#define TYP_CMPRS_KEY 20
+#define TYP_SCAL_KEY 30
+#define TYP_NULL_KEY 40
+#define TYP_DIM_KEY 50
+#define TYP_RANG_KEY 60
+#define TYP_UNIT_KEY 70
+#define TYP_DISP_KEY 80
+#define TYP_HDUID_KEY 90
+#define TYP_CKSUM_KEY 100
+#define TYP_WCS_KEY 110
+#define TYP_REFSYS_KEY 120
+#define TYP_COMM_KEY 130
+#define TYP_CONT_KEY 140
+#define TYP_USER_KEY 150
+
+
+#define INT32BIT int /* 32-bit integer datatype. Currently this */
+ /* datatype is an 'int' on all useful platforms */
+ /* however, it is possible that that are cases */
+ /* where 'int' is a 2-byte integer, in which case */
+ /* INT32BIT would need to be defined as 'long'. */
+
+#define BYTE_IMG 8 /* BITPIX code values for FITS image types */
+#define SHORT_IMG 16
+#define LONG_IMG 32
+#define LONGLONG_IMG 64
+#define FLOAT_IMG -32
+#define DOUBLE_IMG -64
+ /* The following 2 codes are not true FITS */
+ /* datatypes; these codes are only used internally */
+ /* within cfitsio to make it easier for users */
+ /* to deal with unsigned integers. */
+#define SBYTE_IMG 10
+#define USHORT_IMG 20
+#define ULONG_IMG 40
+
+#define IMAGE_HDU 0 /* Primary Array or IMAGE HDU */
+#define ASCII_TBL 1 /* ASCII table HDU */
+#define BINARY_TBL 2 /* Binary table HDU */
+#define ANY_HDU -1 /* matches any HDU type */
+
+#define READONLY 0 /* options when opening a file */
+#define READWRITE 1
+
+/* adopt a hopefully obscure number to use as a null value flag */
+/* could be problems if the FITS files contain data with these values */
+#define FLOATNULLVALUE -9.11912E-36F
+#define DOUBLENULLVALUE -9.1191291391491E-36
+
+/* compression algorithm codes */
+#define NO_DITHER -1
+#define SUBTRACTIVE_DITHER_1 1
+#define SUBTRACTIVE_DITHER_2 2
+#define MAX_COMPRESS_DIM 6
+#define RICE_1 11
+#define GZIP_1 21
+#define GZIP_2 22
+#define PLIO_1 31
+#define HCOMPRESS_1 41
+#define BZIP2_1 51 /* not publicly supported; only for test purposes */
+#define NOCOMPRESS -1
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#define CASESEN 1 /* do case-sensitive string match */
+#define CASEINSEN 0 /* do case-insensitive string match */
+
+#define GT_ID_ALL_URI 0 /* hierarchical grouping parameters */
+#define GT_ID_REF 1
+#define GT_ID_POS 2
+#define GT_ID_ALL 3
+#define GT_ID_REF_URI 11
+#define GT_ID_POS_URI 12
+
+#define OPT_RM_GPT 0
+#define OPT_RM_ENTRY 1
+#define OPT_RM_MBR 2
+#define OPT_RM_ALL 3
+
+#define OPT_GCP_GPT 0
+#define OPT_GCP_MBR 1
+#define OPT_GCP_ALL 2
+
+#define OPT_MCP_ADD 0
+#define OPT_MCP_NADD 1
+#define OPT_MCP_REPL 2
+#define OPT_MCP_MOV 3
+
+#define OPT_MRG_COPY 0
+#define OPT_MRG_MOV 1
+
+#define OPT_CMT_MBR 1
+#define OPT_CMT_MBR_DEL 11
+
+typedef struct /* structure used to store table column information */
+{
+ char ttype[70]; /* column name = FITS TTYPEn keyword; */
+ LONGLONG tbcol; /* offset in row to first byte of each column */
+ int tdatatype; /* datatype code of each column */
+ LONGLONG trepeat; /* repeat count of column; number of elements */
+ double tscale; /* FITS TSCALn linear scaling factor */
+ double tzero; /* FITS TZEROn linear scaling zero point */
+ LONGLONG tnull; /* FITS null value for int image or binary table cols */
+ char strnull[20]; /* FITS null value string for ASCII table columns */
+ char tform[10]; /* FITS tform keyword value */
+ long twidth; /* width of each ASCII table column */
+}tcolumn;
+
+#define VALIDSTRUC 555 /* magic value used to identify if structure is valid */
+
+typedef struct /* structure used to store basic FITS file information */
+{
+ int filehandle; /* handle returned by the file open function */
+ int driver; /* defines which set of I/O drivers should be used */
+ int open_count; /* number of opened 'fitsfiles' using this structure */
+ char *filename; /* file name */
+ int validcode; /* magic value used to verify that structure is valid */
+ int only_one; /* flag meaning only copy the specified extension */
+ LONGLONG filesize; /* current size of the physical disk file in bytes */
+ LONGLONG logfilesize; /* logical size of file, including unflushed buffers */
+ int lasthdu; /* is this the last HDU in the file? 0 = no, else yes */
+ LONGLONG bytepos; /* current logical I/O pointer position in file */
+ LONGLONG io_pos; /* current I/O pointer position in the physical file */
+ int curbuf; /* number of I/O buffer currently in use */
+ int curhdu; /* current HDU number; 0 = primary array */
+ int hdutype; /* 0 = primary array, 1 = ASCII table, 2 = binary table */
+ int writemode; /* 0 = readonly, 1 = readwrite */
+ int maxhdu; /* highest numbered HDU known to exist in the file */
+ int MAXHDU; /* dynamically allocated dimension of headstart array */
+ LONGLONG *headstart; /* byte offset in file to start of each HDU */
+ LONGLONG headend; /* byte offest in file to end of the current HDU header */
+ LONGLONG ENDpos; /* byte offest to where the END keyword was last written */
+ LONGLONG nextkey; /* byte offset in file to beginning of next keyword */
+ LONGLONG datastart; /* byte offset in file to start of the current data unit */
+ int imgdim; /* dimension of image; cached for fast access */
+ LONGLONG imgnaxis[99]; /* length of each axis; cached for fast access */
+ int tfield; /* number of fields in the table (primary array has 2 */
+ int startcol; /* used by ffgcnn to record starting column number */
+ LONGLONG origrows; /* original number of rows (value of NAXIS2 keyword) */
+ LONGLONG numrows; /* number of rows in the table (dynamically updated) */
+ LONGLONG rowlength; /* length of a table row or image size (bytes) */
+ tcolumn *tableptr; /* pointer to the table structure */
+ LONGLONG heapstart; /* heap start byte relative to start of data unit */
+ LONGLONG heapsize; /* size of the heap, in bytes */
+
+ /* the following elements are related to compressed images */
+
+ /* these record the 'requested' options to be used when the image is compressed */
+ int request_compress_type; /* requested image compression algorithm */
+ long request_tilesize[MAX_COMPRESS_DIM]; /* requested tiling size */
+ float request_quantize_level; /* requested quantize level */
+ int request_quantize_method ; /* requested quantizing method */
+ int request_dither_seed; /* starting offset into the array of random dithering */
+ int request_lossy_int_compress; /* lossy compress integer image as if float image? */
+ int request_huge_hdu; /* use '1Q' rather then '1P' variable length arrays */
+ float request_hcomp_scale; /* requested HCOMPRESS scale factor */
+ int request_hcomp_smooth; /* requested HCOMPRESS smooth parameter */
+
+ /* these record the actual options that were used when the image was compressed */
+ int compress_type; /* type of compression algorithm */
+ long tilesize[MAX_COMPRESS_DIM]; /* size of compression tiles */
+ float quantize_level; /* floating point quantization level */
+ int quantize_method; /* floating point pixel quantization algorithm */
+ int dither_seed; /* starting offset into the array of random dithering */
+
+ /* other compression parameters */
+ int compressimg; /* 1 if HDU contains a compressed image, else 0 */
+ char zcmptype[12]; /* compression type string */
+ int zbitpix; /* FITS data type of image (BITPIX) */
+ int zndim; /* dimension of image */
+ long znaxis[MAX_COMPRESS_DIM]; /* length of each axis */
+ long maxtilelen; /* max number of pixels in each image tile */
+ long maxelem; /* maximum byte length of tile compressed arrays */
+
+ int cn_compressed; /* column number for COMPRESSED_DATA column */
+ int cn_uncompressed; /* column number for UNCOMPRESSED_DATA column */
+ int cn_gzip_data; /* column number for GZIP2 lossless compressed data */
+ int cn_zscale; /* column number for ZSCALE column */
+ int cn_zzero; /* column number for ZZERO column */
+ int cn_zblank; /* column number for the ZBLANK column */
+
+ double zscale; /* scaling value, if same for all tiles */
+ double zzero; /* zero pt, if same for all tiles */
+ double cn_bscale; /* value of the BSCALE keyword in header */
+ double cn_bzero; /* value of the BZERO keyword (may be reset) */
+ double cn_actual_bzero; /* actual value of the BZERO keyword */
+ int zblank; /* value for null pixels, if not a column */
+
+ int rice_blocksize; /* first compression parameter: Rice pixels/block */
+ int rice_bytepix; /* 2nd compression parameter: Rice bytes/pixel */
+ float hcomp_scale; /* 1st hcompress compression parameter */
+ int hcomp_smooth; /* 2nd hcompress compression parameter */
+
+ int *tilerow; /* row number of the array of uncompressed tiledata */
+ long *tiledatasize; /* length of the array of tile data in bytes */
+ int *tiletype; /* datatype of the array of tile (TINT, TSHORT, etc) */
+ void **tiledata; /* array of uncompressed tile of data, for row *tilerow */
+ void **tilenullarray; /* array of optional array of null value flags */
+ int *tileanynull; /* anynulls in the array of tile? */
+
+ char *iobuffer; /* pointer to FITS file I/O buffers */
+ long bufrecnum[NIOBUF]; /* file record number of each of the buffers */
+ int dirty[NIOBUF]; /* has the corresponding buffer been modified? */
+ int ageindex[NIOBUF]; /* relative age of each buffer */
+} FITSfile;
+
+typedef struct /* structure used to store basic HDU information */
+{
+ int HDUposition; /* HDU position in file; 0 = first HDU */
+ FITSfile *Fptr; /* pointer to FITS file structure */
+}fitsfile;
+
+typedef struct /* structure for the iterator function column information */
+{
+ /* elements required as input to fits_iterate_data: */
+
+ fitsfile *fptr; /* pointer to the HDU containing the column */
+ int colnum; /* column number in the table (use name if < 1) */
+ char colname[70]; /* name (= TTYPEn value) of the column (optional) */
+ int datatype; /* output datatype (converted if necessary */
+ int iotype; /* = InputCol, InputOutputCol, or OutputCol */
+
+ /* output elements that may be useful for the work function: */
+
+ void *array; /* pointer to the array (and the null value) */
+ long repeat; /* binary table vector repeat value */
+ long tlmin; /* legal minimum data value */
+ long tlmax; /* legal maximum data value */
+ char tunit[70]; /* physical unit string */
+ char tdisp[70]; /* suggested display format */
+
+} iteratorCol;
+
+#define InputCol 0 /* flag for input only iterator column */
+#define InputOutputCol 1 /* flag for input and output iterator column */
+#define OutputCol 2 /* flag for output only iterator column */
+
+/*=============================================================================
+*
+* The following wtbarr typedef is used in the fits_read_wcstab() routine,
+* which is intended for use with the WCSLIB library written by Mark
+* Calabretta, http://www.atnf.csiro.au/~mcalabre/index.html
+*
+* In order to maintain WCSLIB and CFITSIO as independent libraries it
+* was not permissible for any CFITSIO library code to include WCSLIB
+* header files, or vice versa. However, the CFITSIO function
+* fits_read_wcstab() accepts an array of structs defined by wcs.h within
+* WCSLIB. The problem then was to define this struct within fitsio.h
+* without including wcs.h, especially noting that wcs.h will often (but
+* not always) be included together with fitsio.h in an applications
+* program that uses fits_read_wcstab().
+*
+* Of the various possibilities, the solution adopted was for WCSLIB to
+* define "struct wtbarr" while fitsio.h defines "typedef wtbarr", a
+* untagged struct with identical members. This allows both wcs.h and
+* fitsio.h to define a wtbarr data type without conflict by virtue of
+* the fact that structure tags and typedef names share different
+* namespaces in C. Therefore, declarations within WCSLIB look like
+*
+* struct wtbarr *w;
+*
+* while within CFITSIO they are simply
+*
+* wtbarr *w;
+*
+* but as suggested by the commonality of the names, these are really the
+* same aggregate data type. However, in passing a (struct wtbarr *) to
+* fits_read_wcstab() a cast to (wtbarr *) is formally required.
+*===========================================================================*/
+
+#ifndef WCSLIB_GETWCSTAB
+#define WCSLIB_GETWCSTAB
+
+typedef struct {
+ int i; /* Image axis number. */
+ int m; /* Array axis number for index vectors. */
+ int kind; /* Array type, 'c' (coord) or 'i' (index). */
+ char extnam[72]; /* EXTNAME of binary table extension. */
+ int extver; /* EXTVER of binary table extension. */
+ int extlev; /* EXTLEV of binary table extension. */
+ char ttype[72]; /* TTYPEn of column containing the array. */
+ long row; /* Table row number. */
+ int ndim; /* Expected array dimensionality. */
+ int *dimlen; /* Where to write the array axis lengths. */
+ double **arrayp; /* Where to write the address of the array */
+ /* allocated to store the array. */
+} wtbarr;
+
+/* The following exclusion if __CINT__ is defined is needed for ROOT */
+#ifndef __CINT__
+/* the following 3 lines are needed to support C++ compilers */
+#ifdef __cplusplus
+extern "C" {
+#endif
+#endif
+
+int CFITS_API fits_read_wcstab(fitsfile *fptr, int nwtb, wtbarr *wtb, int *status);
+
+/* The following exclusion if __CINT__ is defined is needed for ROOT */
+#ifndef __CINT__
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+#endif /* WCSLIB_GETWCSTAB */
+
+/* error status codes */
+
+#define CREATE_DISK_FILE -106 /* create disk file, without extended filename syntax */
+#define OPEN_DISK_FILE -105 /* open disk file, without extended filename syntax */
+#define SKIP_TABLE -104 /* move to 1st image when opening file */
+#define SKIP_IMAGE -103 /* move to 1st table when opening file */
+#define SKIP_NULL_PRIMARY -102 /* skip null primary array when opening file */
+#define USE_MEM_BUFF -101 /* use memory buffer when opening file */
+#define OVERFLOW_ERR -11 /* overflow during datatype conversion */
+#define PREPEND_PRIMARY -9 /* used in ffiimg to insert new primary array */
+#define SAME_FILE 101 /* input and output files are the same */
+#define TOO_MANY_FILES 103 /* tried to open too many FITS files */
+#define FILE_NOT_OPENED 104 /* could not open the named file */
+#define FILE_NOT_CREATED 105 /* could not create the named file */
+#define WRITE_ERROR 106 /* error writing to FITS file */
+#define END_OF_FILE 107 /* tried to move past end of file */
+#define READ_ERROR 108 /* error reading from FITS file */
+#define FILE_NOT_CLOSED 110 /* could not close the file */
+#define ARRAY_TOO_BIG 111 /* array dimensions exceed internal limit */
+#define READONLY_FILE 112 /* Cannot write to readonly file */
+#define MEMORY_ALLOCATION 113 /* Could not allocate memory */
+#define BAD_FILEPTR 114 /* invalid fitsfile pointer */
+#define NULL_INPUT_PTR 115 /* NULL input pointer to routine */
+#define SEEK_ERROR 116 /* error seeking position in file */
+
+#define BAD_URL_PREFIX 121 /* invalid URL prefix on file name */
+#define TOO_MANY_DRIVERS 122 /* tried to register too many IO drivers */
+#define DRIVER_INIT_FAILED 123 /* driver initialization failed */
+#define NO_MATCHING_DRIVER 124 /* matching driver is not registered */
+#define URL_PARSE_ERROR 125 /* failed to parse input file URL */
+#define RANGE_PARSE_ERROR 126 /* failed to parse input file URL */
+
+#define SHARED_ERRBASE (150)
+#define SHARED_BADARG (SHARED_ERRBASE + 1)
+#define SHARED_NULPTR (SHARED_ERRBASE + 2)
+#define SHARED_TABFULL (SHARED_ERRBASE + 3)
+#define SHARED_NOTINIT (SHARED_ERRBASE + 4)
+#define SHARED_IPCERR (SHARED_ERRBASE + 5)
+#define SHARED_NOMEM (SHARED_ERRBASE + 6)
+#define SHARED_AGAIN (SHARED_ERRBASE + 7)
+#define SHARED_NOFILE (SHARED_ERRBASE + 8)
+#define SHARED_NORESIZE (SHARED_ERRBASE + 9)
+
+#define HEADER_NOT_EMPTY 201 /* header already contains keywords */
+#define KEY_NO_EXIST 202 /* keyword not found in header */
+#define KEY_OUT_BOUNDS 203 /* keyword record number is out of bounds */
+#define VALUE_UNDEFINED 204 /* keyword value field is blank */
+#define NO_QUOTE 205 /* string is missing the closing quote */
+#define BAD_INDEX_KEY 206 /* illegal indexed keyword name */
+#define BAD_KEYCHAR 207 /* illegal character in keyword name or card */
+#define BAD_ORDER 208 /* required keywords out of order */
+#define NOT_POS_INT 209 /* keyword value is not a positive integer */
+#define NO_END 210 /* couldn't find END keyword */
+#define BAD_BITPIX 211 /* illegal BITPIX keyword value*/
+#define BAD_NAXIS 212 /* illegal NAXIS keyword value */
+#define BAD_NAXES 213 /* illegal NAXISn keyword value */
+#define BAD_PCOUNT 214 /* illegal PCOUNT keyword value */
+#define BAD_GCOUNT 215 /* illegal GCOUNT keyword value */
+#define BAD_TFIELDS 216 /* illegal TFIELDS keyword value */
+#define NEG_WIDTH 217 /* negative table row size */
+#define NEG_ROWS 218 /* negative number of rows in table */
+#define COL_NOT_FOUND 219 /* column with this name not found in table */
+#define BAD_SIMPLE 220 /* illegal value of SIMPLE keyword */
+#define NO_SIMPLE 221 /* Primary array doesn't start with SIMPLE */
+#define NO_BITPIX 222 /* Second keyword not BITPIX */
+#define NO_NAXIS 223 /* Third keyword not NAXIS */
+#define NO_NAXES 224 /* Couldn't find all the NAXISn keywords */
+#define NO_XTENSION 225 /* HDU doesn't start with XTENSION keyword */
+#define NOT_ATABLE 226 /* the CHDU is not an ASCII table extension */
+#define NOT_BTABLE 227 /* the CHDU is not a binary table extension */
+#define NO_PCOUNT 228 /* couldn't find PCOUNT keyword */
+#define NO_GCOUNT 229 /* couldn't find GCOUNT keyword */
+#define NO_TFIELDS 230 /* couldn't find TFIELDS keyword */
+#define NO_TBCOL 231 /* couldn't find TBCOLn keyword */
+#define NO_TFORM 232 /* couldn't find TFORMn keyword */
+#define NOT_IMAGE 233 /* the CHDU is not an IMAGE extension */
+#define BAD_TBCOL 234 /* TBCOLn keyword value < 0 or > rowlength */
+#define NOT_TABLE 235 /* the CHDU is not a table */
+#define COL_TOO_WIDE 236 /* column is too wide to fit in table */
+#define COL_NOT_UNIQUE 237 /* more than 1 column name matches template */
+#define BAD_ROW_WIDTH 241 /* sum of column widths not = NAXIS1 */
+#define UNKNOWN_EXT 251 /* unrecognizable FITS extension type */
+#define UNKNOWN_REC 252 /* unrecognizable FITS record */
+#define END_JUNK 253 /* END keyword is not blank */
+#define BAD_HEADER_FILL 254 /* Header fill area not blank */
+#define BAD_DATA_FILL 255 /* Data fill area not blank or zero */
+#define BAD_TFORM 261 /* illegal TFORM format code */
+#define BAD_TFORM_DTYPE 262 /* unrecognizable TFORM datatype code */
+#define BAD_TDIM 263 /* illegal TDIMn keyword value */
+#define BAD_HEAP_PTR 264 /* invalid BINTABLE heap address */
+
+#define BAD_HDU_NUM 301 /* HDU number < 1 or > MAXHDU */
+#define BAD_COL_NUM 302 /* column number < 1 or > tfields */
+#define NEG_FILE_POS 304 /* tried to move before beginning of file */
+#define NEG_BYTES 306 /* tried to read or write negative bytes */
+#define BAD_ROW_NUM 307 /* illegal starting row number in table */
+#define BAD_ELEM_NUM 308 /* illegal starting element number in vector */
+#define NOT_ASCII_COL 309 /* this is not an ASCII string column */
+#define NOT_LOGICAL_COL 310 /* this is not a logical datatype column */
+#define BAD_ATABLE_FORMAT 311 /* ASCII table column has wrong format */
+#define BAD_BTABLE_FORMAT 312 /* Binary table column has wrong format */
+#define NO_NULL 314 /* null value has not been defined */
+#define NOT_VARI_LEN 317 /* this is not a variable length column */
+#define BAD_DIMEN 320 /* illegal number of dimensions in array */
+#define BAD_PIX_NUM 321 /* first pixel number greater than last pixel */
+#define ZERO_SCALE 322 /* illegal BSCALE or TSCALn keyword = 0 */
+#define NEG_AXIS 323 /* illegal axis length < 1 */
+
+#define NOT_GROUP_TABLE 340
+#define HDU_ALREADY_MEMBER 341
+#define MEMBER_NOT_FOUND 342
+#define GROUP_NOT_FOUND 343
+#define BAD_GROUP_ID 344
+#define TOO_MANY_HDUS_TRACKED 345
+#define HDU_ALREADY_TRACKED 346
+#define BAD_OPTION 347
+#define IDENTICAL_POINTERS 348
+#define BAD_GROUP_ATTACH 349
+#define BAD_GROUP_DETACH 350
+
+#define BAD_I2C 401 /* bad int to formatted string conversion */
+#define BAD_F2C 402 /* bad float to formatted string conversion */
+#define BAD_INTKEY 403 /* can't interprete keyword value as integer */
+#define BAD_LOGICALKEY 404 /* can't interprete keyword value as logical */
+#define BAD_FLOATKEY 405 /* can't interprete keyword value as float */
+#define BAD_DOUBLEKEY 406 /* can't interprete keyword value as double */
+#define BAD_C2I 407 /* bad formatted string to int conversion */
+#define BAD_C2F 408 /* bad formatted string to float conversion */
+#define BAD_C2D 409 /* bad formatted string to double conversion */
+#define BAD_DATATYPE 410 /* bad keyword datatype code */
+#define BAD_DECIM 411 /* bad number of decimal places specified */
+#define NUM_OVERFLOW 412 /* overflow during datatype conversion */
+
+# define DATA_COMPRESSION_ERR 413 /* error in imcompress routines */
+# define DATA_DECOMPRESSION_ERR 414 /* error in imcompress routines */
+# define NO_COMPRESSED_TILE 415 /* compressed tile doesn't exist */
+
+#define BAD_DATE 420 /* error in date or time conversion */
+
+#define PARSE_SYNTAX_ERR 431 /* syntax error in parser expression */
+#define PARSE_BAD_TYPE 432 /* expression did not evaluate to desired type */
+#define PARSE_LRG_VECTOR 433 /* vector result too large to return in array */
+#define PARSE_NO_OUTPUT 434 /* data parser failed not sent an out column */
+#define PARSE_BAD_COL 435 /* bad data encounter while parsing column */
+#define PARSE_BAD_OUTPUT 436 /* Output file not of proper type */
+
+#define ANGLE_TOO_BIG 501 /* celestial angle too large for projection */
+#define BAD_WCS_VAL 502 /* bad celestial coordinate or pixel value */
+#define WCS_ERROR 503 /* error in celestial coordinate calculation */
+#define BAD_WCS_PROJ 504 /* unsupported type of celestial projection */
+#define NO_WCS_KEY 505 /* celestial coordinate keywords not found */
+#define APPROX_WCS_KEY 506 /* approximate WCS keywords were calculated */
+
+#define NO_CLOSE_ERROR 999 /* special value used internally to switch off */
+ /* the error message from ffclos and ffchdu */
+
+/*------- following error codes are used in the grparser.c file -----------*/
+#define NGP_ERRBASE (360) /* base chosen so not to interfere with CFITSIO */
+#define NGP_OK (0)
+#define NGP_NO_MEMORY (NGP_ERRBASE + 0) /* malloc failed */
+#define NGP_READ_ERR (NGP_ERRBASE + 1) /* read error from file */
+#define NGP_NUL_PTR (NGP_ERRBASE + 2) /* null pointer passed as argument */
+#define NGP_EMPTY_CURLINE (NGP_ERRBASE + 3) /* line read seems to be empty */
+#define NGP_UNREAD_QUEUE_FULL (NGP_ERRBASE + 4) /* cannot unread more then 1 line (or single line twice) */
+#define NGP_INC_NESTING (NGP_ERRBASE + 5) /* too deep include file nesting (inf. loop ?) */
+#define NGP_ERR_FOPEN (NGP_ERRBASE + 6) /* fopen() failed, cannot open file */
+#define NGP_EOF (NGP_ERRBASE + 7) /* end of file encountered */
+#define NGP_BAD_ARG (NGP_ERRBASE + 8) /* bad arguments passed */
+#define NGP_TOKEN_NOT_EXPECT (NGP_ERRBASE + 9) /* token not expected here */
+
+/* The following exclusion if __CINT__ is defined is needed for ROOT */
+#ifndef __CINT__
+/* the following 3 lines are needed to support C++ compilers */
+#ifdef __cplusplus
+extern "C" {
+#endif
+#endif
+
+int CFITS2Unit( fitsfile *fptr );
+CFITS_API fitsfile* CUnit2FITS(int unit);
+
+/*---------------- FITS file URL parsing routines -------------*/
+int CFITS_API fits_get_token (char **ptr, char *delimiter, char *token, int *isanumber);
+int CFITS_API fits_get_token2(char **ptr, char *delimiter, char **token, int *isanumber, int *status);
+char CFITS_API *fits_split_names(char *list);
+int CFITS_API ffiurl( char *url, char *urltype, char *infile,
+ char *outfile, char *extspec, char *rowfilter,
+ char *binspec, char *colspec, int *status);
+int CFITS_API ffifile (char *url, char *urltype, char *infile,
+ char *outfile, char *extspec, char *rowfilter,
+ char *binspec, char *colspec, char *pixfilter, int *status);
+int CFITS_API ffifile2 (char *url, char *urltype, char *infile,
+ char *outfile, char *extspec, char *rowfilter,
+ char *binspec, char *colspec, char *pixfilter, char *compspec, int *status);
+int CFITS_API ffrtnm(char *url, char *rootname, int *status);
+int CFITS_API ffexist(const char *infile, int *exists, int *status);
+int CFITS_API ffexts(char *extspec, int *extnum, char *extname, int *extvers,
+ int *hdutype, char *colname, char *rowexpress, int *status);
+int CFITS_API ffextn(char *url, int *extension_num, int *status);
+int CFITS_API ffurlt(fitsfile *fptr, char *urlType, int *status);
+int CFITS_API ffbins(char *binspec, int *imagetype, int *haxis,
+ char colname[4][FLEN_VALUE], double *minin,
+ double *maxin, double *binsizein,
+ char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE],
+ char binname[4][FLEN_VALUE], double *weight, char *wtname,
+ int *recip, int *status);
+int CFITS_API ffbinr(char **binspec, char *colname, double *minin,
+ double *maxin, double *binsizein, char *minname,
+ char *maxname, char *binname, int *status);
+int CFITS_API fits_copy_cell2image(fitsfile *fptr, fitsfile *newptr, char *colname,
+ long rownum, int *status);
+int CFITS_API fits_copy_image2cell(fitsfile *fptr, fitsfile *newptr, char *colname,
+ long rownum, int copykeyflag, int *status);
+int CFITS_API fits_copy_pixlist2image(fitsfile *infptr, fitsfile *outfptr, int firstkey, /* I - first HDU record number to start with */
+ int naxis, int *colnum, int *status);
+int CFITS_API ffimport_file( char *filename, char **contents, int *status );
+int CFITS_API ffrwrg( char *rowlist, LONGLONG maxrows, int maxranges, int *numranges,
+ long *minrow, long *maxrow, int *status);
+int CFITS_API ffrwrgll( char *rowlist, LONGLONG maxrows, int maxranges, int *numranges,
+ LONGLONG *minrow, LONGLONG *maxrow, int *status);
+/*---------------- FITS file I/O routines -------------*/
+int CFITS_API fits_init_cfitsio(void);
+int CFITS_API ffomem(fitsfile **fptr, const char *name, int mode, void **buffptr,
+ size_t *buffsize, size_t deltasize,
+ void *(*mem_realloc)(void *p, size_t newsize),
+ int *status);
+int CFITS_API ffopen(fitsfile **fptr, const char *filename, int iomode, int *status);
+int CFITS_API ffopentest(int soname, fitsfile **fptr, const char *filename, int iomode, int *status);
+
+int CFITS_API ffdopn(fitsfile **fptr, const char *filename, int iomode, int *status);
+int CFITS_API ffeopn(fitsfile **fptr, const char *filename, int iomode,
+ char *extlist, int *hdutype, int *status);
+int CFITS_API fftopn(fitsfile **fptr, const char *filename, int iomode, int *status);
+int CFITS_API ffiopn(fitsfile **fptr, const char *filename, int iomode, int *status);
+int CFITS_API ffdkopn(fitsfile **fptr, const char *filename, int iomode, int *status);
+int CFITS_API ffreopen(fitsfile *openfptr, fitsfile **newfptr, int *status);
+int CFITS_API ffinit( fitsfile **fptr, const char *filename, int *status);
+int CFITS_API ffdkinit(fitsfile **fptr, const char *filename, int *status);
+int CFITS_API ffimem(fitsfile **fptr, void **buffptr,
+ size_t *buffsize, size_t deltasize,
+ void *(*mem_realloc)(void *p, size_t newsize),
+ int *status);
+int CFITS_API fftplt(fitsfile **fptr, const char *filename, const char *tempname,
+ int *status);
+int CFITS_API ffflus(fitsfile *fptr, int *status);
+int CFITS_API ffflsh(fitsfile *fptr, int clearbuf, int *status);
+int CFITS_API ffclos(fitsfile *fptr, int *status);
+int CFITS_API ffdelt(fitsfile *fptr, int *status);
+int CFITS_API ffflnm(fitsfile *fptr, char *filename, int *status);
+int CFITS_API ffflmd(fitsfile *fptr, int *filemode, int *status);
+int CFITS_API fits_delete_iraf_file(const char *filename, int *status);
+
+/*---------------- utility routines -------------*/
+
+float CFITS_API ffvers(float *version);
+void CFITS_API ffupch(char *string);
+void CFITS_API ffgerr(int status, char *errtext);
+void CFITS_API ffpmsg(const char *err_message);
+void CFITS_API ffpmrk(void);
+int CFITS_API ffgmsg(char *err_message);
+void CFITS_API ffcmsg(void);
+void CFITS_API ffcmrk(void);
+void CFITS_API ffrprt(FILE *stream, int status);
+void CFITS_API ffcmps(char *templt, char *colname, int casesen, int *match,
+ int *exact);
+int CFITS_API fftkey(const char *keyword, int *status);
+int CFITS_API fftrec(char *card, int *status);
+int CFITS_API ffnchk(fitsfile *fptr, int *status);
+int CFITS_API ffkeyn(const char *keyroot, int value, char *keyname, int *status);
+int CFITS_API ffnkey(int value, const char *keyroot, char *keyname, int *status);
+int CFITS_API ffgkcl(char *card);
+int CFITS_API ffdtyp(const char *cval, char *dtype, int *status);
+int CFITS_API ffinttyp(char *cval, int *datatype, int *negative, int *status);
+int CFITS_API ffpsvc(char *card, char *value, char *comm, int *status);
+int CFITS_API ffgknm(char *card, char *name, int *length, int *status);
+int CFITS_API ffgthd(char *tmplt, char *card, int *hdtype, int *status);
+int CFITS_API ffmkky(const char *keyname, char *keyval, const char *comm, char *card, int *status);
+int CFITS_API fits_translate_keyword(char *inrec, char *outrec, char *patterns[][2],
+ int npat, int n_value, int n_offset, int n_range, int *pat_num,
+ int *i, int *j, int *m, int *n, int *status);
+int CFITS_API fits_translate_keywords(fitsfile *infptr, fitsfile *outfptr,
+ int firstkey, char *patterns[][2],
+ int npat, int n_value, int n_offset, int n_range, int *status);
+int CFITS_API ffasfm(char *tform, int *datacode, long *width, int *decim, int *status);
+int CFITS_API ffbnfm(char *tform, int *datacode, long *repeat, long *width, int *status);
+int CFITS_API ffbnfmll(char *tform, int *datacode, LONGLONG *repeat, long *width, int *status);
+int CFITS_API ffgabc(int tfields, char **tform, int space, long *rowlen, long *tbcol,
+ int *status);
+int CFITS_API fits_get_section_range(char **ptr,long *secmin,long *secmax,long *incre,
+ int *status);
+/* ffmbyt should not normally be used in application programs, but it is
+ defined here as a publicly available routine because there are a few
+ rare cases where it is needed
+*/
+int CFITS_API ffmbyt(fitsfile *fptr, LONGLONG bytpos, int ignore_err, int *status);
+/*----------------- write single keywords --------------*/
+int CFITS_API ffpky(fitsfile *fptr, int datatype, const char *keyname, void *value,
+ const char *comm, int *status);
+int CFITS_API ffprec(fitsfile *fptr, const char *card, int *status);
+int CFITS_API ffpcom(fitsfile *fptr, const char *comm, int *status);
+int CFITS_API ffpunt(fitsfile *fptr, const char *keyname, const char *unit, int *status);
+int CFITS_API ffphis(fitsfile *fptr, const char *history, int *status);
+int CFITS_API ffpdat(fitsfile *fptr, int *status);
+int CFITS_API ffverifydate(int year, int month, int day, int *status);
+int CFITS_API ffgstm(char *timestr, int *timeref, int *status);
+int CFITS_API ffgsdt(int *day, int *month, int *year, int *status);
+int CFITS_API ffdt2s(int year, int month, int day, char *datestr, int *status);
+int CFITS_API fftm2s(int year, int month, int day, int hour, int minute, double second,
+ int decimals, char *datestr, int *status);
+int CFITS_API ffs2dt(char *datestr, int *year, int *month, int *day, int *status);
+int CFITS_API ffs2tm(char *datestr, int *year, int *month, int *day, int *hour,
+ int *minute, double *second, int *status);
+int CFITS_API ffpkyu(fitsfile *fptr, const char *keyname, const char *comm, int *status);
+int CFITS_API ffpkys(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
+int CFITS_API ffpkls(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
+int CFITS_API ffplsw(fitsfile *fptr, int *status);
+int CFITS_API ffpkyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status);
+int CFITS_API ffpkyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status);
+int CFITS_API ffpkyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffpkye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffpkyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffpkyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffpkyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffpkym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffpkfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffpkfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffpkyt(fitsfile *fptr, const char *keyname, long intval, double frac, const char *comm,
+ int *status);
+int CFITS_API ffptdm( fitsfile *fptr, int colnum, int naxis, long naxes[], int *status);
+int CFITS_API ffptdmll( fitsfile *fptr, int colnum, int naxis, LONGLONG naxes[], int *status);
+
+/*----------------- write array of keywords --------------*/
+int CFITS_API ffpkns(fitsfile *fptr, const char *keyroot, int nstart, int nkey, char *value[],
+ char *comm[], int *status);
+int CFITS_API ffpknl(fitsfile *fptr, const char *keyroot, int nstart, int nkey, int *value,
+ char *comm[], int *status);
+int CFITS_API ffpknj(fitsfile *fptr, const char *keyroot, int nstart, int nkey, long *value,
+ char *comm[], int *status);
+int CFITS_API ffpknjj(fitsfile *fptr, const char *keyroot, int nstart, int nkey, LONGLONG *value,
+ char *comm[], int *status);
+int CFITS_API ffpknf(fitsfile *fptr, const char *keyroot, int nstart, int nkey, float *value,
+ int decim, char *comm[], int *status);
+int CFITS_API ffpkne(fitsfile *fptr, const char *keyroot, int nstart, int nkey, float *value,
+ int decim, char *comm[], int *status);
+int CFITS_API ffpkng(fitsfile *fptr, const char *keyroot, int nstart, int nkey, double *value,
+ int decim, char *comm[], int *status);
+int CFITS_API ffpknd(fitsfile *fptr, const char *keyroot, int nstart, int nkey, double *value,
+ int decim, char *comm[], int *status);
+int CFITS_API ffcpky(fitsfile *infptr,fitsfile *outfptr,int incol,int outcol,
+ char *rootname, int *status);
+
+/*----------------- write required header keywords --------------*/
+int CFITS_API ffphps( fitsfile *fptr, int bitpix, int naxis, long naxes[], int *status);
+int CFITS_API ffphpsll( fitsfile *fptr, int bitpix, int naxis, LONGLONG naxes[], int *status);
+int CFITS_API ffphpr( fitsfile *fptr, int simple, int bitpix, int naxis, long naxes[],
+ LONGLONG pcount, LONGLONG gcount, int extend, int *status);
+int CFITS_API ffphprll( fitsfile *fptr, int simple, int bitpix, int naxis, LONGLONG naxes[],
+ LONGLONG pcount, LONGLONG gcount, int extend, int *status);
+int CFITS_API ffphtb(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, int tfields, char **ttype,
+ long *tbcol, char **tform, char **tunit, const char *extname, int *status);
+int CFITS_API ffphbn(fitsfile *fptr, LONGLONG naxis2, int tfields, char **ttype,
+ char **tform, char **tunit, const char *extname, LONGLONG pcount, int *status);
+int CFITS_API ffphext( fitsfile *fptr, const char *xtension, int bitpix, int naxis, long naxes[],
+ LONGLONG pcount, LONGLONG gcount, int *status);
+/*----------------- write template keywords --------------*/
+int CFITS_API ffpktp(fitsfile *fptr, const char *filename, int *status);
+
+/*------------------ get header information --------------*/
+int CFITS_API ffghsp(fitsfile *fptr, int *nexist, int *nmore, int *status);
+int CFITS_API ffghps(fitsfile *fptr, int *nexist, int *position, int *status);
+
+/*------------------ move position in header -------------*/
+int CFITS_API ffmaky(fitsfile *fptr, int nrec, int *status);
+int CFITS_API ffmrky(fitsfile *fptr, int nrec, int *status);
+
+/*------------------ read single keywords -----------------*/
+int CFITS_API ffgnxk(fitsfile *fptr, char **inclist, int ninc, char **exclist,
+ int nexc, char *card, int *status);
+int CFITS_API ffgrec(fitsfile *fptr, int nrec, char *card, int *status);
+int CFITS_API ffgcrd(fitsfile *fptr, const char *keyname, char *card, int *status);
+int CFITS_API ffgstr(fitsfile *fptr, const char *string, char *card, int *status);
+int CFITS_API ffgunt(fitsfile *fptr, const char *keyname, char *unit, int *status);
+int CFITS_API ffgkyn(fitsfile *fptr, int nkey, char *keyname, char *keyval, char *comm,
+ int *status);
+int CFITS_API ffgkey(fitsfile *fptr, const char *keyname, char *keyval, char *comm,
+ int *status);
+
+int CFITS_API ffgky( fitsfile *fptr, int datatype, const char *keyname, void *value,
+ char *comm, int *status);
+int CFITS_API ffgkys(fitsfile *fptr, const char *keyname, char *value, char *comm, int *status);
+int CFITS_API ffgksl(fitsfile *fptr, const char *keyname, int *length, int *status);
+int CFITS_API ffgkls(fitsfile *fptr, const char *keyname, char **value, char *comm, int *status);
+int CFITS_API ffgsky(fitsfile *fptr, const char *keyname, int firstchar, int maxchar,
+ char *value, int *valuelen, char *comm, int *status);
+int CFITS_API fffree(void *value, int *status);
+int CFITS_API fffkls(char *value, int *status);
+int CFITS_API ffgkyl(fitsfile *fptr, const char *keyname, int *value, char *comm, int *status);
+int CFITS_API ffgkyj(fitsfile *fptr, const char *keyname, long *value, char *comm, int *status);
+int CFITS_API ffgkyjj(fitsfile *fptr, const char *keyname, LONGLONG *value, char *comm, int *status);
+int CFITS_API ffgkye(fitsfile *fptr, const char *keyname, float *value, char *comm,int *status);
+int CFITS_API ffgkyd(fitsfile *fptr, const char *keyname, double *value,char *comm,int *status);
+int CFITS_API ffgkyc(fitsfile *fptr, const char *keyname, float *value, char *comm,int *status);
+int CFITS_API ffgkym(fitsfile *fptr, const char *keyname, double *value,char *comm,int *status);
+int CFITS_API ffgkyt(fitsfile *fptr, const char *keyname, long *ivalue, double *dvalue,
+ char *comm, int *status);
+int CFITS_API ffgtdm(fitsfile *fptr, int colnum, int maxdim, int *naxis, long naxes[],
+ int *status);
+int CFITS_API ffgtdmll(fitsfile *fptr, int colnum, int maxdim, int *naxis, LONGLONG naxes[],
+ int *status);
+int CFITS_API ffdtdm(fitsfile *fptr, char *tdimstr, int colnum, int maxdim,
+ int *naxis, long naxes[], int *status);
+int CFITS_API ffdtdmll(fitsfile *fptr, char *tdimstr, int colnum, int maxdim,
+ int *naxis, LONGLONG naxes[], int *status);
+
+/*------------------ read array of keywords -----------------*/
+int CFITS_API ffgkns(fitsfile *fptr, const char *keyname, int nstart, int nmax, char *value[],
+ int *nfound, int *status);
+int CFITS_API ffgknl(fitsfile *fptr, const char *keyname, int nstart, int nmax, int *value,
+ int *nfound, int *status);
+int CFITS_API ffgknj(fitsfile *fptr, const char *keyname, int nstart, int nmax, long *value,
+ int *nfound, int *status);
+int CFITS_API ffgknjj(fitsfile *fptr, const char *keyname, int nstart, int nmax, LONGLONG *value,
+ int *nfound, int *status);
+int CFITS_API ffgkne(fitsfile *fptr, const char *keyname, int nstart, int nmax, float *value,
+ int *nfound, int *status);
+int CFITS_API ffgknd(fitsfile *fptr, const char *keyname, int nstart, int nmax, double *value,
+ int *nfound, int *status);
+int CFITS_API ffh2st(fitsfile *fptr, char **header, int *status);
+int CFITS_API ffhdr2str( fitsfile *fptr, int exclude_comm, char **exclist,
+ int nexc, char **header, int *nkeys, int *status);
+int CFITS_API ffcnvthdr2str( fitsfile *fptr, int exclude_comm, char **exclist,
+ int nexc, char **header, int *nkeys, int *status);
+
+/*----------------- read required header keywords --------------*/
+int CFITS_API ffghpr(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis,
+ long naxes[], long *pcount, long *gcount, int *extend, int *status);
+
+int CFITS_API ffghprll(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis,
+ LONGLONG naxes[], long *pcount, long *gcount, int *extend, int *status);
+
+int CFITS_API ffghtb(fitsfile *fptr,int maxfield, long *naxis1, long *naxis2,
+ int *tfields, char **ttype, long *tbcol, char **tform, char **tunit,
+ char *extname, int *status);
+
+int CFITS_API ffghtbll(fitsfile *fptr,int maxfield, LONGLONG *naxis1, LONGLONG *naxis2,
+ int *tfields, char **ttype, LONGLONG *tbcol, char **tform, char **tunit,
+ char *extname, int *status);
+
+
+int CFITS_API ffghbn(fitsfile *fptr, int maxfield, long *naxis2, int *tfields,
+ char **ttype, char **tform, char **tunit, char *extname,
+ long *pcount, int *status);
+
+int CFITS_API ffghbnll(fitsfile *fptr, int maxfield, LONGLONG *naxis2, int *tfields,
+ char **ttype, char **tform, char **tunit, char *extname,
+ LONGLONG *pcount, int *status);
+
+/*--------------------- update keywords ---------------*/
+int CFITS_API ffuky(fitsfile *fptr, int datatype, const char *keyname, void *value,
+ const char *comm, int *status);
+int CFITS_API ffucrd(fitsfile *fptr, const char *keyname, const char *card, int *status);
+int CFITS_API ffukyu(fitsfile *fptr, const char *keyname, const char *comm, int *status);
+int CFITS_API ffukys(fitsfile *fptr, const char *keyname, const char *value, const char *comm, int *status);
+int CFITS_API ffukls(fitsfile *fptr, const char *keyname, const char *value, const char *comm, int *status);
+int CFITS_API ffukyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status);
+int CFITS_API ffukyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status);
+int CFITS_API ffukyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffukye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffukyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffukyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffukyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffukym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffukfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffukfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
+ int *status);
+
+/*--------------------- modify keywords ---------------*/
+int CFITS_API ffmrec(fitsfile *fptr, int nkey, const char *card, int *status);
+int CFITS_API ffmcrd(fitsfile *fptr, const char *keyname, const char *card, int *status);
+int CFITS_API ffmnam(fitsfile *fptr, const char *oldname, const char *newname, int *status);
+int CFITS_API ffmcom(fitsfile *fptr, const char *keyname, const char *comm, int *status);
+int CFITS_API ffmkyu(fitsfile *fptr, const char *keyname, const char *comm, int *status);
+int CFITS_API ffmkys(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
+int CFITS_API ffmkls(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
+int CFITS_API ffmkyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status);
+int CFITS_API ffmkyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status);
+int CFITS_API ffmkyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffmkye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffmkyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffmkyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffmkyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffmkym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffmkfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffmkfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
+ int *status);
+
+/*--------------------- insert keywords ---------------*/
+int CFITS_API ffirec(fitsfile *fptr, int nkey, const char *card, int *status);
+int CFITS_API ffikey(fitsfile *fptr, const char *card, int *status);
+int CFITS_API ffikyu(fitsfile *fptr, const char *keyname, const char *comm, int *status);
+int CFITS_API ffikys(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
+int CFITS_API ffikls(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
+int CFITS_API ffikyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status);
+int CFITS_API ffikyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status);
+int CFITS_API ffikyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffikye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffikyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffikyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffikyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffikym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffikfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
+ int *status);
+int CFITS_API ffikfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
+ int *status);
+
+/*--------------------- delete keywords ---------------*/
+int CFITS_API ffdkey(fitsfile *fptr, const char *keyname, int *status);
+int CFITS_API ffdstr(fitsfile *fptr, const char *string, int *status);
+int CFITS_API ffdrec(fitsfile *fptr, int keypos, int *status);
+
+/*--------------------- get HDU information -------------*/
+int CFITS_API ffghdn(fitsfile *fptr, int *chdunum);
+int CFITS_API ffghdt(fitsfile *fptr, int *exttype, int *status);
+int CFITS_API ffghad(fitsfile *fptr, long *headstart, long *datastart, long *dataend,
+ int *status);
+int CFITS_API ffghadll(fitsfile *fptr, LONGLONG *headstart, LONGLONG *datastart,
+ LONGLONG *dataend, int *status);
+int CFITS_API ffghof(fitsfile *fptr, OFF_T *headstart, OFF_T *datastart, OFF_T *dataend,
+ int *status);
+int CFITS_API ffgipr(fitsfile *fptr, int maxaxis, int *imgtype, int *naxis,
+ long *naxes, int *status);
+int CFITS_API ffgiprll(fitsfile *fptr, int maxaxis, int *imgtype, int *naxis,
+ LONGLONG *naxes, int *status);
+int CFITS_API ffgidt(fitsfile *fptr, int *imgtype, int *status);
+int CFITS_API ffgiet(fitsfile *fptr, int *imgtype, int *status);
+int CFITS_API ffgidm(fitsfile *fptr, int *naxis, int *status);
+int CFITS_API ffgisz(fitsfile *fptr, int nlen, long *naxes, int *status);
+int CFITS_API ffgiszll(fitsfile *fptr, int nlen, LONGLONG *naxes, int *status);
+
+/*--------------------- HDU operations -------------*/
+int CFITS_API ffmahd(fitsfile *fptr, int hdunum, int *exttype, int *status);
+int CFITS_API ffmrhd(fitsfile *fptr, int hdumov, int *exttype, int *status);
+int CFITS_API ffmnhd(fitsfile *fptr, int exttype, char *hduname, int hduvers,
+ int *status);
+int CFITS_API ffthdu(fitsfile *fptr, int *nhdu, int *status);
+int CFITS_API ffcrhd(fitsfile *fptr, int *status);
+int CFITS_API ffcrim(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status);
+int CFITS_API ffcrimll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status);
+int CFITS_API ffcrtb(fitsfile *fptr, int tbltype, LONGLONG naxis2, int tfields, char **ttype,
+ char **tform, char **tunit, const char *extname, int *status);
+int CFITS_API ffiimg(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status);
+int CFITS_API ffiimgll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status);
+int CFITS_API ffitab(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, int tfields, char **ttype,
+ long *tbcol, char **tform, char **tunit, const char *extname, int *status);
+int CFITS_API ffibin(fitsfile *fptr, LONGLONG naxis2, int tfields, char **ttype, char **tform,
+ char **tunit, const char *extname, LONGLONG pcount, int *status);
+int CFITS_API ffrsim(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status);
+int CFITS_API ffrsimll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status);
+int CFITS_API ffdhdu(fitsfile *fptr, int *hdutype, int *status);
+int CFITS_API ffcopy(fitsfile *infptr, fitsfile *outfptr, int morekeys, int *status);
+int CFITS_API ffcpfl(fitsfile *infptr, fitsfile *outfptr, int prev, int cur, int follow,
+ int *status);
+int CFITS_API ffcphd(fitsfile *infptr, fitsfile *outfptr, int *status);
+int CFITS_API ffcpdt(fitsfile *infptr, fitsfile *outfptr, int *status);
+int CFITS_API ffchfl(fitsfile *fptr, int *status);
+int CFITS_API ffcdfl(fitsfile *fptr, int *status);
+int CFITS_API ffwrhdu(fitsfile *fptr, FILE *outstream, int *status);
+
+int CFITS_API ffrdef(fitsfile *fptr, int *status);
+int CFITS_API ffhdef(fitsfile *fptr, int morekeys, int *status);
+int CFITS_API ffpthp(fitsfile *fptr, long theap, int *status);
+
+int CFITS_API ffcsum(fitsfile *fptr, long nrec, unsigned long *sum, int *status);
+void CFITS_API ffesum(unsigned long sum, int complm, char *ascii);
+unsigned long CFITS_API ffdsum(char *ascii, int complm, unsigned long *sum);
+int CFITS_API ffpcks(fitsfile *fptr, int *status);
+int CFITS_API ffupck(fitsfile *fptr, int *status);
+int CFITS_API ffvcks(fitsfile *fptr, int *datastatus, int *hdustatus, int *status);
+int CFITS_API ffgcks(fitsfile *fptr, unsigned long *datasum, unsigned long *hdusum,
+ int *status);
+
+/*--------------------- define scaling or null values -------------*/
+int CFITS_API ffpscl(fitsfile *fptr, double scale, double zeroval, int *status);
+int CFITS_API ffpnul(fitsfile *fptr, LONGLONG nulvalue, int *status);
+int CFITS_API fftscl(fitsfile *fptr, int colnum, double scale, double zeroval, int *status);
+int CFITS_API fftnul(fitsfile *fptr, int colnum, LONGLONG nulvalue, int *status);
+int CFITS_API ffsnul(fitsfile *fptr, int colnum, char *nulstring, int *status);
+
+/*--------------------- get column information -------------*/
+int CFITS_API ffgcno(fitsfile *fptr, int casesen, char *templt, int *colnum,
+ int *status);
+int CFITS_API ffgcnn(fitsfile *fptr, int casesen, char *templt, char *colname,
+ int *colnum, int *status);
+
+int CFITS_API ffgtcl(fitsfile *fptr, int colnum, int *typecode, long *repeat,
+ long *width, int *status);
+int CFITS_API ffgtclll(fitsfile *fptr, int colnum, int *typecode, LONGLONG *repeat,
+ LONGLONG *width, int *status);
+int CFITS_API ffeqty(fitsfile *fptr, int colnum, int *typecode, long *repeat,
+ long *width, int *status);
+int CFITS_API ffeqtyll(fitsfile *fptr, int colnum, int *typecode, LONGLONG *repeat,
+ LONGLONG *width, int *status);
+int CFITS_API ffgncl(fitsfile *fptr, int *ncols, int *status);
+int CFITS_API ffgnrw(fitsfile *fptr, long *nrows, int *status);
+int CFITS_API ffgnrwll(fitsfile *fptr, LONGLONG *nrows, int *status);
+int CFITS_API ffgacl(fitsfile *fptr, int colnum, char *ttype, long *tbcol,
+ char *tunit, char *tform, double *tscal, double *tzero,
+ char *tnull, char *tdisp, int *status);
+int CFITS_API ffgbcl(fitsfile *fptr, int colnum, char *ttype, char *tunit,
+ char *dtype, long *repeat, double *tscal, double *tzero,
+ long *tnull, char *tdisp, int *status);
+int CFITS_API ffgbclll(fitsfile *fptr, int colnum, char *ttype, char *tunit,
+ char *dtype, LONGLONG *repeat, double *tscal, double *tzero,
+ LONGLONG *tnull, char *tdisp, int *status);
+int CFITS_API ffgrsz(fitsfile *fptr, long *nrows, int *status);
+int CFITS_API ffgcdw(fitsfile *fptr, int colnum, int *width, int *status);
+
+/*--------------------- read primary array or image elements -------------*/
+int CFITS_API ffgpxv(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem,
+ void *nulval, void *array, int *anynul, int *status);
+int CFITS_API ffgpxvll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem,
+ void *nulval, void *array, int *anynul, int *status);
+int CFITS_API ffgpxf(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem,
+ void *array, char *nullarray, int *anynul, int *status);
+int CFITS_API ffgpxfll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem,
+ void *array, char *nullarray, int *anynul, int *status);
+int CFITS_API ffgsv(fitsfile *fptr, int datatype, long *blc, long *trc, long *inc,
+ void *nulval, void *array, int *anynul, int *status);
+
+int CFITS_API ffgpv(fitsfile *fptr, int datatype, LONGLONG firstelem, LONGLONG nelem,
+ void *nulval, void *array, int *anynul, int *status);
+int CFITS_API ffgpf(fitsfile *fptr, int datatype, LONGLONG firstelem, LONGLONG nelem,
+ void *array, char *nullarray, int *anynul, int *status);
+int CFITS_API ffgpvb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, unsigned
+ char nulval, unsigned char *array, int *anynul, int *status);
+int CFITS_API ffgpvsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, signed
+ char nulval, signed char *array, int *anynul, int *status);
+int CFITS_API ffgpvui(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ unsigned short nulval, unsigned short *array, int *anynul,
+ int *status);
+int CFITS_API ffgpvi(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ short nulval, short *array, int *anynul, int *status);
+int CFITS_API ffgpvuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ unsigned long nulval, unsigned long *array, int *anynul,
+ int *status);
+int CFITS_API ffgpvj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ long nulval, long *array, int *anynul, int *status);
+int CFITS_API ffgpvjj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ LONGLONG nulval, LONGLONG *array, int *anynul, int *status);
+int CFITS_API ffgpvuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ unsigned int nulval, unsigned int *array, int *anynul, int *status);
+int CFITS_API ffgpvk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ int nulval, int *array, int *anynul, int *status);
+int CFITS_API ffgpve(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ float nulval, float *array, int *anynul, int *status);
+int CFITS_API ffgpvd(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ double nulval, double *array, int *anynul, int *status);
+
+int CFITS_API ffgpfb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ unsigned char *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgpfsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ signed char *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgpfui(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ unsigned short *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgpfi(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ short *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgpfuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ unsigned long *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgpfj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ long *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgpfjj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ LONGLONG *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgpfuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ unsigned int *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgpfk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ int *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgpfe(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ float *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgpfd(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ double *array, char *nularray, int *anynul, int *status);
+
+int CFITS_API ffg2db(fitsfile *fptr, long group, unsigned char nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, unsigned char *array,
+ int *anynul, int *status);
+int CFITS_API ffg2dsb(fitsfile *fptr, long group, signed char nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, signed char *array,
+ int *anynul, int *status);
+int CFITS_API ffg2dui(fitsfile *fptr, long group, unsigned short nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, unsigned short *array,
+ int *anynul, int *status);
+int CFITS_API ffg2di(fitsfile *fptr, long group, short nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, short *array,
+ int *anynul, int *status);
+int CFITS_API ffg2duj(fitsfile *fptr, long group, unsigned long nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, unsigned long *array,
+ int *anynul, int *status);
+int CFITS_API ffg2dj(fitsfile *fptr, long group, long nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, long *array,
+ int *anynul, int *status);
+int CFITS_API ffg2djj(fitsfile *fptr, long group, LONGLONG nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, LONGLONG *array,
+ int *anynul, int *status);
+int CFITS_API ffg2duk(fitsfile *fptr, long group, unsigned int nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, unsigned int *array,
+ int *anynul, int *status);
+int CFITS_API ffg2dk(fitsfile *fptr, long group, int nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, int *array,
+ int *anynul, int *status);
+int CFITS_API ffg2de(fitsfile *fptr, long group, float nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, float *array,
+ int *anynul, int *status);
+int CFITS_API ffg2dd(fitsfile *fptr, long group, double nulval, LONGLONG ncols,
+ LONGLONG naxis1, LONGLONG naxis2, double *array,
+ int *anynul, int *status);
+
+int CFITS_API ffg3db(fitsfile *fptr, long group, unsigned char nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ unsigned char *array, int *anynul, int *status);
+int CFITS_API ffg3dsb(fitsfile *fptr, long group, signed char nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ signed char *array, int *anynul, int *status);
+int CFITS_API ffg3dui(fitsfile *fptr, long group, unsigned short nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ unsigned short *array, int *anynul, int *status);
+int CFITS_API ffg3di(fitsfile *fptr, long group, short nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ short *array, int *anynul, int *status);
+int CFITS_API ffg3duj(fitsfile *fptr, long group, unsigned long nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ unsigned long *array, int *anynul, int *status);
+int CFITS_API ffg3dj(fitsfile *fptr, long group, long nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ long *array, int *anynul, int *status);
+int CFITS_API ffg3djj(fitsfile *fptr, long group, LONGLONG nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ LONGLONG *array, int *anynul, int *status);
+int CFITS_API ffg3duk(fitsfile *fptr, long group, unsigned int nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ unsigned int *array, int *anynul, int *status);
+int CFITS_API ffg3dk(fitsfile *fptr, long group, int nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ int *array, int *anynul, int *status);
+int CFITS_API ffg3de(fitsfile *fptr, long group, float nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ float *array, int *anynul, int *status);
+int CFITS_API ffg3dd(fitsfile *fptr, long group, double nulval, LONGLONG ncols,
+ LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
+ double *array, int *anynul, int *status);
+
+int CFITS_API ffgsvb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, unsigned char nulval, unsigned char *array,
+ int *anynul, int *status);
+int CFITS_API ffgsvsb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, signed char nulval, signed char *array,
+ int *anynul, int *status);
+int CFITS_API ffgsvui(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, unsigned short nulval, unsigned short *array,
+ int *anynul, int *status);
+int CFITS_API ffgsvi(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, short nulval, short *array, int *anynul, int *status);
+int CFITS_API ffgsvuj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, unsigned long nulval, unsigned long *array,
+ int *anynul, int *status);
+int CFITS_API ffgsvj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, long nulval, long *array, int *anynul, int *status);
+int CFITS_API ffgsvjj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, LONGLONG nulval, LONGLONG *array, int *anynul,
+ int *status);
+int CFITS_API ffgsvuk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, unsigned int nulval, unsigned int *array,
+ int *anynul, int *status);
+int CFITS_API ffgsvk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, int nulval, int *array, int *anynul, int *status);
+int CFITS_API ffgsve(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, float nulval, float *array, int *anynul, int *status);
+int CFITS_API ffgsvd(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, double nulval, double *array, int *anynul,
+ int *status);
+
+int CFITS_API ffgsfb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, unsigned char *array, char *flagval,
+ int *anynul, int *status);
+int CFITS_API ffgsfsb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, signed char *array, char *flagval,
+ int *anynul, int *status);
+int CFITS_API ffgsfui(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, unsigned short *array, char *flagval, int *anynul,
+ int *status);
+int CFITS_API ffgsfi(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, short *array, char *flagval, int *anynul, int *status);
+int CFITS_API ffgsfuj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, unsigned long *array, char *flagval, int *anynul,
+ int *status);
+int CFITS_API ffgsfj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, long *array, char *flagval, int *anynul, int *status);
+int CFITS_API ffgsfjj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, LONGLONG *array, char *flagval, int *anynul,
+ int *status);
+int CFITS_API ffgsfuk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, unsigned int *array, char *flagval, int *anynul,
+ int *status);
+int CFITS_API ffgsfk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, int *array, char *flagval, int *anynul, int *status);
+int CFITS_API ffgsfe(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, float *array, char *flagval, int *anynul, int *status);
+int CFITS_API ffgsfd(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
+ long *trc, long *inc, double *array, char *flagval, int *anynul,
+ int *status);
+
+int CFITS_API ffggpb(fitsfile *fptr, long group, long firstelem, long nelem,
+ unsigned char *array, int *status);
+int CFITS_API ffggpsb(fitsfile *fptr, long group, long firstelem, long nelem,
+ signed char *array, int *status);
+int CFITS_API ffggpui(fitsfile *fptr, long group, long firstelem, long nelem,
+ unsigned short *array, int *status);
+int CFITS_API ffggpi(fitsfile *fptr, long group, long firstelem, long nelem,
+ short *array, int *status);
+int CFITS_API ffggpuj(fitsfile *fptr, long group, long firstelem, long nelem,
+ unsigned long *array, int *status);
+int CFITS_API ffggpj(fitsfile *fptr, long group, long firstelem, long nelem,
+ long *array, int *status);
+int CFITS_API ffggpjj(fitsfile *fptr, long group, long firstelem, long nelem,
+ LONGLONG *array, int *status);
+int CFITS_API ffggpuk(fitsfile *fptr, long group, long firstelem, long nelem,
+ unsigned int *array, int *status);
+int CFITS_API ffggpk(fitsfile *fptr, long group, long firstelem, long nelem,
+ int *array, int *status);
+int CFITS_API ffggpe(fitsfile *fptr, long group, long firstelem, long nelem,
+ float *array, int *status);
+int CFITS_API ffggpd(fitsfile *fptr, long group, long firstelem, long nelem,
+ double *array, int *status);
+
+/*--------------------- read column elements -------------*/
+int CFITS_API ffgcv( fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow,
+ LONGLONG firstelem, LONGLONG nelem, void *nulval, void *array, int *anynul,
+ int *status);
+int CFITS_API ffgcf( fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow,
+ LONGLONG firstelem, LONGLONG nelem, void *array, char *nullarray,
+ int *anynul, int *status);
+int CFITS_API ffgcvs(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, char *nulval, char **array, int *anynul, int *status);
+int CFITS_API ffgcl (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, char *array, int *status);
+int CFITS_API ffgcvl (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, char nulval, char *array, int *anynul, int *status);
+int CFITS_API ffgcvb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned char nulval, unsigned char *array,
+ int *anynul, int *status);
+int CFITS_API ffgcvsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, signed char nulval, signed char *array,
+ int *anynul, int *status);
+int CFITS_API ffgcvui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned short nulval, unsigned short *array,
+ int *anynul, int *status);
+int CFITS_API ffgcvi(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, short nulval, short *array, int *anynul, int *status);
+int CFITS_API ffgcvuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned long nulval, unsigned long *array, int *anynul,
+ int *status);
+int CFITS_API ffgcvj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, long nulval, long *array, int *anynul, int *status);
+int CFITS_API ffgcvjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, LONGLONG nulval, LONGLONG *array, int *anynul,
+ int *status);
+int CFITS_API ffgcvuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned int nulval, unsigned int *array, int *anynul,
+ int *status);
+int CFITS_API ffgcvk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, int nulval, int *array, int *anynul, int *status);
+int CFITS_API ffgcve(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, float nulval, float *array, int *anynul, int *status);
+int CFITS_API ffgcvd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, double nulval, double *array, int *anynul, int *status);
+int CFITS_API ffgcvc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, float nulval, float *array, int *anynul, int *status);
+int CFITS_API ffgcvm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, double nulval, double *array, int *anynul, int *status);
+
+int CFITS_API ffgcx(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstbit,
+ LONGLONG nbits, char *larray, int *status);
+int CFITS_API ffgcxui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows,
+ long firstbit, int nbits, unsigned short *array, int *status);
+int CFITS_API ffgcxuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows,
+ long firstbit, int nbits, unsigned int *array, int *status);
+
+int CFITS_API ffgcfs(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, char **array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfl(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, char *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned char *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, signed char *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned short *array, char *nularray, int *anynul,
+ int *status);
+int CFITS_API ffgcfi(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, short *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned long *array, char *nularray, int *anynul,
+ int *status);
+int CFITS_API ffgcfj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, long *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, LONGLONG *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned int *array, char *nularray, int *anynul,
+ int *status);
+int CFITS_API ffgcfk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, int *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfe(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, float *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, double *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, float *array, char *nularray, int *anynul, int *status);
+int CFITS_API ffgcfm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, double *array, char *nularray, int *anynul, int *status);
+
+int CFITS_API ffgdes(fitsfile *fptr, int colnum, LONGLONG rownum, long *length,
+ long *heapaddr, int *status);
+int CFITS_API ffgdesll(fitsfile *fptr, int colnum, LONGLONG rownum, LONGLONG *length,
+ LONGLONG *heapaddr, int *status);
+int CFITS_API ffgdess(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, long *length,
+ long *heapaddr, int *status);
+int CFITS_API ffgdessll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, LONGLONG *length,
+ LONGLONG *heapaddr, int *status);
+int CFITS_API ffpdes(fitsfile *fptr, int colnum, LONGLONG rownum, LONGLONG length,
+ LONGLONG heapaddr, int *status);
+int CFITS_API fftheap(fitsfile *fptr, LONGLONG *heapsize, LONGLONG *unused, LONGLONG *overlap,
+ int *valid, int *status);
+int CFITS_API ffcmph(fitsfile *fptr, int *status);
+
+int CFITS_API ffgtbb(fitsfile *fptr, LONGLONG firstrow, LONGLONG firstchar, LONGLONG nchars,
+ unsigned char *values, int *status);
+
+int CFITS_API ffgextn(fitsfile *fptr, LONGLONG offset, LONGLONG nelem, void *array, int *status);
+int CFITS_API ffpextn(fitsfile *fptr, LONGLONG offset, LONGLONG nelem, void *array, int *status);
+
+/*------------ write primary array or image elements -------------*/
+int CFITS_API ffppx(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem,
+ void *array, int *status);
+int CFITS_API ffppxll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem,
+ void *array, int *status);
+int CFITS_API ffppxn(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem,
+ void *array, void *nulval, int *status);
+int CFITS_API ffppxnll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem,
+ void *array, void *nulval, int *status);
+int CFITS_API ffppr(fitsfile *fptr, int datatype, LONGLONG firstelem,
+ LONGLONG nelem, void *array, int *status);
+int CFITS_API ffpprb(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, unsigned char *array, int *status);
+int CFITS_API ffpprsb(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, signed char *array, int *status);
+int CFITS_API ffpprui(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, unsigned short *array, int *status);
+int CFITS_API ffppri(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, short *array, int *status);
+int CFITS_API ffppruj(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, unsigned long *array, int *status);
+int CFITS_API ffpprj(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, long *array, int *status);
+int CFITS_API ffppruk(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, unsigned int *array, int *status);
+int CFITS_API ffpprk(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, int *array, int *status);
+int CFITS_API ffppre(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, float *array, int *status);
+int CFITS_API ffpprd(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, double *array, int *status);
+int CFITS_API ffpprjj(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, LONGLONG *array, int *status);
+
+int CFITS_API ffppru(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ int *status);
+int CFITS_API ffpprn(fitsfile *fptr, LONGLONG firstelem, LONGLONG nelem, int *status);
+
+int CFITS_API ffppn(fitsfile *fptr, int datatype, LONGLONG firstelem, LONGLONG nelem,
+ void *array, void *nulval, int *status);
+int CFITS_API ffppnb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ unsigned char *array, unsigned char nulval, int *status);
+int CFITS_API ffppnsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ signed char *array, signed char nulval, int *status);
+int CFITS_API ffppnui(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, unsigned short *array, unsigned short nulval,
+ int *status);
+int CFITS_API ffppni(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, short *array, short nulval, int *status);
+int CFITS_API ffppnj(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, long *array, long nulval, int *status);
+int CFITS_API ffppnuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ unsigned long *array, unsigned long nulval, int *status);
+int CFITS_API ffppnuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
+ unsigned int *array, unsigned int nulval, int *status);
+int CFITS_API ffppnk(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, int *array, int nulval, int *status);
+int CFITS_API ffppne(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, float *array, float nulval, int *status);
+int CFITS_API ffppnd(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, double *array, double nulval, int *status);
+int CFITS_API ffppnjj(fitsfile *fptr, long group, LONGLONG firstelem,
+ LONGLONG nelem, LONGLONG *array, LONGLONG nulval, int *status);
+
+int CFITS_API ffp2db(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, unsigned char *array, int *status);
+int CFITS_API ffp2dsb(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, signed char *array, int *status);
+int CFITS_API ffp2dui(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, unsigned short *array, int *status);
+int CFITS_API ffp2di(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, short *array, int *status);
+int CFITS_API ffp2duj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, unsigned long *array, int *status);
+int CFITS_API ffp2dj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, long *array, int *status);
+int CFITS_API ffp2duk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, unsigned int *array, int *status);
+int CFITS_API ffp2dk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, int *array, int *status);
+int CFITS_API ffp2de(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, float *array, int *status);
+int CFITS_API ffp2dd(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, double *array, int *status);
+int CFITS_API ffp2djj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG *array, int *status);
+
+int CFITS_API ffp3db(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, unsigned char *array, int *status);
+int CFITS_API ffp3dsb(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, signed char *array, int *status);
+int CFITS_API ffp3dui(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, unsigned short *array, int *status);
+int CFITS_API ffp3di(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, short *array, int *status);
+int CFITS_API ffp3duj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, unsigned long *array, int *status);
+int CFITS_API ffp3dj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, long *array, int *status);
+int CFITS_API ffp3duk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, unsigned int *array, int *status);
+int CFITS_API ffp3dk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, int *array, int *status);
+int CFITS_API ffp3de(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, float *array, int *status);
+int CFITS_API ffp3dd(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, double *array, int *status);
+int CFITS_API ffp3djj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
+ LONGLONG naxis2, LONGLONG naxis3, LONGLONG *array, int *status);
+
+int CFITS_API ffpss(fitsfile *fptr, int datatype,
+ long *fpixel, long *lpixel, void *array, int *status);
+int CFITS_API ffpssb(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, unsigned char *array, int *status);
+int CFITS_API ffpsssb(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, signed char *array, int *status);
+int CFITS_API ffpssui(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, unsigned short *array, int *status);
+int CFITS_API ffpssi(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, short *array, int *status);
+int CFITS_API ffpssuj(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, unsigned long *array, int *status);
+int CFITS_API ffpssj(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, long *array, int *status);
+int CFITS_API ffpssuk(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, unsigned int *array, int *status);
+int CFITS_API ffpssk(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, int *array, int *status);
+int CFITS_API ffpsse(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, float *array, int *status);
+int CFITS_API ffpssd(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, double *array, int *status);
+int CFITS_API ffpssjj(fitsfile *fptr, long group, long naxis, long *naxes,
+ long *fpixel, long *lpixel, LONGLONG *array, int *status);
+
+int CFITS_API ffpgpb(fitsfile *fptr, long group, long firstelem,
+ long nelem, unsigned char *array, int *status);
+int CFITS_API ffpgpsb(fitsfile *fptr, long group, long firstelem,
+ long nelem, signed char *array, int *status);
+int CFITS_API ffpgpui(fitsfile *fptr, long group, long firstelem,
+ long nelem, unsigned short *array, int *status);
+int CFITS_API ffpgpi(fitsfile *fptr, long group, long firstelem,
+ long nelem, short *array, int *status);
+int CFITS_API ffpgpuj(fitsfile *fptr, long group, long firstelem,
+ long nelem, unsigned long *array, int *status);
+int CFITS_API ffpgpj(fitsfile *fptr, long group, long firstelem,
+ long nelem, long *array, int *status);
+int CFITS_API ffpgpuk(fitsfile *fptr, long group, long firstelem,
+ long nelem, unsigned int *array, int *status);
+int CFITS_API ffpgpk(fitsfile *fptr, long group, long firstelem,
+ long nelem, int *array, int *status);
+int CFITS_API ffpgpe(fitsfile *fptr, long group, long firstelem,
+ long nelem, float *array, int *status);
+int CFITS_API ffpgpd(fitsfile *fptr, long group, long firstelem,
+ long nelem, double *array, int *status);
+int CFITS_API ffpgpjj(fitsfile *fptr, long group, long firstelem,
+ long nelem, LONGLONG *array, int *status);
+
+/*--------------------- iterator functions -------------*/
+int CFITS_API fits_iter_set_by_name(iteratorCol *col, fitsfile *fptr, char *colname,
+ int datatype, int iotype);
+int CFITS_API fits_iter_set_by_num(iteratorCol *col, fitsfile *fptr, int colnum,
+ int datatype, int iotype);
+int CFITS_API fits_iter_set_file(iteratorCol *col, fitsfile *fptr);
+int CFITS_API fits_iter_set_colname(iteratorCol *col, char *colname);
+int CFITS_API fits_iter_set_colnum(iteratorCol *col, int colnum);
+int CFITS_API fits_iter_set_datatype(iteratorCol *col, int datatype);
+int CFITS_API fits_iter_set_iotype(iteratorCol *col, int iotype);
+
+CFITS_API fitsfile * fits_iter_get_file(iteratorCol *col);
+char CFITS_API * fits_iter_get_colname(iteratorCol *col);
+int CFITS_API fits_iter_get_colnum(iteratorCol *col);
+int CFITS_API fits_iter_get_datatype(iteratorCol *col);
+int CFITS_API fits_iter_get_iotype(iteratorCol *col);
+void CFITS_API *fits_iter_get_array(iteratorCol *col);
+long CFITS_API fits_iter_get_tlmin(iteratorCol *col);
+long CFITS_API fits_iter_get_tlmax(iteratorCol *col);
+long CFITS_API fits_iter_get_repeat(iteratorCol *col);
+char CFITS_API *fits_iter_get_tunit(iteratorCol *col);
+char CFITS_API *fits_iter_get_tdisp(iteratorCol *col);
+
+int CFITS_API ffiter(int ncols, iteratorCol *data, long offset, long nPerLoop,
+ int (*workFn)( long totaln, long offset, long firstn,
+ long nvalues, int narrays, iteratorCol *data, void *userPointer),
+ void *userPointer, int *status);
+
+/*--------------------- write column elements -------------*/
+int CFITS_API ffpcl(fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow,
+ LONGLONG firstelem, LONGLONG nelem, void *array, int *status);
+int CFITS_API ffpcls(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, char **array, int *status);
+int CFITS_API ffpcll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, char *array, int *status);
+int CFITS_API ffpclb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned char *array, int *status);
+int CFITS_API ffpclsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, signed char *array, int *status);
+int CFITS_API ffpclui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned short *array, int *status);
+int CFITS_API ffpcli(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, short *array, int *status);
+int CFITS_API ffpcluj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned long *array, int *status);
+int CFITS_API ffpclj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, long *array, int *status);
+int CFITS_API ffpcluk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned int *array, int *status);
+int CFITS_API ffpclk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, int *array, int *status);
+int CFITS_API ffpcle(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, float *array, int *status);
+int CFITS_API ffpcld(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, double *array, int *status);
+int CFITS_API ffpclc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, float *array, int *status);
+int CFITS_API ffpclm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, double *array, int *status);
+int CFITS_API ffpclu(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, int *status);
+int CFITS_API ffprwu(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status);
+int CFITS_API ffpcljj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, LONGLONG *array, int *status);
+int CFITS_API ffpclx(fitsfile *fptr, int colnum, LONGLONG frow, long fbit, long nbit,
+ char *larray, int *status);
+
+int CFITS_API ffpcn(fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, void *array, void *nulval, int *status);
+int CFITS_API ffpcns( fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, char **array, char *nulvalue, int *status);
+int CFITS_API ffpcnl( fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, char *array, char nulvalue, int *status);
+int CFITS_API ffpcnb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned char *array, unsigned char nulvalue,
+ int *status);
+int CFITS_API ffpcnsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, signed char *array, signed char nulvalue,
+ int *status);
+int CFITS_API ffpcnui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned short *array, unsigned short nulvalue,
+ int *status);
+int CFITS_API ffpcni(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, short *array, short nulvalue, int *status);
+int CFITS_API ffpcnuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned long *array, unsigned long nulvalue,
+ int *status);
+int CFITS_API ffpcnj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, long *array, long nulvalue, int *status);
+int CFITS_API ffpcnuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, unsigned int *array, unsigned int nulvalue,
+ int *status);
+int CFITS_API ffpcnk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, int *array, int nulvalue, int *status);
+int CFITS_API ffpcne(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, float *array, float nulvalue, int *status);
+int CFITS_API ffpcnd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, double *array, double nulvalue, int *status);
+int CFITS_API ffpcnjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
+ LONGLONG nelem, LONGLONG *array, LONGLONG nulvalue, int *status);
+int CFITS_API ffptbb(fitsfile *fptr, LONGLONG firstrow, LONGLONG firstchar, LONGLONG nchars,
+ unsigned char *values, int *status);
+
+int CFITS_API ffirow(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status);
+int CFITS_API ffdrow(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status);
+int CFITS_API ffdrrg(fitsfile *fptr, char *ranges, int *status);
+int CFITS_API ffdrws(fitsfile *fptr, long *rownum, long nrows, int *status);
+int CFITS_API ffdrwsll(fitsfile *fptr, LONGLONG *rownum, LONGLONG nrows, int *status);
+int CFITS_API fficol(fitsfile *fptr, int numcol, char *ttype, char *tform, int *status);
+int CFITS_API fficls(fitsfile *fptr, int firstcol, int ncols, char **ttype,
+ char **tform, int *status);
+int CFITS_API ffmvec(fitsfile *fptr, int colnum, LONGLONG newveclen, int *status);
+int CFITS_API ffdcol(fitsfile *fptr, int numcol, int *status);
+int CFITS_API ffcpcl(fitsfile *infptr, fitsfile *outfptr, int incol, int outcol,
+ int create_col, int *status);
+int CFITS_API ffcprw(fitsfile *infptr, fitsfile *outfptr, LONGLONG firstrow,
+ LONGLONG nrows, int *status);
+
+/*--------------------- WCS Utilities ------------------*/
+int CFITS_API ffgics(fitsfile *fptr, double *xrval, double *yrval, double *xrpix,
+ double *yrpix, double *xinc, double *yinc, double *rot,
+ char *type, int *status);
+int CFITS_API ffgicsa(fitsfile *fptr, char version, double *xrval, double *yrval, double *xrpix,
+ double *yrpix, double *xinc, double *yinc, double *rot,
+ char *type, int *status);
+int CFITS_API ffgtcs(fitsfile *fptr, int xcol, int ycol, double *xrval,
+ double *yrval, double *xrpix, double *yrpix, double *xinc,
+ double *yinc, double *rot, char *type, int *status);
+int CFITS_API ffwldp(double xpix, double ypix, double xref, double yref,
+ double xrefpix, double yrefpix, double xinc, double yinc,
+ double rot, char *type, double *xpos, double *ypos, int *status);
+int CFITS_API ffxypx(double xpos, double ypos, double xref, double yref,
+ double xrefpix, double yrefpix, double xinc, double yinc,
+ double rot, char *type, double *xpix, double *ypix, int *status);
+
+/* WCS support routines (provide interface to Doug Mink's WCS library */
+int CFITS_API ffgiwcs(fitsfile *fptr, char **header, int *status);
+int CFITS_API ffgtwcs(fitsfile *fptr, int xcol, int ycol, char **header, int *status);
+
+/*--------------------- lexical parsing routines ------------------*/
+int CFITS_API fftexp( fitsfile *fptr, char *expr, int maxdim,
+ int *datatype, long *nelem, int *naxis,
+ long *naxes, int *status );
+
+int CFITS_API fffrow( fitsfile *infptr, char *expr,
+ long firstrow, long nrows,
+ long *n_good_rows, char *row_status, int *status);
+
+int CFITS_API ffffrw( fitsfile *fptr, char *expr, long *rownum, int *status);
+
+int CFITS_API fffrwc( fitsfile *fptr, char *expr, char *timeCol,
+ char *parCol, char *valCol, long ntimes,
+ double *times, char *time_status, int *status );
+
+int CFITS_API ffsrow( fitsfile *infptr, fitsfile *outfptr, char *expr,
+ int *status);
+
+int CFITS_API ffcrow( fitsfile *fptr, int datatype, char *expr,
+ long firstrow, long nelements, void *nulval,
+ void *array, int *anynul, int *status );
+
+int CFITS_API ffcalc_rng( fitsfile *infptr, char *expr, fitsfile *outfptr,
+ char *parName, char *parInfo, int nRngs,
+ long *start, long *end, int *status );
+
+int CFITS_API ffcalc( fitsfile *infptr, char *expr, fitsfile *outfptr,
+ char *parName, char *parInfo, int *status );
+
+ /* ffhist is not really intended as a user-callable routine */
+ /* but it may be useful for some specialized applications */
+ /* ffhist2 is a newer version which is strongly recommended instead of ffhist */
+
+int CFITS_API ffhist(fitsfile **fptr, char *outfile, int imagetype, int naxis,
+ char colname[4][FLEN_VALUE],
+ double *minin, double *maxin, double *binsizein,
+ char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE],
+ char binname[4][FLEN_VALUE],
+ double weightin, char wtcol[FLEN_VALUE],
+ int recip, char *rowselect, int *status);
+int CFITS_API ffhist2(fitsfile **fptr, char *outfile, int imagetype, int naxis,
+ char colname[4][FLEN_VALUE],
+ double *minin, double *maxin, double *binsizein,
+ char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE],
+ char binname[4][FLEN_VALUE],
+ double weightin, char wtcol[FLEN_VALUE],
+ int recip, char *rowselect, int *status);
+CFITS_API fitsfile *ffhist3(fitsfile *fptr,
+ char *outfile, int imagetype, int naxis,
+ char colname[4][FLEN_VALUE],
+ double *minin,
+ double *maxin,
+ double *binsizein,
+ char minname[4][FLEN_VALUE],
+ char maxname[4][FLEN_VALUE],
+ char binname[4][FLEN_VALUE],
+ double weightin,
+ char wtcol[FLEN_VALUE],
+ int recip,
+ char *selectrow,
+ int *status);
+int CFITS_API fits_select_image_section(fitsfile **fptr, char *outfile,
+ char *imagesection, int *status);
+int CFITS_API fits_copy_image_section(fitsfile *infptr, fitsfile *outfile,
+ char *imagesection, int *status);
+
+int CFITS_API fits_calc_binning(fitsfile *fptr, int naxis, char colname[4][FLEN_VALUE],
+ double *minin, double *maxin, double *binsizein,
+ char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE],
+ char binname[4][FLEN_VALUE], int *colnum, long *haxes, float *amin,
+ float *amax, float *binsize, int *status);
+
+int CFITS_API fits_write_keys_histo(fitsfile *fptr, fitsfile *histptr,
+ int naxis, int *colnum, int *status);
+int CFITS_API fits_rebin_wcs( fitsfile *fptr, int naxis, float *amin, float *binsize,
+ int *status);
+int CFITS_API fits_make_hist(fitsfile *fptr, fitsfile *histptr, int bitpix,int naxis,
+ long *naxes, int *colnum, float *amin, float *amax, float *binsize,
+ float weight, int wtcolnum, int recip, char *selectrow, int *status);
+
+typedef struct
+{
+ /* input(s) */
+ int count;
+ char ** path;
+ char ** tag;
+ fitsfile ** ifptr;
+
+ char * expression;
+
+ /* output control */
+ int bitpix;
+ long blank;
+ fitsfile * ofptr;
+ char keyword[FLEN_KEYWORD];
+ char comment[FLEN_COMMENT];
+} PixelFilter;
+
+
+int CFITS_API fits_pixel_filter (PixelFilter * filter, int * status);
+
+
+/*--------------------- grouping routines ------------------*/
+
+int CFITS_API ffgtcr(fitsfile *fptr, char *grpname, int grouptype, int *status);
+int CFITS_API ffgtis(fitsfile *fptr, char *grpname, int grouptype, int *status);
+int CFITS_API ffgtch(fitsfile *gfptr, int grouptype, int *status);
+int CFITS_API ffgtrm(fitsfile *gfptr, int rmopt, int *status);
+int CFITS_API ffgtcp(fitsfile *infptr, fitsfile *outfptr, int cpopt, int *status);
+int CFITS_API ffgtmg(fitsfile *infptr, fitsfile *outfptr, int mgopt, int *status);
+int CFITS_API ffgtcm(fitsfile *gfptr, int cmopt, int *status);
+int CFITS_API ffgtvf(fitsfile *gfptr, long *firstfailed, int *status);
+int CFITS_API ffgtop(fitsfile *mfptr,int group,fitsfile **gfptr,int *status);
+int CFITS_API ffgtam(fitsfile *gfptr, fitsfile *mfptr, int hdupos, int *status);
+int CFITS_API ffgtnm(fitsfile *gfptr, long *nmembers, int *status);
+int CFITS_API ffgmng(fitsfile *mfptr, long *nmembers, int *status);
+int CFITS_API ffgmop(fitsfile *gfptr, long member, fitsfile **mfptr, int *status);
+int CFITS_API ffgmcp(fitsfile *gfptr, fitsfile *mfptr, long member, int cpopt,
+ int *status);
+int CFITS_API ffgmtf(fitsfile *infptr, fitsfile *outfptr, long member, int tfopt,
+ int *status);
+int CFITS_API ffgmrm(fitsfile *fptr, long member, int rmopt, int *status);
+
+/*--------------------- group template parser routines ------------------*/
+
+int CFITS_API fits_execute_template(fitsfile *ff, char *ngp_template, int *status);
+
+int CFITS_API fits_img_stats_short(short *array,long nx, long ny, int nullcheck,
+ short nullvalue,long *ngoodpix, short *minvalue, short *maxvalue, double *mean,
+ double *sigma, double *noise1, double *noise2, double *noise3, double *noise5, int *status);
+int CFITS_API fits_img_stats_int(int *array,long nx, long ny, int nullcheck,
+ int nullvalue,long *ngoodpix, int *minvalue, int *maxvalue, double *mean,
+ double *sigma, double *noise1, double *noise2, double *noise3, double *noise5, int *status);
+int CFITS_API fits_img_stats_float(float *array, long nx, long ny, int nullcheck,
+ float nullvalue,long *ngoodpix, float *minvalue, float *maxvalue, double *mean,
+ double *sigma, double *noise1, double *noise2, double *noise3, double *noise5, int *status);
+
+/*--------------------- image compression routines ------------------*/
+
+int CFITS_API fits_set_compression_type(fitsfile *fptr, int ctype, int *status);
+int CFITS_API fits_set_tile_dim(fitsfile *fptr, int ndim, long *dims, int *status);
+int CFITS_API fits_set_noise_bits(fitsfile *fptr, int noisebits, int *status);
+int CFITS_API fits_set_quantize_level(fitsfile *fptr, float qlevel, int *status);
+int CFITS_API fits_set_hcomp_scale(fitsfile *fptr, float scale, int *status);
+int CFITS_API fits_set_hcomp_smooth(fitsfile *fptr, int smooth, int *status);
+int CFITS_API fits_set_quantize_method(fitsfile *fptr, int method, int *status);
+int CFITS_API fits_set_quantize_dither(fitsfile *fptr, int dither, int *status);
+int CFITS_API fits_set_dither_seed(fitsfile *fptr, int seed, int *status);
+int CFITS_API fits_set_dither_offset(fitsfile *fptr, int offset, int *status);
+int CFITS_API fits_set_lossy_int(fitsfile *fptr, int lossy_int, int *status);
+int CFITS_API fits_set_huge_hdu(fitsfile *fptr, int huge, int *status);
+int CFITS_API fits_set_compression_pref(fitsfile *infptr, fitsfile *outfptr, int *status);
+
+int CFITS_API fits_get_compression_type(fitsfile *fptr, int *ctype, int *status);
+int CFITS_API fits_get_tile_dim(fitsfile *fptr, int ndim, long *dims, int *status);
+int CFITS_API fits_get_quantize_level(fitsfile *fptr, float *qlevel, int *status);
+int CFITS_API fits_get_noise_bits(fitsfile *fptr, int *noisebits, int *status);
+int CFITS_API fits_get_hcomp_scale(fitsfile *fptr, float *scale, int *status);
+int CFITS_API fits_get_hcomp_smooth(fitsfile *fptr, int *smooth, int *status);
+int CFITS_API fits_get_dither_seed(fitsfile *fptr, int *seed, int *status);
+
+int CFITS_API fits_img_compress(fitsfile *infptr, fitsfile *outfptr, int *status);
+int CFITS_API fits_compress_img(fitsfile *infptr, fitsfile *outfptr, int compress_type,
+ long *tilesize, int parm1, int parm2, int *status);
+int CFITS_API fits_is_compressed_image(fitsfile *fptr, int *status);
+int CFITS_API fits_is_reentrant(void);
+int CFITS_API fits_decompress_img (fitsfile *infptr, fitsfile *outfptr, int *status);
+int CFITS_API fits_img_decompress_header(fitsfile *infptr, fitsfile *outfptr, int *status);
+int CFITS_API fits_img_decompress (fitsfile *infptr, fitsfile *outfptr, int *status);
+
+/* H-compress routines */
+int CFITS_API fits_hcompress(int *a, int nx, int ny, int scale, char *output,
+ long *nbytes, int *status);
+int CFITS_API fits_hcompress64(LONGLONG *a, int nx, int ny, int scale, char *output,
+ long *nbytes, int *status);
+int CFITS_API fits_hdecompress(unsigned char *input, int smooth, int *a, int *nx,
+ int *ny, int *scale, int *status);
+int CFITS_API fits_hdecompress64(unsigned char *input, int smooth, LONGLONG *a, int *nx,
+ int *ny, int *scale, int *status);
+
+int CFITS_API fits_compress_table (fitsfile *infptr, fitsfile *outfptr, int *status);
+int CFITS_API fits_uncompress_table(fitsfile *infptr, fitsfile *outfptr, int *status);
+
+/* The following exclusion if __CINT__ is defined is needed for ROOT */
+#ifndef __CINT__
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+#endif
+
diff --git a/android_lib/include/libnova.h b/android_lib/include/libnova.h
new file mode 100644
index 0000000..1c048c1
--- /dev/null
+++ b/android_lib/include/libnova.h
@@ -0,0 +1,134 @@
+/*
+ * 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 2 of the License, or (at your option) any later version.
+ *
+ * This library 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 General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (C) 2000 - 2005 Liam Girdwood <lgirdwood@gmail.com>
+ */
+
+#define LIBNOVA_VERSION "0.15.0"
+
+/*! \mainpage libnova
+* \image html libnova-logo.jpg
+* Celestial Mechanics, Astrometry and Astrodynamics Library
+*
+* \section intro Introduction
+* libnova is a general purpose, double precision, Celestial Mechanics, Astrometry and Astrodynamics library.
+*
+* The intended audience of libnova is C / C++ programmers, astronomers and anyone else interested in calculating positions of astronomical objects or celestial mechanics.
+* libnova is the calculation engine used by the <A href="http://nova.sf.net">Nova</A> project and most importantly, is free software.
+*
+* \section features Features
+* The current version of libnova can calculate:
+*
+* - Aberration
+* - Nutation
+* - Apparent Position
+* - Dynamical Time
+* - Julian Day
+* - Precession
+* - Proper Motion
+* - Sidereal Time
+* - Solar Coordinates (using VSOP87)
+* - Coordinate Transformations
+* - Planetary Positions Mercury - Pluto (Mercury - Neptune using VSOP87)
+* - Planetary Magnitude, illuminated disk and phase angle.
+* - Lunar Position (using ELP82), phase angle.
+* - Elliptic Motion of bodies (Asteroid + Comet positional and orbit data)
+* - Asteroid + Comet magnitudes
+* - Parabolic Motion of bodies (Comet positional data)
+* - Orbit velocities and lengths
+* - Atmospheric refraction
+* - Rise, Set and Transit times.
+* - Semidiameters of the Sun, Moon, Planets and asteroids.
+* - Angular separation of bodies
+* - Hyperbolic motion of bodies
+* - Heliocentric (barycentric) time correction
+*
+* \section docs Documentation
+* API documentation for libnova is included in the source. It can also be found in this website and an offline tarball is available <A href="http://libnova.sf.net/libnovadocs.tar.gz">here</A>.
+*
+* \section download Download
+* The latest released version of libnova is 0.15.0
+* It is available for download <A href="http://sourceforge.net/projects/libnova/files/libnova/">here.</A>
+*
+* \section git GIT
+* The latest GIT version of libnova is available via GIT <A href="http://sourceforge.net/p/libnova/libnova/">here.</A>
+*
+* \section licence Licence
+* libnova is released under the <A href="http://www.gnu.org">GNU</A> LGPL.
+*
+* \section help Help
+* If you are interested in helping in the future development of libnova, then please get in touch.
+* Currently, we are needing help in the folowing areas.
+* - Documentation. (Not just API reference, but also astronomy info for novice users)
+* - Programming (in C) astronomical solutions or algorithms.
+* - Algorithms and Solutions.
+*
+* \section authors Authors
+* libnova is maintained by <A href="mailto:lgirdwood@gmail.com">Liam Girdwood</A> and <A href="mailto:petr@kubanek.net">Petr Kubanek</A>.
+*
+* \section thanks Thanks
+* Thanks to Jean Meeus for most of the algorithms used in this library.
+* From his book "Astronomical Algorithms".
+*
+* Thanks to Michelle Chapront-Touze and Jean Chapront for publishing
+* the Lunar Solution ELP 2000-82B.
+*
+* Thanks to Messrs. Bretagnon and Francou for publishing planetary
+* solution VSOP87.
+*
+* Also thanks to Sourceforge for hosting this project. <A href="http://sourceforge.net"> <IMG src="http://sourceforge.net/sflogo.php?group_id=57697&amp;type=5" width="210" height="62" border="0" alt="SourceForge Logo"></A>
+*/
+
+#ifndef _LN_LIBNOVA_H
+#define _LN_LIBNOVA_H
+
+#include <libnova/ln_types.h>
+#include <libnova/julian_day.h>
+#include <libnova/dynamical_time.h>
+#include <libnova/sidereal_time.h>
+#include <libnova/transform.h>
+#include <libnova/nutation.h>
+#include <libnova/aberration.h>
+#include <libnova/apparent_position.h>
+#include <libnova/solar.h>
+#include <libnova/precession.h>
+#include <libnova/proper_motion.h>
+#include <libnova/mercury.h>
+#include <libnova/venus.h>
+#include <libnova/earth.h>
+#include <libnova/mars.h>
+#include <libnova/jupiter.h>
+#include <libnova/saturn.h>
+#include <libnova/uranus.h>
+#include <libnova/neptune.h>
+#include <libnova/pluto.h>
+#include <libnova/vsop87.h>
+#include <libnova/lunar.h>
+#include <libnova/elliptic_motion.h>
+#include <libnova/asteroid.h>
+#include <libnova/comet.h>
+#include <libnova/parabolic_motion.h>
+#include <libnova/refraction.h>
+#include <libnova/rise_set.h>
+#include <libnova/angular_separation.h>
+#include <libnova/ln_types.h>
+#include <libnova/utility.h>
+#include <libnova/hyperbolic_motion.h>
+#include <libnova/parallax.h>
+#include <libnova/airmass.h>
+#include <libnova/heliocentric_time.h>
+#include <libnova/constellation.h>
+
+#endif
diff --git a/android_lib/include/libraw/libraw.h b/android_lib/include/libraw/libraw.h
new file mode 100755
index 0000000..e804a1d
--- /dev/null
+++ b/android_lib/include/libraw/libraw.h
@@ -0,0 +1,377 @@
+/* -*- C++ -*-
+ * File: libraw.h
+ * Copyright 2008-2016 LibRaw LLC (info@libraw.org)
+ * Created: Sat Mar 8, 2008
+ *
+ * LibRaw C++ interface
+ *
+
+LibRaw is free software; you can redistribute it and/or modify
+it under the terms of the one of three licenses as you choose:
+
+1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
+ (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
+
+2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+ (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
+
+3. LibRaw Software License 27032010
+ (See file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
+
+*/
+
+#ifndef _LIBRAW_CLASS_H
+#define _LIBRAW_CLASS_H
+
+#ifdef __linux__
+#define _FILE_OFFSET_BITS 64
+#endif
+
+/* maximum file size to use LibRaw_file_datastream (fully buffered) I/O */
+#define LIBRAW_USE_STREAMS_DATASTREAM_MAXSIZE (250*1024L*1024L)
+
+
+#include <limits.h>
+#include <memory.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+#include "libraw_datastream.h"
+#include "libraw_types.h"
+#include "libraw_const.h"
+#include "libraw_internal.h"
+#include "libraw_alloc.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+DllDef const char *libraw_strerror(int errorcode);
+DllDef const char *libraw_strprogress(enum LibRaw_progress);
+ /* LibRaw C API */
+DllDef libraw_data_t *libraw_init(unsigned int flags);
+DllDef int libraw_open_file(libraw_data_t*, const char *);
+DllDef int libraw_open_file_ex(libraw_data_t*, const char *, INT64 max_buff_sz);
+#if defined(_WIN32) && !defined(__MINGW32__) && defined(_MSC_VER) && (_MSC_VER > 1310)
+DllDef int libraw_open_wfile(libraw_data_t*, const wchar_t *);
+DllDef int libraw_open_wfile_ex(libraw_data_t*, const wchar_t *, INT64 max_buff_sz);
+#endif
+DllDef int libraw_open_buffer(libraw_data_t*, void * buffer, size_t size);
+DllDef int libraw_unpack(libraw_data_t*);
+DllDef int libraw_unpack_thumb(libraw_data_t*);
+DllDef void libraw_recycle_datastream(libraw_data_t*);
+DllDef void libraw_recycle(libraw_data_t*);
+DllDef void libraw_close(libraw_data_t*);
+DllDef void libraw_subtract_black(libraw_data_t*);
+DllDef int libraw_raw2image(libraw_data_t*);
+DllDef void libraw_free_image(libraw_data_t*);
+ /* version helpers */
+DllDef const char* libraw_version();
+DllDef int libraw_versionNumber();
+ /* Camera list */
+DllDef const char** libraw_cameraList();
+DllDef int libraw_cameraCount();
+
+ /* helpers */
+DllDef void libraw_set_memerror_handler(libraw_data_t*, memory_callback cb, void *datap);
+DllDef void libraw_set_exifparser_handler(libraw_data_t*, exif_parser_callback cb, void *datap);
+DllDef void libraw_set_dataerror_handler(libraw_data_t*,data_callback func,void *datap);
+DllDef void libraw_set_progress_handler(libraw_data_t*,progress_callback cb,void *datap);
+DllDef const char * libraw_unpack_function_name(libraw_data_t* lr);
+DllDef int libraw_get_decoder_info(libraw_data_t* lr,libraw_decoder_info_t* d);
+DllDef int libraw_COLOR(libraw_data_t*,int row, int col);
+DllDef unsigned libraw_capabilities();
+
+ /* DCRAW compatibility */
+DllDef int libraw_adjust_sizes_info_only(libraw_data_t*);
+DllDef int libraw_dcraw_ppm_tiff_writer(libraw_data_t* lr,const char *filename);
+DllDef int libraw_dcraw_thumb_writer(libraw_data_t* lr,const char *fname);
+DllDef int libraw_dcraw_process(libraw_data_t* lr);
+DllDef libraw_processed_image_t* libraw_dcraw_make_mem_image(libraw_data_t* lr, int *errc);
+DllDef libraw_processed_image_t* libraw_dcraw_make_mem_thumb(libraw_data_t* lr, int *errc);
+DllDef void libraw_dcraw_clear_mem(libraw_processed_image_t*);
+ /* getters/setters used by 3DLut Creator */
+DllDef void libraw_set_demosaic(libraw_data_t *lr,int value);
+DllDef void libraw_set_output_color(libraw_data_t *lr,int value);
+DllDef void libraw_set_user_mul(libraw_data_t *lr,int index, float val);
+DllDef void libraw_set_output_bps(libraw_data_t *lr,int value);
+DllDef void libraw_set_gamma(libraw_data_t *lr,int index, float value);
+DllDef void libraw_set_no_auto_bright(libraw_data_t *lr,int value);
+DllDef void libraw_set_bright(libraw_data_t *lr,float value);
+DllDef void libraw_set_highlight(libraw_data_t *lr,int value);
+DllDef void libraw_set_fbdd_noiserd(libraw_data_t *lr,int value);
+DllDef int libraw_get_raw_height(libraw_data_t *lr);
+DllDef int libraw_get_raw_width(libraw_data_t *lr);
+DllDef int libraw_get_iheight(libraw_data_t *lr);
+DllDef int libraw_get_iwidth(libraw_data_t *lr);
+DllDef float libraw_get_cam_mul(libraw_data_t *lr,int index);
+DllDef float libraw_get_pre_mul(libraw_data_t *lr,int index);
+DllDef float libraw_get_rgb_cam(libraw_data_t *lr,int index1, int index2);
+DllDef int libraw_get_color_maximum(libraw_data_t *lr);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifdef __cplusplus
+
+class DllDef LibRaw
+{
+ public:
+ libraw_data_t imgdata;
+ int verbose;
+
+ LibRaw(unsigned int flags = LIBRAW_OPTIONS_NONE);
+ libraw_output_params_t* output_params_ptr() { return &imgdata.params;}
+ int open_file(const char *fname, INT64 max_buffered_sz=LIBRAW_USE_STREAMS_DATASTREAM_MAXSIZE);
+#if defined(_WIN32) && !defined(__MINGW32__) && defined(_MSC_VER) && (_MSC_VER > 1310)
+ int open_file(const wchar_t *fname, INT64 max_buffered_sz=LIBRAW_USE_STREAMS_DATASTREAM_MAXSIZE);
+#endif
+ int open_buffer(void *buffer, size_t size);
+ virtual int open_datastream(LibRaw_abstract_datastream *);
+ int error_count(){return libraw_internal_data.unpacker_data.data_error;}
+ void recycle_datastream();
+ int unpack(void);
+ int unpack_thumb(void);
+
+ int adjust_sizes_info_only(void);
+ LibRaw_colormatrix_type camera_color_type();
+ int subtract_black();
+ int subtract_black_internal();
+ int raw2image();
+ int raw2image_ex(int do_subtract_black);
+ void raw2image_start();
+ void free_image();
+ int adjust_maximum();
+ void set_exifparser_handler( exif_parser_callback cb,void *data) {callbacks.exifparser_data = data; callbacks.exif_cb = cb; }
+ void set_memerror_handler( memory_callback cb,void *data) {callbacks.memcb_data = data; callbacks.mem_cb = cb; }
+ void set_dataerror_handler(data_callback func, void *data) { callbacks.datacb_data = data; callbacks.data_cb = func;}
+ void set_progress_handler(progress_callback pcb, void *data) { callbacks.progresscb_data = data; callbacks.progress_cb = pcb;}
+
+ void convertFloatToInt(float dmin=4096.f, float dmax=32767.f, float dtarget = 16383.f);
+ /* helpers */
+ static unsigned capabilities();
+ static const char* version();
+ static int versionNumber();
+ static const char** cameraList();
+ static int cameraCount();
+ static const char* strprogress(enum LibRaw_progress);
+ static const char* strerror(int p);
+ /* dcraw emulation */
+ int dcraw_ppm_tiff_writer(const char *filename);
+ int dcraw_thumb_writer(const char *fname);
+ int dcraw_process(void);
+ /* information calls */
+ int is_fuji_rotated(){return libraw_internal_data.internal_output_params.fuji_width;}
+ int is_sraw();
+ int sraw_midpoint();
+ int is_nikon_sraw();
+ int is_coolscan_nef();
+ int is_floating_point();
+ int have_fpdata();
+ /* memory writers */
+ virtual libraw_processed_image_t* dcraw_make_mem_image(int *errcode=NULL);
+ virtual libraw_processed_image_t* dcraw_make_mem_thumb(int *errcode=NULL);
+ static void dcraw_clear_mem(libraw_processed_image_t*);
+
+ /* Additional calls for make_mem_image */
+ void get_mem_image_format(int* width, int* height, int* colors, int* bps) const;
+ int copy_mem_image(void* scan0, int stride, int bgr);
+
+ /* free all internal data structures */
+ void recycle();
+ virtual ~LibRaw(void);
+
+ int COLOR(int row, int col) { return libraw_internal_data.internal_output_params.fuji_width? FCF(row,col):FC(row,col);}
+
+ int FC(int row,int col) { return (imgdata.idata.filters >> (((row << 1 & 14) | (col & 1)) << 1) & 3);}
+ int fcol (int row, int col);
+
+ const char *unpack_function_name();
+ virtual int get_decoder_info(libraw_decoder_info_t* d_info);
+ libraw_internal_data_t * get_internal_data_pointer(){ return &libraw_internal_data; }
+
+ /* Debanding filter */
+ int wf_remove_banding();
+
+ /* Phase one correction/subtractBL calls */
+ /* Returns libraw error code */
+
+ int phase_one_subtract_black(ushort *src, ushort *dest);
+ int phase_one_correct();
+
+ int set_rawspeed_camerafile(char *filename);
+ virtual void setCancelFlag();
+ virtual void clearCancelFlag();
+ virtual void adobe_coeff (const char *, const char *, int internal_only=0);
+
+ void set_dng_host(void *);
+
+protected:
+ int is_curve_linear();
+ void checkCancel();
+ void cam_xyz_coeff(float _rgb_cam[3][4], double cam_xyz[4][3]);
+ void phase_one_allocate_tempbuffer();
+ void phase_one_free_tempbuffer();
+ virtual int is_phaseone_compressed();
+ virtual int is_canon_600();
+ /* Hotspots */
+ virtual void copy_fuji_uncropped(unsigned short cblack[4], unsigned short *dmaxp);
+ virtual void copy_bayer(unsigned short cblack[4], unsigned short *dmaxp);
+ virtual void fuji_rotate();
+ virtual void convert_to_rgb_loop(float out_cam[3][4]);
+ virtual void lin_interpolate_loop(int code[16][16][32],int size);
+ virtual void scale_colors_loop(float scale_mul[4]);
+
+ int FCF(int row,int col) {
+ int rr,cc;
+ if (libraw_internal_data.unpacker_data.fuji_layout) {
+ rr = libraw_internal_data.internal_output_params.fuji_width - 1 - col + (row >> 1);
+ cc = col + ((row+1) >> 1);
+ } else {
+ rr = libraw_internal_data.internal_output_params.fuji_width - 1 + row - (col >> 1);
+ cc = row + ((col+1) >> 1);
+ }
+ return FC(rr,cc);
+ }
+
+ void adjust_bl();
+ void* malloc(size_t t);
+ void* calloc(size_t n,size_t t);
+ void* realloc(void *p, size_t s);
+ void free(void *p);
+ void merror (void *ptr, const char *where);
+ void derror();
+
+ LibRaw_TLS *tls;
+ libraw_internal_data_t libraw_internal_data;
+ decode first_decode[2048], *second_decode, *free_decode;
+ tiff_ifd_t tiff_ifd[10];
+ libraw_memmgr memmgr;
+ libraw_callbacks_t callbacks;
+
+ LibRaw_constants rgb_constants;
+
+ void (LibRaw:: *write_thumb)();
+ void (LibRaw:: *write_fun)();
+ void (LibRaw:: *load_raw)();
+ void (LibRaw:: *thumb_load_raw)();
+ void (LibRaw:: *pentax_component_load_raw)();
+
+ void kodak_thumb_loader();
+ void write_thumb_ppm_tiff(FILE *);
+ void x3f_thumb_loader();
+#ifdef LIBRAW_DEMOSAIC_PACK_GPL2
+ void foveon_thumb_loader (void);
+#endif
+
+ int own_filtering_supported(){ return 0;}
+ void identify();
+ void write_ppm_tiff ();
+ void convert_to_rgb();
+ void remove_zeroes();
+ void crop_masked_pixels();
+#ifndef NO_LCMS
+ void apply_profile(const char*,const char*);
+#endif
+ void pre_interpolate();
+ void border_interpolate (int border);
+ void lin_interpolate();
+ void vng_interpolate();
+ void ppg_interpolate();
+ void cielab(ushort rgb[3], short lab[3]);
+ void xtrans_interpolate(int);
+ void ahd_interpolate();
+ void dht_interpolate();
+ void aahd_interpolate();
+
+ /* from demosaic pack */
+ void ahd_interpolate_mod();
+ void afd_interpolate_pl(int afd_passes, int clip_on);
+ void afd_noise_filter_pl();
+ void lmmse_interpolate(int gamma_apply);
+ void dcb(int iterations, int dcb_enhance);
+ void fbdd(int noiserd);
+ void vcd_interpolate(int ahd_cutoff);
+ void amaze_demosaic_RT();
+ void exp_bef(float expos, float preser);
+ void CA_correct_RT(float cared, float cablue);
+ void cfa_linedn(float linenoise);
+ void cfa_impulse_gauss(float lclean, float cclean);
+ void green_equilibrate(float thresh);
+
+ /* demosaic pack end */
+
+ void bad_pixels(const char*);
+ void subtract(const char*);
+ void hat_transform (float *temp, float *base, int st, int size, int sc);
+ void wavelet_denoise();
+ void scale_colors();
+ void median_filter ();
+ void blend_highlights();
+ void recover_highlights();
+ void green_matching();
+
+ void stretch();
+
+#ifdef LIBRAW_DEMOSAIC_PACK_GPL2
+ void foveon_thumb ();
+#endif
+ void jpeg_thumb_writer (FILE *tfp,char *thumb,int thumb_length);
+ void jpeg_thumb ();
+ void ppm_thumb ();
+ void ppm16_thumb();
+ void layer_thumb ();
+ void rollei_thumb ();
+ void kodak_thumb_load_raw();
+
+#ifdef LIBRAW_DEMOSAIC_PACK_GPL2
+ void foveon_decoder (unsigned size, unsigned code);
+#endif
+ unsigned get4();
+
+ int flip_index (int row, int col);
+ void gamma_curve (double pwr, double ts, int mode, int imax);
+ void cubic_spline (const int *x_, const int *y_, const int len);
+
+ /* RawSpeed data */
+ void *_rawspeed_camerameta;
+ void *_rawspeed_decoder;
+ void fix_after_rawspeed(int bl);
+ int try_rawspeed(); /* returns LIBRAW_SUCCESS on success */
+ /* Fast cancel flag */
+ long _exitflag;
+
+ /* DNG SDK data */
+ void *dnghost;
+ int valid_for_dngsdk();
+ int try_dngsdk();
+ /* X3F data */
+ void *_x3f_data;
+
+ int raw_was_read()
+ {
+ return imgdata.rawdata.raw_image || imgdata.rawdata.color4_image || imgdata.rawdata.color3_image
+ || imgdata.rawdata.float_image || imgdata.rawdata.float3_image || imgdata.rawdata.float4_image;
+ }
+
+#ifdef LIBRAW_LIBRARY_BUILD
+#include "internal/libraw_internal_funcs.h"
+#endif
+
+};
+
+#ifdef LIBRAW_LIBRARY_BUILD
+#define RUN_CALLBACK(stage,iter,expect) if(callbacks.progress_cb) { \
+ int rr = (*callbacks.progress_cb)(callbacks.progresscb_data,stage,iter,expect); \
+ if(rr!=0) throw LIBRAW_EXCEPTION_CANCELLED_BY_CALLBACK; \
+ }
+#endif
+
+
+#endif /* __cplusplus */
+
+
+#endif /* _LIBRAW_CLASS_H */
diff --git a/android_lib/include/libraw/libraw_alloc.h b/android_lib/include/libraw/libraw_alloc.h
new file mode 100644
index 0000000..f17bcab
--- /dev/null
+++ b/android_lib/include/libraw/libraw_alloc.h
@@ -0,0 +1,99 @@
+/* -*- C++ -*-
+ * File: libraw_alloc.h
+ * Copyright 2008-2016 LibRaw LLC (info@libraw.org)
+ * Created: Sat Mar 22, 2008
+ *
+ * LibRaw C++ interface
+ *
+LibRaw is free software; you can redistribute it and/or modify
+it under the terms of the one of three licenses as you choose:
+
+1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
+ (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
+
+2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+ (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
+
+3. LibRaw Software License 27032010
+ (See file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
+
+ */
+
+#ifndef __LIBRAW_ALLOC_H
+#define __LIBRAW_ALLOC_H
+
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef __cplusplus
+
+#define LIBRAW_MSIZE 64
+
+class DllDef libraw_memmgr
+{
+ public:
+ libraw_memmgr()
+ {
+ memset(mems,0,sizeof(mems));
+ calloc_cnt=0;
+ }
+ void *malloc(size_t sz)
+ {
+ void *ptr = ::malloc(sz);
+ mem_ptr(ptr);
+ return ptr;
+ }
+ void *calloc(size_t n, size_t sz)
+ {
+ void *ptr = ::calloc(n,sz);
+ mem_ptr(ptr);
+ return ptr;
+ }
+ void *realloc(void *ptr,size_t newsz)
+ {
+ void *ret = ::realloc(ptr,newsz);
+ forget_ptr(ptr);
+ mem_ptr(ret);
+ return ret;
+ }
+ void free(void *ptr)
+ {
+ forget_ptr(ptr);
+ ::free(ptr);
+ }
+ void cleanup(void)
+ {
+ for(int i = 0; i< LIBRAW_MSIZE; i++)
+ if(mems[i])
+ {
+ free(mems[i]);
+ mems[i] = NULL;
+ }
+ }
+
+ private:
+ void *mems[LIBRAW_MSIZE];
+ int calloc_cnt;
+ void mem_ptr(void *ptr)
+ {
+ if(ptr)
+ for(int i=0;i < LIBRAW_MSIZE; i++)
+ if(!mems[i])
+ {
+ mems[i] = ptr;
+ break;
+ }
+ }
+ void forget_ptr(void *ptr)
+ {
+ if(ptr)
+ for(int i=0;i < LIBRAW_MSIZE; i++)
+ if(mems[i] == ptr)
+ mems[i] = NULL;
+ }
+
+};
+
+#endif /* C++ */
+
+#endif
diff --git a/android_lib/include/libraw/libraw_const.h b/android_lib/include/libraw/libraw_const.h
new file mode 100644
index 0000000..fbc2669
--- /dev/null
+++ b/android_lib/include/libraw/libraw_const.h
@@ -0,0 +1,298 @@
+/* -*- C++ -*-
+ * File: libraw_const.h
+ * Copyright 2008-2016 LibRaw LLC (info@libraw.org)
+ * Created: Sat Mar 8 , 2008
+ * LibRaw error codes
+LibRaw is free software; you can redistribute it and/or modify
+it under the terms of the one of three licenses as you choose:
+
+1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
+ (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
+
+2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+ (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
+
+3. LibRaw Software License 27032010
+ (See file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
+
+ */
+
+#ifndef _LIBRAW_ERRORS_H
+#define _LIBRAW_ERRORS_H
+
+#define LIBRAW_DEFAULT_ADJUST_MAXIMUM_THRESHOLD 0.75
+#define LIBRAW_DEFAULT_AUTO_BRIGHTNESS_THRESHOLD 0.01
+
+enum LibRaw_whitebalance_code
+{
+/*
+ EXIF light sources
+ 12 = FL-D; Daylight fluorescent (D 5700K – 7100K) (F1,F5)
+ 13 = FL-N; Day white fluorescent (N 4600K – 5400K) (F7,F8)
+ 14 = FL-W; Cool white fluorescent (W 3900K – 4500K) (F2,F6, office, store, warehouse)
+ 15 = FL-WW; White fluorescent (WW 3200K – 3700K) (F3, residential)
+ 16 = FL-L; Soft/Warm white fluorescent (L 2600K - 3250K) (F4, kitchen, bath)
+*/
+LIBRAW_WBI_Unknown=0,
+LIBRAW_WBI_Daylight=1,
+LIBRAW_WBI_Fluorescent=2,
+LIBRAW_WBI_Tungsten=3,
+LIBRAW_WBI_Flash=4,
+LIBRAW_WBI_FineWeather=9,
+LIBRAW_WBI_Cloudy=10,
+LIBRAW_WBI_Shade=11,
+LIBRAW_WBI_FL_D=12,
+LIBRAW_WBI_FL_N=13,
+LIBRAW_WBI_FL_W=14,
+LIBRAW_WBI_FL_WW=15,
+LIBRAW_WBI_FL_L=16,
+LIBRAW_WBI_Ill_A=17,
+LIBRAW_WBI_Ill_B=18,
+LIBRAW_WBI_Ill_C=19,
+LIBRAW_WBI_D55=20,
+LIBRAW_WBI_D65=21,
+LIBRAW_WBI_D75=22,
+LIBRAW_WBI_D50=23,
+LIBRAW_WBI_StudioTungsten=24,
+LIBRAW_WBI_Sunset=64,
+LIBRAW_WBI_Other=255
+};
+
+enum LibRaw_colormatrix_type
+ {
+ LIBRAW_CMATRIX_NONE=0,
+ LIBRAW_CMATRIX_DNG=1,
+ LIBRAW_CMATRIX_DIGBACK=2,
+ LIBRAW_CMATRIX_OTHER=4
+ };
+
+enum LibRaw_dng_processing
+{
+ LIBRAW_DNG_NONE=0,
+ LIBRAW_DNG_FLOAT=1,
+ LIBRAW_DNG_LINEAR=2,
+ LIBRAW_DNG_DEFLATE=4,
+ LIBRAW_DNG_XTRANS=8,
+ LIBRAW_DNG_OTHER=16,
+ LIBRAW_DNG_8BIT=32,
+ /*LIBRAW_DNG_LARGERANGE=64,*/ /* more than 16 bit integer */
+ LIBRAW_DNG_ALL = LIBRAW_DNG_FLOAT|LIBRAW_DNG_LINEAR|LIBRAW_DNG_XTRANS|LIBRAW_DNG_8BIT|LIBRAW_DNG_OTHER /* |LIBRAW_DNG_LARGERANGE */,
+ LIBRAW_DNG_DEFAULT=LIBRAW_DNG_FLOAT|LIBRAW_DNG_LINEAR|LIBRAW_DNG_DEFLATE|LIBRAW_DNG_8BIT
+};
+
+enum LibRaw_runtime_capabilities
+{
+ LIBRAW_CAPS_RAWSPEED=1,
+ LIBRAW_CAPS_DNGSDK=2,
+ LIBRAW_CAPS_DEMOSAICSGPL2=4,
+ LIBRAW_CAPS_DEMOSAICSGPL3=8
+};
+
+enum LibRaw_camera_mounts
+ {
+ LIBRAW_MOUNT_Unknown=0,
+ LIBRAW_MOUNT_Minolta_A=1,
+ LIBRAW_MOUNT_Sony_E=2,
+ LIBRAW_MOUNT_Canon_EF=3,
+ LIBRAW_MOUNT_Canon_EF_S=4,
+ LIBRAW_MOUNT_Canon_EF_M=5,
+ LIBRAW_MOUNT_Nikon_F=6,
+ LIBRAW_MOUNT_Nikon_CX=7, /* used in Nikon 1 series */
+ LIBRAW_MOUNT_FT=8, /* original 4/3 */
+ LIBRAW_MOUNT_mFT=9, /* micro 4/3 */
+ LIBRAW_MOUNT_Pentax_K=10,
+ LIBRAW_MOUNT_Pentax_Q=11,
+ LIBRAW_MOUNT_Pentax_645=12,
+ LIBRAW_MOUNT_Fuji_X=13,
+ LIBRAW_MOUNT_Leica_M=14,
+ LIBRAW_MOUNT_Leica_R=15,
+ LIBRAW_MOUNT_Leica_S=16,
+ LIBRAW_MOUNT_Samsung_NX=17,
+ LIBRAW_MOUNT_RicohModule=18,
+ LIBRAW_MOUNT_Samsung_NX_M=19,
+ LIBRAW_MOUNT_Leica_T=20,
+ LIBRAW_MOUNT_Contax_N=21,
+ LIBRAW_MOUNT_Sigma_X3F=22,
+ LIBRAW_MOUNT_Leica_SL=23,
+ LIBRAW_MOUNT_FixedLens=99
+ };
+
+enum LibRaw_camera_formats
+ {
+ LIBRAW_FORMAT_APSC=1,
+ LIBRAW_FORMAT_FF=2,
+ LIBRAW_FORMAT_MF=3,
+ LIBRAW_FORMAT_APSH=4,
+ LIBRAW_FORMAT_1INCH=5,
+ LIBRAW_FORMAT_FT=8
+ };
+
+enum LibRaw_sony_cameratypes
+ {
+ LIBRAW_SONY_DSC=1,
+ LIBRAW_SONY_DSLR=2,
+ LIBRAW_SONY_NEX=3,
+ LIBRAW_SONY_SLT=4,
+ LIBRAW_SONY_ILCE=5,
+ LIBRAW_SONY_ILCA=6
+ };
+
+enum LibRaw_processing_options
+ {
+ LIBRAW_PROCESSING_SONYARW2_NONE=0,
+ LIBRAW_PROCESSING_SONYARW2_BASEONLY=1,
+ LIBRAW_PROCESSING_SONYARW2_DELTAONLY=1<<1,
+ LIBRAW_PROCESSING_SONYARW2_DELTAZEROBASE=1<<2,
+ LIBRAW_PROCESSING_SONYARW2_DELTATOVALUE=1<<3,
+ LIBRAW_PROCESSING_SONYARW2_ALLFLAGS = LIBRAW_PROCESSING_SONYARW2_BASEONLY + LIBRAW_PROCESSING_SONYARW2_DELTAONLY + LIBRAW_PROCESSING_SONYARW2_DELTAZEROBASE + LIBRAW_PROCESSING_SONYARW2_DELTATOVALUE,
+ LIBRAW_PROCESSING_DP2Q_INTERPOLATERG=1<<4,
+ LIBRAW_PROCESSING_DP2Q_INTERPOLATEAF=1<<5,
+ LIBRAW_PROCESSING_PENTAXK32_ALLFRAMES=1<<6,
+ LIBRAW_PROCESSING_CONVERTFLOAT_TO_INT=1<<7
+ };
+
+enum LibRaw_decoder_flags
+{
+ LIBRAW_DECODER_USEBAYER2 = 1<<3,
+ LIBRAW_DECODER_HASCURVE = 1<<4,
+ LIBRAW_DECODER_SONYARW2 = 1<<5,
+ LIBRAW_DECODER_TRYRAWSPEED = 1<<6,
+ LIBRAW_DECODER_OWNALLOC = 1<<7,
+ LIBRAW_DECODER_FIXEDMAXC = 1<<8,
+ LIBRAW_DECODER_ADOBECOPYPIXEL = 1<<9,
+ LIBRAW_DECODER_NOTSET = 1<<15
+};
+
+#define LIBRAW_XTRANS 9
+
+enum LibRaw_constructor_flags
+{
+ LIBRAW_OPTIONS_NONE =0,
+ LIBRAW_OPIONS_NO_MEMERR_CALLBACK=1,
+ LIBRAW_OPIONS_NO_DATAERR_CALLBACK=1<<1
+};
+
+enum LibRaw_warnings
+{
+ LIBRAW_WARN_NONE =0,
+ LIBRAW_WARN_FOVEON_NOMATRIX =1,
+ LIBRAW_WARN_FOVEON_INVALIDWB =1<<1,
+ LIBRAW_WARN_BAD_CAMERA_WB =1<<2,
+ LIBRAW_WARN_NO_METADATA =1<<3,
+ LIBRAW_WARN_NO_JPEGLIB = 1<<4,
+ LIBRAW_WARN_NO_EMBEDDED_PROFILE = 1<<5,
+ LIBRAW_WARN_NO_INPUT_PROFILE = 1<<6,
+ LIBRAW_WARN_BAD_OUTPUT_PROFILE= 1<<7,
+ LIBRAW_WARN_NO_BADPIXELMAP=1<<8,
+ LIBRAW_WARN_BAD_DARKFRAME_FILE=1<<9,
+ LIBRAW_WARN_BAD_DARKFRAME_DIM=1<<10,
+ LIBRAW_WARN_NO_JASPER = 1<<11,
+ LIBRAW_WARN_RAWSPEED_PROBLEM = 1<<12,
+ LIBRAW_WARN_RAWSPEED_UNSUPPORTED = 1<<13,
+ LIBRAW_WARN_RAWSPEED_PROCESSED = 1<<14,
+ LIBRAW_WARN_FALLBACK_TO_AHD = 1<<15
+};
+
+enum LibRaw_exceptions
+{
+ LIBRAW_EXCEPTION_NONE =0,
+ LIBRAW_EXCEPTION_ALLOC =1,
+ LIBRAW_EXCEPTION_DECODE_RAW =2,
+ LIBRAW_EXCEPTION_DECODE_JPEG=3,
+ LIBRAW_EXCEPTION_IO_EOF =4,
+ LIBRAW_EXCEPTION_IO_CORRUPT =5,
+ LIBRAW_EXCEPTION_CANCELLED_BY_CALLBACK=6,
+ LIBRAW_EXCEPTION_BAD_CROP =7,
+ LIBRAW_EXCEPTION_IO_BADFILE =8,
+ LIBRAW_EXCEPTION_DECODE_JPEG2000=9
+};
+
+#if 0
+enum LibRaw_colorstate
+{
+ LIBRAW_COLORSTATE_UNKNOWN =0,
+ LIBRAW_COLORSTATE_INIT =1,
+ LIBRAW_COLORSTATE_CONST =2,
+ LIBRAW_COLORSTATE_LOADED =3,
+ LIBRAW_COLORSTATE_CALCULATED=4,
+ LIBRAW_COLORSTATE_RESERVED1 =5,
+ LIBRAW_COLORSTATE_RESERVED2 =6,
+ LIBRAW_COLORSTATE_RESERVED3 =7
+};
+#endif
+
+enum LibRaw_progress
+{
+ LIBRAW_PROGRESS_START = 0,
+ LIBRAW_PROGRESS_OPEN = 1,
+ LIBRAW_PROGRESS_IDENTIFY = 1<<1,
+ LIBRAW_PROGRESS_SIZE_ADJUST = 1<<2,
+ LIBRAW_PROGRESS_LOAD_RAW = 1<<3,
+ LIBRAW_PROGRESS_RAW2_IMAGE = 1<<4,
+ LIBRAW_PROGRESS_REMOVE_ZEROES = 1<<5,
+ LIBRAW_PROGRESS_BAD_PIXELS = 1<<6,
+ LIBRAW_PROGRESS_DARK_FRAME = 1<<7,
+ LIBRAW_PROGRESS_FOVEON_INTERPOLATE = 1<<8,
+ LIBRAW_PROGRESS_SCALE_COLORS = 1<<9,
+ LIBRAW_PROGRESS_PRE_INTERPOLATE = 1<<10,
+ LIBRAW_PROGRESS_INTERPOLATE = 1<<11,
+ LIBRAW_PROGRESS_MIX_GREEN = 1<<12,
+ LIBRAW_PROGRESS_MEDIAN_FILTER = 1<<13,
+ LIBRAW_PROGRESS_HIGHLIGHTS = 1<<14,
+ LIBRAW_PROGRESS_FUJI_ROTATE = 1<<15,
+ LIBRAW_PROGRESS_FLIP = 1<<16,
+ LIBRAW_PROGRESS_APPLY_PROFILE = 1<<17,
+ LIBRAW_PROGRESS_CONVERT_RGB = 1<<18,
+ LIBRAW_PROGRESS_STRETCH = 1<<19,
+/* reserved */
+ LIBRAW_PROGRESS_STAGE20 = 1<<20,
+ LIBRAW_PROGRESS_STAGE21 = 1<<21,
+ LIBRAW_PROGRESS_STAGE22 = 1<<22,
+ LIBRAW_PROGRESS_STAGE23 = 1<<23,
+ LIBRAW_PROGRESS_STAGE24 = 1<<24,
+ LIBRAW_PROGRESS_STAGE25 = 1<<25,
+ LIBRAW_PROGRESS_STAGE26 = 1<<26,
+ LIBRAW_PROGRESS_STAGE27 = 1<<27,
+
+ LIBRAW_PROGRESS_THUMB_LOAD = 1<<28,
+ LIBRAW_PROGRESS_TRESERVED1 = 1<<29,
+ LIBRAW_PROGRESS_TRESERVED2 = 1<<30
+};
+#define LIBRAW_PROGRESS_THUMB_MASK 0x0fffffff
+
+enum LibRaw_errors
+{
+ LIBRAW_SUCCESS = 0,
+ LIBRAW_UNSPECIFIED_ERROR=-1,
+ LIBRAW_FILE_UNSUPPORTED = -2,
+ LIBRAW_REQUEST_FOR_NONEXISTENT_IMAGE=-3,
+ LIBRAW_OUT_OF_ORDER_CALL=-4,
+ LIBRAW_NO_THUMBNAIL=-5,
+ LIBRAW_UNSUPPORTED_THUMBNAIL=-6,
+ LIBRAW_INPUT_CLOSED=-7,
+ LIBRAW_NOT_IMPLEMENTED=-8,
+ LIBRAW_UNSUFFICIENT_MEMORY=-100007,
+ LIBRAW_DATA_ERROR=-100008,
+ LIBRAW_IO_ERROR=-100009,
+ LIBRAW_CANCELLED_BY_CALLBACK=-100010,
+ LIBRAW_BAD_CROP=-100011
+};
+
+#define LIBRAW_FATAL_ERROR(ec) ((ec)<-100000)
+
+enum LibRaw_thumbnail_formats
+{
+ LIBRAW_THUMBNAIL_UNKNOWN=0,
+ LIBRAW_THUMBNAIL_JPEG=1,
+ LIBRAW_THUMBNAIL_BITMAP=2,
+ LIBRAW_THUMBNAIL_LAYER=4,
+ LIBRAW_THUMBNAIL_ROLLEI=5
+};
+
+enum LibRaw_image_formats
+{
+ LIBRAW_IMAGE_JPEG=1,
+ LIBRAW_IMAGE_BITMAP=2
+};
+
+#endif
diff --git a/android_lib/include/libraw/libraw_datastream.h b/android_lib/include/libraw/libraw_datastream.h
new file mode 100644
index 0000000..da0fc9f
--- /dev/null
+++ b/android_lib/include/libraw/libraw_datastream.h
@@ -0,0 +1,297 @@
+/* -*- C -*-
+ * File: libraw_datastream.h
+ * Copyright 2008-2016 LibRaw LLC (info@libraw.org)
+ * Created: Sun Jan 18 13:07:35 2009
+ *
+ * LibRaw Data stream interface
+
+LibRaw is free software; you can redistribute it and/or modify
+it under the terms of the one of three licenses as you choose:
+
+1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
+ (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
+
+2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+ (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
+
+3. LibRaw Software License 27032010
+ (See file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
+
+ */
+
+#ifndef __LIBRAW_DATASTREAM_H
+#define __LIBRAW_DATASTREAM_H
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <string.h>
+
+#ifndef __cplusplus
+
+
+#else /* __cplusplus */
+
+#include "libraw_const.h"
+#include "libraw_types.h"
+#include <fstream>
+#include <memory>
+
+#if defined (WIN32)
+#include <winsock2.h>
+
+/* MSVS 2008 and above... */
+#if _MSC_VER >= 1500
+#define WIN32SECURECALLS
+#endif
+#endif
+
+#ifdef USE_DNGSDK
+
+#if defined(WIN32)
+#define qWinOS 1
+#define qMacOS 0
+#elif defined(__APPLE__)
+#define qWinOS 0
+#define qMacOS 1
+#else
+/* define OS types for DNG here */
+#endif
+#define qDNGXMPDocOps 0
+#define qDNGUseLibJPEG 1
+#define qDNGXMPFiles 0
+#define qDNGExperimental 1
+#define qDNGThreadSafe 1
+#include "dng_stream.h"
+#endif /* DNGSDK */
+
+
+#define IOERROR() do { throw LIBRAW_EXCEPTION_IO_EOF; } while(0)
+
+class LibRaw_buffer_datastream;
+class LibRaw_bit_buffer;
+
+class DllDef LibRaw_abstract_datastream
+{
+ public:
+ LibRaw_abstract_datastream(){ substream=0;};
+ virtual ~LibRaw_abstract_datastream(void){if(substream) delete substream;}
+ virtual int valid() = 0;
+ virtual int read(void *,size_t, size_t ) = 0;
+ virtual int seek(INT64 , int ) = 0;
+ virtual INT64 tell() = 0;
+ virtual INT64 size() = 0;
+ virtual int get_char() = 0;
+ virtual char* gets(char *, int) = 0;
+ virtual int scanf_one(const char *, void *) = 0;
+ virtual int eof() = 0;
+ virtual void * make_jas_stream() = 0;
+ virtual int jpeg_src(void *) { return -1; }
+ /* Make buffer from current offset */
+
+ /* subfile parsing not implemented in base class */
+ virtual const char* fname(){ return NULL;};
+#if defined(_WIN32) && !defined(__MINGW32__) && defined(_MSC_VER) && (_MSC_VER > 1310)
+ virtual const wchar_t* wfname(){ return NULL;};
+ virtual int subfile_open(const wchar_t*) { return -1;}
+#endif
+ virtual int subfile_open(const char*) { return -1;}
+ virtual void subfile_close() { }
+
+
+ virtual int tempbuffer_open(void*, size_t);
+ virtual void tempbuffer_close();
+
+ protected:
+ LibRaw_abstract_datastream *substream;
+};
+
+#ifdef WIN32
+template class DllDef std::auto_ptr<std::streambuf>;
+#endif
+
+class DllDef LibRaw_file_datastream: public LibRaw_abstract_datastream
+{
+ protected:
+ std::auto_ptr<std::streambuf> f; /* will close() automatically through dtor */
+ std::auto_ptr<std::streambuf> saved_f; /* when *f is a subfile, *saved_f is the master file */
+ std::string filename;
+ INT64 _fsize;
+#ifdef WIN32
+ std::wstring wfilename;
+#endif
+ FILE *jas_file;
+ public:
+ virtual ~LibRaw_file_datastream();
+ LibRaw_file_datastream(const char *fname);
+#if defined(_WIN32) && !defined(__MINGW32__) && defined(_MSC_VER) && (_MSC_VER > 1310)
+ LibRaw_file_datastream(const wchar_t *fname);
+#endif
+ virtual void *make_jas_stream();
+ virtual int jpeg_src(void *jpegdata);
+ virtual int valid();
+ virtual int read(void * ptr,size_t size, size_t nmemb);
+ virtual int eof();
+ virtual int seek(INT64 o, int whence);
+ virtual INT64 tell();
+ virtual INT64 size() { return _fsize;}
+ virtual int get_char()
+ {
+ if(substream) return substream->get_char();
+ return f->sbumpc();
+ }
+ virtual char* gets(char *str, int sz);
+ virtual int scanf_one(const char *fmt, void*val);
+ virtual const char* fname();
+#if defined(_WIN32) && !defined(__MINGW32__) && defined(_MSC_VER) && (_MSC_VER > 1310)
+ virtual const wchar_t* wfname();
+ virtual int subfile_open(const wchar_t *fn);
+#endif
+ virtual int subfile_open(const char *fn);
+ virtual void subfile_close();
+};
+
+
+class DllDef LibRaw_buffer_datastream : public LibRaw_abstract_datastream
+{
+ public:
+ LibRaw_buffer_datastream(void *buffer, size_t bsize);
+ virtual ~LibRaw_buffer_datastream();
+ virtual int valid();
+ virtual void *make_jas_stream();
+ virtual int jpeg_src(void *jpegdata);
+ virtual int read(void * ptr,size_t sz, size_t nmemb);
+ virtual int eof();
+ virtual int seek(INT64 o, int whence);
+ virtual INT64 tell();
+ virtual INT64 size() { return streamsize;}
+ virtual char* gets(char *s, int sz);
+ virtual int scanf_one(const char *fmt, void* val);
+ virtual int get_char()
+ {
+ if(substream) return substream->get_char();
+ if(streampos>=streamsize)
+ return -1;
+ return buf[streampos++];
+ }
+
+ private:
+ unsigned char *buf;
+ size_t streampos,streamsize;
+};
+
+class DllDef LibRaw_bigfile_datastream : public LibRaw_abstract_datastream
+{
+ public:
+ LibRaw_bigfile_datastream(const char *fname);
+#if defined(_WIN32) && !defined(__MINGW32__) && defined(_MSC_VER) && (_MSC_VER > 1310)
+ LibRaw_bigfile_datastream(const wchar_t *fname);
+#endif
+ virtual ~LibRaw_bigfile_datastream();
+ virtual int valid();
+ virtual int jpeg_src(void *jpegdata);
+ virtual void *make_jas_stream();
+
+ virtual int read(void * ptr,size_t size, size_t nmemb);
+ virtual int eof();
+ virtual int seek(INT64 o, int whence);
+ virtual INT64 tell();
+ virtual INT64 size() { return _fsize;}
+ virtual char* gets(char *str, int sz);
+ virtual int scanf_one(const char *fmt, void*val);
+ virtual const char *fname();
+#if defined(_WIN32) && !defined(__MINGW32__) && defined(_MSC_VER) && (_MSC_VER > 1310)
+ virtual const wchar_t* wfname();
+ virtual int subfile_open(const wchar_t *fn);
+#endif
+ virtual int subfile_open(const char *fn);
+ virtual void subfile_close();
+ virtual int get_char()
+ {
+#ifndef WIN32
+ return substream?substream->get_char():getc_unlocked(f);
+#else
+ return substream?substream->get_char():fgetc(f);
+#endif
+ }
+
+protected:
+ FILE *f,*sav;
+ std::string filename;
+ INT64 _fsize;
+#ifdef WIN32
+ std::wstring wfilename;
+#endif
+};
+
+#ifdef WIN32
+class DllDef LibRaw_windows_datastream : public LibRaw_buffer_datastream
+{
+public:
+ /* ctor: high level constructor opens a file by name */
+ LibRaw_windows_datastream(const TCHAR* sFile);
+ /* ctor: construct with a file handle - caller is responsible for closing the file handle */
+ LibRaw_windows_datastream(HANDLE hFile);
+ /* dtor: unmap and close the mapping handle */
+ virtual ~LibRaw_windows_datastream();
+ virtual INT64 size() { return cbView_;}
+
+protected:
+ void Open(HANDLE hFile);
+ inline void reconstruct_base()
+ {
+ /* this subterfuge is to overcome the private-ness of LibRaw_buffer_datastream */
+ (LibRaw_buffer_datastream&)*this = LibRaw_buffer_datastream(pView_, (size_t)cbView_);
+ }
+
+ HANDLE hMap_; /* handle of the file mapping */
+ void* pView_; /* pointer to the mapped memory */
+ __int64 cbView_; /* size of the mapping in bytes */
+};
+
+#endif
+
+#ifdef USE_DNGSDK
+
+class libraw_dng_stream: public dng_stream
+{
+public:
+ libraw_dng_stream(LibRaw_abstract_datastream* p): dng_stream((dng_abort_sniffer*)NULL,kBigBufferSize,0),parent_stream(p)
+ {
+ if(parent_stream)
+ {
+ off = parent_stream->tell();
+ parent_stream->seek(0UL,SEEK_SET); /* seek to start */
+ }
+ }
+ ~libraw_dng_stream(){
+ if(parent_stream)
+ parent_stream->seek(off,SEEK_SET);
+ }
+ virtual uint64 DoGetLength (){
+ if(parent_stream)
+ return parent_stream->size();
+ return 0;
+ }
+ virtual void DoRead (void *data, uint32 count, uint64 offset)
+ {
+ if(parent_stream)
+ {
+ parent_stream->seek(offset,SEEK_SET);
+ parent_stream->read(data,1,count);
+ }
+ }
+
+private:
+ libraw_dng_stream (const libraw_dng_stream &stream);
+ libraw_dng_stream & operator= (const libraw_dng_stream &stream);
+ LibRaw_abstract_datastream *parent_stream;
+ INT64 off;
+};
+
+#endif
+
+#endif /* cplusplus */
+
+#endif
+
diff --git a/android_lib/include/libraw/libraw_internal.h b/android_lib/include/libraw/libraw_internal.h
new file mode 100644
index 0000000..626323e
--- /dev/null
+++ b/android_lib/include/libraw/libraw_internal.h
@@ -0,0 +1,230 @@
+/* -*- C++ -*-
+ * File: libraw_internal.h
+ * Copyright 2008-2016 LibRaw LLC (info@libraw.org)
+ * Created: Sat Mar 8 , 2008
+ *
+ * LibRaw internal data structures (not visible outside)
+
+LibRaw is free software; you can redistribute it and/or modify
+it under the terms of the one of three licenses as you choose:
+
+1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
+ (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
+
+2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+ (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
+
+3. LibRaw Software License 27032010
+ (See file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
+
+ */
+
+#ifndef _LIBRAW_INTERNAL_TYPES_H
+#define _LIBRAW_INTERNAL_TYPES_H
+
+#include <stdio.h>
+#ifdef __cplusplus
+
+#ifdef LIBRAW_LIBRARY_BUILD
+#ifndef CLASS
+#define CLASS LibRaw::
+#endif
+#endif
+
+#else
+#ifndef CLASS
+#define CLASS
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include "libraw_datastream.h"
+#include "libraw_types.h"
+
+class LibRaw_TLS
+{
+public:
+ struct
+ {
+ unsigned bitbuf;
+ int vbits, reset;
+ }getbits;
+ struct
+ {
+ UINT64 bitbuf;
+ int vbits;
+
+ }ph1_bits;
+ struct
+ {
+ unsigned pad[128], p;
+ }sony_decrypt;
+ struct
+ {
+ uchar buf[0x4000];
+ int vbits, padding;
+ }pana_bits;
+ uchar jpeg_buffer[4096];
+ struct
+ {
+ float cbrt[0x10000], xyz_cam[3][4];
+ }ahd_data;
+ void init()
+ {
+ getbits.bitbuf = 0; getbits.vbits = getbits.reset = 0;
+ ph1_bits.bitbuf = 0; ph1_bits.vbits = 0;
+ pana_bits.vbits = 0;
+ ahd_data.cbrt[0]=-2.0f;
+ }
+};
+
+
+class LibRaw_constants
+{
+ public:
+ static const float d65_white[3];
+ static const double xyz_rgb[3][3];
+};
+#endif /* __cplusplus */
+
+
+typedef struct
+{
+#ifndef __cplusplus
+ struct
+#endif
+ LibRaw_abstract_datastream *input;
+ FILE *output;
+ int input_internal;
+ char *meta_data;
+ INT64 profile_offset;
+ INT64 toffset;
+ unsigned pana_black[4];
+
+} internal_data_t;
+
+
+#define LIBRAW_HISTOGRAM_SIZE 0x2000
+typedef struct
+{
+ int (*histogram)[LIBRAW_HISTOGRAM_SIZE];
+ unsigned *oprof;
+} output_data_t;
+
+typedef struct
+{
+ unsigned olympus_exif_cfa;
+ unsigned unique_id;
+ unsigned tiff_nifds;
+ int tiff_flip;
+}identify_data_t;
+
+typedef struct
+{
+ short order;
+ ushort sraw_mul[4],cr2_slice[3];
+ unsigned kodak_cbpp;
+ INT64 strip_offset, data_offset;
+ INT64 meta_offset;
+ unsigned data_size;
+ unsigned meta_length;
+ unsigned thumb_misc;
+ unsigned fuji_layout;
+ unsigned tiff_samples;
+ unsigned tiff_bps;
+ unsigned tiff_compress;
+ unsigned zero_after_ff;
+ unsigned tile_width, tile_length,load_flags;
+ unsigned data_error;
+ int hasselblad_parser_flag;
+ long long posRAFData;
+ unsigned lenRAFData;
+}unpacker_data_t;
+
+
+
+typedef struct
+{
+ internal_data_t internal_data;
+ libraw_internal_output_params_t internal_output_params;
+ output_data_t output_data;
+ identify_data_t identify_data;
+ unpacker_data_t unpacker_data;
+} libraw_internal_data_t;
+
+
+struct decode
+{
+ struct decode *branch[2];
+ int leaf;
+};
+
+struct tiff_ifd_t {
+ int t_width, t_height, bps, comp, phint, offset, t_flip, samples, bytes;
+ int t_tile_width, t_tile_length,sample_format,predictor;
+ int rows_per_strip;
+ int *strip_offsets,strip_offsets_count;
+ int *strip_byte_counts,strip_byte_counts_count;
+ float t_shutter;
+};
+
+struct jhead {
+ int algo, bits, high, wide, clrs, sraw, psv, restart, vpred[6];
+ ushort quant[64], idct[64], *huff[20], *free[20], *row;
+};
+
+struct tiff_tag {
+ ushort tag, type;
+ int count;
+ union { char c[4]; short s[2]; int i; } val;
+};
+
+struct tiff_hdr {
+ ushort t_order, magic;
+ int ifd;
+ ushort pad, ntag;
+ struct tiff_tag tag[23];
+ int nextifd;
+ ushort pad2, nexif;
+ struct tiff_tag exif[4];
+ ushort pad3, ngps;
+ struct tiff_tag gpst[10];
+ short bps[4];
+ int rat[10];
+ unsigned gps[26];
+ char t_desc[512], t_make[64], t_model[64], soft[32], date[20], t_artist[64];
+};
+
+
+
+#ifdef DEBUG_STAGE_CHECKS
+#define CHECK_ORDER_HIGH(expected_stage) \
+ do { if((imgdata.progress_flags & LIBRAW_PROGRESS_THUMB_MASK) >= expected_stage) {fprintf(stderr,"CHECK_HIGH: check %d >= %d\n",imgdata.progress_flags & LIBRAW_PROGRESS_THUMB_MASK,expected_stage);return LIBRAW_OUT_OF_ORDER_CALL;} } while(0)
+
+#define CHECK_ORDER_LOW(expected_stage) \
+ do { printf("Checking LOW %d/%d : %d\n",imgdata.progress_flags,expected_stage,imgdata.progress_flags<expected_stage); if( (imgdata.progress_flags&LIBRAW_PROGRESS_THUMB_MASK) < expected_stage ) { printf("failed!\n"); return LIBRAW_OUT_OF_ORDER_CALL;} } while(0)
+#define CHECK_ORDER_BIT(expected_stage) \
+ do { if(imgdata.progress_flags & expected_stage) return LIBRAW_OUT_OF_ORDER_CALL; } while(0)
+
+#define SET_PROC_FLAG(stage) do {imgdata.progress_flags |= stage; fprintf(stderr,"SET_FLAG: %d\n",stage); } while (0)
+
+#else
+
+#define CHECK_ORDER_HIGH(expected_stage) \
+ do { if((imgdata.progress_flags & LIBRAW_PROGRESS_THUMB_MASK) >= expected_stage) \
+ {return LIBRAW_OUT_OF_ORDER_CALL;} } while(0)
+
+#define CHECK_ORDER_LOW(expected_stage) \
+ do { if((imgdata.progress_flags&LIBRAW_PROGRESS_THUMB_MASK) < expected_stage) \
+ return LIBRAW_OUT_OF_ORDER_CALL; } while(0)
+
+#define CHECK_ORDER_BIT(expected_stage) \
+ do { if(imgdata.progress_flags & expected_stage) return LIBRAW_OUT_OF_ORDER_CALL; } while(0)
+
+#define SET_PROC_FLAG(stage) do {imgdata.progress_flags |= stage;} while (0)
+
+#endif
+
+#endif
diff --git a/android_lib/include/libraw/libraw_types.h b/android_lib/include/libraw/libraw_types.h
new file mode 100644
index 0000000..e5a739e
--- /dev/null
+++ b/android_lib/include/libraw/libraw_types.h
@@ -0,0 +1,650 @@
+/* -*- C++ -*-
+ * File: libraw_types.h
+ * Copyright 2008-2016 LibRaw LLC (info@libraw.org)
+ * Created: Sat Mar 8 , 2008
+ *
+ * LibRaw C data structures
+ *
+
+LibRaw is free software; you can redistribute it and/or modify
+it under the terms of the one of three licenses as you choose:
+
+1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
+ (See file LICENSE.LGPL provided in LibRaw distribution archive for details).
+
+2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+ (See file LICENSE.CDDL provided in LibRaw distribution archive for details).
+
+3. LibRaw Software License 27032010
+ (See file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
+
+ */
+
+#ifndef _LIBRAW_TYPES_H
+#define _LIBRAW_TYPES_H
+
+#include <sys/types.h>
+#ifndef WIN32
+#include <sys/time.h>
+#endif
+#include <stdio.h>
+
+#if defined (_OPENMP)
+
+#if defined(WIN32)
+# if defined (_MSC_VER) && (_MSC_VER >= 1600 || (_MSC_VER == 1500 && _MSC_FULL_VER >= 150030729) )
+/* VS2010+ : OpenMP works OK, VS2008: have tested by cgilles */
+# define LIBRAW_USE_OPENMP
+#elif defined (__INTEL_COMPILER) && (__INTEL_COMPILER >=910)
+/* Have not tested on 9.x and 10.x, but Intel documentation claims OpenMP 2.5 support in 9.1 */
+# define LIBRAW_USE_OPENMP
+#else
+# undef LIBRAW_USE_OPENMP
+#endif
+/* Not Win32 */
+# elif (defined(__APPLE__) || defined(__MACOSX__)) && defined(_REENTRANT)
+# undef LIBRAW_USE_OPENMP
+# else
+# define LIBRAW_USE_OPENMP
+# endif
+#endif
+
+#ifdef LIBRAW_USE_OPENMP
+#include <omp.h>
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(USE_LCMS)
+#include <lcms.h>
+#elif defined(USE_LCMS2)
+#include <lcms2.h>
+#else
+#define NO_LCMS
+#endif
+
+#include "libraw_const.h"
+#include "libraw_version.h"
+
+#ifdef WIN32
+typedef __int64 INT64;
+typedef unsigned __int64 UINT64;
+#else
+typedef long long INT64;
+typedef unsigned long long UINT64;
+#endif
+
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+
+#ifdef WIN32
+#ifdef LIBRAW_NODLL
+# define DllDef
+#else
+# ifdef LIBRAW_BUILDLIB
+# define DllDef __declspec( dllexport )
+# else
+# define DllDef __declspec( dllimport )
+# endif
+#endif
+#else
+# define DllDef
+#endif
+
+typedef struct
+{
+ const char *decoder_name;
+ unsigned decoder_flags;
+}libraw_decoder_info_t;
+
+typedef struct
+{
+ unsigned mix_green;
+ unsigned raw_color;
+ unsigned zero_is_bad;
+ ushort shrink;
+ ushort fuji_width;
+} libraw_internal_output_params_t;
+
+
+typedef void (* memory_callback)(void * data, const char *file, const char *where);
+typedef void (*exif_parser_callback) (void *context, int tag, int type, int len,unsigned int ord, void *ifp);
+
+DllDef void default_memory_callback(void *data,const char *file, const char *where);
+
+typedef void (*data_callback)(void *data,const char *file, const int offset);
+
+DllDef void default_data_callback(void *data,const char *file, const int offset);
+
+typedef int (* progress_callback) (void *data,enum LibRaw_progress stage, int iteration,int expected);
+
+typedef struct
+{
+ memory_callback mem_cb;
+ void* memcb_data;
+
+ data_callback data_cb;
+ void* datacb_data;
+
+ progress_callback progress_cb;
+ void *progresscb_data;
+
+ exif_parser_callback exif_cb;
+ void *exifparser_data;
+} libraw_callbacks_t;
+
+
+typedef struct
+{
+ enum LibRaw_image_formats type;
+ ushort height,
+ width,
+ colors,
+ bits;
+ unsigned int data_size;
+ unsigned char data[1];
+}libraw_processed_image_t;
+
+
+typedef struct
+{
+ char guard[4];
+ char make[64];
+ char model[64];
+ char software[64];
+ unsigned raw_count;
+ unsigned dng_version;
+ unsigned is_foveon;
+ int colors;
+ unsigned filters;
+ char xtrans[6][6];
+ char xtrans_abs[6][6];
+ char cdesc[5];
+ unsigned xmplen;
+ char *xmpdata;
+
+}libraw_iparams_t;
+
+typedef struct
+{
+ ushort raw_height,
+ raw_width,
+ height,
+ width,
+ top_margin,
+ left_margin;
+ ushort iheight,
+ iwidth;
+ unsigned raw_pitch;
+ double pixel_aspect;
+ int flip;
+ int mask[8][4];
+} libraw_image_sizes_t;
+
+struct ph1_t
+{
+ int format, key_off, tag_21a;
+ int t_black, split_col, black_col, split_row, black_row;
+ float tag_210;
+};
+
+typedef struct
+{
+ ushort illuminant;
+ float calibration[4][4];
+ float colormatrix[4][3];
+ float forwardmatrix[3][4];
+ float dng_blacklevel[4];
+ unsigned dng_whitelevel[4];
+ float analogbalance[4];
+} libraw_dng_color_t;
+
+typedef struct
+{
+ int CanonColorDataVer;
+ int CanonColorDataSubVer;
+ int SpecularWhiteLevel;
+ int AverageBlackLevel;
+// metering
+ short MeteringMode;
+ short SpotMeteringMode;
+ uchar FlashMeteringMode;
+ short FlashExposureLock;
+ short ExposureMode;
+ short AESetting;
+ uchar HighlightTonePriority;
+// stabilization
+ short ImageStabilization;
+// focus
+ short FocusMode;
+ short AFPoint;
+ short FocusContinuous;
+ short AFPointsInFocus30D;
+ uchar AFPointsInFocus1D[8];
+ ushort AFPointsInFocus5D; // bytes in reverse
+// AFInfo
+ ushort AFAreaMode;
+ ushort NumAFPoints;
+ ushort ValidAFPoints;
+ ushort AFImageWidth;
+ ushort AFImageHeight;
+ short AFAreaWidths[61]; // cycle to NumAFPoints
+ short AFAreaHeights[61]; // --''--
+ short AFAreaXPositions[61]; // --''--
+ short AFAreaYPositions[61]; // --''--
+ short AFPointsInFocus[4]; // cycle to floor((NumAFPoints+15)/16)
+ short AFPointsSelected[4]; // --''--
+ ushort PrimaryAFPoint;
+// flash
+ short FlashMode;
+ short FlashActivity;
+ short FlashBits;
+ short ManualFlashOutput;
+ short FlashOutput;
+ short FlashGuideNumber;
+// drive
+ short ContinuousDrive;
+} libraw_canon_makernotes_t;
+
+typedef struct
+{
+ float FujiExpoMidPointShift;
+ ushort FujiDynamicRange;
+ ushort FujiFilmMode;
+ ushort FujiDynamicRangeSetting;
+ ushort FujiDevelopmentDynamicRange;
+ ushort FujiAutoDynamicRange;
+ ushort FocusMode;
+ ushort AFMode;
+ ushort FocusPixel[2];
+ ushort ImageStabilization[3];
+ ushort FlashMode;
+} libraw_fuji_info_t;
+
+typedef struct
+{
+
+ double ExposureBracketValue;
+ ushort ActiveDLighting;
+ ushort ShootingMode;
+// stabilization
+ uchar ImageStabilization[7];
+ uchar VibrationReduction;
+ uchar VRMode;
+// focus
+ char FocusMode[7];
+ uchar AFPoint;
+ ushort AFPointsInFocus;
+ uchar ContrastDetectAF;
+ uchar AFAreaMode;
+ uchar PhaseDetectAF;
+ uchar PrimaryAFPoint;
+ uchar AFPointsUsed[29];
+ ushort AFImageWidth;
+ ushort AFImageHeight;
+ ushort AFAreaXPposition;
+ ushort AFAreaYPosition;
+ ushort AFAreaWidth;
+ ushort AFAreaHeight;
+ uchar ContrastDetectAFInFocus;
+// flash
+ char FlashSetting[13];
+ char FlashType[20];
+ uchar FlashExposureCompensation[4];
+ uchar ExternalFlashExposureComp[4];
+ uchar FlashExposureBracketValue[4];
+ uchar FlashMode;
+ signed char FlashExposureCompensation2;
+ signed char FlashExposureCompensation3;
+ signed char FlashExposureCompensation4;
+ uchar FlashSource;
+ uchar FlashFirmware[2];
+ uchar ExternalFlashFlags;
+ uchar FlashControlCommanderMode;
+ uchar FlashOutputAndCompensation;
+ uchar FlashFocalLength;
+ uchar FlashGNDistance;
+ uchar FlashGroupControlMode[4];
+ uchar FlashGroupOutputAndCompensation[4];
+ uchar FlashColorFilter;
+} libraw_nikon_makernotes_t;
+
+typedef struct
+{
+ int OlympusCropID;
+ ushort OlympusFrame[4]; /* upper left XY, lower right XY */
+ int OlympusSensorCalibration[2];
+ ushort FocusMode[2];
+ ushort AutoFocus;
+ ushort AFPoint;
+ unsigned AFAreas[64];
+ double AFPointSelected[5];
+ ushort AFResult;
+ unsigned ImageStabilization;
+} libraw_olympus_makernotes_t;
+
+typedef struct
+{
+ ushort FocusMode;
+ uchar AFPointMode;
+ ushort AFPointSelected[2];
+ unsigned AFPointsInFocus;
+ uchar DriveMode[4];
+ uchar SRResult;
+ uchar ShakeReduction;
+} libraw_pentax_makernotes_t;
+
+typedef struct
+{
+ ushort SonyCameraType;
+} libraw_sony_info_t;
+
+typedef struct
+{
+ ushort curve[0x10000];
+ unsigned cblack[4102];
+ unsigned black;
+ unsigned data_maximum;
+ unsigned maximum;
+ float fmaximum;
+ float fnorm;
+ ushort white[8][8];
+ float cam_mul[4];
+ float pre_mul[4];
+ float cmatrix[3][4];
+ float rgb_cam[3][4];
+ float cam_xyz[4][3];
+ struct ph1_t phase_one_data;
+ float flash_used;
+ float canon_ev;
+ char model2[64];
+ void *profile;
+ unsigned profile_length;
+ unsigned black_stat[8];
+ libraw_dng_color_t dng_color[2];
+ float baseline_exposure;
+ int digitalBack_color;
+ int WB_Coeffs[256][4]; /* R, G1, B, G2 coeffs */
+ float WBCT_Coeffs[64][5]; /* CCT, than R, G1, B, G2 coeffs */
+} libraw_colordata_t;
+
+typedef struct
+{
+ enum LibRaw_thumbnail_formats tformat;
+ ushort twidth,
+ theight;
+ unsigned tlength;
+ int tcolors;
+ char *thumb;
+}libraw_thumbnail_t;
+
+typedef struct
+{
+ float latitude[3]; /* Deg,min,sec */
+ float longtitude[3]; /* Deg,min,sec */
+ float gpstimestamp[3]; /* Deg,min,sec */
+ float altitude;
+ char altref, latref, longref, gpsstatus;
+ char gpsparsed;
+} libraw_gps_info_t;
+
+typedef struct
+{
+ float iso_speed;
+ float shutter;
+ float aperture;
+ float focal_len;
+ time_t timestamp;
+ unsigned shot_order;
+ unsigned gpsdata[32];
+ libraw_gps_info_t parsed_gps;
+ char desc[512],
+ artist[64];
+ float FlashEC;
+} libraw_imgother_t;
+
+typedef struct
+{
+ unsigned greybox[4]; /* -A x1 y1 x2 y2 */
+ unsigned cropbox[4]; /* -B x1 y1 x2 y2 */
+ double aber[4]; /* -C */
+ double gamm[6]; /* -g */
+ float user_mul[4]; /* -r mul0 mul1 mul2 mul3 */
+ unsigned shot_select; /* -s */
+ float bright; /* -b */
+ float threshold; /* -n */
+ int half_size; /* -h */
+ int four_color_rgb; /* -f */
+ int highlight; /* -H */
+ int use_auto_wb; /* -a */
+ int use_camera_wb; /* -w */
+ int use_camera_matrix; /* +M/-M */
+ int output_color; /* -o */
+ char *output_profile; /* -o */
+ char *camera_profile; /* -p */
+ char *bad_pixels; /* -P */
+ char *dark_frame; /* -K */
+ int output_bps; /* -4 */
+ int output_tiff; /* -T */
+ int user_flip; /* -t */
+ int user_qual; /* -q */
+ int user_black; /* -k */
+ int user_cblack[4];
+ int user_sat; /* -S */
+
+ int med_passes; /* -m */
+ float auto_bright_thr;
+ float adjust_maximum_thr;
+ int no_auto_bright; /* -W */
+ int use_fuji_rotate;/* -j */
+ int green_matching;
+ /* DCB parameters */
+ int dcb_iterations;
+ int dcb_enhance_fl;
+ int fbdd_noiserd;
+ /* VCD parameters */
+ int eeci_refine;
+ int es_med_passes;
+ /* AMaZE*/
+ int ca_correc;
+ float cared;
+ float cablue;
+ int cfaline;
+ float linenoise;
+ int cfa_clean;
+ float lclean;
+ float cclean;
+ int cfa_green;
+ float green_thresh;
+ int exp_correc;
+ float exp_shift;
+ float exp_preser;
+ /* WF debanding */
+ int wf_debanding;
+ float wf_deband_treshold[4];
+ /* Raw speed */
+ int use_rawspeed;
+ /* DNG SDK */
+ int use_dngsdk;
+ /* Disable Auto-scale */
+ int no_auto_scale;
+ /* Disable intepolation */
+ int no_interpolation;
+ /* Disable sRAW YCC to RGB conversion */
+ int sraw_ycc;
+ /* Force use x3f data decoding either if demosaic pack GPL2 enabled */
+ int force_foveon_x3f;
+ /* int x3f_flags; */
+ /* Sony ARW2 digging mode */
+ /* int sony_arw2_options; */
+ unsigned raw_processing_options;
+ int sony_arw2_posterization_thr;
+ /* Nikon Coolscan */
+ float coolscan_nef_gamma;
+}libraw_output_params_t;
+
+typedef struct
+{
+ /* really allocated bitmap */
+ void *raw_alloc;
+ /* alias to single_channel variant */
+ ushort *raw_image;
+ /* alias to 4-channel variant */
+ ushort (*color4_image)[4] ;
+ /* alias to 3-color variand decoded by RawSpeed */
+ ushort (*color3_image)[3];
+ /* float bayer */
+ float *float_image;
+ /* float 3-component */
+ float (*float3_image)[3];
+ /* float 4-component */
+ float (*float4_image)[4];
+
+ /* Phase One black level data; */
+ short (*ph1_cblack)[2];
+ short (*ph1_rblack)[2];
+ /* save color and sizes here, too.... */
+ libraw_iparams_t iparams;
+ libraw_image_sizes_t sizes;
+ libraw_internal_output_params_t ioparams;
+ libraw_colordata_t color;
+} libraw_rawdata_t;
+
+typedef struct
+{
+ unsigned long long LensID;
+ char Lens[128];
+ ushort LensFormat; /* to characterize the image circle the lens covers */
+ ushort LensMount; /* 'male', lens itself */
+ unsigned long long CamID;
+ ushort CameraFormat; /* some of the sensor formats */
+ ushort CameraMount; /* 'female', body throat */
+ char body[64];
+ short FocalType; /* -1/0 is unknown; 1 is fixed focal; 2 is zoom */
+ char LensFeatures_pre[16], LensFeatures_suf[16];
+ float MinFocal, MaxFocal;
+ float MaxAp4MinFocal, MaxAp4MaxFocal, MinAp4MinFocal, MinAp4MaxFocal;
+ float MaxAp, MinAp;
+ float CurFocal, CurAp;
+ float MaxAp4CurFocal, MinAp4CurFocal;
+ float MinFocusDistance;
+ float FocusRangeIndex;
+ float LensFStops;
+ unsigned long long TeleconverterID;
+ char Teleconverter[128];
+ unsigned long long AdapterID;
+ char Adapter[128];
+ unsigned long long AttachmentID;
+ char Attachment[128];
+ ushort CanonFocalUnits;
+ float FocalLengthIn35mmFormat;
+} libraw_makernotes_lens_t;
+
+typedef struct
+{
+ float NikonEffectiveMaxAp;
+ uchar NikonLensIDNumber, NikonLensFStops, NikonMCUVersion, NikonLensType;
+} libraw_nikonlens_t;
+
+typedef struct
+{
+ float MinFocal, MaxFocal, MaxAp4MinFocal, MaxAp4MaxFocal;
+} libraw_dnglens_t;
+
+typedef struct
+{
+ float MinFocal, MaxFocal, MaxAp4MinFocal, MaxAp4MaxFocal, EXIF_MaxAp;
+ char LensMake[128], Lens[128];
+ ushort FocalLengthIn35mmFormat;
+ libraw_nikonlens_t nikon;
+ libraw_dnglens_t dng;
+ libraw_makernotes_lens_t makernotes;
+} libraw_lensinfo_t;
+
+typedef struct
+{
+ libraw_canon_makernotes_t canon;
+ libraw_fuji_info_t fuji;
+ libraw_olympus_makernotes_t olympus;
+ libraw_sony_info_t sony;
+} libraw_makernotes_t;
+
+typedef struct
+{
+ short DriveMode;
+ short FocusMode;
+ short MeteringMode;
+ short AFPoint;
+ short ExposureMode;
+ short ImageStabilization;
+} libraw_shootinginfo_t;
+
+typedef struct
+{
+ ushort (*image)[4] ;
+ libraw_image_sizes_t sizes;
+ libraw_iparams_t idata;
+ libraw_lensinfo_t lens;
+ libraw_makernotes_t makernotes;
+ libraw_shootinginfo_t shootinginfo;
+ libraw_output_params_t params;
+ unsigned int progress_flags;
+ unsigned int process_warnings;
+ libraw_colordata_t color;
+ libraw_imgother_t other;
+ libraw_thumbnail_t thumbnail;
+ libraw_rawdata_t rawdata;
+ void *parent_class;
+} libraw_data_t;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+//Endianness detection for Android NDK
+#ifdef ANDROID
+#include <endian.h>
+#ifdef _BYTE_ORDER
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+#define __LITTLE_ENDIAN__ 1
+#undef __BIG_ENDIAN__
+#elif _BYTE_ORDER == _BIG_ENDIAN
+#define __BIG_ENDIAN__ 1
+#undef __LITTLE_ENDIAN__
+#endif
+#endif
+#endif //ANDROID
+
+/* Byte order */
+#if defined(__POWERPC__)
+#define LibRawBigEndian 1
+
+#elif defined(__INTEL__)
+#define LibRawBigEndian 0
+
+#elif defined(_M_IX86)
+#define LibRawBigEndian 0
+
+#elif defined(_M_X64) || defined(__amd64__)
+#define LibRawBigEndian 0
+
+#elif defined(__LITTLE_ENDIAN__)
+#define LibRawBigEndian 0
+
+#elif defined(__BIG_ENDIAN__)
+#define LibRawBigEndian 1
+#elif defined(_ARM_)
+#define LibRawBigEndian 0
+#else
+#ifndef qXCodeRez
+#error Unable to figure out byte order.
+#endif
+#endif
+
+
+
+#endif
diff --git a/android_lib/include/libraw/libraw_version.h b/android_lib/include/libraw/libraw_version.h
new file mode 100644
index 0000000..2c4cbf5
--- /dev/null
+++ b/android_lib/include/libraw/libraw_version.h
@@ -0,0 +1,62 @@
+/* -*- C++ -*-
+ * File: libraw_version.h
+ * Copyright 2008-2016 LibRaw LLC (info@libraw.org)
+ * Created: Mon Sept 8, 2008
+ *
+ * LibRaw C++ interface
+ *
+
+LibRaw is free software; you can redistribute it and/or modify
+it under the terms of the one of three licenses as you choose:
+
+1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
+(See the file LICENSE.LGPL provided in LibRaw distribution archive for details).
+
+2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+(See the file LICENSE.CDDL provided in LibRaw distribution archive for details).
+
+3. LibRaw Software License 27032010
+ (See the file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
+
+ */
+
+#ifndef __VERSION_H
+#define __VERSION_H
+
+#define LIBRAW_MAJOR_VERSION 0
+#define LIBRAW_MINOR_VERSION 18
+#define LIBRAW_PATCH_VERSION 0
+#define LIBRAW_VERSION_TAIL 201604
+
+#define LIBRAW_SHLIB_CURRENT 15
+#define LIBRAW_SHLIB_REVISION 0
+#define LIBRAW_SHLIB_AGE 0
+
+#define _LIBRAW_VERSION_MAKE(a,b,c,d) #a"."#b"."#c"-"#d
+#define LIBRAW_VERSION_MAKE(a,b,c,d) _LIBRAW_VERSION_MAKE(a,b,c,d)
+
+#define LIBRAW_VERSION_STR LIBRAW_VERSION_MAKE(LIBRAW_MAJOR_VERSION,LIBRAW_MINOR_VERSION,LIBRAW_PATCH_VERSION,LIBRAW_VERSION_TAIL)
+
+#define LIBRAW_MAKE_VERSION(major,minor,patch) \
+ (((major) << 16) | ((minor) << 8) | (patch))
+
+#define LIBRAW_VERSION \
+ LIBRAW_MAKE_VERSION(LIBRAW_MAJOR_VERSION,LIBRAW_MINOR_VERSION,LIBRAW_PATCH_VERSION)
+
+#define LIBRAW_CHECK_VERSION(major,minor,patch) \
+ ( LibRaw::versionNumber() >= LIBRAW_MAKE_VERSION(major,minor,patch) )
+
+#define LIBRAW_RUNTIME_CHECK_VERSION_EXACT() \
+ ( (LibRaw::versionNumber() & 0xffff00) == LIBRAW_MAKE_VERSION(LIBRAW_MAJOR_VERSION,LIBRAW_MINOR_VERSION,0) )
+
+#define LIBRAW_RUNTIME_CHECK_VERSION_NOTLESS() \
+ ( (LibRaw::versionNumber() & 0xffff00) >= LIBRAW_MAKE_VERSION(LIBRAW_MAJOR_VERSION,LIBRAW_MINOR_VERSION,0) )
+
+#define LIBRAW_COMPILE_CHECK_VERSION(major,minor) \
+ (LIBRAW_MAKE_VERSION(major,minor,0) == (LIBRAW_VERSION & 0xffff00))
+
+#define LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(major,minor) \
+ (LIBRAW_MAKE_VERSION(major,minor,0) <= (LIBRAW_VERSION & 0xffff00))
+
+
+#endif
diff --git a/android_lib/include/longnam.h b/android_lib/include/longnam.h
new file mode 100644
index 0000000..fbd7caf
--- /dev/null
+++ b/android_lib/include/longnam.h
@@ -0,0 +1,596 @@
+#ifndef _LONGNAME_H
+#define _LONGNAME_H
+
+#define fits_parse_input_url ffiurl
+#define fits_parse_input_filename ffifile
+#define fits_parse_rootname ffrtnm
+#define fits_file_exists ffexist
+#define fits_parse_output_url ffourl
+#define fits_parse_extspec ffexts
+#define fits_parse_extnum ffextn
+#define fits_parse_binspec ffbins
+#define fits_parse_binrange ffbinr
+#define fits_parse_range ffrwrg
+#define fits_parse_rangell ffrwrgll
+#define fits_open_memfile ffomem
+
+/*
+ use the following special macro to test that the fitsio.h include file
+ that was used to build the CFITSIO library is compatible with the version
+ as included when compiling the application program
+*/
+#define fits_open_file(A, B, C, D) ffopentest( CFITSIO_SONAME, A, B, C, D)
+
+#define fits_open_data ffdopn
+#define fits_open_extlist ffeopn
+#define fits_open_table fftopn
+#define fits_open_image ffiopn
+#define fits_open_diskfile ffdkopn
+#define fits_reopen_file ffreopen
+#define fits_create_file ffinit
+#define fits_create_diskfile ffdkinit
+#define fits_create_memfile ffimem
+#define fits_create_template fftplt
+#define fits_flush_file ffflus
+#define fits_flush_buffer ffflsh
+#define fits_close_file ffclos
+#define fits_delete_file ffdelt
+#define fits_file_name ffflnm
+#define fits_file_mode ffflmd
+#define fits_url_type ffurlt
+
+#define fits_get_version ffvers
+#define fits_uppercase ffupch
+#define fits_get_errstatus ffgerr
+#define fits_write_errmsg ffpmsg
+#define fits_write_errmark ffpmrk
+#define fits_read_errmsg ffgmsg
+#define fits_clear_errmsg ffcmsg
+#define fits_clear_errmark ffcmrk
+#define fits_report_error ffrprt
+#define fits_compare_str ffcmps
+#define fits_test_keyword fftkey
+#define fits_test_record fftrec
+#define fits_null_check ffnchk
+#define fits_make_keyn ffkeyn
+#define fits_make_nkey ffnkey
+#define fits_make_key ffmkky
+#define fits_get_keyclass ffgkcl
+#define fits_get_keytype ffdtyp
+#define fits_get_inttype ffinttyp
+#define fits_parse_value ffpsvc
+#define fits_get_keyname ffgknm
+#define fits_parse_template ffgthd
+#define fits_ascii_tform ffasfm
+#define fits_binary_tform ffbnfm
+#define fits_binary_tformll ffbnfmll
+#define fits_get_tbcol ffgabc
+#define fits_get_rowsize ffgrsz
+#define fits_get_col_display_width ffgcdw
+
+#define fits_write_record ffprec
+#define fits_write_key ffpky
+#define fits_write_key_unit ffpunt
+#define fits_write_comment ffpcom
+#define fits_write_history ffphis
+#define fits_write_date ffpdat
+#define fits_get_system_time ffgstm
+#define fits_get_system_date ffgsdt
+#define fits_date2str ffdt2s
+#define fits_time2str fftm2s
+#define fits_str2date ffs2dt
+#define fits_str2time ffs2tm
+#define fits_write_key_longstr ffpkls
+#define fits_write_key_longwarn ffplsw
+#define fits_write_key_null ffpkyu
+#define fits_write_key_str ffpkys
+#define fits_write_key_log ffpkyl
+#define fits_write_key_lng ffpkyj
+#define fits_write_key_fixflt ffpkyf
+#define fits_write_key_flt ffpkye
+#define fits_write_key_fixdbl ffpkyg
+#define fits_write_key_dbl ffpkyd
+#define fits_write_key_fixcmp ffpkfc
+#define fits_write_key_cmp ffpkyc
+#define fits_write_key_fixdblcmp ffpkfm
+#define fits_write_key_dblcmp ffpkym
+#define fits_write_key_triple ffpkyt
+#define fits_write_tdim ffptdm
+#define fits_write_tdimll ffptdmll
+#define fits_write_keys_str ffpkns
+#define fits_write_keys_log ffpknl
+#define fits_write_keys_lng ffpknj
+#define fits_write_keys_fixflt ffpknf
+#define fits_write_keys_flt ffpkne
+#define fits_write_keys_fixdbl ffpkng
+#define fits_write_keys_dbl ffpknd
+#define fits_copy_key ffcpky
+#define fits_write_imghdr ffphps
+#define fits_write_imghdrll ffphpsll
+#define fits_write_grphdr ffphpr
+#define fits_write_grphdrll ffphprll
+#define fits_write_atblhdr ffphtb
+#define fits_write_btblhdr ffphbn
+#define fits_write_exthdr ffphext
+#define fits_write_key_template ffpktp
+
+#define fits_get_hdrspace ffghsp
+#define fits_get_hdrpos ffghps
+#define fits_movabs_key ffmaky
+#define fits_movrel_key ffmrky
+#define fits_find_nextkey ffgnxk
+
+#define fits_read_record ffgrec
+#define fits_read_card ffgcrd
+#define fits_read_str ffgstr
+#define fits_read_key_unit ffgunt
+#define fits_read_keyn ffgkyn
+#define fits_read_key ffgky
+#define fits_read_keyword ffgkey
+#define fits_read_key_str ffgkys
+#define fits_read_key_log ffgkyl
+#define fits_read_key_lng ffgkyj
+#define fits_read_key_lnglng ffgkyjj
+#define fits_read_key_flt ffgkye
+#define fits_read_key_dbl ffgkyd
+#define fits_read_key_cmp ffgkyc
+#define fits_read_key_dblcmp ffgkym
+#define fits_read_key_triple ffgkyt
+#define fits_get_key_strlen ffgksl
+#define fits_read_key_longstr ffgkls
+#define fits_read_string_key ffgsky
+#define fits_free_memory fffree
+#define fits_read_tdim ffgtdm
+#define fits_read_tdimll ffgtdmll
+#define fits_decode_tdim ffdtdm
+#define fits_decode_tdimll ffdtdmll
+#define fits_read_keys_str ffgkns
+#define fits_read_keys_log ffgknl
+#define fits_read_keys_lng ffgknj
+#define fits_read_keys_lnglng ffgknjj
+#define fits_read_keys_flt ffgkne
+#define fits_read_keys_dbl ffgknd
+#define fits_read_imghdr ffghpr
+#define fits_read_imghdrll ffghprll
+#define fits_read_atblhdr ffghtb
+#define fits_read_btblhdr ffghbn
+#define fits_read_atblhdrll ffghtbll
+#define fits_read_btblhdrll ffghbnll
+#define fits_hdr2str ffhdr2str
+#define fits_convert_hdr2str ffcnvthdr2str
+
+#define fits_update_card ffucrd
+#define fits_update_key ffuky
+#define fits_update_key_null ffukyu
+#define fits_update_key_str ffukys
+#define fits_update_key_longstr ffukls
+#define fits_update_key_log ffukyl
+#define fits_update_key_lng ffukyj
+#define fits_update_key_fixflt ffukyf
+#define fits_update_key_flt ffukye
+#define fits_update_key_fixdbl ffukyg
+#define fits_update_key_dbl ffukyd
+#define fits_update_key_fixcmp ffukfc
+#define fits_update_key_cmp ffukyc
+#define fits_update_key_fixdblcmp ffukfm
+#define fits_update_key_dblcmp ffukym
+
+#define fits_modify_record ffmrec
+#define fits_modify_card ffmcrd
+#define fits_modify_name ffmnam
+#define fits_modify_comment ffmcom
+#define fits_modify_key_null ffmkyu
+#define fits_modify_key_str ffmkys
+#define fits_modify_key_longstr ffmkls
+#define fits_modify_key_log ffmkyl
+#define fits_modify_key_lng ffmkyj
+#define fits_modify_key_fixflt ffmkyf
+#define fits_modify_key_flt ffmkye
+#define fits_modify_key_fixdbl ffmkyg
+#define fits_modify_key_dbl ffmkyd
+#define fits_modify_key_fixcmp ffmkfc
+#define fits_modify_key_cmp ffmkyc
+#define fits_modify_key_fixdblcmp ffmkfm
+#define fits_modify_key_dblcmp ffmkym
+
+#define fits_insert_record ffirec
+#define fits_insert_card ffikey
+#define fits_insert_key_null ffikyu
+#define fits_insert_key_str ffikys
+#define fits_insert_key_longstr ffikls
+#define fits_insert_key_log ffikyl
+#define fits_insert_key_lng ffikyj
+#define fits_insert_key_fixflt ffikyf
+#define fits_insert_key_flt ffikye
+#define fits_insert_key_fixdbl ffikyg
+#define fits_insert_key_dbl ffikyd
+#define fits_insert_key_fixcmp ffikfc
+#define fits_insert_key_cmp ffikyc
+#define fits_insert_key_fixdblcmp ffikfm
+#define fits_insert_key_dblcmp ffikym
+
+#define fits_delete_key ffdkey
+#define fits_delete_str ffdstr
+#define fits_delete_record ffdrec
+#define fits_get_hdu_num ffghdn
+#define fits_get_hdu_type ffghdt
+#define fits_get_hduaddr ffghad
+#define fits_get_hduaddrll ffghadll
+#define fits_get_hduoff ffghof
+
+#define fits_get_img_param ffgipr
+#define fits_get_img_paramll ffgiprll
+
+#define fits_get_img_type ffgidt
+#define fits_get_img_equivtype ffgiet
+#define fits_get_img_dim ffgidm
+#define fits_get_img_size ffgisz
+#define fits_get_img_sizell ffgiszll
+
+#define fits_movabs_hdu ffmahd
+#define fits_movrel_hdu ffmrhd
+#define fits_movnam_hdu ffmnhd
+#define fits_get_num_hdus ffthdu
+#define fits_create_img ffcrim
+#define fits_create_imgll ffcrimll
+#define fits_create_tbl ffcrtb
+#define fits_create_hdu ffcrhd
+#define fits_insert_img ffiimg
+#define fits_insert_imgll ffiimgll
+#define fits_insert_atbl ffitab
+#define fits_insert_btbl ffibin
+#define fits_resize_img ffrsim
+#define fits_resize_imgll ffrsimll
+
+#define fits_delete_hdu ffdhdu
+#define fits_copy_hdu ffcopy
+#define fits_copy_file ffcpfl
+#define fits_copy_header ffcphd
+#define fits_copy_data ffcpdt
+#define fits_write_hdu ffwrhdu
+
+#define fits_set_hdustruc ffrdef
+#define fits_set_hdrsize ffhdef
+#define fits_write_theap ffpthp
+
+#define fits_encode_chksum ffesum
+#define fits_decode_chksum ffdsum
+#define fits_write_chksum ffpcks
+#define fits_update_chksum ffupck
+#define fits_verify_chksum ffvcks
+#define fits_get_chksum ffgcks
+
+#define fits_set_bscale ffpscl
+#define fits_set_tscale fftscl
+#define fits_set_imgnull ffpnul
+#define fits_set_btblnull fftnul
+#define fits_set_atblnull ffsnul
+
+#define fits_get_colnum ffgcno
+#define fits_get_colname ffgcnn
+#define fits_get_coltype ffgtcl
+#define fits_get_coltypell ffgtclll
+#define fits_get_eqcoltype ffeqty
+#define fits_get_eqcoltypell ffeqtyll
+#define fits_get_num_rows ffgnrw
+#define fits_get_num_rowsll ffgnrwll
+#define fits_get_num_cols ffgncl
+#define fits_get_acolparms ffgacl
+#define fits_get_bcolparms ffgbcl
+#define fits_get_bcolparmsll ffgbclll
+
+#define fits_iterate_data ffiter
+
+#define fits_read_grppar_byt ffggpb
+#define fits_read_grppar_sbyt ffggpsb
+#define fits_read_grppar_usht ffggpui
+#define fits_read_grppar_ulng ffggpuj
+#define fits_read_grppar_sht ffggpi
+#define fits_read_grppar_lng ffggpj
+#define fits_read_grppar_lnglng ffggpjj
+#define fits_read_grppar_int ffggpk
+#define fits_read_grppar_uint ffggpuk
+#define fits_read_grppar_flt ffggpe
+#define fits_read_grppar_dbl ffggpd
+
+#define fits_read_pix ffgpxv
+#define fits_read_pixll ffgpxvll
+#define fits_read_pixnull ffgpxf
+#define fits_read_pixnullll ffgpxfll
+#define fits_read_img ffgpv
+#define fits_read_imgnull ffgpf
+#define fits_read_img_byt ffgpvb
+#define fits_read_img_sbyt ffgpvsb
+#define fits_read_img_usht ffgpvui
+#define fits_read_img_ulng ffgpvuj
+#define fits_read_img_sht ffgpvi
+#define fits_read_img_lng ffgpvj
+#define fits_read_img_lnglng ffgpvjj
+#define fits_read_img_uint ffgpvuk
+#define fits_read_img_int ffgpvk
+#define fits_read_img_flt ffgpve
+#define fits_read_img_dbl ffgpvd
+
+#define fits_read_imgnull_byt ffgpfb
+#define fits_read_imgnull_sbyt ffgpfsb
+#define fits_read_imgnull_usht ffgpfui
+#define fits_read_imgnull_ulng ffgpfuj
+#define fits_read_imgnull_sht ffgpfi
+#define fits_read_imgnull_lng ffgpfj
+#define fits_read_imgnull_lnglng ffgpfjj
+#define fits_read_imgnull_uint ffgpfuk
+#define fits_read_imgnull_int ffgpfk
+#define fits_read_imgnull_flt ffgpfe
+#define fits_read_imgnull_dbl ffgpfd
+
+#define fits_read_2d_byt ffg2db
+#define fits_read_2d_sbyt ffg2dsb
+#define fits_read_2d_usht ffg2dui
+#define fits_read_2d_ulng ffg2duj
+#define fits_read_2d_sht ffg2di
+#define fits_read_2d_lng ffg2dj
+#define fits_read_2d_lnglng ffg2djj
+#define fits_read_2d_uint ffg2duk
+#define fits_read_2d_int ffg2dk
+#define fits_read_2d_flt ffg2de
+#define fits_read_2d_dbl ffg2dd
+
+#define fits_read_3d_byt ffg3db
+#define fits_read_3d_sbyt ffg3dsb
+#define fits_read_3d_usht ffg3dui
+#define fits_read_3d_ulng ffg3duj
+#define fits_read_3d_sht ffg3di
+#define fits_read_3d_lng ffg3dj
+#define fits_read_3d_lnglng ffg3djj
+#define fits_read_3d_uint ffg3duk
+#define fits_read_3d_int ffg3dk
+#define fits_read_3d_flt ffg3de
+#define fits_read_3d_dbl ffg3dd
+
+#define fits_read_subset ffgsv
+#define fits_read_subset_byt ffgsvb
+#define fits_read_subset_sbyt ffgsvsb
+#define fits_read_subset_usht ffgsvui
+#define fits_read_subset_ulng ffgsvuj
+#define fits_read_subset_sht ffgsvi
+#define fits_read_subset_lng ffgsvj
+#define fits_read_subset_lnglng ffgsvjj
+#define fits_read_subset_uint ffgsvuk
+#define fits_read_subset_int ffgsvk
+#define fits_read_subset_flt ffgsve
+#define fits_read_subset_dbl ffgsvd
+
+#define fits_read_subsetnull_byt ffgsfb
+#define fits_read_subsetnull_sbyt ffgsfsb
+#define fits_read_subsetnull_usht ffgsfui
+#define fits_read_subsetnull_ulng ffgsfuj
+#define fits_read_subsetnull_sht ffgsfi
+#define fits_read_subsetnull_lng ffgsfj
+#define fits_read_subsetnull_lnglng ffgsfjj
+#define fits_read_subsetnull_uint ffgsfuk
+#define fits_read_subsetnull_int ffgsfk
+#define fits_read_subsetnull_flt ffgsfe
+#define fits_read_subsetnull_dbl ffgsfd
+
+#define ffcpimg fits_copy_image_section
+#define fits_compress_img fits_comp_img
+#define fits_decompress_img fits_decomp_img
+
+#define fits_read_col ffgcv
+#define fits_read_colnull ffgcf
+#define fits_read_col_str ffgcvs
+#define fits_read_col_log ffgcvl
+#define fits_read_col_byt ffgcvb
+#define fits_read_col_sbyt ffgcvsb
+#define fits_read_col_usht ffgcvui
+#define fits_read_col_ulng ffgcvuj
+#define fits_read_col_sht ffgcvi
+#define fits_read_col_lng ffgcvj
+#define fits_read_col_lnglng ffgcvjj
+#define fits_read_col_uint ffgcvuk
+#define fits_read_col_int ffgcvk
+#define fits_read_col_flt ffgcve
+#define fits_read_col_dbl ffgcvd
+#define fits_read_col_cmp ffgcvc
+#define fits_read_col_dblcmp ffgcvm
+#define fits_read_col_bit ffgcx
+#define fits_read_col_bit_usht ffgcxui
+#define fits_read_col_bit_uint ffgcxuk
+
+#define fits_read_colnull_str ffgcfs
+#define fits_read_colnull_log ffgcfl
+#define fits_read_colnull_byt ffgcfb
+#define fits_read_colnull_sbyt ffgcfsb
+#define fits_read_colnull_usht ffgcfui
+#define fits_read_colnull_ulng ffgcfuj
+#define fits_read_colnull_sht ffgcfi
+#define fits_read_colnull_lng ffgcfj
+#define fits_read_colnull_lnglng ffgcfjj
+#define fits_read_colnull_uint ffgcfuk
+#define fits_read_colnull_int ffgcfk
+#define fits_read_colnull_flt ffgcfe
+#define fits_read_colnull_dbl ffgcfd
+#define fits_read_colnull_cmp ffgcfc
+#define fits_read_colnull_dblcmp ffgcfm
+
+#define fits_read_descript ffgdes
+#define fits_read_descriptll ffgdesll
+#define fits_read_descripts ffgdess
+#define fits_read_descriptsll ffgdessll
+#define fits_read_tblbytes ffgtbb
+
+#define fits_write_grppar_byt ffpgpb
+#define fits_write_grppar_sbyt ffpgpsb
+#define fits_write_grppar_usht ffpgpui
+#define fits_write_grppar_ulng ffpgpuj
+#define fits_write_grppar_sht ffpgpi
+#define fits_write_grppar_lng ffpgpj
+#define fits_write_grppar_lnglng ffpgpjj
+#define fits_write_grppar_uint ffpgpuk
+#define fits_write_grppar_int ffpgpk
+#define fits_write_grppar_flt ffpgpe
+#define fits_write_grppar_dbl ffpgpd
+
+#define fits_write_pix ffppx
+#define fits_write_pixll ffppxll
+#define fits_write_pixnull ffppxn
+#define fits_write_pixnullll ffppxnll
+#define fits_write_img ffppr
+#define fits_write_img_byt ffpprb
+#define fits_write_img_sbyt ffpprsb
+#define fits_write_img_usht ffpprui
+#define fits_write_img_ulng ffppruj
+#define fits_write_img_sht ffppri
+#define fits_write_img_lng ffpprj
+#define fits_write_img_lnglng ffpprjj
+#define fits_write_img_uint ffppruk
+#define fits_write_img_int ffpprk
+#define fits_write_img_flt ffppre
+#define fits_write_img_dbl ffpprd
+
+#define fits_write_imgnull ffppn
+#define fits_write_imgnull_byt ffppnb
+#define fits_write_imgnull_sbyt ffppnsb
+#define fits_write_imgnull_usht ffppnui
+#define fits_write_imgnull_ulng ffppnuj
+#define fits_write_imgnull_sht ffppni
+#define fits_write_imgnull_lng ffppnj
+#define fits_write_imgnull_lnglng ffppnjj
+#define fits_write_imgnull_uint ffppnuk
+#define fits_write_imgnull_int ffppnk
+#define fits_write_imgnull_flt ffppne
+#define fits_write_imgnull_dbl ffppnd
+
+#define fits_write_img_null ffppru
+#define fits_write_null_img ffpprn
+
+#define fits_write_2d_byt ffp2db
+#define fits_write_2d_sbyt ffp2dsb
+#define fits_write_2d_usht ffp2dui
+#define fits_write_2d_ulng ffp2duj
+#define fits_write_2d_sht ffp2di
+#define fits_write_2d_lng ffp2dj
+#define fits_write_2d_lnglng ffp2djj
+#define fits_write_2d_uint ffp2duk
+#define fits_write_2d_int ffp2dk
+#define fits_write_2d_flt ffp2de
+#define fits_write_2d_dbl ffp2dd
+
+#define fits_write_3d_byt ffp3db
+#define fits_write_3d_sbyt ffp3dsb
+#define fits_write_3d_usht ffp3dui
+#define fits_write_3d_ulng ffp3duj
+#define fits_write_3d_sht ffp3di
+#define fits_write_3d_lng ffp3dj
+#define fits_write_3d_lnglng ffp3djj
+#define fits_write_3d_uint ffp3duk
+#define fits_write_3d_int ffp3dk
+#define fits_write_3d_flt ffp3de
+#define fits_write_3d_dbl ffp3dd
+
+#define fits_write_subset ffpss
+#define fits_write_subset_byt ffpssb
+#define fits_write_subset_sbyt ffpsssb
+#define fits_write_subset_usht ffpssui
+#define fits_write_subset_ulng ffpssuj
+#define fits_write_subset_sht ffpssi
+#define fits_write_subset_lng ffpssj
+#define fits_write_subset_lnglng ffpssjj
+#define fits_write_subset_uint ffpssuk
+#define fits_write_subset_int ffpssk
+#define fits_write_subset_flt ffpsse
+#define fits_write_subset_dbl ffpssd
+
+#define fits_write_col ffpcl
+#define fits_write_col_str ffpcls
+#define fits_write_col_log ffpcll
+#define fits_write_col_byt ffpclb
+#define fits_write_col_sbyt ffpclsb
+#define fits_write_col_usht ffpclui
+#define fits_write_col_ulng ffpcluj
+#define fits_write_col_sht ffpcli
+#define fits_write_col_lng ffpclj
+#define fits_write_col_lnglng ffpcljj
+#define fits_write_col_uint ffpcluk
+#define fits_write_col_int ffpclk
+#define fits_write_col_flt ffpcle
+#define fits_write_col_dbl ffpcld
+#define fits_write_col_cmp ffpclc
+#define fits_write_col_dblcmp ffpclm
+#define fits_write_col_null ffpclu
+#define fits_write_col_bit ffpclx
+#define fits_write_nulrows ffprwu
+#define fits_write_nullrows ffprwu
+
+#define fits_write_colnull ffpcn
+#define fits_write_colnull_str ffpcns
+#define fits_write_colnull_log ffpcnl
+#define fits_write_colnull_byt ffpcnb
+#define fits_write_colnull_sbyt ffpcnsb
+#define fits_write_colnull_usht ffpcnui
+#define fits_write_colnull_ulng ffpcnuj
+#define fits_write_colnull_sht ffpcni
+#define fits_write_colnull_lng ffpcnj
+#define fits_write_colnull_lnglng ffpcnjj
+#define fits_write_colnull_uint ffpcnuk
+#define fits_write_colnull_int ffpcnk
+#define fits_write_colnull_flt ffpcne
+#define fits_write_colnull_dbl ffpcnd
+
+#define fits_write_ext ffpextn
+#define fits_read_ext ffgextn
+
+#define fits_write_descript ffpdes
+#define fits_compress_heap ffcmph
+#define fits_test_heap fftheap
+
+#define fits_write_tblbytes ffptbb
+#define fits_insert_rows ffirow
+#define fits_delete_rows ffdrow
+#define fits_delete_rowrange ffdrrg
+#define fits_delete_rowlist ffdrws
+#define fits_delete_rowlistll ffdrwsll
+#define fits_insert_col fficol
+#define fits_insert_cols fficls
+#define fits_delete_col ffdcol
+#define fits_copy_col ffcpcl
+#define fits_copy_rows ffcprw
+#define fits_modify_vector_len ffmvec
+
+#define fits_read_img_coord ffgics
+#define fits_read_img_coord_version ffgicsa
+#define fits_read_tbl_coord ffgtcs
+#define fits_pix_to_world ffwldp
+#define fits_world_to_pix ffxypx
+
+#define fits_get_image_wcs_keys ffgiwcs
+#define fits_get_table_wcs_keys ffgtwcs
+
+#define fits_find_rows fffrow
+#define fits_find_first_row ffffrw
+#define fits_find_rows_cmp fffrwc
+#define fits_select_rows ffsrow
+#define fits_calc_rows ffcrow
+#define fits_calculator ffcalc
+#define fits_calculator_rng ffcalc_rng
+#define fits_test_expr fftexp
+
+#define fits_create_group ffgtcr
+#define fits_insert_group ffgtis
+#define fits_change_group ffgtch
+#define fits_remove_group ffgtrm
+#define fits_copy_group ffgtcp
+#define fits_merge_groups ffgtmg
+#define fits_compact_group ffgtcm
+#define fits_verify_group ffgtvf
+#define fits_open_group ffgtop
+#define fits_add_group_member ffgtam
+#define fits_get_num_members ffgtnm
+
+#define fits_get_num_groups ffgmng
+#define fits_open_member ffgmop
+#define fits_copy_member ffgmcp
+#define fits_transfer_member ffgmtf
+#define fits_remove_member ffgmrm
+
+#endif
diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
index 9c2f420..1fad0f6 100644
--- a/kstars/CMakeLists.txt
+++ b/kstars/CMakeLists.txt
@@ -702,7 +702,7 @@ if(BUILD_KSTARS_LITE)
kstarslite/qml/indi/modules/KSButtonsSwitchRow.qml
)
add_subdirectory(kstarslite/qml)
- add_subdirectory(kstarslite/kirigami)
+ add_subdirectory(kstarslite/kirigami-lib)
if(ANDROID)
add_subdirectory(kstarslite/res)
endif()
diff --git a/kstars/kstarslite/kirigami b/kstars/kstarslite/kirigami
deleted file mode 160000
-Subproject 7f11cdf9fbd9d9ed280ad6b16965c331d778c97
diff --git a/kstars/kstarslite/kirigami-lib/CMakeLists.txt b/kstars/kstarslite/kirigami-lib/CMakeLists.txt
new file mode 100644
index 0000000..fbe3a42
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/CMakeLists.txt
@@ -0,0 +1,124 @@
+project(kirigami)
+
+cmake_minimum_required(VERSION 2.8.12)
+set(KF5_MIN_VERSION "5.18.0")
+set(QT_MIN_VERSION "5.5.0")
+
+################# Disallow in-source build #################
+
+if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
+ message(FATAL_ERROR "kirigami requires an out of source build. Please create a separate build directory and run 'cmake path_to_kirigami [options]' there.")
+endif()
+
+option(PLASMA_ENABLED "Build and install The Plasma style" ON)
+option(DESKTOP_ENABLED "Build and install The Desktop style" ON)
+option(STATIC_LIBRARY "Build as a static library" OFF)
+option(BUILD_EXAMPLES "Build and install examples" OFF)
+
+# Make CPack available to easy generate binary packages
+include(CPack)
+include(FeatureSummary)
+
+IF(STATIC_LIBRARY)
+ set(CMAKE_AUTOMOC ON)
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ ADD_DEFINITIONS(-DKIRIGAMI_BUILD_TYPE_STATIC)
+ find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg)
+ set (QT_MIN_VERSION "5.5.0")
+ if(UNIX)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
+ endif()
+ add_subdirectory(src)
+
+ELSE(STATIC_LIBRARY)
+
+
+################# set KDE specific information #################
+
+find_package(ECM 0.0.8 REQUIRED NO_MODULE)
+
+# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
+
+include(ECMSetupVersion)
+include(ECMGenerateHeaders)
+include(ECMPackageConfigHelpers)
+include(KDEInstallDirs)
+include(KDECMakeSettings)
+include(KDECompilerSettings NO_POLICY_SCOPE)
+
+set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Kirigami")
+
+ecm_configure_package_config_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/KF5KirigamiConfig.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/KF5KirigamiConfig.cmake"
+ INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
+ PATH_VARS KF5_INCLUDE_INSTALL_DIR CMAKE_INSTALL_PREFIX
+)
+
+install(FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/KF5KirigamiConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/KF5KirigamiConfigVersion.cmake"
+ "${CMAKE_CURRENT_SOURCE_DIR}/KF5KirigamiMacros.cmake"
+ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+ COMPONENT Devel
+)
+
+
+set(KF5_VERSION "5.22.0")
+ecm_setup_version(${KF5_VERSION}
+ VARIABLE_PREFIX KIRIGAMI
+ VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kirigami_version.h"
+ PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KirigamiConfigVersion.cmake"
+ SOVERSION 5)
+
+find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg)
+
+if(PLASMA_ENABLED)
+# treat plasma as an optinal dep: full functionality is expected with only Qt
+find_package(KF5Plasma ${KF5_MIN_VERSION})
+set_package_properties(KF5Plasma PROPERTIES DESCRIPTION "Plasma framework"
+ TYPE OPTIONAL
+ PURPOSE "Optional Look and feel integration with Plasma Mobile."
+ )
+endif()
+
+if(DESKTOP_ENABLED)
+find_package(KF5Declarative ${KF5_MIN_VERSION})
+set_package_properties(KF5Declarative PROPERTIES DESCRIPTION "KDeclarative framework"
+ TYPE OPTIONAL
+ PURPOSE "Optional Look and feel integration with desktop colors and icons."
+ )
+endif()
+
+if(KF5Plasma_FOUND AND THEME STREQUAL "Plasma")
+ set(PLASMA_ENABLED 1)
+endif()
+
+if(KF5Declarative_FOUND AND THEME STREQUAL "System")
+ set(DESKTOP_ENABLED 1)
+endif()
+
+################# Enable C++11 features for clang and gcc #################
+
+if(UNIX)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
+endif()
+
+################# now find all used packages #################
+
+set (QT_MIN_VERSION "5.5.0")
+
+find_package(PkgConfig)
+#########################################################################
+
+add_subdirectory(src)
+#TODO: conditional
+if (BUILD_EXAMPLES)
+ add_subdirectory(examples)
+endif()
+
+ENDIF(STATIC_LIBRARY)
+
+feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
+
diff --git a/kstars/kstarslite/kirigami-lib/KF5KirigamiConfig.cmake.in b/kstars/kstarslite/kirigami-lib/KF5KirigamiConfig.cmake.in
new file mode 100644
index 0000000..d774dfa
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/KF5KirigamiConfig.cmake.in
@@ -0,0 +1,11 @@
+@PACKAGE_INIT@
+
+# Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file.
+
+#include("${CMAKE_CURRENT_LIST_DIR}/KF5KirigamiTargets.cmake")
+
+set(Kirigami_INSTALL_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
+
+#set(Kirigami_LIBRARIES KF5::Kirigami)
+
+include("${CMAKE_CURRENT_LIST_DIR}/KF5KirigamiMacros.cmake")
diff --git a/kstars/kstarslite/kirigami-lib/KF5KirigamiMacros.cmake b/kstars/kstarslite/kirigami-lib/KF5KirigamiMacros.cmake
new file mode 100644
index 0000000..175db95
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/KF5KirigamiMacros.cmake
@@ -0,0 +1,85 @@
+
+include(CMakeParseArguments)
+include(ExternalProject)
+find_package(Git)
+
+
+function(kirigami_package_breeze_icons)
+ set(_multiValueArgs ICONS)
+ cmake_parse_arguments(ARG "" "" "${_multiValueArgs}" ${ARGN} )
+
+ if(NOT ARG_ICONS)
+ message(FATAL_ERROR "No ICONS argument given to kirigami_package_breeze_icons")
+ endif()
+
+ #include icons used by Kirigami components themselves
+ set(ARG_ICONS ${ARG_ICONS} go-next go-previous handle-left handle-right)
+
+ function(_find_breeze_icon icon varName)
+ #HACKY
+ SET(path "")
+ file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/48/${icon}.svg )
+
+ #seach in other sizes as well
+ if (NOT EXISTS ${path})
+ file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/32/${icon}.svg )
+ if (NOT EXISTS ${path})
+ file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/24/${icon}.svg )
+ if (NOT EXISTS ${path})
+ file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/22/${icon}.svg )
+ endif()
+ endif()
+ endif()
+ if (NOT EXISTS ${path})
+ return()
+ endif()
+
+ get_filename_component(path "${path}" REALPATH)
+
+ SET(${varName} ${path} PARENT_SCOPE)
+ endfunction()
+
+ if (BREEZEICONS_DIR AND NOT EXISTS ${BREEZEICONS_DIR})
+ message(FATAL_ERROR "BREEZEICONS_DIR variable does not point to existing dir: \"${BREEZEICONS_DIR}\"")
+ endif()
+
+ set(_BREEZEICONS_DIR "${BREEZEICONS_DIR}")
+
+ #FIXME: this is a terrible hack
+ if(NOT _BREEZEICONS_DIR)
+ set(_BREEZEICONS_DIR "${CMAKE_BINARY_DIR}/breeze-icons/src/breeze-icons")
+
+ # replacement for ExternalProject_Add not yet working
+ # first time config?
+ if (NOT EXISTS ${_BREEZEICONS_DIR})
+ execute_process(COMMAND ${GIT_EXECUTABLE} clone --depth 1 git://anongit.kde.org/breeze-icons.git ${_BREEZEICONS_DIR})
+ endif()
+
+ # external projects are only pulled at make time, not configure time
+ # so this is too late to work with the _find_breeze_icon() method
+ # _find_breeze_icon() would need to be turned into a target/command
+ if (FALSE)
+ ExternalProject_Add(
+ breeze-icons
+ PREFIX breeze-icons
+ GIT_REPOSITORY git://anongit.kde.org/breeze-icons.git
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ LOG_DOWNLOAD ON
+ )
+ endif()
+ endif()
+
+ message (STATUS "Found external breeze icons:")
+ foreach(_iconName ${ARG_ICONS})
+ set(_iconPath "")
+ _find_breeze_icon(${_iconName} _iconPath)
+ message (STATUS ${_iconPath})
+ if (EXISTS ${_iconPath})
+ install(FILES ${_iconPath} DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami/icons/ RENAME ${_iconName}.svg)
+ endif()
+
+ endforeach()
+endfunction()
+
diff --git a/kstars/kstarslite/kirigami-lib/LICENSE.GPL-2 b/kstars/kstarslite/kirigami-lib/LICENSE.GPL-2
new file mode 100644
index 0000000..d159169
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/LICENSE.GPL-2
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the 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 Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/kstars/kstarslite/kirigami-lib/LICENSE.LGPL-2 b/kstars/kstarslite/kirigami-lib/LICENSE.LGPL-2
new file mode 100644
index 0000000..5bc8fb2
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/LICENSE.LGPL-2
@@ -0,0 +1,481 @@
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. 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 not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library 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
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/kstars/kstarslite/kirigami-lib/LICENSE.LGPL-2.1 b/kstars/kstarslite/kirigami-lib/LICENSE.LGPL-2.1
new file mode 100644
index 0000000..4362b49
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/LICENSE.LGPL-2.1
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. 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 not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the 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
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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 2.1 of the License, or (at your option) any later version.
+
+ This library 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, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/kstars/kstarslite/kirigami-lib/Mainpage.dox b/kstars/kstarslite/kirigami-lib/Mainpage.dox
new file mode 100644
index 0000000..b9b1420
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/Mainpage.dox
@@ -0,0 +1,161 @@
+/*
+ This file is part of Kirigami
+ Copyright (C) 2016 Marco Martin <mart@kde.org>
+
+ 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 2.1 of the License, or (at your option) version 3, or any
+ later version accepted by the membership of KDE e.V. (or its
+ successor approved by the membership of KDE e.V.), which shall
+ act as a proxy defined in Section 6 of version 3 of the license.
+
+ This library 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 <http://www.gnu.org/licenses/>.
+*/
+
+
+/** \mainpage kirigami
+
+
+\section overview Introduction
+Kirigami is a set of QtQuick components at the moment targeted for mobile use (in the future desktop as well) targeting both Plasma Mobile and Android. It’s not a whole set of components, all the “Primitive” ones like buttons and textboxes are a job for QtQuickControls (soon QtQuickContrls2) but it’s a set of high level components to make as easy as possible making applications that look gorgeous on mobile devices that follow the Visual Design Group UI guidelines.
+The target of those components is anybody that wants to do an application using QtQuick as its main UI, especially if targeting a mobile platform, without adding many dependencies. They work both in Plasma Mobile and Android.
+It will eventually become a Tier-1 KDE Framework.
+
+\section components Main Components
+- \link org::kde::kirigami::ApplicationWindow ApplicationWindow \endlink
+- \link org::kde::kirigami::Action Action \endlink
+- \link org::kde::kirigami::GlobalDrawer GlobalDrawer \endlink
+- \link org::kde::kirigami::ContextDrawer ContextDrawer \endlink
+- \link org::kde::kirigami::OverlayDrawer OverlayDrawer \endlink
+- \link org::kde::kirigami::Page Page \endlink
+- \link org::kde::kirigami::ScrollablePage ScrollablePage \endlink
+- \link org::kde::kirigami::OverlaySheet OverlaySheet \endlink
+- \link org::kde::kirigami::Theme Theme \endlink
+- \link org::kde::kirigami::Units Units \endlink
+- \link org::kde::kirigami::Icon Icon \endlink
+- \link org::kde::kirigami::BasicListItem BasicListItem \endlink
+- \link org::kde::kirigami::AbstractApplicationHeader AbstractApplicationHeader \endlink
+- \link org::kde::kirigami::AbstractApplicationWindow AbstractApplicationWindow \endlink
+- \link org::kde::kirigami::AbstractListItem AbstractListItem \endlink
+- \link org::kde::kirigami::ApplicationHeader ApplicationHeader \endlink
+- \link org::kde::kirigami::BasicListItem BasicListItem \endlink
+- \link org::kde::kirigami::SwipeListItem SwipeListItem \endlink
+- \link org::kde::kirigami::Heading Heading \endlink
+- \link org::kde::kirigami::Label Label \endlink
+- \link org::kde::kirigami::SplitDrawer SplitDrawer \endlink
+
+
+\section example Minimal Example
+
+@code
+import QtQuick 2.1
+import org.kde.kirigami 1.0 as Kirigami
+
+Kirigami.ApplicationWindow {
+ id: root
+
+ globalDrawer: Kirigami.GlobalDrawer {
+ title: "Hello App"
+ titleIcon: "applications-graphics"
+
+ actions: [
+ Kirigami.Action {
+ text: "View"
+ iconName: "view-list-icons"
+ Kirigami.Action {
+ text: "action 1"
+ }
+ Kirigami.Action {
+ text: "action 2"
+ }
+ Kirigami.Action {
+ text: "action 3"
+ }
+ },
+ Kirigami.Action {
+ text: "action 3"
+ },
+ Kirigami.Action {
+ text: "action 4"
+ }
+ ]
+ }
+ contextDrawer: Kirigami.ContextDrawer {
+ id: contextDrawer
+ }
+
+ pageStack.initialPage: mainPageComponent
+
+ Component {
+ id: mainPageComponent
+ Kirigami.ScrollablePage {
+ title: "Hello"
+ actions {
+ main: Action {
+ iconName: sheet.opened ? "dialog-cancel" : "document-edit"
+ onTriggered: {
+ print("Action button in buttons page clicked");
+ sheet.opened = !sheet.opened
+ }
+ }
+ left: Action {
+ iconName: "go-previous"
+ onTriggered: {
+ print("Left action triggered")
+ }
+ }
+ right: Action {
+ iconName: "go-next"
+ onTriggered: {
+ print("Right action triggered")
+ }
+ }
+ contextualActions: [
+ Action {
+ text:"Action for buttons"
+ iconName: "bookmarks"
+ onTriggered: print("Action 1 clicked")
+ },
+ Action {
+ text:"Action 2"
+ iconName: "folder"
+ enabled: false
+ },
+ Action {
+ text: "Action for Sheet"
+ visible: sheet.opened
+ }
+ ]
+ }
+ //Page contents...
+ }
+ }
+}
+@endcode
+
+@authors
+Marco Martin \<notmart@gmail.com\><br>
+Sebastian Kuegler \<sebas@kde.org\><br>
+Aleix Pol Gonzalez \<aleixpol@kde.org\><br>
+Dirk Hohndel \<dirk@hohndel.org\><br>
+
+@maintainers
+Marco Martin \<notmart@gmail.com\>
+
+@licenses
+@lgpl
+
+*/
+
+
+// DOXYGEN_SET_RECURSIVE = YES
+// DOXYGEN_SET_EXCLUDE_PATTERNS += *_p.h */private/* */examples/*
+// DOXYGEN_SET_PROJECT_NAME = Kirigami
+// vim:ts=4:sw=4:expandtab:filetype=doxygen
diff --git a/kstars/kstarslite/kirigami-lib/README.md b/kstars/kstarslite/kirigami-lib/README.md
new file mode 100644
index 0000000..b9cb8db
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/README.md
@@ -0,0 +1,27 @@
+# Kirigami
+
+Build on Android:
+```
+mkdir build
+cd build
+
+cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/share/ECM/toolchain/Android.cmake -DQTANDROID_EXPORTED_TARGET=kirigamigallery -DANDROID_APK_DIR=../examples/android/ -DCMAKE_PREFIX_PATH=/path/to/Qt-Android/5.5/android_armv7/ -DCMAKE_INSTALL_PREFIX=/path/to/dummy/install/prefix -DBUILD_EXAMPLES=ON
+```
+
+You need a `-DCMAKE_INSTALL_PREFIX` to somewhere in your home, but using an absolute path
+
+If you have a local checkout of the breeze-icons repo, you can avoid the cloning of the build dir
+by passing also `-DBREEZEICONS_DIR=/path/to/existing/sources/of/breeze-icons`
+
+```
+make
+make install
+make create-apk-kirigamigallery
+```
+
+`kirigamigallery_build_apk/bin/QtApp-debug.apk` will be generated
+
+to directly install on a phone:
+```
+adb install ./kirigamigallery_build_apk//bin/QtApp-debug.apk
+```
diff --git a/kstars/kstarslite/kirigami-lib/examples/CMakeLists.txt b/kstars/kstarslite/kirigami-lib/examples/CMakeLists.txt
new file mode 100644
index 0000000..87ec57a
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/CMakeLists.txt
@@ -0,0 +1,5 @@
+
+add_subdirectory(android)
+
+install(DIRECTORY gallery/ DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/kpackage/genericqml/org.kde.kirigami.gallery)
+install(FILES gallery/metadata.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} RENAME org.kde.kirigami.gallery.desktop)
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/AndroidManifest.xml b/kstars/kstarslite/kirigami-lib/examples/android/AndroidManifest.xml
new file mode 100644
index 0000000..2bde153
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/AndroidManifest.xml
@@ -0,0 +1,64 @@
+<?xml version='1.0' encoding='utf-8'?>
+<manifest package="org.kde.kirigamigallery" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.2" android:versionCode="3" android:installLocation="auto">
+ <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Kirigami Gallery" android:icon="@drawable/icon">
+ <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
+ android:name="org.qtproject.qt5.android.bindings.QtActivity"
+ android:label="Kirigami Gallery"
+ android:theme="@style/AppTheme"
+ android:screenOrientation="unspecified"
+ android:windowSoftInputMode="adjustResize"
+ android:launchMode="singleTop">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
+ <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
+ <meta-data android:name="android.app.repository" android:value="default"/>
+ <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
+ <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
+ <!-- Deploy Qt libs as part of package -->
+ <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
+ <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
+ <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
+ <!-- Run with local libs -->
+ <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
+ <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
+ <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
+ <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
+ <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
+ <!-- Messages maps -->
+ <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
+ <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
+ <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
+ <!-- Messages maps -->
+
+ <!-- Splash screen -->
+ <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
+ <!-- Splash screen -->
+
+ <!-- Background running -->
+ <!-- Warning: changing this value to true may cause unexpected crashes if the
+ application still try to draw after
+ "applicationStateChanged(Qt::ApplicationSuspended)"
+ signal is sent! -->
+ <meta-data android:name="android.app.background_running" android:value="false"/>
+ <!-- Background running -->
+
+ <!-- auto screen scale factor -->
+ <meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
+ <!-- auto screen scale factor -->
+ </activity>
+ </application>
+ <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14"/>
+ <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
+
+ <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
+ Remove the comment if you do not require these default permissions. -->
+ <!-- %%INSERT_PERMISSIONS -->
+
+ <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
+ Remove the comment if you do not require these default features. -->
+ <!-- %%INSERT_FEATURES -->
+
+</manifest>
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/CMakeLists.txt b/kstars/kstarslite/kirigami-lib/examples/android/CMakeLists.txt
new file mode 100644
index 0000000..3fe9d90
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/CMakeLists.txt
@@ -0,0 +1,14 @@
+
+set(kirigamigallery_SRCS
+ main.cpp
+ )
+
+qt5_add_resources(RESOURCES resources.qrc)
+
+add_executable(kirigamigallery ${kirigamigallery_SRCS} ${RESOURCES})
+target_link_libraries(kirigamigallery Qt5::Core Qt5::Qml Qt5::Quick Qt5::Svg)
+
+install(TARGETS kirigamigallery ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
+
+include(${CMAKE_SOURCE_DIR}/KF5KirigamiMacros.cmake)
+kirigami_package_breeze_icons(ICONS applications-graphics view-list-icons folder-sync view-list-details configure document-edit dialog-cancel document-decrypt mail-reply-sender bookmarks folder)
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/kirigami.svgz b/kstars/kstarslite/kirigami-lib/examples/android/kirigami.svgz
new file mode 100644
index 0000000..5b94808
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/kirigami.svgz
Binary files differ
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/main.cpp b/kstars/kstarslite/kirigami-lib/examples/android/main.cpp
new file mode 100644
index 0000000..76d5eaf
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/main.cpp
@@ -0,0 +1,21 @@
+
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+#include <QtQml>
+#include <QUrl>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ qputenv("QML_IMPORT_TRACE", "1");
+ QQmlApplicationEngine engine;
+
+ engine.load(QUrl(QStringLiteral("qrc:///contents/ui/ExampleApp.qml")));
+ if (engine.rootObjects().isEmpty()) {
+ return -1;
+ }
+
+ return app.exec();
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/res/drawable-xxxhdpi/icon.png b/kstars/kstarslite/kirigami-lib/examples/android/res/drawable-xxxhdpi/icon.png
new file mode 100644
index 0000000..f53c007
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/res/drawable-xxxhdpi/icon.png
Binary files differ
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/res/drawable-xxxhdpi/kirigami_splash.9.png b/kstars/kstarslite/kirigami-lib/examples/android/res/drawable-xxxhdpi/kirigami_splash.9.png
new file mode 100644
index 0000000..925702a
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/res/drawable-xxxhdpi/kirigami_splash.9.png
Binary files differ
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/res/drawable/icon.png b/kstars/kstarslite/kirigami-lib/examples/android/res/drawable/icon.png
new file mode 100644
index 0000000..f53c007
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/res/drawable/icon.png
Binary files differ
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/res/drawable/kirigami_splash.9.png b/kstars/kstarslite/kirigami-lib/examples/android/res/drawable/kirigami_splash.9.png
new file mode 100644
index 0000000..a4c3471
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/res/drawable/kirigami_splash.9.png
Binary files differ
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/res/drawable/splash.xml b/kstars/kstarslite/kirigami-lib/examples/android/res/drawable/splash.xml
new file mode 100644
index 0000000..a6f4ba9
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/res/drawable/splash.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="rectangle" >
+ <solid android:color="#FF2196F3"/>
+ </shape>
+ </item>
+ <item>
+ <bitmap android:src="@drawable/kirigami_splash"
+ android:gravity="center"/>
+ </item>
+</layer-list>
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/res/values/apptheme.xml b/kstars/kstarslite/kirigami-lib/examples/android/res/values/apptheme.xml
new file mode 100644
index 0000000..d8c3d7a
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/res/values/apptheme.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
+ <item name="android:windowBackground">@drawable/kirigami_splash</item>
+ </style>
+</resources>
diff --git a/kstars/kstarslite/kirigami-lib/examples/android/resources.qrc b/kstars/kstarslite/kirigami-lib/examples/android/resources.qrc
new file mode 100644
index 0000000..4646eff
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/android/resources.qrc
@@ -0,0 +1,18 @@
+<RCC>
+ <qresource prefix="/">
+ <file alias="contents/ui/MainPage.qml">../gallery/contents/ui/MainPage.qml</file>
+ <file alias="contents/ui/banner.jpg">../gallery/contents/ui/banner.jpg</file>
+ <file alias="contents/ui/gallery/NonScrollableGallery.qml">../gallery/contents/ui/gallery/NonScrollableGallery.qml</file>
+ <file alias="contents/ui/gallery/RadioButtonGallery.qml">../gallery/contents/ui/gallery/RadioButtonGallery.qml</file>
+ <file alias="contents/ui/gallery/ButtonGallery.qml">../gallery/contents/ui/gallery/ButtonGallery.qml</file>
+ <file alias="contents/ui/gallery/ProgressBarGallery.qml">../gallery/contents/ui/gallery/ProgressBarGallery.qml</file>
+ <file alias="contents/ui/gallery/CheckBoxGallery.qml">../gallery/contents/ui/gallery/CheckBoxGallery.qml</file>
+ <file alias="contents/ui/gallery/SliderGallery.qml">../gallery/contents/ui/gallery/SliderGallery.qml</file>
+ <file alias="contents/ui/gallery/MultipleColumnsGallery.qml">../gallery/contents/ui/gallery/MultipleColumnsGallery.qml</file>
+ <file alias="contents/ui/gallery/ListViewGallery.qml">../gallery/contents/ui/gallery/ListViewGallery.qml</file>
+ <file alias="contents/ui/gallery/SwitchGallery.qml">../gallery/contents/ui/gallery/SwitchGallery.qml</file>
+ <file alias="contents/ui/gallery/TextFieldGallery.qml">../gallery/contents/ui/gallery/TextFieldGallery.qml</file>
+ <file alias="contents/ui/ExampleApp.qml">../gallery/contents/ui/ExampleApp.qml</file>
+ <file alias="metadata.desktop">../gallery/metadata.desktop</file>
+ </qresource>
+</RCC>
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/DesktopExampleApp.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/DesktopExampleApp.qml
new file mode 100644
index 0000000..cdb7f6f
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/DesktopExampleApp.qml
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.4 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0 as Kirigami
+import "gallery"
+
+Kirigami.ApplicationWindow {
+ id: root
+
+ header: Kirigami.ToolBarApplicationHeader {}
+
+ globalDrawer: Kirigami.GlobalDrawer {
+ title: "Widget gallery"
+ titleIcon: "applications-graphics"
+ bannerImageSource: "banner.jpg"
+
+ actions: [
+ Kirigami.Action {
+ text: "Submenu 1"
+ iconName: "view-list-icons"
+ Kirigami.Action {
+ text: "Action 1"
+ onTriggered: showPassiveNotification(text + " clicked")
+ }
+ Kirigami.Action {
+ text: "Action 2"
+ onTriggered: showPassiveNotification(text + " clicked")
+ }
+ Kirigami.Action {
+ text: "Action 3"
+ onTriggered: showPassiveNotification(text + " clicked")
+ }
+ },
+ Kirigami.Action {
+ text: "Submenu 2"
+ iconName: "folder-sync"
+ Kirigami.Action {
+ text: "Action 4"
+ onTriggered: showPassiveNotification(text + " clicked")
+ }
+ Kirigami.Action {
+ text: "Action 5"
+ onTriggered: showPassiveNotification(text + " clicked")
+ }
+ },
+ Kirigami.Action {
+ text: "Checkable"
+ iconName: "view-list-details"
+ checkable: true
+ checked: false
+ onTriggered: {
+ showPassiveNotification("Action checked: " + checked)
+ }
+ },
+ Kirigami.Action {
+ text: "Open A Page"
+ iconName: "configure"
+ checkable: true
+ //Need to do this, otherwise it breaks the bindings
+ property bool current: pageStack.currentItem ? pageStack.currentItem.objectName == "settingsPage" : false
+ onCurrentChanged: {
+ checked = current;
+ }
+ onTriggered: {
+ pageStack.push(settingsComponent);
+ }
+ }
+ ]
+
+ Controls.CheckBox {
+ checked: true
+ text: "Option 1"
+ }
+ Controls.CheckBox {
+ text: "Option 2"
+ }
+ Controls.CheckBox {
+ text: "Option 3"
+ }
+ Controls.Slider {
+ Layout.fillWidth: true
+ value: 0.5
+ }
+ }
+
+ pageStack.initialPage: mainPageComponent
+
+ Component {
+ id: settingsComponent
+ Kirigami.Page {
+ title: "Settings"
+ objectName: "settingsPage"
+ Rectangle {
+ anchors.fill: parent
+ Controls.Button {
+ anchors.centerIn: parent
+ iconName: "go-previous"
+ text: "Remove Page"
+ onClicked: applicationWindow().pageStack.pop();
+ }
+ }
+ }
+ }
+
+ //Main app content
+ Component {
+ id: mainPageComponent
+ MainPage {}
+ }
+
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/ExampleApp.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/ExampleApp.qml
new file mode 100644
index 0000000..e52f320
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/ExampleApp.qml
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.4 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0 as Kirigami
+import "gallery"
+
+Kirigami.ApplicationWindow {
+ id: root
+
+ //header: Kirigami.ToolBarApplicationHeader {}
+
+ globalDrawer: Kirigami.GlobalDrawer {
+ title: "Widget gallery"
+ titleIcon: "applications-graphics"
+ bannerImageSource: "banner.jpg"
+
+ topContent: Controls.TextField {
+ anchors {
+ left: parent.left
+ right: parent.right
+ }
+ placeholderText: "Search..."
+ }
+
+ actions: [
+ Kirigami.Action {
+ text: "Submenu 1"
+ iconName: "view-list-icons"
+ Kirigami.Action {
+ text: "Action 1"
+ onTriggered: showPassiveNotification(text + " clicked")
+ }
+ Kirigami.Action {
+ text: "Action 2"
+ onTriggered: showPassiveNotification(text + " clicked")
+ }
+ Kirigami.Action {
+ text: "Action 3"
+ onTriggered: showPassiveNotification(text + " clicked")
+ }
+ },
+ Kirigami.Action {
+ text: "Submenu 2"
+ iconName: "folder-sync"
+ Kirigami.Action {
+ text: "Action 4"
+ onTriggered: showPassiveNotification(text + " clicked")
+ }
+ Kirigami.Action {
+ text: "Action 5"
+ onTriggered: showPassiveNotification(text + " clicked")
+ }
+ },
+ Kirigami.Action {
+ text: "Checkable"
+ iconName: "view-list-details"
+ checkable: true
+ checked: false
+ onTriggered: {
+ showPassiveNotification("Action checked: " + checked)
+ }
+ },
+ Kirigami.Action {
+ text: "Open A Page"
+ iconName: "configure"
+ checkable: true
+ //Need to do this, otherwise it breaks the bindings
+ property bool current: pageStack.currentItem ? pageStack.currentItem.objectName == "settingsPage" : false
+ onCurrentChanged: {
+ checked = current;
+ }
+ onTriggered: {
+ pageStack.push(settingsComponent);
+ }
+ }
+ ]
+
+ Controls.CheckBox {
+ checked: true
+ text: "Option 1"
+ }
+ Controls.CheckBox {
+ text: "Option 2"
+ }
+ Controls.CheckBox {
+ text: "Option 3"
+ }
+ Controls.Slider {
+ Layout.fillWidth: true
+ value: 0.5
+ }
+ }
+ contextDrawer: Kirigami.ContextDrawer {
+ id: contextDrawer
+ }
+
+ pageStack.initialPage: mainPageComponent
+
+ Component {
+ id: settingsComponent
+ Kirigami.Page {
+ title: "Settings"
+ objectName: "settingsPage"
+ Rectangle {
+ anchors.fill: parent
+ Controls.Button {
+ anchors.centerIn: parent
+ iconName: "go-previous"
+ text: "Remove Page"
+ onClicked: applicationWindow().pageStack.pop();
+ }
+ }
+ }
+ }
+
+ //Main app content
+ Component {
+ id: mainPageComponent
+ MainPage {}
+ }
+
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/MainPage.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/MainPage.qml
new file mode 100644
index 0000000..520c518
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/MainPage.qml
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.4 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0 as Kirigami
+
+Kirigami.ScrollablePage {
+ id: pageRoot
+
+ implicitWidth: Kirigami.Units.gridUnit * 20
+ background: Rectangle {
+ color: Kirigami.Theme.viewBackgroundColor
+ }
+
+ title: "Gallery"
+
+ //flickable: mainListView
+ actions {
+ contextualActions: [
+ Kirigami.Action {
+ text:"Action 1"
+ iconName: "document-decrypt"
+ onTriggered: showPassiveNotification("Action 1 clicked")
+ },
+ Kirigami.Action {
+ id: shareAction
+ visible: checkableAction.checked
+ text:"Action 2"
+ iconName: "document-share"
+ onTriggered: showPassiveNotification("Action 2 clicked")
+ },
+ Kirigami.Action {
+ id: checkableAction
+ text:"Checkabke"
+ checkable: true
+ iconName: "dashboard-show"
+ onCheckedChanged: showPassiveNotification("Checked: " + checked)
+ }
+ ]
+ }
+
+ ListView {
+ id: mainListView
+
+ model: ListModel {
+ ListElement {
+ text: "Button"
+ component: "Button"
+ }
+ ListElement {
+ text: "CheckBox"
+ component: "CheckBox"
+ }
+ ListElement {
+ text: "Radio Button"
+ component: "RadioButton"
+ }
+ ListElement {
+ text: "Progress Bar"
+ component: "ProgressBar"
+ }
+ ListElement {
+ text: "Slider"
+ component: "Slider"
+ }
+ ListElement {
+ text: "Switch"
+ component: "Switch"
+ }
+ ListElement {
+ text: "Text Field"
+ component: "TextField"
+ }
+ ListElement {
+ text: "Multiple Columns"
+ component: "MultipleColumns"
+ }
+ ListElement {
+ text: "List View"
+ component: "ListView"
+ }
+ ListElement {
+ text: "Non Scrollable Page"
+ component: "NonScrollable"
+ }
+ }
+ delegate: Kirigami.SwipeListItem {
+ id: listItem
+ Kirigami.Label {
+ height: Math.max(implicitHeight, Kirigami.Units.iconSizes.smallMedium)
+ anchors.verticalCenter: parent.verticalCenter
+ x: y
+ text: model.text
+ color: listItem.checked || (listItem.pressed && !listItem.checked && !listItem.sectionDelegate) ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.viewTextColor
+ }
+
+ property Item ownPage
+ onClicked: {
+ if (!model.component) {
+ return;
+ }
+ root.pageStack.pop(pageRoot);
+ ownPage = root.pageStack.push(Qt.resolvedUrl("gallery/" + model.component + "Gallery.qml"));
+ }
+ checked: ownPage && root.pageStack.lastItem == ownPage
+ actions: [
+ Kirigami.Action {
+ iconName: "document-decrypt"
+ onTriggered: showPassiveNotification(model.text + " Action 1 clicked")
+ },
+ Kirigami.Action {
+ iconName: "mail-reply-sender"
+ onTriggered: showPassiveNotification(model.text + " Action 2 clicked")
+ }]
+ }
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/banner.jpg b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/banner.jpg
new file mode 100644
index 0000000..cf08971
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/banner.jpg
Binary files differ
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ButtonGallery.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ButtonGallery.qml
new file mode 100644
index 0000000..8f148ab
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ButtonGallery.qml
@@ -0,0 +1,220 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+ScrollablePage {
+ id: page
+ Layout.fillWidth: true
+ //implicitWidth: Units.gridUnit * (Math.floor(Math.random() * 35) + 10)
+
+ title: "Buttons"
+
+ actions {
+ main: Action {
+ iconName: sheet.opened ? "dialog-cancel" : "document-edit"
+ text: "Main Action Text"
+ checked: sheet.opened
+ checkable: true
+ onCheckedChanged: sheet.opened = checked;
+ }
+ left: Action {
+ iconName: "go-previous"
+ text: "Left Action Text"
+ onTriggered: {
+ showPassiveNotification("Left action triggered")
+ }
+ }
+ right: Action {
+ iconName: "go-next"
+ text: "Right Action Text"
+ onTriggered: {
+ showPassiveNotification("Right action triggered")
+ }
+ }
+ contextualActions: [
+ Action {
+ text:"Action for buttons"
+ iconName: "bookmarks"
+ onTriggered: showPassiveNotification("Action 1 clicked")
+ },
+ Action {
+ text:"Disabled Action"
+ iconName: "folder"
+ enabled: false
+ },
+ Action {
+ text: "Action for Sheet"
+ visible: sheet.opened
+ }
+ ]
+ }
+
+
+ //Close the drawer with the back button
+ onBackRequested: {
+ if (bottomDrawer.opened) {
+ event.accepted = true;
+ bottomDrawer.close();
+ }
+ if (sheet.opened) {
+ event.accepted = true;
+ sheet.close();
+ }
+ }
+
+ OverlayDrawer {
+ id: bottomDrawer
+ anchors.fill: parent
+ edge: Qt.BottomEdge
+ contentItem: Item {
+ implicitHeight: childrenRect.height + Units.gridUnit
+ ColumnLayout {
+ anchors.centerIn: parent
+ Controls.Button {
+ text: "Button1"
+ onClicked: showPassiveNotification("Button 1 clicked")
+ }
+ Controls.Button {
+ text: "Button2"
+ onClicked: showPassiveNotification("Button 2 clicked")
+ }
+ Item {
+ Layout.minimumHeight: Units.gridUnit * 4
+ }
+ }
+ }
+ }
+
+ OverlaySheet {
+ id: sheet
+ ColumnLayout {
+ Label {
+ Layout.fillWidth: true
+ wrapMode: Text.WordWrap
+ text: "
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id risus id augue euismod accumsan. Nunc vestibulum placerat bibendum. Morbi commodo auctor varius. Donec molestie euismod ultrices. Sed facilisis augue nec eros auctor, vitae mattis quam rhoncus. Nam ut erat diam. Curabitur iaculis accumsan magna, eget fermentum massa scelerisque eu. Cras elementum erat non erat euismod accumsan. Vestibulum ac mi sed dui finibus pulvinar. Vivamus dictum, leo sed lobortis porttitor, nisl magna faucibus orci, sit amet euismod arcu elit eget est. Duis et vehicula nibh. In arcu sapien, laoreet sit amet porttitor non, rhoncus vel magna. Suspendisse imperdiet consectetur est nec ornare. Pellentesque bibendum sapien at erat efficitur vehicula. Morbi sed porta nibh. Vestibulum ut urna ut dolor sagittis mattis."
+ }
+
+ Controls.TextField {
+ Layout.alignment: Qt.AlignHCenter
+ }
+
+ Label {
+ Layout.fillWidth: true
+ wrapMode: Text.WordWrap
+ text: "
+ Morbi dictum, sapien at maximus pulvinar, sapien metus condimentum magna, quis lobortis nisi dui mollis turpis. Aliquam sit amet scelerisque dui. In sit amet tellus placerat, condimentum enim sed, hendrerit quam. Integer dapibus lobortis finibus. Suspendisse faucibus eros vitae ante posuere blandit. Nullam volutpat quam id diam hendrerit aliquam. Donec non sem at diam posuere convallis. Vivamus ut congue quam. Ut dictum fermentum sapien, eu ultricies est ornare ut.
+
+ Nullam fringilla a libero vehicula faucibus. Donec euismod sodales nulla, in vehicula lectus posuere a. Donec nisi nulla, pulvinar eu porttitor vitae, varius eget ante. Nam rutrum eleifend elit, quis facilisis leo sodales vitae. Aenean accumsan a nulla at sagittis. Integer placerat tristique magna, vitae iaculis ante cursus sit amet. Sed facilisis mollis turpis nec tristique. Etiam quis feugiat odio. Vivamus sagittis at purus nec aliquam.
+
+ Morbi neque dolor, elementum ac fermentum ac, auctor ut erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus non nibh sit amet quam luctus congue. Donec in eros varius, porta metus sed, sagittis lacus. Mauris dapibus lorem nisi, non eleifend massa tristique egestas. Curabitur nec blandit urna. Mauris rhoncus libero felis, commodo viverra ante consectetur vel. Donec dictum tincidunt orci, quis tristique urna. Quisque egestas, dui ac mollis dictum, purus velit elementum est, at pellentesque erat est fermentum purus. Nulla a quam tellus. Vestibulum a congue ligula. Quisque feugiat nulla et tortor sodales viverra. Maecenas dolor leo, elementum sed urna vel, posuere hendrerit metus. Mauris pellentesque, mi non luctus aliquam, leo nulla varius arcu, vel pulvinar enim enim nec nisl.
+
+ Etiam sapien leo, venenatis eget justo at, pellentesque mollis tellus. Fusce consequat ullamcorper vulputate. Duis tellus nisi, dictum ut augue non, elementum congue ligula. Fusce in vehicula arcu. Nulla facilisi. Quisque a convallis sapien. Aenean pellentesque convallis egestas. Phasellus rhoncus, nulla in tempor maximus, arcu ex venenatis diam, sit amet egestas mi dolor non ante. "
+ }
+ Controls.Button {
+ text: "Close"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: sheet.close()
+ }
+ }
+ }
+ ColumnLayout {
+ width: page.width
+ spacing: Units.smallSpacing
+
+ Controls.Button {
+ text: "Open Bottom drawer"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: bottomDrawer.open()
+ }
+ Controls.Button {
+ text: "Open Sheet"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: sheet.open()
+ }
+ Controls.Button {
+ text: "Toggle Action Button"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: mainAction.visible = !mainAction.visible;
+ }
+ Controls.Button {
+ text: "Show Passive Notification"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: showPassiveNotification("This is a passive message", 3000);
+ }
+ Controls.Button {
+ text: "Passive Notification Action"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: showPassiveNotification("This is a passive message", "long", "Action", function() {showPassiveNotification("Passive notification action clicked")});
+ }
+ Controls.ToolButton {
+ text: "Toggle controls"
+ checkable: true
+ checked: true
+ anchors.horizontalCenter: parent.horizontalCenter
+ onCheckedChanged: applicationWindow().controlsVisible = checked
+ }
+ Controls.Button {
+ text: "Disabled Button"
+ enabled: false
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: showPassiveNotification("clicked")
+ }
+ Controls.ToolButton {
+ text: "Tool Button"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: showPassiveNotification(text + " clicked")
+ }
+ Controls.ToolButton {
+ text: "Tool Button non flat"
+ property bool flat: false
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: showPassiveNotification(text + " clicked")
+ }
+ Controls.ToolButton {
+ iconName: "go-previous"
+ property bool flat: false
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: showPassiveNotification("Button clicked")
+ }
+ Row {
+ spacing: 0
+ anchors.horizontalCenter: parent.horizontalCenter
+ Controls.ToolButton {
+ iconName: "edit-cut"
+ property bool flat: false
+ onClicked: showPassiveNotification("Cut clicked")
+ }
+ Controls.ToolButton {
+ iconName: "edit-copy"
+ property bool flat: false
+ onClicked: showPassiveNotification("Copy clicked")
+ }
+ Controls.ToolButton {
+ iconName: "edit-paste"
+ property bool flat: false
+ onClicked: showPassiveNotification("Paste clicked")
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/CheckBoxGallery.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/CheckBoxGallery.qml
new file mode 100644
index 0000000..8ac50c6
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/CheckBoxGallery.qml
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+ScrollablePage {
+ id: page
+ actions {
+ main: Action {
+ iconName: sheet.opened ? "dialog-cancel" : "document-edit"
+ text: "Main Action Text"
+ checked: sheet.opened
+ checkable: true
+ onCheckedChanged: sheet.opened = checked;
+ }
+ contextualActions: [
+ Controls.Action {
+ text:"Action 1"
+ onTriggered: showPassiveNotification("Action 1 clicked")
+ },
+ Controls.Action {
+ text:"Action 2"
+ onTriggered: showPassiveNotification("Action 2 clicked")
+ }
+ ]
+ }
+
+ Layout.fillWidth: true
+ title: "Checkboxes"
+
+ OverlaySheet {
+ id: sheet
+ Label {
+ property int implicitWidth: Units.gridUnit * 45
+ wrapMode: Text.WordWrap
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id risus id augue euismod accumsan. Nunc vestibulum placerat bibendum. Morbi commodo auctor varius. Donec molestie euismod ultrices. Sed facilisis augue nec eros auctor, vitae mattis quam rhoncus. Nam ut erat diam. Curabitur iaculis accumsan magna, eget fermentum massa scelerisque eu. Cras elementum erat non erat euismod accumsan. Vestibulum ac mi sed dui finibus pulvinar. Vivamus dictum, leo sed lobortis porttitor, nisl magna faucibus orci, sit amet euismod arcu elit eget est. Duis et vehicula nibh. In arcu sapien, laoreet sit amet porttitor non, rhoncus vel magna. Suspendisse imperdiet consectetur est nec ornare. Pellentesque bibendum sapien at erat efficitur vehicula. Morbi sed porta nibh. Vestibulum ut urna ut dolor sagittis mattis."
+ }
+ }
+
+ ColumnLayout {
+ //This OverlaySheet is put in the "wrong place", but will be automatically reparented
+ // to "page"
+
+ Item {
+ Layout.fillWidth: true
+ Layout.minimumHeight: units.gridUnit * 10
+ GridLayout {
+ anchors.centerIn: parent
+ columns: 3
+ rows: 3
+ rowSpacing: Units.smallSpacing
+
+ Item {
+ width: 1
+ height: 1
+ }
+ Label {
+ text: "Normal"
+ }
+ Label {
+ text: "Disabled"
+ enabled: false
+ }
+ Label {
+ text: "On"
+ }
+ Controls.CheckBox {
+ text: "On"
+ checked: true
+ }
+ Controls.CheckBox {
+ text: "On"
+ checked: true
+ enabled: false
+ }
+ Label {
+ text: "Off"
+ }
+ Controls.CheckBox {
+ text: "Off"
+ checked: false
+ }
+ Controls.CheckBox {
+ text: "Off"
+ checked: false
+ enabled: false
+ }
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ListViewGallery.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ListViewGallery.qml
new file mode 100644
index 0000000..d605cb9
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ListViewGallery.qml
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+ScrollablePage {
+ id: page
+ Layout.fillWidth: true
+ title: "Long List view"
+
+ supportsRefreshing: true
+ onRefreshingChanged: {
+ if (refreshing) {
+ refreshRequestTimer.running = true;
+ } else {
+ showPassiveNotification("Example refreshing completed")
+ }
+ }
+
+ background: Rectangle {
+ color: Theme.viewBackgroundColor
+ }
+
+ ListView {
+ Timer {
+ id: refreshRequestTimer
+ interval: 3000
+ onTriggered: page.refreshing = false
+ }
+ model: 200
+ delegate: BasicListItem {
+ label: "Item " + modelData
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/MultipleColumnsGallery.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/MultipleColumnsGallery.qml
new file mode 100644
index 0000000..47ec5f6
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/MultipleColumnsGallery.qml
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+ScrollablePage {
+ id: page
+ Layout.fillWidth: true
+ //implicitWidth: Units.gridUnit * (Math.floor(Math.random() * 35) + 8)
+
+ title: "Multiple Columns"
+
+ actions {
+ main: Action {
+ iconName: "document-edit"
+ text: "Main Action Text"
+ onTriggered: {
+ showPassiveNotification("Action button in buttons page clicked");
+ }
+ }
+ left: Action {
+ iconName: "go-previous"
+ text: "Left Action Text"
+ onTriggered: {
+ showPassiveNotification("Left action triggered")
+ }
+ }
+ right: Action {
+ iconName: "go-next"
+ text: "Right Action Text"
+ onTriggered: {
+ showPassiveNotification("Right action triggered")
+ }
+ }
+ contextualActions: [
+ Action {
+ text:"Action 1"
+ iconName: "bookmarks"
+ onTriggered: showPassiveNotification("Action 1 clicked")
+ },
+ Action {
+ text:"Action 2"
+ iconName: "folder"
+ enabled: false
+ onTriggered: showPassiveNotification("Action 2 clicked")
+ }
+ ]
+ }
+
+ ColumnLayout {
+ width: page.width
+ spacing: Units.smallSpacing
+
+ Label {
+ Layout.fillWidth: true
+ wrapMode: Text.WordWrap
+ text: "This page is used to test multiple columns: you can push and pop an arbitrary number of pages, each new page will have a random implicit width between 8 and 35 grid units.\nIf you enlarge the window enough, you can test how the application behaves with multiple columns."
+ }
+ Item {
+ Layout.minimumWidth: Units.gridUnit *2
+ Layout.minimumHeight: Layout.minimumWidth
+ }
+ Label {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "Page implicitWidth: " + page.implicitWidth
+ }
+ Controls.Button {
+ text: "Push Another Page"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: pageStack.push(Qt.resolvedUrl("MultipleColumnsGallery.qml"));
+ }
+ Controls.Button {
+ text: "Pop A Page"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: pageStack.pop();
+ }
+ RowLayout {
+ anchors.horizontalCenter: parent.horizontalCenter
+ Controls.TextField {
+ id: edit
+ text: page.title
+ }
+ Controls.Button {
+ text: "Rename Page"
+ onClicked: page.title = edit.text;
+ }
+ }
+ }
+
+
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/NonScrollableGallery.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/NonScrollableGallery.qml
new file mode 100644
index 0000000..ed6ddab
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/NonScrollableGallery.qml
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+Page {
+ id: page
+ Layout.fillWidth: true
+ title: "Simple Page"
+
+ actions {
+ main: Action {
+ iconName: sheet.opened ? "dialog-cancel" : "document-edit"
+ text: "Main Action Text"
+ checked: sheet.opened
+ checkable: true
+ onCheckedChanged: sheet.opened = checked;
+ }
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: "red"
+ Label {
+ anchors.centerIn: parent
+ text: "Rectangle with automatic margins"
+ }
+ }
+
+ OverlaySheet {
+ id: sheet
+ Label {
+ property int implicitWidth: Units.gridUnit * 30
+ wrapMode: Text.WordWrap
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id risus id augue euismod accumsan. Nunc vestibulum placerat bibendum. Morbi commodo auctor varius. Donec molestie euismod ultrices. Sed facilisis augue nec eros auctor, vitae mattis quam rhoncus. Nam ut erat diam. Curabitur iaculis accumsan magna, eget fermentum massa scelerisque eu. Cras elementum erat non erat euismod accumsan. Vestibulum ac mi sed dui finibus pulvinar. Vivamus dictum, leo sed lobortis porttitor, nisl magna faucibus orci, sit amet euismod arcu elit eget est. Duis et vehicula nibh. In arcu sapien, laoreet sit amet porttitor non, rhoncus vel magna. Suspendisse imperdiet consectetur est nec ornare. Pellentesque bibendum sapien at erat efficitur vehicula. Morbi sed porta nibh. Vestibulum ut urna ut dolor sagittis mattis."
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ProgressBarGallery.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ProgressBarGallery.qml
new file mode 100644
index 0000000..3b76999
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/ProgressBarGallery.qml
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+ScrollablePage {
+ id: page
+ Layout.fillWidth: true
+
+ title: "Progress Indicators"
+
+ actions {
+ main: Action {
+ iconName: "document-edit"
+ text: "Main Action Text"
+ onTriggered: {
+ showPassiveNotification("Main action triggered");
+ }
+ }
+ right: Action {
+ iconName: "folder-sync"
+ text: "Right Action Text"
+ onTriggered: {
+ showPassiveNotification("Right action triggered")
+ }
+ }
+ }
+
+ ColumnLayout {
+ width: page.width
+ Timer {
+ id: timer
+ property int value: 0
+ interval: 80
+ repeat: true
+ running: true
+ onTriggered: {
+ value = (value + 1) % 100
+ }
+ }
+
+ GridLayout {
+ anchors.centerIn: parent
+ rowSpacing: Units.largeSpacing
+ columns: 2
+ width: parent.width - units.gridUnit*2
+
+ Label {
+ text: "Determinate:"
+ Layout.alignment: Qt.AlignRight
+ }
+ Controls.ProgressBar {
+ minimumValue: 0
+ maximumValue: 100
+ value: timer.value
+ Layout.maximumWidth: units.gridUnit * 10
+ }
+ Label {
+ text: "Indeterminate:"
+ Layout.alignment: Qt.AlignRight
+ }
+ Controls.ProgressBar {
+ minimumValue: 0
+ maximumValue: 100
+ indeterminate: true
+ Layout.maximumWidth: units.gridUnit * 10
+ }
+ Label {
+ text: "Busy indicator:"
+ Layout.alignment: Qt.AlignRight
+ }
+ Controls.BusyIndicator {
+
+ }
+ Label {
+ text: "Inactive indicator:"
+ Layout.alignment: Qt.AlignRight
+ }
+ Controls.BusyIndicator {
+ running: false
+ }
+ Label {
+ text: "Custom size:"
+ Layout.alignment: Qt.AlignRight
+ }
+ Controls.BusyIndicator {
+ Layout.minimumWidth: Units.iconSizes.enormous
+ Layout.minimumHeight: width
+ }
+ Label {
+ text: "Vertical:"
+ Layout.alignment: Qt.AlignRight
+ }
+ RowLayout {
+ Controls.ProgressBar {
+ Layout.minimumWidth: Units.gridUnit * 2
+ Layout.maximumHeight: Units.gridUnit * 8
+ minimumValue: 0
+ maximumValue: 100
+ value: timer.value
+ orientation: Qt.Vertical
+ }
+ Controls.ProgressBar {
+ Layout.minimumWidth: Units.gridUnit * 2
+ Layout.maximumHeight: Units.gridUnit * 8
+ indeterminate: true
+ orientation: Qt.Vertical
+ }
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/RadioButtonGallery.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/RadioButtonGallery.qml
new file mode 100644
index 0000000..c44e903
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/RadioButtonGallery.qml
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+ScrollablePage {
+ id: page
+ Layout.fillWidth: true
+
+ title: "Radio buttons"
+ actions {
+ main: Action {
+ iconName: "document-edit"
+ text: "Main Action Text"
+ onTriggered: {
+ showPassiveNotification("Action button in buttons page clicked");
+ }
+ }
+ left: Action {
+ iconName: "folder-sync"
+ text: "Left Action Text"
+ onTriggered: {
+ showPassiveNotification("Left action triggered")
+ }
+ }
+ }
+
+
+ ColumnLayout {
+ width: page.width
+ Controls.ExclusiveGroup {
+ id: radioGroup
+ }
+ Controls.ExclusiveGroup {
+ id: radioGroup2
+ }
+
+ Item {
+ Layout.fillWidth: true
+ Layout.minimumHeight: units.gridUnit * 10
+ GridLayout {
+ anchors.centerIn: parent
+ columns: 3
+ rows: 3
+ rowSpacing: Units.smallSpacing
+
+ Item {
+ width: 1
+ height: 1
+ }
+ Label {
+ text: "Normal"
+ }
+ Label {
+ text: "Disabled"
+ enabled: false
+ }
+ Label {
+ text: "On"
+ }
+ Controls.RadioButton {
+ text: "On"
+ checked: true
+ exclusiveGroup: radioGroup
+ }
+ Controls.RadioButton {
+ text: "On"
+ checked: true
+ enabled: false
+ exclusiveGroup: radioGroup2
+ }
+ Label {
+ text: "Off"
+ }
+ Controls.RadioButton {
+ text: "Off"
+ checked: false
+ exclusiveGroup: radioGroup
+ }
+ Controls.RadioButton {
+ text: "Off"
+ checked: false
+ enabled: false
+ exclusiveGroup: radioGroup2
+ }
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/SliderGallery.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/SliderGallery.qml
new file mode 100644
index 0000000..08100ca
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/SliderGallery.qml
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+ScrollablePage {
+ id: page
+ Layout.fillWidth: true
+
+ title: "Sliders"
+
+ actions {
+ left: Action {
+ iconName: "folder-sync"
+ text: "Left Action Text"
+ onTriggered: {
+ showPassiveNotification("Left action triggered")
+ }
+ }
+ right: Action {
+ iconName: "configure"
+ text: "Right Action Text"
+ onTriggered: {
+ showPassiveNotification("Right action triggered")
+ }
+ }
+ }
+
+ ColumnLayout {
+ width: page.width
+
+ Item {
+ Layout.fillWidth: true
+ Layout.minimumHeight: Units.gridUnit * 20
+ ColumnLayout {
+ anchors.centerIn: parent
+ spacing: Units.smallSpacing
+
+ Label {
+ text: "Normal:"
+ }
+ Controls.Slider {
+ Layout.minimumWidth: Units.gridUnit * 15
+ value: 2
+ maximumValue: 5.0
+ }
+ Label {
+ text: "Disabled:"
+ }
+ Controls.Slider {
+ enabled: false
+ Layout.minimumWidth: Units.gridUnit * 15
+ value: 2
+ maximumValue: 5.0
+ }
+ Label {
+ text: "Thickmarks:"
+ }
+ Controls.Slider {
+ Layout.minimumWidth: Units.gridUnit * 15
+ tickmarksEnabled: true
+ maximumValue: 5.0
+ stepSize: 1.0
+ value: 3
+ }
+ Label {
+ text: "Vertical:"
+ }
+ RowLayout {
+ Layout.alignment: Qt.AlignHCenter
+ Controls.Slider {
+ Layout.minimumWidth: 2
+ Layout.minimumHeight: Units.gridUnit * 10
+ value: 2
+ maximumValue: 5.0
+ orientation: Qt.Vertical
+ }
+ Controls.Slider {
+ Layout.minimumWidth: 2
+ Layout.minimumHeight: Units.gridUnit * 10
+ value: 3
+ tickmarksEnabled: true
+ maximumValue: 5.0
+ stepSize: 1.0
+ orientation: Qt.Vertical
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/SwitchGallery.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/SwitchGallery.qml
new file mode 100644
index 0000000..f44b32d
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/SwitchGallery.qml
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+ScrollablePage {
+ id: page
+ Layout.fillWidth: true
+ title: "Switches"
+
+ ColumnLayout {
+ width: page.width
+
+ Item {
+ Layout.fillWidth: true
+ Layout.minimumHeight: units.gridUnit * 10
+ GridLayout {
+ anchors.centerIn: parent
+ columns: 3
+ rows: 3
+ rowSpacing: Units.smallSpacing
+
+ Item {
+ width: 1
+ height: 1
+ }
+ Label {
+ text: "Normal"
+ }
+ Label {
+ text: "Disabled"
+ enabled: false
+ }
+ Label {
+ text: "On"
+ }
+ Controls.Switch {
+ checked: true
+ }
+ Controls.Switch {
+ checked: true
+ enabled: false
+ }
+ Label {
+ text: "Off"
+ }
+ Controls.Switch {
+ checked: false
+ }
+ Controls.Switch {
+ checked: false
+ enabled: false
+ }
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/TextFieldGallery.qml b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/TextFieldGallery.qml
new file mode 100644
index 0000000..d069918
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/contents/ui/gallery/TextFieldGallery.qml
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+ScrollablePage {
+ id: page
+ Layout.fillWidth: true
+ implicitWidth: applicationWindow().width
+ title: "Text fields"
+
+ ColumnLayout {
+ objectName: "pollo"
+ width: page.width
+ spacing: Units.smallSpacing
+
+ Label {
+ text: "Placeholder text:"
+ }
+ Controls.TextField {
+ placeholderText: "Search..."
+ Layout.alignment: Qt.AlignHCenter
+ }
+ Label {
+ text: "Disabled field:"
+ }
+ Controls.TextField {
+ text: "Disabled"
+ enabled: false
+ Layout.alignment: Qt.AlignHCenter
+ }
+ Label {
+ text: "Password:"
+ }
+ Controls.TextField {
+ echoMode: TextInput.Password
+ Layout.alignment: Qt.AlignHCenter
+ }
+ Label {
+ text: "Text area:"
+ }
+ Controls.TextArea {
+ Layout.fillWidth: true
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eu nisl ac nibh malesuada pretium ut sit amet libero. Nulla libero arcu, pharetra a dignissim nec, iaculis sit amet metus. Suspendisse quis justo efficitur, pharetra dui maximus, aliquam dolor. Vestibulum vel imperdiet turpis. Mauris ut leo mauris. Praesent ut libero sollicitudin, tincidunt nisi a, efficitur erat. Curabitur lacinia leo et tempor aliquam."
+ Layout.minimumWidth: Units.gridUnit * 12
+ Layout.minimumHeight: Units.gridUnit * 12
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/gallery/metadata.desktop b/kstars/kstarslite/kirigami-lib/examples/gallery/metadata.desktop
new file mode 100644
index 0000000..4a96e36
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/gallery/metadata.desktop
@@ -0,0 +1,18 @@
+[Desktop Entry]
+Name=Kirigami Gallery
+
+Encoding=UTF-8
+Type=Application
+Exec=kpackagelauncherqml -a org.kde.kirigami.gallery
+Icon=preferences-desktop-theme
+X-KDE-ParentApp=
+X-KDE-PluginInfo-Author=Marco Martin
+X-KDE-PluginInfo-Email=mart@kde.org
+X-KDE-PluginInfo-Name=org.kde.kirigami.gallery
+X-KDE-PluginInfo-Version=1.0
+X-KDE-PluginInfo-Website=http://kde.org
+X-KDE-PluginInfo-Category=Graphics
+X-KDE-PluginInfo-Depends=
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
+X-Plasma-MainScript=ui/ExampleApp.qml
diff --git a/kstars/kstarslite/kirigami-lib/examples/simpleexamples/AbstractApplicationWindow.qml b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/AbstractApplicationWindow.qml
new file mode 100644
index 0000000..c27a614
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/AbstractApplicationWindow.qml
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.4 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0 as Kirigami
+
+Kirigami.AbstractApplicationWindow {
+ id: root
+ width: 500
+ height: 800
+ visible: true
+
+ globalDrawer: Kirigami.GlobalDrawer {
+ title: "Widget gallery"
+ titleIcon: "applications-graphics"
+
+ actions: [
+ Kirigami.Action {
+ text: "View"
+ iconName: "view-list-icons"
+ Kirigami.Action {
+ text: "action 1"
+ }
+ Kirigami.Action {
+ text: "action 2"
+ }
+ Kirigami.Action {
+ text: "action 3"
+ }
+ },
+ Kirigami.Action {
+ text: "Sync"
+ iconName: "folder-sync"
+ Kirigami.Action {
+ text: "action 4"
+ }
+ Kirigami.Action {
+ text: "action 5"
+ }
+ },
+ Kirigami.Action {
+ text: "Checkable"
+ iconName: "view-list-details"
+ checkable: true
+ checked: false
+ onTriggered: {
+ print("Action checked:" + checked)
+ }
+ },
+ Kirigami.Action {
+ text: "Settings"
+ iconName: "configure"
+ checkable: true
+ //Need to do this, otherwise it breaks the bindings
+ property bool current: pageStack.currentItem ? pageStack.currentItem.objectName == "settingsPage" : false
+ onCurrentChanged: {
+ checked = current;
+ }
+ onTriggered: {
+ pageStack.push(settingsComponent);
+ }
+ }
+ ]
+
+ Controls.CheckBox {
+ checked: true
+ text: "Option 1"
+ }
+ Controls.CheckBox {
+ text: "Option 2"
+ }
+ Controls.CheckBox {
+ text: "Option 3"
+ }
+ Controls.Slider {
+ Layout.fillWidth: true
+ value: 0.5
+ }
+ }
+ contextDrawer: Kirigami.ContextDrawer {
+ id: contextDrawer
+ }
+
+ header: Kirigami.ApplicationHeader {}
+
+ pageStack: Controls.StackView {
+ anchors.fill: parent
+ property int currentIndex: 0
+ focus: true
+ onCurrentIndexChanged: {
+ if (depth > currentIndex+1) {
+ pop(get(currentIndex));
+ }
+ }
+ onDepthChanged: {
+ currentIndex = depth-1;
+ }
+ initialItem: mainPageComponent
+
+ Keys.onReleased: {
+ if (event.key == Qt.Key_Back ||
+ (event.key === Qt.Key_Left && (event.modifiers & Qt.AltModifier))) {
+ event.accepted = true;
+ if (root.contextDrawer && root.contextDrawer.opened) {
+ root.contextDrawer.close();
+ } else if (root.globalDrawer && root.globalDrawer.opened) {
+ root.globalDrawer.close();
+ } else {
+ var backEvent = {accepted: false}
+ if (root.pageStack.currentIndex >= 1) {
+ root.pageStack.currentItem.backRequested(backEvent);
+ if (!backEvent.accepted) {
+ if (root.pageStack.depth > 1) {
+ root.pageStack.currentIndex = Math.max(0, root.pageStack.currentIndex - 1);
+ backEvent.accepted = true;
+ } else {
+ Qt.quit();
+ }
+ }
+ }
+
+ if (!backEvent.accepted) {
+ Qt.quit();
+ }
+ }
+ }
+ }
+ }
+
+
+ Component {
+ id: settingsComponent
+ Kirigami.Page {
+ title: "Settings"
+ objectName: "settingsPage"
+ Rectangle {
+ anchors.fill: parent
+ }
+ }
+ }
+
+ //Main app content
+ Component {
+ id: mainPageComponent
+ MultipleColumnsGallery {}
+ }
+
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/simpleexamples/FixedSidebar.qml b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/FixedSidebar.qml
new file mode 100644
index 0000000..74bbc69
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/FixedSidebar.qml
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.4 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0 as Kirigami
+
+Kirigami.ApplicationWindow {
+ id: root
+ width: Kirigami.Units.gridUnit * 60
+ height: Kirigami.Units.gridUnit * 40
+
+
+ pageStack.initialPage: mainPageComponent
+ globalDrawer: Kirigami.OverlayDrawer {
+ opened: true
+ modal: false
+ contentItem: Item {
+ implicitWidth: Kirigami.Units.gridUnit * 10
+
+ Kirigami.Label {
+ text: "This is a sidebar"
+ width: parent.width - Kirigami.Units.smallSpacing * 2
+ wrapMode: Text.WordWrap
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+
+ }
+ }
+
+ //Main app content
+ Component {
+ id: mainPageComponent
+ MultipleColumnsGallery {}
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/simpleexamples/MultipleColumnsGallery.qml b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/MultipleColumnsGallery.qml
new file mode 100644
index 0000000..965f9f3
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/MultipleColumnsGallery.qml
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtQuick.Controls 1.2 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+ScrollablePage {
+ id: page
+ Layout.fillWidth: true
+ implicitWidth: Units.gridUnit * (Math.floor(Math.random() * 35) + 8)
+
+ title: "Multiple Columns"
+
+ actions {
+ contextualActions: [
+ Action {
+ text:"Action for buttons"
+ iconName: "bookmarks"
+ onTriggered: print("Action 1 clicked")
+ },
+ Action {
+ text:"Action 2"
+ iconName: "folder"
+ enabled: false
+ }
+ ]
+ }
+
+ ColumnLayout {
+ width: page.width
+ spacing: Units.smallSpacing
+
+ Label {
+ Layout.fillWidth: true
+ wrapMode: Text.WordWrap
+ text: "This page is used to test multiple columns: you can push and pop an arbitrary number of pages, each new page will have a random implicit width between 8 and 35 grid units.\nIf you enlarge the window enough, you can test how the application behaves with multiple columns."
+ }
+ Item {
+ Layout.minimumWidth: Units.gridUnit *2
+ Layout.minimumHeight: Layout.minimumWidth
+ }
+ Label {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "Page implicitWidth: " + page.implicitWidth
+ }
+ Controls.Button {
+ text: "Push Another Page"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: pageStack.push(Qt.resolvedUrl("MultipleColumnsGallery.qml"));
+ }
+ Controls.Button {
+ text: "Pop A Page"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: pageStack.pop();
+ }
+ RowLayout {
+ anchors.horizontalCenter: parent.horizontalCenter
+ Controls.TextField {
+ id: edit
+ text: page.title
+ }
+ Controls.Button {
+ text: "Rename Page"
+ onClicked: page.title = edit.text;
+ }
+ }
+ }
+
+
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/simpleexamples/SplitDrawer.qml b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/SplitDrawer.qml
new file mode 100644
index 0000000..7dae1bd
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/SplitDrawer.qml
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.4 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0 as Kirigami
+
+Kirigami.ApplicationWindow {
+ id: root
+ width: Kirigami.Units.gridUnit * 60
+ height: Kirigami.Units.gridUnit * 40
+
+
+ pageStack.initialPage: mainPageComponent
+ globalDrawer: Kirigami.SplitDrawer {
+ id: drawer
+ opened: true
+ //modal: false
+ contentItem: Column {
+ //implicitWidth: Kirigami.Units.gridUnit * 10
+
+ Kirigami.Label {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "This is a sidebar"
+ width: parent.width - Kirigami.Units.smallSpacing * 2
+ wrapMode: Text.WordWrap
+ }
+ Controls.Button {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "Modal Drawer"
+ checkable: true
+ checked: true
+ onCheckedChanged: drawer.modal = checked
+ }
+ }
+ }
+
+ //Main app content
+ Component {
+ id: mainPageComponent
+ MultipleColumnsGallery {}
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/simpleexamples/TabBarHeader.qml b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/TabBarHeader.qml
new file mode 100644
index 0000000..b6652cf
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/TabBarHeader.qml
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.4 as Controls
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0 as Kirigami
+
+Kirigami.ApplicationWindow {
+ id: root
+ width: 500
+ height: 800
+ visible: true
+
+
+ header: Kirigami.ApplicationHeader {
+ separatorStyle: "TabBar"
+ }
+
+
+
+ pageStack.initialPage: mainPageComponent
+
+
+ Component.onCompleted: {
+ pageStack.push(mainPageComponent);
+ pageStack.push(mainPageComponent);
+ pageStack.currentIndex = 0;
+ }
+
+ //Main app content
+ Component {
+ id: mainPageComponent
+ MultipleColumnsGallery {}
+ }
+
+}
diff --git a/kstars/kstarslite/kirigami-lib/examples/simpleexamples/minimal.qml b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/minimal.qml
new file mode 100644
index 0000000..dee1290
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/examples/simpleexamples/minimal.qml
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import org.kde.kirigami 1.0 as Kirigami
+
+Kirigami.ApplicationWindow {
+ id: root
+
+ globalDrawer: Kirigami.GlobalDrawer {
+ title: "Hello App"
+ titleIcon: "applications-graphics"
+
+ actions: [
+ Kirigami.Action {
+ text: "View"
+ iconName: "view-list-icons"
+ Kirigami.Action {
+ text: "action 1"
+ }
+ Kirigami.Action {
+ text: "action 2"
+ }
+ Kirigami.Action {
+ text: "action 3"
+ }
+ },
+ Kirigami.Action {
+ text: "action 3"
+ },
+ Kirigami.Action {
+ text: "action 4"
+ }
+ ]
+ }
+ contextDrawer: Kirigami.ContextDrawer {
+ id: contextDrawer
+ }
+
+ pageStack.initialPage: mainPageComponent
+
+ Component {
+ id: mainPageComponent
+ Kirigami.ScrollablePage {
+ title: "Hello"
+ Rectangle {
+ anchors.fill: parent
+ }
+ }
+ }
+
+
+}
diff --git a/kstars/kstarslite/kirigami-lib/kirigami.pri b/kstars/kstarslite/kirigami-lib/kirigami.pri
new file mode 100644
index 0000000..fc88c4c
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/kirigami.pri
@@ -0,0 +1,12 @@
+
+QT += qml quick gui svg
+HEADERS += $$PWD/src/kirigamiplugin.h
+SOURCES += $$PWD/src/kirigamiplugin.cpp
+INCLUDEPATH += $$PWD/src
+DEFINES += KIRIGAMI_BUILD_TYPE_STATIC
+
+API_VER=1.0
+
+RESOURCES += $$PWD/kirigami.qrc
+
+#QML_IMPORT_PATH += $$PWD
diff --git a/kstars/kstarslite/kirigami-lib/kirigami.pro b/kstars/kstarslite/kirigami-lib/kirigami.pro
new file mode 100644
index 0000000..6181287
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/kirigami.pro
@@ -0,0 +1,28 @@
+TEMPLATE = lib
+CONFIG += plugin
+
+QT += qml quick gui svg
+HEADERS += $$PWD/src/kirigamiplugin.h
+SOURCES += $$PWD/src/kirigamiplugin.cpp
+
+API_VER=1.0
+
+TARGET = $$qtLibraryTarget(org/kde/kirigamiplugin)
+
+importPath = $$[QT_INSTALL_QML]/org/kde/kirigami
+target.path = $${importPath}
+
+controls.path = $${importPath}
+controls.files += $$PWD/src/controls/*
+
+#For now ignore Desktop and Plasma stuff in qmake
+#styles.path = $${importPath}/styles
+#styles.files += $$PWD/src/styles/*
+
+INSTALLS += target controls
+
+
+
+
+
+
diff --git a/kstars/kstarslite/kirigami-lib/kirigami.qrc b/kstars/kstarslite/kirigami-lib/kirigami.qrc
new file mode 100644
index 0000000..d59205c
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/kirigami.qrc
@@ -0,0 +1,47 @@
+<RCC>
+ <qresource prefix="/">
+ <file alias="AbstractApplicationWindow.qml">src/controls/AbstractApplicationWindow.qml</file>
+ <file alias="ContextDrawer.qml">src/controls/ContextDrawer.qml</file>
+ <file alias="Action.qml">src/controls/Action.qml</file>
+ <file alias="Page.qml">src/controls/Page.qml</file>
+ <file alias="AbstractListItem.qml">src/controls/AbstractListItem.qml</file>
+ <file alias="SplitDrawer.qml">src/controls/SplitDrawer.qml</file>
+ <file alias="Theme.qml">src/controls/Theme.qml</file>
+ <file alias="private/RefreshableScrollView.qml">src/controls/private/RefreshableScrollView.qml</file>
+ <file alias="private/CornerShadow.qml">src/controls/private/CornerShadow.qml</file>
+ <file alias="private/ActionButton.qml">src/controls/private/ActionButton.qml</file>
+ <file alias="private/DefaultListItemBackground.qml">src/controls/private/DefaultListItemBackground.qml</file>
+ <file alias="private/EdgeShadow.qml">src/controls/private/EdgeShadow.qml</file>
+ <file alias="private/PageActionPropertyGroup.qml">src/controls/private/PageActionPropertyGroup.qml</file>
+ <file alias="OverlayDrawer.qml">src/controls/OverlayDrawer.qml</file>
+ <file alias="OverlaySheet.qml">src/controls/OverlaySheet.qml</file>
+ <file alias="GlobalDrawer.qml">src/controls/GlobalDrawer.qml</file>
+ <file alias="templates/AbstractListItem.qml">src/controls/templates/AbstractListItem.qml</file>
+ <file alias="templates/SplitDrawer.qml">src/controls/templates/SplitDrawer.qml</file>
+ <file alias="templates/private/MenuIcon.qml">src/controls/templates/private/MenuIcon.qml</file>
+ <file alias="templates/private/PassiveNotification.qml">src/controls/templates/private/PassiveNotification.qml</file>
+ <file alias="templates/private/PageRow.qml">src/controls/templates/private/PageRow.qml</file>
+ <file alias="templates/private/ContextIcon.qml">src/controls/templates/private/ContextIcon.qml</file>
+ <file alias="templates/private/AbstractDrawer.qml">src/controls/templates/private/AbstractDrawer.qml</file>
+ <file alias="templates/private/BackButton.qml">src/controls/templates/private/BackButton.qml</file>
+ <file alias="templates/OverlayDrawer.qml">src/controls/templates/OverlayDrawer.qml</file>
+ <file alias="templates/OverlaySheet.qml">src/controls/templates/OverlaySheet.qml</file>
+ <file alias="templates/SwipeListItem.qml">src/controls/templates/SwipeListItem.qml</file>
+ <file alias="templates/ApplicationHeader.qml">src/controls/templates/ApplicationHeader.qml</file>
+ <file alias="templates/AbstractApplicationHeader.qml">src/controls/templates/AbstractApplicationHeader.qml</file>
+ <file alias="Units.qml">src/controls/Units.qml</file>
+ <file alias="SwipeListItem.qml">src/controls/SwipeListItem.qml</file>
+ <file alias="ApplicationWindow.qml">src/controls/ApplicationWindow.qml</file>
+ <file alias="ApplicationHeader.qml">src/controls/ApplicationHeader.qml</file>
+ <file alias="Heading.qml">src/controls/Heading.qml</file>
+ <file alias="ScrollablePage.qml">src/controls/ScrollablePage.qml</file>
+ <file alias="Icon.qml">src/controls/Icon.qml</file>
+ <file alias="Label.qml">src/controls/Label.qml</file>
+ <file alias="BasicListItem.qml">src/controls/BasicListItem.qml</file>
+ <file alias="AbstractApplicationHeader.qml">src/controls/AbstractApplicationHeader.qml</file>
+ <file alias="styles/Plasma/Theme.qml">src/styles/Plasma/Theme.qml</file>
+ <file alias="styles/Plasma/Units.qml">src/styles/Plasma/Units.qml</file>
+ <file alias="styles/Plasma/Icon.qml">src/styles/Plasma/Icon.qml</file>
+
+ </qresource>
+</RCC>
diff --git a/kstars/kstarslite/kirigami-lib/metainfo.yaml b/kstars/kstarslite/kirigami-lib/metainfo.yaml
new file mode 100644
index 0000000..7b21e6a
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/metainfo.yaml
@@ -0,0 +1,12 @@
+maintainer: mart
+description: QtQuick plugins to build user interfaces based on the KDE UX guidelines
+tier: 2
+type: functional
+platforms:
+ - name: All
+portingAid: false
+deprecated: false
+release: false
+libraries:
+ - cmake: KF5::Kirigami
+cmakename: KF5Kirigami
diff --git a/kstars/kstarslite/kirigami-lib/src/CMakeLists.txt b/kstars/kstarslite/kirigami-lib/src/CMakeLists.txt
new file mode 100644
index 0000000..e177f84
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/CMakeLists.txt
@@ -0,0 +1,37 @@
+project(kirigami)
+
+set(kirigami_SRCS
+ kirigamiplugin.cpp
+ )
+
+IF(STATIC_LIBRARY)
+
+
+qt5_add_resources(kirigami_SRCS ${CMAKE_SOURCE_DIR}/kirigami.qrc)
+add_library(kirigamiplugin STATIC ${kirigami_SRCS} ${RESOURCES})
+target_link_libraries(kirigamiplugin Qt5::Core Qt5::Qml Qt5::Quick)
+
+ELSE(STATIC_LIBRARY)
+
+add_library(kirigamiplugin SHARED ${kirigami_SRCS})
+target_link_libraries(kirigamiplugin Qt5::Core Qt5::Qml Qt5::Quick)
+
+install(TARGETS kirigamiplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami)
+
+install(DIRECTORY controls/ DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami)
+
+if (PLASMA_ENABLED)
+ install(DIRECTORY styles/Plasma DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami/styles)
+endif()
+if (DESKTOP_ENABLED)
+ install(DIRECTORY styles/Desktop DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami/styles)
+endif()
+
+install(FILES ${platformspecific} DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami)
+
+include(ECMGeneratePriFile)
+ecm_generate_pri_file(BASE_NAME Kirigami LIB_NAME KF5Kirigami DEPS "core qml quick svg" FILENAME_VAR PRI_FILENAME )
+install(FILES ${PRI_FILENAME}
+ DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
+
+ENDIF(STATIC_LIBRARY)
diff --git a/kstars/kstarslite/kirigami-lib/src/Messages.sh b/kstars/kstarslite/kirigami-lib/src/Messages.sh
new file mode 100644
index 0000000..075e296
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/Messages.sh
@@ -0,0 +1,4 @@
+#! /usr/bin/env bash
+$XGETTEXT `find . -name \*.qml` -L Java -o $podir/libkirigamiplugin.pot
+rm -f rc.cpp
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/AbstractApplicationHeader.qml b/kstars/kstarslite/kirigami-lib/src/controls/AbstractApplicationHeader.qml
new file mode 100644
index 0000000..6d26857
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/AbstractApplicationHeader.qml
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.5
+import org.kde.kirigami 1.0
+
+import "private"
+import "templates" as T
+
+
+/**
+ * An item that can be used as a title for the application.
+ * Scrolling the main page will make it taller or shorter (trough the point of going away)
+ * It's a behavior similar to the typical mobile web browser adressbar
+ * the minimum, preferred and maximum heights of the item can be controlled with
+ * * minimumHeight: default is 0, i.e. hidden
+ * * preferredHeight: default is Units.gridUnit * 1.6
+ * * maximumHeight: default is Units.gridUnit * 3
+ *
+ * To achieve a titlebar that stays completely fixed just set the 3 sizes as the same
+ */
+T.AbstractApplicationHeader {
+ id: root
+
+ background: Rectangle {
+ color: Theme.highlightColor
+ EdgeShadow {
+ id: shadow
+ edge: Qt.TopEdge
+ anchors {
+ right: parent.right
+ left: parent.left
+ top: parent.bottom
+ }
+ }
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/AbstractApplicationWindow.qml b/kstars/kstarslite/kirigami-lib/src/controls/AbstractApplicationWindow.qml
new file mode 100644
index 0000000..5396b88
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/AbstractApplicationWindow.qml
@@ -0,0 +1,283 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.5
+import QtQuick.Controls 1.3 as Controls
+import "templates/private"
+import org.kde.kirigami 1.0
+import QtGraphicalEffects 1.0
+
+/**
+ * A window that provides some basic features needed for all apps
+ * Use this class only if you need a custom content for your application,
+ * different from the Page Row behavior recomended by the HIG and provided
+ * by ApplicationWindow.
+ * It is recomended to use ApplicationWindow instead
+ * @see ApplicationWindow
+ *
+ * It's usually used as a root QML component for the application.
+ * It provides support for a central page stack, side drawers and
+ * a top ApplicationHeader, as well as basic support for the
+ * Android back button
+ *
+ * Example usage:
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.ApplicationWindow {
+ * [...]
+ * globalDrawer: Kirigami.GlobalDrawer {
+ * actions: [
+ * Kirigami.Action {
+ * text: "View"
+ * iconName: "view-list-icons"
+ * Kirigami.Action {
+ * text: "action 1"
+ * }
+ * Kirigami.Action {
+ * text: "action 2"
+ * }
+ * Kirigami.Action {
+ * text: "action 3"
+ * }
+ * },
+ * Kirigami.Action {
+ * text: "Sync"
+ * iconName: "folder-sync"
+ * }
+ * ]
+ * }
+ *
+ * contextDrawer: Kirigami.ContextDrawer {
+ * id: contextDrawer
+ * }
+ *
+ * pageStack: PageStack {
+ * ...
+ * }
+ * [...]
+ * }
+ * @endcode
+ *
+ * @inherit QtQuick.Controls.ApplicationWindow
+ */
+Controls.ApplicationWindow {
+ id: root
+
+ /**
+ * pageStack: StackView
+ * Readonly.
+ * The stack used to allocate the pages and to manage the transitions
+ * between them.
+ * Put a container here, such as QQuickControls PageStack
+ */
+ property Item pageStack
+
+ /**
+ * Shows a little passive notification at the bottom of the app window
+ * lasting for few seconds, with an optional action button.
+ *
+ * @param message The text message to be shown to the user.
+ * @param timeout How long to show the message:
+ * possible values: "short", "long" or the number of milliseconds
+ * @param actionText Text in the action button, if any.
+ * @param callBack A JavaScript function that will be executed when the
+ * user clicks the button.
+ */
+ function showPassiveNotification(message, timeout, actionText, callBack) {
+ if (!internal.__passiveNotification) {
+ var component = Qt.createComponent("templates/private/PassiveNotification.qml");
+ internal.__passiveNotification = component.createObject(contentItem.parent);
+ }
+
+ internal.__passiveNotification.showNotification(message, timeout, actionText, callBack);
+ }
+
+ /**
+ * Hide the passive notification, if any is shown
+ */
+ function hidePassiveNotification() {
+ if(internal.__passiveNotification) {
+ internal.__passiveNotification.hideNotification();
+ }
+ }
+
+
+ /**
+ * @returns a pointer to this application window
+ * can be used anywhere in the application.
+ */
+ function applicationWindow() {
+ return root;
+ }
+
+ /**
+ * header: ApplicationHeader
+ * An item that can be used as a title for the application.
+ * Scrolling the main page will make it taller or shorter (trough the point of going away)
+ * It's a behavior similar to the typical mobile web browser adressbar
+ * the minimum, preferred and maximum heights of the item can be controlled with
+ * * Layout.minimumHeight: default is 0, i.e. hidden
+ * * Layout.preferredHeight: default is Units.gridUnit * 1.6
+ * * Layout.maximumHeight: default is Units.gridUnit * 3
+ *
+ * To achieve a titlebar that stays completely fixed just set the 3 sizes as the same
+ * //FIXME: this should become an actual ApplicationHeader
+ */
+ property var header: undefined
+
+ /**
+ * controlsVisible: bool
+ * This property controls wether the standard chrome of the app, such
+ * as the Action button, the drawer handles and the application
+ * header should be visible or not.
+ */
+ property bool controlsVisible: true
+
+ /**
+ * globalDrawer: AbstractDrawer
+ * The drawer for global actions, that will be opened by sliding from the
+ * left screen edge or by dragging the ActionButton to the right.
+ * It is recommended to use the GlobalDrawer class here
+ */
+ property AbstractDrawer globalDrawer
+
+ /**
+ * wideScreen: bool
+ * If true the application is considered to be in "widescreen" mode, such as on desktops or horizontal tablets.
+ * Different styles can have an own logic for deciding this
+ */
+ property bool wideScreen: width >= Units.gridUnit * 60
+
+ /**
+ * contextDrawer: AbstractDrawer
+ * The drawer for context-dependednt actions, that will be opened by sliding from the
+ * right screen edge or by dragging the ActionButton to the left.
+ * It is recommended to use the ContextDrawer class here.
+ * The contents of the context drawer should depend from what page is
+ * loaded in the main pageStack
+ *
+ * Example usage:
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.ApplicationWindow {
+ * [...]
+ * contextDrawer: Kirigami.ContextDrawer {
+ * id: contextDrawer
+ * }
+ * [...]
+ * }
+ * @endcode
+ *
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.Page {
+ * [...]
+ * contextualActions: [
+ * Kirigami.Action {
+ * iconName: "edit"
+ * text: "Action text"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * },
+ * Kirigami.Action {
+ * iconName: "edit"
+ * text: "Action text"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * }
+ * ]
+ * [...]
+ * }
+ * @endcode
+ *
+ * When this page will be the current one, the context drawer will visualize
+ * contextualActions defined as property in that page.
+ */
+ property AbstractDrawer contextDrawer
+
+ /**
+ * reachableMode: bool
+ * When true the application is in reachable mode for single hand use.
+ * the whole content of the application is moved down the screen to be
+ * reachable with the thumb. if wideScreen is true, tis property has
+ * no effect.
+ */
+ property bool reachableMode: false
+
+ MouseArea {
+ parent: contentItem.parent
+ z: -1
+ anchors.fill: parent
+ onClicked: root.reachableMode = false;
+ Rectangle {
+ anchors.fill: parent
+ color: Qt.rgba(0, 0, 0, 0.3)
+ opacity: 0.15
+ }
+ }
+
+ contentItem.anchors.topMargin: root.wideScreen && header && controlsVisible ? header.height : 0
+ contentItem.anchors.leftMargin: root.globalDrawer && (root.globalDrawer.modal === false) ? root.globalDrawer.contentItem.width * root.globalDrawer.position : 0
+ contentItem.anchors.rightMargin: root.contextDrawer && root.contextDrawer.modal === false ? root.contextDrawer.contentItem.width * root.contextDrawer.position : 0
+ contentItem.transform: Translate {
+ Behavior on y {
+ NumberAnimation {
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ y: root.reachableMode && !root.wideScreen ? root.height/2 : 0
+ x: root.globalDrawer && root.globalDrawer.modal === true && root.globalDrawer.toString().indexOf("SplitDrawer") === 0 ? root.globalDrawer.contentItem.width * root.globalDrawer.position : 0
+ }
+ //Don't want overscroll in landscape mode
+ onWidthChanged: {
+ if (width > height) {
+ root.reachableMode = false;
+ }
+ }
+
+ Binding {
+ when: globalDrawer !== undefined
+ target: globalDrawer
+ property: "parent"
+ value: contentItem.parent
+ }
+ Binding {
+ when: contextDrawer !== undefined
+ target: contextDrawer
+ property: "parent"
+ value: contentItem.parent
+ }
+ onPageStackChanged: pageStack.parent = contentItem;
+
+ width: Units.gridUnit * 30
+ height: Units.gridUnit * 45
+ visible: true
+
+
+ QtObject {
+ id: internal
+ property Item __passiveNotification
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/AbstractListItem.qml b/kstars/kstarslite/kirigami-lib/src/controls/AbstractListItem.qml
new file mode 100644
index 0000000..8f907d1
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/AbstractListItem.qml
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2015 Marco Martin <notmart@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+
+import QtQuick 2.1
+import "private"
+import "templates" as T
+
+/**
+ * An item delegate for the primitive ListView component.
+ *
+ * It's intended to make all listviews look coherent.
+ *
+ * @inherit QtQuick.Item
+ */
+T.AbstractListItem {
+ id: listItem
+
+ background: DefaultListItemBackground {}
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/Action.qml b/kstars/kstarslite/kirigami-lib/src/controls/Action.qml
new file mode 100644
index 0000000..fc89932
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/Action.qml
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.3 as Controls
+
+/**
+ * An item that represents an abstract Action
+ *
+ * @inherit Controls.Action
+ */
+Controls.Action {
+ id: root
+
+ /**
+ * visible: bool
+ * True (default) when the graphic representation of the action
+ * is supposed to be visible.
+ * It's up to the action representation to honor this property.
+ */
+ property bool visible: true
+
+ /**
+ * children: list<Action>
+ * A list of children actions.
+ * Useful for tree-like menus
+ * @code
+ * Action {
+ * text: "Tools"
+ * Action {
+ * text: "Action1"
+ * }
+ * Action {
+ * text: "Action2"
+ * }
+ * }
+ * @endcode
+ */
+ default property alias children: root.__children
+ property list<QtObject> __children
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/ApplicationHeader.qml b/kstars/kstarslite/kirigami-lib/src/controls/ApplicationHeader.qml
new file mode 100644
index 0000000..a46085c
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/ApplicationHeader.qml
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.5
+import "templates" as T
+
+
+/**
+ * An item that can be used as a title for the application.
+ * Scrolling the main page will make it taller or shorter (trough the point of going away)
+ * It's a behavior similar to the typical mobile web browser adressbar
+ * the minimum, preferred and maximum heights of the item can be controlled with
+ * * minimumHeight: default is 0, i.e. hidden
+ * * preferredHeight: default is Units.gridUnit * 1.6
+ * * maximumHeight: default is Units.gridUnit * 3
+ *
+ * To achieve a titlebar that stays completely fixed just set the 3 sizes as the same
+ */
+T.ApplicationHeader {
+ id: header
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/ApplicationWindow.qml b/kstars/kstarslite/kirigami-lib/src/controls/ApplicationWindow.qml
new file mode 100644
index 0000000..5060214
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/ApplicationWindow.qml
@@ -0,0 +1,175 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.5
+import QtQuick.Controls.Private 1.0
+import "templates/private"
+import org.kde.kirigami 1.0 as Kirigami
+import QtGraphicalEffects 1.0
+
+/**
+ * A window that provides some basic features needed for all apps
+ *
+ * It's usually used as a root QML component for the application.
+ * It's based around the PageRow component, the application will be
+ * about pages adding and removal.
+ * For most of the usages, this class should be used instead
+ * of AbstractApplicationWidnow
+ * @see AbstractApplicationWidnow
+ *
+ * Example usage:
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.ApplicationWindow {
+ * [...]
+ * globalDrawer: Kirigami.GlobalDrawer {
+ * actions: [
+ * Kirigami.Action {
+ * text: "View"
+ * iconName: "view-list-icons"
+ * Kirigami.Action {
+ * text: "action 1"
+ * }
+ * Kirigami.Action {
+ * text: "action 2"
+ * }
+ * Kirigami.Action {
+ * text: "action 3"
+ * }
+ * },
+ * Kirigami.Action {
+ * text: "Sync"
+ * iconName: "folder-sync"
+ * }
+ * ]
+ * }
+ *
+ * contextDrawer: Kirigami.ContextDrawer {
+ * id: contextDrawer
+ * }
+ *
+ * pageStack.initialPage: Kirigami.Page {
+ * mainAction: Kirigami.Action {
+ * iconName: "edit"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * }
+ * contextualActions: [
+ * Kirigami.Action {
+ * iconName: "edit"
+ * text: "Action text"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * },
+ * Kirigami.Action {
+ * iconName: "edit"
+ * text: "Action text"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * }
+ * ]
+ * [...]
+ * }
+ * [...]
+ * }
+ * @endcode
+ *
+*/
+AbstractApplicationWindow {
+ id: root
+
+ /**
+ * pageStack: StackView
+ * Readonly.
+ * The stack used to allocate the pages and to manage the transitions
+ * between them.
+ * It's using a PageRow, while having the same API as PageStack,
+ * it positions the pages as adjacent columns, with as many columns
+ * as can fit in the screen. An handheld device would usually have a single
+ * fullscreen column, a tablet device would have many tiled columns.
+ */
+ property alias pageStack: __pageStack
+
+ //redefines here as here we can know a pointer to PageRow
+ wideScreen: width >= applicationWindow().pageStack.defaultColumnWidth*2
+
+ PageRow {
+ id: __pageStack
+ anchors {
+ fill: parent
+ //HACK: workaround a bug in android iOS keyboard management
+ bottomMargin: ((Qt.platform.os == "android" || Qt.platform.os == "ios") || !Qt.inputMethod.visible) ? 0 : Qt.inputMethod.keyboardRectangle.height
+ onBottomMarginChanged: {
+ if (bottomMargin > 0) {
+ root.reachableMode = false;
+ }
+ }
+ }
+ //FIXME
+ onCurrentIndexChanged: root.reachableMode = false;
+
+ function goBack() {
+ if (root.contextDrawer && root.contextDrawer.opened && root.contextDrawer.modal) {
+ root.contextDrawer.close();
+ } else if (root.globalDrawer && root.globalDrawer.opened && root.globalDrawer.modal) {
+ root.globalDrawer.close();
+ } else {
+ var backEvent = {accepted: false}
+ if (root.pageStack.currentIndex >= 1) {
+ root.pageStack.currentItem.backRequested(backEvent);
+ if (!backEvent.accepted) {
+ if (root.pageStack.depth > 1) {
+ root.pageStack.currentIndex = Math.max(0, root.pageStack.currentIndex - 1);
+ backEvent.accepted = true;
+ }
+ }
+ }
+
+ if (Settings.isMobile && !backEvent.accepted) {
+ Qt.quit();
+ }
+ }
+ }
+ Keys.onReleased: {
+ if (event.key == Qt.Key_Back ||
+ (event.key === Qt.Key_Left && (event.modifiers & Qt.AltModifier))) {
+ event.accepted = true;
+ goBack();
+ }
+ }
+
+ Rectangle {
+ z: -1
+ anchors.fill: parent
+ color: Kirigami.Theme.backgroundColor
+ }
+ focus: true
+ }
+
+ Component.onCompleted: {
+ if (root.header === undefined) {
+ var component = Qt.createComponent(Qt.resolvedUrl("./ApplicationHeader.qml"));
+ root.header = component.createObject(root.contentItem.parent);
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/BasicListItem.qml b/kstars/kstarslite/kirigami-lib/src/controls/BasicListItem.qml
new file mode 100644
index 0000000..9ed39cc
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/BasicListItem.qml
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2010 Marco Martin <notmart@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+/**
+ * An item delegate for the primitive ListView component.
+ *
+ * It's intended to make all listviews look coherent.
+ * It has a default icon and a label
+ *
+ * @inherit AbstractListItem
+ */
+AbstractListItem {
+ id: listItem
+
+ /**
+ * string: bool
+ * A single text label the list item will contain
+ */
+ property string label
+
+ /**
+ * icon: var
+ * A single icon that will be displayed in the list item. The icon can
+ * be either a QIcon, a string name of a fdo compatible name,
+ * or any url accepted by the Image element.
+ */
+ property var icon
+
+ RowLayout {
+ anchors {
+ left: parent.left
+ verticalCenter: parent.verticalCenter
+ }
+ Icon {
+ Layout.minimumHeight: Units.iconSizes.smallMedium
+ Layout.maximumHeight: Layout.minimumHeight
+ Layout.minimumWidth: height
+ source: listItem.icon
+ selected: listItem.checked || listItem.pressed
+ }
+ Label {
+ text: listItem.label
+ color: listItem.checked || listItem.pressed ? Theme.highlightedTextColor : Theme.viewTextColor
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/ContextDrawer.qml b/kstars/kstarslite/kirigami-lib/src/controls/ContextDrawer.qml
new file mode 100644
index 0000000..31d1496
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/ContextDrawer.qml
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.2
+import QtQuick.Controls 1.0 as QtControls
+import org.kde.kirigami 1.0
+
+/**
+ * A drawer specialization that will show a list of actions that are
+ * specific of the current page shown by the application
+ *
+ * Example usage:
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.ApplicationWindow {
+ * [...]
+ * contextDrawer: Kirigami.ContextDrawer {
+ * id: contextDrawer
+ * }
+ * [...]
+ * }
+ * @endcode
+ *
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.Page {
+ * [...]
+ * contextualActions: [
+ * Kirigami.Action {
+ * iconName: "edit"
+ * text: "Action text"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * },
+ * Kirigami.Action {
+ * iconName: "edit"
+ * text: "Action text"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * }
+ * ]
+ * [...]
+ * }
+ * @endcode
+ *
+ * @inherit AbstractDrawer
+ */
+OverlayDrawer {
+ id: root
+
+ /**
+ * title: string
+ * A title for the action list that will be shown to the user when opens the drawer
+ */
+ property string title: typeof i18n !== "undefined" ? i18n("Actions") : "Actions"
+
+ /**
+ * actions: list<Action>
+ * This can be any type of object that a ListView can accept as model.
+ * It expects items compatible with either QAction or Kirigami Action
+ */
+ property var actions: pageStack.currentItem ? pageStack.currentItem.contextualActions : null
+ enabled: menu.count > 0
+ edge: Qt.RightEdge
+
+ handleVisible: applicationWindow == undefined || applicationWindow().wideScreen == true ? false : applicationWindow().controlsVisible
+
+ Connections {
+ target: pageStack
+ onCurrentItemChanged: {
+ actions = pageStack.currentItem.contextualActions
+ }
+ }
+
+ contentItem: QtControls.ScrollView {
+ implicitWidth: Units.gridUnit * 20
+ ListView {
+ id: menu
+ interactive: contentHeight > height
+ model: {
+ if (typeof root.actions == "undefined") {
+ return null;
+ }
+ if (root.actions.length == 0) {
+ return null;
+ } else {
+ return root.actions[0].text !== undefined &&
+ root.actions[0].trigger !== undefined ?
+ root.actions :
+ root.actions[0];
+ }
+ }
+ topMargin: menu.height - menu.contentHeight
+ header: Item {
+ height: heading.height
+ width: menu.width
+ Heading {
+ id: heading
+ anchors {
+ left: parent.left
+ right: parent.right
+ margins: Units.largeSpacing
+ }
+ elide: Text.ElideRight
+ level: 2
+ text: root.title
+ }
+ }
+ delegate: BasicListItem {
+ checked: modelData.checked
+ icon: modelData.iconName
+ supportsMouseEvents: true
+ separatorVisible: index < menu.count-1
+ label: model ? model.text : modelData.text
+ enabled: model ? model.enabled : modelData.enabled
+ visible: model ? model.visible : modelData.visible
+ opacity: enabled ? 1.0 : 0.6
+ onClicked: {
+ if (modelData && modelData.trigger !== undefined) {
+ modelData.trigger();
+ // assume the model is a list of QAction or Action
+ } else if (menu.model.length > index) {
+ menu.model[index].trigger();
+ } else {
+ console.warning("Don't know how to trigger the action")
+ }
+ root.opened = false;
+ }
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/GlobalDrawer.qml b/kstars/kstarslite/kirigami-lib/src/controls/GlobalDrawer.qml
new file mode 100644
index 0000000..3e9b234
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/GlobalDrawer.qml
@@ -0,0 +1,373 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.4 as Controls
+import QtQuick.Layouts 1.2
+import QtGraphicalEffects 1.0
+import org.kde.kirigami 1.0
+
+import "private"
+
+/**
+ * A drawer specialization intended for the global actions of the application
+ * valid regardless of the application state (think about the menubar
+ * of a desktop application).
+ *
+ * Example usage:
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.ApplicationWindow {
+ * [...]
+ * globalDrawer: Kirigami.GlobalDrawer {
+ * actions: [
+ * Kirigami.Action {
+ * text: "View"
+ * iconName: "view-list-icons"
+ * Kirigami.Action {
+ * text: "action 1"
+ * }
+ * Kirigami.Action {
+ * text: "action 2"
+ * }
+ * Kirigami.Action {
+ * text: "action 3"
+ * }
+ * },
+ * Kirigami.Action {
+ * text: "Sync"
+ * iconName: "folder-sync"
+ * }
+ * ]
+ * }
+ * [...]
+ * }
+ * @endcode
+ *
+ * @inherit AbstractDrawer
+ */
+OverlayDrawer {
+ id: root
+ edge: Qt.LeftEdge
+
+ /**
+ * title: string
+ * A title to be displayed on top of the drawer
+ */
+ property alias title: heading.text
+
+ /**
+ * icon: var
+ * An icon to be displayed alongside the title.
+ * It can be a QIcon, a fdo-compatible icon name, or any url understood by Image
+ */
+ property alias titleIcon: headingIcon.source
+
+ /**
+ * bannerImageSource: string
+ * An image to be used as background for the title and icon for
+ * a decorative purpose.
+ * It accepts any url format supported by Image
+ */
+ property alias bannerImageSource: bannerImage.source
+
+ /**
+ * actions: list<Action>
+ * The list of actions can be nested having a tree structure.
+ * A tree depth bigger than 2 is discouraged.
+ *
+ * Example usage:
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.ApplicationWindow {
+ * [...]
+ * globalDrawer: Kirigami.GlobalDrawer {
+ * actions: [
+ * Kirigami.Action {
+ * text: "View"
+ * iconName: "view-list-icons"
+ * Kirigami.Action {
+ * text: "action 1"
+ * }
+ * Kirigami.Action {
+ * text: "action 2"
+ * }
+ * Kirigami.Action {
+ * text: "action 3"
+ * }
+ * },
+ * Kirigami.Action {
+ * text: "Sync"
+ * iconName: "folder-sync"
+ * }
+ * ]
+ * }
+ * [...]
+ * }
+ * @endcode
+ */
+ property list<QtObject> actions
+
+
+ /**
+ * content: list<Item> default property
+ * Any random Item can be instantiated inside the drawer and
+ * will be displayed underneath the actions list.
+ *
+ * Example usage:
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.ApplicationWindow {
+ * [...]
+ * globalDrawer: Kirigami.GlobalDrawer {
+ * actions: [...]
+ * Button {
+ * text: "Button"
+ * onClicked: //do stuff
+ * }
+ * }
+ * [...]
+ * }
+ * @endcode
+ */
+ default property alias content: mainContent.data
+
+ /**
+ * content: list<Item> default property
+ * Items that will be instantiated inside the drawer and
+ * will be displayed on top of the actions list.
+ *
+ * Example usage:
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.ApplicationWindow {
+ * [...]
+ * globalDrawer: Kirigami.GlobalDrawer {
+ * actions: [...]
+ * topContent: [Button {
+ * text: "Button"
+ * onClicked: //do stuff
+ * }]
+ * }
+ * [...]
+ * }
+ * @endcode
+ */
+ property alias topContent: topContent.data
+
+ contentItem: Controls.ScrollView {
+ id: scrollView
+ anchors.fill: parent
+ implicitWidth: Math.min (Math.max(Units.gridUnit * 12, title.width), root.parent.width * 0.8)
+ horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
+ Flickable {
+ id: mainFlickable
+ contentWidth: width
+ contentHeight: mainColumn.Layout.minimumHeight
+ ColumnLayout {
+ id: mainColumn
+ width: mainFlickable.width
+ spacing: 0
+ height: Math.max(root.height, Layout.minimumHeight)
+
+ Image {
+ id: bannerImage
+ Layout.fillWidth: true
+
+ Layout.preferredWidth: title.implicitWidth
+ Layout.preferredHeight: bannerImageSource != "" ? Math.max(title.implicitHeight, Math.floor(width / (sourceSize.width/sourceSize.height))) : title.implicitHeight
+ Layout.minimumHeight: Math.max(headingIcon.height, heading.height) + Units.smallSpacing * 2
+
+ fillMode: Image.PreserveAspectCrop
+ asynchronous: true
+
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: parent.top
+ }
+
+ EdgeShadow {
+ edge: Qt.BottomEdge
+ visible: bannerImageSource != ""
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.top
+ }
+ }
+ LinearGradient {
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: parent.top
+ }
+ visible: bannerImageSource != ""
+ height: title.height * 1.3
+ start: Qt.point(0, 0)
+ end: Qt.point(0, height)
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: Qt.rgba(0, 0, 0, 0.8)
+ }
+ GradientStop {
+ position: 1.0
+ color: "transparent"
+ }
+ }
+ }
+
+ RowLayout {
+ id: title
+ anchors {
+ left: parent.left
+ top: parent.top
+ margins: Units.smallSpacing * 2
+ }
+ Icon {
+ id: headingIcon
+ Layout.minimumWidth: Units.iconSizes.large
+ Layout.minimumHeight: width
+ }
+ Heading {
+ id: heading
+ level: 1
+ color: bannerImageSource != "" ? "white" : Theme.textColor
+ }
+ Item {
+ height: 1
+ Layout.minimumWidth: heading.height
+ }
+ }
+ }
+
+ ColumnLayout {
+ id: topContent
+ spacing: 0
+ Layout.alignment: Qt.AlignHCenter
+ Layout.minimumWidth: parent.width - Units.smallSpacing*2
+ Layout.maximumWidth: Layout.minimumWidth
+ Layout.preferredHeight: Layout.minimumHeight + Units.smallSpacing*2
+ Layout.fillWidth: false
+ Layout.fillHeight: true
+ visible: children.length > 0 && childrenRect.height > 0
+ }
+
+ Rectangle {
+ color: Theme.textColor
+ opacity: 0.2
+ Layout.fillWidth: true
+ Layout.minimumHeight: Math.floor(Units.devicePixelRatio)
+ visible: actions.length > 0
+ }
+
+ Controls.StackView {
+ id: stackView
+ Layout.fillWidth: true
+ Layout.minimumHeight: currentItem ? currentItem.implicitHeight : 0
+ Layout.maximumHeight: Layout.minimumHeight
+ initialItem: menuComponent
+ }
+ Item {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.minimumHeight: Units.smallSpacing
+ }
+
+ ColumnLayout {
+ id: mainContent
+ Layout.alignment: Qt.AlignHCenter
+ Layout.minimumWidth: parent.width - Units.smallSpacing*2
+ Layout.maximumWidth: Layout.minimumWidth
+ Layout.fillWidth: false
+ Layout.fillHeight: true
+ visible: children.length > 0
+ }
+ Item {
+ Layout.minimumWidth: Units.smallSpacing
+ Layout.minimumHeight: Units.smallSpacing
+ }
+
+ Component {
+ id: menuComponent
+ ColumnLayout {
+ id: optionMenu
+ spacing: 0
+ property alias model: actionsRepeater.model
+
+ property int level: 0
+ Layout.maximumHeight: Layout.minimumHeight
+
+
+ Repeater {
+ id: actionsRepeater
+ model: actions
+ delegate: BasicListItem {
+ id: listItem
+ supportsMouseEvents: true
+ checked: modelData.checked
+ icon: modelData.iconName
+ label: modelData.text
+ visible: model ? model.visible || model.visible===undefined : modelData.visible
+ enabled: model ? model.enabled : modelData.enabled
+ opacity: enabled ? 1.0 : 0.3
+ Icon {
+ anchors {
+ verticalCenter: parent.verticalCenter
+ right: parent.right
+ }
+ height: Units.iconSizes.smallMedium
+ selected: listItem.checked || listItem.pressed
+ width: height
+ source: "go-next"
+ visible: modelData.children!==undefined && modelData.children.length > 0
+ }
+
+ onClicked: {
+ if (modelData.children!==undefined && modelData.children.length > 0) {
+ stackView.push(menuComponent, {"model": modelData.children, "level": level + 1});
+ } else {
+ modelData.trigger();
+ stackView.pop(stackView.initialItem);
+ if (root.modal) {
+ root.opened = false;
+ }
+ }
+ }
+ }
+ }
+ BasicListItem {
+ visible: level > 0
+ supportsMouseEvents: true
+ icon: "go-previous"
+ label: typeof i18n !== "undefined" ? i18n("Back") : "Back"
+ onClicked: stackView.pop()
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/Heading.qml b/kstars/kstarslite/kirigami-lib/src/controls/Heading.qml
new file mode 100644
index 0000000..be51fe0
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/Heading.qml
@@ -0,0 +1,82 @@
+/*
+* Copyright 2012 by Sebastian Kügler <sebas@kde.org>
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU Library General Public License as
+* published by the Free Software Foundation; either version 2, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Library General Public License for more details
+*
+* You should have received a copy of the GNU Library General Public
+* License along with this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+*/
+
+import QtQuick 2.0
+import org.kde.kirigami 1.0
+
+/**
+ * A heading label used for subsections of texts.
+ *
+ * The characteristics of the text will be automatically set according to the
+ * plasma Theme. Use this components for section titles or headings in your UI,
+ * for example page or section titles.
+ *
+ * Example usage:
+ *
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ * [...]
+ * Column {
+ * Kirigami.Heading {
+ * text: "Apples in the sunlight"
+ * level: 2
+ * }
+ * [...]
+ * }
+ * @endcode
+ *
+ * The most important property is "text", which applies to the text property of
+ * Label. See PlasmaComponents Label and primitive QML Text element API for
+ * additional properties, methods and signals.
+ */
+Label {
+ id: heading
+
+ /**
+ * level: int
+ * The level determines how big the section header is display, values
+ * between 1 (big) and 5 (small) are accepted
+ */
+ property int level: 1
+
+ /**
+ * step: int
+ * adjust the point size in between a level and another.
+ */
+ property int step: 2
+
+ height: Math.round(paintedHeight * 1.2)
+ font.pointSize: headerPointSize(level)
+ font.weight: Font.Light
+ wrapMode: Text.WordWrap
+ opacity: 0.8
+
+ function headerPointSize(l) {
+ var n = Theme.defaultFont.pointSize;
+ var s;
+ if (l > 4) {
+ s = n
+ } else if (l < 2) {
+ s = n + (5*step)
+ } else {
+ s = n + ((5-level)*2)
+ }
+ return s;
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/Icon.qml b/kstars/kstarslite/kirigami-lib/src/controls/Icon.qml
new file mode 100644
index 0000000..bb2634c
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/Icon.qml
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+import org.kde.kirigami 1.0
+
+Item {
+ id: root
+ property string source
+ property alias smooth: image.smooth
+ property bool active: false
+ property bool valid: image.status == Image.Ready
+ property bool selected: false
+
+ implicitWidth: image.source != "" ? Units.iconSizes.smallMedium : 0
+ implicitHeight: image.source != "" ? Units.iconSizes.smallMedium : 0
+
+ Image {
+ id: image
+ anchors.fill: parent
+ source: root.source != "" ? (root.source.indexOf(".") === -1 ? "./icons/" + root.source + ".svg" : root.source) : root.source
+ sourceSize.width: root.width
+ sourceSize.height: root.height
+ }
+ ColorOverlay {
+
+ anchors.fill: parent
+ source: image
+ color: Theme.highlightedTextColor
+ cached: true
+ visible: root.selected && root.valid
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/Label.qml b/kstars/kstarslite/kirigami-lib/src/controls/Label.qml
new file mode 100644
index 0000000..d0a3974
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/Label.qml
@@ -0,0 +1,59 @@
+/*
+* Copyright (C) 2011 by Marco Martin <mart@kde.org>
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU Library General Public License as
+* published by the Free Software Foundation; either version 2, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Library General Public License for more details
+*
+* You should have received a copy of the GNU Library General Public
+* License along with this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+*/
+
+import QtQuick 2.1
+import org.kde.kirigami 1.0
+
+/**
+ * This is a label which uses the plasma Theme.
+ *
+ * The characteristics of the text will be automatically set according to the
+ * plasma Theme. If you need a more customized text item use the Text component
+ * from QtQuick.
+ *
+ * You can use all elements of the QML Text component, in particular the "text"
+ * property to define the label text.
+ *
+ * @inherit QtQuick.Text
+ */
+Text {
+ id: root
+
+ height: Math.round(Math.max(paintedHeight, Units.gridUnit * 1.6))
+ verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter
+
+ activeFocusOnTab: false
+ renderType: Text.NativeRendering
+
+ font.capitalization: Theme.defaultFont.capitalization
+ font.family: Theme.defaultFont.family
+ font.italic: Theme.defaultFont.italic
+ font.letterSpacing: Theme.defaultFont.letterSpacing
+ font.pointSize: Theme.defaultFont.pointSize
+ font.strikeout: Theme.defaultFont.strikeout
+ font.underline: Theme.defaultFont.underline
+ font.weight: Theme.defaultFont.weight
+ font.wordSpacing: Theme.defaultFont.wordSpacing
+ color: Theme.textColor
+
+ opacity: enabled? 1 : 0.6
+
+ Accessible.role: Accessible.StaticText
+ Accessible.name: text
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/OverlayDrawer.qml b/kstars/kstarslite/kirigami-lib/src/controls/OverlayDrawer.qml
new file mode 100644
index 0000000..1b7376e
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/OverlayDrawer.qml
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtGraphicalEffects 1.0
+import org.kde.kirigami 1.0
+
+import "private"
+import "templates" as T
+
+/**
+ * Overlay Drawers are used to expose additional UI elements needed for
+ * small secondary tasks for which the main UI elements are not needed.
+ * For example in Okular Active, an Overlay Drawer is used to display
+ * thumbnails of all pages within a document along with a search field.
+ * This is used for the distinct task of navigating to another page.
+ *
+ */
+T.OverlayDrawer {
+ id: root
+
+//BEGIN Properties
+ background: Rectangle {
+ color: Theme.viewBackgroundColor
+
+ Item {
+ id: drawerHandle
+ z: -1
+
+ anchors {
+ right: root.edge == Qt.LeftEdge ? undefined : parent.left
+ left: root.edge == Qt.RightEdge ? undefined : parent.right
+ bottom: parent.bottom
+ }
+ visible: root.enabled && (root.edge == Qt.LeftEdge || root.edge == Qt.RightEdge)
+ width: Units.iconSizes.medium + Units.smallSpacing * 2
+ height: width
+ opacity: root.handleVisible ? 1 : 0
+ Behavior on opacity {
+ NumberAnimation {
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ transform: Translate {
+ id: translateTransform
+ x: root.handleVisible ? 0 : (root.edge == Qt.LeftEdge ? -drawerHandle.width : drawerHandle.width)
+ Behavior on x {
+ NumberAnimation {
+ duration: Units.longDuration
+ easing.type: !root.handleVisible ? Easing.OutQuad : Easing.InQuad
+ }
+ }
+ }
+ Item {
+ opacity: 0.3 + root.position
+ anchors {
+ fill:parent
+ margins: -Units.gridUnit
+ }
+ layer.enabled: true
+ Rectangle {
+ id: shadowRect
+ anchors.fill: handleGraphics
+ color: "black"
+ }
+ FastBlur {
+ z: -1
+ anchors.fill: shadowRect
+ source: shadowRect
+ radius: Units.gridUnit
+ transparentBorder: true
+ }
+ Rectangle {
+ id: handleGraphics
+ color: Theme.viewBackgroundColor
+ anchors {
+ fill:parent
+ margins: Units.gridUnit
+ }
+ }
+ }
+
+ Loader {
+ anchors.centerIn: parent
+ width: height
+ height: Units.iconSizes.smallMedium
+ source: root.edge == Qt.LeftEdge ? Qt.resolvedUrl("templates/private/MenuIcon.qml") : (root.edge == Qt.RightEdge ? Qt.resolvedUrl("templates/private/ContextIcon.qml") : "")
+ onItemChanged: {
+ if(item) {
+ item.morph = Qt.binding(function(){return root.position})
+ }
+ }
+ }
+ }
+
+ EdgeShadow {
+ z: -2
+ edge: root.edge
+ anchors {
+ right: root.edge == Qt.RightEdge ? parent.left : (root.edge == Qt.LeftEdge ? undefined : parent.right)
+ left: root.edge == Qt.LeftEdge ? parent.right : (root.edge == Qt.RightEdge ? undefined : parent.left)
+ top: root.edge == Qt.TopEdge ? parent.bottom : (root.edge == Qt.BottomEdge ? undefined : parent.top)
+ bottom: root.edge == Qt.BottomEdge ? parent.top : (root.edge == Qt.TopEdge ? undefined : parent.bottom)
+ }
+
+ opacity: root.position == 0 ? 0 : 1
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/OverlaySheet.qml b/kstars/kstarslite/kirigami-lib/src/controls/OverlaySheet.qml
new file mode 100644
index 0000000..8faab2e
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/OverlaySheet.qml
@@ -0,0 +1,106 @@
+/*
+* Copyright (C) 2016 by Marco Martin <mart@kde.org>
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU Library General Public License as
+* published by the Free Software Foundation; either version 2, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Library General Public License for more details
+*
+* You should have received a copy of the GNU Library General Public
+* License along with this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+*/
+
+import QtQuick 2.5
+import org.kde.kirigami 1.0
+import "private"
+import "templates" as T
+
+/**
+ * An overlay sheet that covers the current Page content.
+ * Its contents can be scrolled up or down, scrolling all the way up or
+ * all the way down, dismisses it.
+ * Use this for big, modal dialogs or information display, that can't be
+ * logically done as a new separate Page, even if potentially
+ * are taller than the screen space.
+ */
+T.OverlaySheet {
+ id: root
+
+ background: Item {
+ anchors.fill: parent
+ //Why not a shadow or rectangularglow?
+ //on some android devices they break badly when the OverlaySheet is bigger than
+ //the screen
+ CornerShadow {
+ corner: Qt.BottomRightCorner
+ anchors {
+ right: parent.left
+ bottom: parent.top
+ }
+ }
+ CornerShadow {
+ corner: Qt.BottomLeftCorner
+ anchors {
+ left: parent.right
+ bottom: parent.top
+ }
+ }
+ CornerShadow {
+ corner: Qt.TopRightCorner
+ anchors {
+ right: parent.left
+ top: parent.bottom
+ }
+ }
+ CornerShadow {
+ corner: Qt.TopLeftCorner
+ anchors {
+ left: parent.right
+ top: parent.bottom
+ }
+ }
+ EdgeShadow {
+ edge: Qt.BottomEdge
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.top
+ }
+ }
+ EdgeShadow {
+ edge: Qt.TopEdge
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: parent.bottom
+ }
+ }
+ EdgeShadow {
+ edge: Qt.LeftEdge
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ left: parent.right
+ }
+ }
+ EdgeShadow {
+ edge: Qt.RightEdge
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ right: parent.left
+ }
+ }
+ Rectangle {
+ anchors.fill: parent
+ color: Theme.viewBackgroundColor
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/Page.qml b/kstars/kstarslite/kirigami-lib/src/controls/Page.qml
new file mode 100644
index 0000000..e2f838b
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/Page.qml
@@ -0,0 +1,280 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+import "private"
+
+/**
+ * Page is a container for all the app pages: everything pushed to the
+ * ApplicationWindow stackView should be a Page instabnce (or a subclass,
+ * such as ScrollablePage)
+ * @see ScrollablePage
+ */
+Item {
+ id: root
+
+ /**
+ * title: string
+ * Title for the page
+ */
+ property string title
+
+ /**
+ * leftPadding: int
+ * default contents padding at left
+ */
+ property int leftPadding: Units.gridUnit
+
+ /**
+ * topPadding: int
+ * default contents padding at top
+ */
+ property int topPadding: Units.gridUnit
+
+ /**
+ * rightPadding: int
+ * default contents padding at right
+ */
+ property int rightPadding: Units.gridUnit
+
+ /**
+ * bottomPadding: int
+ * default contents padding at bottom
+ */
+ property int bottomPadding: Units.gridUnit
+
+ /**
+ * contentData: Item
+ * The main items contained in this Page
+ */
+ default property alias contentData: container.data
+
+ /**
+ * flickable: Flickable
+ * if the central element of the page is a Flickable
+ * (ListView and Gridview as well) you can set it there.
+ * normally, you wouldn't need to do that, but just use the
+ * ScrollablePage element instead
+ * @see ScrollablePage
+ * Use this if your flickable has some non standard properties, such as not covering the whole Page
+ */
+ property Flickable flickable
+
+ /**
+ * actions.contextualActions: list<QtObject>
+ * Defines the contextual actions for the page:
+ * an easy way to assign actions in the right sliding panel
+ *
+ * Example usage:
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.ApplicationWindow {
+ * [...]
+ * contextDrawer: Kirigami.ContextDrawer {
+ * id: contextDrawer
+ * }
+ * [...]
+ * }
+ * @endcode
+ *
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ *
+ * Kirigami.Page {
+ * [...]
+ * actions.contextualActions: [
+ * Kirigami.Action {
+ * iconName: "edit"
+ * text: "Action text"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * },
+ * Kirigami.Action {
+ * iconName: "edit"
+ * text: "Action text"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * }
+ * ]
+ * [...]
+ * }
+ * @endcode
+ */
+ //TODO: remove
+ property alias contextualActions: actionsGroup.contextualActions
+
+ /**
+ * actions.main: Action
+ * An optional single action for the action button.
+ * it can be a Kirigami.Action or a QAction
+ *
+ * Example usage:
+ *
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ * Kirigami.Page {
+ * actions.main: Kirigami.Action {
+ * iconName: "edit"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * }
+ * }
+ * @endcode
+ */
+ //TODO: remove
+ property alias mainAction: actionsGroup.main
+
+ /**
+ * actions.left: Action
+ * An optional extra action at the left of the main action button.
+ * it can be a Kirigami.Action or a QAction
+ *
+ * Example usage:
+ *
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ * Kirigami.Page {
+ * actions.left: Kirigami.Action {
+ * iconName: "edit"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * }
+ * }
+ * @endcode
+ */
+ //TODO: remove
+ property alias leftAction: actionsGroup.left
+
+ /**
+ * actions.right: Action
+ * An optional extra action at the right of the main action button.
+ * it can be a Kirigami.Action or a QAction
+ *
+ * Example usage:
+ *
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ * Kirigami.Page {
+ * actions.right: Kirigami.Action {
+ * iconName: "edit"
+ * onTriggered: {
+ * // do stuff
+ * }
+ * }
+ * }
+ * @endcode
+ */
+ //TODO: remove
+ property alias rightAction: actionsGroup.right
+
+ /**
+ * Actions properties are grouped.
+ *
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ * Kirigami.Page {
+ * actions {
+ * main: Kirigami.Action {...}
+ * left: Kirigami.Action {...}
+ * right: Kirigami.Action {...}
+ * contextualActions: [
+ * Kirigami.Action {...},
+ * Kirigami.Action {...}
+ * ]
+ * }
+ * }
+ * @endcode
+ */
+ readonly property alias actions: actionsGroup
+
+ PageActionPropertyGroup {
+ id: actionsGroup
+ }
+
+ /**
+ * background: Item
+ * This property holds the background item.
+ * Note: If the background item has no explicit size specified,
+ * it automatically follows the control's size.
+ * In most cases, there is no need to specify width or
+ * height for a background item.
+ */
+ property Item background
+
+ onBackgroundChanged: {
+ background.z = -1;
+ background.parent = root;
+ background.anchors.fill = root;
+ }
+
+ /**
+ * emitted When the application requests a Back action
+ * For instance a global "back" shortcut or the Android
+ * Back button has been pressed.
+ * The page can manage the back event by itself,
+ * and if it set event.accepted = true, it will stop the main
+ * application to manage the back event.
+ */
+ signal backRequested(var event);
+
+ Item {
+ id: container
+ onChildrenChanged: {
+ //NOTE: make sure OverlaySheets are directly under the root
+ //so they are over all the contents and don't have margins
+ //TODO: OverlayDrawers as well?
+ //search for an OverlaySheet, unfortunately have to blind test properties
+ //as there is no way to get the classname from qml objects
+ for (var i = children.length -1; i >= 0; --i) {
+ var child = children[i];
+ if (child.toString().indexOf("OverlaySheet") === 0) {
+ child.parent = root;
+ }
+ }
+ }
+ anchors {
+ fill: parent
+ leftMargin: leftPadding
+ topMargin: topPadding + (applicationWindow === undefined || applicationWindow().wideScreen ? 0 : applicationWindow().header.height)
+ rightMargin: rightPadding
+ bottomMargin: bottomPadding
+ }
+ }
+
+ Loader {
+ z: 9999
+ parent: root
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ height: item ? item.height : 0
+ source: applicationWindow().header && applicationWindow().header.toString().indexOf("ToolBarApplicationHeader") !== 0 ? Qt.resolvedUrl("./private/ActionButton.qml") : ""
+ }
+
+ Layout.fillWidth: true
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/ScrollablePage.qml b/kstars/kstarslite/kirigami-lib/src/controls/ScrollablePage.qml
new file mode 100644
index 0000000..9d036b9
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/ScrollablePage.qml
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+import "private"
+
+/**
+ * ScrollablePage is a container for all the app pages: everything pushed to the
+ * ApplicationWindow stackView should be a Page or ScrollablePage instabnce.
+ * This Page subclass is for content that has to be scrolled around, such as
+ * bigger content than the screen that would normally go in a Flickable
+ * or a ListView.
+ * Scrolling and scrolling indicators will be automatically managed
+ *
+ *
+ * @code
+ * ScrollablePage {
+ * id: root
+ * //The rectangle will automatically bescrollable
+ * Rectangle {
+ * width: root.width
+ * height: 99999
+ * }
+ * }
+ * @endcode
+ *
+ * @code
+ * ScrollablePage {
+ * id: root
+ *
+ * //support for the popular "pull down to refresh" behavior in mobile apps
+ * supportsRefreshing: true
+ *
+ * //The ListView will automatically receive proper scroll indicators
+ * ListView {
+ * model: myModel
+ * delegate: BasicListItem { ... }
+ * }
+ * }
+ * @endcode
+ *
+ * @inherit Page
+ */
+Page {
+ id: root
+
+ /**
+ * refreshing: bool
+ * If true the list is asking for refresh and will show a loading spinner.
+ * it will automatically be set to true when the user pulls down enough the list.
+ * This signals the application logic to start its refresh procedure.
+ * The application itself will have to set back this property to false when done.
+ */
+ property alias refreshing: scrollView.refreshing
+
+ /**
+ * supportsRefreshing: bool
+ * If true the list supports the "pull down to refresh" behavior.
+ * default is false.
+ */
+ property alias supportsRefreshing: scrollView.supportsRefreshing
+
+ /**
+ * flickable: Flickable
+ * The main Flickable item of this page
+ */
+ property alias flickable: scrollView.flickableItem
+
+ /**
+ * The main content Item of this page.
+ * In the case of a ListView or GridView, both contentItem and flickable
+ * will be a pointer to the ListView (or GridView)
+ */
+ default property alias contentItem: scrollView.contentItem
+
+ /**
+ * leftPadding: int
+ * default contents padding at left
+ */
+ property alias leftPadding: scrollView.leftPadding
+
+ /**
+ * topPadding: int
+ * default contents padding at top
+ */
+ property alias topPadding: scrollView.topPadding
+
+ /**
+ * rightPadding: int
+ * default contents padding at right
+ */
+ property alias rightPadding: scrollView.rightPadding
+
+ /**
+ * bottomPadding: int
+ * default contents padding at bottom
+ */
+ property alias bottomPadding: scrollView.bottomPadding
+
+ children: [
+ RefreshableScrollView {
+ id: scrollView
+ topPadding: (applicationWindow() && applicationWindow().header ? applicationWindow().header.preferredHeight : 0) + (contentItem == flickable ? 0 : Units.gridUnit)
+ leftPadding: contentItem == flickable ? 0 : Units.gridUnit
+ rightPadding: contentItem == flickable ? 0 : Units.gridUnit
+ bottomPadding: contentItem == flickable ? 0 : Units.gridUnit
+ anchors {
+ fill: parent
+ }
+ },
+
+ Item {
+ id: overlay
+ anchors.fill: parent
+ property Item oldContentItem
+ }
+ ]
+
+ //HACK to get the contentItem as the last one, all the other eventual items as an overlay
+ //no idea if is the way the user expects
+ onContentItemChanged: {
+ if (overlay.oldContentItem) {
+ overlay.oldContentItem.parent = overlay
+ }
+ overlay.oldContentItem = root.contentItem
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/SplitDrawer.qml b/kstars/kstarslite/kirigami-lib/src/controls/SplitDrawer.qml
new file mode 100644
index 0000000..12067a0
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/SplitDrawer.qml
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import "private"
+import "templates" as T
+
+/**
+ * Split Drawers are used to expose additional UI elements which are optional
+ * and can be used in conjunction with the main UI elements.
+ * For example the Resource Browser uses a Split Drawer to select
+ * different kinds of filters for the main view.
+ */
+T.SplitDrawer {
+ id: root
+
+ background: Item {
+ EdgeShadow {
+ edge: Qt.RightEdge
+ anchors {
+ right: parent.left
+ top: parent.top
+ bottom: parent.bottom
+ rightMargin: -1
+ }
+ }
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/SwipeListItem.qml b/kstars/kstarslite/kirigami-lib/src/controls/SwipeListItem.qml
new file mode 100644
index 0000000..632537a
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/SwipeListItem.qml
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2010 Marco Martin <notmart@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+
+import QtQuick 2.5
+import "private"
+import "templates" as T
+
+/**
+ * An item delegate Intended to support extra actions obtainable
+ * by uncovering them by dragging away the item with the handle
+ * This acts as a container for normal list items.
+ * Any subclass of AbstractListItem can be assigned as the contentItem property.
+ * @code
+ * ListView {
+ * model: myModel
+ * delegate: SwipeListItem {
+ * Label {
+ * text: model.text
+ * }
+ * actions: [
+ * Action {
+ * iconName: "document-decrypt"
+ * onTriggered: print("Action 1 clicked")
+ * },
+ * Action {
+ * iconName: model.action2Icon
+ * onTriggered: //do something
+ * }
+ * ]
+ * }
+ *
+ * }
+ * @endcode
+ *
+ * @inherit QtQuick.Item
+ */
+T.SwipeListItem {
+ id: root
+
+ background: DefaultListItemBackground {}
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/Theme.qml b/kstars/kstarslite/kirigami-lib/src/controls/Theme.qml
new file mode 100644
index 0000000..8012cda
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/Theme.qml
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.4
+
+pragma Singleton
+
+
+QtObject {
+ id: theme
+
+ property color textColor: "#31363b"
+ property color disabledTextColor: "#9931363b"
+
+ property color highlightColor: "#2196F3"
+ property color highlightedTextColor: "#eff0fa"
+ property color backgroundColor: "#eff0f1"
+ property color linkColor: "#2196F3"
+ property color visitedLinkColor: "#2196F3"
+
+ property color buttonTextColor: "#31363b"
+ property color buttonBackgroundColor: "#eff0f1"
+ property color buttonHoverColor: "#2196F3"
+ property color buttonFocusColor: "#2196F3"
+
+ property color viewTextColor: "#31363b"
+ property color viewBackgroundColor: "#fcfcfc"
+ property color viewHoverColor: "#2196F3"
+ property color viewFocusColor: "#2196F3"
+
+ property font defaultFont: fontMetrics.font
+
+ property list<QtObject> children: [
+ TextMetrics {
+ id: fontMetrics
+ }
+ ]
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/ToolBarApplicationHeader.qml b/kstars/kstarslite/kirigami-lib/src/controls/ToolBarApplicationHeader.qml
new file mode 100644
index 0000000..21968e5
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/ToolBarApplicationHeader.qml
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.5
+import QtQuick.Controls 1.3 as Controls
+import QtQuick.Layouts 1.2
+import QtQuick.Controls.Private 1.0
+import "private"
+import org.kde.kirigami 1.0
+
+
+/**
+ *
+ */
+ApplicationHeader {
+ id: header
+
+ preferredHeight: 34//spacer.height
+ maximumHeight: preferredHeight
+
+ Controls.ToolButton {
+ id: spacer
+ iconName: "go-previous"
+ visible: false
+ }
+
+ //FIXME: needs a property difinition to have its own type in qml
+ property string _internal: ""
+
+ pageDelegate: Item {
+ id: delegateItem
+ readonly property Page page: applicationWindow().pageStack.get(modelData)
+ property ListView view: ListView.view
+ readonly property bool current: __appWindow.pageStack.currentIndex == index
+ property Row layout
+
+ width: {
+ //more columns shown?
+ if (__appWindow.wideScreen) {
+ if (modelData == 0 && view.x > 0) {
+ return page.width - Math.max(0, view.x - __appWindow.contentItem.x);
+ } else {
+ return page.width;
+ }
+ } else {
+ return Math.min(view.width, delegateRoot.implicitWidth + Units.smallSpacing);
+ }
+ }
+ height: view.height
+
+ Component.onCompleted: {
+ layout = toolbarComponent.createObject(delegateItem)
+ }
+ Component {
+ id: toolbarComponent
+ Row {
+ id: layout
+ x: __appWindow.wideScreen ? (Math.min(delegateItem.width - width, Math.max(0, delegateItem.view.contentX - delegateItem.x))) : 0
+
+ Rectangle {
+ anchors.verticalCenter: parent.verticalCenter
+ color: Theme.textColor
+ opacity: 0.3
+ width: Units.devicePixelRatio
+ height: parent.height * 0.6
+ }
+ Controls.ToolButton {
+ anchors.verticalCenter: parent.verticalCenter
+ iconName: page && page.actions && page.actions.main ? page.actions.main.iconName : ""
+ text: page && page.actions && page.actions.main ? page.actions.main.text : ""
+ tooltip: page && page.actions && page.actions.main ? page.actions.main.text : ""
+ checkable: page && page.actions && page.actions.main && page.actions.main.checkable
+ checked: page && page.actions && page.actions.main && page.actions.main.checked
+ enabled: page && page.actions && page.actions.main && page.actions.main.enabled
+ opacity: enabled ? 1 : 0.4
+ visible: page && page.actions && page.actions.main && page.actions.main.visible
+ onClicked: page.actions.main.trigger();
+ }
+ Controls.ToolButton {
+ anchors.verticalCenter: parent.verticalCenter
+ iconName: page && page.actions && page.actions.left ? page.actions.left.iconName : ""
+ text: page && page.actions && page.actions.left ? page.actions.left.text : ""
+ tooltip: page && page.actions && page.actions.left ? page.actions.left.text : ""
+ checkable: page && page.actions && page.actions.left && page.actions.left.checkable
+ checked: page && page.actions && page.actions.left && page.actions.left.checked
+ enabled: page && page.actions && page.actions.left && page.actions.left.enabled
+ opacity: enabled ? 1 : 0.4
+ visible: page && page.actions && page.actions.left && page.actions.left && page.actions.left.visible
+ onClicked: page.actions.left.trigger();
+ }
+ Controls.ToolButton {
+ anchors.verticalCenter: parent.verticalCenter
+ iconName: page && page.actions && page.actions.right ? page.actions.right.iconName : ""
+ text: page && page.actions && page.actions.right ? page.actions.right.text : ""
+ tooltip: page && page.actions && page.actions.right ? page.actions.right.text : ""
+ checkable: page && page.actions && page.actions.right && page.actions.right.checkable
+ checked: page && page.actions && page.actions.right && page.actions.right.checked
+ enabled: page && page.actions && page.actions.right && page.actions.right.enabled
+ opacity: enabled ? 1 : 0.4
+ visible: page && page.actions && page.actions.right && page.actions.right && page.actions.right.visible
+ onClicked: page.actions.right.trigger();
+ }
+ Rectangle {
+ anchors.verticalCenter: parent.verticalCenter
+ color: Theme.textColor
+ opacity: 0.3
+ width: Units.devicePixelRatio
+ height: parent.height * 0.6
+ }
+ Repeater {
+ id: repeater
+ model: page && page.actions.contextualActions ? page.actions.contextualActions : null
+ delegate: Controls.ToolButton {
+ anchors.verticalCenter: parent.verticalCenter
+ iconName: modelData.iconName
+ text: modelData.text
+ tooltip: modelData.text
+ checkable: modelData.checkable
+ checked: modelData.checked
+ enabled: modelData.enabled
+ opacity: enabled ? 1 : 0.4
+ visible: modelData.visible && x+layout.x+width*2 < delegateItem.width
+ onClicked: modelData.trigger();
+ }
+ }
+ }
+ }
+ Heading {
+ x: __appWindow.wideScreen ? (Math.min(delegateItem.width - width, Math.max(0, delegateItem.view.contentX - delegateItem.x))) : 0
+ anchors.verticalCenter: parent.verticalCenter
+ visible: layout.width <= 0
+ opacity: delegateItem.current ? 1 : 0.4
+ color: Theme.textColor
+ elide: Text.ElideRight
+ text: page ? page.title : ""
+ font.pixelSize: parent.height / 1.6
+ }
+ Controls.ToolButton {
+ id: moreButton
+ anchors {
+ right: parent.right
+ verticalCenter: parent.verticalCenter
+ }
+
+ //TODO: we need a kebab icon
+ iconName: "application-menu"
+ visible: menu.visibleChildren > 0
+ onClicked: page.actions.main
+
+ menu: Controls.Menu {
+ id: menu
+
+ property int visibleChildren: 0
+ Instantiator {
+ model: page && page.actions.contextualActions ? page.actions.contextualActions : null
+ delegate: Controls.MenuItem {
+ text: modelData ? modelData.text : ""
+ iconName: modelData.iconName
+ shortcut: modelData.shortcut
+ onTriggered: modelData.trigger();
+ //skip the 3 buttons and 2 separators
+ visible: !layout.children[index+5].visible && modelData.visible
+ enabled: modelData.enabled
+ onVisibleChanged: {
+ if (visible) {
+ menu.visibleChildren++;
+ } else {
+ menu.visibleChildren = Math.max(0, menu.visibleChildren-1);
+ }
+ }
+ }
+ onObjectAdded: {
+ menu.insertItem(index, object);
+ if (object.visible) {
+ menu.visibleChildren++;
+ }
+ }
+ onObjectRemoved: {
+ menu.removeItem(object);
+ if (object.visible) {
+ menu.visibleChildren = Math.max(0, menu.visibleChildren-1);
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/Units.qml b/kstars/kstarslite/kirigami-lib/src/controls/Units.qml
new file mode 100644
index 0000000..a7b2fc3
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/Units.qml
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.4
+import QtQuick.Controls.Private 1.0
+import QtQuick.Window 2.2
+
+pragma Singleton
+
+
+QtObject {
+ id: units
+
+ /**
+ * The fundamental unit of space that should be used for sizes, expressed in pixels.
+ * Given the screen has an accurate DPI settings, it corresponds to a width of
+ * the capital letter M
+ */
+ property int gridUnit: fontMetrics.height
+
+ /**
+ * units.iconSizes provides access to platform-dependent icon sizing
+ *
+ * The icon sizes provided are normalized for different DPI, so icons
+ * will scale depending on the DPI.
+ *
+ * Icon sizes from KIconLoader, adjusted to devicePixelRatio:
+ * * small
+ * * smallMedium
+ * * medium
+ * * large
+ * * huge
+ * * enormous
+ *
+ * Not devicePixelRation-adjusted::
+ * * desktop
+ */
+ property QtObject iconSizes: QtObject {
+ property int small: 16 * devicePixelRatio * (Settings.isMobile ? 1.5 : 1)
+ property int smallMedium: 22 * devicePixelRatio * (Settings.isMobile ? 1.5 : 1)
+ property int medium: 32 * devicePixelRatio * (Settings.isMobile ? 1.5 : 1)
+ property int large: 48 * devicePixelRatio * (Settings.isMobile ? 1.5 : 1)
+ property int huge: 64 * devicePixelRatio * (Settings.isMobile ? 1.5 : 1)
+ property int enormous: 128 * devicePixelRatio * (Settings.isMobile ? 1.5 : 1)
+ }
+
+ /**
+ * units.smallSpacing is the amount of spacing that should be used around smaller UI elements,
+ * for example as spacing in Columns. Internally, this size depends on the size of
+ * the default font as rendered on the screen, so it takes user-configured font size and DPI
+ * into account.
+ */
+ property int smallSpacing: gridUnit/4
+
+ /**
+ * units.largeSpacing is the amount of spacing that should be used inside bigger UI elements,
+ * for example between an icon and the corresponding text. Internally, this size depends on
+ * the size of the default font as rendered on the screen, so it takes user-configured font
+ * size and DPI into account.
+ */
+ property int largeSpacing: gridUnit
+
+ /**
+ * The ratio between physical and device-independent pixels. This value does not depend on the \
+ * size of the configured font. If you want to take font sizes into account when scaling elements,
+ * use theme.mSize(theme.defaultFont), units.smallSpacing and units.largeSpacing.
+ * The devicePixelRatio follows the definition of "device independent pixel" by Microsoft.
+ */
+ property real devicePixelRatio: fontMetrics.font.pixelSize / (fontMetrics.font.pointSize * 1.33)
+
+ /**
+ * units.longDuration should be used for longer, screen-covering animations, for opening and
+ * closing of dialogs and other "not too small" animations
+ */
+ property int longDuration: 250
+
+ /**
+ * units.shortDuration should be used for short animations, such as accentuating a UI event,
+ * hover events, etc..
+ */
+ property int shortDuration: 150
+
+ /**
+ * metrics used by the default font
+ */
+ property variant fontMetrics: TextMetrics {
+ text: "M"
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/private/ActionButton.qml b/kstars/kstarslite/kirigami-lib/src/controls/private/ActionButton.qml
new file mode 100644
index 0000000..ec2c9f5
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/private/ActionButton.qml
@@ -0,0 +1,399 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.2
+import QtGraphicalEffects 1.0
+import org.kde.kirigami 1.0
+
+import "../templates/private"
+
+Item {
+ id: root
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom:parent.bottom
+ }
+ //smallSpacing for the shadow
+ height: button.height + Units.smallSpacing
+ clip: true
+
+ //either Action or QAction should work here
+ property QtObject action: pageStack.currentItem ? pageStack.currentItem.mainAction : null
+ property QtObject leftAction: pageStack.currentItem ? pageStack.currentItem.leftAction : null
+ property QtObject rightAction: pageStack.currentItem ? pageStack.currentItem.rightAction : null
+
+ onWidthChanged: button.x = root.width/2 - button.width/2
+
+ transform: Translate {
+ id: translateTransform
+ }
+
+ Item {
+ id: button
+
+ anchors {
+ bottom: parent.bottom
+ bottomMargin: Units.smallSpacing
+ }
+ implicitWidth: implicitHeight + Units.iconSizes.smallMedium*3
+ implicitHeight: Units.iconSizes.large + Units.largeSpacing
+
+
+ onXChanged: {
+ if (mouseArea.pressed || edgeMouseArea.pressed || fakeContextMenuButton.pressed) {
+ if (globalDrawer && globalDrawer.enabled && globalDrawer.modal) {
+ globalDrawer.position = Math.min(1, Math.max(0, (x - root.width/2 + button.width/2)/globalDrawer.contentItem.width + mouseArea.drawerShowAdjust));
+ }
+ if (contextDrawer && contextDrawer.enabled && contextDrawer.modal) {
+ contextDrawer.position = Math.min(1, Math.max(0, (root.width/2 - button.width/2 - x)/contextDrawer.contentItem.width + mouseArea.drawerShowAdjust));
+ }
+ }
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+
+ visible: action != null || leftAction != null || rightAction != null
+ property bool internalVisibility: (applicationWindow === undefined || (applicationWindow().controlsVisible && applicationWindow().height > root.height*2)) && (root.action === null || root.action.visible === undefined || root.action.visible)
+ preventStealing: true
+ onInternalVisibilityChanged: {
+ showAnimation.running = false;
+ if (internalVisibility) {
+ showAnimation.to = 0;
+ } else {
+ showAnimation.to = button.height;
+ }
+ showAnimation.running = true;
+ }
+
+ drag {
+ target: button
+ //filterChildren: true
+ axis: Drag.XAxis
+ minimumX: contextDrawer && contextDrawer.enabled && contextDrawer.modal ? 0 : root.width/2 - button.width/2
+ maximumX: globalDrawer && globalDrawer.enabled && globalDrawer.modal ? root.width : root.width/2 - button.width/2
+ }
+
+ property var downTimestamp;
+ property int startX
+ property int startMouseY
+ property real drawerShowAdjust
+ property bool buttonPressedUnderMouse: false
+ property bool leftButtonPressedUnderMouse: false
+ property bool rightButtonPressedUnderMouse: false
+
+ onPressed: {
+ //search if we have a page to set to current
+ if (applicationWindow !== undefined && applicationWindow().pageStack.currentIndex !== undefined) {
+ //search the button parent's parent, that is the page parent
+ //this will make the context drawer open for the proper page
+ applicationWindow().pageStack.currentIndex = root.parent.parent.parent.level;
+ }
+ downTimestamp = (new Date()).getTime();
+ startX = button.x + button.width/2;
+ startMouseY = mouse.y;
+ drawerShowAdjust = 0;
+ buttonPressedUnderMouse = mouse.x > buttonGraphics.x && mouse.x < buttonGraphics.x + buttonGraphics.width;
+ leftButtonPressedUnderMouse = !buttonPressedUnderMouse && leftAction && mouse.x < buttonGraphics.x;
+ rightButtonPressedUnderMouse = !buttonPressedUnderMouse && rightAction && mouse.x > buttonGraphics.x + buttonGraphics.width;
+ }
+ onReleased: {
+ //pixel/second
+ var x = button.x + button.width/2;
+ var speed = ((x - startX) / ((new Date()).getTime() - downTimestamp) * 1000);
+ drawerShowAdjust = 0;
+
+ //project where it would be a full second in the future
+ if (globalDrawer && globalDrawer.modal && x + speed > Math.min(root.width/4*3, root.width/2 + globalDrawer.contentItem.width/2)) {
+ globalDrawer.open();
+ contextDrawer.close();
+ } else if (contextDrawer && x + speed < Math.max(root.width/4, root.width/2 - contextDrawer.contentItem.width/2)) {
+ if (contextDrawer && contextDrawer.modal) {
+ contextDrawer.open();
+ }
+ if (globalDrawer && globalDrawer.modal) {
+ globalDrawer.close();
+ }
+ } else {
+ if (globalDrawer && globalDrawer.modal) {
+ globalDrawer.close();
+ }
+ if (contextDrawer && contextDrawer.modal) {
+ contextDrawer.close();
+ }
+ }
+ //Don't rely on native onClicked, but fake it here:
+ //Qt.startDragDistance is not adapted to devices dpi in case
+ //of Android, so consider the button "clicked" when:
+ //*the button has been dragged less than a gridunit
+ //*the finger is still on the button
+ if (Math.abs((button.x + button.width/2) - startX) < Units.gridUnit &&
+ mouse.y > 0) {
+ var action;
+ if (buttonPressedUnderMouse) {
+ action = root.action;
+ } else if (leftButtonPressedUnderMouse) {
+ action = root.leftAction;
+ } else if (rightButtonPressedUnderMouse) {
+ action = root.rightAction;
+ }
+
+ if (!action) {
+ return;
+ }
+
+ //if an action has been assigned, trigger it
+ if (action && action.trigger) {
+ action.trigger();
+ }
+ }
+ }
+
+ onPositionChanged: {
+ drawerShowAdjust = Math.min(0.3, Math.max(0, (startMouseY - mouse.y)/(Units.gridUnit*15)));
+ button.xChanged();
+ }
+ onPressAndHold: {
+ var action;
+ if (buttonPressedUnderMouse) {
+ action = root.action;
+ } else if (leftButtonPressedUnderMouse) {
+ action = root.leftAction;
+ } else if (rightButtonPressedUnderMouse) {
+ action = root.rightAction;
+ }
+
+ if (!action) {
+ return;
+ }
+
+ //if an action has been assigned, show a message like a tooltip
+ if (action && action.text) {
+ showPassiveNotification(action.text);
+ }
+ }
+ Connections {
+ target: globalDrawer
+ onPositionChanged: {
+ if ( globalDrawer && globalDrawer.modal && !mouseArea.pressed && !edgeMouseArea.pressed && !fakeContextMenuButton.pressed) {
+ button.x = globalDrawer.contentItem.width * globalDrawer.position + root.width/2 - button.width/2;
+ }
+ }
+ }
+ Connections {
+ target: contextDrawer
+ onPositionChanged: {
+ if (contextDrawer && contextDrawer.modal && !mouseArea.pressed && !edgeMouseArea.pressed && !fakeContextMenuButton.pressed) {
+ button.x = root.width/2 - button.width/2 - contextDrawer.contentItem.width * contextDrawer.position;
+ }
+ }
+ }
+
+ NumberAnimation {
+ id: showAnimation
+ target: translateTransform
+ properties: "y"
+ duration: Units.longDuration
+ easing.type: mouseArea.internalVisibility == true ? Easing.InQuad : Easing.OutQuad
+ }
+ Item {
+ id: background
+ anchors {
+ fill: parent
+ }
+
+ Rectangle {
+ id: buttonGraphics
+ radius: width/2
+ anchors.centerIn: parent
+ height: parent.height - Units.smallSpacing*2
+ width: height
+ visible: root.action
+ readonly property bool pressed: root.action && ((mouseArea.buttonPressedUnderMouse && mouseArea.pressed) || root.action.checked)
+ color: pressed ? Theme.highlightColor : Theme.backgroundColor
+
+ Icon {
+ id: icon
+ source: root.action && root.action.iconName ? root.action.iconName : ""
+ selected: buttonGraphics.pressed
+ anchors {
+ fill: parent
+ margins: Units.smallSpacing
+ }
+ }
+ Behavior on color {
+ ColorAnimation {
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ Behavior on x {
+ NumberAnimation {
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+ //left button
+ Rectangle {
+ id: leftButtonGraphics
+ z: -1
+ anchors {
+ left: parent.left
+ verticalCenter: parent.verticalCenter
+ }
+ radius: Units.smallSpacing
+ height: buttonGraphics.height * 0.7
+ width: height + (root.action ? Units.iconSizes.smallMedium : 0)
+ visible: root.leftAction
+
+ readonly property bool pressed: root.leftAction && ((mouseArea.leftButtonPressedUnderMouse && mouseArea.pressed) || root.leftAction.checked)
+ color: pressed ? Theme.highlightColor : Theme.backgroundColor
+ Icon {
+ source: root.leftAction && root.leftAction.iconName ? root.leftAction.iconName : ""
+ width: height
+ selected: leftButtonGraphics.pressed
+ anchors {
+ left: parent.left
+ top: parent.top
+ bottom: parent.bottom
+ margins: Units.smallSpacing
+ }
+ }
+ }
+ //right button
+ Rectangle {
+ id: rightButtonGraphics
+ z: -1
+ anchors {
+ right: parent.right
+ verticalCenter: parent.verticalCenter
+ }
+ radius: Units.smallSpacing
+ height: buttonGraphics.height * 0.7
+ width: height + (root.action ? Units.iconSizes.smallMedium : 0)
+ visible: root.rightAction
+ readonly property bool pressed: root.rightAction && ((mouseArea.rightButtonPressedUnderMouse && mouseArea.pressed) || root.rightAction.checked)
+ color: pressed ? Theme.highlightColor : Theme.backgroundColor
+ Icon {
+ source: root.rightAction && root.rightAction.iconName ? root.rightAction.iconName : ""
+ width: height
+ selected: rightButtonGraphics.pressed
+ anchors {
+ right: parent.right
+ top: parent.top
+ bottom: parent.bottom
+ margins: Units.smallSpacing
+ }
+ }
+ }
+ }
+
+ DropShadow {
+ anchors.fill: background
+ horizontalOffset: 0
+ verticalOffset: Units.smallSpacing/3
+ radius: Units.gridUnit / 3.5
+ samples: 16
+ color: Qt.rgba(0, 0, 0, 0.5)
+ source: background
+ }
+ }
+ }
+
+ MouseArea {
+ id: fakeContextMenuButton
+ anchors {
+ right: edgeMouseArea.right
+ bottom: edgeMouseArea.bottom
+ margins: -1
+ }
+ drag {
+ target: button
+ //filterChildren: true
+ axis: Drag.XAxis
+ minimumX: contextDrawer && contextDrawer.enabled && contextDrawer.modal ? 0 : root.width/2 - button.width/2
+ maximumX: globalDrawer && globalDrawer.enabled && globalDrawer.modal ? root.width : root.width/2 - button.width/2
+ }
+ visible: root.parent.parent.actions.contextualActions.length > 0 && (applicationWindow === undefined || applicationWindow().wideScreen)
+
+ width: Units.iconSizes.medium
+ height: width
+
+ Rectangle {
+ color: Theme.viewBackgroundColor
+ opacity: parent.pressed ? 1 : 0.3
+ anchors.fill: parent
+ }
+
+ ContextIcon {
+ anchors.centerIn: parent
+ width: height
+ height: Units.iconSizes.smallMedium - Units.smallSpacing * 2
+ }
+
+ onPressed: mouseArea.onPressed(mouse)
+ onReleased: {
+ var pos = root.mapFromItem(fakeContextMenuButton, mouse.x, mouse.y);
+ if (pos.x < root.width/2 || (mouse.x > 0 && mouse.x < width)) {
+ contextDrawer.open();
+ } else {
+ contextDrawer.close();
+ }
+ if (globalDrawer.position > 0.5) {
+ globalDrawer.open();
+ } else {
+ globalDrawer.close();
+ }
+ }
+ layer.enabled: true
+ layer.effect: DropShadow {
+ horizontalOffset: 0
+ verticalOffset: 0
+ radius: Units.gridUnit
+ samples: 32
+ color: Qt.rgba(0, 0, 0, 0.5)
+ }
+ }
+
+ MouseArea {
+ id: edgeMouseArea
+ z:99
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ drag {
+ target: button
+ //filterChildren: true
+ axis: Drag.XAxis
+ minimumX: contextDrawer && contextDrawer.enabled && contextDrawer.modal ? 0 : root.width/2 - button.width/2
+ maximumX: globalDrawer && globalDrawer.enabled && globalDrawer.modal ? root.width : root.width/2 - button.width/2
+ }
+ height: Units.smallSpacing * 3
+
+ onPressed: mouseArea.onPressed(mouse)
+ onPositionChanged: mouseArea.positionChanged(mouse)
+ onReleased: mouseArea.released(mouse)
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/private/CornerShadow.qml b/kstars/kstarslite/kirigami-lib/src/controls/private/CornerShadow.qml
new file mode 100644
index 0000000..7ebc7f6
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/private/CornerShadow.qml
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtGraphicalEffects 1.0
+import org.kde.kirigami 1.0
+
+RadialGradient {
+ id: shadow
+ /**
+ * corner: enumeration
+ * This property holds the corner of the shadow that will determine
+ * the direction of the gradient.
+ * The acceptable values are:
+ * Qt.TopLeftCorner, TopRightCorner, BottomLeftCorner, BottomRightCorner
+ */
+ property int corner: Qt.TopRightCorner
+
+ width: Units.gridUnit/2
+ height: Units.gridUnit/2
+
+ horizontalOffset: {
+ switch (corner) {
+ case Qt.TopLeftCorner:
+ case Qt.BottomLeftCorner:
+ return -width/2;
+ default:
+ return width/2;
+ }
+ }
+ verticalOffset: {
+ switch (corner) {
+ case Qt.TopLeftCorner:
+ case Qt.TopRightCorner:
+ return -width/2;
+ default:
+ return width/2;
+ }
+ }
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: Qt.rgba(0, 0, 0, 0.2)
+ }
+ GradientStop {
+ position: 0.3
+ color: Qt.rgba(0, 0, 0, 0.1)
+ }
+ GradientStop {
+ position: 1.0
+ color: "transparent"
+ }
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/private/DefaultListItemBackground.qml b/kstars/kstarslite/kirigami-lib/src/controls/private/DefaultListItemBackground.qml
new file mode 100644
index 0000000..4f0b5b9
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/private/DefaultListItemBackground.qml
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import org.kde.kirigami 1.0
+import QtQuick.Controls 1.0 as Controls
+import QtQuick.Controls.Private 1.0
+
+Rectangle {
+ color: listItem.checked || (listItem.pressed && !listItem.checked && !listItem.sectionDelegate) ? Theme.highlightColor : Theme.viewBackgroundColor
+
+ visible: listItem.ListView.view ? listItem.ListView.view.highlight === null : true
+ Rectangle {
+ anchors.fill: parent
+ visible: !Settings.isMobile
+ color: Theme.highlightColor
+ opacity: listItem.containsMouse && !listItem.pressed ? 0.2 : 0
+ Behavior on opacity { NumberAnimation { duration: Units.longDuration } }
+ }
+ Behavior on color {
+ ColorAnimation { duration: Units.longDuration }
+ }
+
+ Rectangle {
+ id: separator
+ color: Theme.textColor
+ opacity: 0.2
+ visible: listItem.separatorVisible
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ height: Math.ceil(Units.smallSpacing / 5);
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/private/EdgeShadow.qml b/kstars/kstarslite/kirigami-lib/src/controls/private/EdgeShadow.qml
new file mode 100644
index 0000000..8f4052b
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/private/EdgeShadow.qml
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtGraphicalEffects 1.0
+import org.kde.kirigami 1.0
+
+LinearGradient {
+ id: shadow
+ /**
+ * edge: enumeration
+ * This property holds the edge of the shadow that will determine
+ * the direction of the gradient.
+ * The acceptable values are:
+ * Qt.TopEdge: The top edge of the content item.
+ * Qt.LeftEdge: The left edge of the content item (default).
+ * Qt.RightEdge: The right edge of the content item.
+ * Qt.BottomEdge: The bottom edge of the content item.
+ */
+ property int edge: Qt.LeftEdge
+
+ width: Units.gridUnit/2
+ height: Units.gridUnit/2
+
+ start: Qt.point((edge != Qt.RightEdge ? 0 : width), (edge != Qt.BottomEdge ? 0 : height))
+ end: Qt.point((edge != Qt.LeftEdge ? 0 : width), (edge != Qt.TopEdge ? 0 : height))
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: Qt.rgba(0, 0, 0, 0.2)
+ }
+ GradientStop {
+ position: 0.3
+ color: Qt.rgba(0, 0, 0, 0.1)
+ }
+ GradientStop {
+ position: 1.0
+ color: "transparent"
+ }
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/private/PageActionPropertyGroup.qml b/kstars/kstarslite/kirigami-lib/src/controls/private/PageActionPropertyGroup.qml
new file mode 100644
index 0000000..2ee0adf
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/private/PageActionPropertyGroup.qml
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQml 2.1
+
+QtObject {
+ id: actionsGroup
+ property QtObject main
+ property QtObject left
+ property QtObject right
+ property list<QtObject> contextualActions
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/private/RefreshableScrollView.qml b/kstars/kstarslite/kirigami-lib/src/controls/private/RefreshableScrollView.qml
new file mode 100644
index 0000000..ba2b029
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/private/RefreshableScrollView.qml
@@ -0,0 +1,295 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.5
+import QtQuick.Controls 1.3 as Controls
+import QtGraphicalEffects 1.0
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+
+/**
+ * RefreshableScrollView is a scroll view for any Flickable that supports the
+ * "scroll down to refresh" behavior, and also allows the contents of the
+ * flickable to have more top margins in order to make possible to scroll down the list
+ * to reach it with the thumb while using the phone with a single hand.
+ *
+ * Example usage:
+ *
+ * @code
+ * import org.kde.kirigami 1.0 as Kirigami
+ * [...]
+ *
+ * Kirigami.RefreshableScrollView {
+ * id: view
+ * supportsRefreshing: true
+ * onRefreshingChanged: {
+ * if (refreshing) {
+ * myModel.refresh();
+ * }
+ * }
+ * ListView {
+ * //NOTE: MyModel doesn't come from the components,
+ * //it's purely an example on how it can be used together
+ * //some application logic that can update the list model
+ * //and signals when it's done.
+ * model: MyModel {
+ * onRefreshDone: view.refreshing = false;
+ * }
+ * delegate: BasicListItem {}
+ * }
+ * }
+ * [...]
+ *
+ * @endcode
+ *
+ * @inherit QtQuick.Controls.Scrollview
+ */
+Controls.ScrollView {
+ id: root
+
+ /**
+ * type: bool
+ * If true the list is asking for refresh and will show a loading spinner.
+ * it will automatically be set to true when the user pulls down enough the list.
+ * This signals the application logic to start its refresh procedure.
+ * The application itself will have to set back this property to false when done.
+ */
+ property bool refreshing: false
+
+ /**
+ * type: bool
+ * If true the list supports the "pull down to refresh" behavior.
+ */
+ property bool supportsRefreshing: false
+
+ /**
+ * leftPadding: int
+ * default contents padding at left
+ */
+ property int leftPadding: Units.gridUnit
+
+ /**
+ * topPadding: int
+ * default contents padding at top
+ */
+ property int topPadding: Units.gridUnit
+
+ /**
+ * rightPadding: int
+ * default contents padding at right
+ */
+ property int rightPadding: Units.gridUnit
+
+ /**
+ * bottomPadding: int
+ * default contents padding at bottom
+ */
+ property int bottomPadding: Units.gridUnit
+
+
+ frameVisible: false
+
+ children: [
+ Item {
+ id: busyIndicatorFrame
+ z: 99
+ y: -root.flickableItem.contentY-height
+ width: root.flickableItem.width
+ height: busyIndicator.height + Units.gridUnit * 2
+ Controls.BusyIndicator {
+ id: busyIndicator
+ anchors.centerIn: parent
+ running: root.refreshing
+ visible: root.refreshing
+ //Android busywidget QQC seems to be broken at custom sizes
+ }
+ Rectangle {
+ id: spinnerProgress
+ anchors {
+ fill: busyIndicator
+ margins: Math.ceil(Units.smallSpacing/2)
+ }
+ radius: width
+ visible: supportsRefreshing && !refreshing && progress > 0
+ color: "transparent"
+ opacity: 0.8
+ border.color: Theme.viewBackgroundColor
+ border.width: Math.ceil(Units.smallSpacing/4)
+ property real progress: supportsRefreshing && !refreshing ? (parent.y/busyIndicatorFrame.height) : 0
+
+ }
+ ConicalGradient {
+ source: spinnerProgress
+ visible: spinnerProgress.visible
+ anchors.fill: spinnerProgress
+ gradient: Gradient {
+ GradientStop { position: 0.00; color: Theme.highlightColor }
+ GradientStop { position: spinnerProgress.progress; color: Theme.highlightColor }
+ GradientStop { position: spinnerProgress.progress + 0.01; color: "transparent" }
+ GradientStop { position: 1.00; color: "transparent" }
+ }
+ }
+
+ Rectangle {
+ color: Theme.textColor
+ opacity: 0.2
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+ //only show in ListViews
+ visible: root.flickableItem == root.contentItem
+ height: Math.ceil(Units.smallSpacing / 5);
+ }
+ onYChanged: {
+ if (y > busyIndicatorFrame.height*1.5 + topPadding && applicationWindow() && root.flickableItem.atYBeginning && applicationWindow().pageStack.anchors.bottomMargin == 0 && root.width < root.height) {
+ applicationWindow().reachableMode = true;
+ overshootResetTimer.restart();
+ canOvershootBackTimer.restart();
+ }
+
+ if (!supportsRefreshing) {
+ return;
+ }
+ if (!root.refreshing && y > busyIndicatorFrame.height/2 + topPadding) {
+ root.refreshing = true;
+ }
+ }
+ Timer {
+ id: overshootResetTimer
+ interval: 8000
+ onTriggered: {
+ applicationWindow().reachableMode = false;
+ }
+ }
+ //HACK?
+ Timer {
+ id: canOvershootBackTimer
+ interval: 800
+ }
+ Connections {
+ target: root.flickableItem
+ onMovementEnded: {
+ if (!canOvershootBackTimer.running &&
+ applicationWindow().reachableMode) {
+ applicationWindow().reachableMode = false;
+ }
+ }
+ }
+ Binding {
+ target: root.flickableItem
+ property: "topMargin"
+ value: applicationWindow().wideScreen ? 0 : Math.max(root.topPadding + (root.refreshing ? busyIndicatorFrame.height : 0), applicationWindow().header.height)
+ }
+
+ Binding {
+ target: root.flickableItem
+ property: "flickableDirection"
+ value: Flickable.VerticalFlick
+ }
+
+ Binding {
+ target: root.flickableItem
+ property: "bottomMargin"
+ value: Units.gridUnit * 5
+ }
+
+ Binding {
+ target: root.contentItem
+ property: "width"
+ value: root.flickableItem.width
+ }
+
+ //FIXME: this shouldn't exist
+ Timer {
+ id: resetTimer
+ interval: 100
+ onTriggered: {
+ if (applicationWindow() && applicationWindow().header && !applicationWindow().wideScreen) {
+ flickableItem.contentY = -applicationWindow().header.preferredHeight;
+ }
+
+ if (root.contentItem == root.flickableItem) {
+ flickableItem.anchors.leftMargin = 0;
+ flickableItem.anchors.topMargin = 0;
+ flickableItem.anchors.rightMargin = 0;
+ flickableItem.anchors.bottomMargin = 0;
+ } else {
+ flickableItem.anchors.leftMargin = leftPadding;
+ flickableItem.anchors.topMargin = topPadding;
+ flickableItem.anchors.rightMargin = rightPadding;
+ flickableItem.anchors.bottomMargin = bottomPadding;
+ }
+ }
+ }
+ }
+ ]
+
+ onHeightChanged: {
+ if (!applicationWindow() || !applicationWindow().activeFocusItem) {
+ return;
+ }
+
+ //NOTE: there is no function to know if an item is descended from another,
+ //so we have to walk the parent hyerarchy by hand
+ var isDescendent = false;
+ var candidate = applicationWindow().activeFocusItem.parent;
+ while (candidate) {
+ if (candidate == root) {
+ isDescendent = true;
+ break;
+ }
+ candidate = candidate.parent;
+ }
+ if (!isDescendent) {
+ return;
+ }
+
+ var cursorY = 0;
+ if (applicationWindow().activeFocusItem.cursorPosition !== undefined) {
+ cursorY = applicationWindow().activeFocusItem.positionToRectangle(applicationWindow().activeFocusItem.cursorPosition).y;
+ }
+
+ var pos = applicationWindow().activeFocusItem.mapToItem(root.contentItem, 0, cursorY);
+
+ //focused item alreqady visible? add some margin for the space of the action buttons
+ if (pos.y >= root.flickableItem.contentY && pos.y <= root.flickableItem.contentY + root.flickableItem.height - Units.gridUnit * 8) {
+ return;
+ }
+ root.flickableItem.contentY = pos.y;
+ }
+
+ onLeftPaddingChanged: {
+ if (root.contentItem == root.flickableItem) {
+ flickableItem.anchors.leftMargin = 0;
+ flickableItem.anchors.topMargin = 0;
+ flickableItem.anchors.rightMargin = 0;
+ flickableItem.anchors.bottomMargin = 0;
+ } else {
+ flickableItem.anchors.leftMargin = leftPadding;
+ flickableItem.anchors.topMargin = topPadding;
+ flickableItem.anchors.rightMargin = rightPadding;
+ flickableItem.anchors.bottomMargin = bottomPadding;
+ }
+ }
+
+ onFlickableItemChanged: resetTimer.restart()
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/qmldir b/kstars/kstarslite/kirigami-lib/src/controls/qmldir
new file mode 100644
index 0000000..46d452e
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/qmldir
@@ -0,0 +1,7 @@
+module org.kde.kirigami
+plugin kirigamiplugin
+classname KirigamiPlugin
+depends QtQuick.Controls 1.4
+depends QtQuick.Controls.Private 1.0
+designersupported
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/AbstractApplicationHeader.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/AbstractApplicationHeader.qml
new file mode 100644
index 0000000..6b4aa5e
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/AbstractApplicationHeader.qml
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.5
+import QtQuick.Layouts 1.2
+import "private"
+import org.kde.kirigami 1.0
+
+
+/**
+ * An item that can be used as a title for the application.
+ * Scrolling the main page will make it taller or shorter (trough the point of going away)
+ * It's a behavior similar to the typical mobile web browser adressbar
+ * the minimum, preferred and maximum heights of the item can be controlled with
+ * * minimumHeight: default is 0, i.e. hidden
+ * * preferredHeight: default is Units.gridUnit * 1.6
+ * * preferredHeight: default is Units.gridUnit * 3
+ *
+ * To achieve a titlebar that stays completely fixed just set the 3 sizes as the same
+ */
+Item {
+ id: root
+ z: 90
+ property int minimumHeight: 0
+ property int preferredHeight: Units.gridUnit * 2
+ property int maximumHeight: Units.gridUnit * 3
+ default property alias contentItem: mainItem.data
+
+ parent: __appWindow.contentItem.parent
+ //FIXME: remove
+ property QtObject __appWindow: applicationWindow();
+
+ anchors {
+ top: parent.top
+ left: parent.left
+ right: parent.right
+ }
+ height: preferredHeight
+
+ /**
+ * background: Item
+ * This property holds the background item.
+ * Note: the background will be automatically sized as the whole control
+ */
+ property Item background
+
+ onBackgroundChanged: {
+ background.z = -1;
+ background.parent = root;
+ background.anchors.fill = root;
+ }
+
+ Behavior on height {
+ enabled: __appWindow.pageStack.currentItem && __appWindow.pageStack.currentItem.flickable && !__appWindow.pageStack.currentItem.flickable.moving
+ NumberAnimation {
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+
+ opacity: height > 0 && -translateTransform.y <= height ? 1 : 0
+ Behavior on opacity {
+ OpacityAnimator {
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+
+ Connections {
+ target: __appWindow
+ onWideScreenChanged: {
+ if (wideScreen) {
+ height = preferredHeight;
+ } else {
+ height = preferredHeight;
+ }
+ }
+ onHeightChanged: root.height = preferredHeight;
+ onReachableModeChanged: root.height = __appWindow.reachableMode && !__appWindow.wideScreen ? maximumHeight : preferredHeight;
+ }
+
+ transform: Translate {
+ id: translateTransform
+ y: {
+ if (__appWindow === undefined) {
+ return 0;
+ }
+ if (__appWindow.reachableMode && !__appWindow.wideScreen) {
+ return __appWindow.height/2;
+ } else if (!__appWindow.controlsVisible) {
+ return -headerItem.height - Units.smallSpacing;
+ } else {
+ return 0;
+ }
+ }
+ Behavior on y {
+ NumberAnimation {
+ duration: Units.longDuration
+ easing.type: translateTransform.y < 0 ? Easing.OutQuad : Easing.InQuad
+ }
+ }
+ }
+
+ Item {
+ id: headerItem
+ anchors {
+ left: parent.left
+ right: parent.right
+ bottom: parent.bottom
+ }
+
+ height: parent.preferredHeight
+
+ Connections {
+ id: headerSlideConnection
+ target: __appWindow.pageStack.currentItem ? __appWindow.pageStack.currentItem.flickable : null
+ property int oldContentY
+ onContentYChanged: {
+ if (!__appWindow.pageStack.currentItem) {
+ return;
+ }
+ if (__appWindow.pageStack.currentItem.flickable.atYBeginning ||
+ __appWindow.pageStack.currentItem.flickable.atYEnd) {
+ return;
+ }
+
+ if (__appWindow.wideScreen) {
+ root.height = root.preferredHeight;
+ } else if (__appWindow.reachableMode && !__appWindow.wideScreen) {
+ root.height = root.maximumHeight;
+ } else {
+ root.height = Math.min(root.preferredHeight,
+ Math.max(root.minimumHeight,
+ root.height + oldContentY - __appWindow.pageStack.currentItem.flickable.contentY));
+ oldContentY = __appWindow.pageStack.currentItem.flickable.contentY;
+ }
+ }
+ onMovementEnded: {
+ if (root.height > root.preferredHeight) {
+ //if don't change the position if more then preferredSize is shown
+ } else if (root.height > root.preferredHeight/2 ) {
+ root.height = root.preferredHeight;
+ } else {
+ root.height = 0;
+ }
+ }
+ }
+ Connections {
+ target: __appWindow.pageStack
+ onCurrentItemChanged: {
+ if (!__appWindow.pageStack.currentItem) {
+ return;
+ }
+ if (__appWindow.pageStack.currentItem.flickable) {
+ headerSlideConnection.oldContentY = __appWindow.pageStack.currentItem.flickable.contentY;
+ } else {
+ headerSlideConnection.oldContentY = 0;
+ }
+ root.height = root.preferredHeight;
+ }
+ }
+
+ Item {
+ id: mainItem
+ anchors {
+ fill: parent
+ topMargin: applicationWindow().reachable ? 0 : Math.min(headerItem.height - root.height, headerItem.height - root.preferredHeight)
+ }
+ }
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/AbstractListItem.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/AbstractListItem.qml
new file mode 100644
index 0000000..9583dc5
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/AbstractListItem.qml
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2010 Marco Martin <notmart@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.0
+import QtQuick.Controls 1.0 as Controls
+import QtQuick.Controls.Private 1.0
+import org.kde.kirigami 1.0
+
+/**
+ * An item delegate for the primitive ListView component.
+ *
+ * It's intended to make all listviews look coherent.
+ *
+ * @inherit QtQuick.Item
+ */
+Rectangle {
+ id: listItem
+
+ /**
+ * contentItem: Item
+ * This property holds the visual content item.
+ *
+ * Note: The content item is automatically resized inside the
+ * padding of the control.
+ */
+ default property Item contentItem
+
+ /**
+ * supportsMouseEvents: bool
+ * Holds if the item emits signals related to mouse interaction.
+ *TODO: remove
+ * The default value is false.
+ */
+ property alias supportsMouseEvents: itemMouse.enabled
+
+ /**
+ * clicked: signal
+ * This signal is emitted when there is a click.
+ *
+ * This is disabled by default, set enabled to true to use it.
+ * @see enabled
+ */
+ signal clicked
+
+
+ /**
+ * pressAndHold: signal
+ * The user pressed the item with the mouse and didn't release it for a
+ * certain amount of time.
+ *
+ * This is disabled by default, set enabled to true to use it.
+ * @see enabled
+ */
+ signal pressAndHold
+
+ /**
+ * checked: bool
+ * If true makes the list item look as checked or pressed. It has to be set
+ * from the code, it won't change by itself.
+ */
+ property bool checked: false
+
+ /**
+ * pressed: bool
+ * True when the user is pressing the mouse over the list item and
+ * supportsMouseEvents is set to true
+ */
+ property alias pressed: itemMouse.pressed
+
+ /**
+ * containsMouse: bool
+ * True when the user hover the mouse over the list item
+ * NOTE: on mobile touch devices this will be true only when pressed is also true
+ */
+ property alias containsMouse: itemMouse.containsMouse
+
+ /**
+ * sectionDelegate: bool
+ * If true the item will be a delegate for a section, so will look like a
+ * "title" for the items under it.
+ */
+ property bool sectionDelegate: false
+
+ /**
+ * separatorVisible: bool
+ * True if the separator between items is visible
+ * default: true
+ */
+ property bool separatorVisible: true
+
+ /**
+ * background: Item
+ * This property holds the background item.
+ *
+ * Note: If the background item has no explicit size specified,
+ * it automatically follows the control's size.
+ * In most cases, there is no need to specify width or
+ * height for a background item.
+ */
+ property Item background
+
+ implicitWidth: contentItem ? contentItem.childrenRect.width : 0
+
+ implicitHeight: contentItem.height + Units.smallSpacing * 5
+
+ width: parent ? parent.width : implicitWidth
+ Layout.fillWidth: true
+
+ opacity: enabled ? 1 : 0.6
+
+ height: visible ? implicitHeight : 0
+
+ onContentItemChanged: {
+ contentItem.parent = paddingItem;
+ }
+
+ Component.onCompleted: {
+ if (background) {
+ background.parent = itemMouse;
+ background.anchors.fill = itemMouse;
+ }
+ }
+
+ MouseArea {
+ id: itemMouse
+ anchors.fill: parent
+ enabled: true
+ hoverEnabled: !Settings.isMobile
+
+ onClicked: listItem.clicked()
+ onPressAndHold: listItem.pressAndHold()
+
+ Item {
+ id: paddingItem
+ z: 2
+ anchors {
+ fill: parent
+ margins: Units.smallSpacing
+ }
+ }
+ }
+
+ onBackgroundChanged: {
+ background.parent = itemMouse
+ }
+
+ Accessible.role: Accessible.ListItem
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/ApplicationHeader.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/ApplicationHeader.qml
new file mode 100644
index 0000000..b239b87
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/ApplicationHeader.qml
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.5
+import QtQuick.Layouts 1.2
+import QtQuick.Controls.Private 1.0
+import "private"
+import org.kde.kirigami 1.0
+
+
+/**
+ * An item that can be used as a title for the application.
+ * Scrolling the main page will make it taller or shorter (trough the point of going away)
+ * It's a behavior similar to the typical mobile web browser adressbar
+ * the minimum, preferred and maximum heights of the item can be controlled with
+ * * minimumHeight: default is 0, i.e. hidden
+ * * preferredHeight: default is Units.gridUnit * 1.6
+ * * maximumHeight: default is Units.gridUnit * 3
+ *
+ * To achieve a titlebar that stays completely fixed just set the 3 sizes as the same
+ */
+AbstractApplicationHeader {
+ id: header
+
+ /**
+ * separatorStyle: string
+ * The way the separator between pages should be drawn in the header.
+ * Allowed values are:
+ * * Breadcrumb: the pages are hyerarchical and the separator will look like a >
+ * * TabBar: the pages are intended to behave like tabbar pages
+ * and the separator will look limke a dot.
+ *
+ * When the heaer is in wide screen mode, no separator will be drawn.
+ */
+ property string separatorStyle: "Breadcrumb"
+
+ property alias pageDelegate: titleList.delegate
+
+ Rectangle {
+ anchors {
+ right: titleList.left
+ verticalCenter: parent.verticalCenter
+ }
+ visible: titleList.x > 0 && !titleList.atXBeginning
+ height: parent.height * 0.7
+ color: Theme.highlightedTextColor
+ width: Math.ceil(Units.smallSpacing / 6)
+ opacity: 0.4
+ }
+
+ ListView {
+ id: titleList
+ //uses this to have less strings comparisons
+ property bool isTabBar: header.separatorStyle == "TabBar"
+ Component.onCompleted: {
+ //only iOS and desktop systems put the back button on top left corner
+ if (!titleList.isTabBar && (!Settings.isMobile || Qt.platform.os == "ios")) {
+ var component = Qt.createComponent(Qt.resolvedUrl("private/BackButton.qml"));
+ titleList.backButton = component.createObject(titleList.parent);
+ }
+ }
+ property Item backButton
+ clip: true
+ anchors {
+ fill: parent
+ leftMargin: Math.max ((backButton ? backButton.width : Units.smallSpacing*2), __appWindow.contentItem.x)
+ }
+ cacheBuffer: width ? Math.max(0, width * count) : 0
+ displayMarginBeginning: __appWindow.pageStack.width * count
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ model: __appWindow.pageStack.depth
+ spacing: 0
+ currentIndex: __appWindow.pageStack && __appWindow.pageStack.currentIndex !== undefined ? __appWindow.pageStack.currentIndex : 0
+
+ function gotoIndex(idx) {
+ //don't actually scroll in widescreen mode
+ if (__appWindow.wideScreen) {
+ return;
+ }
+ listScrollAnim.running = false
+ var pos = titleList.contentX;
+ var destPos;
+ titleList.positionViewAtIndex(idx, ListView.Center);
+ destPos = titleList.contentX;
+ listScrollAnim.from = pos;
+ listScrollAnim.to = destPos;
+ listScrollAnim.running = true;
+ }
+
+ NumberAnimation {
+ id: listScrollAnim
+ target: titleList
+ property: "contentX"
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+
+ onCurrentIndexChanged: gotoIndex(currentIndex);
+ onModelChanged: gotoIndex(currentIndex);
+ onContentWidthChanged: gotoIndex(currentIndex);
+
+ onContentXChanged: {
+ if (__appWindow.wideScreen && !__appWindow.pageStack.contentItem.moving) {
+ //__appWindow.pageStack.contentItem.contentX = titleList.contentX
+ }
+ }
+ onHeightChanged: {
+ titleList.returnToBounds()
+ }
+ onMovementEnded: {
+ if (__appWindow.wideScreen) {
+ __appWindow.pageStack.contentItem.movementEnded();
+ }
+ }
+
+ NumberAnimation {
+ id: scrollTopAnimation
+ target: __appWindow.pageStack.currentItem && __appWindow.pageStack.currentItem.flickable ? __appWindow.pageStack.currentItem.flickable : null
+ property: "contentY"
+ to: 0
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+
+ delegate: MouseArea {
+ id: delegate
+ readonly property Page page: __appWindow.pageStack.get(modelData)
+ //NOTE: why not use ListViewCurrentIndex? because listview itself resets
+ //currentIndex in some situations (since here we are using an int as a model,
+ //even more often) so the property binding gets broken
+ readonly property bool current: __appWindow.pageStack.currentIndex == index
+
+ width: {
+ //more columns shown?
+ if (__appWindow.wideScreen && page) {
+ if (modelData == 0 && titleList.backButton) {
+ return page.width - Math.max(0, titleList.backButton.width - __appWindow.contentItem.x);
+ } else {
+ return page.width;
+ }
+ } else {
+ return Math.min(titleList.width, delegateRoot.implicitWidth + Units.smallSpacing);
+ }
+ }
+ height: titleList.height
+ onClicked: {
+ if (__appWindow.pageStack.currentIndex == modelData) {
+ //scroll up if current otherwise make current
+ if (!__appWindow.pageStack.currentItem.flickable) {
+ return;
+ }
+ if (__appWindow.pageStack.currentItem.flickable.contentY > -__appWindow.header.height) {
+ scrollTopAnimation.to = -__appWindow.pageStack.currentItem.flickable.topMargin;
+ scrollTopAnimation.running = true;
+ }
+
+ } else {
+ __appWindow.pageStack.currentIndex = modelData;
+ }
+ }
+
+ Row {
+ id: delegateRoot
+ x: Units.smallSpacing + __appWindow.wideScreen ? (Math.min(delegate.width - width, Math.max(0, titleList.contentX - delegate.x))) : 0
+ height: parent.height
+
+ spacing: Units.smallSpacing
+
+ Icon {
+ //in tabbar mode this is just a spacer
+ visible: (titleList.isTabBar || modelData > 0) && !__appWindow.wideScreen && opacity > 0
+ height: title.height
+ width: height
+ selected: header.background && header.background.color && header.background.color == Theme.highlightColor
+ source: titleList.isTabBar ? "" : "go-next"
+ }
+
+ Heading {
+ id: title
+ width:Math.min(titleList.width, implicitWidth)
+ anchors.verticalCenter: parent.verticalCenter
+ opacity: delegate.current ? 1 : 0.4
+ //Scaling animate NativeRendering is too slow
+ renderType: Text.QtRendering
+ color: header.background && header.background.color && header.background.color == Theme.highlightColor ? Theme.highlightedTextColor : Theme.textColor
+ elide: Text.ElideRight
+ text: page.title
+ font.pixelSize: titleList.height / 1.6
+ height: parent.height
+ Rectangle {
+ anchors {
+ bottom: parent.bottom
+ left: parent.left
+ right: parent.right
+ }
+ height: Units.smallSpacing
+ color: title.color
+ opacity: 0.6
+ visible: titleList.isTabBar && delegate.current
+ }
+ }
+ }
+ }
+ Connections {
+ target: __appWindow.wideScreen ? __appWindow.pageStack.contentItem : null
+ onContentXChanged: {
+ if (!titleList.contentItem.moving) {
+ titleList.contentX = __appWindow.pageStack.contentItem.contentX - __appWindow.pageStack.contentItem.originX + titleList.originX;
+ }
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/OverlayDrawer.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/OverlayDrawer.qml
new file mode 100644
index 0000000..12279ae
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/OverlayDrawer.qml
@@ -0,0 +1,459 @@
+/*
+ * Copyright 2012 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import org.kde.kirigami 1.0
+import "private"
+
+/**
+ * Overlay Drawers are used to expose additional UI elements needed for
+ * small secondary tasks for which the main UI elements are not needed.
+ * For example in Okular Active, an Overlay Drawer is used to display
+ * thumbnails of all pages within a document along with a search field.
+ * This is used for the distinct task of navigating to another page.
+ *
+ */
+AbstractDrawer {
+ id: root
+
+ z: modal ? (opened ? 100 : 99 ): 98
+
+//BEGIN Properties
+ /**
+ * page: Item
+ * It's the default property. it's the main content of the drawer page,
+ * the part that is always shown
+ */
+ default property alias page: mainPage.data
+
+ /**
+ * contentItem: Item
+ * It's the part that can be pulled in and out, will act as a sidebar.
+ */
+ property Item contentItem
+
+ /**
+ * background: Item
+ * This property holds the background item.
+ * Note: the background will be automatically sized as the whole control
+ */
+ property Item background
+
+ /**
+ * opened: bool
+ * If true the drawer is open showing the contents of the "drawer"
+ * component.
+ */
+ property alias opened: mainFlickable.open
+
+ /**
+ * edge: enumeration
+ * This property holds the edge of the content item at which the drawer
+ * will open from.
+ * The acceptable values are:
+ * Qt.TopEdge: The top edge of the content item.
+ * Qt.LeftEdge: The left edge of the content item (default).
+ * Qt.RightEdge: The right edge of the content item.
+ * Qt.BottomEdge: The bottom edge of the content item.
+ */
+ property int edge: Qt.LeftEdge
+
+ /**
+ * position: real
+ * This property holds the position of the drawer relative to its
+ * final destination. That is, the position will be 0 when the
+ * drawer is fully closed, and 1 when fully open.
+ */
+ property real position: 0
+
+ /**
+ * handleVisible: bool
+ * If true, a little handle will be visible to make opening the drawer easier
+ * Currently supported only on left and right drawers
+ */
+ property bool handleVisible: typeof(applicationWindow)===typeof(Function) && applicationWindow() ? applicationWindow().controlsVisible : true
+
+ /**
+ * modal: bool
+ * If true the drawer will be an overlay of the main content,
+ * obscuring it and blocking input.
+ * If false, the drawer will look like a sidebar, with the main content
+ * application still usable.
+ * It is recomended to use modal on mobile devices and not modal on desktop
+ * devices.
+ * Default is true
+ */
+ //property bool modal: true
+//END Properties
+
+
+//BEGIN Methods
+ /**
+ * open: function
+ * This method opens the drawer, animating the movement if a
+ * valid animation has been set.
+ */
+ function open () {
+ mainAnim.to = 0;
+ switch (root.edge) {
+ case Qt.RightEdge:
+ mainAnim.to = drawerPage.width;
+ break;
+ case Qt.BottomEdge:
+ mainAnim.to = drawerPage.height;
+ break;
+ case Qt.LeftEdge:
+ case Qt.TopEdge:
+ default:
+ mainAnim.to = 0;
+ break;
+ }
+ mainAnim.running = true;
+ mainFlickable.open = true;
+ }
+
+ /**
+ * close: function
+ * This method closes the drawer, animating the movement if a
+ * valid animation has been set.
+ */
+ function close () {
+ switch (root.edge) {
+ case Qt.RightEdge:
+ case Qt.BottomEdge:
+ mainAnim.to = 0;
+ break;
+ case Qt.LeftEdge:
+ mainAnim.to = drawerPage.width;
+ break;
+ case Qt.TopEdge:
+ mainAnim.to = drawerPage.height;
+ break;
+ }
+ mainAnim.running = true;
+ mainFlickable.open = false;
+ }
+
+ /**
+ * clicked: signal
+ * This signal is emitted when the drawer is clicked.
+ */
+//END Methods
+
+//BEGIN Signal handlers
+ onBackgroundChanged: {
+ background.z = 1;
+ background.parent = mainItem;
+ background.anchors.fill = drawerPage;
+ }
+
+ onPositionChanged: {
+ if (!mainFlickable.loopCheck) {
+ mainFlickable.loopCheck = true;
+ if (!mainFlickable.flicking && !mainFlickable.dragging && !mainAnim.running) {
+ switch (root.edge) {
+ case Qt.RightEdge:
+ mainFlickable.contentX = drawerPage.width * position;
+ break;
+ case Qt.LeftEdge:
+ mainFlickable.contentX = drawerPage.width * (1-position);
+ break;
+ case Qt.BottomEdge:
+ mainFlickable.contentY = drawerPage.height * position;
+ break;
+ }
+ }
+ mainFlickable.loopCheck = false;
+ }
+ }
+ onContentItemChanged: {
+ contentItem.parent = drawerPage
+ contentItem.anchors.fill = drawerPage
+ }
+//END Signal handlers
+
+ Item {
+ id: mainPage
+ anchors.fill: parent
+ onChildrenChanged: mainPage.children[0].anchors.fill = mainPage
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: "black"
+ opacity: 0.6 * mainFlickable.internalPosition
+ visible: root.modal
+ }
+
+
+ //NOTE: it's a PropertyAnimation instead of a NumberAnimation because
+ //NumberAnimation doesn't have NOTIFY signal on to property
+ PropertyAnimation {
+ id: mainAnim
+ target: mainFlickable
+ properties: (root.edge == Qt.RightEdge || root.edge == Qt.LeftEdge) ? "contentX" : "contentY"
+ duration: Units.longDuration
+ easing.type: mainAnim.to > 0 ? Easing.InQuad : Easing.OutQuad
+ }
+
+ MouseArea {
+ id: edgeMouse
+ anchors {
+ right: root.edge == Qt.LeftEdge ? undefined : parent.right
+ left: root.edge == Qt.RightEdge ? undefined : parent.left
+ top: root.edge == Qt.BottomEdge ? undefined : parent.top
+ bottom: root.edge == Qt.TopEdge ? undefined : parent.bottom
+ }
+ z: 99
+ width: Units.smallSpacing * 3
+ height: Units.smallSpacing * 3
+ property int startMouseX
+ property real oldMouseX
+ property int startMouseY
+ property real oldMouseY
+ property bool startDragging: false
+
+ function managePress(mouse) {
+ if (drawerPage.children.length == 0) {
+ mouse.accepted = false;
+ return;
+ }
+
+ speedSampler.restart();
+ mouse.accepted = true;
+ oldMouseX = startMouseX = mouse.x;
+ oldMouseY = startMouseY = mouse.y;
+ startDragging = false;
+ }
+ onPressed: {
+ managePress(mouse)
+ }
+
+ onPositionChanged: {
+ if (!root.contentItem) {
+ mouse.accepted = false;
+ return;
+ }
+
+ if (Math.abs(mouse.x - startMouseX) > root.width / 5 ||
+ Math.abs(mouse.y - startMouseY) > root.height / 5) {
+ startDragging = true;
+ }
+ if (startDragging) {
+ switch (root.edge) {
+ case Qt.RightEdge:
+ mainFlickable.contentX = Math.min(mainItem.width - root.width, mainFlickable.contentX + oldMouseX - mouse.x);
+ break;
+ case Qt.LeftEdge:
+ mainFlickable.contentX = Math.max(0, mainFlickable.contentX + oldMouseX - mouse.x);
+ break;
+ case Qt.BottomEdge:
+ mainFlickable.contentY = Math.min(mainItem.height - root.height, mainFlickable.contentY + oldMouseY - mouse.y);
+ break;
+ case Qt.TopEdge:
+ mainFlickable.contentY = Math.max(0, mainFlickable.contentY + oldMouseY - mouse.y);
+ break;
+ }
+ }
+ oldMouseX = mouse.x;
+ oldMouseY = mouse.y;
+ }
+ onReleased: {
+ if (!startDragging) {
+ return;
+ }
+ speedSampler.running = false;
+ if (speedSampler.speed != 0) {
+ if (root.edge == Qt.RightEdge || root.edge == Qt.LeftEdge) {
+ mainFlickable.flick(speedSampler.speed, 0);
+ } else {
+ mainFlickable.flick(0, speedSampler.speed);
+ }
+ } else {
+ if (mainFlickable.internalPosition > 0.5) {
+ root.open();
+ } else {
+ root.close();
+ }
+ }
+ }
+ }
+
+ MouseArea {
+ id: handleMouseArea
+ z:999
+ anchors {
+ right: root.edge == Qt.LeftEdge ? undefined : parent.right
+ left: root.edge == Qt.RightEdge ? undefined : parent.left
+ bottom: parent.bottom
+ leftMargin: root.opened ? drawerPage.width : 0
+ rightMargin: root.opened ? drawerPage.width : 0
+ }
+ visible: root.handleVisible && (root.edge == Qt.LeftEdge || root.edge == Qt.RightEdge)
+ width: Units.iconSizes.medium
+ height: width
+ onPressed: edgeMouse.managePress(mouse);
+ onPositionChanged: edgeMouse.positionChanged(mouse);
+ onReleased: edgeMouse.released(mouse);
+ onClicked: root.opened ? root.close() : root.open();
+ }
+
+ Timer {
+ id: speedSampler
+ interval: 100
+ repeat: true
+ property real speed
+ property real oldContentX
+ property real oldContentY
+ onTriggered: {
+ if (root.edge == Qt.RightEdge || root.edge == Qt.LeftEdge) {
+ speed = (mainFlickable.contentX - oldContentX) * 10;
+ oldContentX = mainFlickable.contentX;
+ } else {
+ speed = (mainFlickable.contentY - oldContentY) * 10;
+ oldContentY = mainFlickable.contentY;
+ }
+ }
+ onRunningChanged: {
+ if (running) {
+ speed = 0;
+ oldContentX = mainFlickable.contentX;
+ oldContentY = mainFlickable.contentY;
+ } else {
+ if (root.edge == Qt.RightEdge || root.edge == Qt.LeftEdge) {
+ speed = (oldContentX - mainFlickable.contentX) * 10;
+ } else {
+ speed = (oldContentY - mainFlickable.contentY) * 10;
+ }
+ }
+ }
+ }
+
+ MouseArea {
+ id: mainMouseArea
+ anchors.fill: parent
+ drag.filterChildren: true
+ onClicked: {
+ if ((root.edge == Qt.LeftEdge && mouse.x < drawerPage.width) ||
+ (root.edge == Qt.RightEdge && mouse.x > drawerPage.x - mainFlickable.contentX) ||
+ (root.edge == Qt.TopEdge && mouse.y < drawerPage.height) ||
+ (root.edge == Qt.BottomEdge && mouse.y > drawerPage.y - mainFlickable.contentY)) {
+ return;
+ }
+ root.clicked();
+ root.close();
+ }
+ enabled: (root.edge == Qt.LeftEdge && !mainFlickable.atXEnd) ||
+ (root.edge == Qt.RightEdge && !mainFlickable.atXBeginning) ||
+ (root.edge == Qt.TopEdge && !mainFlickable.atYEnd) ||
+ (root.edge == Qt.BottomEdge && !mainFlickable.atYBeginning) ||
+ mainFlickable.moving
+
+ Flickable {
+ id: mainFlickable
+ property bool open
+ anchors.fill: parent
+ interactive: root.modal
+ onOpenChanged: {
+ if (open) {
+ root.open();
+ Qt.inputMethod.hide();
+ } else {
+ root.close();
+ }
+ }
+ enabled: parent.enabled
+ flickableDirection: root.edge == Qt.LeftEdge || root.edge == Qt.RightEdge ? Flickable.HorizontalFlick : Flickable.VerticalFlick
+ contentWidth: mainItem.width
+ contentHeight: mainItem.height
+ boundsBehavior: Flickable.StopAtBounds
+ readonly property real internalPosition: {
+ switch (root.edge) {
+ case Qt.RightEdge:
+ return mainFlickable.contentX/drawerPage.width;
+ case Qt.LeftEdge:
+ return 1 - (mainFlickable.contentX/drawerPage.width);
+ case Qt.BottomEdge:
+ return mainFlickable.contentY/drawerPage.height;
+ case Qt.TopEdge:
+ return 1 - (mainFlickable.contentY/drawerPage.height);
+ }
+ }
+ property bool loopCheck: false
+ onInternalPositionChanged: {
+ if (!loopCheck) {
+ loopCheck = true;
+ root.position = internalPosition;
+ loopCheck = false;
+ }
+ }
+
+ onFlickingChanged: {
+ if (!flicking) {
+ if (internalPosition > 0.5) {
+ root.open();
+ } else {
+ root.close();
+ }
+ }
+ }
+ onMovingChanged: {
+ if (!moving) {
+ flickingChanged();
+ }
+ }
+
+ Item {
+ id: mainItem
+ width: root.width + ((root.edge == Qt.RightEdge || root.edge == Qt.LeftEdge) ? drawerPage.width : 0)
+ height: root.height + ((root.edge == Qt.TopEdge || root.edge == Qt.BottomEdge) ? drawerPage.height : 0)
+ onWidthChanged: {
+ if (root.edge == Qt.LeftEdge) {
+ if (root.opened) {
+ mainFlickable.contentX = 0;
+ } else {
+ mainFlickable.contentX = drawerPage.width;
+ }
+ }
+ }
+ onHeightChanged: {
+ if (root.edge == Qt.TopEdge) {
+ mainFlickable.contentY = drawerPage.Height;
+ }
+ }
+
+
+ Item {
+ id: drawerPage
+ z: 3
+ anchors {
+ left: root.edge != Qt.RightEdge ? parent.left : undefined
+ right: root.edge != Qt.LeftEdge ? parent.right : undefined
+ top: root.edge != Qt.BottomEdge ? parent.top : undefined
+ bottom: root.edge != Qt.TopEdge ? parent.bottom : undefined
+ }
+
+ clip: true
+ width: root.contentItem ? Math.min(root.contentItem.implicitWidth, root.width * 0.7) : 0
+ height: root.contentItem ? Math.min(root.contentItem.implicitHeight, root.height * 0.7) : 0
+ }
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/OverlaySheet.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/OverlaySheet.qml
new file mode 100644
index 0000000..4570540
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/OverlaySheet.qml
@@ -0,0 +1,278 @@
+/*
+* Copyright (C) 2016 by Marco Martin <mart@kde.org>
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU Library General Public License as
+* published by the Free Software Foundation; either version 2, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Library General Public License for more details
+*
+* You should have received a copy of the GNU Library General Public
+* License along with this program; if not, write to the
+* Free Software Foundation, Inc.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+*/
+
+import QtQuick 2.5
+import QtQuick.Controls 1.3 as Controls
+import org.kde.kirigami 1.0
+import QtGraphicalEffects 1.0
+import "private"
+
+/**
+ * An overlay sheet that covers the current Page content.
+ * Its contents can be scrolled up or down, scrolling all the way up or
+ * all the way down, dismisses it.
+ * Use this for big, modal dialogs or information display, that can't be
+ * logically done as a new separate Page, even if potentially
+ * are taller than the screen space.
+ */
+Item {
+ id: root
+
+ z: 999
+
+ anchors.fill: parent
+ visible: false
+
+ /**
+ * contentItem: Item
+ * This property holds the visual content item.
+ *
+ * Note: The content item is automatically resized inside the
+ * padding of the control.
+ */
+ default property Item contentItem
+
+ /**
+ * opened: bool
+ * If true the sheet is open showing the contents of the OverlaySheet
+ * component.
+ */
+ property bool opened
+
+ /**
+ * leftPadding: int
+ * default contents padding at left
+ */
+ property int leftPadding: Units.gridUnit
+
+ /**
+ * topPadding: int
+ * default contents padding at top
+ */
+ property int topPadding: Units.gridUnit
+
+ /**
+ * rightPadding: int
+ * default contents padding at right
+ */
+ property int rightPadding: Units.gridUnit
+
+ /**
+ * bottomPadding: int
+ * default contents padding at bottom
+ */
+ property int bottomPadding: Units.gridUnit
+
+ /**
+ * background: Item
+ * This property holds the background item.
+ *
+ * Note: If the background item has no explicit size specified,
+ * it automatically follows the control's size.
+ * In most cases, there is no need to specify width or
+ * height for a background item.
+ */
+ property Item background
+
+
+ function open() {
+ root.visible = true;
+ openAnimation.from = -root.height;
+ openAnimation.to = openAnimation.topOpenPosition;
+ openAnimation.running = true;
+ root.opened = true;
+ }
+
+ function close() {
+ if (mainFlickable.contentY < 0) {
+ closeAnimation.to = -height;
+ } else {
+ closeAnimation.to = flickableContents.height;
+ }
+ closeAnimation.running = true;
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: Theme.textColor
+ opacity: 0.6 * Math.min(
+ (Math.min(mainFlickable.contentY + mainFlickable.height, mainFlickable.height) / mainFlickable.height),
+ (2 + (mainFlickable.contentHeight - mainFlickable.contentY - mainFlickable.topMargin - mainFlickable.bottomMargin)/mainFlickable.height))
+ }
+
+
+ Component.onCompleted: {
+ mainFlickable.interactive = true;
+ }
+ onBackgroundChanged: {
+ background.parent = flickableContents;
+ background.z = -1;
+ }
+ onContentItemChanged: {
+ contentItem.parent = contentItemParent;
+ contentItem.anchors.left = contentItemParent.left;
+ contentItem.anchors.right = contentItemParent.right;
+ }
+ onOpenedChanged: {
+ if (opened) {
+ open();
+ } else {
+ close();
+ Qt.inputMethod.hide();
+ }
+ }
+ onHeightChanged: {
+ var focusItem;
+
+ if (typeof applicationWindow !== "undefined") {
+ focusItem = applicationWindow().activeFocusItem;
+ //fallback: hope activeFocusItem is in context
+ } else {
+ focusItem = activeFocusItem;
+ }
+
+ if (!activeFocusItem) {
+ return;
+ }
+
+ //NOTE: there is no function to know if an item is descended from another,
+ //so we have to walk the parent hyerarchy by hand
+ var isDescendent = false;
+ var candidate = focusItem.parent;
+ while (candidate) {
+ if (candidate == root) {
+ isDescendent = true;
+ break;
+ }
+ candidate = candidate.parent;
+ }
+ if (!isDescendent) {
+ return;
+ }
+
+ var cursorY = 0;
+ if (focusItem.cursorPosition !== undefined) {
+ cursorY = focusItem.positionToRectangle(focusItem.cursorPosition).y;
+ }
+
+
+ var pos = focusItem.mapToItem(flickableContents, 0, cursorY - Units.gridUnit*3);
+ //focused item alreqady visible? add some margin for the space of the action buttons
+ if (pos.y >= mainFlickable.contentY && pos.y <= mainFlickable.contentY + mainFlickable.height - Units.gridUnit * 8) {
+ return;
+ }
+ mainFlickable.contentY = pos.y;
+ }
+
+
+ NumberAnimation {
+ id: openAnimation
+ property int topOpenPosition: Math.min(-root.height*0.15, flickableContents.height - root.height + Units.gridUnit * 5)
+ property int bottomOpenPosition: (flickableContents.height - root.height) + (Units.gridUnit * 5)
+ target: mainFlickable
+ properties: "contentY"
+ from: -root.height
+ to: topOpenPosition
+ duration: Units.longDuration
+ easing.type: Easing.OutQuad
+ }
+
+ SequentialAnimation {
+ id: closeAnimation
+ property int to: -root.height
+ NumberAnimation {
+ target: mainFlickable
+ properties: "contentY"
+ to: closeAnimation.to
+ duration: Units.longDuration
+ easing.type: Easing.InQuad
+ }
+ ScriptAction {
+ script: root.visible = root.opened = false;
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ z: 2
+ drag.filterChildren: true
+
+ onClicked: {
+ var pos = mapToItem(flickableContents, mouse.x, mouse.y);
+ if (!flickableContents.contains(pos)) {
+ root.close();
+ }
+ }
+
+ Controls.ScrollView {
+ id: scrollView
+ anchors.fill: parent
+ Flickable {
+ id: mainFlickable
+ topMargin: height
+ contentWidth: width
+ contentHeight: flickableContents.height;
+ flickableDirection: Flickable.VerticalFlick
+ Item {
+ width: mainFlickable.width
+ height: flickableContents.height
+ Item {
+ id: flickableContents
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: root.contentItem.implicitWidth <= 0 ? root.width : Math.max(root.width/2, Math.min(root.width, root.contentItem.implicitWidth))
+ height: contentItem.height + topPadding + bottomPadding + Units.iconSizes.medium + Units.gridUnit
+ Item {
+ id: contentItemParent
+ anchors {
+ fill: parent
+ leftMargin: leftPadding
+ topMargin: topPadding
+ rightMargin: rightPadding
+ bottomMargin: bottomPadding
+ }
+ }
+ }
+ }
+ bottomMargin: height
+ onMovementEnded: {
+ //close
+ if ((root.height + mainFlickable.contentY) < root.height/2) {
+ closeAnimation.to = -root.height;
+ closeAnimation.running = true;
+ } else if ((root.height*0.6 + mainFlickable.contentY) > flickableContents.height) {
+ closeAnimation.to = flickableContents.height
+ closeAnimation.running = true;
+
+ //reset to the default opened position
+ } else if (mainFlickable.contentY < openAnimation.topOpenPosition) {
+ openAnimation.from = mainFlickable.contentY;
+ openAnimation.to = openAnimation.topOpenPosition;
+ openAnimation.running = true;
+ //reset to the default "bottom" opened position
+ } else if (mainFlickable.contentY > openAnimation.bottomOpenPosition) {
+ openAnimation.from = mainFlickable.contentY;
+ openAnimation.to = openAnimation.bottomOpenPosition;
+ openAnimation.running = true;
+ }
+ }
+ onFlickEnded: movementEnded();
+ }
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/SplitDrawer.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/SplitDrawer.qml
new file mode 100644
index 0000000..6eb089d
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/SplitDrawer.qml
@@ -0,0 +1,268 @@
+/*
+ * Copyright 2012 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import org.kde.kirigami 1.0
+import "private"
+
+/**
+ * Split Drawers are used to expose additional UI elements which are optional
+ * and can be used in conjunction with the main UI elements.
+ * For example the Resource Browser uses a Split Drawer to select
+ * different kinds of filters for the main view.
+ */
+AbstractDrawer {
+ id: root
+ z:0
+
+ visible: true
+
+ /**
+ * page: Item
+ * It's the default property. it's the main content of the drawer page,
+ * the part that is always shown
+ */
+ default property alias page: mainPage.data
+
+ /**
+ * contentItem: Item
+ * It's the part that can be pulled in and out, will act as a sidebar.
+ */
+ property Item contentItem
+
+ /**
+ * opened: bool
+ * If true the drawer is open showing the contents of the "drawer"
+ * component.
+ */
+ property alias opened: sidebar.open
+
+ /**
+ * position: real
+ * This property holds the position of the drawer relative to its
+ * final destination. That is, the position will be 0 when the
+ * drawer is fully closed, and 1 when fully open.
+ */
+ property real position: 0
+
+ /**
+ * modal: bool
+ * If true the drawer will be an overlay of the main content,
+ * obscuring it and blocking input.
+ * If false, the drawer will look like a sidebar, with the main content
+ * application still usable.
+ * It is recomended to use modal on mobile devices and not modal on desktop
+ * devices.
+ * Default is true
+ */
+ //property bool modal: true
+
+ /**
+ * background: Item
+ * This property holds the background item.
+ *
+ * Note: If the background item has no explicit size specified,
+ * it automatically follows the control's size.
+ * In most cases, there is no need to specify width or
+ * height for a background item.
+ */
+ property Item background
+
+ onBackgroundChanged: {
+ background.parent = browserFrame;
+ background.anchors.fill = browserFrame;
+ background.z = -1;
+ }
+
+ Component.onCompleted: {
+ mainPage.width = browserFrame.width
+ contentItem.parent = drawerPage
+ }
+
+ onPositionChanged: {
+ if (!browserFrame.loopCheck) {
+ browserFrame.loopCheck = true;
+ browserFrame.x = position * drawerPage.width;
+ browserFrame.loopCheck = false;
+ }
+ }
+ onContentItemChanged: contentItem.parent = drawerPage
+ MouseArea {
+ id: mouseEventListener
+ z: 200
+ drag.filterChildren: true
+ //drag.target: browserFrame
+ property int startMouseX
+ property int oldMouseX
+ property int startBrowserFrameX
+ property bool toggle: false
+ property string startState
+ enabled: root.modal
+
+ anchors.fill: parent
+
+ onPressed: {
+ if (drawerPage.children.length == 0 || (browserFrame.state == "Closed" && mouse.x > Units.gridUnit) ||
+ mouse.x < browserFrame.x) {
+ mouse.accepted = false;
+ return;
+ }
+
+ toggle = true;
+ startBrowserFrameX = browserFrame.x;
+ oldMouseX = startMouseX = mouse.x;
+ startState = browserFrame.state;
+ browserFrame.state = "Dragging";
+ browserFrame.x = startBrowserFrameX;
+ }
+
+ onPositionChanged: {
+ browserFrame.x = Math.max(0, browserFrame.x + mouse.x - oldMouseX);
+ oldMouseX = mouse.x;
+ if (Math.abs(mouse.x - startMouseX) > Units.gridUnit * 2) {
+ toggle = false;
+ }
+ }
+
+ onReleased: {
+ if (toggle) {
+ browserFrame.state = startState == "Open" ? "Closed" : "Open"
+ } else if (browserFrame.x < drawerPage.width / 2) {
+ browserFrame.state = "Closed";
+ } else {
+ browserFrame.state = "Open";
+ }
+ }
+ onClicked: root.clicked()
+ }
+
+ Item {
+ id: browserFrame
+ z: 100
+ state: sidebar.open ? "Open" : "Closed"
+ onStateChanged: sidebar.open = (state != "Closed")
+ readonly property real position: Math.abs(x) / drawerPage.width
+ property bool loopCheck: false
+ onPositionChanged: {
+ if (!loopCheck) {
+ loopCheck = true;
+ root.position = position;
+ loopCheck = false;
+ }
+ }
+
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ }
+ width: root.width;
+
+ Item {
+ id: mainPage
+ onChildrenChanged: mainPage.children[0].anchors.fill = mainPage
+
+ anchors.fill: parent
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ color: "black"
+ opacity: Math.min(0.4, 0.4 * (browserFrame.x / drawerPage.width))
+ visible: root.modal
+ }
+
+ states: [
+ State {
+ name: "Open"
+ PropertyChanges {
+ target: browserFrame
+ x: drawerPage.width
+ }
+
+ },
+ State {
+ name: "Dragging"
+ PropertyChanges {
+ target: browserFrame
+ x: mouseEventListener.startBrowserFrameX
+ }
+ },
+ State {
+ name: "Closed"
+ PropertyChanges {
+ target: browserFrame
+ x: 0
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ //Exclude Dragging
+ to: "Open,Closed,Hidden"
+ NumberAnimation {
+ properties: "x"
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ ]
+ }
+
+
+ Item {
+ id: sidebar
+
+ property bool open: false
+ onOpenChanged: {
+ if (drawerPage.children.length == 0) {
+ return;
+ }
+
+ if (open) {
+ browserFrame.state = "Open";
+ } else {
+ browserFrame.state = "Closed";
+ }
+ }
+
+ width: browserFrame.x
+ clip: true
+
+ anchors {
+ left: parent.left
+ top: parent.top
+ bottom: parent.bottom
+ }
+
+ Item {
+ id: drawerPage
+ width: Math.min(root.width/4*3, Math.max(root.contentItem ? root.contentItem.implicitWidth : 0, root.width/4))
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ left: parent.left
+ topMargin: (applicationWindow !== undefined && applicationWindow().header) && modal ? applicationWindow().header.height : 0
+ }
+ clip: false
+ onChildrenChanged: drawerPage.children[0].anchors.fill = drawerPage
+ }
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/SwipeListItem.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/SwipeListItem.qml
new file mode 100644
index 0000000..a263c44
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/SwipeListItem.qml
@@ -0,0 +1,387 @@
+/*
+ * Copyright 2010 Marco Martin <notmart@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
+ */
+
+import QtQuick 2.5
+import QtQuick.Layouts 1.2
+import QtQuick.Controls 1.0 as Controls
+import QtQuick.Controls.Private 1.0
+import org.kde.kirigami 1.0
+import "../private"
+
+/**
+ * An item delegate Intended to support extra actions obtainable
+ * by uncovering them by dragging away the item with the handle
+ * This acts as a container for normal list items.
+ * Any subclass of AbstractListItem can be assigned as the contentItem property.
+ * @code
+ * ListView {
+ * model: myModel
+ * delegate: SwipeListItem {
+ * Label {
+ * text: model.text
+ * }
+ * actions: [
+ * Action {
+ * iconName: "document-decrypt"
+ * onTriggered: print("Action 1 clicked")
+ * },
+ * Action {
+ * iconName: model.action2Icon
+ * onTriggered: //do something
+ * }
+ * ]
+ * }
+ *
+ * }
+ * @endcode
+ *
+ * @inherit QtQuick.Item
+ */
+Item {
+ id: listItem
+
+//BEGIN properties
+ /**
+ * contentItem: Item
+ * This property holds the visual content item.
+ *
+ * Note: The content item is automatically resized inside the
+ * padding of the control.
+ */
+ default property Item contentItem
+
+ /**
+ * supportsMouseEvents: bool
+ * Holds if the item emits signals related to mouse interaction.
+ *TODO: remove
+ * The default value is false.
+ */
+ property alias supportsMouseEvents: itemMouse.enabled
+
+ /**
+ * clicked: signal
+ * This signal is emitted when there is a click.
+ *
+ * This is disabled by default, set enabled to true to use it.
+ * @see enabled
+ */
+ signal clicked
+
+
+ /**
+ * pressAndHold: signal
+ * The user pressed the item with the mouse and didn't release it for a
+ * certain amount of time.
+ *
+ * This is disabled by default, set enabled to true to use it.
+ * @see enabled
+ */
+ signal pressAndHold
+
+ /**
+ * checked: bool
+ * If true makes the list item look as checked or pressed. It has to be set
+ * from the code, it won't change by itself.
+ */
+ property bool checked: false
+
+ /**
+ * pressed: bool
+ * True when the user is pressing the mouse over the list item and
+ * supportsMouseEvents is set to true
+ */
+ property alias pressed: itemMouse.pressed
+
+ /**
+ * containsMouse: bool
+ * True when the user hover the mouse over the list item
+ * NOTE: on mobile touch devices this will be true only when pressed is also true
+ */
+ property alias containsMouse: itemMouse.containsMouse
+
+ /**
+ * sectionDelegate: bool
+ * If true the item will be a delegate for a section, so will look like a
+ * "title" for the items under it.
+ */
+ property bool sectionDelegate: false
+
+ /**
+ * separatorVisible: bool
+ * True if the separator between items is visible
+ * default: true
+ */
+ property bool separatorVisible: true
+
+ /**
+ * actions: list<Action>
+ * Defines the actions for the list item: at most 4 buttons will
+ * contain the actions for the item, that can be revealed by
+ * sliding away the list item.
+ */
+ property list<Action> actions
+
+
+ /**
+ * position: real
+ * This property holds the position of the dragged list item relative to its
+ * final destination (just like the Drawer). That is, the position
+ * will be 0 when the list item is fully closed, and 1 when fully open.
+ */
+ property real position: 0
+
+ /**
+ * background: Item
+ * This property holds the background item.
+ *
+ * Note: If the background item has no explicit size specified,
+ * it automatically follows the control's size.
+ * In most cases, there is no need to specify width or
+ * height for a background item.
+ */
+ property Item background
+
+ Item {
+ id: behindItem
+ parent: listItem
+ anchors {
+ fill: parent
+ leftMargin: height
+ }
+ Rectangle {
+ id: shadowHolder
+ color: Theme.backgroundColor
+ anchors.fill: parent
+ }
+ EdgeShadow {
+ edge: Qt.TopEdge
+ anchors {
+ right: parent.right
+ left: parent.left
+ top: parent.top
+ }
+ }
+ EdgeShadow {
+ edge: Qt.LeftEdge
+ x: behindItem.width - (behindItem.width * listItem.position)
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ }
+ }
+ }
+
+ implicitWidth: parent ? parent.width : contentItem.width + paddingItem.anchors.margins * 2
+ implicitHeight: contentItem.height + Units.smallSpacing * 5
+//END properties
+
+//BEGIN signal handlers
+ onBackgroundChanged: {
+ background.parent = itemMouse;
+ background.anchors.fill = itemMouse;
+ background.z = 0;
+ }
+
+ onContentItemChanged: {
+ contentItem.parent = paddingItem
+ contentItem.z = 0;
+ }
+
+ Component.onCompleted: {
+
+ if (background) {
+ background.parent = itemMouse;
+ background.z = 0;
+ }
+
+ contentItem.parent = itemMouse
+ contentItem.z = 1;
+ }
+
+ onPositionChanged: {
+ if (!mainFlickable.loopCheck && !handleMouse.pressed && !mainFlickable.flicking &&
+ !mainFlickable.dragging && !positionAnimation.running) {
+ mainFlickable.contentX = (listItem.width-listItem.height) * mainFlickable.internalPosition;
+ }
+ }
+//END signal handlers
+
+//BEGIN UI implementation
+ RowLayout {
+ id: actionsLayout
+ z: 1
+ anchors {
+ right: parent.right
+ verticalCenter: parent.verticalCenter
+ rightMargin: y
+ }
+ height: Math.min( parent.height / 1.5, Units.iconSizes.medium)
+ property bool exclusive: false
+ property Item checkedButton
+ spacing: Units.largeSpacing
+ Repeater {
+ model: {
+ if (listItem.actions.length == 0) {
+ return null;
+ } else {
+ return listItem.actions[0].text !== undefined &&
+ listItem.actions[0].trigger !== undefined ?
+ listItem.actions :
+ listItem.actions[0];
+ }
+ }
+ delegate: Icon {
+ Layout.fillHeight: true
+ Layout.minimumWidth: height
+ source: modelData.iconName
+ MouseArea {
+ anchors {
+ fill: parent
+ margins: -Units.smallSpacing
+ }
+ onClicked: {
+ if (modelData && modelData.trigger !== undefined) {
+ modelData.trigger();
+ // assume the model is a list of QAction or Action
+ } else if (toolbar.model.length > index) {
+ toolbar.model[index].trigger();
+ } else {
+ console.log("Don't know how to trigger the action")
+ }
+ positionAnimation.to = 0;
+ positionAnimation.running = true;
+ }
+ }
+ }
+ }
+ }
+
+ PropertyAnimation {
+ id: positionAnimation
+ target: mainFlickable
+ properties: "contentX"
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+
+ Flickable {
+ id: mainFlickable
+ z: 2
+ interactive: false
+ boundsBehavior: Flickable.StopAtBounds
+ anchors.fill: parent
+ contentWidth: mainItem.width
+ contentHeight: height
+ onFlickEnded: {
+ if (contentX > width / 2) {
+ positionAnimation.to = width - height;
+ } else {
+ positionAnimation.to = 0;
+ }
+ positionAnimation.running = true;
+ }
+ readonly property real internalPosition: (mainFlickable.contentX/(listItem.width-listItem.height));
+ property bool loopCheck: false
+ onInternalPositionChanged: {
+ if (!loopCheck) {
+ loopCheck = true;
+ listItem.position = internalPosition;
+ loopCheck = false;
+ }
+ }
+
+ Item {
+ id: mainItem
+ width: (mainFlickable.width * 2) - height
+ height: mainFlickable.height
+ MouseArea {
+ id: itemMouse
+ anchors {
+ left: parent.left
+ top: parent.top
+ bottom: parent.bottom
+ }
+ hoverEnabled: !Settings.isMobile
+ width: mainFlickable.width
+ onClicked: listItem.clicked()
+ onPressAndHold: listItem.pressAndHold()
+
+ Item {
+ id: paddingItem
+ anchors {
+ fill: parent
+ margins: Units.smallSpacing
+ }
+ }
+ }
+
+ MouseArea {
+ id: handleMouse
+ anchors {
+ left: itemMouse.right
+ top: parent.top
+ bottom: parent.bottom
+ leftMargin: -height
+ }
+ preventStealing: true
+ width: mainFlickable.width - actionsLayout.width
+ property var downTimestamp;
+ property int startX
+ property int startMouseX
+
+ onClicked: {
+ if (Math.abs(startX - mainFlickable.contentX) > Units.gridUnit ||
+ Math.abs(startMouseX - mouse.x) > Units.gridUnit) {
+ return;
+ }
+ if (mainFlickable.contentX > mainFlickable.width / 2) {
+ positionAnimation.to = 0;
+ } else {
+ positionAnimation.to = mainFlickable.width - mainFlickable.height;
+ }
+ positionAnimation.running = true;
+ }
+ onPressed: {
+ downTimestamp = (new Date()).getTime();
+ startX = mainFlickable.contentX;
+ startMouseX = mouse.x;
+ }
+ onPositionChanged: {
+ mainFlickable.contentX = Math.max(0, Math.min(mainFlickable.width - height, mainFlickable.contentX + (startMouseX - mouse.x)))
+ }
+ onReleased: {
+ var speed = ((startX - mainFlickable.contentX) / ((new Date()).getTime() - downTimestamp) * 1000);
+ mainFlickable.flick(speed, 0);
+ }
+ Icon {
+ id: handleIcon
+ anchors.verticalCenter: parent.verticalCenter
+ selected: listItem.checked || (listItem.pressed && !listItem.checked && !listItem.sectionDelegate)
+ width: Units.iconSizes.smallMedium
+ height: width
+ x: y
+ source: (mainFlickable.contentX > mainFlickable.width / 2) ? "handle-right" : "handle-left"
+ }
+ }
+ }
+ }
+//END UI implementation
+
+ Accessible.role: Accessible.ListItem
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/private/AbstractDrawer.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/AbstractDrawer.qml
new file mode 100644
index 0000000..e80d0d8
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/AbstractDrawer.qml
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtGraphicalEffects 1.0
+import org.kde.kirigami 1.0
+
+//TODO: This will become a QQC2 Drawer
+//providing just a dummy api for now
+Item {
+ id: root
+ anchors {
+ fill: parent
+ topMargin: !modal && applicationWindow !== undefined && applicationWindow().header && applicationWindow().controlsVisible ? applicationWindow().header.height : 0
+ }
+ z: 9999
+
+ default property alias page: mainPage.data
+ property Item contentItem
+ property bool opened
+ property int edge: Qt.LeftEdge
+ property real position: 0
+ property bool modal: true
+
+ function open () { }
+ function close () { }
+ signal clicked
+
+ Item {
+ id: mainPage
+ anchors.fill: parent
+ onChildrenChanged: mainPage.children[0].anchors.fill = mainPage
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/private/BackButton.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/BackButton.qml
new file mode 100644
index 0000000..f401773
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/BackButton.qml
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Controls 1.0 as Controls
+import QtQuick.Controls.Private 1.0
+import org.kde.kirigami 1.0
+
+MouseArea {
+ anchors {
+ left: parent.left
+ top: parent.top
+ bottom: parent.bottom
+ }
+ opacity: !Settings.isMobile &&__appWindow.pageStack.currentIndex < 1 ? 0.4 : 1
+ width: height
+ z: 99
+ onClicked: applicationWindow().pageStack.goBack();
+
+ Icon {
+ anchors.fill: parent
+ selected: header.background && header.background.color && header.background.color == Theme.highlightColor
+ source: "go-previous"
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/private/ContextIcon.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/ContextIcon.qml
new file mode 100644
index 0000000..915a55e
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/ContextIcon.qml
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.2
+import QtGraphicalEffects 1.0
+import org.kde.kirigami 1.0
+
+Item {
+ id: canvas
+ width: height
+ height: Units.iconSizes.smallMedium
+ property real morph: 0
+ property color color: Theme.textColor
+ opacity: 0.8
+ layer.enabled: true
+
+ Rectangle {
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ top: parent.top
+ leftMargin: canvas.width/4 * morph
+ }
+ antialiasing: true
+ transformOrigin: Item.Left
+ width: (1 - morph) * height + morph * ((parent.width / Math.sqrt(2)) - height/2)
+ height: Math.round(Units.smallSpacing / 2)
+ color: canvas.color
+ rotation: 45 * morph
+ }
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: height * (1 - morph)
+ height: Math.round(Units.smallSpacing / 2)
+ color: canvas.color
+ }
+
+
+ Rectangle {
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ bottom: parent.bottom
+ leftMargin: canvas.width/4 * morph
+ }
+ antialiasing: true
+ transformOrigin: Item.Left
+ width: (1 - morph) * height + morph * ((parent.width / Math.sqrt(2)) - height/2)
+ height: Math.round(Units.smallSpacing / 2)
+ color: canvas.color
+ rotation: -45 * morph
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/private/MenuIcon.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/MenuIcon.qml
new file mode 100644
index 0000000..159d403
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/MenuIcon.qml
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.1
+import QtQuick.Layouts 1.2
+import QtGraphicalEffects 1.0
+import org.kde.kirigami 1.0
+
+Item {
+ id: canvas
+ width: height
+ height: Units.iconSizes.smallMedium
+ property real morph: 0
+ property color color: Theme.textColor
+ opacity: 0.8
+ layer.enabled: true
+
+ Rectangle {
+ anchors {
+ right: parent.right
+ top: parent.top
+ rightMargin: canvas.width/4 * morph
+ }
+ antialiasing: true
+ transformOrigin: Item.Right
+ width: (1 - morph) * parent.width + morph * ((parent.width / Math.sqrt(2)) - height/2)
+ height: Math.round(Units.smallSpacing / 2)
+ color: canvas.color
+ rotation: -45 * morph
+ }
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: parent.width - parent.width * morph
+ height: Math.round(Units.smallSpacing / 2)
+ color: canvas.color
+ }
+
+ Rectangle {
+ anchors {
+ right: parent.right
+ bottom: parent.bottom
+ rightMargin: canvas.width/4 * morph
+ }
+ antialiasing: true
+ transformOrigin: Item.Right
+ width: (1 - morph) * parent.width + morph * ((parent.width / Math.sqrt(2)) - height/2)
+ height: Math.round(Units.smallSpacing / 2)
+ color: canvas.color
+ rotation: 45 * morph
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/private/PageRow.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/PageRow.qml
new file mode 100644
index 0000000..0c50468
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/PageRow.qml
@@ -0,0 +1,511 @@
+/*
+ * Copyright 2016 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.5
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 1.0
+
+Item {
+ id: root
+
+//BEGIN PROPERTIES
+ /**
+ * This property holds the number of items currently pushed onto the view
+ */
+ readonly property alias depth: pagesLogic.count
+
+ /**
+ * The last Page in the Row
+ */
+ readonly property Item lastItem: pagesLogic.count ? pagesLogic.get(pagesLogic.count - 1).page : null
+
+ /**
+ * The currently visible Item
+ */
+ readonly property Item currentItem: mainFlickable.currentItem
+
+ /**
+ * the index of the currently visible Item
+ */
+ property alias currentIndex: mainFlickable.currentIndex
+
+ /**
+ * The initial item when this PageRow is created
+ */
+ property variant initialPage
+
+ /**
+ * The main flickable of this Row
+ */
+ property alias contentItem: mainFlickable
+
+ /**
+ * The default width for a column
+ * default is wide enough for 30 grid units.
+ * Pages can override it with their Layout.fillWidth,
+ * implicitWidth Layout.minimumWidth etc.
+ */
+ property int defaultColumnWidth: Units.gridUnit * 20
+
+ /**
+ * interactive: bool
+ * If true it will be possible to go back/forward by dragging the
+ * content themselves with a gesture.
+ * Otherwise the only way to go back will be programmatically
+ * default: true
+ */
+ property alias interactive: mainFlickable.interactive
+
+//END PROPERTIES
+
+//BEGIN FUNCTIONS
+ /**
+ * Pushes a page on the stack.
+ * The page can be defined as a component, item or string.
+ * If an item is used then the page will get re-parented.
+ * If a string is used then it is interpreted as a url that is used to load a page
+ * component.
+ *
+ * @param page The page can also be given as an array of pages.
+ * In this case all those pages will
+ * be pushed onto the stack. The items in the stack can be components, items or
+ * strings just like for single pages.
+ * Additionally an object can be used, which specifies a page and an optional
+ * properties property.
+ * This can be used to push multiple pages while still giving each of
+ * them properties.
+ * When an array is used the transition animation will only be to the last page.
+ *
+ * @param properties The properties argument is optional and allows defining a
+ * map of properties to set on the page.
+ * @return The new created page
+ */
+ function push(page, properties) {
+ pop(currentItem);
+
+ // figure out if more than one page is being pushed
+ var pages;
+ if (page instanceof Array) {
+ pages = page;
+ page = pages.pop();
+ if (page.createObject === undefined && page.parent === undefined && typeof page != "string") {
+ properties = properties || page.properties;
+ page = page.page;
+ }
+ }
+
+ // push any extra defined pages onto the stack
+ if (pages) {
+ var i;
+ for (i = 0; i < pages.length; i++) {
+ var tPage = pages[i];
+ var tProps;
+ if (tPage.createObject === undefined && tPage.parent === undefined && typeof tPage != "string") {
+ tProps = tPage.properties;
+ tPage = tPage.page;
+ }
+
+ var container = pagesLogic.initPage(tPage, tProps);
+ pagesLogic.append(container);
+ }
+ }
+
+ // initialize the page
+ var container = pagesLogic.initPage(page, properties);
+ pagesLogic.append(container);
+ container.visible = container.page.visible = true;
+
+ mainFlickable.currentIndex = container.level;
+ return container.page
+ }
+
+ /**
+ * Pops a page off the stack.
+ * @param page If page is specified then the stack is unwound to that page,
+ * to unwind to the first page specify
+ * page as null.
+ * @return The page instance that was popped off the stack.
+ */
+ function pop(page) {
+ if (depth == 0) {
+ return;
+ }
+
+ var oldPage = pagesLogic.get(pagesLogic.count-1).page;
+ if (page !== undefined) {
+ // an unwind target has been specified - pop until we find it
+ while (page != oldPage && pagesLogic.count > 1) {
+ pagesLogic.remove(oldPage.parent.level);
+
+ oldPage = pagesLogic.get(pagesLogic.count-1).page;
+ }
+ } else {
+ pagesLogic.remove(pagesLogic.count-1);
+ }
+ }
+
+ /**
+ * Replaces a page on the stack.
+ * @param page The page can also be given as an array of pages.
+ * In this case all those pages will
+ * be pushed onto the stack. The items in the stack can be components, items or
+ * strings just like for single pages.
+ * Additionally an object can be used, which specifies a page and an optional
+ * properties property.
+ * This can be used to push multiple pages while still giving each of
+ * them properties.
+ * When an array is used the transition animation will only be to the last page.
+ * @param properties The properties argument is optional and allows defining a
+ * map of properties to set on the page.
+ * @see push() for details.
+ */
+ function replace(page, properties) {
+ if (currentIndex>=1)
+ pop(pagesLogic.get(currentIndex-1).page);
+ else if (currentIndex==0)
+ pop();
+ else
+ console.warn("There's no page to replace");
+ return push(page, properties);
+ }
+
+ /**
+ * Clears the page stack.
+ * Destroy (or reparent) all the pages contained.
+ */
+ function clear() {
+ return pagesLogic.clear();
+ }
+
+ function get(idx) {
+ return pagesLogic.get(idx).page;
+ }
+
+//END FUNCTIONS
+
+ QtObject {
+ id: pagesLogic
+
+ readonly property int count: mainLayout.children.length
+ property var componentCache
+
+ property int roundedDefaultColumnWidth: Math.floor(root.width/root.defaultColumnWidth) > 0 ? root.width/Math.floor(root.width/root.defaultColumnWidth) : root.width
+
+ //NOTE:seems to only work if the array is defined in a declarative way,
+ //the Object in an imperative way, espacially on Android
+ Component.onCompleted: {
+ componentCache = {};
+ }
+
+ //TODO: remove?
+ function get(id) {
+ return mainLayout.children[id];
+ }
+
+ function append(item) {
+ //FIXME: seems that for one loop the x of the item would continue to be 0
+ item.x = item.level * roundedDefaultColumnWidth;
+ item.parent = mainLayout;
+ }
+
+ function clear () {
+ while (mainLayout.children.length > 0) {
+ remove(0);
+ }
+ }
+
+ function remove(id) {
+ if (id < 0 || id >= count) {
+ print("Tried to remove an invalid page index:" + id);
+ return;
+ }
+
+ var item = mainLayout.children[id];
+ if (item.owner) {
+ item.page.parent = item.owner;
+ }
+ //FIXME: why reparent ing is necessary?
+ //is destroy just an async deleteLater() that isn't executed immediately or it actually leaks?
+ item.parent = root;
+ item.destroy();
+ }
+
+ function initPage(page, properties) {
+ var container = containerComponent.createObject(mainLayout, {
+ "level": pagesLogic.count,
+ "page": page
+ });
+
+ var pageComp;
+ if (page.createObject) {
+ // page defined as component
+ pageComp = page;
+ } else if (typeof page == "string") {
+ // page defined as string (a url)
+ pageComp = pagesLogic.componentCache[page];
+ if (!pageComp) {
+ pageComp = pagesLogic.componentCache[page] = Qt.createComponent(page);
+ }
+ }
+ if (pageComp) {
+ if (pageComp.status == Component.Error) {
+ throw new Error("Error while loading page: " + pageComp.errorString());
+ } else {
+ // instantiate page from component
+ page = pageComp.createObject(container.pageParent, properties || {});
+ }
+ } else {
+ // copy properties to the page
+ for (var prop in properties) {
+ if (properties.hasOwnProperty(prop)) {
+ page[prop] = properties[prop];
+ }
+ }
+ }
+
+ container.page = page;
+ if (page.parent == null || page.parent == container.pageParent) {
+ container.owner = null;
+ } else {
+ container.owner = page.parent;
+ }
+
+ // the page has to be reparented
+ if (page.parent != container) {
+ page.parent = container;
+ }
+
+ return container;
+ }
+ }
+
+ NumberAnimation {
+ id: scrollAnim
+ target: mainFlickable
+ property: "contentX"
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+
+ Flickable {
+ id: mainFlickable
+ anchors.fill: parent
+ boundsBehavior: Flickable.StopAtBounds
+ contentWidth: mainLayout.childrenRect.width
+ contentHeight: height
+ readonly property Item currentItem: {
+ var idx = Math.min(currentIndex, pagesLogic.count-1)
+ return idx>=0 ? pagesLogic.get(idx).page : null
+ }
+ //clip only when the app has a sidebar
+ clip: root.x > 0
+
+ property int currentIndex: 0
+ property int firstVisibleLevel: Math.round (contentX / pagesLogic.roundedDefaultColumnWidth)
+
+ flickDeceleration: Units.gridUnit * 50
+ onCurrentItemChanged: {
+ var itemX = pagesLogic.roundedDefaultColumnWidth * currentIndex;
+
+ if (itemX >= contentX && mainFlickable.currentItem && itemX + mainFlickable.currentItem.width <= contentX + mainFlickable.width) {
+ return;
+ }
+
+ //this catches 0 and NaN (sometimes at startup width can oddly be nan
+ if (!mainFlickable.width) {
+ return;
+ }
+ scrollAnim.running = false;
+ scrollAnim.from = contentX;
+ if (itemX < contentX || !mainFlickable.currentItem) {
+ scrollAnim.to = Math.max(0, Math.min(itemX, mainFlickable.contentWidth - mainFlickable.width));
+ } else {
+ scrollAnim.to = Math.max(0, Math.min(itemX - mainFlickable.width + mainFlickable.currentItem.width, mainFlickable.contentWidth - mainFlickable.width));
+ }
+ scrollAnim.running = true;
+ }
+ onMovementEnded: {
+ if (mainLayout.childrenRect.width == 0) {
+ return;
+ }
+
+ scrollAnim.running = false;
+ scrollAnim.from = contentX;
+ scrollAnim.to = pagesLogic.roundedDefaultColumnWidth * firstVisibleLevel
+ scrollAnim.running = true;
+
+ var mappedCurrentItemPos = currentItem.mapToItem(mainFlickable, 0, 0);
+
+ //is the current item out of view?
+ if (mappedCurrentItemPos.x < 0) {
+ currentIndex = firstVisibleLevel;
+ } else if (mappedCurrentItemPos.x + currentItem.width > mainFlickable.width) {
+ currentIndex = Math.min(root.depth-1, firstVisibleLevel + Math.floor(mainFlickable.width/pagesLogic.roundedDefaultColumnWidth)-1);
+ }
+ }
+ onFlickEnded: movementEnded();
+
+ Row {
+ id: mainLayout
+ add: Transition {
+ NumberAnimation {
+ property: "y"
+ from: mainFlickable.height
+ to: 0
+ duration: Units.shortDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ onWidthChanged: {
+ //current item in view
+ if (children[mainFlickable.currentIndex].x >= mainFlickable.contentX &&
+ children[mainFlickable.currentIndex].x + children[mainFlickable.currentIndex].width <= mainFlickable.contentX + mainFlickable.width) {
+ mainFlickable.contentX = pagesLogic.roundedDefaultColumnWidth * mainFlickable.firstVisibleLevel;
+ } else {
+ mainFlickable.contentX = Math.max(0, Math.min(width - mainFlickable.width, mainFlickable.currentIndex * pagesLogic.roundedDefaultColumnWidth));
+ }
+
+ }
+ //onChildrenChanged: mainFlickable.contentX = pagesLogic.roundedDefaultColumnWidth * mainFlickable.firstVisibleLevel
+ }
+ }
+
+ Rectangle {
+ height: Units.smallSpacing
+ width: root.width * root.width/mainLayout.width
+ anchors.bottom: parent.bottom
+ color: Theme.textColor
+ opacity: 0
+ x: root.width * mainFlickable.visibleArea.xPosition
+ onXChanged: {
+ opacity = 0.3
+ scrollIndicatorTimer.restart();
+ }
+ Behavior on opacity {
+ OpacityAnimator {
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ }
+ Timer {
+ id: scrollIndicatorTimer
+ interval: Units.longDuration * 4
+ onTriggered: parent.opacity = 0;
+ }
+ }
+
+ Component {
+ id: containerComponent
+
+ MouseArea {
+ id: container
+ height: mainFlickable.height
+ width: root.width
+ state: pendingState
+ property string pendingState: root.width < root.defaultColumnWidth*2 ? "vertical" : (container.level >= pagesLogic.count - 1 ? "last" : "middle");
+
+ //HACK
+ onPendingStateChanged: {
+ stateTimer.restart();
+ }
+ Timer {
+ id: stateTimer
+ interval: 150
+ onTriggered: container.state = container.pendingState
+ }
+
+ property int level
+
+ property int hint: page && page.implicitWidth ? page.implicitWidth : root.defaultColumnWidth
+ property int roundedHint: Math.floor(root.width/hint) > 0 ? root.width/Math.floor(root.width/hint) : root.width
+
+ property Item page
+ property Item owner
+ onPageChanged: {
+ page.parent = container;
+ page.anchors.fill = container;
+ }
+ drag.filterChildren: true
+ onClicked: root.currentIndex = level;
+ onFocusChanged: {
+ if (focus) {
+ root.currentIndex = level;
+ }
+ }
+
+ Rectangle {
+ z: 999
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ right: parent.right
+ }
+ width: Math.ceil(Units.smallSpacing / 5)
+ color: Theme.textColor
+ opacity: 0.3
+ visible: container.level < root.depth-1
+ }
+ states: [
+ State {
+ name: "vertical"
+ PropertyChanges {
+ target: container
+ width: root.width
+ }
+ },
+ State {
+ name: "last"
+ PropertyChanges {
+ target: container
+ width: Math.max(roundedHint, root.width - (container.level == 0 ? 0 : pagesLogic.get(container.level-1).width))
+ }
+ },
+ State {
+ name: "middle"
+ PropertyChanges {
+ target: container
+ width: pagesLogic.roundedDefaultColumnWidth
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "last,middle"
+ to: "middle,last"
+ SequentialAnimation {
+ NumberAnimation {
+ property: "width"
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ ScriptAction {
+ script: mainFlickable.currentItemChanged();
+ }
+ }
+ }
+ ]
+ }
+ }
+
+ Component.onCompleted: {
+ if (initialPage) {
+ push(initialPage, null)
+ }
+ }
+}
diff --git a/kstars/kstarslite/kirigami-lib/src/controls/templates/private/PassiveNotification.qml b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/PassiveNotification.qml
new file mode 100644
index 0000000..5b3b16a
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/controls/templates/private/PassiveNotification.qml
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2015 Marco Martin <mart@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 2.5
+import QtQuick.Controls 1.3 as Controls
+import QtQuick.Layouts 1.2
+import QtGraphicalEffects 1.0
+import org.kde.kirigami 1.0
+
+MouseArea {
+ id: root
+ z: 9999
+ width: background.width
+ height: background.height
+ opacity: 0
+ enabled: appearAnimation.appear
+
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ bottom: parent.bottom
+ bottomMargin: Units.gridUnit * 4
+ }
+ function showNotification(message, timeout, actionText, callBack) {
+ if (!message) {
+ return;
+ }
+ appearAnimation.running = false;
+ appearAnimation.appear = true;
+ appearAnimation.running = true;
+ if (timeout == "short") {
+ timer.interval = 1000;
+ } else if (timeout == "long") {
+ timer.interval = 4500;
+ } else if (timeout > 0) {
+ timer.interval = timeout;
+ } else {
+ timer.interval = 4500;
+ }
+ messageLabel.text = message ? message : "";
+ actionButton.text = actionText ? actionText : "";
+ actionButton.callBack = callBack ? callBack : "";
+
+ timer.restart();
+ }
+
+ function hideNotification() {
+ appearAnimation.running = false;
+ appearAnimation.appear = false;
+ appearAnimation.running = true;
+ }
+
+
+ onClicked: {
+ appearAnimation.appear = false;
+ appearAnimation.running = true;
+ }
+
+ transform: Translate {
+ id: transform
+ y: root.height
+ }
+
+ Timer {
+ id: timer
+ interval: 4000
+ onTriggered: {
+ appearAnimation.appear = false;
+ appearAnimation.running = true;
+ }
+ }
+ ParallelAnimation {
+ id: appearAnimation
+ property bool appear: true
+ NumberAnimation {
+ target: root
+ properties: "opacity"
+ to: appearAnimation.appear ? 1 : 0
+ duration: Units.longDuration
+ easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ target: transform
+ properties: "y"
+ to: appearAnimation.appear ? 0 : background.height
+ duration: Units.longDuration
+ easing.type: appearAnimation.appear ? Easing.OutQuad : Easing.InQuad
+ }
+ }
+
+ Item {
+ id: background
+ width: backgroundRect.width + Units.gridUnit
+ height: backgroundRect.height + Units.gridUnit
+ Rectangle {
+ id: backgroundRect
+ anchors.centerIn: parent
+ radius: Units.smallSpacing
+ color: Theme.textColor
+ opacity: 0.6
+ width: mainLayout.width + Math.round((height - mainLayout.height))
+ height: Math.max(mainLayout.height + Units.smallSpacing*2, Units.gridUnit*2)
+ }
+ RowLayout {
+ id: mainLayout
+ anchors.centerIn: parent
+ Label {
+ id: messageLabel
+ width: Math.min(root.parent.width - Units.largeSpacing*2, implicitWidth)
+ elide: Text.ElideRight
+ color: Theme.backgroundColor
+ }
+ Controls.Button {
+ id: actionButton
+ property var callBack
+ visible: text != ""
+ onClicked: {
+ appearAnimation.appear = false;
+ appearAnimation.running = true;
+ if (callBack) {
+ callBack();
+ }
+ }
+ }
+ }
+ layer.enabled: true
+ layer.effect: DropShadow {
+ horizontalOffset: 0
+ verticalOffset: 0
+ radius: Units.gridUnit
+ samples: 32
+ color: Qt.rgba(0, 0, 0, 0.5)
+ }
+ }
+}
+
diff --git a/kstars/kstarslite/kirigami-lib/src/kirigamiplugin.cpp b/kstars/kstarslite/kirigami-lib/src/kirigamiplugin.cpp
new file mode 100644
index 0000000..77e34b6
--- /dev/null
+++ b/kstars/kstarslite/kirigami-lib/src/kirigamiplugin.cpp
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2009 by Alan Alpert <alan.alpert@nokia.com>
+ * Copyright 2010 by Ménard Alexis <menard@kde.org>
+ * Copyright 2010 by Marco Martin <mart@kde.org>
+
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "kirigamiplugin.h"
+
+#include <QQmlEngine>
+#include <QQmlContext>
+#include <QQuickItem>
+
+QUrl KirigamiPlugin::componentPath(const QString &fileName) const
+{
+ QString candidate;
+ QString candidatePath;
+
+ foreach (const QString &style, m_stylesFallbackChain) {
+ candidate = QStringLiteral("styles/") + style + QLatin1Char('/') + fileName;
+ if (QFile::exists(resolveFilePath(candidate))) {
+ return QUrl(resolveFileUrl(candidate));
+ }
+ }
+ return QUrl(resolveFileUrl(fileName));
+}
+
+
+void KirigamiPlugin::registerTypes(const char *uri)
+{
+#ifdef KIRIGAMI_BUILD_TYPE_STATIC
+ Q_INIT_RESOURCE(kirigami);
+#endif
+
+ Q_ASSERT(uri == QLatin1String("org.kde.kirigami"));
+ const QString style = QString::fromLatin1(qgetenv("QT_QUICK_CONTROLS_STYLE"));
+
+#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
+ if (style.isEmpty() && QFile::exists(resolveFilePath(QStringLiteral("/styles/Desktop")))) {
+ m_stylesFallbackChain.prepend(QStringLiteral("Desktop"));
+ }
+#endif
+
+ if (!style.isEmpty() && QFile::exists(resolveFilePath(QStringLiteral("/styles/") + style))) {
+ m_stylesFallbackChain.prepend(style);
+ }
+ //At this point the fallback chain will be selected->Desktop->Fallback
+
+
+ //TODO: in this plugin it will end up something similar to
+ //PlasmaCore's ColorScope?
+
+ qmlRegisterSingletonType(componentPath(QStringLiteral("The