diff --git a/3rdparty/qjson/CMakeLists.txt b/3rdparty/qjson/CMakeLists.txt deleted file mode 100644 index 9e212a980..000000000 --- a/3rdparty/qjson/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# add_custom_command (OUTPUT ${qjson_SOURCE_DIR}/lib/json_parser.cc -# PRE_BUILD -# COMMAND bison -t -o json_parser.cc -d json_parser.yy -# DEPENDS json_parser.yy -# WORKING_DIRECTORY ${qjson_SOURCE_DIR}/lib/ -# ) - -# To regenerate json_scanner.cc use: -# flex json_scanner.yy - -IF (ENABLE_QT5) - qt5_wrap_cpp(qjson_MOC_SRCS ${qjson_MOC_HDRS}) -ELSE (ENABLE_QT5) - if (ENABLE_KDE) - add_definitions(${KDE4_ENABLE_EXCEPTIONS}) - else (ENABLE_KDE) - if (CMAKE_COMPILER_IS_GNUCXX) - add_definitions("-fexceptions -UQT_NO_EXCEPTIONS") - endif (CMAKE_COMPILER_IS_GNUCXX) - if (CMAKE_C_COMPILER MATCHES "icc") - add_definitions(-fexceptions) - endif (CMAKE_C_COMPILER MATCHES "icc") - if (MSVC) - add_definitions(-EHsc) - endif (MSVC) - endif (ENABLE_KDE) - qt4_wrap_cpp(qjson_MOC_SRCS ${qjson_MOC_HDRS}) -ENDIF(ENABLE_QT5) - -set (qjson_SRCS parser.cpp qobjecthelper.cpp json_scanner.cpp json_parser.cc) -set (qjson_HEADERS parser.h qobjecthelper.h ) - -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QTINCLUDES} ) - -add_library (qjson STATIC ${qjson_SRCS} ${qjson_MOC_SRCS} ${qjson_HEADERS}) diff --git a/3rdparty/qjson/COPYING.lib b/3rdparty/qjson/COPYING.lib deleted file mode 100644 index 08f25cd2f..000000000 --- a/3rdparty/qjson/COPYING.lib +++ /dev/null @@ -1,504 +0,0 @@ - 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. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License version 2.1, as published by the Free Software Foundation. - - - 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. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/3rdparty/qjson/FlexLexer.h b/3rdparty/qjson/FlexLexer.h deleted file mode 100644 index bad4ce03f..000000000 --- a/3rdparty/qjson/FlexLexer.h +++ /dev/null @@ -1,206 +0,0 @@ -// -*-C++-*- -// FlexLexer.h -- define interfaces for lexical analyzer classes generated -// by flex - -// Copyright (c) 1993 The Regents of the University of California. -// All rights reserved. -// -// This code is derived from software contributed to Berkeley by -// Kent Williams and Tom Epperly. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: - -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. - -// Neither the name of the University nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. - -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE. - -// This file defines FlexLexer, an abstract class which specifies the -// external interface provided to flex C++ lexer objects, and yyFlexLexer, -// which defines a particular lexer class. -// -// If you want to create multiple lexer classes, you use the -P flag -// to rename each yyFlexLexer to some other xxFlexLexer. You then -// include in your other sources once per lexer class: -// -// #undef yyFlexLexer -// #define yyFlexLexer xxFlexLexer -// #include -// -// #undef yyFlexLexer -// #define yyFlexLexer zzFlexLexer -// #include -// ... - -#ifndef __FLEX_LEXER_H -// Never included before - need to define base class. -#define __FLEX_LEXER_H - -#include -# ifndef FLEX_STD -# define FLEX_STD std:: -# endif - -extern "C++" { - -struct yy_buffer_state; -typedef int yy_state_type; - -class FlexLexer { -public: - virtual ~FlexLexer() { } - - const char* YYText() const { return yytext; } - int YYLeng() const { return yyleng; } - - virtual void - yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0; - virtual struct yy_buffer_state* - yy_create_buffer( FLEX_STD istream* s, int size ) = 0; - virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; - virtual void yyrestart( FLEX_STD istream* s ) = 0; - - virtual int yylex() = 0; - - // Call yylex with new input/output sources. - int yylex( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 ) - { - switch_streams( new_in, new_out ); - return yylex(); - } - - // Switch to new input/output streams. A nil stream pointer - // indicates "keep the current one". - virtual void switch_streams( FLEX_STD istream* new_in = 0, - FLEX_STD ostream* new_out = 0 ) = 0; - - int lineno() const { return yylineno; } - - int debug() const { return yy_flex_debug; } - void set_debug( int flag ) { yy_flex_debug = flag; } - -protected: - char* yytext; - int yyleng; - int yylineno; // only maintained if you use %option yylineno - int yy_flex_debug; // only has effect with -d or "%option debug" -}; - -} -#endif // FLEXLEXER_H - -#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) -// Either this is the first time through (yyFlexLexerOnce not defined), -// or this is a repeated include to define a different flavor of -// yyFlexLexer, as discussed in the flex manual. -#define yyFlexLexerOnce - -extern "C++" { - -class yyFlexLexer : public FlexLexer { -public: - // arg_yyin and arg_yyout default to the cin and cout, but we - // only make that assignment when initializing in yylex(). - yyFlexLexer( FLEX_STD istream* arg_yyin = 0, FLEX_STD ostream* arg_yyout = 0 ); - - virtual ~yyFlexLexer(); - - void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); - struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s, int size ); - void yy_delete_buffer( struct yy_buffer_state* b ); - void yyrestart( FLEX_STD istream* s ); - - void yypush_buffer_state( struct yy_buffer_state* new_buffer ); - void yypop_buffer_state(); - - virtual int yylex(); - virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 ); - virtual int yywrap(); - -protected: - virtual int LexerInput( char* buf, int max_size ); - virtual void LexerOutput( const char* buf, int size ); - virtual void LexerError( const char* msg ); - - void yyunput( int c, char* buf_ptr ); - int yyinput(); - - void yy_load_buffer_state(); - void yy_init_buffer( struct yy_buffer_state* b, FLEX_STD istream* s ); - void yy_flush_buffer( struct yy_buffer_state* b ); - - int yy_start_stack_ptr; - int yy_start_stack_depth; - int* yy_start_stack; - - void yy_push_state( int new_state ); - void yy_pop_state(); - int yy_top_state(); - - yy_state_type yy_get_previous_state(); - yy_state_type yy_try_NUL_trans( yy_state_type current_state ); - int yy_get_next_buffer(); - - FLEX_STD istream* yyin; // input source for default LexerInput - FLEX_STD ostream* yyout; // output sink for default LexerOutput - - // yy_hold_char holds the character lost when yytext is formed. - char yy_hold_char; - - // Number of characters read into yy_ch_buf. - int yy_n_chars; - - // Points to current character in buffer. - char* yy_c_buf_p; - - int yy_init; // whether we need to initialize - int yy_start; // start state number - - // Flag which is used to allow yywrap()'s to do buffer switches - // instead of setting up a fresh yyin. A bit of a hack ... - int yy_did_buffer_switch_on_eof; - - - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - struct yy_buffer_state ** yy_buffer_stack; /**< Stack as an array. */ - void yyensure_buffer_stack(void); - - // The following are not always needed, but may be depending - // on use of certain flex features (like REJECT or yymore()). - - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - yy_state_type* yy_state_buf; - yy_state_type* yy_state_ptr; - - char* yy_full_match; - int* yy_full_state; - int yy_full_lp; - - int yy_lp; - int yy_looking_for_trail_begin; - - int yy_more_flag; - int yy_more_len; - int yy_more_offset; - int yy_prev_more_offset; -}; - -} - -#endif // yyFlexLexer || ! yyFlexLexerOnce - diff --git a/3rdparty/qjson/README.license b/3rdparty/qjson/README.license deleted file mode 100644 index 3ede31323..000000000 --- a/3rdparty/qjson/README.license +++ /dev/null @@ -1,89 +0,0 @@ -Qjson version xxxx, Date - -The following files are licensed under LGPL V2.1: ------------------------------------------------- -src/json_parser.yy -src/json_scanner.cpp -src/json_scanner.h -src/parser.cpp -src/parser.h -src/parser_p.h -src/parserrunnable.cpp -src/parserrunnable.h -src/qjson_debug.h -src/qjson_export.h -src/qobjecthelper.cpp -src/serializer.cpp -src/qobjecthelper.h -src/serializer.h -src/serializerrunnable.cpp -src/serializerrunnable.h -tests/cmdline_tester/cmdline_tester.cpp -tests/cmdline_tester/cmdlineparser.cpp -tests/cmdline_tester/cmdlineparser.h -tests/parser/testparser.cpp -tests/qobjecthelper/person.h -tests/qobjecthelper/testqobjecthelper.cpp -tests/serializer/testserializer.cpp - - -The following files are licensed under GPL V2 with Bison Exception: --------------------------------------------------------------------- -/src/json_parser.cc -/src/stack.hh -/src/location.hh -/src/position.hh -/src/json_parser.hh - - -Copyrights: ----------- -Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -Copyright (C) 2009 Flavio Castelli 2009 Frank Osterfeld -Copyright (C) 2008 Flavio Castelli -Copyright (C) 2009 Till Adam -Copyright (C) 2009 Michael Leupold -Copyright (C) 2009 Flavio Castelli -Copyright (C) 2009 Frank Osterfeld -Copyright (C) 2009 Pino Toscano -Copyright (C) 2010 Flavio Castelli - - -GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999: -------------------------------------------------------------- - -Checkout COPYING.lib - - -GPL V2 with Bison Exception: ----------------------------- -Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - -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, 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. - -As a special exception, you may create a larger work that contains -part or all of the Bison parser skeleton and distribute that work -under terms of your choice, so long as that work isn't itself a -parser generator using the skeleton or a modified version thereof -as a parser skeleton. Alternatively, if you modify or redistribute -the parser skeleton itself, you may (at your option) remove this -special exception, which will cause the skeleton and the resulting -Bison output files to be licensed under the GNU General Public -License without this special exception. - -This special exception was added by the Free Software Foundation in -version 2.2 of Bison. - diff --git a/3rdparty/qjson/json_parser.cc b/3rdparty/qjson/json_parser.cc deleted file mode 100644 index 84fdfac73..000000000 --- a/3rdparty/qjson/json_parser.cc +++ /dev/null @@ -1,1103 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Skeleton implementation for Bison LALR(1) parsers in C++ - - Copyright (C) 2002-2012 Free Software Foundation, Inc. - - 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 3 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, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - - -/* First part of user declarations. */ - -/* Line 279 of lalr1.cc */ -#line 38 "json_parser.cc" - - -#include "json_parser.hh" - -/* User implementation prologue. */ - -/* Line 285 of lalr1.cc */ -#line 46 "json_parser.cc" - - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* FIXME: INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -# ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).begin = YYRHSLOC (Rhs, 1).begin; \ - (Current).end = YYRHSLOC (Rhs, N).end; \ - } \ - else \ - { \ - (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ - } \ - while (/*CONSTCOND*/ false) -# endif - - -/* Suppress unused-variable warnings by "using" E. */ -#define YYUSE(e) ((void) (e)) - -/* Enable debugging if requested. */ -#if YYDEBUG - -/* A pseudo ostream that takes yydebug_ into account. */ -# define YYCDEBUG if (yydebug_) (*yycdebug_) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug_) \ - { \ - *yycdebug_ << Title << ' '; \ - yy_symbol_print_ ((Type), (Value), (Location)); \ - *yycdebug_ << std::endl; \ - } \ -} while (false) - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug_) \ - yy_reduce_print_ (Rule); \ -} while (false) - -# define YY_STACK_PRINT() \ -do { \ - if (yydebug_) \ - yystack_print_ (); \ -} while (false) - -#else /* !YYDEBUG */ - -# define YYCDEBUG if (false) std::cerr -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) YYUSE(Type) -# define YY_REDUCE_PRINT(Rule) static_cast(0) -# define YY_STACK_PRINT() static_cast(0) - -#endif /* !YYDEBUG */ - -#define yyerrok (yyerrstatus_ = 0) -#define yyclearin (yychar = yyempty_) - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab -#define YYRECOVERING() (!!yyerrstatus_) - - -namespace yy { -/* Line 353 of lalr1.cc */ -#line 141 "json_parser.cc" - - /* Return YYSTR after stripping away unnecessary quotes and - backslashes, so that it's suitable for yyerror. The heuristic is - that double-quoting is unnecessary unless the string contains an - apostrophe, a comma, or backslash (other than backslash-backslash). - YYSTR is taken from yytname. */ - std::string - json_parser::yytnamerr_ (const char *yystr) - { - if (*yystr == '"') - { - std::string yyr = ""; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - yyr += *yyp; - break; - - case '"': - return yyr; - } - do_not_strip_quotes: ; - } - - return yystr; - } - - - /// Build a parser object. - json_parser::json_parser (QJson::ParserPrivate* driver_yyarg) - : -#if YYDEBUG - yydebug_ (false), - yycdebug_ (&std::cerr), -#endif - driver (driver_yyarg) - { - } - - json_parser::~json_parser () - { - } - -#if YYDEBUG - /*--------------------------------. - | Print this symbol on YYOUTPUT. | - `--------------------------------*/ - - inline void - json_parser::yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, const location_type* yylocationp) - { - YYUSE (yylocationp); - YYUSE (yyvaluep); - std::ostream& yyo = debug_stream (); - std::ostream& yyoutput = yyo; - YYUSE (yyoutput); - switch (yytype) - { - default: - break; - } - } - - - void - json_parser::yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, const location_type* yylocationp) - { - *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") - << ' ' << yytname_[yytype] << " (" - << *yylocationp << ": "; - yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); - *yycdebug_ << ')'; - } -#endif - - void - json_parser::yydestruct_ (const char* yymsg, - int yytype, semantic_type* yyvaluep, location_type* yylocationp) - { - YYUSE (yylocationp); - YYUSE (yymsg); - YYUSE (yyvaluep); - - if (yymsg) - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } - } - - void - json_parser::yypop_ (unsigned int n) - { - yystate_stack_.pop (n); - yysemantic_stack_.pop (n); - yylocation_stack_.pop (n); - } - -#if YYDEBUG - std::ostream& - json_parser::debug_stream () const - { - return *yycdebug_; - } - - void - json_parser::set_debug_stream (std::ostream& o) - { - yycdebug_ = &o; - } - - - json_parser::debug_level_type - json_parser::debug_level () const - { - return yydebug_; - } - - void - json_parser::set_debug_level (debug_level_type l) - { - yydebug_ = l; - } -#endif - - inline bool - json_parser::yy_pact_value_is_default_ (int yyvalue) - { - return yyvalue == yypact_ninf_; - } - - inline bool - json_parser::yy_table_value_is_error_ (int yyvalue) - { - return yyvalue == yytable_ninf_; - } - - int - json_parser::parse () - { - /// Lookahead and lookahead in internal form. - int yychar = yyempty_; - int yytoken = 0; - - // State. - int yyn; - int yylen = 0; - int yystate = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// Semantic value of the lookahead. - static semantic_type yyval_default; - semantic_type yylval = yyval_default; - /// Location of the lookahead. - location_type yylloc; - /// The locations where the error started and ended. - location_type yyerror_range[3]; - - /// $$. - semantic_type yyval; - /// @$. - location_type yyloc; - - int yyresult; - - // FIXME: This shoud be completely indented. It is not yet to - // avoid gratuitous conflicts when merging into the master branch. - try - { - YYCDEBUG << "Starting parse" << std::endl; - - - /* Initialize the stacks. The initial state will be pushed in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystate_stack_ = state_stack_type (0); - yysemantic_stack_ = semantic_stack_type (0); - yylocation_stack_ = location_stack_type (0); - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yylloc); - - /* New state. */ - yynewstate: - yystate_stack_.push (yystate); - YYCDEBUG << "Entering state " << yystate << std::endl; - - /* Accept? */ - if (yystate == yyfinal_) - goto yyacceptlab; - - goto yybackup; - - /* Backup. */ - yybackup: - - /* Try to take a decision without lookahead. */ - yyn = yypact_[yystate]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - /* Read a lookahead token. */ - if (yychar == yyempty_) - { - YYCDEBUG << "Reading a token: "; - yychar = yylex (&yylval, &yylloc, driver); - } - - /* Convert token to internal form. */ - if (yychar <= yyeof_) - { - yychar = yytoken = yyeof_; - YYCDEBUG << "Now at end of input." << std::endl; - } - else - { - yytoken = yytranslate_ (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) - goto yydefault; - - /* Reduce or error. */ - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the token being shifted. */ - yychar = yyempty_; - - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yylloc); - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus_) - --yyerrstatus_; - - yystate = yyn; - goto yynewstate; - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - /*-----------------------------. - | yyreduce -- Do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. Otherwise, use the top of the stack. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. */ - if (yylen) - yyval = yysemantic_stack_[yylen - 1]; - else - yyval = yysemantic_stack_[0]; - - // Compute the default @$. - { - slice slice (yylocation_stack_, yylen); - YYLLOC_DEFAULT (yyloc, slice, yylen); - } - - // Perform the reduction. - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -/* Line 670 of lalr1.cc */ -#line 82 "json_parser.yy" - { - driver->m_result = (yysemantic_stack_[(1) - (1)]); - qjsonDebug() << "json_parser - parsing finished"; - } - break; - - case 3: -/* Line 670 of lalr1.cc */ -#line 87 "json_parser.yy" - { (yyval) = (yysemantic_stack_[(1) - (1)]); } - break; - - case 4: -/* Line 670 of lalr1.cc */ -#line 89 "json_parser.yy" - { - qCritical()<< "json_parser - syntax error found, " - << "forcing abort, Line" << (yyloc).begin.line << "Column" << (yyloc).begin.column; - YYABORT; - } - break; - - case 6: -/* Line 670 of lalr1.cc */ -#line 96 "json_parser.yy" - { - (yyval) = QVariant(QVariantMap()); - } - break; - - case 7: -/* Line 670 of lalr1.cc */ -#line 99 "json_parser.yy" - { - QVariantMap* map = (yysemantic_stack_[(3) - (2)]).value(); - (yyval) = QVariant(*map); - delete map; - } - break; - - case 8: -/* Line 670 of lalr1.cc */ -#line 105 "json_parser.yy" - { - QVariantMap* pair = new QVariantMap(); - pair->insert((yysemantic_stack_[(3) - (1)]).toString(), (yysemantic_stack_[(3) - (3)])); - (yyval).setValue(pair); - } - break; - - case 9: -/* Line 670 of lalr1.cc */ -#line 110 "json_parser.yy" - { - (yyval).value()->insert((yysemantic_stack_[(5) - (3)]).toString(), (yysemantic_stack_[(5) - (5)])); - } - break; - - case 10: -/* Line 670 of lalr1.cc */ -#line 114 "json_parser.yy" - { - (yyval) = QVariant(QVariantList()); - } - break; - - case 11: -/* Line 670 of lalr1.cc */ -#line 117 "json_parser.yy" - { - QVector* list = (yysemantic_stack_[(3) - (2)]).value* >(); - (yyval) = QVariant(list->toList()); - delete list; - } - break; - - case 12: -/* Line 670 of lalr1.cc */ -#line 123 "json_parser.yy" - { - QVector* list = new QVector(1); - list->replace(0, (yysemantic_stack_[(1) - (1)])); - (yyval).setValue(list); - } - break; - - case 13: -/* Line 670 of lalr1.cc */ -#line 128 "json_parser.yy" - { - (yyval).value* >()->append((yysemantic_stack_[(3) - (3)])); - } - break; - - -/* Line 670 of lalr1.cc */ -#line 549 "json_parser.cc" - default: - break; - } - - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action - invokes YYABORT, YYACCEPT, or YYERROR immediately after altering - yychar. In the case of YYABORT or YYACCEPT, an incorrect - destructor might then be invoked immediately. In the case of - YYERROR, subsequent parser actions might lead to an incorrect - destructor call or verbose syntax error message before the - lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); - - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - - yysemantic_stack_.push (yyval); - yylocation_stack_.push (yyloc); - - /* Shift the result of the reduction. */ - yyn = yyr1_[yyn]; - yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; - if (0 <= yystate && yystate <= yylast_ - && yycheck_[yystate] == yystate_stack_[0]) - yystate = yytable_[yystate]; - else - yystate = yydefgoto_[yyn - yyntokens_]; - goto yynewstate; - - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ - yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus_) - { - ++yynerrs_; - if (yychar == yyempty_) - yytoken = yyempty_; - error (yylloc, yysyntax_error_ (yystate, yytoken)); - } - - yyerror_range[1] = yylloc; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - if (yychar <= yyeof_) - { - /* Return failure if at end of input. */ - if (yychar == yyeof_) - YYABORT; - } - else - { - yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); - yychar = yyempty_; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (false) - goto yyerrorlab; - - yyerror_range[1] = yylocation_stack_[yylen - 1]; - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - yystate = yystate_stack_[0]; - goto yyerrlab1; - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += yyterror_; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yystate_stack_.height () == 1) - YYABORT; - - yyerror_range[1] = yylocation_stack_[0]; - yydestruct_ ("Error: popping", - yystos_[yystate], - &yysemantic_stack_[0], &yylocation_stack_[0]); - yypop_ (); - yystate = yystate_stack_[0]; - YY_STACK_PRINT (); - } - - yyerror_range[2] = yylloc; - // Using YYLLOC is tempting, but would change the location of - // the lookahead. YYLOC is available though. - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); - yysemantic_stack_.push (yylval); - yylocation_stack_.push (yyloc); - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], - &yysemantic_stack_[0], &yylocation_stack_[0]); - - yystate = yyn; - goto yynewstate; - - /* Accept. */ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - /* Abort. */ - yyabortlab: - yyresult = 1; - goto yyreturn; - - yyreturn: - if (yychar != yyempty_) - { - /* Make sure we have latest lookahead translation. See comments - at user semantic actions for why this is necessary. */ - yytoken = yytranslate_ (yychar); - yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, - &yylloc); - } - - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - while (1 < yystate_stack_.height ()) - { - yydestruct_ ("Cleanup: popping", - yystos_[yystate_stack_[0]], - &yysemantic_stack_[0], - &yylocation_stack_[0]); - yypop_ (); - } - - return yyresult; - } - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack" - << std::endl; - // Do not try to display the values of the reclaimed symbols, - // as their printer might throw an exception. - if (yychar != yyempty_) - { - /* Make sure we have latest lookahead translation. See - comments at user semantic actions for why this is - necessary. */ - yytoken = yytranslate_ (yychar); - yydestruct_ (YY_NULL, yytoken, &yylval, &yylloc); - } - - while (1 < yystate_stack_.height ()) - { - yydestruct_ (YY_NULL, - yystos_[yystate_stack_[0]], - &yysemantic_stack_[0], - &yylocation_stack_[0]); - yypop_ (); - } - throw; - } - } - - // Generate an error message. - std::string - json_parser::yysyntax_error_ (int yystate, int yytoken) - { - std::string yyres; - // Number of reported tokens (one for the "unexpected", one per - // "expected"). - size_t yycount = 0; - // Its maximum. - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - // Arguments of yyformat. - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yytoken) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state - merging (from LALR or IELR) and default reductions corrupt the - expected token list. However, the list is correct for - canonical LR with one exception: it will still contain any - token that will not be accepted due to an error action in a - later state. - */ - if (yytoken != yyempty_) - { - yyarg[yycount++] = yytname_[yytoken]; - int yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_ (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - for (int yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ - && !yy_table_value_is_error_ (yytable_[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - break; - } - else - yyarg[yycount++] = yytname_[yyx]; - } - } - } - - char const* yyformat = YY_NULL; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - // Argument number. - size_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += yytnamerr_ (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ - const signed char json_parser::yypact_ninf_ = -5; - const signed char - json_parser::yypact_[] = - { - 1, -5, -5, 3, 18, -5, -5, -5, -5, -5, - 8, -5, -5, -5, -5, -5, 2, 11, -5, -3, - -5, -5, 29, -5, 4, -5, 29, -5, 13, -5, - 29, -5 - }; - - /* YYDEFACT[S] -- default reduction number in state S. Performed when - YYTABLE doesn't specify something else to do. Zero means the - default is an error. */ - const unsigned char - json_parser::yydefact_[] = - { - 0, 5, 4, 0, 0, 15, 16, 17, 18, 14, - 0, 2, 19, 20, 3, 6, 0, 0, 10, 0, - 12, 1, 0, 7, 0, 11, 0, 8, 0, 13, - 0, 9 - }; - - /* YYPGOTO[NTERM-NUM]. */ - const signed char - json_parser::yypgoto_[] = - { - -5, -5, -5, -5, -5, -5, -5, -4 - }; - - /* YYDEFGOTO[NTERM-NUM]. */ - const signed char - json_parser::yydefgoto_[] = - { - -1, 10, 11, 12, 17, 13, 19, 14 - }; - - /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF_, syntax error. */ - const signed char json_parser::yytable_ninf_ = -1; - const unsigned char - json_parser::yytable_[] = - { - 20, 1, 2, 25, 3, 26, 4, 15, 21, 22, - 5, 6, 7, 8, 9, 23, 16, 28, 27, 24, - 30, 3, 29, 4, 18, 0, 31, 5, 6, 7, - 8, 9, 3, 0, 4, 0, 0, 0, 5, 6, - 7, 8, 9 - }; - - /* YYCHECK. */ - const signed char - json_parser::yycheck_[] = - { - 4, 0, 1, 6, 3, 8, 5, 4, 0, 7, - 9, 10, 11, 12, 13, 4, 13, 13, 22, 8, - 7, 3, 26, 5, 6, -1, 30, 9, 10, 11, - 12, 13, 3, -1, 5, -1, -1, -1, 9, 10, - 11, 12, 13 - }; - - /* STOS_[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ - const unsigned char - json_parser::yystos_[] = - { - 0, 0, 1, 3, 5, 9, 10, 11, 12, 13, - 16, 17, 18, 20, 22, 4, 13, 19, 6, 21, - 22, 0, 7, 4, 8, 6, 8, 22, 13, 22, - 7, 22 - }; - -#if YYDEBUG - /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding - to YYLEX-NUM. */ - const unsigned short int - json_parser::yytoken_number_[] = - { - 0, 256, 257, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12 - }; -#endif - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ - const unsigned char - json_parser::yyr1_[] = - { - 0, 15, 16, 17, 17, 17, 18, 18, 19, 19, - 20, 20, 21, 21, 22, 22, 22, 22, 22, 22, - 22 - }; - - /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ - const unsigned char - json_parser::yyr2_[] = - { - 0, 2, 1, 1, 1, 1, 2, 3, 3, 5, - 2, 3, 1, 3, 1, 1, 1, 1, 1, 1, - 1 - }; - - - /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at \a yyntokens_, nonterminals. */ - const char* - const json_parser::yytname_[] = - { - "\"end of file\"", "error", "$undefined", "\"{\"", "\"}\"", "\"[\"", - "\"]\"", "\":\"", "\",\"", "\"number\"", "\"true\"", "\"false\"", - "\"null\"", "\"string\"", "\"invalid\"", "$accept", "start", "data", - "object", "members", "array", "values", "value", YY_NULL - }; - -#if YYDEBUG - /* YYRHS -- A `-1'-separated list of the rules' RHS. */ - const json_parser::rhs_number_type - json_parser::yyrhs_[] = - { - 16, 0, -1, 17, -1, 22, -1, 1, -1, 0, - -1, 3, 4, -1, 3, 19, 4, -1, 13, 7, - 22, -1, 19, 8, 13, 7, 22, -1, 5, 6, - -1, 5, 21, 6, -1, 22, -1, 21, 8, 22, - -1, 13, -1, 9, -1, 10, -1, 11, -1, 12, - -1, 18, -1, 20, -1 - }; - - /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ - const unsigned char - json_parser::yyprhs_[] = - { - 0, 0, 3, 5, 7, 9, 11, 14, 18, 22, - 28, 31, 35, 37, 41, 43, 45, 47, 49, 51, - 53 - }; - - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ - const unsigned char - json_parser::yyrline_[] = - { - 0, 82, 82, 87, 88, 94, 96, 99, 105, 110, - 114, 117, 123, 128, 132, 133, 134, 135, 136, 137, - 138 - }; - - // Print the state stack on the debug stream. - void - json_parser::yystack_print_ () - { - *yycdebug_ << "Stack now"; - for (state_stack_type::const_iterator i = yystate_stack_.begin (); - i != yystate_stack_.end (); ++i) - *yycdebug_ << ' ' << *i; - *yycdebug_ << std::endl; - } - - // Report on the debug stream that the rule \a yyrule is going to be reduced. - void - json_parser::yy_reduce_print_ (int yyrule) - { - unsigned int yylno = yyrline_[yyrule]; - int yynrhs = yyr2_[yyrule]; - /* Print the symbols being reduced, and their result. */ - *yycdebug_ << "Reducing stack by rule " << yyrule - 1 - << " (line " << yylno << "):" << std::endl; - /* The symbols being reduced. */ - for (int yyi = 0; yyi < yynrhs; yyi++) - YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", - yyrhs_[yyprhs_[yyrule] + yyi], - &(yysemantic_stack_[(yynrhs) - (yyi + 1)]), - &(yylocation_stack_[(yynrhs) - (yyi + 1)])); - } -#endif // YYDEBUG - - /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ - json_parser::token_number_type - json_parser::yytranslate_ (int t) - { - static - const token_number_type - translate_table[] = - { - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2 - }; - if ((unsigned int) t <= yyuser_token_number_max_) - return translate_table[t]; - else - return yyundef_token_; - } - - const int json_parser::yyeof_ = 0; - const int json_parser::yylast_ = 42; - const int json_parser::yynnts_ = 8; - const int json_parser::yyempty_ = -2; - const int json_parser::yyfinal_ = 21; - const int json_parser::yyterror_ = 1; - const int json_parser::yyerrcode_ = 256; - const int json_parser::yyntokens_ = 15; - - const unsigned int json_parser::yyuser_token_number_max_ = 257; - const json_parser::token_number_type json_parser::yyundef_token_ = 2; - - -} // yy -/* Line 1141 of lalr1.cc */ -#line 1079 "json_parser.cc" -/* Line 1142 of lalr1.cc */ -#line 140 "json_parser.yy" - - -int yy::yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate* driver) -{ - JSonScanner* scanner = driver->m_scanner; - yylval->clear(); - int ret = scanner->yylex(yylval, yylloc); - - qjsonDebug() << "json_parser::yylex - calling scanner yylval==|" - << yylval->toByteArray() << "|, ret==|" << QString::number(ret) << "|"; - - return ret; -} - -void yy::json_parser::error (const yy::location& yyloc, const std::string& error) -{ - /*qjsonDebug() << yyloc.begin.line; - qjsonDebug() << yyloc.begin.column; - qjsonDebug() << yyloc.end.line; - qjsonDebug() << yyloc.end.column;*/ - qjsonDebug() << "json_parser::error [line" << yyloc.end.line << "] -" << error.c_str() ; - driver->setError(QString::fromLatin1(error.c_str()), yyloc.end.line); -} diff --git a/3rdparty/qjson/json_parser.hh b/3rdparty/qjson/json_parser.hh deleted file mode 100644 index 25e00fa1b..000000000 --- a/3rdparty/qjson/json_parser.hh +++ /dev/null @@ -1,300 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Skeleton interface for Bison LALR(1) parsers in C++ - - Copyright (C) 2002-2012 Free Software Foundation, Inc. - - 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 3 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, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/** - ** \file json_parser.hh - ** Define the yy::parser class. - */ - -/* C++ LALR(1) parser skeleton written by Akim Demaille. */ - -#ifndef YY_YY_JSON_PARSER_HH_INCLUDED -# define YY_YY_JSON_PARSER_HH_INCLUDED - -/* "%code requires" blocks. */ -/* Line 33 of lalr1.cc */ -#line 26 "json_parser.yy" - - #include "parser_p.h" - #include "json_scanner.h" - #include "qjson_debug.h" - - #include - #include - #include - #include - - #include - - class JSonScanner; - - namespace QJson { - class Parser; - } - - #define YYERROR_VERBOSE 1 - - Q_DECLARE_METATYPE(QVector*) - Q_DECLARE_METATYPE(QVariantMap*) - - -/* Line 33 of lalr1.cc */ -#line 72 "json_parser.hh" - - -#include -#include -#include "stack.hh" -#include "location.hh" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif - - -namespace yy { -/* Line 33 of lalr1.cc */ -#line 88 "json_parser.hh" - - /// A Bison parser. - class json_parser - { - public: - /// Symbol semantic values. -#ifndef YYSTYPE - typedef int semantic_type; -#else - typedef YYSTYPE semantic_type; -#endif - /// Symbol locations. - typedef location location_type; - /// Tokens. - struct token - { - /* Tokens. */ - enum yytokentype { - END = 0, - CURLY_BRACKET_OPEN = 1, - CURLY_BRACKET_CLOSE = 2, - SQUARE_BRACKET_OPEN = 3, - SQUARE_BRACKET_CLOSE = 4, - COLON = 5, - COMMA = 6, - NUMBER = 7, - TRUE_VAL = 8, - FALSE_VAL = 9, - NULL_VAL = 10, - STRING = 11, - INVALID = 12 - }; - - }; - /// Token type. - typedef token::yytokentype token_type; - - /// Build a parser object. - json_parser (QJson::ParserPrivate* driver_yyarg); - virtual ~json_parser (); - - /// Parse. - /// \returns 0 iff parsing succeeded. - virtual int parse (); - -#if YYDEBUG - /// The current debugging stream. - std::ostream& debug_stream () const; - /// Set the current debugging stream. - void set_debug_stream (std::ostream &); - - /// Type for debugging levels. - typedef int debug_level_type; - /// The current debugging level. - debug_level_type debug_level () const; - /// Set the current debugging level. - void set_debug_level (debug_level_type l); -#endif - - private: - /// Report a syntax error. - /// \param loc where the syntax error is found. - /// \param msg a description of the syntax error. - virtual void error (const location_type& loc, const std::string& msg); - - /// Generate an error message. - /// \param state the state where the error occurred. - /// \param tok the lookahead token. - virtual std::string yysyntax_error_ (int yystate, int tok); - -#if YYDEBUG - /// \brief Report a symbol value on the debug stream. - /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - virtual void yy_symbol_value_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); - /// \brief Report a symbol on the debug stream. - /// \param yytype The token type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - virtual void yy_symbol_print_ (int yytype, - const semantic_type* yyvaluep, - const location_type* yylocationp); -#endif - - - /// State numbers. - typedef int state_type; - /// State stack type. - typedef stack state_stack_type; - /// Semantic value stack type. - typedef stack semantic_stack_type; - /// location stack type. - typedef stack location_stack_type; - - /// The state stack. - state_stack_type yystate_stack_; - /// The semantic value stack. - semantic_stack_type yysemantic_stack_; - /// The location stack. - location_stack_type yylocation_stack_; - - /// Whether the given \c yypact_ value indicates a defaulted state. - /// \param yyvalue the value to check - static bool yy_pact_value_is_default_ (int yyvalue); - - /// Whether the given \c yytable_ value indicates a syntax error. - /// \param yyvalue the value to check - static bool yy_table_value_is_error_ (int yyvalue); - - /// Internal symbol numbers. - typedef unsigned char token_number_type; - /* Tables. */ - /// For a state, the index in \a yytable_ of its portion. - static const signed char yypact_[]; - static const signed char yypact_ninf_; - - /// For a state, default reduction number. - /// Unless\a yytable_ specifies something else to do. - /// Zero means the default is an error. - static const unsigned char yydefact_[]; - - static const signed char yypgoto_[]; - static const signed char yydefgoto_[]; - - /// What to do in a state. - /// \a yytable_[yypact_[s]]: what to do in state \a s. - /// - if positive, shift that token. - /// - if negative, reduce the rule which number is the opposite. - /// - if zero, do what YYDEFACT says. - static const unsigned char yytable_[]; - static const signed char yytable_ninf_; - - static const signed char yycheck_[]; - - /// For a state, its accessing symbol. - static const unsigned char yystos_[]; - - /// For a rule, its LHS. - static const unsigned char yyr1_[]; - /// For a rule, its RHS length. - static const unsigned char yyr2_[]; - - /// Convert the symbol name \a n to a form suitable for a diagnostic. - static std::string yytnamerr_ (const char *n); - - - /// For a symbol, its name in clear. - static const char* const yytname_[]; -#if YYDEBUG - /// A type to store symbol numbers and -1. - typedef signed char rhs_number_type; - /// A `-1'-separated list of the rules' RHS. - static const rhs_number_type yyrhs_[]; - /// For each rule, the index of the first RHS symbol in \a yyrhs_. - static const unsigned char yyprhs_[]; - /// For each rule, its source line number. - static const unsigned char yyrline_[]; - /// For each scanner token number, its symbol number. - static const unsigned short int yytoken_number_[]; - /// Report on the debug stream that the rule \a r is going to be reduced. - virtual void yy_reduce_print_ (int r); - /// Print the state stack on the debug stream. - virtual void yystack_print_ (); - - /* Debugging. */ - int yydebug_; - std::ostream* yycdebug_; -#endif - - /// Convert a scanner token number \a t to a symbol number. - token_number_type yytranslate_ (int t); - - /// \brief Reclaim the memory associated to a symbol. - /// \param yymsg Why this token is reclaimed. - /// If null, do not display the symbol, just free it. - /// \param yytype The symbol type. - /// \param yyvaluep Its semantic value. - /// \param yylocationp Its location. - inline void yydestruct_ (const char* yymsg, - int yytype, - semantic_type* yyvaluep, - location_type* yylocationp); - - /// Pop \a n symbols the three stacks. - inline void yypop_ (unsigned int n = 1); - - /* Constants. */ - static const int yyeof_; - /* LAST_ -- Last index in TABLE_. */ - static const int yylast_; - static const int yynnts_; - static const int yyempty_; - static const int yyfinal_; - static const int yyterror_; - static const int yyerrcode_; - static const int yyntokens_; - static const unsigned int yyuser_token_number_max_; - static const token_number_type yyundef_token_; - - /* User arguments. */ - QJson::ParserPrivate* driver; - }; - -} // yy -/* Line 33 of lalr1.cc */ -#line 297 "json_parser.hh" - - - -#endif /* !YY_YY_JSON_PARSER_HH_INCLUDED */ diff --git a/3rdparty/qjson/json_parser.yy b/3rdparty/qjson/json_parser.yy deleted file mode 100644 index fa4656bab..000000000 --- a/3rdparty/qjson/json_parser.yy +++ /dev/null @@ -1,162 +0,0 @@ -/* This file is part of QJSon - * - * Copyright (C) 2008 Flavio Castelli - * Copyright (C) 2013 Silvio Moioli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -%skeleton "lalr1.cc" -%defines -%define "parser_class_name" "json_parser" - -%code requires{ - #include "parser_p.h" - #include "json_scanner.h" - #include "qjson_debug.h" - - #include - #include - #include - #include - - #include - - class JSonScanner; - - namespace QJson { - class Parser; - } - - #define YYERROR_VERBOSE 1 - - Q_DECLARE_METATYPE(QVector*) - Q_DECLARE_METATYPE(QVariantMap*) -} - -%parse-param { QJson::ParserPrivate* driver } -%lex-param { QJson::ParserPrivate* driver } - -%locations - -%debug -%error-verbose - -%token END 0 "end of file" - -%token CURLY_BRACKET_OPEN 1 "{" -%token CURLY_BRACKET_CLOSE 2 "}" -%token SQUARE_BRACKET_OPEN 3 "[" -%token SQUARE_BRACKET_CLOSE 4 "]" -%token COLON 5 ":" -%token COMMA 6 "," - -%token NUMBER 7 "number" -%token TRUE_VAL 8 "true" -%token FALSE_VAL 9 "false" -%token NULL_VAL 10 "null" -%token STRING 11 "string" - -%token INVALID 12 "invalid" - -// define the initial token -%start start - -%% - -// grammar rules - -start: data { - driver->m_result = $1; - qjsonDebug() << "json_parser - parsing finished"; - }; - -data: value { $$ = $1; } - | error - { - qCritical()<< "json_parser - syntax error found, " - << "forcing abort, Line" << @$.begin.line << "Column" << @$.begin.column; - YYABORT; - } - | END; - -object: CURLY_BRACKET_OPEN CURLY_BRACKET_CLOSE { - $$ = QVariant(QVariantMap()); - } - | CURLY_BRACKET_OPEN members CURLY_BRACKET_CLOSE { - QVariantMap* map = $2.value(); - $$ = QVariant(*map); - delete map; - }; - -members: STRING COLON value { - QVariantMap* pair = new QVariantMap(); - pair->insert($1.toString(), $3); - $$.setValue(pair); - } - | members COMMA STRING COLON value { - $$.value()->insert($3.toString(), $5); - }; - -array: SQUARE_BRACKET_OPEN SQUARE_BRACKET_CLOSE { - $$ = QVariant(QVariantList()); - } - | SQUARE_BRACKET_OPEN values SQUARE_BRACKET_CLOSE { - QVector* list = $2.value* >(); - $$ = QVariant(list->toList()); - delete list; - }; - -values: value { - QVector* list = new QVector(1); - list->replace(0, $1); - $$.setValue(list); - } - | values COMMA value { - $$.value* >()->append($3); - }; - -value: STRING - | NUMBER - | TRUE_VAL - | FALSE_VAL - | NULL_VAL - | object - | array; - -%% - -int yy::yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate* driver) -{ - JSonScanner* scanner = driver->m_scanner; - yylval->clear(); - int ret = scanner->yylex(yylval, yylloc); - - qjsonDebug() << "json_parser::yylex - calling scanner yylval==|" - << yylval->toByteArray() << "|, ret==|" << QString::number(ret) << "|"; - - return ret; -} - -void yy::json_parser::error (const yy::location& yyloc, const std::string& error) -{ - /*qjsonDebug() << yyloc.begin.line; - qjsonDebug() << yyloc.begin.column; - qjsonDebug() << yyloc.end.line; - qjsonDebug() << yyloc.end.column;*/ - qjsonDebug() << "json_parser::error [line" << yyloc.end.line << "] -" << error.c_str() ; - driver->setError(QString::fromLatin1(error.c_str()), yyloc.end.line); -} diff --git a/3rdparty/qjson/json_scanner.cc b/3rdparty/qjson/json_scanner.cc deleted file mode 100644 index d148b0cd6..000000000 --- a/3rdparty/qjson/json_scanner.cc +++ /dev/null @@ -1,4513 +0,0 @@ -#line 2 "json_scanner.cc" - -#line 4 "json_scanner.cc" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - - /* The c++ scanner is a mess. The FlexLexer.h header file relies on the - * following macro. This is required in order to pass the c++-multiple-scanners - * test in the regression suite. We get reports that it breaks inheritance. - * We will address this in a future release of flex, or omit the C++ scanner - * altogether. - */ - #define yyFlexLexer yyFlexLexer - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ -#include -#include -#include -#include -#include -/* end standard C++ headers. */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern yy_size_t yyleng; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - - std::istream* yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -#define yytext_ptr yytext - -#include - -int yyFlexLexer::yywrap() { return 1; } -int yyFlexLexer::yylex() - { - LexerError( "yyFlexLexer::yylex invoked but %option yyclass used" ); - return 0; - } - -#define YY_DECL int JSonScanner::yylex() -static yyconst flex_int16_t yy_nxt[][256] = - { - { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 - }, - - { - 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, - 12, 11, 11, 13, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 10, 14, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 15, 16, 10, 10, 17, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 19, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 20, 10, 21, 10, 10, 10, 10, 10, 10, - 10, 10, 22, 10, 10, 10, 10, 10, 10, 10, - 23, 10, 10, 10, 10, 10, 24, 10, 10, 10, - 10, 10, 10, 25, 10, 26, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10 - }, - - { - 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, - 12, 11, 11, 13, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 10, 14, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 15, 16, 10, 10, 17, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 19, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 20, 10, 21, 10, 10, 10, 10, 10, 10, - 10, 10, 22, 10, 10, 10, 10, 10, 10, 10, - 23, 10, 10, 10, 10, 10, 24, 10, 10, 10, - 10, 10, 10, 25, 10, 26, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10 - }, - - { - 9, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 29, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27 - }, - - { - 9, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 29, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27 - - }, - - { - 9, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 30, 30, - 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, - 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, - - 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30 - }, - - { - 9, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - - 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 30, 30, - 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, - 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, - 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30 - }, - - { - 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, - 12, 11, 11, 13, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 10, 14, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 15, 32, 10, 10, 17, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 19, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 33, 10, 10, 10, 10, 34, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 20, 10, 21, 10, 10, 10, 10, 10, 10, - 10, 10, 22, 10, 10, 33, 10, 10, 10, 10, - 35, 10, 10, 10, 10, 10, 24, 10, 10, 10, - 10, 10, 10, 25, 10, 26, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10 - }, - - { - 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, - 12, 11, 11, 13, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 11, 10, 14, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 15, 32, 10, 10, 17, 18, - 18, 18, 18, 18, 18, 18, 18, 18, 19, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 33, 10, 10, 10, 10, 34, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 20, 10, 21, 10, 10, 10, 10, 10, 10, - 10, 10, 22, 10, 10, 33, 10, 10, 10, 10, - 35, 10, 10, 10, 10, 10, 24, 10, 10, 10, - - 10, 10, 10, 25, 10, 26, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10 - }, - - { - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, - -9, -9, -9, -9, -9, -9 - - }, - - { - 9, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, - -10, -10, -10, -10, -10, -10 - }, - - { - 9, -11, -11, -11, -11, -11, -11, -11, -11, 36, - -11, 36, 36, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, 36, -11, -11, -11, -11, -11, -11, -11, - - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - - -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, - -11, -11, -11, -11, -11, -11 - }, - - { - 9, -12, -12, -12, -12, -12, -12, -12, -12, -12, - 37, -12, -12, 37, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, - -12, -12, -12, -12, -12, -12 - }, - - { - 9, -13, -13, -13, -13, -13, -13, -13, -13, -13, - 37, -13, -13, 37, -13, -13, -13, -13, -13, -13, - - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, - -13, -13, -13, -13, -13, -13 - }, - - { - 9, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, - -14, -14, -14, -14, -14, -14 - - }, - - { - 9, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, - -15, -15, -15, -15, -15, -15 - }, - - { - 9, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - - -16, -16, -16, -16, -16, -16, -16, -16, 38, 39, - 39, 39, 39, 39, 39, 39, 39, 39, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - - -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, - -16, -16, -16, -16, -16, -16 - }, - - { - 9, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, 40, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, 41, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, 41, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, - -17, -17, -17, -17, -17, -17 - }, - - { - 9, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, 40, -18, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, 41, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, 41, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, - -18, -18, -18, -18, -18, -18 - }, - - { - 9, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, - -19, -19, -19, -19, -19, -19 - - }, - - { - 9, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, - -20, -20, -20, -20, -20, -20 - }, - - { - 9, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - - -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, - -21, -21, -21, -21, -21, -21 - }, - - { - 9, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, 43, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, - -22, -22, -22, -22, -22, -22 - }, - - { - 9, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, 44, -23, -23, - - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, - -23, -23, -23, -23, -23, -23 - }, - - { - 9, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, 45, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24 - - }, - - { - 9, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25 - }, - - { - 9, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - - -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, - -26, -26, -26, -26, -26, -26 - }, - - { - 9, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, -27, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, -27, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46 - }, - - { - 9, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, - -28, -28, -28, -28, -28, -28 - }, - - { - 9, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, 47, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, 48, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, 49, -29, -29, -29, -29, -29, 50, -29, - -29, -29, 51, -29, -29, -29, -29, -29, -29, -29, - 52, -29, -29, -29, 53, -29, 54, 55, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, - -29, -29, -29, -29, -29, -29 - - }, - - { - 9, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, - -30, -30, -30, -30, -30, -30 - }, - - { - 9, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - - -31, -31, -31, -31, -31, -31, -31, -31, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, -31, -31, - -31, -31, -31, -31, -31, 56, 56, 56, 56, 56, - 56, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, 56, 56, 56, - 56, 56, 56, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - - -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, - -31, -31, -31, -31, -31, -31 - }, - - { - 9, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, 38, 39, - 39, 39, 39, 39, 39, 39, 39, 39, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, 57, -32, -32, -32, -32, -32, -32, - - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, 57, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, - -32, -32, -32, -32, -32, -32 - }, - - { - 9, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - 58, -33, -33, -33, -33, -33, -33, -33, -33, -33, - - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, - -33, -33, -33, -33, -33, -33 - }, - - { - 9, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - - -34, -34, -34, -34, -34, 59, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, 59, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34 - - }, - - { - 9, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, 59, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, 59, -35, -35, - - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, 44, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, - -35, -35, -35, -35, -35, -35 - }, - - { - 9, -36, -36, -36, -36, -36, -36, -36, -36, 36, - -36, 36, 36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, 36, -36, -36, -36, -36, -36, -36, -36, - - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - - -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, - -36, -36, -36, -36, -36, -36 - }, - - { - 9, -37, -37, -37, -37, -37, -37, -37, -37, -37, - 37, -37, -37, 37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, - -37, -37, -37, -37, -37, -37 - }, - - { - 9, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, 40, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, 41, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, 41, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38 - }, - - { - 9, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, 40, -39, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, -39, -39, - - -39, -39, -39, -39, -39, -39, -39, -39, -39, 41, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, 41, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, - -39, -39, -39, -39, -39, -39 - - }, - - { - 9, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, - -40, -40, -40, -40, -40, -40 - }, - - { - 9, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - - -41, -41, -41, 62, -41, 62, -41, -41, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - - -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, - -41, -41, -41, -41, -41, -41 - }, - - { - 9, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, 40, -42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, 41, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, 41, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, - -42, -42, -42, -42, -42, -42 - }, - - { - 9, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, 64, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, - -43, -43, -43, -43, -43, -43 - }, - - { - 9, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, 65, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44 - - }, - - { - 9, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, 66, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45 - }, - - { - 9, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, -46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, -46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46 - }, - - { - 9, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, - -47, -47, -47, -47, -47, -47 - }, - - { - 9, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, - -48, -48, -48, -48, -48, -48 - }, - - { - 9, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, - -49, -49, -49, -49, -49, -49 - - }, - - { - 9, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, - -50, -50, -50, -50, -50, -50 - }, - - { - 9, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - - -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, - -51, -51, -51, -51, -51, -51 - }, - - { - 9, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, - -52, -52, -52, -52, -52, -52 - }, - - { - 9, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53, -53, -53, -53, -53, - -53, -53, -53, -53, -53, -53 - }, - - { - 9, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54, -54, -54, -54, -54, - -54, -54, -54, -54, -54, -54 - - }, - - { - 9, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55, -55, -55, -55, -55, - -55, -55, -55, -55, -55, -55 - }, - - { - 9, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - - -56, -56, -56, -56, -56, -56, -56, -56, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, -56, -56, - -56, -56, -56, -56, -56, 67, 67, 67, 67, 67, - 67, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, 67, 67, 67, - 67, 67, 67, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - - -56, -56, -56, -56, -56, -56, -56, -56, -56, -56, - -56, -56, -56, -56, -56, -56 - }, - - { - 9, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - 68, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, - -57, -57, -57, -57, -57, -57 - }, - - { - 9, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, 69, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, - -58, -58, -58, -58, -58, -58 - }, - - { - 9, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, 70, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - 70, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, - -59, -59, -59, -59, -59, -59 - - }, - - { - 9, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, 40, -60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, 41, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - - -60, 41, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, - -60, -60, -60, -60, -60, -60 - }, - - { - 9, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - - -61, -61, -61, -61, -61, -61, -61, -61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, 41, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, 41, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61 - }, - - { - 9, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, - -62, -62, -62, -62, -62, -62 - }, - - { - 9, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, - -63, -63, -63, -63, -63, -63 - }, - - { - 9, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, 71, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64 - - }, - - { - 9, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - - -65, -65, -65, -65, -65, -65, -65, -65, 72, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, - -65, -65, -65, -65, -65, -65 - }, - - { - 9, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, 73, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - - -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, - -66, -66, -66, -66, -66, -66 - }, - - { - 9, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, -67, -67, - -67, -67, -67, -67, -67, 74, 74, 74, 74, 74, - 74, -67, -67, -67, -67, -67, -67, -67, -67, -67, - - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, 74, 74, 74, - 74, 74, 74, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67, -67, -67, -67, -67, - -67, -67, -67, -67, -67, -67 - }, - - { - 9, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, 75, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, - -68, -68, -68, -68, -68, -68 - }, - - { - 9, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, 76, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, - -69, -69, -69, -69, -69, -69 - - }, - - { - 9, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, - -70, -70, -70, -70, -70, -70 - }, - - { - 9, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, 77, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - - -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, - -71, -71, -71, -71, -71, -71 - }, - - { - 9, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - -72, -72, -72, -72, -72, -72 - }, - - { - 9, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, - -73, -73, -73, -73, -73, -73 - }, - - { - 9, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, - -74, -74, -74, -74, -74, -74 - - }, - - { - 9, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - - -75, -75, -75, -75, -75, 78, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, - -75, -75, -75, -75, -75, -75 - }, - - { - 9, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - 79, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - - -76, -76, -76, -76, -76, -76, -76, -76, -76, -76, - -76, -76, -76, -76, -76, -76 - }, - - { - 9, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, - -77, -77, -77, -77, -77, -77 - }, - - { - 9, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - 80, -78, -78, -78, -78, -78, -78, -78, -78, -78, - - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78, -78, -78, -78, -78, - -78, -78, -78, -78, -78, -78 - }, - - { - 9, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, 81, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, - -79, -79, -79, -79, -79, -79 - - }, - - { - 9, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - - -80, -80, -80, -80, -80, 82, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -80, -80, -80, -80 - }, - - { - 9, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, 83, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - - -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, - -81, -81, -81, -81, -81, -81 - }, - - { - 9, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, 84, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, - -82, -82, -82, -82, -82, -82 - }, - - { - 9, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - - -83, 85, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, - -83, -83, -83, -83, -83, -83 - }, - - { - 9, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, 86, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, - -84, -84, -84, -84, -84, -84 - - }, - - { - 9, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, - -85, -85, -85, -85, -85, -85 - }, - - { - 9, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - - -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, - -86, -86, -86, -86, -86, -86 - }, - - } ; - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 36 -#define YY_END_OF_BUFFER 37 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[87] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 37, 35, - 1, 2, 2, 11, 27, 35, 6, 6, 26, 28, - 29, 35, 35, 35, 30, 31, 21, 23, 22, 25, - 25, 35, 35, 35, 35, 1, 2, 8, 8, 0, - 0, 7, 0, 0, 0, 21, 12, 14, 13, 15, - 16, 17, 18, 19, 20, 0, 0, 0, 0, 9, - 10, 0, 10, 0, 0, 0, 0, 0, 0, 32, - 0, 5, 3, 24, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 33, 34 - } ; - -static yyconst yy_state_type yy_NUL_trans[87] = - { 0, - 10, 10, 27, 27, 30, 30, 10, 10, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 - } ; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -#line 1 "json_scanner.yy" -/* This file is part of QJson - * - * Copyright (C) 2013 Silvio Moioli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110yy::json_parser::token::INVALID301, USA. - */ -/* Flex output settings */ -#define YY_NO_UNISTD_H 1 -#define YY_NO_INPUT 1 -#line 29 "json_scanner.yy" - #include "json_scanner.h" - #include "json_parser.hh" - - #if defined(_WIN32) && !defined(__MINGW32__) - #define strtoll _strtoi64 - #define strtoull _strtoui64 - #endif - - #define YY_USER_INIT if(m_allowSpecialNumbers) { \ - BEGIN(ALLOW_SPECIAL_NUMBERS); \ - } -/* Exclusive subscanners for strings and escaped hex sequences */ - -/* Extra-JSON rules active iff m_allowSpecialNumbers is true */ - -#line 3168 "json_scanner.cc" - -#define INITIAL 0 -#define QUOTMARK_OPEN 1 -#define HEX_OPEN 2 -#define ALLOW_SPECIAL_NUMBERS 3 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -#define ECHO LexerOutput( yytext, yyleng ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ -\ - if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) LexerError( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 -#define YY_DECL int yyFlexLexer::yylex() -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 48 "json_scanner.yy" - - - /* Whitespace */ -#line 3275 "json_scanner.cc" - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = & std::cin; - - if ( ! yyout ) - yyout = & std::cout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - while ( (yy_current_state = yy_nxt[yy_current_state][ YY_SC_TO_UI(*yy_cp) ]) > 0 ) - { - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - - ++yy_cp; - } - - yy_current_state = -yy_current_state; - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos) + 1; - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 51 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - } - YY_BREAK -case 2: -/* rule 2 can match eol */ -YY_RULE_SETUP -#line 55 "json_scanner.yy" -{ - m_yylloc->lines(yyleng); - } - YY_BREAK -/* Special values */ -case 3: -YY_RULE_SETUP -#line 61 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(true); - return yy::json_parser::token::TRUE_VAL; - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 67 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(false); - return yy::json_parser::token::FALSE_VAL; - } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 73 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(); - return yy::json_parser::token::NULL_VAL; - } - YY_BREAK -/* Numbers */ -case 6: -#line 82 "json_scanner.yy" -case 7: -YY_RULE_SETUP -#line 82 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(strtoull(yytext, NULL, 10)); - if (errno == ERANGE) { - qCritical() << "Number is out of range: " << yytext; - return yy::json_parser::token::INVALID; - } - return yy::json_parser::token::NUMBER; - } - YY_BREAK -case 8: -#line 93 "json_scanner.yy" -case 9: -YY_RULE_SETUP -#line 93 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(strtoll(yytext, NULL, 10)); - if (errno == ERANGE) { - qCritical() << "Number is out of range: " << yytext; - return yy::json_parser::token::INVALID; - } - return yy::json_parser::token::NUMBER; - } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 103 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - bool ok; - *m_yylval = QVariant(m_C_locale.toDouble(QLatin1String(yytext),&ok)); - if (!ok) { - qCritical() << "Number is out of range: " << yytext; - return yy::json_parser::token::INVALID; - } - return yy::json_parser::token::NUMBER; - } - YY_BREAK -/* Strings */ -case 11: -YY_RULE_SETUP -#line 115 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - BEGIN(QUOTMARK_OPEN); - } - YY_BREAK - -case 12: -YY_RULE_SETUP -#line 121 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\"")); - } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 125 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\\")); - } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 129 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("/")); - } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 133 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\b")); - } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 137 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\f")); - } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 141 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\n")); - } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 145 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\r")); - } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 149 "json_scanner.yy" -{ - m_currentString.append(QLatin1String("\t")); - } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 153 "json_scanner.yy" -{ - BEGIN(HEX_OPEN); - } - YY_BREAK -case 21: -/* rule 21 can match eol */ -YY_RULE_SETUP -#line 157 "json_scanner.yy" -{ - m_currentString.append(QString::fromUtf8(yytext)); - } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 161 "json_scanner.yy" -{ - // ignore - } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 165 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(m_currentString); - m_currentString.clear(); - BEGIN(INITIAL); - return yy::json_parser::token::STRING; - } - YY_BREAK - - -case 24: -YY_RULE_SETUP -#line 175 "json_scanner.yy" -{ - QString hexDigits = QString::fromUtf8(yytext, yyleng); - bool ok; - ushort hexDigit1 = hexDigits.left(2).toShort(&ok, 16); - ushort hexDigit2 = hexDigits.right(2).toShort(&ok, 16); - m_currentString.append(QChar(hexDigit2, hexDigit1)); - BEGIN(QUOTMARK_OPEN); - } - YY_BREAK -case 25: -/* rule 25 can match eol */ -YY_RULE_SETUP -#line 184 "json_scanner.yy" -{ - qCritical() << "Invalid hex string"; - m_yylloc->columns(yyleng); - *m_yylval = QVariant(QLatin1String("")); - BEGIN(QUOTMARK_OPEN); - return yy::json_parser::token::INVALID; - } - YY_BREAK - -/* "Compound type" related tokens */ -case 26: -YY_RULE_SETUP -#line 196 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::COLON; - } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 201 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::COMMA; - } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 206 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::SQUARE_BRACKET_OPEN; - } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 211 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::SQUARE_BRACKET_CLOSE; - } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 216 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::CURLY_BRACKET_OPEN; - } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 221 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::CURLY_BRACKET_CLOSE; - } - YY_BREAK -/* Extra-JSON numbers */ - -case 32: -YY_RULE_SETUP -#line 229 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(std::numeric_limits::quiet_NaN()); - return yy::json_parser::token::NUMBER; - } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 235 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(std::numeric_limits::infinity()); - return yy::json_parser::token::NUMBER; - } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 241 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - *m_yylval = QVariant(-std::numeric_limits::infinity()); - return yy::json_parser::token::NUMBER; - } - YY_BREAK - -/* If all else fails */ -case 35: -YY_RULE_SETUP -#line 249 "json_scanner.yy" -{ - m_yylloc->columns(yyleng); - return yy::json_parser::token::INVALID; - } - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(QUOTMARK_OPEN): -case YY_STATE_EOF(HEX_OPEN): -case YY_STATE_EOF(ALLOW_SPECIAL_NUMBERS): -#line 254 "json_scanner.yy" -return yy::json_parser::token::END; - YY_BREAK -case 36: -YY_RULE_SETUP -#line 255 "json_scanner.yy" -ECHO; - YY_BREAK -#line 3660 "json_scanner.cc" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* The contents of this function are C++ specific, so the () macro is not used. - */ -yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout ) -{ - yyin = arg_yyin; - yyout = arg_yyout; - yy_c_buf_p = 0; - yy_init = 0; - yy_start = 0; - yy_flex_debug = 0; - yylineno = 1; // this will only get updated if %option yylineno - - yy_did_buffer_switch_on_eof = 0; - - yy_looking_for_trail_begin = 0; - yy_more_flag = 0; - yy_more_len = 0; - yy_more_offset = yy_prev_more_offset = 0; - - yy_start_stack_ptr = yy_start_stack_depth = 0; - yy_start_stack = NULL; - - yy_buffer_stack = 0; - yy_buffer_stack_top = 0; - yy_buffer_stack_max = 0; - - yy_state_buf = 0; - -} - -/* The contents of this function are C++ specific, so the () macro is not used. - */ -yyFlexLexer::~yyFlexLexer() -{ - delete [] yy_state_buf; - yyfree(yy_start_stack ); - yy_delete_buffer( YY_CURRENT_BUFFER ); - yyfree(yy_buffer_stack ); -} - -/* The contents of this function are C++ specific, so the () macro is not used. - */ -void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out ) -{ - if ( new_in ) - { - yy_delete_buffer( YY_CURRENT_BUFFER ); - yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) ); - } - - if ( new_out ) - yyout = new_out; -} - -#ifdef YY_INTERACTIVE -int yyFlexLexer::LexerInput( char* buf, int /* max_size */ ) -#else -int yyFlexLexer::LexerInput( char* buf, int max_size ) -#endif -{ - if ( yyin->eof() || yyin->fail() ) - return 0; - -#ifdef YY_INTERACTIVE - yyin->get( buf[0] ); - - if ( yyin->eof() ) - return 0; - - if ( yyin->bad() ) - return -1; - - return 1; - -#else - (void) yyin->read( buf, max_size ); - - if ( yyin->bad() ) - return -1; - else - return yyin->gcount(); -#endif -} - -void yyFlexLexer::LexerOutput( const char* buf, int size ) -{ - (void) yyout->write( buf, size ); -} - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -int yyFlexLexer::yy_get_next_buffer() -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - yy_state_type yyFlexLexer::yy_get_previous_state() -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - if ( *yy_cp ) - { - yy_current_state = yy_nxt[yy_current_state][YY_SC_TO_UI(*yy_cp)]; - } - else - yy_current_state = yy_NUL_trans[yy_current_state]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - yy_current_state = yy_NUL_trans[yy_current_state]; - yy_is_jam = (yy_current_state == 0); - - if ( ! yy_is_jam ) - { - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - } - - return yy_is_jam ? 0 : yy_current_state; -} - - void yyFlexLexer::yyunput( int c, register char* yy_bp) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - - int yyFlexLexer::yyinput() -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - return c; -} - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyFlexLexer::yyrestart( std::istream* input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - - void yyFlexLexer::yy_load_buffer_state() -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); - - yyfree((void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file ) - -{ - int oerrno = errno; - - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yyFlexLexer::yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -void yyFlexLexer::yyensure_buffer_stack(void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -void yyFlexLexer::LexerError( yyconst char msg[] ) -{ - std::cerr << msg << std::endl; - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return (void *) malloc( size ); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 255 "json_scanner.yy" diff --git a/3rdparty/qjson/json_scanner.cpp b/3rdparty/qjson/json_scanner.cpp deleted file mode 100644 index eb4ec8357..000000000 --- a/3rdparty/qjson/json_scanner.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2008 Flavio Castelli - * Copyright (C) 2013 Silvio Moioli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ -#include "json_scanner.cc" - -#include "qjson_debug.h" -#include "json_scanner.h" -#include "json_parser.hh" - -#include - -#include -#include - -#include - - -JSonScanner::JSonScanner(QIODevice* io) - : m_allowSpecialNumbers(false), - m_io (io), - m_criticalError(false), - m_C_locale(QLocale::C) -{ - -} - -JSonScanner::~JSonScanner() -{ -} - -void JSonScanner::allowSpecialNumbers(bool allow) { - m_allowSpecialNumbers = allow; -} - -int JSonScanner::yylex(YYSTYPE* yylval, yy::location *yylloc) { - m_yylval = yylval; - m_yylloc = yylloc; - m_yylloc->step(); - int result = yylex(); - - if (m_criticalError) { - return -1; - } - - return result; -} - -int JSonScanner::LexerInput(char* buf, int max_size) { - if (!m_io->isOpen()) { - qCritical() << "JSonScanner::yylex - io device is not open"; - m_criticalError = true; - return 0; - } - - int readBytes = m_io->read(buf, max_size); - if(readBytes < 0) { - qCritical() << "JSonScanner::yylex - error while reading from io device"; - m_criticalError = true; - return 0; - } - - return readBytes; -} - - diff --git a/3rdparty/qjson/json_scanner.h b/3rdparty/qjson/json_scanner.h deleted file mode 100644 index 6a0e97b6f..000000000 --- a/3rdparty/qjson/json_scanner.h +++ /dev/null @@ -1,66 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2008 Flavio Castelli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _JSON_SCANNER -#define _JSON_SCANNER - -#include -#include -#include - -#define YYSTYPE QVariant - -// Only include FlexLexer.h if it hasn't been already included -#if ! defined(yyFlexLexerOnce) -#include -#endif - -#include "parser_p.h" - - - -namespace yy { - class location; - int yylex(YYSTYPE *yylval, yy::location *yylloc, QJson::ParserPrivate* driver); -} - -class JSonScanner : public yyFlexLexer -{ - public: - explicit JSonScanner(QIODevice* io); - ~JSonScanner(); - - void allowSpecialNumbers(bool allow); - - int yylex(YYSTYPE* yylval, yy::location *yylloc); - int yylex(); - int LexerInput(char* buf, int max_size); - protected: - bool m_allowSpecialNumbers; - QIODevice* m_io; - - YYSTYPE* m_yylval; - yy::location* m_yylloc; - bool m_criticalError; - QString m_currentString; - QLocale m_C_locale; -}; - -#endif diff --git a/3rdparty/qjson/json_scanner.yy b/3rdparty/qjson/json_scanner.yy deleted file mode 100644 index 27104b28e..000000000 --- a/3rdparty/qjson/json_scanner.yy +++ /dev/null @@ -1,254 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2013 Silvio Moioli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110yy::json_parser::token::INVALID301, USA. - */ - -/* Flex output settings */ -%option 8bit c++ full warn -%option noyywrap nounistd -%option noinput nounput noyy_push_state noyy_pop_state noyy_top_state noyy_scan_buffer noyy_scan_bytes noyy_scan_string noyyget_extra noyyset_extra noyyget_leng noyyget_text noyyget_lineno noyyset_lineno noyyget_in noyyset_in noyyget_out noyyset_out noyyget_lval noyyset_lval noyyget_lloc noyyset_lloc noyyget_debug noyyset_debug -%option yyclass="JSonScanner" -%option outfile="json_scanner.cc" - -%{ - #include "json_scanner.h" - #include "json_parser.hh" - - #if defined(_WIN32) && !defined(__MINGW32__) - #define strtoll _strtoi64 - #define strtoull _strtoui64 - #endif - - #define YY_USER_INIT if(m_allowSpecialNumbers) { \ - BEGIN(ALLOW_SPECIAL_NUMBERS); \ - } -%} - -/* Exclusive subscanners for strings and escaped hex sequences */ -%x QUOTMARK_OPEN HEX_OPEN - -/* Extra-JSON rules active iff m_allowSpecialNumbers is true */ -%s ALLOW_SPECIAL_NUMBERS - -%% - - /* Whitespace */ -[\v\f\t ]+ { - m_yylloc->columns(yyleng); - } - -[\r\n]+ { - m_yylloc->lines(yyleng); - } - - - /* Special values */ -true { - m_yylloc->columns(yyleng); - *m_yylval = QVariant(true); - return yy::json_parser::token::TRUE_VAL; - } - -false { - m_yylloc->columns(yyleng); - *m_yylval = QVariant(false); - return yy::json_parser::token::FALSE_VAL; - } - -null { - m_yylloc->columns(yyleng); - *m_yylval = QVariant(); - return yy::json_parser::token::NULL_VAL; - } - - - /* Numbers */ -[0-9] | -[1-9][0-9]+ { - m_yylloc->columns(yyleng); - *m_yylval = QVariant(strtoull(yytext, NULL, 10)); - if (errno == ERANGE) { - qCritical() << "Number is out of range: " << yytext; - return yy::json_parser::token::INVALID; - } - return yy::json_parser::token::NUMBER; - } - --[0-9] | --[1-9][0-9]+ { - m_yylloc->columns(yyleng); - *m_yylval = QVariant(strtoll(yytext, NULL, 10)); - if (errno == ERANGE) { - qCritical() << "Number is out of range: " << yytext; - return yy::json_parser::token::INVALID; - } - return yy::json_parser::token::NUMBER; - } - --?(([0-9])|([1-9][0-9]+))(\.[0-9]+)?([Ee][+\-]?[0-9]+)? { - m_yylloc->columns(yyleng); - bool ok; - *m_yylval = QVariant(m_C_locale.toDouble(QLatin1String(yytext),&ok)); - if (!ok) { - qCritical() << "Number is out of range: " << yytext; - return yy::json_parser::token::INVALID; - } - return yy::json_parser::token::NUMBER; - } - - /* Strings */ -\" { - m_yylloc->columns(yyleng); - BEGIN(QUOTMARK_OPEN); - } - -{ - \\\" { - m_currentString.append(QLatin1String("\"")); - } - - \\\\ { - m_currentString.append(QLatin1String("\\")); - } - - \\\/ { - m_currentString.append(QLatin1String("/")); - } - - \\b { - m_currentString.append(QLatin1String("\b")); - } - - \\f { - m_currentString.append(QLatin1String("\f")); - } - - \\n { - m_currentString.append(QLatin1String("\n")); - } - - \\r { - m_currentString.append(QLatin1String("\r")); - } - - \\t { - m_currentString.append(QLatin1String("\t")); - } - - \\u { - BEGIN(HEX_OPEN); - } - - [^\"\\]+ { - m_currentString.append(QString::fromUtf8(yytext)); - } - - \\ { - // ignore - } - - \" { - m_yylloc->columns(yyleng); - *m_yylval = QVariant(m_currentString); - m_currentString.clear(); - BEGIN(INITIAL); - return yy::json_parser::token::STRING; - } -} - -{ - [0-9A-Fa-f]{4} { - QString hexDigits = QString::fromUtf8(yytext, yyleng); - bool ok; - ushort hexDigit1 = hexDigits.left(2).toShort(&ok, 16); - ushort hexDigit2 = hexDigits.right(2).toShort(&ok, 16); - m_currentString.append(QChar(hexDigit2, hexDigit1)); - BEGIN(QUOTMARK_OPEN); - } - - .|\n { - qCritical() << "Invalid hex string"; - m_yylloc->columns(yyleng); - *m_yylval = QVariant(QLatin1String("")); - BEGIN(QUOTMARK_OPEN); - return yy::json_parser::token::INVALID; - } -} - - - - /* "Compound type" related tokens */ -: { - m_yylloc->columns(yyleng); - return yy::json_parser::token::COLON; - } - -, { - m_yylloc->columns(yyleng); - return yy::json_parser::token::COMMA; - } - -\[ { - m_yylloc->columns(yyleng); - return yy::json_parser::token::SQUARE_BRACKET_OPEN; - } - -\] { - m_yylloc->columns(yyleng); - return yy::json_parser::token::SQUARE_BRACKET_CLOSE; - } - -\{ { - m_yylloc->columns(yyleng); - return yy::json_parser::token::CURLY_BRACKET_OPEN; - } - -\} { - m_yylloc->columns(yyleng); - return yy::json_parser::token::CURLY_BRACKET_CLOSE; - } - - - /* Extra-JSON numbers */ -{ - (?i:nan) { - m_yylloc->columns(yyleng); - *m_yylval = QVariant(std::numeric_limits::quiet_NaN()); - return yy::json_parser::token::NUMBER; - } - - [Ii]nfinity { - m_yylloc->columns(yyleng); - *m_yylval = QVariant(std::numeric_limits::infinity()); - return yy::json_parser::token::NUMBER; - } - - -[Ii]nfinity { - m_yylloc->columns(yyleng); - *m_yylval = QVariant(-std::numeric_limits::infinity()); - return yy::json_parser::token::NUMBER; - } -} - - /* If all else fails */ -. { - m_yylloc->columns(yyleng); - return yy::json_parser::token::INVALID; - } - -<> return yy::json_parser::token::END; diff --git a/3rdparty/qjson/location.hh b/3rdparty/qjson/location.hh deleted file mode 100644 index 0bf1a74e8..000000000 --- a/3rdparty/qjson/location.hh +++ /dev/null @@ -1,181 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Locations for Bison parsers in C++ - - Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc. - - 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 3 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, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/** - ** \file location.hh - ** Define the yy::location class. - */ - -#ifndef YY_YY_LOCATION_HH_INCLUDED -# define YY_YY_LOCATION_HH_INCLUDED - -# include "position.hh" - - -namespace yy { -/* Line 166 of location.cc */ -#line 47 "location.hh" - - /// Abstract a location. - class location - { - public: - - /// Construct a location from \a b to \a e. - location (const position& b, const position& e) - : begin (b) - , end (e) - { - } - - /// Construct a 0-width location in \a p. - explicit location (const position& p = position ()) - : begin (p) - , end (p) - { - } - - /// Construct a 0-width location in \a f, \a l, \a c. - explicit location (std::string* f, - unsigned int l = 1u, - unsigned int c = 1u) - : begin (f, l, c) - , end (f, l, c) - { - } - - - /// Initialization. - void initialize (std::string* f = YY_NULL, - unsigned int l = 1u, - unsigned int c = 1u) - { - begin.initialize (f, l, c); - end = begin; - } - - /** \name Line and Column related manipulators - ** \{ */ - public: - /// Reset initial location to final location. - void step () - { - begin = end; - } - - /// Extend the current location to the COUNT next columns. - void columns (unsigned int count = 1) - { - end += count; - } - - /// Extend the current location to the COUNT next lines. - void lines (unsigned int count = 1) - { - end.lines (count); - } - /** \} */ - - - public: - /// Beginning of the located region. - position begin; - /// End of the located region. - position end; - }; - - /// Join two location objects to create a location. - inline const location operator+ (const location& begin, const location& end) - { - location res = begin; - res.end = end.end; - return res; - } - - /// Add two location objects. - inline const location operator+ (const location& begin, unsigned int width) - { - location res = begin; - res.columns (width); - return res; - } - - /// Add and assign a location. - inline location& operator+= (location& res, unsigned int width) - { - res.columns (width); - return res; - } - - /// Compare two location objects. - inline bool - operator== (const location& loc1, const location& loc2) - { - return loc1.begin == loc2.begin && loc1.end == loc2.end; - } - - /// Compare two location objects. - inline bool - operator!= (const location& loc1, const location& loc2) - { - return !(loc1 == loc2); - } - - /** \brief Intercept output stream redirection. - ** \param ostr the destination output stream - ** \param loc a reference to the location to redirect - ** - ** Avoid duplicate information. - */ - template - inline std::basic_ostream& - operator<< (std::basic_ostream& ostr, const location& loc) - { - position last = loc.end - 1; - ostr << loc.begin; - if (last.filename - && (!loc.begin.filename - || *loc.begin.filename != *last.filename)) - ostr << '-' << last; - else if (loc.begin.line != last.line) - ostr << '-' << last.line << '.' << last.column; - else if (loc.begin.column != last.column) - ostr << '-' << last.column; - return ostr; - } - - -} // yy -/* Line 296 of location.cc */ -#line 180 "location.hh" - -#endif /* !YY_YY_LOCATION_HH_INCLUDED */ diff --git a/3rdparty/qjson/parser.cpp b/3rdparty/qjson/parser.cpp deleted file mode 100644 index 73de8ceae..000000000 --- a/3rdparty/qjson/parser.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2008 Flavio Castelli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "parser.h" -#include "parser_p.h" -#include "json_parser.hh" -#include "json_scanner.h" - -#include -#include -#include -#include - -using namespace QJson; - -ParserPrivate::ParserPrivate() : - m_scanner(0) -{ - m_specialNumbersAllowed = false; - reset(); -} - -ParserPrivate::~ParserPrivate() -{ - if (m_scanner) - delete m_scanner; -} - -void ParserPrivate::setError(QString errorMsg, int errorLine) { - m_error = true; - m_errorMsg = errorMsg; - m_errorLine = errorLine; -} - -void ParserPrivate::reset() -{ - m_error = false; - m_errorLine = 0; - m_errorMsg.clear(); - if (m_scanner) { - delete m_scanner; - m_scanner = 0; - } -} - -Parser::Parser() : - d(new ParserPrivate) -{ -} - -Parser::~Parser() -{ - delete d; -} - -QVariant Parser::parse (QIODevice* io, bool* ok) -{ - d->reset(); - - if (!io->isOpen()) { - if (!io->open(QIODevice::ReadOnly)) { - if (ok != 0) - *ok = false; - qCritical ("Error opening device"); - return QVariant(); - } - } - - if (!io->isReadable()) { - if (ok != 0) - *ok = false; - qCritical ("Device is not readable"); - io->close(); - return QVariant(); - } - - if (io->atEnd()) { - if (ok != 0) - *ok = false; - d->setError(QLatin1String("No data"), 0); - io->close(); - return QVariant(); - } - - d->m_scanner = new JSonScanner (io); - d->m_scanner->allowSpecialNumbers(d->m_specialNumbersAllowed); - yy::json_parser parser(d); - parser.parse(); - - delete d->m_scanner; - d->m_scanner = 0; - - if (ok != 0) - *ok = !d->m_error; - - io->close(); - return d->m_result; -} - -QVariant Parser::parse(const QByteArray& jsonString, bool* ok) { - QBuffer buffer; - buffer.open(QBuffer::ReadWrite); - buffer.write(jsonString); - buffer.seek(0); - return parse (&buffer, ok); -} - -QString Parser::errorString() const -{ - return d->m_errorMsg; -} - -int Parser::errorLine() const -{ - return d->m_errorLine; -} - -void QJson::Parser::allowSpecialNumbers(bool allowSpecialNumbers) { - d->m_specialNumbersAllowed = allowSpecialNumbers; -} - -bool Parser::specialNumbersAllowed() const { - return d->m_specialNumbersAllowed; -} diff --git a/3rdparty/qjson/parser.h b/3rdparty/qjson/parser.h deleted file mode 100644 index 0e20a6c25..000000000 --- a/3rdparty/qjson/parser.h +++ /dev/null @@ -1,99 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2008 Flavio Castelli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef QJSON_PARSER_H -#define QJSON_PARSER_H - -#include "qjson_export.h" - -QT_BEGIN_NAMESPACE -class QIODevice; -class QVariant; -QT_END_NAMESPACE - -/** - * Namespace used by QJson - */ -namespace QJson { - - class ParserPrivate; - - /** - * @brief Main class used to convert JSON data to QVariant objects - */ - class /*QJSON_EXPORT*/ Parser - { - public: - Parser(); - ~Parser(); - - /** - * Read JSON string from the I/O Device and converts it to a QVariant object - * @param io Input output device - * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. - * @returns a QVariant object generated from the JSON string - */ - QVariant parse(QIODevice* io, bool* ok = 0); - - /** - * This is a method provided for convenience. - * @param jsonData data containing the JSON object representation - * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true. - * @returns a QVariant object generated from the JSON string - * @sa errorString - * @sa errorLine - */ - QVariant parse(const QByteArray& jsonData, bool* ok = 0); - - /** - * This method returns the error message - * @returns a QString object containing the error message of the last parse operation - * @sa errorLine - */ - QString errorString() const; - - /** - * This method returns line number where the error occurred - * @returns the line number where the error occurred - * @sa errorString - */ - int errorLine() const; - - /** - * Sets whether special numbers (Infinity, -Infinity, NaN) are allowed as an extension to - * the standard - * @param allowSpecialNumbers new value of whether special numbers are allowed - * @sa specialNumbersAllowed - */ - void allowSpecialNumbers(bool allowSpecialNumbers); - - /** - * @returns whether special numbers (Infinity, -Infinity, NaN) are allowed - * @sa allowSpecialNumbers - */ - bool specialNumbersAllowed() const; - - private: - Q_DISABLE_COPY(Parser) - ParserPrivate* const d; - }; -} - -#endif // QJSON_PARSER_H diff --git a/3rdparty/qjson/parser_p.h b/3rdparty/qjson/parser_p.h deleted file mode 100644 index de98b9b6b..000000000 --- a/3rdparty/qjson/parser_p.h +++ /dev/null @@ -1,57 +0,0 @@ -/* This file is part of QJson - * - * Copyright (C) 2008 Flavio Castelli - * Copyright (C) 2009 Michael Leupold - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef QJSON_PARSER_P_H -#define QJSON_PARSER_P_H - -#include "parser.h" - -#include -#include - -class JSonScanner; - -namespace yy { - class json_parser; -} - -namespace QJson { - - class ParserPrivate - { - public: - ParserPrivate(); - ~ParserPrivate(); - - void reset(); - - void setError(QString errorMsg, int line); - - JSonScanner* m_scanner; - bool m_error; - int m_errorLine; - QString m_errorMsg; - QVariant m_result; - bool m_specialNumbersAllowed; - }; -} - -#endif // QJSON_PARSER_H diff --git a/3rdparty/qjson/position.hh b/3rdparty/qjson/position.hh deleted file mode 100644 index 3b33c2734..000000000 --- a/3rdparty/qjson/position.hh +++ /dev/null @@ -1,172 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Positions for Bison parsers in C++ - - Copyright (C) 2002-2007, 2009-2012 Free Software Foundation, Inc. - - 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 3 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, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/** - ** \file position.hh - ** Define the yy::position class. - */ - -#ifndef YY_YY_POSITION_HH_INCLUDED -# define YY_YY_POSITION_HH_INCLUDED - -# include // std::max -# include -# include - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - - -namespace yy { -/* Line 36 of location.cc */ -#line 57 "position.hh" - /// Abstract a position. - class position - { - public: - - /// Construct a position. - explicit position (std::string* f = YY_NULL, - unsigned int l = 1u, - unsigned int c = 1u) - : filename (f) - , line (l) - , column (c) - { - } - - - /// Initialization. - void initialize (std::string* fn = YY_NULL, - unsigned int l = 1u, - unsigned int c = 1u) - { - filename = fn; - line = l; - column = c; - } - - /** \name Line and Column related manipulators - ** \{ */ - /// (line related) Advance to the COUNT next lines. - void lines (int count = 1) - { - column = 1u; - line += count; - } - - /// (column related) Advance to the COUNT next columns. - void columns (int count = 1) - { - column = std::max (1u, column + count); - } - /** \} */ - - /// File name to which this position refers. - std::string* filename; - /// Current line number. - unsigned int line; - /// Current column number. - unsigned int column; - }; - - /// Add and assign a position. - inline position& - operator+= (position& res, const int width) - { - res.columns (width); - return res; - } - - /// Add two position objects. - inline const position - operator+ (const position& begin, const int width) - { - position res = begin; - return res += width; - } - - /// Add and assign a position. - inline position& - operator-= (position& res, const int width) - { - return res += -width; - } - - /// Add two position objects. - inline const position - operator- (const position& begin, const int width) - { - return begin + -width; - } - - /// Compare two position objects. - inline bool - operator== (const position& pos1, const position& pos2) - { - return (pos1.line == pos2.line - && pos1.column == pos2.column - && (pos1.filename == pos2.filename - || (pos1.filename && pos2.filename - && *pos1.filename == *pos2.filename))); - } - - /// Compare two position objects. - inline bool - operator!= (const position& pos1, const position& pos2) - { - return !(pos1 == pos2); - } - - /** \brief Intercept output stream redirection. - ** \param ostr the destination output stream - ** \param pos a reference to the position to redirect - */ - template - inline std::basic_ostream& - operator<< (std::basic_ostream& ostr, const position& pos) - { - if (pos.filename) - ostr << *pos.filename << ':'; - return ostr << pos.line << '.' << pos.column; - } - - -} // yy -/* Line 148 of location.cc */ -#line 172 "position.hh" -#endif /* !YY_YY_POSITION_HH_INCLUDED */ diff --git a/3rdparty/qjson/qjson_debug.h b/3rdparty/qjson/qjson_debug.h deleted file mode 100644 index 6036b2268..000000000 --- a/3rdparty/qjson/qjson_debug.h +++ /dev/null @@ -1,34 +0,0 @@ -/* This file is part of qjson - * - * Copyright (C) 2009 Michael Leupold - * Copyright (C) 2013 Silvio Moioli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef QJSON_DEBUG_H -#define QJSON_DEBUG_H - -#include - -// define qjsonDebug() -#ifdef QJSON_VERBOSE_DEBUG_OUTPUT - inline QDebug qjsonDebug() { return QDebug(QtDebugMsg); } -#else - #define qjsonDebug() if(false) QDebug(QtDebugMsg) -#endif - -#endif diff --git a/3rdparty/qjson/qjson_export.h b/3rdparty/qjson/qjson_export.h deleted file mode 100644 index 9a807b91b..000000000 --- a/3rdparty/qjson/qjson_export.h +++ /dev/null @@ -1,35 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2009 Pino Toscano - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License version 2.1, as published by the Free Software Foundation. - - - 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; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef QJSON_EXPORT_H -#define QJSON_EXPORT_H - -#include - -#ifndef QJSON_EXPORT -# if defined(QJSON_MAKEDLL) - /* We are building this library */ -# define QJSON_EXPORT Q_DECL_EXPORT -# else - /* We are using this library */ -# define QJSON_EXPORT Q_DECL_IMPORT -# endif -#endif - -#endif diff --git a/3rdparty/qjson/qobjecthelper.cpp b/3rdparty/qjson/qobjecthelper.cpp deleted file mode 100644 index 4f8daf722..000000000 --- a/3rdparty/qjson/qobjecthelper.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* This file is part of qjson - * - * Copyright (C) 2009 Till Adam - * Copyright (C) 2009 Flavio Castelli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - - -#include "qobjecthelper.h" - -#include -#include -#include - -using namespace QJson; - -class QObjectHelper::QObjectHelperPrivate { -}; - -QObjectHelper::QObjectHelper() - : d (new QObjectHelperPrivate) -{ -} - -QObjectHelper::~QObjectHelper() -{ - delete d; -} - -QVariantMap QObjectHelper::qobject2qvariant( const QObject* object, - const QStringList& ignoredProperties) -{ - QVariantMap result; - const QMetaObject *metaobject = object->metaObject(); - int count = metaobject->propertyCount(); - for (int i=0; iproperty(i); - const char *name = metaproperty.name(); - - if (ignoredProperties.contains(QLatin1String(name)) || (!metaproperty.isReadable())) - continue; - - QVariant value = object->property(name); - result[QLatin1String(name)] = value; - } - return result; -} - -void QObjectHelper::qvariant2qobject(const QVariantMap& variant, QObject* object) -{ - const QMetaObject *metaobject = object->metaObject(); - - QVariantMap::const_iterator iter; - for (iter = variant.constBegin(); iter != variant.constEnd(); ++iter) { - int pIdx = metaobject->indexOfProperty( iter.key().toLatin1() ); - - if ( pIdx < 0 ) { - continue; - } - - QMetaProperty metaproperty = metaobject->property( pIdx ); - QVariant::Type type = metaproperty.type(); - QVariant v( iter.value() ); - if ( v.canConvert( type ) ) { - v.convert( type ); - metaproperty.write( object, v ); - } else if (QString(QLatin1String("QVariant")).compare(QLatin1String(metaproperty.typeName())) == 0) { - metaproperty.write( object, v ); - } - } -} diff --git a/3rdparty/qjson/qobjecthelper.h b/3rdparty/qjson/qobjecthelper.h deleted file mode 100644 index 42f6b9b1f..000000000 --- a/3rdparty/qjson/qobjecthelper.h +++ /dev/null @@ -1,147 +0,0 @@ -/* This file is part of qjson - * - * Copyright (C) 2009 Flavio Castelli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * - * 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; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef QOBJECTHELPER_H -#define QOBJECTHELPER_H - -#include "qjson_export.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE -class QObject; -QT_END_NAMESPACE - -namespace QJson { - /** - * @brief Class used to convert QObject into QVariant and vivce-versa. - * During these operations only the class attributes defined as properties will - * be considered. - * Properties marked as 'non-stored' will be ignored. - * - * Suppose the declaration of the Person class looks like this: - * \code - * class Person : public QObject - { - Q_OBJECT - - Q_PROPERTY(QString name READ name WRITE setName) - Q_PROPERTY(int phoneNumber READ phoneNumber WRITE setPhoneNumber) - Q_PROPERTY(Gender gender READ gender WRITE setGender) - Q_PROPERTY(QDate dob READ dob WRITE setDob) - Q_ENUMS(Gender) - - public: - Person(QObject* parent = 0); - ~Person(); - - QString name() const; - void setName(const QString& name); - - int phoneNumber() const; - void setPhoneNumber(const int phoneNumber); - - enum Gender {Male, Female}; - void setGender(Gender gender); - Gender gender() const; - - QDate dob() const; - void setDob(const QDate& dob); - - private: - QString m_name; - int m_phoneNumber; - Gender m_gender; - QDate m_dob; - }; - \endcode - - The following code will serialize an instance of Person to JSON : - - \code - Person person; - person.setName("Flavio"); - person.setPhoneNumber(123456); - person.setGender(Person::Male); - person.setDob(QDate(1982, 7, 12)); - - QVariantMap variant = QObjectHelper::qobject2qvariant(&person); - Serializer serializer; - qDebug() << serializer.serialize( variant); - \endcode - - The generated output will be: - \code - { "dob" : "1982-07-12", "gender" : 0, "name" : "Flavio", "phoneNumber" : 123456 } - \endcode - - It's also possible to initialize a QObject using the values stored inside of - a QVariantMap. - - Suppose you have the following JSON data stored into a QString: - \code - { "dob" : "1982-07-12", "gender" : 0, "name" : "Flavio", "phoneNumber" : 123456 } - \endcode - - The following code will initialize an already allocated instance of Person - using the JSON values: - \code - Parser parser; - QVariant variant = parser.parse(json); - - Person person; - QObjectHelper::qvariant2qobject(variant.toMap(), &person); - \endcode - - \sa Parser - \sa Serializer - */ - class /*QJSON_EXPORT*/ QObjectHelper { - public: - QObjectHelper(); - ~QObjectHelper(); - - /** - * This method converts a QObject instance into a QVariantMap. - * - * @param object The QObject instance to be converted. - * @param ignoredProperties Properties that won't be converted. - */ - static QVariantMap qobject2qvariant( const QObject* object, - const QStringList& ignoredProperties = QStringList(QString(QLatin1String("objectName")))); - - /** - * This method converts a QVariantMap instance into a QObject - * - * @param variant Attributes to assign to the object. - * @param object The QObject instance to update. - */ - static void qvariant2qobject(const QVariantMap& variant, QObject* object); - - private: - Q_DISABLE_COPY(QObjectHelper) - class QObjectHelperPrivate; - QObjectHelperPrivate* const d; - }; -} - -#endif // QOBJECTHELPER_H diff --git a/3rdparty/qjson/stack.hh b/3rdparty/qjson/stack.hh deleted file mode 100644 index 590accbaf..000000000 --- a/3rdparty/qjson/stack.hh +++ /dev/null @@ -1,133 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Stack handling for Bison parsers in C++ - - Copyright (C) 2002-2012 Free Software Foundation, Inc. - - 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 3 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, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/** - ** \file stack.hh - ** Define the yy::stack class. - */ - -#ifndef YY_YY_STACK_HH_INCLUDED -# define YY_YY_STACK_HH_INCLUDED - -# include - - -namespace yy { -/* Line 34 of stack.hh */ -#line 47 "stack.hh" - template > - class stack - { - public: - // Hide our reversed order. - typedef typename S::reverse_iterator iterator; - typedef typename S::const_reverse_iterator const_iterator; - - stack () : seq_ () - { - } - - stack (unsigned int n) : seq_ (n) - { - } - - inline - T& - operator [] (unsigned int i) - { - return seq_[i]; - } - - inline - const T& - operator [] (unsigned int i) const - { - return seq_[i]; - } - - inline - void - push (const T& t) - { - seq_.push_front (t); - } - - inline - void - pop (unsigned int n = 1) - { - for (; n; --n) - seq_.pop_front (); - } - - inline - unsigned int - height () const - { - return seq_.size (); - } - - inline const_iterator begin () const { return seq_.rbegin (); } - inline const_iterator end () const { return seq_.rend (); } - - private: - S seq_; - }; - - /// Present a slice of the top of a stack. - template > - class slice - { - public: - slice (const S& stack, unsigned int range) - : stack_ (stack) - , range_ (range) - { - } - - inline - const T& - operator [] (unsigned int i) const - { - return stack_[range_ - i]; - } - - private: - const S& stack_; - unsigned int range_; - }; - -} // yy -/* Line 116 of stack.hh */ -#line 132 "stack.hh" - -#endif /* !YY_YY_STACK_HH_INCLUDED */ diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a8520bca..8a195a1fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,6 @@ if (WIN32 OR APPLE) else (WIN32 OR APPLE) option(ENABLE_LIBVLC "Use libVLC for MPD HTTP stream playback (if ENABLE_HTTP_STREAM_PLAYBACK=ON)" ON) endif (WIN32 OR APPLE) -option(ENABLE_QT5 "Build against Qt5" ON) option(ENABLE_FFMPEG "Enable ffmpeg/libav libraries (required for replaygain calculation)" ON) option(ENABLE_MPG123 "Enable mpg123 libraries (required for replaygain calculation)" ON) option(ENABLE_PROXY_CONFIG "Enable proxy config in settings dialog" OFF) @@ -83,10 +82,8 @@ if (NOT APPLE AND NOT WIN32) CACHE PATH "Define install directory for read-only architecture-independent data") endif (NOT APPLE AND NOT WIN32) if (WIN32) - set(ENABLE_QT5 ON) set(CANTATA_ICON_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/icons/cantata) elseif (APPLE) - set(ENABLE_QT5 ON) set(MACOSX_BUNDLE_BUNDLE_NAME Cantata) set(MACOSX_BUNDLE_EXECUTABLE cantata) set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${CANTATA_VERSION}) @@ -132,14 +129,6 @@ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT APPLE AND NOT WIN32) message("-- Set install prefix to ${CMAKE_INSTALL_PREFIX}") endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT APPLE AND NOT WIN32) -if (NOT ENABLE_QT5 AND NOT APPLE AND NOT WIN32) - find_package(X11) - if (X11_FOUND) - include_directories(${X11_INCLUDE_DIR}) - set(CANTATA_LIBS ${CANTATA_LIBS} ${X11_LIBRARIES}) - endif (X11_FOUND) -endif (NOT ENABLE_QT5 AND NOT APPLE AND NOT WIN32) - if (ENABLE_TAGLIB) set(TAGLIB_MIN_VERSION "1.6") find_package(Taglib) @@ -226,61 +215,48 @@ if (NOT MTP_FOUND) set(ENABLE_UNCACHED_MTP OFF) endif (NOT MTP_FOUND) -if (ENABLE_QT5) - find_package(Qt5Widgets REQUIRED) - find_package(Qt5Xml REQUIRED) - find_package(Qt5Network REQUIRED) - find_package(Qt5Concurrent REQUIRED) - find_package(Qt5Svg REQUIRED) - find_package(Qt5Sql REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Xml REQUIRED) +find_package(Qt5Network REQUIRED) +find_package(Qt5Concurrent REQUIRED) +find_package(Qt5Svg REQUIRED) +find_package(Qt5Sql REQUIRED) - if (${Qt5Widgets_VERSION} VERSION_GREATER "5.6.99") - set(CMAKE_CXX_STANDARD "11") - endif (${Qt5Widgets_VERSION} VERSION_GREATER "5.6.99") +if (${Qt5Widgets_VERSION} VERSION_GREATER "5.6.99") + set(CMAKE_CXX_STANDARD "11") +endif (${Qt5Widgets_VERSION} VERSION_GREATER "5.6.99") - set(QTCORELIBS ${Qt5Core_LIBRARIES}) - set(QTNETWORKLIBS ${Qt5Network_LIBRARIES}) - set(QTGUILIBS ${Qt5Gui_LIBRARIES}) - set(QTLIBS ${QTCORELIBS} ${Qt5Widgets_LIBRARIES} ${QTNETWORKLIBS} ${QTGUILIBS} ${Qt5Xml_LIBRARIES} ${Qt5Concurrent_LIBRARIES} ${Qt5Svg_LIBRARIES} ${Qt5Sql_LIBRARIES}) - set(QTINCLUDES ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Concurrent_INCLUDE_DIRS} - ${Qt5Svg_INCLUDE_DIRS} ${Qt5Sql_INCLUDE_DIRS}) - add_definitions(${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5Concurrent_DEFINITIONS} ${Qt5Svg_DEFINITIONS} ${Qt5Sql_DEFINITIONS}) - if (Qt5_POSITION_INDEPENDENT_CODE) - set(CMAKE_POSITION_INDEPENDENT_CODE ON) - else (Qt5_POSITION_INDEPENDENT_CODE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") - endif (Qt5_POSITION_INDEPENDENT_CODE) - if (NOT ENABLE_UBUNTU AND NOT APPLE AND NOT WIN32) - # Does Ubuntu/Touch version need DBus? - find_package(Qt5DBus) - macro_log_feature(Qt5DBus_FOUND "Qt5DBus" "DBus support." "http://qtproject.org") - if (Qt5DBus_FOUND) - set(QT_QTDBUS_FOUND 1) # required for config.h !!! - set(QTLIBS ${QTLIBS} ${Qt5DBus_LIBRARIES}) - set(QTINCLUDES ${QTINCLUDES} ${Qt5DBus_INCLUDE_DIRS}) - add_definitions(${Qt5DBus_DEFINITIONS}) - endif (Qt5DBus_FOUND) - endif (NOT ENABLE_UBUNTU AND NOT APPLE AND NOT WIN32) - if (ENABLE_UBUNTU) - find_package(Qt5Quick REQUIRED) - find_package(Qt5Qml REQUIRED) - endif (ENABLE_UBUNTU) - if (APPLE OR WIN32) - get_target_property(QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) - exec_program(${QT_QMAKE_EXECUTABLE} ARGS -query QT_INSTALL_TRANSLATIONS OUTPUT_VARIABLE QT_TRANSLATIONS_DIR) - endif (APPLE OR WIN32) -else (ENABLE_QT5) - find_package(Qt4 REQUIRED QtCore QtGui QtXml QtNetwork QtSvg QtSql) - set(QTCORELIBS ${QT_QTCORE_LIBRARY}) - set(QTNETWORKLIBS ${QT_QTNETWORK_LIBRARY}) - set(QTGUILIBS ${QT_QTGUI_LIBRARY}) - set(QTLIBS ${QT_QTXML_LIBRARY} ${QTCORELIBS} ${QTGUILIBS} ${QTNETWORKLIBS} ${QT_QTSVG_LIBRARY} ${QT_QTSQL_LIBRARY}) - if (QT_QTDBUS_FOUND) - set(QTLIBS ${QTLIBS} ${QT_QTDBUS_LIBRARY}) - endif (QT_QTDBUS_FOUND) - set(QTINCLUDES ${QT_INCLUDES}) - add_definitions(-DQT_NO_STL -DQT_NO_CAST_TO_ASCII -Wall -Wextra) -endif (ENABLE_QT5) +set(QTCORELIBS ${Qt5Core_LIBRARIES}) +set(QTNETWORKLIBS ${Qt5Network_LIBRARIES}) +set(QTGUILIBS ${Qt5Gui_LIBRARIES}) +set(QTLIBS ${QTCORELIBS} ${Qt5Widgets_LIBRARIES} ${QTNETWORKLIBS} ${QTGUILIBS} ${Qt5Xml_LIBRARIES} ${Qt5Concurrent_LIBRARIES} ${Qt5Svg_LIBRARIES} ${Qt5Sql_LIBRARIES}) +set(QTINCLUDES ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Concurrent_INCLUDE_DIRS} + ${Qt5Svg_INCLUDE_DIRS} ${Qt5Sql_INCLUDE_DIRS}) +add_definitions(${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5Concurrent_DEFINITIONS} ${Qt5Svg_DEFINITIONS} ${Qt5Sql_DEFINITIONS}) +if (Qt5_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) +else (Qt5_POSITION_INDEPENDENT_CODE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") +endif (Qt5_POSITION_INDEPENDENT_CODE) +if (NOT ENABLE_UBUNTU AND NOT APPLE AND NOT WIN32) + # Does Ubuntu/Touch version need DBus? + find_package(Qt5DBus) + macro_log_feature(Qt5DBus_FOUND "Qt5DBus" "DBus support." "http://qtproject.org") + if (Qt5DBus_FOUND) + set(QT_QTDBUS_FOUND 1) # required for config.h !!! + set(QTLIBS ${QTLIBS} ${Qt5DBus_LIBRARIES}) + set(QTINCLUDES ${QTINCLUDES} ${Qt5DBus_INCLUDE_DIRS}) + add_definitions(${Qt5DBus_DEFINITIONS}) + endif (Qt5DBus_FOUND) +endif (NOT ENABLE_UBUNTU AND NOT APPLE AND NOT WIN32) +if (ENABLE_UBUNTU) + find_package(Qt5Quick REQUIRED) + find_package(Qt5Qml REQUIRED) +endif (ENABLE_UBUNTU) +if (APPLE OR WIN32) + get_target_property(QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) + exec_program(${QT_QMAKE_EXECUTABLE} ARGS -query QT_INSTALL_TRANSLATIONS OUTPUT_VARIABLE QT_TRANSLATIONS_DIR) +endif (APPLE OR WIN32) if (ENABLE_HTTP_STREAM_PLAYBACK) if (ENABLE_LIBVLC) @@ -289,17 +265,12 @@ if (ENABLE_HTTP_STREAM_PLAYBACK) add_definitions(-DLIBVLC_FOUND) include_directories(${LIBVLC_INCLUDE_DIR}) set(CANTATA_LIBS ${CANTATA_LIBS} ${LIBVLC_LIBRARY}) - elseif (ENABLE_QT5) + else (ENABLE_LIBVLC) find_package(Qt5Multimedia REQUIRED) macro_log_feature(Qt5Multimedia_FOUND "Qt5Multimedia" "MPD HTTP stream playback." "http://qtproject.org") include_directories(${Qt5Multimedia_INCLUDE_DIRS}) add_definitions(${Qt5Multimedia_DEFINITIONS}) set(CANTATA_LIBS ${CANTATA_LIBS} ${Qt5Multimedia_LIBRARIES}) - else (ENABLE_LIBVLC) - find_package(Phonon REQUIRED) - macro_log_feature(PHONON_FOUND "Phonon" "MPD HTTP stream playback." "http://phonon.kde.org") - include_directories(${PHONON_INCLUDES}) - set(CANTATA_LIBS ${CANTATA_LIBS} ${PHONON_LIBS}) endif (ENABLE_LIBVLC) set(CANTATA_SRCS ${CANTATA_SRCS} mpd-interface/httpstream.cpp) set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} mpd-interface/httpstream.h) @@ -324,30 +295,16 @@ if (APPLE) add_definitions(${Qt5MacExtras_DEFINITIONS}) set(QT_MAC_EXTRAS_FOUND 1) endif (Qt5MacExtras_FOUND) -elseif (WIN32 AND ENABLE_QT5) +elseif (WIN32) find_package(Qt5WinExtras REQUIRED) set(QTINCLUDES ${QTINCLUDES} ${Qt5WinExtras_INCLUDE_DIRS}) set(QTLIBS ${QTLIBS} ${Qt5WinExtras_LIBRARIES}) add_definitions(${Qt5WinExtras_DEFINITIONS}) set(CANTATA_SRCS ${CANTATA_SRCS} windows/thumbnailtoolbar.cpp) endif (APPLE) -# For Qt5, we use Qt's own QJSonDocument class, so no need to find libqjson -if (NOT ENABLE_QT5 AND NOT WIN32 AND NOT APPLE) - find_package(QJSON) -endif (NOT ENABLE_QT5 AND NOT WIN32 AND NOT APPLE) -if (QJSON_FOUND) - message("-- Using system libqjson") - include_directories(${QJSON_INCLUDE_DIR}) - set(CANTATA_LIBS ${CANTATA_LIBS} ${QJSON_LIBRARIES}) -elseif (NOT ENABLE_QT5) - message("-- Using supplied libqjson") - add_subdirectory(3rdparty/qjson) - set(CANTATA_LIBS ${CANTATA_LIBS} qjson) -endif (QJSON_FOUND) - -# QJSon and MusicBrainz require exceptions to be enabled! -if (MUSICBRAINZ5_FOUND OR NOT ENABLE_QT5) +# MusicBrainz requires exceptions to be enabled! +if (MUSICBRAINZ5_FOUND) message("-- Enabling exceptions") if (CMAKE_COMPILER_IS_GNUCXX) add_definitions("-fexceptions -UQT_NO_EXCEPTIONS") @@ -358,7 +315,7 @@ if (MUSICBRAINZ5_FOUND OR NOT ENABLE_QT5) if (MSVC) add_definitions(-EHsc) endif (MSVC) -endif (MUSICBRAINZ5_FOUND OR NOT ENABLE_QT5) +endif (MUSICBRAINZ5_FOUND) include_directories(${CMAKE_SOURCE_DIR}/3rdparty ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${QTINCLUDES} ${ZLIB_INCLUDE_DIRS}) @@ -470,13 +427,6 @@ if (ENABLE_HTTP_SERVER) set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} http/httpserver.h http/httpsocket.h) endif (ENABLE_HTTP_SERVER) -if (ENABLE_MODEL_TEST AND NOT ENABLE_QT5) - set(QTLIBS ${QTLIBS} ${QT_QTTEST_LIBRARY}) - set(CANTATA_SRCS ${CANTATA_SRCS} models/modeltest.cpp) - set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} models/modeltest.h) - set(CMAKE_BUILD_TYPE "Debug") -endif (ENABLE_MODEL_TEST AND NOT ENABLE_QT5) - if (QT_QTDBUS_FOUND) set(CANTATA_SRCS ${CANTATA_SRCS} dbus/gnomemediakeys.cpp) set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} dbus/gnomemediakeys.h) @@ -486,35 +436,16 @@ if (QT_QTDBUS_FOUND) set(CANTATA_SRCS ${CANTATA_SRCS} dbus/notify.cpp) set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} dbus/notify.h) - if (ENABLE_QT5) - qt5_add_dbus_adaptor(CANTATA_SRCS dbus/org.mpris.MediaPlayer2.Player.xml dbus/mpris.h Mpris) - qt5_add_dbus_adaptor(CANTATA_SRCS dbus/org.mpris.MediaPlayer2.root.xml dbus/mpris.h Mpris) - qt5_add_dbus_adaptor(CANTATA_SRCS dbus/${PROJECT_REV_URL}.xml gui/mainwindow.h MainWindow) - qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.Notifications.xml) - qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.UPower.xml) - qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.login1.xml) - qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.gnome.SettingsDaemon.xml) - qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.gnome.SettingsDaemon.MediaKeys.xml) - qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.kde.Solid.PowerManagement.PolicyAgent.xml) - qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.PowerManagement.Inhibit.xml) - else (ENABLE_QT5) - if (USE_OLD_DBUS_TYPEDEF OR ((QT_VERSION_MINOR LESS 8) OR (QT_VERSION_MINOR EQUAL 8 AND QT_VERSION_PATCH LESS 2) )) - qt4_add_dbus_adaptor(CANTATA_SRCS dbus/org.mpris.MediaPlayer2.Player.OLD.xml dbus/mpris.h Mpris) - qt4_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.Notifications.OLD.xml) - else (USE_OLD_DBUS_TYPEDEF OR ((QT_VERSION_MINOR LESS 8) OR (QT_VERSION_MINOR EQUAL 8 AND QT_VERSION_PATCH LESS 2) )) - qt4_add_dbus_adaptor(CANTATA_SRCS dbus/org.mpris.MediaPlayer2.Player.xml dbus/mpris.h Mpris) - qt4_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.Notifications.xml) - endif (USE_OLD_DBUS_TYPEDEF OR ((QT_VERSION_MINOR LESS 8) OR (QT_VERSION_MINOR EQUAL 8 AND QT_VERSION_PATCH LESS 2) )) - qt4_add_dbus_adaptor(CANTATA_SRCS dbus/org.mpris.MediaPlayer2.root.xml dbus/mpris.h Mpris) - qt4_add_dbus_adaptor(CANTATA_SRCS dbus/${PROJECT_REV_URL}.xml gui/mainwindow.h MainWindow) - - qt4_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.UPower.xml) - qt4_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.login1.xml) - qt4_add_dbus_interfaces(CANTATA_SRCS dbus/org.gnome.SettingsDaemon.xml) - qt4_add_dbus_interfaces(CANTATA_SRCS dbus/org.gnome.SettingsDaemon.MediaKeys.xml) - qt4_add_dbus_interfaces(CANTATA_SRCS dbus/org.kde.Solid.PowerManagement.PolicyAgent.xml) - qt4_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.PowerManagement.Inhibit.xml) - endif (ENABLE_QT5) + qt5_add_dbus_adaptor(CANTATA_SRCS dbus/org.mpris.MediaPlayer2.Player.xml dbus/mpris.h Mpris) + qt5_add_dbus_adaptor(CANTATA_SRCS dbus/org.mpris.MediaPlayer2.root.xml dbus/mpris.h Mpris) + qt5_add_dbus_adaptor(CANTATA_SRCS dbus/${PROJECT_REV_URL}.xml gui/mainwindow.h MainWindow) + qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.Notifications.xml) + qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.UPower.xml) + qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.login1.xml) + qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.gnome.SettingsDaemon.xml) + qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.gnome.SettingsDaemon.MediaKeys.xml) + qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.kde.Solid.PowerManagement.PolicyAgent.xml) + qt5_add_dbus_interfaces(CANTATA_SRCS dbus/org.freedesktop.PowerManagement.Inhibit.xml) endif (QT_QTDBUS_FOUND) if (NOT WIN32 AND NOT APPLE) @@ -615,11 +546,7 @@ if (TAGLIB_FOUND) set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} devices/remotefsdevice.h devices/remotedevicepropertiesdialog.h devices/remotedevicepropertieswidget.h) set(CANTATA_UIS ${CANTATA_UIS} devices/remotedevicepropertieswidget.ui) - if (ENABLE_QT5) - qt5_add_dbus_interfaces(CANTATA_SRCS devices/mounter/${PROJECT_REV_URL}.mounter.xml) - else (ENABLE_QT5) - qt4_add_dbus_interfaces(CANTATA_SRCS devices/mounter/${PROJECT_REV_URL}.mounter.xml) - endif (ENABLE_QT5) + qt5_add_dbus_interfaces(CANTATA_SRCS devices/mounter/${PROJECT_REV_URL}.mounter.xml) add_subdirectory(devices/mounter) add_subdirectory(devices/avahi) endif (ENABLE_REMOTE_DEVICES) @@ -671,24 +598,14 @@ endif (WIN32) set(CANTATA_SRCS ${CANTATA_SRCS} gui/shortcutssettingspage.cpp gui/mediakeys.cpp) set(CANTATA_MOC_HDRS ${CANTATA_MOC_HDRS} gui/multimediakeysinterface.h) -if (ENABLE_QT5) - QT5_ADD_RESOURCES(CANTATA_RC_SRCS ${CANTATA_RCS}) - QT5_WRAP_UI(CANTATA_UI_HDRS ${CANTATA_UIS}) - QT5_WRAP_CPP(CANTATA_MOC_SRCS ${CANTATA_MOC_HDRS}) -else (ENABLE_QT5) - qt4_add_resources(CANTATA_RC_SRCS ${CANTATA_RCS}) - QT4_WRAP_UI(CANTATA_UI_HDRS ${CANTATA_UIS}) - INCLUDE(${QT_USE_FILE}) - QT4_WRAP_CPP(CANTATA_MOC_SRCS ${CANTATA_MOC_HDRS}) -endif (ENABLE_QT5) +QT5_ADD_RESOURCES(CANTATA_RC_SRCS ${CANTATA_RCS}) +QT5_WRAP_UI(CANTATA_UI_HDRS ${CANTATA_UIS}) +QT5_WRAP_CPP(CANTATA_MOC_SRCS ${CANTATA_MOC_HDRS}) -if (WIN32 OR (NOT APPLE AND NOT ENABLE_QT5)) +if (WIN32) add_definitions(-DQXT_STATIC) add_subdirectory(3rdparty/qxt) set(CANTATA_SRCS ${CANTATA_SRCS} gui/qxtmediakeys.cpp) -endif (WIN32 OR (NOT APPLE AND NOT ENABLE_QT5)) - -if (WIN32) set(CMAKE_BUILD_TYPE "Release") ADD_EXECUTABLE(cantata WIN32 ${CANTATA_SRCS} ${CANTATA_MOC_SRCS} ${CANTATA_RC_SRCS} ${CANTATA_UI_HDRS} ${CANTATA_PO}) install(TARGETS cantata DESTINATION ${CMAKE_INSTALL_PREFIX}) @@ -729,11 +646,9 @@ if (WIN32 OR APPLE) add_subdirectory(3rdparty/qtsingleapplication) target_link_libraries(cantata qtsingleapplication) endif (WIN32 OR APPLE) -if (WIN32 OR (NOT APPLE AND NOT ENABLE_QT5)) - target_link_libraries(cantata qxt) -endif (WIN32 OR (NOT APPLE AND NOT ENABLE_QT5)) if (WIN32) + target_link_libraries(cantata qxt) install(FILES tags/tag_fixes.xml context/lyrics_providers.xml context/weblinks.xml online/podcast_directories.xml scrobbling/scrobblers.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/config/) elseif (APPLE) @@ -774,15 +689,8 @@ if (NOT WIN32 AND NOT APPLE) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake) endif (NOT WIN32 AND NOT APPLE) -if (ENABLE_QT5) - message("-- Building Qt5 version") -else (ENABLE_QT5) - message("-- Building Qt4 version") -endif (ENABLE_QT5) - macro_display_feature_log() - if ((NOT ENABLE_DEVICES_SUPPORT AND NOT WIN32 AND NOT APPLE) OR (NOT ENABLE_HTTP_STREAM_PLAYBACK)) message("-----------------------------------------------------------------------------") message("-- The following STANDARD options have been DISABLED.") @@ -808,10 +716,3 @@ if ((ENABLE_DEVICES_SUPPORT AND ENABLE_REMOTE_DEVICES) OR (NOT ENABLE_KDE AND EN endif (ENABLE_REMOTE_DEVICES) message("") endif ((ENABLE_DEVICES_SUPPORT AND ENABLE_REMOTE_DEVICES) OR (ENABLE_PROXY_CONFIG)) - -if (ENABLE_MODEL_TEST AND NOT ENABLE_QT5) - message("-----------------------------------------------------------------------------") - message("-- ENABLING MODEL TESTS!!! RUN UNDER A DEBUGGER, AND DO NOT USE AS RELEASE!!!") - message("-----------------------------------------------------------------------------") - message("") -endif (ENABLE_MODEL_TEST AND NOT ENABLE_QT5) diff --git a/ChangeLog b/ChangeLog index 61fb5dda7..0ed5c5cdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -64,7 +64,7 @@ 48. Show podcast descriptions in tooltips. 49. Parse name field in playlists. 50. Use 32-bit int for bitrate and samplerate staus values. -51. Remove KDE4 and Ubuntu touch support. +51. Remove Qt4, KDE4, and Ubuntu touch support. 2.0.1 ----- diff --git a/INSTALL b/INSTALL index 698e9acd7..044d55079 100644 --- a/INSTALL +++ b/INSTALL @@ -1,16 +1,6 @@ Build & Installation ==================== -Qt4 ---- -1. mkdir build -2. cd build -3. cmake .. -DENABLE_QT5=OFF -4. make -5. sudo make install - -Qt5 ---- 1. mkdir build 2. cd build 3. cmake .. @@ -41,16 +31,9 @@ The following options may be passed to CMake: separated with a semicolon (";") e.g. -DCANTATA_TRANSLATIONS="es;pl" Default: all - -DUSE_OLD_DBUS_TYPEDEF=ON - Some Qt4 builds still use com.trolltech.QtDBus.QtTypeName, whereas - newer ones use org.qtproject.QtDBus.QtTypeName. If you get build - failures such as "fatal error: playeradaptor.h: No such file or - directory" then try calling CMake with this option set to ON. - Default: OFF - -DENABLE_HTTP_STREAM_PLAYBACK=ON - Enable support for playing back MPD HTTP streams via Phonon (Qt4), - QtMultiMedia (Qt5), or lib VLC (see below) + Enable support for playing back MPD HTTP streams via QtMultiMedia or + lib VLC (see below) Default: ON -DENABLE_LIBVLC=ON @@ -73,10 +56,6 @@ The following options may be passed to CMake: really works under Windows. Default: Windows:ON, Others:OFF - -DENABLE_QT5=ON - Build against Qt5, not Qt4 - Default: ON - -DENABLE_PROXY_CONFIG=ON Enable support for proxy settings in config dialog. If disabled, system proxy settings are used. @@ -128,22 +107,6 @@ The following options may be passed to CMake: Path where Inno Setpup Compiler should place the catata setup exe. Default: z:\ - -DCANTATA_MINGW_LIBS=/mingwm10.dll;/libgcc_s_dw2-1.dll - Extra MinGW libraries required for install stage. - Qt4 builds only - not required for Qt5. - Default: - -DCANTATA_SSL_LIBS=/libeay32.dll;/ssleay32.dll SSL libraries Default: - - - Testing ONLY options: - - -DENABLE_MODEL_TEST=ON - Enable testing of Cantata's QAbstractItemModels. Builds with this set - are ONLY intended to be run under a debugger! If enabled, then - CMAKE_BUILD_TYPE will automatically be set to Debug. - Currently this option ONLY affects pure Qt4 builds. - Default: OFF - diff --git a/README b/README index eed131e2c..e1ab1a57f 100644 --- a/README +++ b/README @@ -26,7 +26,7 @@ Table of Contents Cantata is a graphical client for MPD. It contains the following features: - 1. Support for Qt4, Qt5, MacOSX, and Windows. + 1. Support for Linux, MacOSX, and Windows. 2. Multiple MPD collections. 3. Highly customisable layout. 4. Songs grouped by album in play queue. @@ -78,19 +78,17 @@ Cantata requires the following Qt libraries: Cantata may also use the following optional libraries: - 1. TagLib - Tag edit dialog, replaygain, track organizer, and UMS device - support. - 2. LibMTP - MTP devices. - 3. FFMPEG (libavcodec) - ReplayGain detection code. - 4. SpeexDSP - ReplayGain detection code. - 5. MPG123 - ReplayGain detection code. - 6. CDParanoia - Read/rip Audio CDs. - 7. CDDB - either this or MusicBrainz5 required for Audio CDs - 8. MusicBrainz5 - either this or CDDB required for Audio CDs - 9. LibQJson - only for Qt4, builds. If this is not found on the - system then Cantata will use its own bundled copy. -10. LibEbur128 - ReplayGain detection code. If this is not found on the - system then Cantata will use its own bundled copy. +1. TagLib - Tag edit dialog, replaygain, track organizer, and UMS device + support. +2. LibMTP - MTP devices. +3. FFMPEG (libavcodec) - ReplayGain detection code. +4. SpeexDSP - ReplayGain detection code. +5. MPG123 - ReplayGain detection code. +6. CDParanoia - Read/rip Audio CDs. +7. CDDB - either this or MusicBrainz5 required for Audio CDs +8. MusicBrainz5 - either this or CDDB required for Audio CDs +9. LibEbur128 - ReplayGain detection code. If this is not found on the + system then Cantata will use its own bundled copy. 3. Building @@ -100,11 +98,6 @@ Please refer to the INSTALL file for general build instructions. Details on how Cantata is build for Windows can be found in section 16, and Mac OSX in section 17. -Some Qt4 builds still use com.trolltech.QtDBus.QtTypeName, whereas newer ones -use org.qtproject.QtDBus.QtTypeName. If you get build failures such as "fatal -error: playeradaptor.h: No such file or directory" then set --DUSE_OLD_DBUS_TYPEDEF=ON when calling CMake. - 4. Bugs ======= @@ -647,11 +640,11 @@ file. 10. MultiMedia Keys =================== -Linux Qt4 and Windows builds, as of 1.2, now also support basic media-keys +Linux and Windows builds, as of 1.2, now also support basic media-keys shortcuts. -Linux Qt4 and Qt5 builds can also use the GNOME settings daemon's MediaKeys -interface. This interface is normally started automatically under GNOME/Unity. +Linux use the GNOME settings daemon's MediaKeys interface. This interface is +normally started automatically under GNOME/Unity. 11. Dynamic Helper Script - Local Mode diff --git a/README.md b/README.md index 4ba2f69bd..4dec7ce8b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Introduction Cantata is a graphical client for MPD, supporting the following features: - 1. Support for Qt4, Qt5, MacOSX, and Windows. + 1. Support for Linux, MacOSX, and Windows. 2. Multiple MPD collections. 3. Highly customisable layout. 4. Songs grouped by album in play queue. diff --git a/context/artistview.cpp b/context/artistview.cpp index d6ffbd2b1..9b1a5bf7d 100644 --- a/context/artistview.cpp +++ b/context/artistview.cpp @@ -36,9 +36,7 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include -#endif #include #include #include @@ -62,33 +60,21 @@ static QString cacheFileName(const QString &artist, const QString &lang, bool si static QString buildUrl(const LibraryDb::Album &al) { QUrl url("cantata:///"); - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif query.addQueryItem("artist", al.artist); query.addQueryItem("albumId", al.id); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif return url.toString(); } static QString buildUrl(const QString &artist) { QUrl url("cantata:///"); - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif query.addQueryItem("artist", artist); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif return url.toString(); } @@ -366,19 +352,13 @@ void ArtistView::requestSimilar() { abort(); QUrl url("http://ws.audioscrobbler.com/2.0/"); - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif query.addQueryItem("method", "artist.getSimilar"); query.addQueryItem("api_key", Covers::constLastFmApiKey); query.addQueryItem("autocorrect", "1"); query.addQueryItem("artist", Covers::fixArtist(currentSong.artist)); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif currentSimilarJob=NetworkAccessManager::self()->get(url); currentSimilarJob->setProperty(constNameKey, currentSong.artist); @@ -476,11 +456,7 @@ void ArtistView::buildSimilar(const QStringList &artists) void ArtistView::show(const QUrl &url) { if (QLatin1String("cantata")==url.scheme()) { - #if QT_VERSION < 0x050000 - const QUrl &q=url; - #else QUrlQuery q(url); - #endif if (q.hasQueryItem("artist")) { if (q.hasQueryItem("albumId")) { diff --git a/context/contextwidget.cpp b/context/contextwidget.cpp index a4a835990..0f1a65fd4 100644 --- a/context/contextwidget.cpp +++ b/context/contextwidget.cpp @@ -44,12 +44,8 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include #include -#else -#include "qjson/parser.h" -#endif #include #include #include @@ -788,16 +784,10 @@ static const char * constArtistProp="artist-name"; void ContextWidget::getMusicbrainzId(const QString &artist) { QUrl url("http://www.musicbrainz.org/ws/2/artist/"); - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif query.addQueryItem("query", "artist:"+artist); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif job = NetworkAccessManager::self()->get(url); DBUG << url.toString(); @@ -859,16 +849,10 @@ void ContextWidget::musicbrainzResponse() } } else { QUrl url("http://webservice.fanart.tv/v3/music/"+id); - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif query.addQueryItem("api_key", constFanArtApiKey); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif job=NetworkAccessManager::self()->get(url); DBUG << url.toString(); @@ -887,14 +871,9 @@ void ContextWidget::fanArtResponse() QString url; if (reply->ok()) { - #if QT_VERSION >= 0x050000 QJsonParseError jsonParseError; QVariantMap parsed=QJsonDocument::fromJson(reply->readAll(), &jsonParseError).toVariant().toMap(); bool ok=QJsonParseError::NoError==jsonParseError.error; - #else - bool ok=false; - QVariantMap parsed = QJson::Parser().parse(reply->readAll(), &ok).toMap(); - #endif if (ok && !parsed.isEmpty()) { QVariantList artistbackgrounds; diff --git a/context/lastfmengine.cpp b/context/lastfmengine.cpp index 22eb941c3..a9f219091 100644 --- a/context/lastfmengine.cpp +++ b/context/lastfmengine.cpp @@ -26,9 +26,7 @@ #include "support/localize.h" #include "gui/covers.h" #include "config.h" -#if QT_VERSION >= 0x050000 #include -#endif #include #include @@ -68,11 +66,7 @@ void LastFmEngine::search(const QStringList &query, Mode mode) { QStringList fixedQuery=fixQuery(query); QUrl url("https://ws.audioscrobbler.com/2.0/"); - #if QT_VERSION < 0x050000 - QUrl &urlQuery=url; - #else QUrlQuery urlQuery; - #endif switch (mode) { case Artist: @@ -92,9 +86,7 @@ void LastFmEngine::search(const QStringList &query, Mode mode) urlQuery.addQueryItem("autocorrect", "1"); urlQuery.addQueryItem("artist", Covers::fixArtist(fixedQuery.at(0))); - #if QT_VERSION >= 0x050000 url.setQuery(urlQuery); - #endif job=NetworkAccessManager::self()->get(url); job->setProperty(constModeProperty, (int)mode); diff --git a/context/songview.cpp b/context/songview.cpp index be24e212a..884974496 100644 --- a/context/songview.cpp +++ b/context/songview.cpp @@ -53,9 +53,7 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include -#endif const QLatin1String SongView::constLyricsDir("lyrics/"); const QLatin1String SongView::constExtension(".lyrics"); @@ -110,12 +108,8 @@ static QString actualFile(const Song &song) QString songFile=song.filePath(); if (song.isCantataStream()) { - #if QT_VERSION < 0x050000 - QUrl u(songFile); - #else QUrl qu(songFile); QUrlQuery u(qu); - #endif songFile=u.hasQueryItem("file") ? u.queryItemValue("file") : QString(); } return songFile; diff --git a/context/ultimatelyricsprovider.cpp b/context/ultimatelyricsprovider.cpp index 8363ef3f2..dededaa78 100644 --- a/context/ultimatelyricsprovider.cpp +++ b/context/ultimatelyricsprovider.cpp @@ -27,9 +27,7 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include -#endif #include static bool debugEnabled=false; #define DBUG if (debugEnabled) qWarning() << "Lyrics" << __FUNCTION__ @@ -212,11 +210,7 @@ QString UltimateLyricsProvider::displayName() const void UltimateLyricsProvider::fetchInfo(int id, const Song &metadata) { - #if QT_VERSION < 0x050000 - const QTextCodec *codec = QTextCodec::codecForName(charset.toAscii().constData()); - #else const QTextCodec *codec = QTextCodec::codecForName(charset.toLatin1().constData()); - #endif if (!codec) { emit lyricsReady(id, QString()); return; @@ -227,19 +221,13 @@ void UltimateLyricsProvider::fetchInfo(int id, const Song &metadata) if (QLatin1String("lyrics.wikia.com")==name) { QUrl url(urlText); - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif query.addQueryItem(QLatin1String("artist"), artistFixed); query.addQueryItem(QLatin1String("song"), metadata.title); query.addQueryItem(QLatin1String("func"), QLatin1String("getSong")); query.addQueryItem(QLatin1String("fmt"), QLatin1String("xml")); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif NetworkJob *reply = NetworkAccessManager::self()->get(url); requests[reply] = id; @@ -352,11 +340,7 @@ void UltimateLyricsProvider::wikiMediaLyricsFetched() return; } - #if QT_VERSION < 0x050000 - const QTextCodec *codec = QTextCodec::codecForName(charset.toAscii().constData()); - #else const QTextCodec *codec = QTextCodec::codecForName(charset.toLatin1().constData()); - #endif QString contents = codec->toUnicode(reply->readAll()).replace("
", "
"); DBUG << name << "response" << contents; emit lyricsReady(id, extract(contents, QLatin1String("<lyrics>"), QLatin1String("</lyrics>"))); @@ -379,11 +363,7 @@ void UltimateLyricsProvider::lyricsFetched() return; } - #if QT_VERSION < 0x050000 - const QTextCodec *codec = QTextCodec::codecForName(charset.toAscii().constData()); - #else const QTextCodec *codec = QTextCodec::codecForName(charset.toLatin1().constData()); - #endif const QString originalContent = codec->toUnicode(reply->readAll()).replace("
", "
"); DBUG << name << "response" << originalContent; diff --git a/context/wikipediaengine.cpp b/context/wikipediaengine.cpp index 03667f880..cb04b5562 100644 --- a/context/wikipediaengine.cpp +++ b/context/wikipediaengine.cpp @@ -27,9 +27,7 @@ #include "gui/settings.h" #include "gui/covers.h" #include "config.h" -#if QT_VERSION >= 0x050000 #include -#endif #include #include @@ -349,11 +347,7 @@ void WikipediaEngine::requestTitles(const QStringList &query, Mode mode, const Q { cancel(); QUrl url("https://"+lang+".wikipedia.org/w/api.php"); - #if QT_VERSION < 0x050000 - QUrl &q=url; - #else QUrlQuery q; - #endif q.addQueryItem(QLatin1String("action"), QLatin1String("query")); q.addQueryItem(QLatin1String("list"), QLatin1String("search")); @@ -362,9 +356,7 @@ void WikipediaEngine::requestTitles(const QStringList &query, Mode mode, const Q q.addQueryItem(QLatin1String("srredirects"), QString::number(1)); q.addQueryItem(QLatin1String("srlimit"), QString::number(20)); q.addQueryItem(QLatin1String("format"), QLatin1String("xml")); - #if QT_VERSION >= 0x050000 url.setQuery(q); - #endif job=NetworkAccessManager::self()->get(url); job->setProperty(constModeProperty, (int)mode); diff --git a/context/wikipediasettings.cpp b/context/wikipediasettings.cpp index ccc733a0a..4fa3c4155 100644 --- a/context/wikipediasettings.cpp +++ b/context/wikipediasettings.cpp @@ -32,9 +32,7 @@ #include "support/utils.h" #include "support/action.h" #include "support/thread.h" -#if QT_VERSION >= 0x050000 #include -#endif #include #include @@ -167,11 +165,7 @@ void WikipediaSettings::getLangs() reload->setEnabled(false); cancel(); QUrl url("http://en.wikipedia.org/w/api.php"); - #if QT_VERSION < 0x050000 - QUrl &q=url; - #else QUrlQuery q; - #endif q.addQueryItem(QLatin1String("action"), QLatin1String("query")); q.addQueryItem(QLatin1String("meta"), QLatin1String("siteinfo")); @@ -179,9 +173,7 @@ void WikipediaSettings::getLangs() q.addQueryItem(QLatin1String("sifilteriw"), QLatin1String("local")); q.addQueryItem(QLatin1String("format"), QLatin1String("xml")); - #if QT_VERSION >= 0x050000 url.setQuery(q); - #endif job=NetworkAccessManager::self()->get(url); connect(job, SIGNAL(finished()), this, SLOT(parseLangs())); diff --git a/devices/audiocddevice.cpp b/devices/audiocddevice.cpp index 06f38cb7c..4c4678edc 100644 --- a/devices/audiocddevice.cpp +++ b/devices/audiocddevice.cpp @@ -40,9 +40,7 @@ #include "gui/settings.h" #include #include -#if QT_VERSION >= 0x050000 #include -#endif #include "solid-lite/block.h" const QLatin1String AudioCdDevice::constAnyDev("-"); @@ -60,11 +58,7 @@ QString AudioCdDevice::coverUrl(QString udi) QString AudioCdDevice::getDevice(const QUrl &url) { if (QLatin1String("cdda")==url.scheme()) { - #if QT_VERSION < 0x050000 - const QUrl &q=url; - #else QUrlQuery q(url); - #endif if (q.hasQueryItem("dev")) { return q.queryItemValue("dev"); } diff --git a/devices/musicbrainz.cpp b/devices/musicbrainz.cpp index 89f540957..fafb6ee7d 100644 --- a/devices/musicbrainz.cpp +++ b/devices/musicbrainz.cpp @@ -262,11 +262,7 @@ void MusicBrainz::lookup(bool full) // Code adapted from libmusicbrainz/examples/cdlookup.cc try { - #if QT_VERSION < 0x050000 - MusicBrainz5::CMetadata Metadata=Query.Query("discid", discId.toAscii().constData()); - #else MusicBrainz5::CMetadata Metadata=Query.Query("discid", discId.toLatin1().constData()); - #endif if (Metadata.Disc() && Metadata.Disc()->ReleaseList()) { MusicBrainz5::CReleaseList *releaseList=Metadata.Disc()->ReleaseList(); @@ -288,12 +284,7 @@ void MusicBrainz::lookup(bool full) //However, these releases will include information for all media in the release //So we need to filter out the only the media we want. - - #if QT_VERSION < 0x050000 - MusicBrainz5::CMediumList mediaList=fullRelease->MediaMatchingDiscID(discId.toAscii().constData()); - #else MusicBrainz5::CMediumList mediaList=fullRelease->MediaMatchingDiscID(discId.toLatin1().constData()); - #endif if (mediaList.NumItems() > 0) { DBUG << "Found " << mediaList.NumItems() << " media item(s)"; diff --git a/devices/remotedevicepropertieswidget.cpp b/devices/remotedevicepropertieswidget.cpp index 3b2c28a75..87854277a 100644 --- a/devices/remotedevicepropertieswidget.cpp +++ b/devices/remotedevicepropertieswidget.cpp @@ -27,9 +27,7 @@ #include "support/localize.h" #include #include -#if QT_VERSION >= 0x050000 #include -#endif #include "support/lineedit.h" #include "config.h" @@ -101,38 +99,18 @@ void RemoteDevicePropertiesWidget::update(const RemoteFsDevice::Details &d, bool smbHost->setText(d.url.host()); smbUser->setText(d.url.userName()); smbPassword->setText(d.url.password()); - #if QT_VERSION < 0x050000 - if (d.url.hasQueryItem(RemoteFsDevice::constDomainQuery)) { - smbDomain->setText(d.url.queryItemValue(RemoteFsDevice::constDomainQuery)); - } else { - smbDomain->setText(QString()); - } - #else QUrlQuery q(d.url); if (q.hasQueryItem(RemoteFsDevice::constDomainQuery)) { smbDomain->setText(q.queryItemValue(RemoteFsDevice::constDomainQuery)); } else { smbDomain->setText(QString()); } - #endif break; } case Type_SambaAvahi: { smbAvahiShare->setText(d.url.path()); smbAvahiUser->setText(d.url.userName()); smbAvahiPassword->setText(d.url.password()); - #if QT_VERSION < 0x050000 - if (d.url.hasQueryItem(RemoteFsDevice::constDomainQuery)) { - smbAvahiDomain->setText(d.url.queryItemValue(RemoteFsDevice::constDomainQuery)); - } else { - smbAvahiDomain->setText(QString()); - } - if (d.url.hasQueryItem(RemoteFsDevice::constServiceNameQuery)) { - smbAvahiName->setText(d.url.queryItemValue(RemoteFsDevice::constServiceNameQuery)); - } else { - smbAvahiName->setText(QString()); - } - #else QUrlQuery q(d.url); if (q.hasQueryItem(RemoteFsDevice::constDomainQuery)) { smbAvahiDomain->setText(q.queryItemValue(RemoteFsDevice::constDomainQuery)); @@ -144,7 +122,6 @@ void RemoteDevicePropertiesWidget::update(const RemoteFsDevice::Details &d, bool } else { smbAvahiName->setText(QString()); } - #endif break; } } @@ -236,13 +213,9 @@ RemoteFsDevice::Details RemoteDevicePropertiesWidget::details() det.url.setScheme(RemoteFsDevice::constSambaProtocol); det.url.setPassword(smbPassword->text().trimmed()); if (!smbDomain->text().trimmed().isEmpty()) { - #if QT_VERSION < 0x050000 - det.url.addQueryItem(RemoteFsDevice::constDomainQuery, smbDomain->text().trimmed()); - #else QUrlQuery q; q.addQueryItem(RemoteFsDevice::constDomainQuery, smbDomain->text().trimmed()); det.url.setQuery(q); - #endif } break; case Type_SambaAvahi: @@ -251,14 +224,6 @@ RemoteFsDevice::Details RemoteDevicePropertiesWidget::details() det.url.setPort(0); det.url.setScheme(RemoteFsDevice::constSambaAvahiProtocol); det.url.setPassword(smbAvahiPassword->text().trimmed()); - #if QT_VERSION < 0x050000 - if (!smbDomain->text().trimmed().isEmpty()) { - det.url.addQueryItem(RemoteFsDevice::constDomainQuery, smbDomain->text().trimmed()); - } - if (!smbAvahiName->text().trimmed().isEmpty()) { - det.url.addQueryItem(RemoteFsDevice::constServiceNameQuery, smbAvahiName->text().trimmed()); - } - #else if (!smbDomain->text().trimmed().isEmpty() || !smbAvahiName->text().trimmed().isEmpty()) { QUrlQuery q; if (!smbDomain->text().trimmed().isEmpty()) { @@ -270,7 +235,6 @@ RemoteFsDevice::Details RemoteDevicePropertiesWidget::details() } det.url.setQuery(q); } - #endif break; } return det; diff --git a/devices/remotefsdevice.cpp b/devices/remotefsdevice.cpp index 0171facb3..871820c7b 100644 --- a/devices/remotefsdevice.cpp +++ b/devices/remotefsdevice.cpp @@ -558,16 +558,10 @@ void RemoteFsDevice::load() if (RemoteFsDevice::constSambaAvahiProtocol==details.url.scheme()) { // Start Avahi listener... Avahi::self(); - #if QT_VERSION < 0x050000 - if (details.url.hasQueryItem(constServiceNameQuery)) { - details.serviceName=details.url.queryItemValue(constServiceNameQuery); - } - #else // QT_VERSION QUrlQuery q(details.url); if (q.hasQueryItem(constServiceNameQuery)) { details.serviceName=q.queryItemValue(constServiceNameQuery); } - #endif // QT_VERSION if (!details.serviceName.isEmpty()) { AvahiService *srv=Avahi::self()->getService(details.serviceName); diff --git a/dynamic/dynamic.cpp b/dynamic/dynamic.cpp index a5b188cea..8ff44b18e 100644 --- a/dynamic/dynamic.cpp +++ b/dynamic/dynamic.cpp @@ -41,14 +41,8 @@ #include #include #include -#if QT_VERSION >= 0x050000 -#include -#endif #include #include -#if defined ENABLE_MODEL_TEST -#include "models/modeltest.h" -#endif #include static bool debugEnabled=false; @@ -169,9 +163,6 @@ Dynamic::Dynamic() QTimer::singleShot(500, this, SLOT(checkHelper())); startAction = ActionCollection::get()->createAction("startdynamic", i18n("Start Dynamic Playlist"), Icons::self()->replacePlayQueueIcon); stopAction = ActionCollection::get()->createAction("stopdynamic", i18n("Stop Dynamic Mode"), Icons::self()->stopDynamicIcon); - #if defined ENABLE_MODEL_TEST - new ModelTest(this, this); - #endif } QString Dynamic::name() const diff --git a/gui/application_mac.cpp b/gui/application_mac.cpp index 917015a09..623427e58 100644 --- a/gui/application_mac.cpp +++ b/gui/application_mac.cpp @@ -31,11 +31,9 @@ Application::Application(int &argc, char **argv) : SingleApplication(argc, argv) { setAttribute(Qt::AA_DontShowIconsInMenus, true); - #if QT_VERSION >= 0x050100 if (Settings::self()->retinaSupport()) { setAttribute(Qt::AA_UseHighDpiPixmaps); } - #endif // Setup icon path... QStringList paths=QIcon::themeSearchPaths(); diff --git a/gui/application_qt.cpp b/gui/application_qt.cpp index 7f3064f10..3698f66aa 100644 --- a/gui/application_qt.cpp +++ b/gui/application_qt.cpp @@ -43,11 +43,9 @@ static void setupIconTheme(Application *app) Application::Application(int &argc, char **argv) : QApplication(argc, argv) { - #if QT_VERSION >= 0x050400 if (Settings::self()->retinaSupport()) { setAttribute(Qt::AA_UseHighDpiPixmaps); } - #endif } bool Application::start() diff --git a/gui/application_win.cpp b/gui/application_win.cpp index 5bd5a8839..bb8b0b6eb 100644 --- a/gui/application_win.cpp +++ b/gui/application_win.cpp @@ -30,19 +30,14 @@ Application::Application(int &argc, char **argv) : SingleApplication(argc, argv) { - #if QT_VERSION >= 0x050000 installNativeEventFilter(this); - #endif QIcon::setThemeName(QLatin1String("cantata")); setAttribute(Qt::AA_DontShowIconsInMenus, true); - #if QT_VERSION >= 0x050400 if (Settings::self()->retinaSupport()) { setAttribute(Qt::AA_UseHighDpiPixmaps); } - #endif } -#if QT_VERSION >= 0x050000 bool Application::nativeEventFilter(const QByteArray &, void *message, long *result) { MSG *msg = static_cast(message); @@ -51,13 +46,4 @@ bool Application::nativeEventFilter(const QByteArray &, void *message, long *res } return false; } -#else -bool Application::winEventFilter(MSG *msg, long *result) -{ - if (msg && WM_POWERBROADCAST==msg->message && PBT_APMRESUMEAUTOMATIC==msg->wParam) { - emit reconnect(); - } - return QCoreApplication::winEventFilter(msg, result); -} -#endif diff --git a/gui/application_win.h b/gui/application_win.h index 67ca5f436..eb853c75e 100644 --- a/gui/application_win.h +++ b/gui/application_win.h @@ -25,23 +25,15 @@ #define APPLICATION_WIN_H #include "singleapplication.h" - -#if QT_VERSION >= 0x050000 #include + class Application : public SingleApplication, public QAbstractNativeEventFilter -#else -class Application : public SingleApplication -#endif { public: static void initObjects(); Application(int &argc, char **argv); virtual ~Application() { } - #if QT_VERSION >= 0x050000 bool nativeEventFilter(const QByteArray &, void *message, long *result); - #else - bool winEventFilter(MSG *msg, long *result); - #endif }; #endif diff --git a/gui/cachesettings.cpp b/gui/cachesettings.cpp index 520a458fd..98077bccf 100644 --- a/gui/cachesettings.cpp +++ b/gui/cachesettings.cpp @@ -184,11 +184,7 @@ void CacheItem::calculate() static inline void setResizeMode(QHeaderView *hdr, int idx, QHeaderView::ResizeMode mode) { - #if QT_VERSION < 0x050000 - hdr->setResizeMode(idx, mode); - #else hdr->setSectionResizeMode(idx, mode); - #endif } CacheTree::CacheTree(QWidget *parent) diff --git a/gui/coverdialog.cpp b/gui/coverdialog.cpp index dc656190e..6ae0f601e 100644 --- a/gui/coverdialog.cpp +++ b/gui/coverdialog.cpp @@ -53,13 +53,9 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include #include #include -#else -#include "qjson/parser.h" -#endif #include #include #include @@ -710,11 +706,7 @@ void CoverDialog::sendQuery() void CoverDialog::sendLastFmQuery(const QString &fixedQuery, int page) { QUrl url; - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif url.setScheme("https"); url.setHost(constLastFmHost); url.setPath("/2.0/"); @@ -723,20 +715,14 @@ void CoverDialog::sendLastFmQuery(const QString &fixedQuery, int page) query.addQueryItem("page", QString::number(page+1)); query.addQueryItem(isArtist ? "artist" : "album", fixedQuery); query.addQueryItem("method", isArtist ? "artist.search" : "album.search"); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif sendQueryRequest(url); } void CoverDialog::sendGoogleQuery(const QString &fixedQuery, int page) { QUrl url; - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif url.setScheme("http"); url.setHost(constGoogleHost); url.setPath("/images"); @@ -744,9 +730,7 @@ void CoverDialog::sendGoogleQuery(const QString &fixedQuery, int page) query.addQueryItem("gbv", QChar('1')); query.addQueryItem("filter", QChar('1')); query.addQueryItem("start", QString::number(20 * page)); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif sendQueryRequest(url); } @@ -756,18 +740,12 @@ void CoverDialog::sendSpotifyQuery(const QString &fixedQuery) return; } QUrl url; - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif url.setScheme("http"); url.setHost(constSpotifyHost); url.setPath(isArtist ? "/search/1/artist.json" : "/search/1/album.json"); query.addQueryItem("q", fixedQuery); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif sendQueryRequest(url); } @@ -778,11 +756,7 @@ void CoverDialog::sendITunesQuery(const QString &fixedQuery) } QUrl url; - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif url.setScheme("http"); url.setHost(constITunesHost); url.setPath("/search"); @@ -790,29 +764,21 @@ void CoverDialog::sendITunesQuery(const QString &fixedQuery) query.addQueryItem("limit", QString::number(10)); query.addQueryItem("media", "music"); query.addQueryItem("entity", "album"); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif sendQueryRequest(url); } void CoverDialog::sendDeezerQuery(const QString &fixedQuery) { QUrl url; - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif url.setScheme("http"); url.setHost(constDeezerHost); url.setPath(isArtist ? "/search/artist" : "/search/album"); query.addQueryItem("q", fixedQuery); query.addQueryItem("nb_items", QString::number(10)); query.addQueryItem("output", "json"); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif sendQueryRequest(url); } @@ -1081,12 +1047,8 @@ void CoverDialog::parseGoogleQueryResponse(const QByteArray &resp) QString html = xml.replace(QLatin1String("&"), QLatin1String("&")); while (-1!=(pos=rx.indexIn(html, pos))) { - #if QT_VERSION < 0x050000 - QUrl url("http://www.google.com"+rx.cap(1)); - #else QUrl u("http://www.google.com"+rx.cap(1)); QUrlQuery url(u); - #endif int width=url.queryItemValue("w").toInt(); int height=url.queryItemValue("h").toInt(); if (canUse(width, height)) { @@ -1098,14 +1060,9 @@ void CoverDialog::parseGoogleQueryResponse(const QByteArray &resp) void CoverDialog::parseCoverArtArchiveQueryResponse(const QByteArray &resp) { - #if QT_VERSION >= 0x050000 QJsonParseError jsonParseError; QVariantMap parsed=QJsonDocument::fromJson(resp, &jsonParseError).toVariant().toMap(); bool ok=QJsonParseError::NoError==jsonParseError.error; - #else - bool ok=false; - QVariantMap parsed=QJson::Parser().parse(resp, &ok).toMap(); - #endif if (ok && parsed.contains("images")) { QVariantList images=parsed["images"].toList(); @@ -1128,14 +1085,9 @@ void CoverDialog::parseCoverArtArchiveQueryResponse(const QByteArray &resp) void CoverDialog::parseSpotifyQueryResponse(const QByteArray &resp) { - #if QT_VERSION >= 0x050000 QJsonParseError jsonParseError; QVariantMap parsed=QJsonDocument::fromJson(resp, &jsonParseError).toVariant().toMap(); bool ok=QJsonParseError::NoError==jsonParseError.error; - #else - bool ok=false; - QVariantMap parsed=QJson::Parser().parse(resp, &ok).toMap(); - #endif if (ok) { if (parsed.contains("info")) { // Initial query response... @@ -1164,14 +1116,9 @@ void CoverDialog::parseSpotifyQueryResponse(const QByteArray &resp) void CoverDialog::parseITunesQueryResponse(const QByteArray &resp) { - #if QT_VERSION >= 0x050000 QJsonParseError jsonParseError; QVariantMap parsed=QJsonDocument::fromJson(resp, &jsonParseError).toVariant().toMap(); bool ok=QJsonParseError::NoError==jsonParseError.error; - #else - bool ok=false; - QVariantMap parsed=QJson::Parser().parse(resp, &ok).toMap(); - #endif if (ok && parsed.contains("results")) { QVariantList results=parsed["results"].toList(); @@ -1188,14 +1135,9 @@ void CoverDialog::parseITunesQueryResponse(const QByteArray &resp) void CoverDialog::parseDeezerQueryResponse(const QByteArray &resp) { const QString key=QLatin1String(isArtist ? "picture" : "cover"); - #if QT_VERSION >= 0x050000 QJsonParseError jsonParseError; QVariantMap parsed=QJsonDocument::fromJson(resp, &jsonParseError).toVariant().toMap(); bool ok=QJsonParseError::NoError==jsonParseError.error; - #else - bool ok=false; - QVariantMap parsed=QJson::Parser().parse(resp, &ok).toMap(); - #endif if (ok && parsed.contains("data")) { QVariantList results=parsed["data"].toList(); @@ -1318,11 +1260,7 @@ bool CoverDialog::saveCover(const QString &src, const QImage &img) static bool hasMimeType(QDropEvent *event) { - #if QT_VERSION < 0x050000 - return event->provides("text/uri-list"); - #else return event->mimeData()->formats().contains(QLatin1String("text/uri-list")); - #endif } void CoverDialog::dragEnterEvent(QDragEnterEvent *event) diff --git a/gui/covers.cpp b/gui/covers.cpp index 324140776..8b0e96b0b 100644 --- a/gui/covers.cpp +++ b/gui/covers.cpp @@ -43,9 +43,7 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include -#endif #include #include #include @@ -87,11 +85,9 @@ static bool saveInMpdDir=true; static bool fetchCovers=true; static QString constNoCover=QLatin1String("{nocover}"); -#if QT_VERSION >= 0x050100 static double devicePixelRatio=1.0; // Only scale images to device pixel ratio if un-scaled size is less then 300pixels. static const int constRetinaScaleMaxSize=300; -#endif #ifdef USE_JPEG_FOR_SCALED_CACHE static const QLatin1String constScaledExtension(".jpg"); @@ -631,11 +627,7 @@ bool CoverDownloader::downloadViaHttp(Job &job, JobType type) } job.level++; } - #if QT_VERSION < 0x050000 - u.setEncodedUrl(MPDConnection::self()->getDetails().dir.toLatin1()+QUrl::toPercentEncoding(dir, Utils::constDirSepCharStr)+coverName.toLatin1()); - #else u=QUrl(MPDConnection::self()->getDetails().dir+dir+coverName.toLatin1()); - #endif job.type=type; NetworkJob *j=network()->get(u); @@ -648,11 +640,7 @@ bool CoverDownloader::downloadViaHttp(Job &job, JobType type) void CoverDownloader::downloadViaLastFm(Job &job) { QUrl url("https://ws.audioscrobbler.com/2.0/"); - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif query.addQueryItem("method", job.song.isArtistImageRequest() || job.song.isComposerImageRequest() ? "artist.getInfo" : "album.getInfo"); query.addQueryItem("api_key", Covers::constLastFmApiKey); @@ -661,9 +649,7 @@ void CoverDownloader::downloadViaLastFm(Job &job) if (!job.song.isArtistImageRequest()) { query.addQueryItem("album", job.song.album); } - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif NetworkJob *j = network()->get(url); connect(j, SIGNAL(finished()), this, SLOT(lastFmCallFinished())); @@ -724,15 +710,9 @@ void CoverDownloader::lastFmCallFinished() } if (!url.isEmpty()) { - QUrl u; - #if QT_VERSION < 0x050000 - u.setEncodedUrl(url.toLatin1()); - #else - u=QUrl(url); - #endif - NetworkJob *j=network()->get(QNetworkRequest(u)); + NetworkJob *j=network()->get(QNetworkRequest(QUrl(url))); connect(j, SIGNAL(finished()), this, SLOT(jobFinished())); - DBUG << "download" << u.toString(); + DBUG << "download" << url; jobs.insert(j, job); } else { failed(job); @@ -1066,11 +1046,9 @@ void CoverLoader::load() foreach (const LoadedCover &s, toDo) { DBUG << s.song.artist << s.song.albumId() << s.song.size; int size=s.song.size; - #if QT_VERSION >= 0x050100 if (size= 0x050100 if (Settings::self()->retinaSupport()) { devicePixelRatio=qApp->devicePixelRatio(); } - #endif maxCoverUpdatePerIteration=Settings::self()->maxCoverUpdatePerIteration(); cache.setMaxCost(Settings::self()->coverCacheSize()*1024*1024); } @@ -1186,9 +1162,6 @@ QPixmap * Covers::saveScaledCover(const QImage &img, const Song &song, int size) QPixmap * Covers::defaultPix(const Song &song, int size, int origSize) { - #if QT_VERSION < 0x050100 - Q_UNUSED(origSize) - #endif bool podcast=!song.isArtistImageRequest() && !song.isComposerImageRequest() && song.isFromOnlineService() && OnlineService::isPodcasts(song.onlineService()); QString key=song.isArtistImageRequest() ? QLatin1String("artist-") @@ -1207,12 +1180,10 @@ QPixmap * Covers::defaultPix(const Song &song, int size, int origSize) ? Icons::self()->podcastIcon : Icons::self()->albumIcon(size); pix=new QPixmap(icn.pixmap(size, size).scaled(QSize(size, size), Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - #if QT_VERSION >= 0x050100 if (size!=origSize) { pix->setDevicePixelRatio(devicePixelRatio); DBUG << "Set pixel ratio of dummy pixmap" << devicePixelRatio; } - #endif cache.insert(key, pix, 1); cacheSizes.insert(size); } @@ -1229,11 +1200,9 @@ QPixmap * Covers::get(const Song &song, int size, bool urgent) } int origSize=size; - #if QT_VERSION >= 0x050100 if (size= 0x050100 if (size!=origSize) { pix->setDevicePixelRatio(devicePixelRatio); DBUG << "Set pixel ratio of cover" << devicePixelRatio; } - #endif cache.insert(key, pix, 1); cacheSizes.insert(size); } @@ -1270,24 +1237,20 @@ QPixmap * Covers::get(const Song &song, int size, bool urgent) Image img=findImage(song, false); if (!img.img.isNull()) { pix=saveScaledCover(scale(song, img.img, size), song, size); - #if QT_VERSION >= 0x050100 if (size!=origSize) { pix->setDevicePixelRatio(devicePixelRatio); DBUG << "Set pixel ratio of saved scaled cover" << devicePixelRatio; } - #endif return pix; } else if (constNoCover==img.fileName) { return defaultPix(song, size, origSize); } } else { pix=new QPixmap(QPixmap::fromImage(cached)); - #if QT_VERSION >= 0x050100 if (size!=origSize) { pix->setDevicePixelRatio(devicePixelRatio); DBUG << "Set pixel ratio of loaded scaled cover" << devicePixelRatio; } - #endif cache.insert(key, pix); cacheSizes.insert(size); return pix; @@ -1301,12 +1264,10 @@ QPixmap * Covers::get(const Song &song, int size, bool urgent) // Create a dummy image so that we dont keep on locating/loading/downloading files that do not exist! pix=new QPixmap(1, 1); - #if QT_VERSION >= 0x050100 if (size!=origSize) { pix->setDevicePixelRatio(devicePixelRatio); DBUG << "Set pixel ratio of dummy cover" << devicePixelRatio; } - #endif cache.insert(key, pix, 1); cacheSizes.insert(size); } @@ -1353,25 +1314,19 @@ bool Covers::updateCache(const Song &song, const QImage &img, bool dummyEntriesO QPixmap *pix(cache.object(key)); if (pix && (!dummyEntriesOnly || pix->width()<2)) { - #if QT_VERSION >= 0x050100 double pixRatio=pix->devicePixelRatio(); - #endif cache.remove(key); if (!img.isNull()) { DBUG_CLASS("Covers"); QPixmap *p=saveScaledCover(scale(song, img, s), song, s); - #if QT_VERSION >= 0x050100 if (p) { p->setDevicePixelRatio(pixRatio); DBUG << "Set pixel ratio of updated cached pixmap" << devicePixelRatio; } - #endif if (p && emitLoaded) { - #if QT_VERSION >= 0x050100 if (pixRatio>1.00001) { s/=pixRatio; } - #endif emit loaded(song, s); updated=true; } @@ -1560,12 +1515,8 @@ Covers::Image Covers::locateImage(const Song &song) bool haveAbsPath=songFile.startsWith(Utils::constDirSep); if (song.isCantataStream()) { - #if QT_VERSION < 0x050000 - QUrl u(songFile); - #else QUrl url(songFile); QUrlQuery u(url); - #endif songFile=u.hasQueryItem("file") ? u.queryItemValue("file") : QString(); } @@ -1808,19 +1759,15 @@ void Covers::loaded(const QList &covers) foreach (const LoadedCover &cvr, covers) { if (!cvr.img.isNull()) { int size=cvr.song.size; - #if QT_VERSION >= 0x050100 int origSize=size; if (size= 0x050100 if (size!=origSize) { pix->setDevicePixelRatio(devicePixelRatio); DBUG << "Set pixel ratio of loaded pixmap" << devicePixelRatio; } - #endif cache.insert(cacheKey(cvr.song, size), pix); cacheSizes.insert(size); emit loaded(cvr.song, cvr.song.size); diff --git a/gui/customactionssettings.cpp b/gui/customactionssettings.cpp index 50fdf753c..1cd0ad6fb 100644 --- a/gui/customactionssettings.cpp +++ b/gui/customactionssettings.cpp @@ -76,11 +76,7 @@ bool CustomActionDialog::edit(const QString &name, const QString &cmd) static inline void setResizeMode(QHeaderView *hdr, int idx, QHeaderView::ResizeMode mode) { - #if QT_VERSION < 0x050000 - hdr->setResizeMode(idx, mode); - #else hdr->setSectionResizeMode(idx, mode); - #endif } CustomActionsSettings::CustomActionsSettings(QWidget *parent) diff --git a/gui/initialsettingswizard.cpp b/gui/initialsettingswizard.cpp index 5fc6742f8..16328d5e1 100644 --- a/gui/initialsettingswizard.cpp +++ b/gui/initialsettingswizard.cpp @@ -32,11 +32,7 @@ #include "mpd-interface/mpduser.h" #endif #include -#if QT_VERSION > 0x050000 #include -#else -#include -#endif #include enum Pages { @@ -169,11 +165,7 @@ void InitialSettingsWizard::pageChanged(int p) if (PAGE_CONNECTION==p) { connectionStack->setCurrentIndex(basic->isChecked() ? 1 : 0); if (basic->isChecked() && basicDir->text().isEmpty()) { - #if QT_VERSION > 0x050000 QString dir=QStandardPaths::writableLocation(QStandardPaths::MusicLocation); - #else - QString dir=QDesktopServices::storageLocation(QDesktopServices::MusicLocation); - #endif if (dir.isEmpty()) { QString dir=QDir::homePath()+"/Music"; dir=dir.replace("//", "/"); diff --git a/gui/interfacesettings.cpp b/gui/interfacesettings.cpp index b8e0d6fe3..2a6b29b25 100644 --- a/gui/interfacesettings.cpp +++ b/gui/interfacesettings.cpp @@ -408,12 +408,10 @@ void InterfaceSettings::showEvent(QShowEvent *e) foreach (const QString &code, transCodes) { QString langName = QLocale::languageToString(QLocale(code).language()); - #if QT_VERSION >= 0x040800 QString nativeName = QLocale(code).nativeLanguageName(); if (!nativeName.isEmpty()) { langName = nativeName; } - #endif langMap[QString("%1 (%2)").arg(langName, code)] = code; } diff --git a/gui/main.cpp b/gui/main.cpp index 17ae5ca3d..a1ee3a799 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -66,11 +66,7 @@ #include static QMutex msgMutex; static bool firstMsg=true; -#if QT_VERSION < 0x050000 -static void cantataQtMsgHandler(QtMsgType, const char *msg) -#else static void cantataQtMsgHandler(QtMsgType, const QMessageLogContext &, const QString &msg) -#endif { QMutexLocker locker(&msgMutex); QFile f(Utils::cacheDir(QString(), true)+"cantata.log"); @@ -93,33 +89,15 @@ static void cantataQtMsgHandler(QtMsgType, const QMessageLogContext &, const QSt class PoTranslator : public QTranslator { public: - #if QT_VERSION < 0x050000 - QString translate(const char *context, const char *sourceText, const char *disambiguation = 0) const - { - QString ret = QTranslator::translate(context, sourceText, disambiguation); - return !ret.isEmpty() ? ret : QTranslator::translate(NULL, sourceText, disambiguation); - } - #else QString translate(const char *context, const char *sourceText, const char *disambiguation = 0, int n=-1) const { QString ret = QTranslator::translate(context, sourceText, disambiguation, n); return !ret.isEmpty() ? ret : QTranslator::translate(NULL, sourceText, disambiguation, n); } - #endif }; static void loadTranslation(const QString &prefix, const QString &path, const QString &overrideLanguage = QString()) { - #if QT_VERSION < 0x040700 - // QTranslator::load will try to open and read "cantata" if it exists, - // without checking if it's a file first. - // This was fixed in Qt 4.7 - QFileInfo maybeCantataDirectory(path + "/cantata"); - if (maybeCantataDirectory.exists() && !maybeCantataDirectory.isFile()) { - return; - } - #endif - QString language = overrideLanguage.isEmpty() ? QLocale::system().name() : overrideLanguage; QTranslator *t = new PoTranslator; if (t->load(prefix+"_"+language, path)) { @@ -127,10 +105,6 @@ static void loadTranslation(const QString &prefix, const QString &path, const QS } else { delete t; } - - #if QT_VERSION < 0x050000 - QTextCodec::setCodecForTr(QTextCodec::codecForLocale()); - #endif } static void removeOldFiles(const QString &d, const QStringList &types) @@ -261,11 +235,7 @@ static void installDebugMessageHandler() MediaKeys::enableDebug(); } if (dbg&Dbg_All && logToFile) { - #if QT_VERSION < 0x050000 - qInstallMsgHandler(cantataQtMsgHandler); - #else qInstallMessageHandler(cantataQtMsgHandler); - #endif } } } diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 44b583354..23f05e01e 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -109,12 +109,10 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include #ifdef Q_OS_WIN #include "windows/thumbnailtoolbar.h" #endif -#endif #include #include #include @@ -158,11 +156,11 @@ MainWindow::MainWindow(QWidget *parent) , contextSwitchTime(0) , connectedState(CS_Init) , stopAfterCurrent(false) - #if defined Q_OS_WIN && QT_VERSION >= 0x050000 + #if defined Q_OS_WIN , thumbnailTooolbar(0) #endif { - #if defined Q_OS_MAC || defined Q_OS_WIN || QT_VERSION<0x050000 + #if defined Q_OS_MAC || defined Q_OS_WIN init(); #else if ("qt5ct"==qgetenv("QT_QPA_PLATFORMTHEME")) { @@ -181,7 +179,7 @@ MainWindow::MainWindow(QWidget *parent) void MainWindow::init() { - #if !defined Q_OS_MAC && !defined Q_OS_WIN && QT_VERSION>=0x050000 + #if !defined Q_OS_MAC && !defined Q_OS_WIN // Work-aroud Qt5Ct incorrectly setting icon theme if (!Settings::self()->useStandardIcons()) { QIcon::setThemeSearchPaths(QStringList() << CANTATA_SYS_ICONS_DIR << QIcon::themeSearchPaths()); @@ -1037,7 +1035,7 @@ void MainWindow::keyPressEvent(QKeyEvent *event) } } -#if defined Q_OS_WIN && QT_VERSION >= 0x050000 +#if defined Q_OS_WIN void MainWindow::showEvent(QShowEvent *event) { if (!thumbnailTooolbar) { @@ -1424,7 +1422,7 @@ void MainWindow::readSettings() tabWidget->setStyle(Settings::self()->sidebar()); coverWidget->setEnabled(Settings::self()->showCoverWidget()); stopTrackButton->setVisible(Settings::self()->showStopButton()); - #if defined Q_OS_WIN && QT_VERSION >= 0x050000 + #if defined Q_OS_WIN if (thumbnailTooolbar) { thumbnailTooolbar->readSettings(); } @@ -1826,7 +1824,7 @@ void MainWindow::updateStatus(MPDStatus * const status) // Update status info lastState = status->state(); lastSongId = status->songId(); - #if defined Q_OS_WIN && QT_VERSION>=0x050000 + #if defined Q_OS_WIN if (thumbnailTooolbar) { thumbnailTooolbar->update(status); } diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 210f87e4a..8b4840174 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -65,7 +65,7 @@ class HttpStream; class MPDStatus; struct MPDConnectionDetails; struct Output; -#if defined Q_OS_WIN && QT_VERSION>=0x050000 +#if defined Q_OS_WIN class ThumbnailToolBar; #endif #ifdef Q_OS_MAC @@ -113,7 +113,7 @@ public: protected: void keyPressEvent(QKeyEvent *event); - #if defined Q_OS_WIN && QT_VERSION >= 0x050000 + #if defined Q_OS_WIN void showEvent(QShowEvent *event); #endif void closeEvent(QCloseEvent *event); @@ -343,7 +343,7 @@ private: int contextSwitchTime; enum { CS_Init, CS_Connected, CS_Disconnected } connectedState; bool stopAfterCurrent; - #if defined Q_OS_WIN && QT_VERSION>=0x050000 + #if defined Q_OS_WIN ThumbnailToolBar *thumbnailTooolbar; #endif #ifdef Q_OS_MAC diff --git a/gui/mediakeys.h b/gui/mediakeys.h index 7c5681a04..5710b653b 100644 --- a/gui/mediakeys.h +++ b/gui/mediakeys.h @@ -31,7 +31,7 @@ class GnomeMediaKeys; class QxtMediaKeys; class MultiMediaKeysInterface; -#if defined Q_OS_WIN || (!defined Q_OS_MAC && QT_VERSION < 0x050000) +#if defined Q_OS_WIN #define CANTATA_USE_QXT_MEDIAKEYS #endif diff --git a/gui/serversettings.cpp b/gui/serversettings.cpp index d162ddff5..dc18117ec 100644 --- a/gui/serversettings.cpp +++ b/gui/serversettings.cpp @@ -37,11 +37,7 @@ #include #include #include -#if QT_VERSION > 0x050000 #include -#else -#include -#endif #define REMOVE(w) \ w->setVisible(false); \ @@ -288,11 +284,7 @@ void ServerSettings::add() #ifdef ENABLE_SIMPLE_MPD_SUPPORT } else { details=MPDUser::self()->details(true); - #if QT_VERSION > 0x050000 QString dir=QStandardPaths::writableLocation(QStandardPaths::MusicLocation); - #else - QString dir=QDesktopServices::storageLocation(QDesktopServices::MusicLocation); - #endif if (dir.isEmpty()) { QString dir=QDir::homePath()+"/Music"; dir=dir.replace("//", "/"); diff --git a/http/httpserver.cpp b/http/httpserver.cpp index 9ef8399e0..9ffad72a5 100644 --- a/http/httpserver.cpp +++ b/http/httpserver.cpp @@ -33,9 +33,7 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include -#endif #include static bool debugIsEnabled=false; @@ -161,13 +159,8 @@ QByteArray HttpServer::encodeUrl(const Song &s) if (!start()) { return QByteArray(); } - #if QT_VERSION < 0x050000 - QUrl url; - QUrl &query=url; - #else QUrl url; QUrlQuery query; - #endif url.setScheme("http"); url.setHost(currentIfaceIp); url.setPort(socket->serverPort()); @@ -207,9 +200,7 @@ QByteArray HttpServer::encodeUrl(const Song &s) } query.addQueryItem("id", QString::number(s.id)); query.addQueryItem("cantata", "song"); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif DBUG << "encoded as" << url.toString(); return url.toEncoded(); } @@ -244,23 +235,13 @@ QByteArray HttpServer::encodeUrl(const QString &file) Song HttpServer::decodeUrl(const QString &url) const { - #if QT_VERSION >= 0x050000 return decodeUrl(QUrl(url)); - #else - QUrl u; - u.setEncodedUrl(url.toUtf8()); - return decodeUrl(u); - #endif } Song HttpServer::decodeUrl(const QUrl &url) const { Song s; - #if QT_VERSION < 0x050000 - const QUrl &q=url; - #else QUrlQuery q(url); - #endif if (q.hasQueryItem("cantata") && q.queryItemValue("cantata")=="song") { if (q.hasQueryItem("album")) { diff --git a/http/httpsocket.cpp b/http/httpsocket.cpp index 89eaacdd5..7acb2551e 100644 --- a/http/httpsocket.cpp +++ b/http/httpsocket.cpp @@ -35,9 +35,7 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include -#endif #include #if defined TAGLIB_FOUND && !defined ENABLE_EXTERNAL_TAGS #include "tags/tags.h" @@ -280,11 +278,7 @@ void HttpSocket::readClient() } QUrl url(QUrl::fromEncoded(tokens[1])); - #if QT_VERSION < 0x050000 - QUrl &q=url; - #else QUrlQuery q(url); - #endif bool ok=false; qint32 readBytesFrom=0; qint32 readBytesTo=0; diff --git a/models/browsemodel.cpp b/models/browsemodel.cpp index 9fd9cd301..5369e28eb 100644 --- a/models/browsemodel.cpp +++ b/models/browsemodel.cpp @@ -30,9 +30,6 @@ #include "mpd-interface/mpdconnection.h" #include "mpd-interface/mpdstats.h" #include -#if defined ENABLE_MODEL_TEST -#include "modeltest.h" -#endif void BrowseModel::FolderItem::add(Item *i) { @@ -63,9 +60,6 @@ BrowseModel::BrowseModel(QObject *p) , enabled(false) , dbVersion(0) { - #if defined ENABLE_MODEL_TEST - new ModelTest(this, this); - #endif connect(this, SIGNAL(listFolder(QString)), MPDConnection::self(), SLOT(listFolder(QString))); folderIndex.insert(root->getPath(), root); } diff --git a/models/devicesmodel.cpp b/models/devicesmodel.cpp index 4741c8325..838101daf 100644 --- a/models/devicesmodel.cpp +++ b/models/devicesmodel.cpp @@ -56,9 +56,6 @@ #include "solid-lite/storagedrive.h" #include "solid-lite/storagevolume.h" #include "solid-lite/opticaldisc.h" -#if defined ENABLE_MODEL_TEST -#include "modeltest.h" -#endif #include @@ -105,9 +102,6 @@ DevicesModel::DevicesModel(QObject *parent) #endif updateItemMenu(); connect(this, SIGNAL(add(const QStringList &, int, quint8)), MPDConnection::self(), SLOT(add(const QStringList &, int, quint8))); - #if defined ENABLE_MODEL_TEST - new ModelTest(this, this); - #endif } DevicesModel::~DevicesModel() diff --git a/models/digitallyimported.cpp b/models/digitallyimported.cpp index 7fcc811c3..2551659cd 100644 --- a/models/digitallyimported.cpp +++ b/models/digitallyimported.cpp @@ -27,11 +27,7 @@ #include "support/localize.h" #include "support/globalstatic.h" #include -#if QT_VERSION >= 0x050000 #include -#else -#include "qjson/parser.h" -#endif #include #include @@ -81,11 +77,7 @@ void DigitallyImported::logout() void DigitallyImported::addAuthHeader(QNetworkRequest &req) const { - #if QT_VERSION < 0x050000 - req.setRawHeader("Authorization", "Basic "+QString("%1:%2").arg(constApiUserName, constApiPassword).toAscii().toBase64()); - #else req.setRawHeader("Authorization", "Basic "+QString("%1:%2").arg(constApiUserName, constApiPassword).toLatin1().toBase64()); - #endif } void DigitallyImported::load() @@ -177,11 +169,7 @@ void DigitallyImported::loginResponse() return; } - #if QT_VERSION >= 0x050000 QVariantMap data=QJsonDocument::fromJson(reply->readAll()).toVariant().toMap(); - #else - QVariantMap data = QJson::Parser().parse(reply->readAll()).toMap(); - #endif if (!data.contains("subscriptions")) { status=i18n("No subscriptions"); diff --git a/models/modeltest.cpp b/models/modeltest.cpp deleted file mode 100644 index 4d5d554cf..000000000 --- a/models/modeltest.cpp +++ /dev/null @@ -1,565 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include - -#include "modeltest.h" - -#include - -Q_DECLARE_METATYPE ( QModelIndex ) - -/*! - Connect to all of the models signals. Whenever anything happens recheck everything. -*/ -ModelTest::ModelTest ( QAbstractItemModel *_model, QObject *parent ) : QObject ( parent ), model ( _model ), fetchingMore ( false ) -{ - if (!model) - qFatal("%s: model must not be null", Q_FUNC_INFO); - - connect ( model, SIGNAL ( columnsAboutToBeInserted ( const QModelIndex &, int, int ) ), - this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( columnsAboutToBeRemoved ( const QModelIndex &, int, int ) ), - this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( columnsInserted ( const QModelIndex &, int, int ) ), - this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( columnsRemoved ( const QModelIndex &, int, int ) ), - this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( dataChanged ( const QModelIndex &, const QModelIndex & ) ), - this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( headerDataChanged ( Qt::Orientation, int, int ) ), - this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( layoutAboutToBeChanged () ), this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( layoutChanged () ), this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( modelReset () ), this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ), - this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ), - this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( rowsInserted ( const QModelIndex &, int, int ) ), - this, SLOT ( runAllTests() ) ); - connect ( model, SIGNAL ( rowsRemoved ( const QModelIndex &, int, int ) ), - this, SLOT ( runAllTests() ) ); - - // Special checks for inserting/removing - connect ( model, SIGNAL ( layoutAboutToBeChanged() ), - this, SLOT ( layoutAboutToBeChanged() ) ); - connect ( model, SIGNAL ( layoutChanged() ), - this, SLOT ( layoutChanged() ) ); - - connect ( model, SIGNAL ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ), - this, SLOT ( rowsAboutToBeInserted ( const QModelIndex &, int, int ) ) ); - connect ( model, SIGNAL ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ), - this, SLOT ( rowsAboutToBeRemoved ( const QModelIndex &, int, int ) ) ); - connect ( model, SIGNAL ( rowsInserted ( const QModelIndex &, int, int ) ), - this, SLOT ( rowsInserted ( const QModelIndex &, int, int ) ) ); - connect ( model, SIGNAL ( rowsRemoved ( const QModelIndex &, int, int ) ), - this, SLOT ( rowsRemoved ( const QModelIndex &, int, int ) ) ); - - runAllTests(); -} - -void ModelTest::runAllTests() -{ - if ( fetchingMore ) - return; - nonDestructiveBasicTest(); - rowCount(); - columnCount(); - hasIndex(); - index(); - parent(); - data(); -} - -/*! - nonDestructiveBasicTest tries to call a number of the basic functions (not all) - to make sure the model doesn't outright segfault, testing the functions that makes sense. -*/ -void ModelTest::nonDestructiveBasicTest() -{ - QVERIFY( model->buddy ( QModelIndex() ) == QModelIndex() ); - model->canFetchMore ( QModelIndex() ); - QVERIFY( model->columnCount ( QModelIndex() ) >= 0 ); - QVERIFY( model->data ( QModelIndex() ) == QVariant() ); - fetchingMore = true; - model->fetchMore ( QModelIndex() ); - fetchingMore = false; - Qt::ItemFlags flags = model->flags ( QModelIndex() ); - QVERIFY( flags == Qt::ItemIsDropEnabled || flags == 0 ); - model->hasChildren ( QModelIndex() ); - model->hasIndex ( 0, 0 ); - model->headerData ( 0, Qt::Horizontal ); - model->index ( 0, 0 ); - model->itemData ( QModelIndex() ); - QVariant cache; - model->match ( QModelIndex(), -1, cache ); - model->mimeTypes(); - QVERIFY( model->parent ( QModelIndex() ) == QModelIndex() ); - QVERIFY( model->rowCount() >= 0 ); - QVariant variant; - model->setData ( QModelIndex(), variant, -1 ); - model->setHeaderData ( -1, Qt::Horizontal, QVariant() ); - model->setHeaderData ( 999999, Qt::Horizontal, QVariant() ); - QMap roles; - model->sibling ( 0, 0, QModelIndex() ); - model->span ( QModelIndex() ); - model->supportedDropActions(); -} - -/*! - Tests model's implementation of QAbstractItemModel::rowCount() and hasChildren() - - Models that are dynamically populated are not as fully tested here. - */ -void ModelTest::rowCount() -{ -// qDebug() << "rc"; - // check top row - QModelIndex topIndex = model->index ( 0, 0, QModelIndex() ); - int rows = model->rowCount ( topIndex ); - QVERIFY( rows >= 0 ); - if ( rows > 0 ) - QVERIFY( model->hasChildren ( topIndex ) ); - - QModelIndex secondLevelIndex = model->index ( 0, 0, topIndex ); - if ( secondLevelIndex.isValid() ) { // not the top level - // check a row count where parent is valid - rows = model->rowCount ( secondLevelIndex ); - QVERIFY( rows >= 0 ); - if ( rows > 0 ) - QVERIFY( model->hasChildren ( secondLevelIndex ) ); - } - - // The models rowCount() is tested more extensively in checkChildren(), - // but this catches the big mistakes -} - -/*! - Tests model's implementation of QAbstractItemModel::columnCount() and hasChildren() - */ -void ModelTest::columnCount() -{ - // check top row - QModelIndex topIndex = model->index ( 0, 0, QModelIndex() ); - QVERIFY( model->columnCount ( topIndex ) >= 0 ); - - // check a column count where parent is valid - QModelIndex childIndex = model->index ( 0, 0, topIndex ); - if ( childIndex.isValid() ) - QVERIFY( model->columnCount ( childIndex ) >= 0 ); - - // columnCount() is tested more extensively in checkChildren(), - // but this catches the big mistakes -} - -/*! - Tests model's implementation of QAbstractItemModel::hasIndex() - */ -void ModelTest::hasIndex() -{ -// qDebug() << "hi"; - // Make sure that invalid values returns an invalid index - QVERIFY( !model->hasIndex ( -2, -2 ) ); - QVERIFY( !model->hasIndex ( -2, 0 ) ); - QVERIFY( !model->hasIndex ( 0, -2 ) ); - - int rows = model->rowCount(); - int columns = model->columnCount(); - - // check out of bounds - QVERIFY( !model->hasIndex ( rows, columns ) ); - QVERIFY( !model->hasIndex ( rows + 1, columns + 1 ) ); - - if ( rows > 0 ) - QVERIFY( model->hasIndex ( 0, 0 ) ); - - // hasIndex() is tested more extensively in checkChildren(), - // but this catches the big mistakes -} - -/*! - Tests model's implementation of QAbstractItemModel::index() - */ -void ModelTest::index() -{ -// qDebug() << "i"; - // Make sure that invalid values returns an invalid index - QVERIFY( model->index ( -2, -2 ) == QModelIndex() ); - QVERIFY( model->index ( -2, 0 ) == QModelIndex() ); - QVERIFY( model->index ( 0, -2 ) == QModelIndex() ); - - int rows = model->rowCount(); - int columns = model->columnCount(); - - if ( rows == 0 ) - return; - - // Catch off by one errors - QVERIFY( model->index ( rows, columns ) == QModelIndex() ); - QVERIFY( model->index ( 0, 0 ).isValid() ); - - // Make sure that the same index is *always* returned - QModelIndex a = model->index ( 0, 0 ); - QModelIndex b = model->index ( 0, 0 ); - QVERIFY( a == b ); - - // index() is tested more extensively in checkChildren(), - // but this catches the big mistakes -} - -/*! - Tests model's implementation of QAbstractItemModel::parent() - */ -void ModelTest::parent() -{ -// qDebug() << "p"; - // Make sure the model wont crash and will return an invalid QModelIndex - // when asked for the parent of an invalid index. - QVERIFY( model->parent ( QModelIndex() ) == QModelIndex() ); - - if ( model->rowCount() == 0 ) - return; - - // Column 0 | Column 1 | - // QModelIndex() | | - // \- topIndex | topIndex1 | - // \- childIndex | childIndex1 | - - // Common error test #1, make sure that a top level index has a parent - // that is a invalid QModelIndex. - QModelIndex topIndex = model->index ( 0, 0, QModelIndex() ); - QVERIFY( model->parent ( topIndex ) == QModelIndex() ); - - // Common error test #2, make sure that a second level index has a parent - // that is the first level index. - if ( model->rowCount ( topIndex ) > 0 ) { - QModelIndex childIndex = model->index ( 0, 0, topIndex ); - QVERIFY( model->parent ( childIndex ) == topIndex ); - } - - // Common error test #3, the second column should NOT have the same children - // as the first column in a row. - // Usually the second column shouldn't have children. - QModelIndex topIndex1 = model->index ( 0, 1, QModelIndex() ); - if ( model->rowCount ( topIndex1 ) > 0 ) { - QModelIndex childIndex = model->index ( 0, 0, topIndex ); - QModelIndex childIndex1 = model->index ( 0, 0, topIndex1 ); - QVERIFY( childIndex != childIndex1 ); - } - - // Full test, walk n levels deep through the model making sure that all - // parent's children correctly specify their parent. - checkChildren ( QModelIndex() ); -} - -/*! - Called from the parent() test. - - A model that returns an index of parent X should also return X when asking - for the parent of the index. - - This recursive function does pretty extensive testing on the whole model in an - effort to catch edge cases. - - This function assumes that rowCount(), columnCount() and index() already work. - If they have a bug it will point it out, but the above tests should have already - found the basic bugs because it is easier to figure out the problem in - those tests then this one. - */ -void ModelTest::checkChildren ( const QModelIndex &parent, int currentDepth ) -{ - // First just try walking back up the tree. - QModelIndex p = parent; - while ( p.isValid() ) - p = p.parent(); - - // For models that are dynamically populated - if ( model->canFetchMore ( parent ) ) { - fetchingMore = true; - model->fetchMore ( parent ); - fetchingMore = false; - } - - int rows = model->rowCount ( parent ); - int columns = model->columnCount ( parent ); - - if ( rows > 0 ) - QVERIFY( model->hasChildren ( parent ) ); - - // Some further testing against rows(), columns(), and hasChildren() - QVERIFY( rows >= 0 ); - QVERIFY( columns >= 0 ); - if ( rows > 0 ) - QVERIFY( model->hasChildren ( parent ) ); - - //qDebug() << "parent:" << model->data(parent).toString() << "rows:" << rows - // << "columns:" << columns << "parent column:" << parent.column(); - - QVERIFY( !model->hasIndex ( rows + 1, 0, parent ) ); - for ( int r = 0; r < rows; ++r ) { - if ( model->canFetchMore ( parent ) ) { - fetchingMore = true; - model->fetchMore ( parent ); - fetchingMore = false; - } - QVERIFY( !model->hasIndex ( r, columns + 1, parent ) ); - for ( int c = 0; c < columns; ++c ) { - QVERIFY( model->hasIndex ( r, c, parent ) ); - QModelIndex index = model->index ( r, c, parent ); - // rowCount() and columnCount() said that it existed... - QVERIFY( index.isValid() ); - - // index() should always return the same index when called twice in a row - QModelIndex modifiedIndex = model->index ( r, c, parent ); - QVERIFY( index == modifiedIndex ); - - // Make sure we get the same index if we request it twice in a row - QModelIndex a = model->index ( r, c, parent ); - QModelIndex b = model->index ( r, c, parent ); - QVERIFY( a == b ); - - // Some basic checking on the index that is returned - QVERIFY( index.model() == model ); - QCOMPARE( index.row(), r ); - QCOMPARE( index.column(), c ); - // While you can technically return a QVariant usually this is a sign - // of a bug in data(). Disable if this really is ok in your model. -// QVERIFY( model->data ( index, Qt::DisplayRole ).isValid() ); - - // If the next test fails here is some somewhat useful debug you play with. - - if (model->parent(index) != parent) { - qDebug() << r << c << currentDepth << model->data(index).toString() - << model->data(parent).toString(); - qDebug() << index << parent << model->parent(index); -// And a view that you can even use to show the model. -// QTreeView view; -// view.setModel(model); -// view.show(); - } - - // Check that we can get back our real parent. - QCOMPARE( model->parent ( index ), parent ); - - // recursively go down the children - if ( model->hasChildren ( index ) && currentDepth < 10 ) { - //qDebug() << r << c << "has children" << model->rowCount(index); - checkChildren ( index, ++currentDepth ); - }/* else { if (currentDepth >= 10) qDebug() << "checked 10 deep"; };*/ - - // make sure that after testing the children that the index doesn't change. - QModelIndex newerIndex = model->index ( r, c, parent ); - QVERIFY( index == newerIndex ); - } - } -} - -/*! - Tests model's implementation of QAbstractItemModel::data() - */ -void ModelTest::data() -{ - // Invalid index should return an invalid qvariant - QVERIFY( !model->data ( QModelIndex() ).isValid() ); - - if ( model->rowCount() == 0 ) - return; - - // A valid index should have a valid QVariant data - QVERIFY( model->index ( 0, 0 ).isValid() ); - - // shouldn't be able to set data on an invalid index - QVERIFY( !model->setData ( QModelIndex(), QLatin1String ( "foo" ), Qt::DisplayRole ) ); - - // General Purpose roles that should return a QString - QVariant variant = model->data ( model->index ( 0, 0 ), Qt::ToolTipRole ); - if ( variant.isValid() ) { - QVERIFY( qVariantCanConvert ( variant ) ); - } - variant = model->data ( model->index ( 0, 0 ), Qt::StatusTipRole ); - if ( variant.isValid() ) { - QVERIFY( qVariantCanConvert ( variant ) ); - } - variant = model->data ( model->index ( 0, 0 ), Qt::WhatsThisRole ); - if ( variant.isValid() ) { - QVERIFY( qVariantCanConvert ( variant ) ); - } - - // General Purpose roles that should return a QSize - variant = model->data ( model->index ( 0, 0 ), Qt::SizeHintRole ); - if ( variant.isValid() ) { - QVERIFY( qVariantCanConvert ( variant ) ); - } - - // General Purpose roles that should return a QFont - QVariant fontVariant = model->data ( model->index ( 0, 0 ), Qt::FontRole ); - if ( fontVariant.isValid() ) { - QVERIFY( qVariantCanConvert ( fontVariant ) ); - } - - // Check that the alignment is one we know about - QVariant textAlignmentVariant = model->data ( model->index ( 0, 0 ), Qt::TextAlignmentRole ); - if ( textAlignmentVariant.isValid() ) { - int alignment = textAlignmentVariant.toInt(); - QCOMPARE( alignment, ( alignment & ( Qt::AlignHorizontal_Mask | Qt::AlignVertical_Mask ) ) ); - } - - // General Purpose roles that should return a QColor - QVariant colorVariant = model->data ( model->index ( 0, 0 ), Qt::BackgroundColorRole ); - if ( colorVariant.isValid() ) { - QVERIFY( qVariantCanConvert ( colorVariant ) ); - } - - colorVariant = model->data ( model->index ( 0, 0 ), Qt::TextColorRole ); - if ( colorVariant.isValid() ) { - QVERIFY( qVariantCanConvert ( colorVariant ) ); - } - - // Check that the "check state" is one we know about. - QVariant checkStateVariant = model->data ( model->index ( 0, 0 ), Qt::CheckStateRole ); - if ( checkStateVariant.isValid() ) { - int state = checkStateVariant.toInt(); - QVERIFY( state == Qt::Unchecked || - state == Qt::PartiallyChecked || - state == Qt::Checked ); - } -} - -/*! - Store what is about to be inserted to make sure it actually happens - - \sa rowsInserted() - */ -void ModelTest::rowsAboutToBeInserted ( const QModelIndex &parent, int start, int end ) -{ - Q_UNUSED(end) -// qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end << "parent=" << model->data ( parent ).toString() -// << "current count of parent=" << model->rowCount ( parent ); // << "display of last=" << model->data( model->index(start-1, 0, parent) ); -// qDebug() << model->index(start-1, 0, parent) << model->data( model->index(start-1, 0, parent) ); - Changing c; - c.parent = parent; - c.oldSize = model->rowCount ( parent ); - c.last = model->data ( model->index ( start - 1, 0, parent ) ); - c.next = model->data ( model->index ( start, 0, parent ) ); - insert.push ( c ); -} - -/*! - Confirm that what was said was going to happen actually did - - \sa rowsAboutToBeInserted() - */ -void ModelTest::rowsInserted ( const QModelIndex & parent, int start, int end ) -{ - Changing c = insert.pop(); - QVERIFY( c.parent == parent ); -// qDebug() << "rowsInserted" << "start=" << start << "end=" << end << "oldsize=" << c.oldSize -// << "parent=" << model->data ( parent ).toString() << "current rowcount of parent=" << model->rowCount ( parent ); - -// for (int ii=start; ii <= end; ii++) -// { -// qDebug() << "itemWasInserted:" << ii << model->data ( model->index ( ii, 0, parent )); -// } -// qDebug(); - - QVERIFY( c.oldSize + ( end - start + 1 ) == model->rowCount ( parent ) ); - QVERIFY( c.last == model->data ( model->index ( start - 1, 0, c.parent ) ) ); - - if (c.next != model->data(model->index(end + 1, 0, c.parent))) { - qDebug() << start << end; - for (int i=0; i < model->rowCount(); ++i) - qDebug() << model->index(i, 0).data().toString(); - qDebug() << c.next << model->data(model->index(end + 1, 0, c.parent)); - } - - QVERIFY( c.next == model->data ( model->index ( end + 1, 0, c.parent ) ) ); -} - -void ModelTest::layoutAboutToBeChanged() -{ - for ( int i = 0; i < qBound ( 0, model->rowCount(), 100 ); ++i ) - changing.append ( QPersistentModelIndex ( model->index ( i, 0 ) ) ); -} - -void ModelTest::layoutChanged() -{ - for ( int i = 0; i < changing.count(); ++i ) { - QPersistentModelIndex p = changing[i]; - QVERIFY( p == model->index ( p.row(), p.column(), p.parent() ) ); - } - changing.clear(); -} - -/*! - Store what is about to be inserted to make sure it actually happens - - \sa rowsRemoved() - */ -void ModelTest::rowsAboutToBeRemoved ( const QModelIndex &parent, int start, int end ) -{ -qDebug() << "ratbr" << parent << start << end; - Changing c; - c.parent = parent; - c.oldSize = model->rowCount ( parent ); - c.last = model->data ( model->index ( start - 1, 0, parent ) ); - c.next = model->data ( model->index ( end + 1, 0, parent ) ); - remove.push ( c ); -} - -/*! - Confirm that what was said was going to happen actually did - - \sa rowsAboutToBeRemoved() - */ -void ModelTest::rowsRemoved ( const QModelIndex & parent, int start, int end ) -{ - qDebug() << "rr" << parent << start << end; - Changing c = remove.pop(); - QVERIFY( c.parent == parent ); - QVERIFY( c.oldSize - ( end - start + 1 ) == model->rowCount ( parent ) ); - QVERIFY( c.last == model->data ( model->index ( start - 1, 0, c.parent ) ) ); - QVERIFY( c.next == model->data ( model->index ( start, 0, c.parent ) ) ); -} - - - diff --git a/models/modeltest.h b/models/modeltest.h deleted file mode 100644 index 36dc809e3..000000000 --- a/models/modeltest.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef MODELTEST_H -#define MODELTEST_H - -#include -#include -#include - -class ModelTest : public QObject -{ - Q_OBJECT - -public: - ModelTest( QAbstractItemModel *model, QObject *parent = 0 ); - -private Q_SLOTS: - void nonDestructiveBasicTest(); - void rowCount(); - void columnCount(); - void hasIndex(); - void index(); - void parent(); - void data(); - -protected Q_SLOTS: - void runAllTests(); - void layoutAboutToBeChanged(); - void layoutChanged(); - void rowsAboutToBeInserted( const QModelIndex &parent, int start, int end ); - void rowsInserted( const QModelIndex & parent, int start, int end ); - void rowsAboutToBeRemoved( const QModelIndex &parent, int start, int end ); - void rowsRemoved( const QModelIndex & parent, int start, int end ); - -private: - void checkChildren( const QModelIndex &parent, int currentDepth = 0 ); - - QAbstractItemModel *model; - - struct Changing { - QModelIndex parent; - int oldSize; - QVariant last; - QVariant next; - }; - QStack insert; - QStack remove; - - bool fetchingMore; - - QList changing; -}; - -#endif - diff --git a/models/musiclibrarymodel.cpp b/models/musiclibrarymodel.cpp index 68babbf00..ed43c47a6 100644 --- a/models/musiclibrarymodel.cpp +++ b/models/musiclibrarymodel.cpp @@ -42,18 +42,12 @@ #include #include #include -#if defined ENABLE_MODEL_TEST -#include "modeltest.h" -#endif MusicLibraryModel::MusicLibraryModel(QObject *parent) : ActionModel(parent) , rootItem(new MusicLibraryItemRoot) { rootItem->setModel(this); - #if defined ENABLE_MODEL_TEST - new ModelTest(this, this); - #endif } MusicLibraryModel::~MusicLibraryModel() diff --git a/models/playlistsmodel.cpp b/models/playlistsmodel.cpp index 26feb19ae..ebe8e8e8e 100644 --- a/models/playlistsmodel.cpp +++ b/models/playlistsmodel.cpp @@ -49,10 +49,6 @@ #include "http/httpserver.h" #endif -#if defined ENABLE_MODEL_TEST -#include "modeltest.h" -#endif - QString PlaylistsModel::headerText(int col) { switch (col) { @@ -97,9 +93,6 @@ PlaylistsModel::PlaylistsModel(QObject *parent) Action::initIcon(newAction); alignments[COL_TITLE]=alignments[COL_ARTIST]=alignments[COL_ALBUM]=alignments[COL_GENRE]=alignments[COL_COMPOSER]=alignments[COL_PERFORMER]=int(Qt::AlignVCenter|Qt::AlignLeft); alignments[COL_LENGTH]=alignments[COL_YEAR]=int(Qt::AlignVCenter|Qt::AlignRight); - #if defined ENABLE_MODEL_TEST - new ModelTest(this, this); - #endif } PlaylistsModel::~PlaylistsModel() diff --git a/models/playqueuemodel.cpp b/models/playqueuemodel.cpp index 92c65b351..0dbd0e797 100644 --- a/models/playqueuemodel.cpp +++ b/models/playqueuemodel.cpp @@ -63,10 +63,6 @@ #include #include -#if defined ENABLE_MODEL_TEST -#include "modeltest.h" -#endif - GLOBAL_STATIC(PlayQueueModel, instance) const QLatin1String PlayQueueModel::constMoveMimeType("cantata/move"); @@ -226,9 +222,6 @@ PlayQueueModel::PlayQueueModel(QObject *parent) #ifdef ENABLE_DEVICES_SUPPORT //TODO: Problems here with devices support!!! connect(DevicesModel::self(), SIGNAL(updatedDetails(QList)), SLOT(updateDetails(QList))); #endif - #if defined ENABLE_MODEL_TEST - new ModelTest(this, this); - #endif UNITY_MENU_ICON_CHECK removeDuplicatesAction=new Action(i18n("Remove Duplicates"), this); diff --git a/models/searchmodel.cpp b/models/searchmodel.cpp index 6efac0e7f..995ce1de2 100644 --- a/models/searchmodel.cpp +++ b/models/searchmodel.cpp @@ -32,12 +32,6 @@ #include #include #include -#if QT_VERSION >= 0x050000 -#include -#endif -#if defined ENABLE_MODEL_TEST -#include "modeltest.h" -#endif QString SearchModel::headerText(int col) { diff --git a/models/sqllibrarymodel.cpp b/models/sqllibrarymodel.cpp index 52d6a8016..c009d777b 100644 --- a/models/sqllibrarymodel.cpp +++ b/models/sqllibrarymodel.cpp @@ -30,9 +30,6 @@ #include "support/configuration.h" #include "roles.h" #include -#if defined ENABLE_MODEL_TEST -#include "modeltest.h" -#endif static QString parentData(const SqlLibraryModel::Item *i) { @@ -82,9 +79,6 @@ SqlLibraryModel::SqlLibraryModel(LibraryDb *d, QObject *p, Type top) { connect(db, SIGNAL(libraryUpdated()), SLOT(libraryUpdated())); connect(db, SIGNAL(error(QString)), this, SIGNAL(error(QString))); - #if defined ENABLE_MODEL_TEST - new ModelTest(this, this); - #endif } void SqlLibraryModel::clear() diff --git a/models/streamsearchmodel.cpp b/models/streamsearchmodel.cpp index 5a0d35df1..8b9ad46b8 100644 --- a/models/streamsearchmodel.cpp +++ b/models/streamsearchmodel.cpp @@ -36,9 +36,7 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include -#endif static QIcon getIcon(const QString &name) { @@ -291,11 +289,7 @@ void StreamSearchModel::search(const QString &searchTerm, bool stationsOnly) foreach (StreamsModel::Item *item, root->children) { QUrl searchUrl; - #if QT_VERSION < 0x050000 - QUrl &query=searchUrl; - #else QUrlQuery query; - #endif switch (root->children.indexOf(item)) { case TuneIn: { searchUrl=QUrl(item->url); @@ -331,9 +325,7 @@ void StreamSearchModel::search(const QString &searchTerm, bool stationsOnly) break; } - #if QT_VERSION >= 0x050000 searchUrl.setQuery(query); - #endif NetworkJob *job=NetworkAccessManager::self()->get(searchUrl); if (jobs.isEmpty()) { emit loading(); diff --git a/models/streamsmodel.cpp b/models/streamsmodel.cpp index 1ffe6a581..f4681e12e 100644 --- a/models/streamsmodel.cpp +++ b/models/streamsmodel.cpp @@ -54,20 +54,13 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include #include -#else -#include "qjson/parser.h" -#endif #if defined Q_OS_WIN #include #endif #include #include -#if defined ENABLE_MODEL_TEST -#include "modeltest.h" -#endif #include GLOBAL_STATIC(StreamsModel, instance) @@ -490,16 +483,10 @@ NetworkJob * StreamsModel::ShoutCastCategoryItem::fetchSecondardyUrl() if (url!=constShoutCastUrl) { // Get stations... QUrl url(QLatin1String("http://")+constShoutCastHost+QLatin1String("/legacy/genresearch")); - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif query.addQueryItem("k", constShoutCastApiKey); query.addQueryItem("genre", name); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif QNetworkRequest req(url); addHeaders(req); @@ -548,9 +535,6 @@ StreamsModel::StreamsModel(QObject *parent) } } } - #if defined ENABLE_MODEL_TEST - new ModelTest(this, this); - #endif connect(MPDConnection::self(), SIGNAL(savedStream(QString,QString)), SLOT(savedFavouriteStream(QString,QString))); connect(MPDConnection::self(), SIGNAL(removedStreams(QList)), SLOT(removedFavouriteStreams(QList))); @@ -1405,11 +1389,7 @@ QList StreamsModel::parseSomaFmResponse(QIODevice *dev, Ca QList StreamsModel::parseDigitallyImportedResponse(QIODevice *dev, CategoryItem *cat) { QList newItems; - #if QT_VERSION >= 0x050000 QVariantMap data=QJsonDocument::fromJson(dev->readAll()).toVariant().toMap(); - #else - QVariantMap data = QJson::Parser().parse(dev->readAll()).toMap(); - #endif QString listenHost=QLatin1String("listen.")+QUrl(cat->url).host().remove("www."); if (data.contains("channel_filters")) { @@ -1643,11 +1623,7 @@ QList StreamsModel::parseDirbleResponse(QIODevice *dev, Ca return parseDirbleStations(dev, cat); } QList newItems; - #if QT_VERSION >= 0x050000 QVariantList data=QJsonDocument::fromJson(dev->readAll()).toVariant().toList(); - #else - QVariantList data = QJson::Parser().parse(dev->readAll()).toList(); - #endif // Get categories...::f if (!data.isEmpty()) { @@ -1663,11 +1639,7 @@ QList StreamsModel::parseDirbleResponse(QIODevice *dev, Ca QList StreamsModel::parseDirbleStations(QIODevice *dev, CategoryItem *cat) { QList newItems; - #if QT_VERSION >= 0x050000 QVariantList data=QJsonDocument::fromJson(dev->readAll()).toVariant().toList(); - #else - QVariantList data = QJson::Parser().parse(dev->readAll()).toList(); - #endif QSet added; foreach (const QVariant &d, data) { @@ -1807,11 +1779,7 @@ StreamsModel::CategoryItem * StreamsModel::addInstalledProvider(const QString &n if (streamsFileName.endsWith(constSettingsFile)) { QFile file(streamsFileName); if (file.open(QIODevice::ReadOnly)) { - #if QT_VERSION >= 0x050000 QVariantMap map=QJsonDocument::fromJson(file.readAll()).toVariant().toMap(); - #else - QVariantMap map = QJson::Parser().parse(file.readAll()).toMap(); - #endif QString type=map["type"].toString(); QString url=map["url"].toString(); diff --git a/mpd-interface/cuefile.cpp b/mpd-interface/cuefile.cpp index 4b465a249..7bc42d8de 100644 --- a/mpd-interface/cuefile.cpp +++ b/mpd-interface/cuefile.cpp @@ -36,9 +36,7 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include -#endif static const QString constFileLineRegExp = QLatin1String("(\\S+)\\s+(?:\"([^\"]+)\"|(\\S+))\\s*(?:\"([^\"]+)\"|(\\S+))?"); static const QString constIndexRegExp = QLatin1String("(\\d{2,3}):(\\d{2}):(\\d{2})"); @@ -63,11 +61,7 @@ bool CueFile::isCue(const QString &str) QByteArray CueFile::getLoadLine(const QString &str) { QUrl u(str); - #if QT_VERSION < 0x050000 - const QUrl &q=u; - #else QUrlQuery q(u); - #endif if (q.hasQueryItem("pos")) { QString pos=q.queryItemValue("pos"); diff --git a/mpd-interface/httpstream.cpp b/mpd-interface/httpstream.cpp index 62882e3a7..f2bde0a79 100644 --- a/mpd-interface/httpstream.cpp +++ b/mpd-interface/httpstream.cpp @@ -25,9 +25,6 @@ #include "mpdconnection.h" #include "mpdstatus.h" #include "gui/settings.h" -#if QT_VERSION < 0x050000 -#include -#endif HttpStream::HttpStream(QObject *p) : QObject(p) @@ -87,11 +84,6 @@ void HttpStream::streamUrl(const QString &url) media = libvlc_media_new_location(instance, byteArrayUrl.constData()); player = libvlc_media_player_new_from_media(media); libvlc_media_release(media); - #elif QT_VERSION < 0x050000 - player=new Phonon::MediaObject(this); - Phonon::createPath(player, new Phonon::AudioOutput(Phonon::MusicCategory, this)); - player->setCurrentSource(QUrl(url)); - player->setProperty(constUrlProperty, url); #else player=new QMediaPlayer(this); player->setMedia(QUrl(url)); @@ -107,10 +99,6 @@ void HttpStream::streamUrl(const QString &url) if(libvlc_media_player_get_state(player)!=libvlc_Playing){ libvlc_media_player_play(player); } - #elif QT_VERSION < 0x050000 - if (Phonon::PlayingState!=player->state()) { - player->play(); - } #else if (QMediaPlayer::PlayingState!=player->state()) { player->play(); @@ -159,10 +147,6 @@ void HttpStream::updateStatus() if (libvlc_Playing!=libvlc_media_player_get_state(player)) { libvlc_media_player_play(player); } - #elif QT_VERSION < 0x050000 - if (Phonon::PlayingState!=player->state()) { - player->play(); - } #else if (QMediaPlayer::PlayingState!=player->state()) { player->play(); diff --git a/mpd-interface/httpstream.h b/mpd-interface/httpstream.h index 085d18b08..0dfa4620b 100644 --- a/mpd-interface/httpstream.h +++ b/mpd-interface/httpstream.h @@ -28,8 +28,6 @@ #ifdef LIBVLC_FOUND #include -#elif QT_VERSION < 0x050000 -#include #else #include #endif @@ -58,8 +56,6 @@ private: libvlc_instance_t *instance; libvlc_media_player_t *player; libvlc_media_t *media; - #elif QT_VERSION < 0x050000 - Phonon::MediaObject *player; #else QMediaPlayer *player; #endif diff --git a/network/networkproxyfactory.cpp b/network/networkproxyfactory.cpp index d4ba16141..f858568f1 100644 --- a/network/networkproxyfactory.cpp +++ b/network/networkproxyfactory.cpp @@ -29,106 +29,9 @@ const char * NetworkProxyFactory::constSettingsGroup = "Proxy"; -#if defined Q_OS_LINUX && QT_VERSION < 0x050000 -// Taken from Qt5... -static bool ignoreProxyFor(const QNetworkProxyQuery &query) -{ - const QList noProxyTokens = qgetenv("no_proxy").split(','); - - foreach (const QByteArray &rawToken, noProxyTokens) { - QByteArray token = rawToken.trimmed(); - QString peerHostName = query.peerHostName(); - - // Since we use suffix matching, "*" is our 'default' behaviour - if (token.startsWith("*")) { - token = token.mid(1); - } - - // Harmonize trailing dot notation - if (token.endsWith('.') && !peerHostName.endsWith('.')) { - token = token.left(token.length()-1); - } - - // We prepend a dot to both values, so that when we do a suffix match, - // we don't match "donotmatch.com" with "match.com" - if (!token.startsWith('.')) { - token.prepend('.'); - } - - if (!peerHostName.startsWith('.')) { - peerHostName.prepend('.'); - } - - if (peerHostName.endsWith(QString::fromLatin1(token))) { - return true; - } - } - - return false; -} - -// Taken from Qt5... -static QList systemProxyForQuery(const QNetworkProxyQuery &query) -{ - QList proxyList; - - if (ignoreProxyFor(query)) { - return proxyList << QNetworkProxy::NoProxy; - } - - // No need to care about casing here, QUrl lowercases values already - const QString queryProtocol = query.protocolTag(); - QByteArray proxy_env; - - if (queryProtocol == QLatin1String("http")) { - proxy_env = qgetenv("http_proxy"); - } else if (queryProtocol == QLatin1String("https")) { - proxy_env = qgetenv("https_proxy"); - } else if (queryProtocol == QLatin1String("ftp")) { - proxy_env = qgetenv("ftp_proxy"); - } else { - proxy_env = qgetenv("all_proxy"); - } - - // Fallback to http_proxy is no protocol specific proxy was found - if (proxy_env.isEmpty()) { - proxy_env = qgetenv("http_proxy"); - } - - if (!proxy_env.isEmpty()) { - QUrl url = QUrl(QString::fromLocal8Bit(proxy_env)); - if (url.scheme() == QLatin1String("socks5")) { - QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, url.host(), - url.port() ? url.port() : 1080, url.userName(), url.password()); - proxyList << proxy; - } else if (url.scheme() == QLatin1String("socks5h")) { - QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, url.host(), - url.port() ? url.port() : 1080, url.userName(), url.password()); - proxy.setCapabilities(QNetworkProxy::HostNameLookupCapability); - proxyList << proxy; - } else if ((url.scheme() == QLatin1String("http") || url.scheme().isEmpty()) - && query.queryType() != QNetworkProxyQuery::UdpSocket - && query.queryType() != QNetworkProxyQuery::TcpServer) { - QNetworkProxy proxy(QNetworkProxy::HttpProxy, url.host(), - url.port() ? url.port() : 8080, url.userName(), url.password()); - proxyList << proxy; - } - } - if (proxyList.isEmpty()) { - proxyList << QNetworkProxy::NoProxy; - } - - return proxyList; -} -#endif - static QList getSystemProxyForQuery(const QNetworkProxyQuery &query) { - #if defined Q_OS_LINUX && QT_VERSION < 0x050000 - return ::systemProxyForQuery(query); - #else return QNetworkProxyFactory::systemProxyForQuery(query); - #endif } #ifdef ENABLE_PROXY_CONFIG diff --git a/online/magnatuneservice.cpp b/online/magnatuneservice.cpp index 38f6330db..32c83a827 100644 --- a/online/magnatuneservice.cpp +++ b/online/magnatuneservice.cpp @@ -229,12 +229,7 @@ Song & MagnatuneService::fixPath(Song &s) const { s.type=Song::OnlineSvrTrack; if (MB_None!=membership) { - QUrl url; - #if QT_VERSION < 0x050000 - url.setEncodedUrl(s.file.toLocal8Bit()); - #else - url=QUrl(s.file); - #endif + QUrl url(s.file); url.setScheme("http"); url.setHost(MB_Streaming==membership ? constStreamingHostname : constDownloadHostname); url.setUserName(username); diff --git a/online/podcastsearchdialog.cpp b/online/podcastsearchdialog.cpp index bbd4500cf..b4d26afb7 100644 --- a/online/podcastsearchdialog.cpp +++ b/online/podcastsearchdialog.cpp @@ -54,12 +54,8 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include #include -#else -#include "qjson/parser.h" -#endif static int iCount=0; @@ -364,20 +360,14 @@ void PodcastSearchPage::doSearch() currentSearch=text; QUrl url=queryUrl; - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif query.addQueryItem(queryKey, text); if (otherArgs.size()>1) { for (int i=0; i= 0x050000 url.setQuery(query); - #endif fetch(url); } @@ -387,11 +377,7 @@ void PodcastSearchPage::parseResonse(QIODevice *dev) emit error(i18n("Failed to fetch podcasts from %1", name())); return; } - #if QT_VERSION >= 0x050000 QVariant data=QJsonDocument::fromJson(dev->readAll()).toVariant(); - #else - QVariant data = QJson::Parser().parse(dev->readAll()); - #endif if (data.isNull()) { emit error(i18n("There was a problem parsing the response from %1", name())); return; diff --git a/online/podcastservice.cpp b/online/podcastservice.cpp index 3f4806dfe..3870fda13 100644 --- a/online/podcastservice.cpp +++ b/online/podcastservice.cpp @@ -44,9 +44,6 @@ #include #include #include -#if QT_VERSION >= 0x050000 -#include -#endif #include PodcastService::Proxy::Proxy(QObject *parent) diff --git a/online/soundcloudservice.cpp b/online/soundcloudservice.cpp index 7f3512fb5..fad6c8027 100644 --- a/online/soundcloudservice.cpp +++ b/online/soundcloudservice.cpp @@ -26,12 +26,8 @@ #include "network/networkaccessmanager.h" #include "mpd-interface/mpdconnection.h" #include -#if QT_VERSION >= 0x050000 #include #include -#else -#include "qjson/parser.h" -#endif static const QLatin1String constName("soundcloud"); static const QLatin1String constApiKey("0cb23dce473528973ce74815bd36a334"); @@ -76,16 +72,10 @@ void SoundCloudService::search(const QString &key, const QString &value) } QUrl searchUrl(constUrl); - #if QT_VERSION < 0x050000 - QUrl &query=searchUrl; - #else QUrlQuery query; - #endif query.addQueryItem("client_id", constApiKey); query.addQueryItem("q", currentValue); - #if QT_VERSION >= 0x050000 searchUrl.setQuery(query); - #endif QNetworkRequest req(searchUrl); req.setRawHeader("Accept", "application/json"); @@ -106,11 +96,7 @@ void SoundCloudService::jobFinished() QList songs; if (j->ok()) { - #if QT_VERSION >= 0x050000 QVariant result=QJsonDocument::fromJson(j->readAll()).toVariant(); - #else - QVariant result = QJson::Parser().parse(j->readAll()); - #endif if (result.isValid()) { QVariantList list = result.toList(); foreach(const QVariant &item, list) { @@ -120,15 +106,9 @@ void SoundCloudService::jobFinished() } Song song; QUrl url = details["stream_url"].toUrl(); - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query; - #endif query.addQueryItem("client_id", constApiKey); - #if QT_VERSION >= 0x050000 url.setQuery(query); - #endif // MPD does not seem to support https :-( if (QLatin1String("https")==url.scheme() && !MPDConnection::self()->urlHandlers().contains(QLatin1String("https"))) { url.setScheme(QLatin1String("http")); diff --git a/replaygain/CMakeLists.txt b/replaygain/CMakeLists.txt index 3a08b5d1e..f656c49d5 100644 --- a/replaygain/CMakeLists.txt +++ b/replaygain/CMakeLists.txt @@ -16,12 +16,7 @@ if (FFMPEG_FOUND OR MPG123_FOUND) kde4_add_executable(cantata-replaygain ${CANTATA_RG_SRCS} ${CANTATA_RG_MOC_SRCS}) install(TARGETS cantata-replaygain RUNTIME DESTINATION ${LINUX_LIB_DIR}/cantata) else (ENABLE_KDE_SUPPORT) - if (ENABLE_QT5) - QT5_WRAP_CPP(CANTATA_RG_MOC_SRCS ${CANTATA_RG_MOC_HDRS}) - else (ENABLE_QT5) - INCLUDE(${QT_USE_FILE}) - QT4_WRAP_CPP(CANTATA_RG_MOC_SRCS ${CANTATA_RG_MOC_HDRS}) - endif (ENABLE_QT5) + QT5_WRAP_CPP(CANTATA_RG_MOC_SRCS ${CANTATA_RG_MOC_HDRS}) if (WIN32) set(CMAKE_BUILD_TYPE "Release") diff --git a/replaygain/rgdialog.cpp b/replaygain/rgdialog.cpp index dd774b7ca..9d3c5f813 100644 --- a/replaygain/rgdialog.cpp +++ b/replaygain/rgdialog.cpp @@ -67,11 +67,7 @@ int RgDialog::instanceCount() static inline void setResizeMode(QHeaderView *hdr, int idx, QHeaderView::ResizeMode mode) { - #if QT_VERSION < 0x050000 - hdr->setResizeMode(idx, mode); - #else hdr->setSectionResizeMode(idx, mode); - #endif } RgDialog::RgDialog(QWidget *parent) diff --git a/streams/streamspage.cpp b/streams/streamspage.cpp index 0463d706c..865cd1f59 100644 --- a/streams/streamspage.cpp +++ b/streams/streamspage.cpp @@ -45,9 +45,7 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include -#endif static const int constMsgDisplayTime=1500; static const char *constNameProperty="name"; @@ -342,17 +340,11 @@ void StreamsBrowsePage::addToFavourites(const QList &items) int added=0; foreach (const StreamItem item, items) { QUrl url(item.url); - #if QT_VERSION < 0x050000 - QUrl &query=url; - #else QUrlQuery query(url); - #endif query.removeQueryItem(QLatin1String("locale")); - #if QT_VERSION >= 0x050000 if (!query.isEmpty()) { url.setQuery(query); } - #endif QString urlStr=url.toString(); if (urlStr.endsWith('&')) { urlStr=urlStr.left(urlStr.length()-1); diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt index 45ef13b11..ac9a832ea 100644 --- a/support/CMakeLists.txt +++ b/support/CMakeLists.txt @@ -3,11 +3,7 @@ set(SUPPORT_CORE_MOC_HDRS thread.h) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QTINCLUDES}) -if (ENABLE_QT5) - qt5_wrap_cpp(SUPPORT_CORE_MOC_SRCS ${SUPPORT_CORE_MOC_HDRS}) -else (ENABLE_QT5) - qt4_wrap_cpp(SUPPORT_CORE_MOC_SRCS ${SUPPORT_CORE_MOC_HDRS}) -endif (ENABLE_QT5) +qt5_wrap_cpp(SUPPORT_CORE_MOC_SRCS ${SUPPORT_CORE_MOC_HDRS}) add_library(support-core STATIC ${SUPPORT_CORE_MOC_SRCS} ${SUPPORT_CORE_SRCS}) @@ -30,9 +26,7 @@ if (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB) set(SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} flickcharm.h) endif (ENABLE_TOUCH_SUPPORT) - if (ENABLE_QT5) - set(SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} combobox.h) - endif (ENABLE_QT5) + set(SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} combobox.h) if (NOT WIN32 AND NOT APPLE) set(SUPPORT_SRCS ${SUPPORT_SRCS} gtkproxystyle.cpp shortcuthandler.cpp) @@ -41,11 +35,7 @@ if (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB) if (APPLE) set(SUPPORT_SRCS ${SUPPORT_SRCS} osxstyle.cpp flattoolbutton.cpp windowmanager.cpp) set(SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} osxstyle.h windowmanager.h) - if (ENABLE_QT5) - qt5_add_resources(SUPPORT_RC_SRCS support_mac_icons.qrc) - else (ENABLE_QT5) - qt4_add_resources(SUPPORT_RC_SRCS support_mac_icons.qrc) - endif (ENABLE_QT5) + qt5_add_resources(SUPPORT_RC_SRCS support_mac_icons.qrc) endif (APPLE) if (ENABLE_KDE_SUPPORT) @@ -63,28 +53,14 @@ if (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB) set(SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} pathrequester.h kmessagewidget.h urllabel.h dialog.h shortcutsmodel.h shortcutssettingswidget.h keysequencewidget.h spinner.h acceleratormanager_private.h) set(SUPPORT_UIS shortcutssettingswidget.ui) - if (ENABLE_QT5) - if (Qt5Gui_VERSION_MAJOR LESS 5 OR Qt5Gui_VERSION_MINOR LESS 2) - set(SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} lineedit.h) - endif (Qt5Gui_VERSION_MAJOR LESS 5 OR Qt5Gui_VERSION_MINOR LESS 2) - qt5_wrap_ui(SUPPORT_UI_HDRS ${SUPPORT_UIS}) - else (ENABLE_QT5) + if (Qt5Gui_VERSION_MAJOR LESS 5 OR Qt5Gui_VERSION_MINOR LESS 2) set(SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} lineedit.h) - qt4_wrap_ui(SUPPORT_UI_HDRS ${SUPPORT_UIS}) - endif (ENABLE_QT5) + endif (Qt5Gui_VERSION_MAJOR LESS 5 OR Qt5Gui_VERSION_MINOR LESS 2) + qt5_wrap_ui(SUPPORT_UI_HDRS ${SUPPORT_UIS}) endif (ENABLE_KDE_SUPPORT) - if (ENABLE_QT5) - qt5_wrap_cpp(SUPPORT_MOC_SRCS ${SUPPORT_MOC_HDRS}) - qt5_add_resources(SUPPORT_RC_SRCS ${SUPPORT_RCS}) - else (ENABLE_QT5) - qt4_wrap_cpp(SUPPORT_MOC_SRCS ${SUPPORT_MOC_HDRS}) - qt4_add_resources(SUPPORT_RC_SRCS ${SUPPORT_RCS}) - endif (ENABLE_QT5) + qt5_wrap_cpp(SUPPORT_MOC_SRCS ${SUPPORT_MOC_HDRS}) + qt5_add_resources(SUPPORT_RC_SRCS ${SUPPORT_RCS}) add_library(support STATIC ${SUPPORT_MOC_SRCS} ${SUPPORT_SRCS} ${SUPPORT_UI_HDRS} ${SUPPORT_RC_SRCS}) - - if (NOT ENABLE_QT5 AND X11_FOUND) - target_link_libraries(support ${X11_LIBRARIES}) - endif (NOT ENABLE_QT5 AND X11_FOUND) endif (NOT ENABLE_UBUNTU AND NOT ENABLE_WEB) diff --git a/support/acceleratormanager.cpp b/support/acceleratormanager.cpp index ccb2cd13f..ed6ca19a6 100644 --- a/support/acceleratormanager.cpp +++ b/support/acceleratormanager.cpp @@ -72,11 +72,7 @@ static inline QString esc(const QString &orig) { - #if QT_VERSION < 0x050000 - return Qt::escape(orig); - #else return orig.toHtmlEscaped(); - #endif } class AcceleratorManagerPrivate diff --git a/support/actioncollection.cpp b/support/actioncollection.cpp index 9e11fd1bc..7b486fbbb 100644 --- a/support/actioncollection.cpp +++ b/support/actioncollection.cpp @@ -25,6 +25,7 @@ #include "icon.h" #include #include +#include static const char *constProp="Category"; static ActionCollection *coll=0; @@ -245,33 +246,6 @@ void ActionCollection::actionDestroyed(QObject *obj) { unlistAction(action); } -void ActionCollection::connectNotify(const char *signal) { - #if QT_VERSION < 0x050000 - if(_connectHovered && _connectTriggered) - return; - - if(QMetaObject::normalizedSignature(SIGNAL(actionHovered(QAction*))) == signal) { - if(!_connectHovered) { - _connectHovered = true; - foreach (QAction* action, actions()) - connect(action, SIGNAL(hovered()), SLOT(slotActionHovered())); - } - } else if(QMetaObject::normalizedSignature(SIGNAL(actionTriggered(QAction*))) == signal) { - if(!_connectTriggered) { - _connectTriggered = true; - foreach (QAction* action, actions()) - connect(action, SIGNAL(triggered(bool)), SLOT(slotActionTriggered())); - } - } - - QObject::connectNotify(signal); - #else - Q_UNUSED(signal) - #endif -} - -#if QT_VERSION >= 0x050000 -#include void ActionCollection::connectNotify(const QMetaMethod &signal) { if(_connectHovered && _connectTriggered) return; @@ -292,7 +266,6 @@ void ActionCollection::connectNotify(const QMetaMethod &signal) { QObject::connectNotify(signal); } -#endif void ActionCollection::associateWidget(QWidget *widget) const { foreach(QAction *action, actions()) { diff --git a/support/actioncollection.h b/support/actioncollection.h index 51cd91a26..3c0bf3ba4 100644 --- a/support/actioncollection.h +++ b/support/actioncollection.h @@ -98,13 +98,10 @@ Q_SIGNALS: void tooltipUpdated(QAction *); protected Q_SLOTS: - virtual void connectNotify(const char *signal); virtual void slotActionTriggered(); -#if QT_VERSION >= 0x050000 protected: virtual void connectNotify(const QMetaMethod &signal); -#endif private Q_SLOTS: void slotActionHovered(); diff --git a/support/combobox.cpp b/support/combobox.cpp index e81eba077..a28ffb4c0 100644 --- a/support/combobox.cpp +++ b/support/combobox.cpp @@ -45,9 +45,7 @@ ComboBox::ComboBox(QWidget *p) } } #endif - #if QT_VERSION >= 0x050000 connect(this, SIGNAL(editTextChanged(QString)), this, SIGNAL(textChanged(QString))); - #endif } void ComboBox::setEditable(bool editable) diff --git a/support/combobox.h b/support/combobox.h index d0ce4939b..dcc83023a 100644 --- a/support/combobox.h +++ b/support/combobox.h @@ -28,9 +28,7 @@ class ComboBox : public QComboBox { - #if QT_VERSION >= 0x050000 Q_OBJECT - #endif public: ComboBox(QWidget *p); @@ -42,10 +40,8 @@ public: void hidePopup(); #endif -#if QT_VERSION >= 0x050000 Q_SIGNALS: void textChanged(const QString &t); -#endif private: bool toggleState; diff --git a/support/fancytabwidget.cpp b/support/fancytabwidget.cpp index bc84eb5e8..6d73d9e67 100644 --- a/support/fancytabwidget.cpp +++ b/support/fancytabwidget.cpp @@ -41,7 +41,7 @@ #ifdef Q_OS_MAC #include "osxstyle.h" #endif -#include "styleoption.h" +#include #include #include #include @@ -86,11 +86,7 @@ int FancyTabWidget::iconSize(bool large) static void drawIcon(const QIcon &icon, const QRect &r, QPainter *p, const QSize &iconSize, bool selected) { QPixmap px = icon.pixmap(iconSize, selected ? QIcon::Selected : QIcon::Normal); - #if QT_VERSION >= 0x050100 QSize layoutSize = px.size() / px.devicePixelRatio(); - #else - QSize layoutSize = px.size(); - #endif p->drawPixmap(r.x()+(r.width()-layoutSize.width())/2.0, r.y()+(r.height()-layoutSize.height())/2.0, layoutSize.width(), layoutSize.height(), px); } @@ -149,7 +145,7 @@ void FancyTabProxyStyle::drawControl(ControlElement element, const QStyleOption textRect.setRight(draw_rect.width()); iconRect.translate(0, (draw_rect.height() - iconRect.height()) / 2); - StyleOptionViewItem styleOpt; + QStyleOptionViewItem styleOpt; styleOpt.palette=option->palette; styleOpt.rect=draw_rect; if (QStyleOptionTab::Beginning==v3Opt->position) { @@ -158,7 +154,7 @@ void FancyTabProxyStyle::drawControl(ControlElement element, const QStyleOption styleOpt.state=option->state; styleOpt.state&=~(QStyle::State_Selected|QStyle::State_MouseOver); styleOpt.state|=QStyle::State_Selected|QStyle::State_Enabled; - styleOpt.viewItemPosition = StyleOptionViewItem::OnlyOne; + styleOpt.viewItemPosition = QStyleOptionViewItem::OnlyOne; styleOpt.showDecorationSelected=true; bool drawBgnd=true; int fader = 1; @@ -495,12 +491,12 @@ void FancyTabBar::paintTab(QPainter *painter, int tabIndex) const QRect rect = tabRect(tabIndex); bool selected = (tabIndex == currentIdx); - StyleOptionViewItem styleOpt; + QStyleOptionViewItem styleOpt; styleOpt.initFrom(this); styleOpt.state&=~(QStyle::State_Selected|QStyle::State_MouseOver); styleOpt.state|=QStyle::State_Selected|QStyle::State_Enabled; styleOpt.rect=rect; - styleOpt.viewItemPosition = StyleOptionViewItem::OnlyOne; + styleOpt.viewItemPosition = QStyleOptionViewItem::OnlyOne; styleOpt.showDecorationSelected=true; bool drawBgnd=true; diff --git a/support/gtkstyle.cpp b/support/gtkstyle.cpp index 0d1d8dff8..604e99ac6 100644 --- a/support/gtkstyle.cpp +++ b/support/gtkstyle.cpp @@ -39,9 +39,6 @@ #ifndef NO_GTK_SUPPORT #include "gtkproxystyle.h" -#if QT_VERSION < 0x050000 -#include -#endif #endif static bool usingGtkStyle=false; @@ -61,7 +58,7 @@ bool GtkStyle::isActive() return usingGtkStyle; } -void GtkStyle::drawSelection(const StyleOptionViewItem &opt, QPainter *painter, double opacity) +void GtkStyle::drawSelection(const QStyleOptionViewItem &opt, QPainter *painter, double opacity) { static const int constMaxDimension=32; static QCache cache(30000); @@ -76,13 +73,13 @@ void GtkStyle::drawSelection(const StyleOptionViewItem &opt, QPainter *painter, if (!pix) { pix=new QPixmap(width, opt.rect.height()); - StyleOptionViewItem styleOpt(opt); + QStyleOptionViewItem styleOpt(opt); pix->fill(Qt::transparent); QPainter p(pix); styleOpt.state=opt.state; styleOpt.state&=~(QStyle::State_Selected|QStyle::State_MouseOver); styleOpt.state|=QStyle::State_Selected|QStyle::State_Enabled|QStyle::State_Active; - styleOpt.viewItemPosition = StyleOptionViewItem::OnlyOne; + styleOpt.viewItemPosition = QStyleOptionViewItem::OnlyOne; styleOpt.rect=QRect(0, 0, opt.rect.width(), opt.rect.height()); QApplication::style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &styleOpt, &p, 0); p.end(); diff --git a/support/gtkstyle.h b/support/gtkstyle.h index 7b561d2be..7b12f2b04 100644 --- a/support/gtkstyle.h +++ b/support/gtkstyle.h @@ -24,7 +24,7 @@ #ifndef GTKSTYLE_H #define GTKSTYLE_H -#include "styleoption.h" +#include #include class QPainter; @@ -33,7 +33,7 @@ class QWidget; namespace GtkStyle { extern bool isActive(); - extern void drawSelection(const StyleOptionViewItem &opt, QPainter *painter, double opacity); + extern void drawSelection(const QStyleOptionViewItem &opt, QPainter *painter, double opacity); extern void applyTheme(QWidget *widget); } diff --git a/support/lineedit.cpp b/support/lineedit.cpp index 0458805d7..97139ed88 100644 --- a/support/lineedit.cpp +++ b/support/lineedit.cpp @@ -36,63 +36,3 @@ void LineEdit::setReadOnly(bool e) setPalette(qApp->palette()); } } - -#if QT_VERSION < 0x050200 - -/**************************************************************************** -** -** Copyright (c) 2007 Trolltech ASA -** -** Use, modification and distribution is allowed without limitation, -** warranty, liability or support of any kind. -** -****************************************************************************/ - -#include "icon.h" -#include "config.h" -#include -#include -#include - -LineEdit::LineEdit(QWidget *parent) - : QLineEdit(parent) -{ - clearButton = new QToolButton(this); - clearButton->setIcon(Icon::std(Icon::Clear)); - clearButton->setCursor(Qt::ArrowCursor); - clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }"); - clearButton->hide(); - clearButton->setFocusPolicy(Qt::NoFocus); - connect(clearButton, SIGNAL(clicked()), this, SLOT(clear())); - connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateCloseButton(const QString&))); - int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); - bool onCombo = parent && qobject_cast(parent); - QString styleSheet=QLatin1String("QLineEdit { padding-right")+ - QLatin1String(": %1px; ")+QLatin1String(onCombo ? "background: transparent " : "")+QChar('}'); - setStyleSheet(styleSheet.arg(clearButton->sizeHint().width() + frameWidth + 1)); - - if (!onCombo && (!parent || !parent->property("cantata-delegate").isValid())) { - QSize msz = minimumSizeHint(); - setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2), - qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2)); - } -} - -void LineEdit::resizeEvent(QResizeEvent *e) -{ - QSize sz = clearButton->sizeHint(); - int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); - if (isRightToLeft()) { - clearButton->move(rect().left() + frameWidth, (rect().bottom() + 1 - sz.height()) / 2); - } else { - clearButton->move(rect().right() - frameWidth - sz.width(), (rect().bottom() + 1 - sz.height()) / 2); - } - QLineEdit::resizeEvent(e); -} - -void LineEdit::updateCloseButton(const QString &text) -{ - clearButton->setVisible(!isReadOnly() && !text.isEmpty()); -} - -#endif diff --git a/support/lineedit.h b/support/lineedit.h index 022a2c517..fc5b78f75 100644 --- a/support/lineedit.h +++ b/support/lineedit.h @@ -21,21 +21,11 @@ * Boston, MA 02110-1301, USA. */ -/**************************************************************************** -** -** Copyright (c) 2007 Trolltech ASA -** -** Use, modification and distribution is allowed without limitation, -** warranty, liability or support of any kind. -** -****************************************************************************/ - #ifndef LINEEDIT_H #define LINEEDIT_H #include -#if QT_VERSION >= 0x050200 class LineEdit : public QLineEdit { public: @@ -43,28 +33,4 @@ public: void setReadOnly(bool e); }; -#else - -class QToolButton; -class LineEdit : public QLineEdit -{ - Q_OBJECT - -public: - LineEdit(QWidget *parent = 0); - virtual ~LineEdit() { } - void setReadOnly(bool e); - -protected: - void resizeEvent(QResizeEvent *e); - -private Q_SLOTS: - void updateCloseButton(const QString &text); - -private: - QToolButton *clearButton; -}; - -#endif - #endif // LIENEDIT_H diff --git a/support/osxstyle.cpp b/support/osxstyle.cpp index 56f40223c..611ab12a8 100644 --- a/support/osxstyle.cpp +++ b/support/osxstyle.cpp @@ -53,7 +53,7 @@ const QPalette & OSXStyle::viewPalette() return viewWidget()->palette(); } -void OSXStyle::drawSelection(StyleOptionViewItem opt, QPainter *painter, double opacity) +void OSXStyle::drawSelection(QStyleOptionViewItem opt, QPainter *painter, double opacity) { opt.palette=viewPalette(); if (opacity<0.999) { diff --git a/support/osxstyle.h b/support/osxstyle.h index e2ce7ed56..d2aa51a5c 100644 --- a/support/osxstyle.h +++ b/support/osxstyle.h @@ -24,7 +24,7 @@ #ifndef OSXSTYLE_H #define OSXSTYLE_H -#include "styleoption.h" +#include #include #include @@ -48,7 +48,7 @@ public: OSXStyle(); const QPalette & viewPalette(); - void drawSelection(StyleOptionViewItem opt, QPainter *painter, double opacity); + void drawSelection(QStyleOptionViewItem opt, QPainter *painter, double opacity); QColor monoIconColor(); void initWindowMenu(QMainWindow *mw); diff --git a/support/pagewidget.cpp b/support/pagewidget.cpp index 22c7209e1..226bc3b4e 100644 --- a/support/pagewidget.cpp +++ b/support/pagewidget.cpp @@ -25,7 +25,7 @@ #include "icon.h" #include "gtkstyle.h" #include "dialog.h" -#include "styleoption.h" +#include #include #include #include @@ -81,7 +81,7 @@ public: if (standard) { if (GtkStyle::isActive()) { bool mouseOver=option.state&QStyle::State_MouseOver; - StyleOptionViewItem opt = option; + QStyleOptionViewItem opt = option; initStyleOption(&opt, index); if (!underMouse) { @@ -121,11 +121,7 @@ public: const QPixmap pixmap = icon.pixmap(iconSize, iconSize); QFontMetrics fm = painter->fontMetrics(); - #if QT_VERSION >= 0x050100 QSize layoutSize = pixmap.size() / pixmap.devicePixelRatio(); - #else - QSize layoutSize = pixmap.size(); - #endif QTextLayout iconTextLayout(text, option.font); QTextOption textOption(Qt::AlignHCenter); @@ -140,7 +136,7 @@ public: cg = QPalette::Inactive; } - StyleOptionViewItem opt(option); + QStyleOptionViewItem opt(option); opt.showDecorationSelected = true; QStyle *style = opt.widget ? opt.widget->style() : QApplication::style(); @@ -184,11 +180,7 @@ public: QFontMetrics fm = option.fontMetrics; int gap = fm.height(); - #if QT_VERSION >= 0x050100 QSize layoutSize = pixmap.size() / pixmap.devicePixelRatio(); - #else - QSize layoutSize = pixmap.size(); - #endif if (layoutSize.height() == 0) { /** diff --git a/support/styleoption.h b/support/styleoption.h deleted file mode 100644 index 113326d80..000000000 --- a/support/styleoption.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Cantata - * - * Copyright (c) 2011-2016 Craig Drummond - * - * ---- - * - * 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; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef STYLEOPTION_H -#define STYLEOPTION_H - -#include - -#if QT_VERSION >= 0x050100 -#define StyleOptionViewItem QStyleOptionViewItem -#else -#define StyleOptionViewItem QStyleOptionViewItemV4 -#endif - -#endif diff --git a/support/touchproxystyle.cpp b/support/touchproxystyle.cpp index 3e1f95c0c..c9451cd4e 100644 --- a/support/touchproxystyle.cpp +++ b/support/touchproxystyle.cpp @@ -208,7 +208,6 @@ QSize TouchProxyStyle::sizeFromContents(ContentsType type, const QStyleOption *o #if QT_VERSION < 0x050200 sz += QSize(0, 1); #endif - #if QT_VERSION >= 0x050000 // Qt5 does not seem to be taking special value, or suffix, into account when calculatng width... if (widget && qobject_cast(widget)) { const QSpinBox *spin=static_cast(widget); @@ -230,9 +229,7 @@ QSize TouchProxyStyle::sizeFromContents(ContentsType type, const QStyleOption *o sz.setWidth(minWidth); } } - } else - #endif - if (!GtkStyle::isActive()) { + } else if (!GtkStyle::isActive()) { sz.setWidth(sz.width()+6); } } diff --git a/support/utils.cpp b/support/utils.cpp index 677d74520..38545287b 100644 --- a/support/utils.cpp +++ b/support/utils.cpp @@ -35,11 +35,7 @@ #include #include #include -#if QT_VERSION >= 0x050000 #include -#else -#include -#endif #include #include #include @@ -682,29 +678,17 @@ QString Utils::dataDir(const QString &sub, bool create) { #if defined Q_OS_WIN || defined Q_OS_MAC - #if QT_VERSION >= 0x050000 return userDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation)+constDirSep, sub, create); - #else - return userDir(QDesktopServices::storageLocation(QDesktopServices::DataLocation)+constDirSep, sub, create); - #endif #else static QString location; if (location.isEmpty()) { - #if QT_VERSION >= 0x050000 location=QStandardPaths::writableLocation(QStandardPaths::DataLocation); if (QCoreApplication::organizationName()==QCoreApplication::applicationName()) { location=location.replace(QCoreApplication::organizationName()+Utils::constDirSep+QCoreApplication::applicationName(), QCoreApplication::applicationName()); } - #else - location=QDesktopServices::storageLocation(QDesktopServices::DataLocation); - if (QCoreApplication::organizationName()==QCoreApplication::applicationName()) { - location=location.replace(QLatin1String("data")+Utils::constDirSep+QCoreApplication::applicationName()+Utils::constDirSep+QCoreApplication::applicationName(), - QCoreApplication::applicationName()); - } - #endif } return userDir(location+constDirSep, sub, create); @@ -715,21 +699,13 @@ QString Utils::cacheDir(const QString &sub, bool create) { #if defined Q_OS_WIN || defined Q_OS_MAC - #if QT_VERSION >= 0x050000 return userDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)+constDirSep, sub, create); - #else - return userDir(QDesktopServices::storageLocation(QDesktopServices::CacheLocation)+constDirSep, sub, create); - #endif #else static QString location; if (location.isEmpty()) { - #if QT_VERSION >= 0x050000 location=QStandardPaths::writableLocation(QStandardPaths::CacheLocation); - #else - location=QDesktopServices::storageLocation(QDesktopServices::CacheLocation); - #endif if (QCoreApplication::organizationName()==QCoreApplication::applicationName()) { location=location.replace(QCoreApplication::organizationName()+Utils::constDirSep+QCoreApplication::applicationName(), QCoreApplication::applicationName()); @@ -976,9 +952,6 @@ QColor Utils::monoIconColor() #ifdef Q_OS_WIN // This is down here, because windows.h includes ALL windows stuff - and we get conflicts with MessageBox :-( #include -#elif !defined Q_OS_MAC && QT_VERSION < 0x050000 -#include -#include #endif void Utils::raiseWindow(QWidget *w) @@ -990,7 +963,7 @@ void Utils::raiseWindow(QWidget *w) #ifdef Q_OS_WIN ::SetWindowPos(reinterpret_cast(w->effectiveWinId()), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); ::SetWindowPos(reinterpret_cast(w->effectiveWinId()), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); - #elif !defined Q_OS_WIN && QT_VERSION>=0x050000 + #elif !defined Q_OS_WIN bool wasHidden=w->isHidden(); #endif @@ -1002,21 +975,6 @@ void Utils::raiseWindow(QWidget *w) #endif #if !defined Q_OS_WIN && !defined Q_OS_MAC // This section seems to be required for compiz, so that MPRIS.Raise actually shows the window, and not just highlight launcher. - #if QT_VERSION < 0x050000 - static const Atom constNetActive=XInternAtom(QX11Info::display(), "_NET_ACTIVE_WINDOW", False); - QX11Info info; - XEvent xev; - xev.xclient.type = ClientMessage; - xev.xclient.serial = 0; - xev.xclient.send_event = True; - xev.xclient.message_type = constNetActive; - xev.xclient.display = QX11Info::display(); - xev.xclient.window = w->effectiveWinId(); - xev.xclient.format = 32; - xev.xclient.data.l[0] = 2; - xev.xclient.data.l[1] = xev.xclient.data.l[2] = xev.xclient.data.l[3] = xev.xclient.data.l[4] = 0; - XSendEvent(QX11Info::display(), QX11Info::appRootWindow(info.screen()), False, SubstructureRedirectMask|SubstructureNotifyMask, &xev); - #else // QT_VERSION < 0x050000 QString wmctrl=Utils::findExe(QLatin1String("wmctrl")); if (!wmctrl.isEmpty()) { if (wasHidden) { @@ -1024,7 +982,6 @@ void Utils::raiseWindow(QWidget *w) } QProcess::execute(wmctrl, QStringList() << QLatin1String("-i") << QLatin1String("-a") << QString::number(w->effectiveWinId())); } - #endif // QT_VERSION < 0x050000 #endif } diff --git a/support/windowmanager.cpp b/support/windowmanager.cpp index ee86042e2..4e780f042 100644 --- a/support/windowmanager.cpp +++ b/support/windowmanager.cpp @@ -57,14 +57,6 @@ #include #include -#if defined Q_WS_X11 && QT_VERSION < 0x050000 -#include -#if QT_VERSION < 0x050000 -#include -#include -#endif -#endif - static inline bool isToolBar(QWidget *w) { return qobject_cast(w) || 0==strcmp(w->metaObject()->className(), "ToolBar"); @@ -76,40 +68,9 @@ static inline void addEventFilter(QObject *object, QObject *filter) object->installEventFilter(filter); } -#if QT_VERSION < 0x040600 -Pointer & Pointer::operator=(QWidget *w) -{ - widget_=w; - if (widget_) { - addEventFilter(widget_, this); - } - return *this; -} - -void Pointer::clear() -{ - if (widget_) { - widget_->removeEventFilter(this); - } - widget_=0L; -} - -bool Pointer::eventFilter(QObject *o, QEvent *e) -{ - if (o==widget_ && QEvent::Destroy==e->type()) { - widget_=0L; - } - return false; -} -#endif - WindowManager::WindowManager(QObject *parent) : QObject(parent) - #if defined Q_WS_X11 && QT_VERSION < 0x050000 - , _useWMMoveResize(true) - #else , _useWMMoveResize(false) - #endif , _dragMode(WM_DRAG_NONE) , _dragDistance(QApplication::startDragDistance()) , _dragDelay(QApplication::startDragTime()) @@ -563,28 +524,7 @@ void WindowManager::startDrag(QWidget *widget, const QPoint& position) // ungrab pointer if (useWMMoveResize()) { - #if defined Q_WS_X11 && QT_VERSION < 0x050000 - static const Atom constNetMoveResize = XInternAtom(QX11Info::display(), "_NET_WM_MOVERESIZE", False); - //...Taken from bespin... - // stolen... errr "adapted!" from QSizeGrip - QX11Info info; - XEvent xev; - xev.xclient.type = ClientMessage; - xev.xclient.message_type = constNetMoveResize; - xev.xclient.display = QX11Info::display(); - xev.xclient.window = widget->window()->winId(); - xev.xclient.format = 32; - xev.xclient.data.l[0] = position.x(); - xev.xclient.data.l[1] = position.y(); - xev.xclient.data.l[2] = 8; // NET::Move - xev.xclient.data.l[3] = Button1; - xev.xclient.data.l[4] = 0; - XUngrabPointer(QX11Info::display(), QX11Info::appTime()); - XSendEvent(QX11Info::display(), QX11Info::appRootWindow(info.screen()), False, - SubstructureRedirectMask | SubstructureNotifyMask, &xev); - #else Q_UNUSED(position) - #endif } #ifndef Q_OS_MAC @@ -600,9 +540,6 @@ void WindowManager::startDrag(QWidget *widget, const QPoint& position) bool WindowManager::supportWMMoveResize(void) const { - #if defined Q_WS_X11 && QT_VERSION < 0x050000 - return true; - #endif return false; } diff --git a/support/windowmanager.h b/support/windowmanager.h index 6da167ee0..bef8a6e73 100644 --- a/support/windowmanager.h +++ b/support/windowmanager.h @@ -44,35 +44,13 @@ #include #include #include -#if QT_VERSION < 0x050000 -#include -#define WmPointer QWeakPointer -#else #include -#define WmPointer QPointer -#endif #include class WindowManager: public QObject { Q_OBJECT - #if QT_VERSION < 0x040600 - class WmPointer : public QObject - { - public: - Pointer(QWidget *w=0L) : widget_(w) {} - Pointer & operator=(QWidget *w); - operator bool() const { return 0L!=widget_; } - void clear(); - bool eventFilter(QObject *, QEvent *); - QWidget *data() { return widget_; } - - private: - QWidget *widget_; - }; - #endif - public: enum DragMode { @@ -159,11 +137,7 @@ private: //! target being dragged /*! QWeakPointer is used in case the target gets deleted while drag is in progress */ - #if QT_VERSION < 0x040600 - WmPointer _target; - #else - WmPointer _target; - #endif + QPointer _target; //! true if drag is about to start bool _dragAboutToStart; diff --git a/tags/CMakeLists.txt b/tags/CMakeLists.txt index d4211f783..08f1dd197 100644 --- a/tags/CMakeLists.txt +++ b/tags/CMakeLists.txt @@ -7,11 +7,7 @@ if (ENABLE_KDE_SUPPORT) install(TARGETS cantata-tags RUNTIME DESTINATION ${LINUX_LIB_DIR}/cantata) target_link_libraries(cantata-tags ${KDE4_KDECORE_LIBS}) else (ENABLE_KDE_SUPPORT) - if (ENABLE_QT5) - QT5_WRAP_CPP(CANTATA_TAGS_MOC_SRCS ${CANTATA_TAGS_MOC_HDRS}) - else (ENABLE_QT5) - QT4_WRAP_CPP(CANTATA_TAGS_MOC_SRCS ${CANTATA_TAGS_MOC_HDRS}) - endif (ENABLE_QT5) + QT5_WRAP_CPP(CANTATA_TAGS_MOC_SRCS ${CANTATA_TAGS_MOC_HDRS}) if (WIN32) set(CMAKE_BUILD_TYPE "Release") diff --git a/tags/main.cpp b/tags/main.cpp index 1ce1e837e..d8d5f285f 100644 --- a/tags/main.cpp +++ b/tags/main.cpp @@ -40,11 +40,7 @@ static long __stdcall exceptionHandler(EXCEPTION_POINTERS *p) static QString logFileName; static bool firstMsg=true; -#if QT_VERSION < 0x050000 -static void cantataQtMsgHandler(QtMsgType, const char *msg) -#else static void cantataQtMsgHandler(QtMsgType, const QMessageLogContext &, const QString &msg) -#endif { QFile f(logFileName); if (f.open(QIODevice::WriteOnly|QIODevice::Append|QIODevice::Text)) { @@ -68,11 +64,7 @@ int main(int argc, char *argv[]) if (4==app.arguments().length()) { logFileName=app.arguments().at(3); if (!logFileName.isEmpty()) { - #if QT_VERSION < 0x050000 - qInstallMsgHandler(cantataQtMsgHandler); - #else qInstallMessageHandler(cantataQtMsgHandler); - #endif TagHelper::enableDebug(); Tags::enableDebug(); } diff --git a/tags/tags.cpp b/tags/tags.cpp index 8960accd6..69ce071ea 100644 --- a/tags/tags.cpp +++ b/tags/tags.cpp @@ -849,11 +849,7 @@ static bool writeVorbisCommentTags(TagLib::Ogg::XiphComment *tag, const Song &fr } if (!img.isEmpty()) { - #if QT_VERSION < 0x050000 - tag->addField("COVERART", qString2TString(QString::fromAscii(img.toBase64()))); - #else tag->addField("COVERART", qString2TString(QString::fromLatin1(img.toBase64()))); - #endif changed=true; } diff --git a/widgets/actionitemdelegate.cpp b/widgets/actionitemdelegate.cpp index 6771e0d16..a9a043ab7 100644 --- a/widgets/actionitemdelegate.cpp +++ b/widgets/actionitemdelegate.cpp @@ -148,11 +148,7 @@ void ActionItemDelegate::drawIcons(QPainter *painter, const QRect &r, bool mouse foreach (const QPointer &a, actions) { QPixmap pix=a->icon().pixmap(QSize(iconSize, iconSize)); - #if QT_VERSION >= 0x050100 QSize pixSize = pix.isNull() ? QSize(0, 0) : (pix.size() / pix.devicePixelRatio()); - #else - QSize pixSize = pix.size(); - #endif if (!pix.isNull() && actionRect.width()>=pixSize.width()/* && r.x()>=0 && r.y()>=0*/) { drawBgnd(painter, actionRect, lightBgnd); diff --git a/widgets/basicitemdelegate.cpp b/widgets/basicitemdelegate.cpp index 8e775286a..9bc2ac001 100644 --- a/widgets/basicitemdelegate.cpp +++ b/widgets/basicitemdelegate.cpp @@ -24,7 +24,7 @@ #include "basicitemdelegate.h" #include "support/gtkstyle.h" #include "support/utils.h" -#include "support/styleoption.h" +#include #include #include #include @@ -95,7 +95,7 @@ void BasicItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt bool active=option.state&QStyle::State_Active; if (GtkStyle::isActive()) { bool mouseOver=option.state&QStyle::State_MouseOver; - StyleOptionViewItem opt = option; + QStyleOptionViewItem opt = option; initStyleOption(&opt, index); if (trackMouse && !underMouse) { @@ -121,18 +121,18 @@ void BasicItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt QColor col(option.palette.color(active ? QPalette::Active : QPalette::Inactive, selected ? QPalette::HighlightedText : QPalette::Text)); - switch (((StyleOptionViewItem &)option).viewItemPosition) { - case StyleOptionViewItem::Beginning: + switch (((QStyleOptionViewItem &)option).viewItemPosition) { + case QStyleOptionViewItem::Beginning: drawLine(painter, option.rect, col, true, false); break; - case StyleOptionViewItem::Middle: + case QStyleOptionViewItem::Middle: drawLine(painter, option.rect, col, false, false); break; - case StyleOptionViewItem::End: + case QStyleOptionViewItem::End: drawLine(painter, option.rect, col, false, true); break; - case StyleOptionViewItem::Invalid: - case StyleOptionViewItem::OnlyOne: + case QStyleOptionViewItem::Invalid: + case QStyleOptionViewItem::OnlyOne: drawLine(painter, option.rect, col, true, true); } } diff --git a/widgets/coverwidget.cpp b/widgets/coverwidget.cpp index eecf63787..a111b51d8 100644 --- a/widgets/coverwidget.cpp +++ b/widgets/coverwidget.cpp @@ -110,11 +110,7 @@ public: return; } QPainter p(this); - #if QT_VERSION >= 0x050100 QSize layoutSize = pix.size() / pix.devicePixelRatio(); - #else - QSize layoutSize = pix.size(); - #endif QRect r((width()-layoutSize.width())/2, (height()-layoutSize.height())/2, layoutSize.width(), layoutSize.height()); p.drawPixmap(r, pix); if (underMouse()) { @@ -139,22 +135,16 @@ public: if (style()->pixelMetric(QStyle::PM_ToolBarFrameWidth)==0) { size-=constBorder*2; } - #if QT_VERSION >= 0x050100 double pixRatio=1.0; if (Settings::self()->retinaSupport()) { pixRatio=qApp->devicePixelRatio(); size*=pixRatio; } - #endif img=img.scaled(size, size, Qt::KeepAspectRatio, Qt::SmoothTransformation); - #if QT_VERSION >= 0x050100 img.setDevicePixelRatio(pixRatio); - #endif if (pix.isNull() || pix.size()!=img.size()) { pix=QPixmap(img.size()); - #if QT_VERSION >= 0x050100 pix.setDevicePixelRatio(pixRatio); - #endif } pix.fill(Qt::transparent); QPainter painter(&pix); diff --git a/widgets/groupedview.cpp b/widgets/groupedview.cpp index 3cbafd6eb..b6f4eaf5c 100644 --- a/widgets/groupedview.cpp +++ b/widgets/groupedview.cpp @@ -373,21 +373,13 @@ public: pix=cover ? *cover : (stream && !song.isCdda() ? Icons::self()->streamIcon : Icons::self()->albumIcon(constCoverSize)).pixmap(constCoverSize, constCoverSize); } - #if QT_VERSION >= 0x050100 int maxSize=constCoverSize*pix.devicePixelRatio(); - #else - int maxSize=constCoverSize; - #endif if (pix.width()>maxSize) { pix=pix.scaled(maxSize, maxSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); } - #if QT_VERSION >= 0x050100 QSize pixSize = pix.isNull() ? QSize(0, 0) : (pix.size() / pix.devicePixelRatio()); - #else - QSize pixSize = pix.size(); - #endif if (rtl) { painter->drawPixmap(r.x()+r.width()-(pixSize.width()-constBorder), r.y()+((r.height()-pixSize.height())/2), pixSize.width(), pixSize.height(), pix); diff --git a/widgets/itemview.cpp b/widgets/itemview.cpp index 2587617be..c134b4519 100644 --- a/widgets/itemview.cpp +++ b/widgets/itemview.cpp @@ -41,7 +41,7 @@ #include "support/actioncollection.h" #include "support/configuration.h" #include "support/flattoolbutton.h" -#include "support/styleoption.h" +#include #include #include #include @@ -182,7 +182,7 @@ public: bool active=option.state&QStyle::State_Active; bool drawBgnd=true; bool iconMode = view && QListView::IconMode==view->viewMode(); - StyleOptionViewItem opt(option); + QStyleOptionViewItem opt(option); opt.showDecorationSelected=true; if (!underMouse) { @@ -265,11 +265,7 @@ public: r.adjust(constBorder, 0, -constBorder, 0); } if (!pix.isNull()) { - #if QT_VERSION >= 0x050100 QSize layoutSize = pix.size() / pix.devicePixelRatio(); - #else - QSize layoutSize = pix.size(); - #endif int adjust=qMax(layoutSize.width(), layoutSize.height()); if (AP_VTop==actionPos) { int xpos=r.x()+((r.width()-layoutSize.width())/2); @@ -471,11 +467,7 @@ public: } if (!pix.isNull()) { - #if QT_VERSION >= 0x050100 QSize layoutSize = pix.size() / pix.devicePixelRatio(); - #else - QSize layoutSize = pix.size(); - #endif int adjust=qMax(layoutSize.width(), layoutSize.height()); if (rtl) { painter->drawPixmap(r.x()+r.width()-layoutSize.width(), r.y()+((r.height()-layoutSize.height())/2), layoutSize.width(), layoutSize.height(), pix); diff --git a/widgets/ratingwidget.cpp b/widgets/ratingwidget.cpp index 56337cf22..b6d3b390f 100644 --- a/widgets/ratingwidget.cpp +++ b/widgets/ratingwidget.cpp @@ -40,9 +40,7 @@ RatingPainter::RatingPainter(int s) , pixmapSize((starSz*constNumStars)+(constBorder*(constNumStars-1)), starSz) , col(QApplication::palette().text().color()) { - #if QT_VERSION >= 0x050100 pixelRatio=Icon("dialog-ok").pixmap(16, 16).devicePixelRatio(); - #endif } void RatingPainter::paint(QPainter *p, const QRect &r, int rating) @@ -51,11 +49,9 @@ void RatingPainter::paint(QPainter *p, const QRect &r, int rating) return; } - #if QT_VERSION >= 0x050100 if (!isNull() && !Utils::equal(pixelRatio, pixmaps[0].devicePixelRatio())) { pixmaps[0]=QPixmap(); } - #endif if (isNull()) { QSvgRenderer renderer; @@ -66,19 +62,13 @@ void RatingPainter::paint(QPainter *p, const QRect &r, int rating) } if (!bytes.isEmpty()) { bytes.replace("#000", col.name().toLatin1()); - #if QT_VERSION >= 0x050100 if (pixelRatio>1.25) { bytes.replace("stroke-width=\"3\"", "stroke-width=\"6\""); } - #endif } renderer.load(bytes); - #if QT_VERSION >= 0x050100 int pixSize=starSz*pixelRatio; - #else - int pixSize=starSz; - #endif for (int p=0; p<2; ++p) { pixmaps[p]=QPixmap(pixSize, pixSize); @@ -92,21 +82,15 @@ void RatingPainter::paint(QPainter *p, const QRect &r, int rating) int halfSz=(pixSize/2.0)+0.5; painter.drawPixmap(0, 0, pixmaps[1], 0, 0, halfSz, pixSize); painter.drawPixmap(halfSz, 0, pixmaps[0], halfSz, 0, pixSize-halfSz, pixSize); - #if QT_VERSION >= 0x050100 painter.end(); for (int p=0; p<3; ++p) { pixmaps[p].setDevicePixelRatio(pixelRatio); } - #endif } int fullStars=rating/Song::Rating_Step; bool half=allowHalfStars && rating%Song::Rating_Step; - #if QT_VERSION >= 0x050100 QSize layoutSize = pixmaps[0].size() / pixmaps[0].devicePixelRatio(); - #else - QSize layoutSize = pixmaps[0].size(); - #endif QRect pr(r.x(), r.y()+(r.height()-layoutSize.width())/2, layoutSize.width(), layoutSize.height()); for (int i=0; i= 0x050100 double pixelRatio; - #endif }; class RatingWidget : public QWidget diff --git a/widgets/tableview.cpp b/widgets/tableview.cpp index b1d485523..be0afe3fc 100644 --- a/widgets/tableview.cpp +++ b/widgets/tableview.cpp @@ -27,13 +27,13 @@ #include "ratingwidget.h" #include "support/localize.h" #include "support/configuration.h" -#include "support/styleoption.h" #include "models/roles.h" #include "mpd-interface/song.h" #include #include #include #include +#include class TableViewItemDelegate : public BasicItemDelegate { @@ -46,8 +46,8 @@ public: return; } - StyleOptionViewItem v4((StyleOptionViewItem &)option); - if (StyleOptionViewItem::Beginning==v4.viewItemPosition) { + QStyleOptionViewItem v4((QStyleOptionViewItem &)option); + if (QStyleOptionViewItem::Beginning==v4.viewItemPosition) { v4.icon=index.data(Cantata::Role_Decoration).value(); if (!v4.icon.isNull()) { v4.features |= QStyleOptionViewItemV2::HasDecoration; @@ -137,11 +137,7 @@ void TableView::initHeader() initiallyHidden.append(i); } } - #if QT_VERSION >= 0x050000 hdr->setSectionsMovable(true); - #else - hdr->setMovable(true); - #endif connect(hdr, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showMenu(QPoint))); } diff --git a/widgets/toolbutton.cpp b/widgets/toolbutton.cpp index 03aa8dd49..ab1d97d77 100644 --- a/widgets/toolbutton.cpp +++ b/widgets/toolbutton.cpp @@ -75,7 +75,6 @@ void ToolButton::paintEvent(QPaintEvent *e) } } #endif - #if QT_VERSION > 0x050000 || defined UNITY_MENU_HACK Q_UNUSED(e) // Hack to work-around Qt5 sometimes leaving toolbutton in 'raised' state. QStylePainter p(this); @@ -94,17 +93,6 @@ void ToolButton::paintEvent(QPaintEvent *e) } #endif p.drawComplexControl(QStyle::CC_ToolButton, opt); - #else // QT_VERSION > 0x050000 || defined UNITY_MENU_HACK - if (menu() && hideMenuIndicator) { - QStylePainter p(this); - QStyleOptionToolButton opt; - initStyleOption(&opt); - opt.features=QStyleOptionToolButton::None; - p.drawComplexControl(QStyle::CC_ToolButton, opt); - } else { - QToolButton::paintEvent(e); - } - #endif } QSize ToolButton::sizeHint() const