pax_global_header00006660000000000000000000000064134633216720014521gustar00rootroot0000000000000052 comment=1b8b802efe76d66355beadf3fc167a4b3cbdffbd tea-qt-47.1.0/000077500000000000000000000000001346332167200130055ustar00rootroot00000000000000tea-qt-47.1.0/.gitignore000066400000000000000000000014271346332167200150010ustar00rootroot00000000000000# based on https://github.com/github/gitignore/blob/master/C%2B%2B.gitignore # and https://github.com/github/gitignore/blob/master/Qt.gitignore # Prerequisites *.d # Compiled Object files *.slo *.lo *.o *.obj # Precompiled Headers *.gch *.pch # Compiled Dynamic libraries *.so *.dylib *.dll # Fortran module files *.mod *.smod # Compiled Static libraries *.lai *.la *.a *.lib # Executables *.exe *.out *.app # Qt-es object_script.*.Release object_script.*.Debug *_plugin_import.cpp /.qmake.cache /.qmake.stash *.pro.user *.pro.user.* *.qbs.user *.qbs.user.* *.moc moc_*.cpp moc_*.h qrc_*.cpp ui_*.h *.qmlc *.jsc Makefile* *build-* # Qt unit tests target_wrapper.* # QtCreator *.autosave # QtCreator Qml *.qmlproject.user *.qmlproject.user.* # QtCreator CMake CMakeLists.txt.user* tea-qt-47.1.0/AUTHORS000066400000000000000000000112341346332167200140560ustar00rootroot00000000000000Code and design: Peter Semiletov PHP hl module by Boo-boo. Code from other projects: Diego Iastrubni, Qxt Foundation, Trolltech ASA, Franz Schmid, Adam Rogoyski, Michael Protasov, Angius Fabrizio, Kostya Gancov. ZIP and Zlib stuff by: Zlib - (C) 1995-2005 Jean-loup Gailly and Mark Adler Zip/Unzip - (C) 1998-2005 Gilles Vollant QuaZIP - (C) 2005-2018 Sergey A. Tachenov single application module (one of two) - Berenger Bramas (http://berenger.eu/blog/c-qt-singleapplication-single-app-instance/) exif.h/cpp - public domain code from http://imonad.com (based on Exif Jpeg header manipulation tool http://www.sentex.net/~mwandel/jhead/) Some code snippets were taken from qtcentre programming forum. ## Translators: Russian UI translation and documentation: Peter Semiletov English documentation (the terrible one): Peter Semiletov German UI translation: Tobias Quathamer Frech UI translation: gholafox //GTK version localizations (unsupported in Qt-branch): Czech translation: Zbyněk Mrkvička French translation: Sylvain Cresto , Michèle Garoche Latvian translation: Andrejs Meinerts Spanish translation: Miguel Latorre German translation: Ruediger Arp Polish translation: Wit Wiliński Serbian translation: Dejan Čabrilo Japanese translation: UTUMI Hirosi Spanish documentation: Miguel Latorre Ukrainian translation: Peter Semiletov Previous ukrainian translators: Vlad Svetlichny, Rudyy 'black fire' Andriy, Oleg Matviychuk, Taras Jahnjuk ## Packages and ports: OpenBSD: Giovanni Bechis Debian: Tobias Quathamer . SUSE: Detlef Reichelt Mandriva: Funda Wang Crux: Ivan Rodionov Frugalware Linux: Priyank Gosalia //GTK branch Frugalware Linux: Priyank M. Gosalia Fink port: Michèle Garoche Crux port: acrux Darwin port: Ole Guldberg Jensen ALT Linux: Vitaly Lipatov Zenwalk: Paul Marwick Zenwalk (previous maintainers): Jean-Philippe Guillemin, Mike Verret, Fred Broders Ubuntu: Joao Pinto prev. Ubuntu packages: Chaigneau Vincent FreeBSD: Danfe Slackware: Yanmarshus Fresh Debian Package: Oisn Mac Fheara Debian: Lior Kaplan , Marco Rodrigues SUSE: Detlef Reichelt (was - Pascal Bleser) Arch Linux: Roman Kyrylych Mandriva Linux: Lenny Cartier Mandriva: Steffen Van Roosbroeck , MandrivaClub.NL Mandrake Linux SRC package: UTUMI Hirosi Mandrake Linux: Paul Smith Fedora: Michael Krylov Gentoo ebuild: Peter Weller old Gentoo ebuilds: Maciej Szumieluk, Serg, Miguel Latorre old packages for Slackware: Fred Broders, Anton Ivanov old Slax package: Ivan Andronov ## Acknowledgements: Thanks to (an incomplete and unsorted list): Ronald Fischer Vladimir Shatilo Сергей (post2) Elbert Pol Настя Глазуу z_hunter Товарищ У Анна Зубенко 6y_6y Niels Rasmussen Alexey Svetlichniy Alexander Natalenko Michèle Garoche Zhu Baoshi Michael Shigorin Dmitri Yurchenko Detlef Bloch Victor Soroka Shlomi Loubaton Aleksey Kirpichnikov Dmitry Shevchenko Dmitry Shurupov Oleg Bartunov Segiy Burachek Dmitri Yurchenko Paul Whalley Tom Veidt Lungu Sergey Maciej Szumieluk Sebastian Schlingmann Sergey Zhumatiy Mad Deer Jose Alexey Boyko Miguel Latorre Hetdegon Svetlana Semyonova Dmitriy K Geert Theys Meka[ni] Salvador Koutsomhtsos Alexey Dokuchaev Bart Alberti Peter Müller Peter Weller Victor Ananjevsky Sharon Kimble Giovanni Giovanzana Yanmarshus Oleg Matviychuk scp Oleksandr Natalenko Serkan Calis Jordan Mantha Sam Cater Yanmarshus Dmitriy Shilov Goran Mekić Dejan Čabrilo Giovanni Bechis Bill Gribble Smirftsch Steven Penny And of course, thanks for the inspiration to Group Image, Can, Nirvana, Scorn, The Pixies, Family, Frank Black, Bonzo Dog Doo Dah Band, Little Grey Girlfriend, Melt Banana, Tuxedomoon, Grajdanskaya Oborona, Guano Apes, Fall, Juno Reactor, Meathookseed, Broadcast, Napalm Death, NoMeansNo, Bach, Radiohead, Copout, Shaolin Wooden Men, Vladymir Vysotsky, Captain Beefheart and His Magic Band, coldwave projects, and demo-groups: Stravaganza, Haujobb, Conspiracy. tea-qt-47.1.0/CMakeLists.txt000066400000000000000000000102431346332167200155450ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.0) set (QT_MIN_VERSION "5.4.0") include_directories(${Qt5Widgets_INCLUDE_DIRS}) add_definitions(${Qt5Widgets_DEFINITIONS}) add_definitions(${Qt5Widgets_COMPILE_DEFINITIONS}) set(PROJECT "tea") project ($PROJECT VERSION 47.1.0) add_definitions(-DVERSION_NUMBER="\\"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}\\"") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") add_definitions(-DQ_OS_LINUX) add_definitions(-DQ_OS_UNIX) endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") find_package(PkgConfig REQUIRED) pkg_check_modules(hunspell hunspell) if(hunspell_FOUND) add_definitions(-DHUNSPELL_ENABLE) message("+ hunspell support") endif() find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Network Qml Quick) add_definitions(-DUSE_QML_STUFF) if(BUILD_TESTING) find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED) endif() qt5_add_resources(QT_RESOURCES resources.qrc) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") file(GLOB tea_SRCS "*.c" "*.cpp") file(GLOB tea_HEADERS "*.h") set(${PROJECT}_ICONPNG32 ./icons/32/${PROJECT}.png ) set(${PROJECT}_ICONPNG48 ./icons/48/${PROJECT}.png ) set(${PROJECT}_ICONPNG64 ./icons/64/${PROJECT}.png ) set(${PROJECT}_ICONPNG128 ./icons/128/${PROJECT}.png ) set(${PROJECT}_ICONSVG ./icons/svg/${PROJECT}.svg ) set(${PROJECT}_DESKTOP ./desktop/${PROJECT}.desktop ) add_custom_target(dist COMMAND git archive --prefix=${PROJECT}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}/ master | bzip2 >${PROJECT}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.tar.bz2 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} ) add_executable(${PROJECT} ${tea_SRCS} ${QT_RESOURCES}) find_package(Qt5PrintSupport) if (Qt5PrintSupport_FOUND) Message ("+ printer support") add_definitions(-DPRINTER_ENABLE) target_link_libraries(${PROJECT} Qt5::PrintSupport) endif() if (EXISTS "/usr/include/linux/joystick.h") message("+JOYSTICK_SUPPORTED") add_definitions(-DJOYSTICK_SUPPORTED) endif() find_path(ASPELL_INLCUDES aspell.h "/usr/include/" "/usr/local/" ) if(ASPELL_INLCUDES) add_definitions(-DASPELL_ENABLE) target_link_libraries(${PROJECT} libaspell.so) message("+ aspell support") endif() find_package(PkgConfig) pkg_check_modules(popplerqt5 poppler-qt5) if(popplerqt5_FOUND) add_definitions(-DPOPPLER_ENABLE) target_link_libraries(${PROJECT} ${popplerqt5_LIBRARIES}) include_directories(${popplerqt5_INCLUDE_DIRS}) message("+ poppler support") endif() find_package(PkgConfig) pkg_check_modules(ddjvuapi ddjvuapi) if(ddjvuapi_FOUND) add_definitions(-DDJVU_ENABLE) target_link_libraries(${PROJECT} ${ddjvuapi_LIBRARIES}) include_directories(${ddjvuapi_INCLUDE_DIRS}) message("+ djvuapi support") endif() if(UNIX OR MINGW) find_package(ZLIB REQUIRED) else(UNIX OR MINGW) set(ZLIB_INCLUDE_DIRS "${QT_ROOT}/src/3rdparty/zlib" CACHE STRING "Path to ZLIB headers of Qt") set(ZLIB_LIBRARIES "") if(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h") message("Please specify a valid zlib include dir") endif(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h") endif(UNIX OR MINGW) if (ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIRS} ) target_link_libraries(${PROJECT} ${ZLIB_LIBRARIES} ) endif( ZLIB_FOUND ) if(hunspell_FOUND) include_directories(${hunspell_INCLUDE_DIRS} ) target_link_libraries(${PROJECT} ${hunspell_LIBRARIES} ) endif() target_link_libraries(${PROJECT} Qt5::Widgets Qt5::Core Qt5::Network Qt5::Qml Qt5::Quick) install (TARGETS ${PROJECT} DESTINATION bin) install (FILES ${tea_ICONSVG} DESTINATION share/icons/hicolor/scalable/apps) install (FILES ${tea_ICONPNG32} DESTINATION share/icons/hicolor/32x32/apps) install (FILES ${tea_ICONPNG48} DESTINATION share/icons/hicolor/48x48/apps) install (FILES ${tea_ICONPNG64} DESTINATION share/icons/hicolor/64x64/apps) install (FILES ${tea_ICONPNG128} DESTINATION share/icons/hicolor/128x128/apps) install (FILES ${tea_DESKTOP} DESTINATION share/applications) tea-qt-47.1.0/COPYING000066400000000000000000001045131346332167200140440ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state 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 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . tea-qt-47.1.0/ChangeLog000066400000000000000000000604501346332167200145640ustar00rootroot00000000000000//it's lazy updated file, so the real ChangeLog is the activity on github * qt4 compilation fix * "search in files" results window close automatically with TEA * main windows destructor FIX //using deleteLater() * logmemo is scriptable again + Objective C support (hl, header/source switch) * Qt 4.x fix + "Nav - Toggle header/source" moved to IDE menu + --m TEA command line option to enable multiply instance mode + Prg menu:: Run program, Build program, Clean program + Tune :: Logmemo font settings + Profile saves logmemo and GUI font settings + meson/ninja build system support * quazip fixes + Tune::Common:: Syntax highlighting enabled - turn on/off syntax hl globally (useful for large documents on slow machines) 2018 jul 45.0.2 - BSD fix 45.0.1 - MacOS fix 2018 jan + recent list and bookmarks saves the word wrap 2017 nov * desktop/icons stuff fixes 2017 july - User loaded external fonts //causes segfault on Qt 5.6 * other fixes 2017 may * IMPORTANT changes for qmake pro file. The PREFIX for qmake now NOT CONTAINS "bin", i.e. by default was "usr/local/bin", but now is "/usr/local". TEA now installs tea.desktop file to $$PREFIX/share/applications, and tea binary to $$PREFIX/bin 2017 april + coords translation tool * single application mode megafix 2017 + basic block selections 2017 feb + cliptpl.txt to format clipboard pieces captured to the storage file + Fm - Multi-rename + Zero pad file names + Delete N first chars at file names + Replace in file names + Apply template 2016 sept - 43.1.0 * Fixes to the manuals * segfault (43.0.0 affected) on exit fixed * Russian translation update * some new options 2016 aug-sept //for more see github stats + Tune - Images - Use EXIF orientation at image viewer + Tune - Images - Apply hard rotation by EXIF data + new themes and palettes + new hls file format + optional libpoppler support (see README) for text extraction from PDF + optional DJVU text extractor + Tune - Interface - Cursor blink time (msecs), set to zero to turn blinking off + Tune - Interface - Cursor width * Tune pages are scrollable + Functions - Tools - Scale image * %fext, %ffilename, %fdir, %fbasename macros are %ext, %filename, %dir, %basename now + Search - Mark all found + Search - Unmark - Alt-S, Alt-E hardcoded + Tune::Common - Use Left Alt + WASD as additional cursor keys LALT + WASD = cursor movement LALT + E, C = page up/down LWIN and the same keys = select text + Functions - Repeat last * all hls updated to the new format + GIF animation support on the image preview + File - Do not add to recent + prefs UI redesign + Functions - Text - Compress //removes all whitespaces from selection + Functions - Sort - Flip a list with separator, Sort case sensitively, with separator * Instr menu renamed to Tools and moved into Functions + initial themed icons support 2016 summer + basic Markdown support + file path elements in command line to call external program * palettes fix * English manual fix by Dr. Tobias Quathamer. * other fixes 2016 + Functions - math - Sum by last column 2015/September *goto line function fixed 2015/July * qmake prefix option fixed * built-in calc fixes 2015/April - 41.0.0 + themes engine * many fixes 2015/feb + New icons set * source configuration options via qmake has been changed (see README) 2015/jan + Functions - Cells - Sort table by column ABC + Functions - Cells Swap cells + Functions - Cells - Delete by column + Functions - Cells - Copy by column[s] + Partial Eclipse themes support from http://eclipsecolorthemes.org/ (put them into tea Palettes directory) 2014/december + Sorting modes at File Manager * OS/2 building fixes * documentation fixes 2014/november + single instance application mode + new TEA icons + Search - From cursor (option, ON by default) + Tune - Common - Use Alt key to access main menu (option, default is OFF) * misc. fixes 2014/june-october + File - Notes + QML plugins support + items from Programs menu can be used with TEA's file manager (for the current file at the File manager) + code and docs cleanup + Tune - Common - Charset for file open from command line 2014/feb-march + Functions - Statistics - Words lengths + Programs from Run menu can be opened with "file at cursor". Use %i macro. For example: gimp %i Set cursor to filename at the text, then use Run - gimp 2014/jan + zip unpacker can work with multiply selected files 2013/nov * LaTeX support fixes * hardcoded keyboard shortcuts can be redefined 2013/sept-oct * 37.0.0 - many new functions and fixes 2013/sept * LaTeX hl fixed + Functions - Text - Double quotes to TeX quotes //work with "" 2013/aug * some 2013/july * "open at cursor" compatible with local id-labels + grey background of the tab widget to indicate that there is no any new files by default 2013/may-june + new syntax hl engine + full Qt5 support + CLANG support 2013/march + more natural line ending handling. + file manager mult. selection via INS 2013/february + "Wikitext" markup mode is changed to MediaWiki and DokuWiki modes. For the automatical mode switch use files with extensions "mediawiki" and "dokuwiki" 2013/january + new FB2 and ABW parsers + Hunspell on Win32 * all spellchecker stuff is fixed + more QT5 compatibility + @@snippetname as parameter to Functions - Text - Apply to each line 2012/12/24 + Qt 5 compatibility 2012/12/11 //33.3.4 2012/09/18 * File - Save timestamped version now has a different file name format: filename + date + time + ext instead of the old one: date + time + filename + ext 2012/08/28 + --p command lin option for portable mode ON * image converter/scaler fixed 2012/07/22 * Undo fix after "replace all" * built-in calculator now supports braces 2012/04/28 + Qt5 alpha compatibility * Win32/OS2: Aspell path selection from UI - fixed 2012/03/11 * UI styles switching fixed 2012/03/03 + Python hl //very ugly + moon calendar + much more 2012/01/13 + Edit - Set as storage file + Edit - Copy to storage file + Edit - Start/stop capture clipboard to storage file 2012/01/11 + Tune - Common - Documents tabs align + Tune - Common - UI tabs align 2012/01/04 + Calendar - Go to current date * almost all menus are tearable now 2011/12/31 * replacement tables now works also with seletect files //from the file manager * replace all - works with selected files in file manager mode * ODT reader - fixed 2011/12/24 * editor widget redraw optimizations 2011/12/17 * built-in calculator - unner resolution has been changed from float to double 2011/11/16 * fb2 charset support 2011/09/19 * 31.0.0 2011/08/31 * change profiles - fixed 2011/08/07 * 30.1.0 * new stuff etc. 2011/07/03 * zip library support cleanup * TEA can deal with urls from Chrome addr bar //fix 2011/07/02 * OS/2 fixes 2011/06/01 * xml syntax hl fixes + labels 2011/05/20 * more fixes 2011/04/25 + Markup - [X]HTML tools - Rename selected file + Perl hl fixes 2011/04/09 * drag and drop - fixed 100%!!! 2011/04/04 * drag and drop fixed 2011/04/01 * native file save/open dialogs were been disabled to gain the ability of modification 2011/03/09 + some new palettes 2011/03/06 * image processing speed-up * misc fixes and code cleanup 2010/10/15 - all screen-shooting stuff has been removed as buggy and UI non-friendly 2010/07/28 * tabulation width has been fixed * documentation has been updated 2010/07/10 + French UI translation by gholafox 2010/06/24 * drag'n'drop files to TEA - the charset from the file manager's charset list is used * HTML/XML commenting is fixed //28.0.0 2010/05/14 * search backwards - fixed 2010/05/12 + Functions - Images - Save image from clipboard to file 2010/05/06 + task-oriented main menu + Calendar menu //visible when the todo panel is active + Calendar - Add or subtract - years/months/days use the negative value to represent N-days before the selected date + Calendar - Days between two dates 2010/05/05 * all files at TEA config directory will be saved automatically on closing * files from the TEA config directory are not adding to the recent files list + main ui - "todo" panel + Tune - Common - Start week on Sunday * editor area and logmemo manual resizing - fixed + Tune - Images page. All image-related options weve moved here 2010/05/02 + Functions - Images - Capture desktop 2010/04/30 + Functions - Images - Show image from clipboard + Functions - Images - Capture active window + Tune - Images - Screen capture delay, seconds 2010/04/25 + Edit - Comment selection 2010/04/18 + Fman panel - "?" button //the Magical charset guesser button 2010/04/16 * more fman fixes 2010/04/11 //27.1.0 2010/04/04 * drag from the fman fix 2010/04/02 * The Manuals have been updated * Edit- Copy now copies text from the manual, if the Learn tab is active 2010/03/31 //27.0.2 + File - File actions - Set UNIX end of line + File - File actions - Set Windows end of line + File - File actions - Set traditional Mac end of line * Fm - File information - Full info //now detects the end of line of the selected file 2010/03/23 //27.0.1 * Web-gallery tool fixed 2010/02/28 * Morse encoder can handle the lower case text * a few Russian manual fixes 2010/02/25 //27.0.0 + Fm - Select by regexp + Fm - Deselect by regexp for example, to select all *.txt-files, put the following regexps into the FIF:".*\.txt$" (without quotes!) then, use Select by regexp. Then you can press Open button to open all selected files + Fm - File info - Count lines in selected files //select some files, then use this function 2010/02/24 + when launching a program from TEA, the output goes into Logmemo 2010/02/19 * new brackets hl code //from qwriter + app.version() - script func., returns the TEA version 2010/02/15 + View - Profiles + View - Save profile 2010/02/11 + Search - Find in files 2010/02/06 + German UI translation by Tobias Quathamer 2010/02/05 * Win32 version uses ini-file config instead of Registry 2010/02/04 + app.call_menuitem (item_name) function is available from QtScript/JS script you can activate any TEA's menu item by its caption. For example: fif.setText ("hello~hallo"); app.call_menuitem ("Replace all"); please note that the menu item name is a localized version, i.e. call the translated menu item, if the translation is exists 2010/01/25 + line numbers area //based on qwriter code 2010/01/23 //26.2.2 * xml/html, clike hl modules fixed + new FIF - the editable combobox instead of the old line edit 2010/01/22 * old FIF autocompletion mode is coming back 2010/01/07 * XML/HTML syntax hl improvements 2010/01/04 //26.2.0 * some fixes to make TEA GCC4x compatible * other fixes 2009/12/27 + Edit - Indent by first line 2009/12/22 + Fman - Images - Create web gallery * "Fman - Image conversion" has been renamed to "Images" + "Tune - Functions - Web gallery options" section * Tune page UI improvemets 2009/12/16 + new FIF autocompletion UI 2009/12/07 //26.1.0 2009/12/04 + LilyPond basic hl + NASM hl * TEA now loads the last selected palette. And old mechanism via "def_palette" file now is obsolete. To tweak the palette, create the own one. 2009/11/14 + Functions - Filter - Remove before delimiter at each line + Functions - Filter - Remove after delimiter at each line 2009/11/06 + "margin_color" color name for palette files. If no margin_color is defined, TEA takes the text color as one. + Bash script hl module 2009/10/20 * syntax hl inner changes. Strikeout and underline font style parameteres has been added 2009/10/17 * syntax hl engine fixes 2009/09/31 -- 26.0.0 + Functions - Remove from dictionary //This function is Hunspell-only. An updated dictionary will be loaded after the next session. + Vala syntax hl module * hl engine fixes (now keywords are bold only with "fontstyle=bold" attribute at the hl file) * "replace all" function now can be case-insensetive * misc documentation fixes and additions 2009/09/26 + Lua syntax hl module + Perl syntax hl module 2009/09/21 + "File - Edit bookmarks" menu * "Add to bookmarks" has been moved to "Edit bookmarks" + File - Edit bookmarks - Find obsolete paths //all obsolete bookmarks will be prefixed with # * dynamic menu items those started from # are not visible anymore, so you can comment out any line at the list-like config file such as external programs list, etc. + qmake options: USE_ASPELL=true/false //true by default USE_HUNSPELL=true/false //true by default example to disable Hunspell, but with the Aspell supported: qmake USE_HUNSPELL=false to disable just Aspell: qmake USE_ASPELL=false to disable both: qmake USE_HUNSPELL=false USE_ASPELL=false to enable all: qmake 2009/09/20 + Tune::Functions - Hunspell dictionaries directory + Tune::Functions - Spell checker engine 2009/09/15 + qmake PREFIX=path works fine 2009/08/12 + Search - Replace all in opened files 2009/08/11 * document tabs are movable 2009/08/10 //25.1.0 2009/08/06 + Tune::Interface - "Cursor center on scroll" option //can be buggy * very cool fixes 2009/08/05 * MRU list fixes + Margin options at the Tune::Interface page 2009/07/25 //25.0.0 2009/07/10 + --charset=codepage command line option is re-implemented 2009/07/07 + new KWD and DOCX format readers 2009/07/02 + new ODT format reader 2009/07/01 + FIF can search in the File manager //case-insensetive, with MatchStartsWith option * spell checker progress shows correctly 2009/06/01 * all dynamic menus can be teared off * Lout IncludeGraphic support on Insert image 2009/05/28 + Functions - Math - Binary to decimal //works with unsigned int binary numbers only + Search - Regexp mode //affect the searching, tables + more UI tweaks for smalls-screen devices * all options from UI::Tune::Rare moved to UI::Tune::Common * "Tab width in spaces" option moved to UI::Tune::Interface * fixes at the tables engine 2009/05/27 //23.7.0 * main window can be resized to any size //useful for EEE PC 701 users 2009/05/26 + Functions - Tables 2009/05/24 //23.6.0 * win32: Templates and snippets were been fixed 2009/05/23 + Functions - Math - Decimal to binary //use with decimal representation + Functions - Math - Flip bits (bitwise complement) //use with binary representation 2009/05/21 + Markup - HTML tools - Strip HTML tags 2009/05/16 + "+" and "-" keys scales image at the image viewer + drag from the TEA's file manager to outside 2009/04/16 * some file manager improvenents 2009/04/04 + View - Highlighting mode menu to set the hl-mode manually + File manager::places - configs item //to speed-up access to TEA config files + Markup - Mode - Lout 2009/04/03 + FIF works to search at the Tune/Keyboard/Shortcuts list + Lout syntax HL (if the file has the extension "lout" - foobar.lout) 2009/04/01 * Tune window fixes 2009/03/25 + PHP syntax hl - made by Boo-boo 2009/03/24 //23.3.0 + D syntax hl + "Fm - File information - Full info" can read WAV file properties and calculate the RMS. RMS is calculated for 16 bit PCM files only. 2009/03/10 + Enter key work at the file name entry at the file manager. If user used Open file, Enter key acts to open file, if the "Save as" is used, Enter acts like fileman's "Save as" button 2009/03/07 //23.2.0 + FB2 format read-only support (via the inner ABW tio module) * file manager fixes 2009/03/06 * string list functions fixes * OOP design fixes, tea binary site has been reduced by ~10 kbytes * resourses cleanup 2009/03/05 + Functions - Sort - Sort case insensitively 2009/03/03 //23.1.1 * indent/unindent fixed + Verilog hl + Tune - Rare - Use wrap setting from highlighting module + some focusing fixes for the file manager 2009/02/28 //23.1.0 + Edit - Indent + Edit - Un-indent 2009/02/27 + Tune - Rare page * "Use traditional File Save/Open dialogs" and "Override locale" options have been moved to the Rare page * templates - fixed * LaTeX markup mode small fixes 2009/02/26 + tab - indent the selected block by space or tab + shift-tab - unindent by the one space or tab //depending of "Use spaces instead of tabs" options - zip code:: crypt.h //because TEA doesn't support passworded ZIP-files 2009/02/23 + Tune - Common - Automatic indent + Tune - Common - Use spaces instead of tabs + Tune - Functions - Tab width in spaces + Tab key at the editor indents selection (if some text is selected) 2009/02/22 + image viewer::rotate by [ and ] keys 2009/02/16 * Morse code table fixed + image viewer (not a automatic previewer) can handle Space, PageUp/Down, Home and End keys to navigate through the images in the current directory * statistics::line count for the selected text - fixed 2009/02/12 * for "Automatic preview images" TEA reads the thumbnails from the .thumbnails directory //*nix only 2009/02/11 + Tune - Common - Automatic preview images at file manager //off by default + Fm - Preview image //for the current selected at the file manager * "File - Open at cursor" works in a same way when the file manager is focused 2009/02/09 //23.0.0 + BASIC syntax hl + new logo at the About window + LaTeX syntax hl 2009/02/07 + Fm - ZIP - Create new ZIP + Fm - ZIP - Add to ZIP + Fm - ZIP - Save ZIP 2009/02/05 + SLA (Scribus) format //read only 2009/02/04 + Functions - Text - Escape regexp + weak RTF support //read only 2009/02/03 + input box for Save session //instead of file name in FIF 2009/02/02 + ODT, SXW (old OOo format), KWD (old KWord format), ABW (AbiWord), DOCX documents //read only 2009/01/26 + Fman - Image conversion - Scale by side + Fman - Image conversion - Scale by percentages //1. put the val into the FIF 2. select images 3. apply the function * Fortran hl fixes + Tune - Functions - Image conversion output format + Tune - Functions - Scale images with bilinear filtering + Tune - Functions - Output images quality //mainly for JPEG. Use -1 for default settings, otherwise 0..100 + Tune - Functions - Zip directory with processed images 2009/01/21 //22.3.0 + Initial Fortran syntax hl. The fortran.xml is based on Fortran 90 spec + C# syntax hl 2009/01/20 + Functions - Text - Remove trailing spaces //on the each line 2009/01/20 //22.2.1 * Aplly to each line - fixed 2009/01/17 //22.2.0 + Snippets, Scripts, Sessions and Templates now can hold submenus - Qt version checking in src.pro is removed (it never worked fine on some distros) 2009/01/14 * Search options are saving now * Image viewer hides itself when the file manager lost a focus + Autocompletion for the FIF 2009/01/11 //22.1.0 * MD5 checksum evaluation - fixed 2009/01/10 * paired braces hl - fixed 2009/01/09 * Toggle header/source - fixed + Functions - Analyze - Count the substring (regexp) + Functions - Analyze - Count the substring //the "Search - Case sensitive" is used as an option //Use the FIF to define a substring. 2009/01/07 * text to html - fixed * several memory leaks - fixed * markup engine inner changes 2009/01/02 //22.0.1 * shortcuts bug - fixed * "keys" file is renamed to "shortcuts", so all your previous hotkeys were lost assign them again! * "famous input field" is used instead of FEF :) 2009/01/02 * shortcuts engine - fixed * the "fte" script object is renamed to "fef" according to the FTE > FEF renaming 2008/12/31 + File manager :: backspace navigates the fman to the directory at the upper level - old image viewer * syntax hl engine can be case insensetive 2008/12/29 + Seed7 syntax hl + much better C/C++ hl 2008/12/27 + Search - Whole words option + Search - Case sensitive 2008/12/25 * the "setup" tab has been renamed to "tune" * "replace all" - fixed 2008/12/22 + Functions - Analyze - UNITAZ quantity sorting + Functions - Analyze - UNITAZ sorting alphabet - Functions - Analyze - UNITAZ * Ctrl-F can be assigned twise - for Search and for the Focus the Famous entry field. Please remove the first assignment manually to make the second one working properly 2008/12/21 //21.1.3 * some UNITAZ fixes and improvements 2008/12/20 //21.1.2 + Functions - Analyze - UNITAZ 2008/12/19 * c/c++ hl fixed 2008/12/17 //21.1.1 * hl fixes * Pascal hl file fixed 2008/12/16 //21.1.0 * "Functions - Statistics" is renamed to Analyze * Extraction - Exract words is moved to Analyze - Extraction submenu - Single application mode 2008/12/15 * misc inner changes * single_application engine is updated to 1.0 2008/12/10 //21.0.5 + File - File actions - Reload //i.e. revert to saved + File - File actions - Reload with encoding //use double click to reload current document with the selected charset 2008/12/08 //21.0.4 * Pascal hl fixed * some other bug fixes 2008/11/29 //21.0.3 * spellchecker is fixed!!! + progressbar for the spellchecker 2008/11/27 //21.0.2 * src.pro: QT version checking is disabled due to some reasons * the inner changes to improve the loading speed 2008/11/24 * IDE switched to QDevelop ;) * Ctrl-F is now assigned for Focus the Famous text entry * some bugs were fixed 2008/11/19 - 21.0.0 2008/11/14 + Fm - File information - MD5 checksum + Fm - File information - MD4 checksum + Fm - File information - SHA1 checksum 2008/11/12 + new file manager + menu Fm + Fm - File operations - Create new directory + Fm - File operations - Rename + Fm - File operations - Delete file * the < and > buttons of the Famous text entry is working + Famous text entry is the search field for the Manual browser - Manual browser own search entry 2008/10/24 * QTextEdit is replaced by QTextEdit to improve large files editing + Java Script as built-in macro-language //see the Manual 2008/10/09 + new manual browser 2008/10/01 + Java 3.0 syntax highlighting + Pascal syntax highlighting (Turbo/Borland Pascal, Object Pascal, Free Pascal) + new highlighting engine + View - Palettes 2008/09/24 + Markup - [X]HTML Tools - Preview selected color //the color can be in the form of the hex value or the named color (darkBlue, red, white, etc) * Last opened file is renamed to Last closed file 2008/09/08 * "Additional highlighting" is renamed to "Highlight current line" + "Highlight paired brackets" option 2008/09/03 //19.1.1 * Apply to each line - fixed 2008/09/01 //19.1.0 - good 2008/08/29 + Statistics::author's sheets + File - Sessions + File - Save different - Save session + Prefs::Restore the last session on start-up 2008/08/18 + View - Stay on top 2008/08/15 + Qt version detection on the qmake stage + Functions - Math - Enumerate Enumerates lines from the selected text. Params = Famous text entry. Syntax: step~zero_padding~prefix Examples: "1~1~) " //without quotes "1~3~ " "10" "10~5" 2008/08/04 //19.0.5 * norv.wood theme bug is fixed 2008/08/04 //19.0.4 * spellchecker words parser is fixed 2008/08/04 //19.0.3 * more fixes 2008/08/04 //19.0.2 * some file manager fixes 2008/08/04 //19.0.1 + Preferences - Override locale option //to redefine the program's locale, use the two-letters code: en, ru, uk, etc. + Single instance mode for Windows 2008/08/01 //19.0.0 2008/07/30 + Functions - Text - Quotes to facing quotes 2008/07/28 + Dialogs remembers their sizes * SingleApplication library copy is relicensed to GPL (from LGPL) for an accordance of the main program license. see LGPL, section 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". 2008/07/25 + UNIX: File manager + UNIX: single-instance mode * UNIX: "Insert image" calls the file manager page + UNIX: Preferences - Use traditional File save/open dialogs - TEAVisor 2008/07/18 * fixed: restore the positions of toolbars 2008/07/17 + NorwegianWood UI style //from QT demo 2008/07/16 //18.1.1 * templates/snippets/scripts shortcuts at File Save/Open dialogs are working by default. The reason of a non-working state: when the hidden files visibility of off, those shortcurs are not working 2008/07/16 //18.1.0 * obscure "QObject: Do not delete object, 'unnamed', during its event handler" is fixed 2008/07/15 + Qt 4.4 is minimum requirement * fixed: open file from the command line with a full path as the parameter 2008/07/14 - 18.0.3 + Qt 4.4 compatibility. TEA doesn't crushes on start anymore * more fixes 2008/07/12 * antispam e-mail - fixed 2008/07/11 + Scripts support //compatible with TEA-GTK * some fixes 2008/07/08 * "Highlight current line" option is changed to "Additional highlighting" + with Additional highlighting enabled, TEA highlights the current line and pair brackers 2008/04/12 - initial release tea-qt-47.1.0/INSTALL000066400000000000000000000000161346332167200140330ustar00rootroot00000000000000See the READMEtea-qt-47.1.0/NEWS000066400000000000000000000006621346332167200135100ustar00rootroot00000000000000=====NEWS ABOUT TEA==== TEA 47.1.0, may 04, 2019 --------------------------------------- http://semiletov.org/tea - official size #1 http://tea.ourproject.org - official size #1 https://github.com/psemiletov/tea-qt - development https://vk.com/teaeditor - VK-community https://www.facebook.com/groups/766324686841748/ - FB-community --------------------------------------- Bug fixes for good. Stay tuned. Peter Semiletovtea-qt-47.1.0/NEWS-RU000066400000000000000000000011061346332167200140260ustar00rootroot00000000000000====НОВОСТИ ПРО ТИА==== ТИА 47.1.0, 4 мая 2019 --------------------------------------- http://semiletov.org/tea - офсайт http://tea.ourproject.org - второй офсайт https://github.com/psemiletov/tea-qt - свежак https://vk.com/teaeditor - сообщество TEA https://www.facebook.com/groups/766324686841748/ - FB-сообщество --------------------------------------- Буду краток - исправления ошибок. С кирпичным пролетарским приветом, Петр Семилетов!tea-qt-47.1.0/README000066400000000000000000000117261346332167200136740ustar00rootroot00000000000000===TEA=== Home sites > http://semiletov.org/tea http://tea.ourproject.org Development > https://github.com/psemiletov/tea-qt Communities > https://vk.com/teaeditor https://www.facebook.com/groups/766324686841748/ ===INTRO=== TEA is a text editor with the hundreds of features. ===INSTALLATION FROM THE SOURCE=== You can install TEA from the source by 4 ways, using build systems qmake/make, meson/ninja, cmake/make, cmake/ninja. But first, you need to install some development libraries. Mandatory: Qt 4 or 5 zlib Optional: libaspell (for spell checking engine) libhunspell (for spell checking engine) poppler-qt5 (to read the text from PDF) ddjvuap (to read the text from DJVU) Note for FreeBSD users: you need the pkgconf package - pkg install pkgconf If you want to build and install TEA with cmake + make, run at the source dir: mkdir b cd b cmake .. make make install (as root or with sudo) To build and install TEA with cmake/ninja and GCC, do: mkdir b cd b cmake -GNinja .. ninja ninja install To build and install TEA with meson/ninja and GCC, do: mkdir b meson --buildtype=release b cd b ninja ninja install To build and install TEA with meson/ninja and CLANG, do: mkdir b CC=clang CXX=clang++ meson --buildtype=release b cd b ninja ninja install With qmake it is even more simplier: qmake make make install (as root or with sudo) To make some source configuration (with qmake), use CONFIG variable at qmake command line parameter. For example: qmake "CONFIG+=useclang" "CONFIG+=noaspell" You can use some values: nosingleapp - do not build TEA with the single application mode support nodesktop - do not install desktop files and icons useclang - TEA will be compiled with Clang. noaspell - disable the Aspell (if you have it installed, but do not want to compile TEA with Aspell support) nohunspell - disable Hunspell for TEA. usepoppler - use libpoppler-qt5 or qt4 for PDF text layer import. DISABLED by default usedjvu - use libdjvulibre to read DJVU files text (read only). DISABLED by default noprinter - disable printing support Notes: 1. If you have installed both Qt4 and Qt5, use the qmake from Qt4 or Qt5 to configure TEA with exact version of QT. The common solution is to make symlink to qmake from Qt5 and name it qmake5, then use qmake5 instead of the usual qmake. 2. If the context menus in TEA are not localized, install the qttranslations package from your distro's repository. 3. With cmake, there are no way to disable some TEA features manually - they will be compiled if TEA found the libs those needed. /* Basic snippet for Ubuntu users (Qt5 build) - run this from Terminal at the TEA source directory (unpacked): sudo apt-get install g++ pkg-config sudo apt-get install zlib1g-dev libaspell-dev libhunspell-dev sudo apt-get install qt5-default qttools5-dev-tools sudo apt-get install libqt5qml5 libqt5quick5 qtdeclarative5-dev qmake make sudo make install Snippet for Ubuntu users (Qt4 build): sudo apt-get install g++ pkg-config sudo apt-get install zlib1g-dev libaspell-dev libhunspell-dev sudo apt-get install libqt4-dev qt4-dev-tools qmake make sudo make install */ ===NOTE FOR PACKAGE MAINTAINERS=== 1. TEA after the compilation is a single binary file (with embedded resources). 2. For the qmake build, to override the default installation path (/usr/local, with binary at /usr/local/bin) use: qmake PREFIX=your_path make make install 3. cmake vs qmake vs meson. TEA's qmake project file is rather old and obscure, but it will be supported forever because it works well with Qt 4 and Qt 5. Use of meson or cmake build system is a modern way to build TEA. I use meson internally, but TEA's cmake stuff more mature. ===NOTE FOR UBUNTU USERS=== User defined hotkeys may not work due to Qt5 and Unity global menu feature. To remove global menu support in Qt5 apps, do sudo apt-get autoremove appmenu-qt5 or, if you want to remove also GTK global menus, use: sudo apt-get autoremove appmenu-gtk appmenu-gtk3 appmenu-qt5 ===LICENSE NOTES=== TEA code is licensed under GPL V3 and, partially, as a Public Domain. TEA media (images, etc), manuals and translations are public domain. Note to contributors - please put your translations into the public domain or GPL. ===DONATE=== If you want to support TEA via donation, better give your support to the Ukrainian dog shelter Lyubas House - http://lyubas.pp.ua. There are lot of dogs with disabilities, and they need help more than TEA. To donate via PayPal, please see http://www.ukraineanimalrescue.org/#!lyubas-house/cxfj. Please specify "For Lyubas's House" in the comments of donation, because there are other projects uses that PayPal account. Ежели вы хотите как-то поддержать разработку TEA денежно, лучше поддержите киевский приют для собак Дом Любчика - http://lyubas.pp.ua. Любчик - это пёс на инвалидной коляске. У него много друзей, которым всегда нужна помощь. tea-qt-47.1.0/TODO000066400000000000000000000045201346332167200134760ustar00rootroot00000000000000cmake dist creates wrong tarball that cannot be build with meson JAMSpell support (https://github.com/bakwc/JamSpell ) при повторении последней функции, сендер-ту становится от пункта меню "повторить" избранное для ЗПВ если перенос строк выключен в настройках, то из меню Вид перенос строк не работает при переключении темы, иконки меняются только после перезагрузки TEA в hl-файлах, вместо расширений в заголовке использовать regexp file compare tmtheme support filesToolbar странно меняет размер иконки спеллчекер плохо работает с кавычками елочкой вставка картинки как base64? в сборке Qt5, шорткаты с Alt стали языко-зависимыми CSound, Ada, JS, gas, List hl массовая перекодировка выделенных файлов. окно ИЗ - В вытащить меню таблиц мультизамен в режим фприказчика, проверить обработку batch-обработка картинок: обрезка, масштабирование, поворот, зеркало? при закрытии календарной записи будет автоматический возврат на панель календаря autosave bookmarks? autocompletion broken local links checking Highlight all search results gradient colorization in palettes "entity to text" function autoscroll //useful for musicians or youtube bloggers. define the speed in bpm? numbers into words ctags support make max recent items user-modified units conversion unicode table window split document panel ANSI art support play the chords by name, i.e. select AmDm, then use something like "Play melody" chords to tabs, heh heh parse the compiler output, goto the error by clicking at logmemo 0-9 markers goto start/end of the code block PalmDOC (pdb) read-only support? http://wiki.mobileread.com/wiki/PalmDOC, http://www.hotpaw.com/rhn/palm/pdb.txt epub support gz file save? select code block планы: использовать libretta::CPainFile вместо QSettings tea-qt-47.1.0/calendar.cpp000066400000000000000000000200731346332167200152640ustar00rootroot00000000000000/* this code is Public Domain */ #include #include #include #include #include #include #include "utils.h" #include "calendar.h" inline int tropical_year (int year) { return 1 + (year % 19); } int moon_phase_leueshkanov (int year, int month, int day) { int L = tropical_year (year); int phase = L * 11 - 14 + day + month + 3; return phase % 30; } /* moon phase - based on Ben Daglish JavaScript code from based on http://www.ben-daglish.net/moon.shtml */ int moon_phase_trig2 (int year, int month, int day) { double n = floor (12.37 * (year - 1900 + ((1.0 * month - 0.5) / 12.0))); double RAD = 3.14159265 / 180.0; double t = n / 1236.85; double t2 = t * t; double as = 359.2242 + 29.105356 * n; double am = 306.0253 + 385.816918 * n + 0.010730 * t2; double xtra = 0.75933 + 1.53058868 * n + ((1.178e-4) - (1.55e-7) * t) * t2; xtra += (0.1734 - 3.93e-4 * t) * sin (RAD * as) - 0.4068 * sin (RAD * am); double i = (xtra > 0.0 ? floor (xtra) : ceil (xtra - 1.0)); QDate d (year, month, day); int j1 = d.toJulianDay(); int jd = (2415020 + 28 * n) + i; //return (j1 - jd + 30) % 30; int r = (j1 - jd + 30) % 30; if (r == 0) r = 30; return r; } /*This simply mods the difference between the date and a known new moon date (1970-01-07) by the length of the lunar period. For this reason, it is only valid from 1970 onwards.*/ int moon_phase_simple (int year, int month, int day) { int lp = 2551443; QDateTime now (QDate (year, month - 1, day), QTime (20, 35, 0)); QDateTime new_moon (QDate (1970, 0, 7), QTime (20, 35, 0)); double phase = ((now.toMSecsSinceEpoch() - new_moon.toMSecsSinceEpoch()) / 1000) % lp; return floor (phase / (24 * 3600)) + 1; } /* Conway This is based on a 'do it in your head' algorithm by John Conway. In its current form, it's only valid for the 20th and 21st centuries, but I'm sure John's got refinements. :) */ int moon_phase_conway (int year, int month, int day) { int r = year % 100; r %= 19; if (r > 9) r -= 19; r = ((r * 11) % 30) + month + day; if (month < 3) r += 2; r -= ((year < 2000) ? 4 : 8.3); r = (int) floor (r + 0.5) % 30; return (r < 0) ? r + 30 : r; } /*Trig1 This is based on some Basic code by Roger W. Sinnot from Sky & Telescope magazine, March 1985. I don't pretend to understand it - something to do with a first-order approximation to the 'real' calculation of the position of the bodies involved - which I'm still working on... :) */ inline double GetFrac (double fr) { return (fr - floor (fr)); } int moon_phase_trig1 (int year, int month, int day) { QDate d (year, month, day); int thisJD = d.toJulianDay(); double degToRad = 3.14159265 / 180; double K0, T, T2, T3, J0, F0, M0, M1, B1; int oldJ = 0; K0 = floor ((year - 1900) * 12.3685); T = (year - 1899.5) / 100; T2 = T * T; T3 = T * T * T; J0 = 2415020 + 29*K0; F0 = 0.0001178 * T2 - 0.000000155 * T3 + (0.75933 + 0.53058868 * K0) - (0.000837 * T + 0.000335 * T2); M0 = 360 * (GetFrac (K0 * 0.08084821133)) + 359.2242 - 0.0000333 *T2 - 0.00000347 * T3; M1 = 360 * (GetFrac (K0 * 0.07171366128)) + 306.0253 + 0.0107306 * T2 + 0.00001236 * T3; B1 = 360 * (GetFrac (K0 * 0.08519585128)) + 21.2964 - (0.0016528 * T2) - (0.00000239 * T3); int phase = 0; int jday = 0; while (jday < thisJD) { double F = F0 + 1.530588 * phase; double M5 = (M0 + phase * 29.10535608) * degToRad; double M6 = (M1 + phase * 385.81691806) * degToRad; double B6 = (B1 + phase * 390.67050646) * degToRad; F -= 0.4068 * sin (M6) + (0.1734 - 0.000393 * T) * sin (M5); F += 0.0161 * sin (2 * M6) + 0.0104 * sin (2 * B6); F -= 0.0074 * sin (M5 - M6) - 0.0051 * sin (M5 + M6); F += 0.0021 * sin (2 * M5) + 0.0010 * sin (2 * B6 - M6); F += 0.5 / 1440; oldJ = jday; jday = J0 + 28 * phase + floor(F); phase++; } return (thisJD - oldJ) % 30; } int moon_phase_by_algo (int v, int year, int month, int day) { int r = 0; switch (v) { case MOON_PHASE_TRIG2: r = moon_phase_trig2 (year, month, day); break; case MOON_PHASE_TRIG1: r = moon_phase_trig1 (year, month, day); break; case MOON_PHASE_CONWAY: r = moon_phase_conway (year, month, day); break; case MOON_PHASE_LEUESHKANOV: r = moon_phase_leueshkanov (year, month, day); break; case MOON_PHASE_SIMPLE: r = moon_phase_simple (year, month, day); break; }; return r; } CCalendarWidget::CCalendarWidget (QWidget *parent, const QString &a_dir_days): QCalendarWidget (parent) { dir_days = a_dir_days; moon_phase_algo = MOON_PHASE_TRIG2; moon_mode = false; moon_tiles.load (":/images/moon-phases.png"); northern_hemisphere = true; //setHeaderTextFormat (const QTextCharFormat & format); QTextCharFormat tformat; tformat.setForeground (QBrush (QColor ("white"))); tformat.setBackground (QBrush (QColor ("black"))); tformat.setFontWeight (QFont::Bold); setWeekdayTextFormat (Qt::Monday, tformat); setWeekdayTextFormat (Qt::Tuesday, tformat); setWeekdayTextFormat (Qt::Wednesday, tformat); setWeekdayTextFormat (Qt::Thursday, tformat); setWeekdayTextFormat (Qt::Friday, tformat); setWeekdayTextFormat (Qt::Saturday, tformat); setWeekdayTextFormat (Qt::Sunday, tformat); } void CCalendarWidget::paintCell (QPainter *painter, const QRect &rect, const QDate &date) const { QSize fsize = fontMetrics().size (Qt::TextSingleLine, "A"); if (moon_mode) { int moon_day = moon_phase_by_algo (moon_phase_algo, date.year(), date.month(), date.day()); bool has_image = true; if (moon_day == 0 || moon_day == 30 || moon_day == 1) has_image = false; //вычисляем ряд и колонку int cursorOffset = moon_day; int off = 0; /* int row = 0; while (cursorOffset >= (off + 8)) { off += 7; row++; } */ int row = moon_day / 7; if ((moon_day % 7 == 0) && (row != 0)) row--; int col = cursorOffset - off; // qDebug() << "moon day: " << moon_day << "| date:" << date.toString("dd") << " | row = " << row << " col = " << col; int trow = moon_day / 7; if ((moon_day % 7 == 0) && (trow != 0)) trow--; /* qDebug() << "moon day = " << moon_day; qDebug() << "moon_day / 7 = " << (double) moon_day / 7; qDebug() << "trow = " << trow; qDebug() << "row = " << row; */ //вычисляем, откуда копировать int pad = 3; int x = (col - 1) * 73 + (pad * col) - pad; int y = row * 73 + (pad * row); QRect r (x, y, 66, 73); QImage tile = moon_tiles.copy (r); QColor bg_color (Qt::black); painter->fillRect (rect, bg_color); if (has_image) { if (northern_hemisphere) painter->drawImage (rect.x(), rect.y(), tile); else painter->drawImage (rect.x(), rect.y(), tile.mirrored (true, false)); } painter->setPen (QPen (Qt::yellow)); QTextCharFormat tcf = dateTextFormat (date); if (tcf.fontStrikeOut()) painter->setPen (QPen (Qt::magenta)); else if (tcf.fontUnderline()) painter->setPen (QPen (Qt::red)); painter->drawText (QPoint (rect.x() + 5, rect.y() + fsize.height()), date.toString("dd") + " / " + QString::number (moon_day)); if (selectedDate() == date) { QPen dpen (Qt::yellow); dpen.setWidth (5); painter->setPen (dpen); painter->drawRect (rect); } } else QCalendarWidget::paintCell (painter, rect, date); } void CCalendarWidget::do_update() { updateCells(); } tea-qt-47.1.0/calendar.h000066400000000000000000000016031346332167200147270ustar00rootroot00000000000000#ifndef CALENDAR_H #define CALENDAR_H #include class CCalendarWidget: public QCalendarWidget { Q_OBJECT public: QImage moon_tiles; QString dir_days; bool moon_mode; bool northern_hemisphere; int moon_phase_algo; CCalendarWidget (QWidget *parent, const QString &a_dir_days); void paintCell (QPainter *painter, const QRect &rect, const QDate &date) const; void do_update(); }; enum { MOON_PHASE_TRIG2 = 0, MOON_PHASE_TRIG1, MOON_PHASE_CONWAY, MOON_PHASE_LEUESHKANOV, MOON_PHASE_SIMPLE }; int moon_phase_by_algo (int v, int year, int month, int day); int moon_phase_trig2 (int year, int month, int day); int moon_phase_simple (int year, int month, int day); int moon_phase_conway (int year, int month, int day); int moon_phase_trig1 (int year, int month, int day); int moon_phase_leueshkanov (int year, int month, int day); #endif // CALENDAR_H tea-qt-47.1.0/desktop/000077500000000000000000000000001346332167200144565ustar00rootroot00000000000000tea-qt-47.1.0/desktop/tea.desktop000066400000000000000000000005301346332167200166200ustar00rootroot00000000000000[Desktop Entry] Name=TEA Terminal=false Type=Application Icon=tea Exec=tea %U Categories=Utility;TextEditor; StartupNotify=false MimeType=text/plain; NoDisplay=false Version=1.1 Keywords=text editor;text;editor; Keywords[de]=Texteditor;Text;Editor; Comment=Text editor with hundreds of functions Comment[de]=Texteditor mit hunderten Funktionen tea-qt-47.1.0/document.cpp000066400000000000000000002170601346332167200153350ustar00rootroot00000000000000/*************************************************************************** * 2007-2018 by Peter Semiletov * * peter.semiletov@gmail.com * * * * 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, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * **************************************************************************/ /* some code by Copyright (C) 2006-2008 Trolltech ASA. All rights reserved. */ /* code from qPEditor: Copyright (C) 2007 by Michael Protasov, mik-protasov@anyqsoft.com */ /* Diego Iastrubni //some GPL'ed code from new-editor-diego-3, found on qtcentre forum */ /* code from qwriter: * Copyright (C) 2009 by Gancov Kostya * * kossne@mail.ru * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #if QT_VERSION >= 0x050000 #include #endif #include "document.h" #include "utils.h" #include "gui_utils.h" #include "textproc.h" QHash global_palette; QSettings *settings; QMenu *current_files_menu; int recent_list_max_items; bool b_recent_off; bool b_destroying_all; void CDocument::update_status() { if (! cursor_xy_visible) { holder->l_charset->setText (charset); return; } int x = textEdit->textCursor().position() - textEdit->textCursor().block().position() + 1; int y = textEdit->textCursor().block().blockNumber() + 1; holder->l_status_bar->setText ( QString ("%1:%2").arg ( QString::number (y)).arg ( QString::number (x))); holder->l_charset->setText (charset); } void CDocument::update_title (bool fullname) { if (! holder->parent_wnd) return; QMainWindow *w = qobject_cast (holder->parent_wnd); if (fullname) w->setWindowTitle (file_name); else w->setWindowTitle (QFileInfo (file_name).fileName()); } void CDocument::reload (const QString &enc) { if (file_exists (file_name)) open_file (file_name, enc); } bool CDocument::open_file (const QString &fileName, const QString &codec) { CTio *tio = holder->tio_handler.get_for_fname (fileName); if (! tio) return false; if (fileName.contains (holder->dir_config)) tio->charset = "UTF-8"; else tio->charset = codec; if (! tio->load (fileName)) { holder->log->log (tr ("cannot open %1 because of: %2") .arg (fileName) .arg (tio->error_string)); return false; } charset = tio->charset; eol = tio->eol; textEdit->setPlainText (tio->data); file_name = fileName; holder->update_project (file_name); set_tab_caption (QFileInfo (file_name).fileName()); set_hl(); set_markup_mode(); textEdit->document()->setModified (false); holder->log->log (tr ("%1 is open").arg (file_name)); QMutableListIterator i (holder->recent_files); while (i.hasNext()) { QStringList lt = i.next().split(","); if (lt.size() > 0) if (lt[0] == file_name) i.remove(); } return true; } bool CDocument::save_with_name (const QString &fileName, const QString &codec) { CTio *tio = holder->tio_handler.get_for_fname (fileName); if (! tio) return false; if (fileName.contains (holder->dir_config)) tio->charset = "UTF-8"; else tio->charset = codec; tio->data = textEdit->toPlainText(); if (eol != "\n") tio->data.replace ("\n", eol); if (! tio->save (fileName)) { holder->log->log (tr ("cannot save %1 because of: %2") .arg (fileName) .arg (tio->error_string)); return false; } if (! b_destroying_all) { charset = tio->charset; file_name = fileName; set_tab_caption (QFileInfo (file_name).fileName()); holder->log->log (tr ("%1 is saved").arg (file_name)); update_title (settings->value ("full_path_at_window_title", 1).toBool()); update_status(); textEdit->document()->setModified (false); holder->update_current_files_menu(); holder->update_project (file_name); } return true; } CDocument::CDocument (QObject *parent): QObject (parent) { QString fname = tr ("new[%1]").arg (QTime::currentTime().toString ("hh-mm-ss")); fnameswoexts.insert ("configure", "sh"); fnameswoexts.insert ("install-sh", "sh"); markup_mode = "HTML"; file_name = fname; cursor_xy_visible = true; charset = "UTF-8"; text_to_search = ""; position = 0; #if defined(Q_OS_WIN) || defined(Q_OS_OS2) eol = "\r\n"; #elif defined(Q_OS_UNIX) eol = "\n"; #endif } CDocument::~CDocument() { if (file_name.endsWith (".notes") && textEdit->document()->isModified()) save_with_name_plain (file_name); else if (file_name.startsWith (holder->dir_config) && textEdit->document()->isModified()) save_with_name_plain (file_name); else if (textEdit->document()->isModified() && file_exists (file_name)) { if (QMessageBox::warning (0, "TEA", tr ("%1 has been modified.\n" "Do you want to save your changes?").arg (file_name), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) save_with_name (file_name, charset); } if (! file_name.startsWith (holder->dir_config) && ! file_name.endsWith (".notes")) { holder->add_to_recent (this); holder->update_recent_menu(); } if (file_name.startsWith (holder->todo.dir_days)) holder->todo.load_dayfile(); QMainWindow *w = qobject_cast (holder->parent_wnd); w->setWindowTitle (""); int i = holder->tab_widget->indexOf (tab_page); if (i != -1) holder->tab_widget->removeTab (i); } void CDocument::create_new() { textEdit = new CTEAEdit; textEdit->doc = this; textEdit->current_line_color = QColor (hash_get_val (global_palette, "cur_line_color", "#EEF6FF")).darker (settings->value ("darker_val", 100).toInt()).name(); highlighter = NULL; int tab_index = holder->tab_widget->addTab (textEdit, file_name); tab_page = holder->tab_widget->widget (tab_index); textEdit->setFocus (Qt::OtherFocusReason); } int CDocument::get_tab_idx() { return holder->tab_widget->indexOf (tab_page); } void CDocument::set_tab_caption (const QString &fileName) { holder->tab_widget->setTabText (get_tab_idx(), fileName); } void CDox::reload_recent_list (void) { if (! file_exists (recent_list_fname)) return; recent_files = qstring_load (recent_list_fname).split ("\n"); } CDox::~CDox() { b_destroying_all = true; while (! list.isEmpty()) delete list.takeFirst(); qstring_save (recent_list_fname, recent_files.join ("\n")); #if defined(JOYSTICK_SUPPORTED) delete joystick; #endif } CDocument* CDox::create_new() { CDocument *doc = new CDocument; doc->holder = this; doc->markup_mode = markup_mode; list.append (doc); doc->create_new(); tab_widget->setCurrentIndex (tab_widget->indexOf (doc->tab_page)); apply_settings_single (doc); doc->update_title (settings->value ("full_path_at_window_title", 1).toBool()); doc->update_status(); update_current_files_menu(); return doc; } CDocument* CDox::get_document_by_fname (const QString &fileName) { if (fileName.isEmpty()) return NULL; foreach (CDocument *d, list) if (d->file_name == fileName) return d; return NULL; } CDocument* CDox::open_file (const QString &fileName, const QString &codec) { if (! file_exists (fileName)) return NULL; if (is_image (fileName)) { CDocument *td = get_current(); if (td) { td->insert_image (fileName); td->textEdit->setFocus (Qt::OtherFocusReason); } return td; } CDocument *d = get_document_by_fname (fileName); if (d) { tab_widget->setCurrentIndex (tab_widget->indexOf (d->tab_page)); d->reload (codec); return d; } CDocument *doc = create_new(); doc->open_file (fileName, codec); doc->update_status(); doc->update_title (settings->value ("full_path_at_window_title", 1).toBool()); tab_widget->setCurrentIndex (tab_widget->indexOf (doc->tab_page)); update_current_files_menu(); return doc; } void CDox::close_by_idx (int i) { if (i < 0) return; CDocument *d = list[i]; list.removeAt (i); delete d; update_current_files_menu(); } void CDox::close_current() { close_by_idx (tab_widget->currentIndex()); } CDocument* CDox::get_current() { int i = tab_widget->currentIndex(); if (i < 0) return NULL; return list[i]; } bool CDocument::save_with_name_plain (const QString &fileName) { QFile file (fileName); if (! file.open (QFile::WriteOnly | QFile::Text)) return false; QTextStream out (&file); out.setCodec (charset.toUtf8().data()); out << textEdit->toPlainText(); holder->update_current_files_menu(); return true; } QString CDocument::get_filename_at_cursor() { if (textEdit->textCursor().hasSelection()) { QFileInfo nf (file_name); QDir cd (nf.absolutePath()); return cd.cleanPath (cd.absoluteFilePath (textEdit->textCursor().selectedText())); } QString s = textEdit->textCursor().block().text(); if (s.isEmpty()) return QString (""); QString x; if (markup_mode == "LaTeX") { int pos = textEdit->textCursor().positionInBlock(); int end = s.indexOf ("}", pos); if (end == -1) return x; int start = s.lastIndexOf ("{", pos); if (start == -1) return x; x = s.mid (start + 1, end - (start + 1)); QFileInfo inf (file_name); QDir cur_dir (inf.absolutePath()); QString result = cur_dir.cleanPath (cur_dir.absoluteFilePath(x)); if (file_exists (result)) return result; int i = x.lastIndexOf ("/"); if (i < 0) i = x.lastIndexOf ("\\"); if (i < 0) return QString(); x = x.mid (i + 1); result = cur_dir.cleanPath (cur_dir.absoluteFilePath(x)); //qDebug() << "in cur dir: " << result; return result; } else { int pos = textEdit->textCursor().positionInBlock(); int end = s.indexOf ("\"", pos); if (end == -1) return x; int start = s.lastIndexOf ("\"", pos); if (start == -1) return x; x = s.mid (start + 1, end - (start + 1)); if (x.startsWith("#")) return x; QFileInfo inf (file_name); QDir cur_dir (inf.absolutePath()); return cur_dir.cleanPath (cur_dir.absoluteFilePath(x)); } } CSyntaxHighlighter::CSyntaxHighlighter (QTextDocument *parent, CDocument *doc, const QString &fname): QSyntaxHighlighter (parent) { document = doc; xml_format = 0; } CSyntaxHighlighterQRegExp::CSyntaxHighlighterQRegExp (QTextDocument *parent, CDocument *doc, const QString &fname): CSyntaxHighlighter (parent, doc, fname) { document = doc; casecare = true; load_from_xml (fname); } #if QT_VERSION >= 0x050000 CSyntaxHighlighterQRegularExpression::CSyntaxHighlighterQRegularExpression (QTextDocument *parent, CDocument *doc, const QString &fname): CSyntaxHighlighter (parent, doc, fname) { document = doc; load_from_xml (fname); } #endif void CDocument::set_hl (bool mode_auto, const QString &theext) { if (highlighter) delete highlighter; if (! settings->value ("hl_enabled", 1).toBool()) return; QString ext; if (mode_auto) ext = file_get_ext (file_name); else ext = theext; if (ext.isEmpty()) { QFileInfo fi (file_name); ext = fnameswoexts[fi.fileName()]; } if (ext.isEmpty()) return; QString fname = holder->hls.value (ext); if (fname.isEmpty() || ! file_exists (fname)) return; #if QT_VERSION >= 0x050000 if (settings->value ("qregexpsyntaxhl", 0).toBool()) highlighter = new CSyntaxHighlighterQRegExp (textEdit->document(), this, fname); else highlighter = new CSyntaxHighlighterQRegularExpression (textEdit->document(), this, fname); #else highlighter = new CSyntaxHighlighterQRegExp (textEdit->document(), this, fname); #endif } void CDocument::goto_pos (int pos) { QTextCursor cr = textEdit->textCursor(); cr.setPosition (pos); textEdit->setTextCursor (cr); } void CDox::apply_settings_single (CDocument *d) { int darker_val = settings->value ("darker_val", 100).toInt(); d->textEdit->setCursorWidth (settings->value ("cursor_width", 2).toInt()); d->textEdit->setCenterOnScroll (settings->value ("center_on_scroll", true).toBool()); QString s_sel_back_color = hash_get_val (global_palette, "sel-background", "black"); QString s_sel_text_color = hash_get_val (global_palette, "sel-text", "white"); d->textEdit->sel_text_color = QColor (s_sel_text_color).darker(darker_val).name(); d->textEdit->sel_back_color = QColor (s_sel_back_color).darker(darker_val).name(); d->textEdit->tab_sp_width = settings->value ("tab_sp_width", 8).toInt(); d->textEdit->spaces_instead_of_tabs = settings->value ("spaces_instead_of_tabs", true).toBool(); #if QT_VERSION >= 0x051000 d->textEdit->setTabStopDistance (d->textEdit->tab_sp_width * d->textEdit->brace_width); #else d->textEdit->setTabStopWidth (d->textEdit->tab_sp_width * d->textEdit->brace_width); #endif d->textEdit->setup_brace_width(); d->textEdit->set_show_linenums (settings->value ("show_linenums", false).toBool()); d->textEdit->set_show_margin (settings->value ("show_margin", false).toBool()); d->textEdit->set_margin_pos (settings->value ("margin_pos", 72).toInt()); d->textEdit->highlight_current_line = settings->value ("additional_hl", false).toBool(); d->textEdit->hl_brackets = settings->value ("hl_brackets", false).toBool(); d->textEdit->brackets_color = QColor (hash_get_val (global_palette, "brackets", "yellow")).darker (darker_val); d->textEdit->current_line_color = QColor (hash_get_val (global_palette, "cur_line_color", "#EEF6FF")).darker (darker_val); d->cursor_xy_visible = settings->value ("cursor_xy_visible", "2").toBool(); d->textEdit->auto_indent = settings->value ("auto_indent", false).toBool(); QString text_color = hash_get_val (global_palette, "text", "black"); QString t_text_color = QColor (text_color).darker(darker_val).name(); d->textEdit->text_color = QColor (t_text_color); QString back_color = hash_get_val (global_palette, "background", "white"); d->textEdit->margin_color = QColor (hash_get_val (global_palette, "margin_color", text_color)).darker(darker_val); d->textEdit->linenums_bg = QColor (hash_get_val (global_palette, "linenums_bg", back_color)).darker(darker_val); d->textEdit->set_word_wrap (settings->value ("word_wrap", true).toBool()); d->textEdit->repaint(); d->set_hl(); } void CDox::apply_settings() { foreach (CDocument *d, list) apply_settings_single (d); } void CDox::add_to_recent (CDocument *d) { if (b_recent_off) return; if (! file_exists (d->file_name)) return; QString s (d->file_name); s += ","; s += d->charset; s += ","; s += QString::number (d->textEdit->textCursor().position()); s += ","; if (! d->textEdit->get_word_wrap()) s+="0"; else s+="1"; recent_files.prepend (s); if (recent_files.size() > recent_list_max_items) recent_files.removeLast(); } void CDox::update_recent_menu() { recent_menu->clear(); create_menu_from_list (this, recent_menu, recent_files, SLOT(open_recent())); } void CDox::open_recent() { QAction *act = qobject_cast(sender()); int i = recent_files.indexOf (act->text()); if (i == -1) return; open_file_triplex (recent_files[i]); update_recent_menu(); } CDocument* CDox::open_file_triplex (const QString &triplex) { QStringList sl = triplex.split (","); if (sl.size() < 3) return NULL; CDocument *d = open_file (sl[0], sl[1]); if (! d) return NULL; d->goto_pos (sl[2].toInt()); if (sl.size() >= 4) { if (sl[3] == "1") d->textEdit->set_word_wrap (true); else d->textEdit->set_word_wrap (false); } return d; } QString CDocument::get_triplex() { if (! file_exists (file_name)) return QString (""); QString s (file_name); s += ","; s += charset; s += ","; s += QString::number (textEdit->textCursor().position()); s += ","; if (! textEdit->get_word_wrap()) s+="0"; else s+="1"; return s; } void CDocument::set_markup_mode() { markup_mode = holder->markup_mode; QString e = file_get_ext (file_name); QString t = holder->markup_modes[e]; if (! t.isEmpty()) markup_mode = t; } void CTEAEdit::cb_cursorPositionChanged() { viewport()->update(); if (doc) doc->update_status(); if (hl_brackets) update_ext_selections(); } void CTEAEdit::set_hl_cur_line (bool enable) { highlight_current_line = enable; emit repaint(); } void CTEAEdit::set_hl_brackets (bool enable) { hl_brackets = enable; emit repaint(); } void CTEAEdit::set_show_margin (bool enable) { draw_margin = enable; emit repaint(); } void CTEAEdit::set_show_linenums (bool enable) { draw_linenums = enable; updateLineNumberAreaWidth (0); emit repaint(); } void CTEAEdit::set_margin_pos (int mp) { margin_pos = mp; margin_x = brace_width * margin_pos; emit repaint(); } void CTEAEdit::paintEvent (QPaintEvent *event) { if (draw_margin || highlight_current_line) { QPainter painter (viewport()); if (highlight_current_line) { QRect r = cursorRect(); r.setX (0); r.setWidth (viewport()->width()); painter.fillRect (r, QBrush (current_line_color)); } if (draw_margin) { QPen pen = painter.pen(); pen.setColor (margin_color); painter.setPen (pen); painter.drawLine (margin_x, 0, margin_x, viewport()->height()); } } QPlainTextEdit::paintEvent (event); } void CTEAEdit::setup_brace_width() { QFontMetrics *fm = new QFontMetrics (font()); brace_width = fm->averageCharWidth(); } CTEAEdit::CTEAEdit (QWidget *parent): QPlainTextEdit (parent) { rect_sel_reset(); highlight_current_line = false; setup_brace_width(); lineNumberArea = new CLineNumberArea (this); connect(this, SIGNAL(selectionChanged()), this, SLOT(slot_selectionChanged())); connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int))); connect(this, SIGNAL(updateRequest(const QRect &, int)), this, SLOT(updateLineNumberArea(const QRect &, int))); updateLineNumberAreaWidth (0); margin_pos = 72; margin_x = brace_width * margin_pos; draw_margin = false; hl_brackets = false; auto_indent = false; tab_sp_width = 8; spaces_instead_of_tabs = true; document()->setUseDesignMetrics (true); QString s_sel_back_color = hash_get_val (global_palette, "sel-background", "black"); QString s_sel_text_color = hash_get_val (global_palette, "sel-text", "white"); int darker_val = settings->value ("darker_val", 100).toInt(); sel_text_color = QColor (s_sel_text_color).darker(darker_val).name(); sel_back_color = QColor (s_sel_back_color).darker(darker_val).name(); connect (this, SIGNAL(cursorPositionChanged()), this, SLOT(cb_cursorPositionChanged())); } void CDox::move_cursor_up() { move_cursor (QTextCursor::Up); } void CDox::move_cursor_down() { move_cursor (QTextCursor::Down); } void CDox::move_cursor_left() { move_cursor (QTextCursor::Left); } void CDox::move_cursor_right() { move_cursor (QTextCursor::Right); } void CDox::move_cursor_x (double v) { if (v < 0) move_cursor (QTextCursor::Right); if (v > 0) move_cursor (QTextCursor::Left); } void CDox::move_cursor_y (double v) { if (v < 0) move_cursor (QTextCursor::Up); if (v > 0) move_cursor (QTextCursor::Down); qDebug() << v; } CDox::CDox() { markup_modes.insert ("htm", "HTML"); markup_modes.insert ("html", "HTML"); markup_modes.insert ("xhtml", "XHTML"); markup_modes.insert ("xml", "Docbook"); markup_modes.insert ("tex", "LaTeX"); markup_modes.insert ("lout", "Lout"); markup_modes.insert ("dokuwiki", "DokuWiki"); markup_modes.insert ("mediawiki", "MediaWiki"); markup_modes.insert ("md", "Markdown"); markup_modes.insert ("markdown", "Markdown"); timer = new QTimer (this); timer->setInterval (100); #if defined(JOYSTICK_SUPPORTED) joystick = new CJoystick (0, this); if (joystick->initialized) { connect(timer, SIGNAL(timeout()), joystick, SLOT(read_joystick())); if (settings->value ("use_joystick", "0").toInt()) timer->start(); } #endif } QStringList CDocument::get_words() { QStringList result; QTextCursor cr = textEdit->textCursor(); QString text = textEdit->toPlainText(); cr.setPosition (0); cr.movePosition (QTextCursor::Start, QTextCursor::MoveAnchor); do { QChar c = text[cr.position()]; if (char_is_bad (c)) while (char_is_bad (c)) { cr.movePosition (QTextCursor::NextCharacter); c = text[cr.position()]; } cr.movePosition (QTextCursor::EndOfWord, QTextCursor::KeepAnchor); c = text[cr.position()]; QString stext = cr.selectedText(); if (! stext.isEmpty() && stext.endsWith ("\"")) { cr.movePosition (QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor); stext = cr.selectedText(); } if (! stext.isEmpty()) result.append (stext); } while (cr.movePosition (QTextCursor::NextWord)); return result; } QTextCharFormat tformat_from_style (const QString &fontstyle, const QString &color, int darker_val) { QTextCharFormat tformat; tformat.setForeground (QBrush (QColor (color).darker (darker_val))); if (fontstyle.isEmpty()) return tformat; if (fontstyle.contains ("bold")) tformat.setFontWeight (QFont::Bold); if (fontstyle.contains ("italic")) tformat.setFontItalic (true); if (fontstyle.contains ("underline")) tformat.setFontUnderline (true); if (fontstyle.contains ("strikeout")) tformat.setFontStrikeOut (true); return tformat; } #if QT_VERSION >= 0x050000 void CSyntaxHighlighterQRegularExpression::load_from_xml (const QString &fname) { // qDebug() << "CSyntaxHighlighterQRegularExpression::load_from_xml "; //wrap = true; casecare = true; exts = "default"; langs = "default"; pattern_opts = 0; int darker_val = settings->value ("darker_val", 100).toInt(); if (! file_exists (fname)) return; QString temp = qstring_load (fname); QXmlStreamReader xml (temp); while (! xml.atEnd()) { xml.readNext(); QString tag_name = xml.name().toString().toLower(); /* if (xml.isStartElement()) if (tag_name == "document") { exts = xml.attributes().value ("exts").toString(); langs = xml.attributes().value ("langs").toString(); } */ if (xml.isStartElement()) { if (tag_name == "document") { exts = xml.attributes().value ("exts").toString(); langs = xml.attributes().value ("langs").toString(); } if (tag_name == "item") { QString attr_type = xml.attributes().value ("type").toString(); QString attr_name = xml.attributes().value ("name").toString(); if (attr_name == "options") { QString s_xml_format = xml.attributes().value ("xml_format").toString(); if (! s_xml_format.isEmpty()) xml_format = s_xml_format.toInt(); QString s_casecare = xml.attributes().value ("casecare").toString(); if (! s_casecare.isEmpty()) if (s_casecare == "0" || s_casecare == "false") casecare = false; if (! casecare) pattern_opts = pattern_opts | QRegularExpression::CaseInsensitiveOption; } if (attr_type == "keywords") { QString color = hash_get_val (global_palette, xml.attributes().value ("color").toString(), "darkBlue"); QTextCharFormat fmt = tformat_from_style (xml.attributes().value ("fontstyle").toString(), color, darker_val); if (xml_format == 0) //old and ugly format { QStringList keywordPatterns = xml.readElementText().trimmed().split(";"); //HighlightingRule rule; for (int i = 0; i < keywordPatterns.size(); i++) if (! keywordPatterns.at(i).isEmpty()) { QRegularExpression rg = QRegularExpression (keywordPatterns.at(i).trimmed(), pattern_opts); if (! rg.isValid()) qDebug() << "! valid " << rg.pattern(); else { HighlightingRule rule; rule.pattern = rg; rule.format = fmt; highlightingRules.append (rule); } } } else if (xml_format == 1) { HighlightingRule rule; QRegularExpression rg = QRegularExpression (xml.readElementText().trimmed().remove('\n'), pattern_opts); if (! rg.isValid()) qDebug() << "! valid " << rg.pattern(); else { HighlightingRule rule; rule.pattern = rg; rule.format = fmt; highlightingRules.append (rule); } } } //keywords else if (attr_type == "item") { QString color = hash_get_val (global_palette, xml.attributes().value ("color").toString(), "darkBlue"); QTextCharFormat fmt = tformat_from_style (xml.attributes().value ("fontstyle").toString(), color, darker_val); // qDebug() << "attr_type == item, attr_name == " << attr_name; QRegularExpression rg = QRegularExpression (xml.readElementText().trimmed(), pattern_opts); if (! rg.isValid()) qDebug() << "! valid " << rg.pattern(); else { HighlightingRule rule; rule.pattern = rg; rule.format = fmt; highlightingRules.append (rule); } } else if (attr_type == "mcomment-start") { QString color = hash_get_val (global_palette, xml.attributes().value ("color").toString(), "gray"); QTextCharFormat fmt = tformat_from_style (xml.attributes().value ("color").toString(), color, darker_val); multiLineCommentFormat = fmt; commentStartExpression = QRegularExpression (xml.readElementText().trimmed(), pattern_opts); } else if (attr_type == "mcomment-end") { commentEndExpression = QRegularExpression (xml.readElementText().trimmed(), pattern_opts); } else if (attr_type == "comment") { if (xml.attributes().value ("name").toString() == "cm_mult") cm_mult = xml.readElementText().trimmed(); else if (xml.attributes().value ("name").toString() == "cm_single") cm_single = xml.readElementText().trimmed(); } }//item }//is start if (xml.hasError()) qDebug() << "xml parse error"; } //cycle } void CSyntaxHighlighterQRegularExpression::highlightBlock (const QString &text) { foreach (HighlightingRule rule, highlightingRules) { QRegularExpressionMatch m = rule.pattern.match (text); int index = m.capturedStart(); while (index >= 0) { int length = m.capturedLength(); setFormat (index, length, rule.format); m = rule.pattern.match (text, index + length); index = m.capturedStart(); } } setCurrentBlockState (0); int startIndex = 0; if (! commentStartExpression.isValid() || ! commentEndExpression.isValid()) return; QRegularExpressionMatch m_start = commentStartExpression.match (text); if (previousBlockState() != 1) startIndex = m_start.capturedStart(); while (startIndex >= 0) { QRegularExpressionMatch m_end = commentEndExpression.match (text, startIndex); int endIndex = m_end.capturedStart(); int commentLength; if (endIndex == -1) { setCurrentBlockState (1); commentLength = text.length() - startIndex; } else commentLength = endIndex - startIndex + m_end.capturedLength(); setFormat (startIndex, commentLength, multiLineCommentFormat); m_start = commentStartExpression.match (text, startIndex + commentLength); startIndex = m_start.capturedStart(); } } #endif void CSyntaxHighlighterQRegExp::load_from_xml (const QString &fname) { //qDebug() << "CSyntaxHighlighter::load_from_xml - start"; int darker_val = settings->value ("darker_val", 100).toInt(); exts = "default"; langs = "default"; cs = Qt::CaseSensitive; if (! file_exists (fname)) return; QString temp = qstring_load (fname); QXmlStreamReader xml (temp); while (! xml.atEnd()) { xml.readNext(); QString tag_name = xml.name().toString().toLower(); /* if (xml.isStartElement()) if (tag_name == "document") { exts = xml.attributes().value ("exts").toString(); langs = xml.attributes().value ("langs").toString(); } */ if (xml.isStartElement()) { if (tag_name == "document") { exts = xml.attributes().value ("exts").toString(); langs = xml.attributes().value ("langs").toString(); } if (tag_name == "item") { QString attr_type = xml.attributes().value ("type").toString(); QString attr_name = xml.attributes().value ("name").toString(); if (attr_name == "options") { /* QString s_wrap = xml.attributes().value ("wrap").toString(); if (! s_wrap.isEmpty()) if (s_wrap == "0" || s_wrap == "false") wrap = false;*/ QString s_casecare = xml.attributes().value ("casecare").toString(); if (! s_casecare.isEmpty()) if (s_casecare == "0" || s_casecare == "false") casecare = false; if (! casecare) cs = Qt::CaseInsensitive; } if (attr_type == "keywords") { QString color = hash_get_val (global_palette, xml.attributes().value ("color").toString(), "darkBlue"); QTextCharFormat fmt = tformat_from_style (xml.attributes().value ("fontstyle").toString(), color, darker_val); if (xml_format == 0) { QStringList keywordPatterns = xml.readElementText().trimmed().split(";"); for (int i = 0; i < keywordPatterns.size(); i++) if (! keywordPatterns.at(i).isEmpty()) { QRegExp rg = QRegExp (keywordPatterns.at(i).trimmed(), cs, QRegExp::RegExp); if (rg.isValid()) { HighlightingRule rule; rule.pattern = rg; rule.format = fmt; highlightingRules.append (rule); } } } else if (xml_format == 1) { QRegExp rg = QRegExp (xml.readElementText().trimmed().remove('\n'), cs); if (! rg.isValid()) qDebug() << "! valid " << rg.pattern(); else { HighlightingRule rule; rule.pattern = QRegExp (xml.readElementText().trimmed().remove('\n'), cs); rule.format = fmt; highlightingRules.append(rule); } } } //keywords else if (attr_type == "item") { QString color = hash_get_val (global_palette, xml.attributes().value ("color").toString(), "darkBlue"); QTextCharFormat fmt = tformat_from_style (xml.attributes().value ("fontstyle").toString(), color, darker_val); QRegExp rg = QRegExp (xml.readElementText().trimmed(), cs, QRegExp::RegExp); if (rg.isValid()) { HighlightingRule rule; rule.pattern = rg; rule.format = fmt; highlightingRules.append (rule); } } else if (attr_type == "mcomment-start") { QString color = hash_get_val (global_palette, xml.attributes().value ("color").toString(), "gray"); QTextCharFormat fmt = tformat_from_style (xml.attributes().value ("color").toString(), color, darker_val); multiLineCommentFormat = fmt; commentStartExpression = QRegExp (xml.readElementText().trimmed(), cs, QRegExp::RegExp); } else if (attr_type == "mcomment-end") { commentEndExpression = QRegExp (xml.readElementText().trimmed(), cs, QRegExp::RegExp); } else if (attr_type == "comment") { if (xml.attributes().value ("name").toString() == "cm_mult") cm_mult = xml.readElementText().trimmed(); else if (xml.attributes().value ("name").toString() == "cm_single") cm_single = xml.readElementText().trimmed(); } }//item }//is start if (xml.hasError()) qDebug() << "xml parse error"; } //cycle } void CSyntaxHighlighterQRegExp::highlightBlock (const QString &text) { foreach (HighlightingRule rule, highlightingRules) { int index; index = text.indexOf (rule.pattern); while (index >= 0) { int length = rule.pattern.matchedLength(); setFormat (index, length, rule.format); index = text.indexOf (rule.pattern, index + length); } } setCurrentBlockState (0); int startIndex = 0; if (commentStartExpression.isEmpty() || commentEndExpression.isEmpty()) return; if (previousBlockState() != 1) startIndex = text.indexOf (commentStartExpression); while (startIndex >= 0) { // int endIndex = text.indexOf (commentEndExpression, startIndex); int endIndex = commentEndExpression.indexIn (text, startIndex); int commentLength; if (endIndex == -1) { setCurrentBlockState (1); commentLength = text.length() - startIndex; } else commentLength = endIndex - startIndex + commentEndExpression.matchedLength(); setFormat (startIndex, commentLength, multiLineCommentFormat); startIndex = text.indexOf (commentStartExpression, startIndex + commentLength); } } void CDox::save_to_session (const QString &fileName) { if (list.size() < 0) return; fname_current_session = fileName; QString l; foreach (CDocument *d, list) { QString t = d->get_triplex(); if (! t.isEmpty()) { l += t; l += "\n"; } } qstring_save (fileName, l.trimmed()); } void CDox::load_from_session (const QString &fileName) { if (! file_exists (fileName)) return; QStringList l = qstring_load (fileName).split ("\n"); if (l.size() < 0) return; foreach (QString t, l) open_file_triplex (t); fname_current_session = fileName; } /* QHash CDox::load_eclipse_theme_xml (const QString &fname) { QHash result; QString temp = qstring_load (fname); QXmlStreamReader xml (temp); while (! xml.atEnd()) { xml.readNext(); QString tag_name = xml.name().toString(); if (xml.isStartElement()) { if (tag_name == "colorTheme") { log->log (xml.attributes().value ("id").toString()); log->log (xml.attributes().value ("name").toString()); log->log (xml.attributes().value ("modified").toString()); log->log (xml.attributes().value ("author").toString()); log->log (xml.attributes().value ("website").toString()); } if (tag_name == "singleLineComment") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) result.insert ("single comment", t); } if (tag_name == "class") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) { result.insert ("class", t); result.insert ("type", t); } } if (tag_name == "operator") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) result.insert ("operator", t); } if (tag_name == "string") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) result.insert ("quotes", t); } if (tag_name == "multiLineComment") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) result.insert ("mcomment-start", t); } if (tag_name == "foreground") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) { result.insert ("text", t); result.insert ("functions", t); result.insert ("modifiers", t); result.insert ("margin_color", t); result.insert ("digits", t); result.insert ("digits-float", t); result.insert ("label", t); result.insert ("include", t); result.insert ("preproc", t); } } if (tag_name == "background") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) { result.insert ("background", t); result.insert ("linenums_bg", t); } } if (tag_name == "selectionForeground") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) result.insert ("sel-text", t); } if (tag_name == "selectionBackground") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) result.insert ("sel-background", t); } if (tag_name == "keyword") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) { result.insert ("keywords", t); result.insert ("tags", t); } } if (tag_name == "currentLine") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) result.insert ("cur_line_color", t); } if (tag_name == "bracket") { QString t = xml.attributes().value ("color").toString(); if (! t.isEmpty()) result.insert ("brackets", t); } }//is start if (xml.hasError()) qDebug() << "xml parse error"; } //cycle result.insert ("error", "red"); return result; } */ /* void CDox::load_global_palette (const QString &fileName) { if (! file_exists (fileName)) return; global_palette.clear(); if (file_get_ext (fileName) == "xml") global_palette = load_eclipse_theme_xml (fileName); else global_palette = hash_load_keyval (fileName); } */ QString CDocument::get_selected_text() const { return textEdit->textCursor().selectedText(); } void CDocument::set_selected_text (const QString &value) { textEdit->textCursor().insertText (value); } void CDocument::insert_image (const QString &full_path) { textEdit->textCursor().insertText (get_insert_image (file_name, full_path, markup_mode)); } //если строка пустая - пофиг, а надо бы смотреть тогда строку выше void CTEAEdit::calc_auto_indent() { QTextCursor cur = textCursor(); cur.movePosition (QTextCursor::StartOfLine, QTextCursor::KeepAnchor); int aindent = 0; QString s = cur.selectedText(); int len = s.size(); QChar t = ' '; //what to detect - space or tab? if (s.indexOf ('\t') != -1) t = '\t'; if (t != '\t') { for (int i = 0; i < len; i++) if (! s.at(i).isSpace()) { aindent = i; break; } } else { for (int i = 0; i < len; i++) if (s.at(i) != '\t') { aindent = i; break; } } if (aindent != 0) indent_val = indent_val.fill (t, aindent); else indent_val.clear(); } void CTEAEdit::indent() { if (! textCursor().hasSelection()) { QString fl; fl = fl.fill (' ', tab_sp_width); if (spaces_instead_of_tabs) textCursor().insertText (fl); else textCursor().insertText ("\t"); return; } QStringList l = textCursor().selectedText().split (QChar::ParagraphSeparator); QString fl; fl = fl.fill (' ', tab_sp_width); QMutableListIterator i (l); while (i.hasNext()) { QString s = i.next(); if (spaces_instead_of_tabs) i.setValue (s.prepend (fl)); else i.setValue (s.prepend ("\t")); } textCursor().insertText (l.join ("\n")); QTextCursor cur = textCursor(); cur.movePosition (QTextCursor::Up, QTextCursor::KeepAnchor, l.size() - 1); cur.movePosition (QTextCursor::StartOfLine, QTextCursor::KeepAnchor); setTextCursor (cur); } void CTEAEdit::un_indent() { if (! textCursor().hasSelection()) { QString t = textCursor().selectedText(); if (! t.isEmpty() && (t.size() > 1) && t[0].isSpace()) t = t.mid (1); return; } QStringList l = textCursor().selectedText().split (QChar::ParagraphSeparator); QMutableListIterator i (l); while (i.hasNext()) { QString t = i.next(); if (! t.isEmpty() && (t.size() > 1)) if (t[0] == '\t' || t[0].isSpace()) { t = t.mid (1); i.setValue (t); } } textCursor().insertText (l.join ("\n")); QTextCursor cur = textCursor(); cur.movePosition (QTextCursor::Up, QTextCursor::KeepAnchor, l.size() - 1); cur.movePosition (QTextCursor::StartOfLine, QTextCursor::KeepAnchor); setTextCursor (cur); } #define SK_A 38 #define SK_D 40 #define SK_W 25 #define SK_S 39 #define SK_E 26 #define SK_C 54 void CTEAEdit::keyPressEvent (QKeyEvent *event) { // qDebug() << event->nativeScanCode() ; // qDebug() << int_to_binary (event->nativeModifiers()); // std::bitset<32> btst (event->nativeModifiers()); /* for (std::size_t i = 0; i < btst.size(); ++i) { qDebug() << "btst[" << i << "]: " << btst[i]; } */ //LSHIFT = 0 //LCTRL = 2 //LALT = 3 //LWIN = 6 if (settings->value ("wasd", "0").toInt()) { std::bitset<32> btst (event->nativeModifiers()); QTextCursor cr = textCursor(); QTextCursor::MoveMode m = QTextCursor::MoveAnchor; if (btst[3] == 1 || btst[6] == 1) //LALT or LWIN { int visible_lines; if (btst[6] == 1) m = QTextCursor::KeepAnchor; switch (event->nativeScanCode()) { case SK_W: cr.movePosition (QTextCursor::Up, m); setTextCursor (cr); return; case SK_S: cr.movePosition (QTextCursor::Down, m); setTextCursor (cr); return; case SK_A: cr.movePosition (QTextCursor::Left, m); setTextCursor (cr); return; case SK_D: cr.movePosition (QTextCursor::Right, m); setTextCursor (cr); return; case SK_E: visible_lines = height() / fontMetrics().height(); cr.movePosition (QTextCursor::Down, m, visible_lines); setTextCursor (cr); return; case SK_C: visible_lines = height() / fontMetrics().height(); cr.movePosition (QTextCursor::Up, m, visible_lines); setTextCursor (cr); return; } } } if (auto_indent && event->key() == Qt::Key_Return) { calc_auto_indent(); QPlainTextEdit::keyPressEvent (event); textCursor().insertText (indent_val); return; } if (event->key() == Qt::Key_Tab) { indent(); event->accept(); return; } else if (event->key() == Qt::Key_Backtab) { un_indent(); event->accept(); return; } else if (event->key() == Qt::Key_Insert) { setOverwriteMode (! overwriteMode()); event->accept(); return; } /* else if (event->key() == doc->holder->gamepadnav.leftKey()) { qDebug() << "left"; event->accept(); return; } */ QPlainTextEdit::keyPressEvent (event); } int CTEAEdit::lineNumberAreaWidth() { if (! draw_linenums) return 0; int digits = 1; int max = qMax (1, blockCount()); while (max >= 10) { max /= 10; ++digits; } int space = (brace_width * 2) + (brace_width * digits); return space; } void CTEAEdit::updateLineNumberAreaWidth (int newBlockCount) { setViewportMargins (lineNumberAreaWidth(), 0, 0, 0); } void CTEAEdit::updateLineNumberArea (const QRect &rect, int dy) { if (dy) lineNumberArea->scroll (0, dy); else lineNumberArea->update (0, rect.y(), lineNumberArea->width(), rect.height()); if (rect.contains (viewport()->rect())) updateLineNumberAreaWidth (0); } void CTEAEdit::lineNumberAreaPaintEvent (QPaintEvent *event) { if (! draw_linenums) return; QPainter painter (lineNumberArea); painter.fillRect (event->rect(), linenums_bg); painter.setPen (text_color); QTextBlock block = firstVisibleBlock(); int blockNumber = block.blockNumber(); int top = (int) blockBoundingGeometry (block).translated (contentOffset()).top(); int bottom = top + (int) blockBoundingRect (block).height(); int w = lineNumberArea->width(); int h = fontMetrics().height(); while (block.isValid() && top <= event->rect().bottom()) { if (block.isVisible() && bottom >= event->rect().top()) { QString number = QString::number (blockNumber + 1) + " "; // painter.setPen (text_color); painter.drawText (0, top, w, h, Qt::AlignRight, number); /*int index = bookMark.indexOf(number.toInt()); if (index != -1) { //painter.drawText(0, top, 30, fontMetrics().height(), Qt::AlignCenter, "+"); painter.setBrush(QBrush(Qt::yellow, Qt::SolidPattern)); painter.drawEllipse(5, top + (fontMetrics().height()/4), fontMetrics().height()/2, fontMetrics().height()/2); }*/ } block = block.next(); top = bottom; bottom = top + (int) blockBoundingRect(block).height(); ++blockNumber; } } void CTEAEdit::resizeEvent (QResizeEvent *e) { QPlainTextEdit::resizeEvent (e); QRect cr = contentsRect(); lineNumberArea->setGeometry (QRect (cr.left(), cr.top(), lineNumberAreaWidth(), cr.height())); } void CTEAEdit::braceHighlight() { //extraSelections.clear(); //setExtraSelections (extraSelections); brace_selection.format.setBackground (brackets_color); QTextDocument *doc = document(); QTextCursor cursor = textCursor(); QTextCursor beforeCursor = cursor; cursor.movePosition (QTextCursor::NextCharacter, QTextCursor::KeepAnchor); QString brace = cursor.selectedText(); beforeCursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor); QString beforeBrace = beforeCursor.selectedText(); if ((brace != "{") && (brace != "}") && (brace != "[") && (brace != "]") && (brace != "(") && (brace != ")") && (brace != "<") && (brace != ">")) { if ((beforeBrace == "{") || (beforeBrace == "}") || (beforeBrace == "[") || (beforeBrace == "]") || (beforeBrace == "(") || (beforeBrace == ")") || (beforeBrace == "<") || (beforeBrace == ">")) { cursor = beforeCursor; brace = cursor.selectedText(); } else return; } QString openBrace; QString closeBrace; if ((brace == "{") || (brace == "}")) { openBrace = "{"; closeBrace = "}"; } else if ((brace == "[") || (brace == "]")) { openBrace = "["; closeBrace = "]"; } else if ((brace == "(") || (brace == ")")) { openBrace = "("; closeBrace = ")"; } else if ((brace == "<") || (brace == ">")) { openBrace = "<"; closeBrace = ">"; } if (brace == openBrace) { QTextCursor cursor1 = doc->find (closeBrace, cursor); QTextCursor cursor2 = doc->find (openBrace, cursor); if (cursor2.isNull()) { brace_selection.cursor = cursor; extraSelections.append (brace_selection); brace_selection.cursor = cursor1; extraSelections.append (brace_selection); setExtraSelections (extraSelections); } else { while (cursor1.position() > cursor2.position()) { cursor1 = doc->find (closeBrace, cursor1); cursor2 = doc->find (openBrace, cursor2); if (cursor2.isNull()) break; } brace_selection.cursor = cursor; extraSelections.append (brace_selection); brace_selection.cursor = cursor1; extraSelections.append (brace_selection); setExtraSelections (extraSelections); } } else { if (brace == closeBrace) { QTextCursor cursor1 = doc->find (openBrace, cursor, QTextDocument::FindBackward); QTextCursor cursor2 = doc->find (closeBrace, cursor, QTextDocument::FindBackward); if (cursor2.isNull()) { brace_selection.cursor = cursor; extraSelections.append (brace_selection); brace_selection.cursor = cursor1; extraSelections.append (brace_selection); setExtraSelections (extraSelections); } else { while (cursor1.position() < cursor2.position()) { cursor1 = doc->find (openBrace, cursor1, QTextDocument::FindBackward); cursor2 = doc->find (closeBrace, cursor2, QTextDocument::FindBackward); if (cursor2.isNull()) break; } brace_selection.cursor = cursor; extraSelections.append (brace_selection); brace_selection.cursor = cursor1; extraSelections.append (brace_selection); setExtraSelections (extraSelections); } } } } bool CTEAEdit::has_rect_selection() { if (rect_sel_start.y() == -1 || rect_sel_end.y() == -1) return false; return true; } void CTEAEdit::update_rect_sel() { // qDebug() << "CTEAEdit::update_rect_sel() -1"; if (rect_sel_start.y() == -1 || rect_sel_end.y() == -1) return; QTextEdit::ExtraSelection rect_selection; //extraSelections.clear(); int y1 = std::min (rect_sel_start.y(), rect_sel_end.y()); int y2 = std::max (rect_sel_start.y(), rect_sel_end.y()); //int ydiff = y2 - y1; int x1 = std::min (rect_sel_start.x(), rect_sel_end.x()); int x2 = std::max (rect_sel_start.x(), rect_sel_end.x()); int xdiff = x2 - x1; int correction = 0; QTextCursor cursor = textCursor(); cursor.movePosition (QTextCursor::Start, QTextCursor::MoveAnchor); cursor.movePosition (QTextCursor::NextBlock, QTextCursor::MoveAnchor, y1); for (int y = y1; y <= y2; y++) { // qDebug() << "y:" << y; QTextBlock b = document()->findBlockByNumber (y); // qDebug() << "b.text().length(): " << b.text().length(); // qDebug() << "x1: " << x1; if (b.text().length() == 0) { //cursor.movePosition (QTextCursor::NextBlock, QTextCursor::MoveAnchor); correction++; continue; } int sel_len = xdiff; if ((b.text().length() - x1) < xdiff) sel_len = b.text().length() - x1; cursor.movePosition (QTextCursor::Right, QTextCursor::MoveAnchor, x1 + correction); cursor.movePosition (QTextCursor::Right, QTextCursor::KeepAnchor, sel_len); rect_selection.cursor = cursor; // rect_selection.format.setBackground (brackets_color); rect_selection.format.setBackground (sel_back_color); rect_selection.format.setForeground (sel_text_color); extraSelections.append (rect_selection); cursor.movePosition (QTextCursor::NextBlock, QTextCursor::MoveAnchor); if (b.text().length() != 0) correction = 0; } setExtraSelections (extraSelections); /* qDebug() << "ydiff: " << ydiff; qDebug() << "y1:" << y1; qDebug() << "y2:" << y2; qDebug() << "x1:" << x1; qDebug() << "x2:" << x2; */ // qDebug() << get_rect_sel(); } void CTEAEdit::rect_sel_replace (const QString &s, bool insert) { /* 1. Определить с какой строки начинаем вставку 2. Определить как вставляемый текст перекрывает старый. Если строк в старом меньше (или конец файла), добавляем в выходной буфер строки. 3. Составляем выходной буфер из строк старого и нового. 4. Заменяем старый текст на выходной буфер. */ int y1 = std::min (rect_sel_start.y(), rect_sel_end.y()); int y2 = std::max (rect_sel_start.y(), rect_sel_end.y()); int ydiff = y2 - y1; int x1 = std::min (rect_sel_start.x(), rect_sel_end.x()); int x2 = std::max (rect_sel_start.x(), rect_sel_end.x()); // int how_many_copy_from_source = ydiff; // int lines_to_end = blockCount() - y1; QStringList sl_source; for (int line = y1; line <= y2; line++) { QTextBlock b = document()->findBlockByNumber (line); sl_source.append (b.text()); } QStringList sl_insert = s.split ("\n"); QStringList sl_dest; for (int line = 0; line < sl_insert.size(); line++) { QString t; if (line >= sl_source.size()) { t = sl_insert [line]; sl_dest.append (t); continue; } t = sl_source[line].left (x1); t += sl_insert [line]; if (! insert) t += sl_source[line].mid (x2); else t += sl_source[line].mid (x1); sl_dest.append (t); } QString new_text = sl_dest.join ("\n"); //new_text += "\n"; //теперь выделить при помощи курсора всё от y1 до y2 и обычным способом заменить текст QTextCursor cursor = textCursor(); cursor.movePosition (QTextCursor::Start, QTextCursor::MoveAnchor); cursor.movePosition (QTextCursor::NextBlock, QTextCursor::MoveAnchor, y1); cursor.movePosition (QTextCursor::NextBlock, QTextCursor::KeepAnchor, ydiff); cursor.movePosition (QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); cursor.removeSelectedText(); textCursor().insertText (new_text); // qDebug() << new_text; } /* void CTEAEdit::rect_sel_insert (const QString &s) { int y1 = std::min (rect_sel_start.y(), rect_sel_end.y()); int y2 = std::max (rect_sel_start.y(), rect_sel_end.y()); int ydiff = y2 - y1; int x1 = std::min (rect_sel_start.x(), rect_sel_end.x()); int x2 = std::max (rect_sel_start.x(), rect_sel_end.x()); int xdiff = x2 - x1; int how_many_copy_from_source = ydiff; int lines_to_end = blockCount() - y1; if (ydiff > lines_to_end) how_many_copy_from_source = lines_to_end; QStringList sl_source; for (int line = y1; line <= y2; line++) { QTextBlock b = document()->findBlockByNumber (line); sl_source.append (b.text()); } QStringList sl_insert = s.split ("\n"); QStringList sl_dest; for (int line = 0; line < sl_insert.size(); line++) { QString t; if (line >= sl_source.size()) { t = sl_insert [line]; sl_dest.append (t); continue; } t = sl_source[line].left (x1); t += sl_insert [line]; t += sl_source[line].mid (x1); sl_dest.append (t); } QString new_text = sl_dest.join ("\n"); //new_text += "\n"; //теперь выделить при помощи курсора всё от y1 до y2 и обычным способом заменить текст QTextCursor cursor = textCursor(); cursor.movePosition (QTextCursor::Start, QTextCursor::MoveAnchor); cursor.movePosition (QTextCursor::NextBlock, QTextCursor::MoveAnchor, y1); cursor.movePosition (QTextCursor::NextBlock, QTextCursor::KeepAnchor, ydiff); cursor.movePosition (QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); cursor.removeSelectedText(); textCursor().insertText (new_text); qDebug() << new_text; } */ bool CTEAEdit::canInsertFromMimeData (const QMimeData *source) { // if (source->hasFormat ("text/uri-list")) // return true; //else return true; } QMimeData* CTEAEdit::createMimeDataFromSelection() { if (has_rect_selection()) { QMimeData *md = new QMimeData; md->setText (get_rect_sel()); return md; } return QPlainTextEdit::createMimeDataFromSelection(); } void CTEAEdit::insertFromMimeData (const QMimeData *source) { QString fName; QFileInfo info; bool b_ins_plain_text = ! source->hasUrls(); if (source->hasUrls() && source->urls().at(0).scheme() != "file") b_ins_plain_text = true; if (b_ins_plain_text) { QPlainTextEdit::insertFromMimeData (source); return; } foreach (QUrl u, source->urls()) { fName = u.toLocalFile(); info.setFile(fName); if (info.isFile()) doc->holder->open_file (fName, "UTF-8"); } } QStringList text_get_bookmarks (const QString &s, const QString &sstart, const QString &send) { QStringList result; int c = s.size(); int i = 0; while (i < c) { int start = s.indexOf (sstart, i, Qt::CaseInsensitive); if (start == -1) break; int end = s.indexOf (send, start + sstart.length()); if (end == -1) break; result.prepend (s.mid (start + sstart.length(), (end - start) - send.length())); i = end + 1; } return result; } void CDocument::update_labels() { labels.clear(); labels = text_get_bookmarks (textEdit->toPlainText(), settings->value ("label_start", "[?").toString(), settings->value ("label_end", "?]").toString()); } void CDox::open_current() { QAction *act = qobject_cast(sender()); CDocument *d = get_document_by_fname (act->text()); if (d) tab_widget->setCurrentIndex (tab_widget->indexOf (d->tab_page)); } void CDox::update_current_files_menu() { QStringList current_files; foreach (CDocument *d, list) current_files.prepend (d->file_name); current_files_menu->clear(); create_menu_from_list (this, current_files_menu, current_files, SLOT(open_current())); } void CTEAEdit::rect_sel_reset() { rect_sel_start.setX (-1); rect_sel_start.setY (-1); rect_sel_end.setX (-1); rect_sel_end.setY (-1); } QString CTEAEdit::get_rect_sel() { QString result; int y1 = std::min (rect_sel_start.y(), rect_sel_end.y()); int y2 = std::max (rect_sel_start.y(), rect_sel_end.y()); //int ydiff = y2 - y1; int x1 = std::min (rect_sel_start.x(), rect_sel_end.x()); int x2 = std::max (rect_sel_start.x(), rect_sel_end.x()); int xdiff = x2 - x1; for (int y = y1; y <= y2; y++) { //int sel_len = xdiff; QTextBlock b = document()->findBlockByNumber (y); //if ((b.text().length() - x1) < xdiff) // sel_len = b.text().length() - x1; QString t = b.text(); result += t.mid (x1, xdiff); if (y != y2) result += '\n'; } return result; } void CTEAEdit::rect_sel_cut (bool just_del) { int y1 = std::min (rect_sel_start.y(), rect_sel_end.y()); int y2 = std::max (rect_sel_start.y(), rect_sel_end.y()); int ydiff = y2 - y1; int x1 = std::min (rect_sel_start.x(), rect_sel_end.x()); int x2 = std::max (rect_sel_start.x(), rect_sel_end.x()); // int how_many_copy_from_source = ydiff; //int lines_to_end = blockCount() - y1; // if (ydiff > lines_to_end) // how_many_copy_from_source = lines_to_end; QStringList sl_source; for (int line = y1; line <= y2; line++) { QTextBlock b = document()->findBlockByNumber (line); sl_source.append (b.text()); } QStringList sl_dest; QStringList sl_copy; for (int line = 0; line < sl_source.size(); line++) { QString t; t = sl_source[line].left (x1); t += sl_source[line].mid (x2); sl_dest.append (t); sl_copy.append (sl_source[line].mid (x1, x2 - x1)); } QString new_text = sl_dest.join ("\n"); //теперь выделить при помощи курсора всё от y1 до y2 и обычным способом заменить текст QTextCursor cursor = textCursor(); cursor.movePosition (QTextCursor::Start, QTextCursor::MoveAnchor); cursor.movePosition (QTextCursor::NextBlock, QTextCursor::MoveAnchor, y1); cursor.movePosition (QTextCursor::NextBlock, QTextCursor::KeepAnchor, ydiff); cursor.movePosition (QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); cursor.beginEditBlock(); cursor.removeSelectedText(); cursor.insertText (new_text); cursor.endEditBlock(); if (! just_del) QApplication::clipboard()->setText (sl_copy.join ("\n")); } void CTEAEdit::update_ext_selections() { extraSelections.clear(); setExtraSelections (extraSelections); update_rect_sel(); braceHighlight(); } void CTEAEdit::slot_selectionChanged() { QTextCursor cursor = this->textCursor(); if (cursor.selectionStart() != cursor.selectionEnd()) { rect_sel_start.setX (-1); rect_sel_end.setX (-1); update_ext_selections(); } } void CTEAEdit::text_replace (const QString &s) { if (has_rect_selection()) rect_sel_replace (s, false); else textCursor().insertText (s); } /* void CTEAEdit::copy() { qDebug() << "CTEAEdit::copy()"; if (has_rect_selection()) QApplication::clipboard()->setText (get_rect_sel()); else QPlainTextEdit::copy(); } */ /* * // new INDEX-IN VARIANT void CSyntaxHighlighter::highlightBlock (const QString &text) { qDebug() << "1"; foreach (HighlightingRule rule, highlightingRules) { QRegExp expression (rule.pattern); int index; if (! casecare) index = expression.indexIn (text.toLower()); else index = expression.indexIn (text); while (index >= 0) { int length = expression.matchedLength(); setFormat (index, length, rule.format); if (! casecare) index = expression.indexIn (text.toLower(), index + length); else index = expression.indexIn (text, index + length); } } setCurrentBlockState (0); int startIndex = 0; if (commentStartExpression.isEmpty() || commentEndExpression.isEmpty()) return; if (previousBlockState() != 1) { if (! casecare) startIndex = commentStartExpression.indexIn (text.toLower()); else startIndex = commentStartExpression.indexIn (text); } while (startIndex >= 0) { int endIndex; if (! casecare) endIndex = commentEndExpression.indexIn (text.toLower(), startIndex); else endIndex = commentEndExpression.indexIn (text, startIndex); int commentLength; if (endIndex == -1) { setCurrentBlockState (1); commentLength = text.length() - startIndex; } else commentLength = endIndex - startIndex + commentEndExpression.matchedLength(); setFormat (startIndex, commentLength, multiLineCommentFormat); if (! casecare) startIndex = commentStartExpression.indexIn (text.toLower(), startIndex + commentLength); else startIndex = commentStartExpression.indexIn (text, startIndex + commentLength); } } */ void CDox::move_cursor (QTextCursor::MoveOperation mo) { CDocument *d = get_current(); if (! d) return; QTextCursor cr = d->textEdit->textCursor(); if (cr.isNull()) return; if (mo != QTextCursor::NoMove) { cr.movePosition (mo, QTextCursor::MoveAnchor); d->textEdit->setTextCursor (cr); } } #if defined(JOYSTICK_SUPPORTED) bool CDox::event (QEvent *ev) { if (static_cast(ev->type() == evtJoystickAxis)) { CJoystickAxisEvent* custom_event = reinterpret_cast(ev); handle_joystick_event (custom_event); custom_event->accept(); return true; } return QObject::event(ev); } void CDox::handle_joystick_event (CJoystickAxisEvent *event) { // CDocument *d = get_current(); // if (! d) // return; // QTextCursor cr = d->textEdit->textCursor(); // if (cr.isNull()) // return; QTextCursor::MoveOperation mo = QTextCursor::NoMove; if (event->axis == 1 && event->value < 0) //up mo = QTextCursor::Up; if (event->axis == 1 && event->value > 0) //down mo = QTextCursor::Down; if (event->axis == 0 && event->value < 0) //left mo = QTextCursor::Left; if (event->axis == 0 && event->value > 0) //right mo = QTextCursor::Right; move_cursor (mo); // if (mo != QTextCursor::NoMove) // { // cr.movePosition (mo, QTextCursor::MoveAnchor); // d->textEdit->setTextCursor (cr); //} } #endif void CDox::update_project (const QString &fileName) { if (file_get_ext (fileName) == "teaproject") { fname_current_project = fileName; hash_project.clear(); hash_project = hash_load_keyval (fileName); } } void CTEAEdit::set_word_wrap (bool wrap) { if (wrap) setWordWrapMode (QTextOption::WrapAtWordBoundaryOrAnywhere); else setWordWrapMode (QTextOption::NoWrap); } bool CTEAEdit::get_word_wrap() { if (wordWrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere) return true; else return false; } tea-qt-47.1.0/document.h000066400000000000000000000231501346332167200147750ustar00rootroot00000000000000/*************************************************************************** * 2007-2019 by Peter Semiletov * * * * * * 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, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * **************************************************************************/ /* Copyright (C) 2006-2008 Trolltech ASA. All rights reserved. */ /* Diego Iastrubni //some GPL'ed code from new-editor-diego-3, found on qtcentre forum */ /* code from qwriter: * Copyright (C) 2009 by Gancov Kostya * * kossne@mail.ru * */ #ifndef DOCUMENT_H #define DOCUMENT_H #include #include #include #include #include #include #if QT_VERSION >= 0x050700 //#include //#include #endif #if QT_VERSION >= 0x050000 #include #endif #if defined(JOYSTICK_SUPPORTED) #include "myjoystick.h" #endif #include "logmemo.h" #include "tio.h" #include "todo.h" class CDox; class CDocument; class CTEAEdit: public QPlainTextEdit { Q_OBJECT public: QString indent_val; QList extraSelections; QTextEdit::ExtraSelection brace_selection; QPoint rect_sel_start; //rect selection QPoint rect_sel_end; //rect selection CDocument *doc; //uplink QColor current_line_color; QColor brackets_color; QColor margin_color; QColor linenums_bg; QColor text_color; QColor sel_text_color; QColor sel_back_color; QWidget *lineNumberArea; bool highlight_current_line; bool hl_brackets; bool draw_margin; bool draw_linenums; // bool use_hl_wrap; // bool wrap; bool auto_indent; bool spaces_instead_of_tabs; int tab_sp_width; //in spaces int brace_width; //in pixels int margin_pos; //in chars int margin_x; //in pixels CTEAEdit (QWidget *parent = 0); void set_show_linenums (bool enable); void set_show_margin (bool enable); void set_margin_pos (int mp); void set_hl_cur_line (bool enable); void set_hl_brackets (bool enable); void set_word_wrap (bool wrap); bool get_word_wrap(); void indent(); void un_indent(); void calc_auto_indent(); void setup_brace_width(); void text_replace (const QString &s); void rect_sel_reset(); void rect_sel_replace (const QString &s, bool insert = false); void update_ext_selections(); void update_rect_sel(); QString get_rect_sel(); void rect_sel_cut (bool just_del = false); void braceHighlight(); void lineNumberAreaPaintEvent(QPaintEvent *event); int lineNumberAreaWidth(); Q_INVOKABLE bool has_rect_selection(); protected: bool canInsertFromMimeData (const QMimeData *source); void insertFromMimeData (const QMimeData *source); QMimeData* createMimeDataFromSelection(); void paintEvent(QPaintEvent *event); void keyPressEvent (QKeyEvent *event); void resizeEvent(QResizeEvent *event); public slots: void updateLineNumberAreaWidth (int newBlockCount); void cb_cursorPositionChanged(); void updateLineNumberArea (const QRect &, int); void slot_selectionChanged(); }; class CSyntaxHighlighter: public QSyntaxHighlighter { public: CSyntaxHighlighter (QTextDocument *parent = 0, CDocument *doc = 0, const QString &fname = "none"); CDocument *document; bool casecare; int xml_format; QString exts; QString langs; QString cm_mult; QString cm_single; QTextCharFormat singleLineCommentFormat; QTextCharFormat multiLineCommentFormat; }; class CSyntaxHighlighterQRegExp: public CSyntaxHighlighter { Q_OBJECT protected: void highlightBlock (const QString &text); public: struct HighlightingRule { QRegExp pattern; QTextCharFormat format; }; QRegExp commentStartExpression; QRegExp commentEndExpression; Qt::CaseSensitivity cs; CSyntaxHighlighterQRegExp (QTextDocument *parent = 0, CDocument *doc = 0, const QString &fname = "none"); QVector highlightingRules; void load_from_xml (const QString &fname); }; #if QT_VERSION >= 0x050000 class CSyntaxHighlighterQRegularExpression: public CSyntaxHighlighter { Q_OBJECT protected: void highlightBlock (const QString &text); public: struct HighlightingRule { QRegularExpression pattern; QTextCharFormat format; }; QRegularExpression commentStartExpression; QRegularExpression commentEndExpression; QRegularExpression::PatternOptions pattern_opts; CSyntaxHighlighterQRegularExpression (QTextDocument *parent = 0, CDocument *doc = 0, const QString &fname = "none"); QVector highlightingRules; QTextCharFormat singleLineCommentFormat; QTextCharFormat multiLineCommentFormat; void load_from_xml (const QString &fname); }; #endif class CDocument: public QObject { Q_OBJECT public: bool cursor_xy_visible; QHash fnameswoexts; QString eol; CDox *holder; CSyntaxHighlighter *highlighter; CTEAEdit *textEdit; QStringList labels; QString markup_mode; QString file_name; QString text_to_search; QString charset; QWidget *tab_page; int position; CDocument (QObject *parent = 0); ~CDocument(); Q_INVOKABLE QString get_selected_text() const; Q_INVOKABLE void set_selected_text (const QString &value); void create_new(); Q_INVOKABLE void set_tab_caption (const QString &fileName); Q_INVOKABLE bool save_with_name (const QString &fileName, const QString &codec); Q_INVOKABLE bool save_with_name_plain (const QString &fileName); Q_INVOKABLE void goto_pos (int pos); Q_INVOKABLE QString get_filename_at_cursor(); Q_INVOKABLE QStringList get_words(); Q_INVOKABLE void set_hl (bool mode_auto = true, const QString &theext = "txt"); Q_INVOKABLE bool open_file (const QString &fileName, const QString &codec); Q_INVOKABLE void insert_image (const QString &full_path); Q_INVOKABLE void set_markup_mode(); Q_INVOKABLE void reload (const QString &enc); Q_INVOKABLE int get_tab_idx(); Q_INVOKABLE QString get_triplex(); Q_INVOKABLE void update_status(); Q_INVOKABLE void update_title (bool fullname = true); Q_INVOKABLE void update_labels(); }; class CDox: public QObject { Q_OBJECT public: CTioHandler tio_handler; CTodo todo; QStringList recent_files; QString fname_current_session; QString fname_current_project; QString dir_config; QString fname_crapbook; QString markup_mode; QString recent_list_fname; QHash hls; QHash markup_modes; QHash hash_project; QLabel *l_status_bar; QLabel *l_charset; QList list; QStatusBar *status_bar; CLogMemo *log; QMainWindow *parent_wnd; QTabWidget *tab_widget; QMenu *recent_menu; QTimer *timer; #if defined(JOYSTICK_SUPPORTED) CJoystick *joystick; #endif CDox(); ~CDox(); #if defined(JOYSTICK_SUPPORTED) bool event (QEvent *ev); void handle_joystick_event (CJoystickAxisEvent *ev); #endif void update_project (const QString &fileName); void reload_recent_list(); void add_to_recent (CDocument *d); void update_recent_menu(); void update_current_files_menu(); void move_cursor (QTextCursor::MoveOperation mo); Q_INVOKABLE CDocument* create_new(); Q_INVOKABLE CDocument* open_file (const QString &fileName, const QString &codec); Q_INVOKABLE CDocument* open_file_triplex (const QString &triplex); Q_INVOKABLE CDocument* get_document_by_fname (const QString &fileName); Q_INVOKABLE CDocument* get_current(); Q_INVOKABLE void close_by_idx (int i); Q_INVOKABLE void close_current(); Q_INVOKABLE void save_to_session (const QString &fileName); Q_INVOKABLE void load_from_session (const QString &fileName); Q_INVOKABLE void apply_settings(); Q_INVOKABLE void apply_settings_single (CDocument *d); public slots: void open_recent(); void open_current(); void move_cursor_up(); void move_cursor_down(); void move_cursor_left(); void move_cursor_right(); void move_cursor_x(double v); void move_cursor_y(double v); }; class CLineNumberArea: public QWidget { public: CTEAEdit *code_editor; CLineNumberArea (CTEAEdit *editor = 0): QWidget (editor), code_editor (editor) {} QSize sizeHint() const { return QSize(code_editor->lineNumberAreaWidth(), 0); } protected: void paintEvent (QPaintEvent *event) { code_editor->lineNumberAreaPaintEvent (event); } }; #endif tea-qt-47.1.0/encsign/000077500000000000000000000000001346332167200144335ustar00rootroot00000000000000tea-qt-47.1.0/encsign/CP1251000066400000000000000000000001221346332167200151640ustar00rootroot00000000000000 tea-qt-47.1.0/encsign/CP866000066400000000000000000000001221346332167200151170ustar00rootroot00000000000000 tea-qt-47.1.0/encsign/KOI8-R000066400000000000000000000001221346332167200152620ustar00rootroot00000000000000 tea-qt-47.1.0/encsign/KOI8-U000066400000000000000000000001141346332167200152660ustar00rootroot00000000000000 צ ˦ Φ ͦ ' Ц ަ tea-qt-47.1.0/exif.cpp000066400000000000000000000276431346332167200144600ustar00rootroot00000000000000#include #include #include #include #include #include "exif.h" rint8u readByte (QFile &file) { char a; file.getChar (&a); return (rint8u)a; } //-------------------------------------------------------------------------- // Parse the marker stream until SOS or EOI is seen; //-------------------------------------------------------------------------- int Exif::readJpegSections(QFile &file, int *Orientation) { QByteArray *data; rint8u a = readByte (file); if (a != 0xff) return -1; else { rint8u b = readByte (file); if (b != M_SOI) return -1; } //int SectionsRead=0; for (;;) { int itemlen; int prev; rint8u marker = 0; rint8u ll, lh; prev = 0; for (int i = 0; ; i++) { marker = readByte (file); if (marker != 0xff && prev == 0xff) break; prev = marker; } // Read the length of the section. lh = readByte (file); ll = readByte (file); itemlen = (lh << 8) | ll; if (itemlen < 2) // Invalid marker return -1; data = new QByteArray (file.read (itemlen - 2)); // Read the whole section. if (data->isEmpty()) return -1; // Could not allocate memory if(data->size() != itemlen - 2) return -1; // Premature end of file? switch (marker) { case M_SOS: // stop before hitting compressed data return 0; case M_EOI: // in case it's a tables-only JPEG stream return -1; case M_COM: // Comment section delete (data); break; case M_JFIF: // Regular jpegs always have this tag, exif images have the exif // marker instead, althogh ACDsee will write images with both markers. // this program will re-create this marker on absence of exif marker. // hence no need to keep the copy from the file. if (itemlen >= 16){ // if Jfif header not too short // skipped } delete (data); break; case M_EXIF: // There can be different section using the same marker. if (data->left(4) == "Exif") { processEXIF(data, itemlen, Orientation); break; } // Oterwise, discard this section. delete (data); break; case M_IPTC: delete (data); break; /* case M_SOF0: case M_SOF1: case M_SOF2: case M_SOF3: case M_SOF5: case M_SOF6: case M_SOF7: case M_SOF9: case M_SOF10: case M_SOF11: case M_SOF13: case M_SOF14: case M_SOF15: //process_SOFn(Data, marker);*/ break; default: // Skip any other sections. break; } // switch } // for(;;) return 0; } // Convert a 16 bit unsigned value from file's native byte order int Get16u(const void * Short, int MotorolaOrder){ if (MotorolaOrder){ return (((uchar *)Short)[0] << 8) | ((uchar *)Short)[1]; }else{ return (((uchar *)Short)[1] << 8) | ((uchar *)Short)[0]; } } // Convert a 32 bit signed value from file's native byte order int Get32s(const void * Long, int MotorolaOrder){ if (MotorolaOrder){ return ((( char *)Long)[0] << 24) | (((uchar *)Long)[1] << 16) | (((uchar *)Long)[2] << 8 ) | (((uchar *)Long)[3] << 0 ); }else{ return ((( char *)Long)[3] << 24) | (((uchar *)Long)[2] << 16) | (((uchar *)Long)[1] << 8 ) | (((uchar *)Long)[0] << 0 ); } } // Convert a 32 bit unsigned value from file's native byte order unsigned Get32u(const void * Long, int MotorolaOrder){ return (unsigned)Get32s(Long, MotorolaOrder) & 0xffffffff; } #define NUM_FORMATS 12 #define FMT_BYTE 1 #define FMT_STRING 2 #define FMT_USHORT 3 #define FMT_ULONG 4 #define FMT_URATIONAL 5 #define FMT_SBYTE 6 #define FMT_UNDEFINED 7 #define FMT_SSHORT 8 #define FMT_SLONG 9 #define FMT_SRATIONAL 10 #define FMT_SINGLE 11 #define FMT_DOUBLE 12 // Evaluate number, be it int, rational, or float from directory. double ConvertAnyFormat(const void * ValuePtr, int Format, int MotorolaOrder) { double Value = 0.0; switch(Format){ case FMT_SBYTE: Value = *(signed char *)ValuePtr; break; case FMT_BYTE: Value = *(uchar *)ValuePtr; break; case FMT_USHORT: Value = Get16u(ValuePtr, MotorolaOrder); break; case FMT_ULONG: Value = Get32u(ValuePtr, MotorolaOrder); break; case FMT_URATIONAL: case FMT_SRATIONAL: { int Num, Den; Num = Get32s(ValuePtr, MotorolaOrder); Den = Get32s(4+(char *)ValuePtr, MotorolaOrder); if (Den == 0){ Value = 0; }else{ Value = (double)Num/Den; } break; } case FMT_SSHORT: Value = (signed short)Get16u(ValuePtr, MotorolaOrder); break; case FMT_SLONG: Value = Get32s(ValuePtr, MotorolaOrder); break; // Not sure if this is correct (never seen float used in Exif format) case FMT_SINGLE: Value = (double)*(float *)ValuePtr; break; case FMT_DOUBLE: Value = *(double *)ValuePtr; break; default: Value = 100;// Illegal format code } return Value; } #define TAG_ORIENTATION 0x0112 #define TAG_INTEROP_OFFSET 0xA005 #define TAG_EXIF_OFFSET 0x8769 const int BytesPerFormat[] = {0,1,1,2,4,8,1,1,2,4,8,4,8}; // Process one of the nested EXIF directories. int Exif::processEXIFDir(const char *DirStart, const char *OffsetBase, rint32u exifSize, rint32u nesting, int MotorolaOrder, int *NumOrientations, int *Orientation){ int numDirEntries; if(nesting>4) return -1; // Maximum Exif directory nesting exceeded (corrupt Exif header) numDirEntries = Get16u(DirStart, MotorolaOrder); //qDebug() << "num entries: " << numDirEntries; #define DIR_ENTRY_ADDR(Start, Entry) (Start+2+12*(Entry)) for (int de=0; de= NUM_FORMATS) continue; // (-1) catches illegal zero case as unsigned underflows to positive large. if((unsigned)Components > 0x10000) continue; // Too many components ByteCount = Components * BytesPerFormat[Format]; //qDebug() << "byte count" << ByteCount; if (ByteCount > 4){ // If its bigger than 4 bytes, the dir entry contains an offset. unsigned OffsetVal = Get32u(DirEntry+8, MotorolaOrder); if (OffsetVal+ByteCount > exifSize) continue; // Bogus pointer offset and / or bytecount value ValuePtr = OffsetBase+OffsetVal; }else{ // 4 bytes or less and value is in the dir entry itself ValuePtr = DirEntry+8; } // Extract useful components of tag switch(Tag){ case TAG_ORIENTATION: if (*NumOrientations >= 2){ // Can have another orientation tag for the thumbnail, but if there's // a third one, things are stringae. break; } if (*NumOrientations == 0){ *Orientation = (int)ConvertAnyFormat(ValuePtr, Format, MotorolaOrder); //qDebug() << "orientation:" << *Orientation; } if (*Orientation < 0 || *Orientation > 8){ // Undefined rotation value *Orientation = 0; } *NumOrientations += 1; break; case TAG_EXIF_OFFSET: case TAG_INTEROP_OFFSET: const char * SubdirStart; SubdirStart = OffsetBase + Get32u(ValuePtr, MotorolaOrder); if (SubdirStart < OffsetBase || SubdirStart > OffsetBase+ exifSize){ // Illegal Exif or interop ofset directory link }else{ processEXIFDir(SubdirStart, OffsetBase, exifSize, nesting+1, MotorolaOrder, NumOrientations, Orientation); } continue; break; default: // Skip any other sections. break; } } return 0; } // Process a EXIF marker // Describes all the drivel that most digital cameras include... int Exif::processEXIF(QByteArray *data, int itemlen, int *Orientation){ int MotorolaOrder = 0; // Check the EXIF header component if(data->left(6) == "Exif\0\0"){ qDebug() << data->left(4); } if(data->mid(6,2) == "II"){ // Exif section in Intel order //qDebug() << data->mid(6,2); MotorolaOrder = 0; }else{ if(data->mid(6,2) == "II"){ // Exif section in Motorola order //qDebug() << data->mid(6,2); MotorolaOrder = 1; }else{ return -1; // Invalid Exif alignment marker. } } // get first offset QByteArray ttt(data->mid(10,4)); const char *ttt2 = ttt.constData(); rint32u FirstOffset; FirstOffset = Get32u(ttt2, MotorolaOrder); //qDebug() << "fist offset: " << FirstOffset; if (FirstOffset < 8 || FirstOffset > 16){ if (FirstOffset < 16 || int(FirstOffset) > itemlen-16) return -1; // invalid offset for first Exif IFD value ; } const char *dirStart = data->constData(); const char *offsetBase = data->constData(); dirStart += 6 + FirstOffset; offsetBase += 6; int numOrientations = 0; // First directory starts 16 bytes in. All offset are relative to 8 bytes in. processEXIFDir(dirStart, offsetBase, itemlen-8, 0, MotorolaOrder, &numOrientations, Orientation); //qDebug() << "num orientations:" << numOrientations; return 0; } int Exif::readJpegFile(QFile &file, int *Orientation) { readJpegSections(file, Orientation); return 0; } int Exif::getExifOrientation(QFile &file) { int r; readJpegFile(file, &r); return r; } int get_exif_orientation (const QString &fname) { Exif exif; int o = 0; QFile file (fname); if (file.open(QIODevice::ReadOnly)) { o = exif.getExifOrientation(file/*, &o*/); file.close(); } return o; } tea-qt-47.1.0/exif.h000066400000000000000000000043111346332167200141100ustar00rootroot00000000000000#ifndef EXIF_H #define EXIF_H // This implementation is based on http://www.sentex.net/~mwandel/jhead/ // Rewritten and published in public domain like // the original code by http://imonad.com //-------------------------------------------------------------------------- // JPEG markers consist of one or more 0xFF bytes, followed by a marker // code byte (which is not an FF). Here are the marker codes of interest // in this program. (See jdmarker.c for a more complete list.) //-------------------------------------------------------------------------- #define M_SOF0 0xC0 // Start Of Frame N #define M_SOF1 0xC1 // N indicates which compression process #define M_SOF2 0xC2 // Only SOF0-SOF2 are now in common use #define M_SOF3 0xC3 #define M_SOF5 0xC5 // NB: codes C4 and CC are NOT SOF markers #define M_SOF6 0xC6 #define M_SOF7 0xC7 #define M_SOF9 0xC9 #define M_SOF10 0xCA #define M_SOF11 0xCB #define M_SOF13 0xCD #define M_SOF14 0xCE #define M_SOF15 0xCF #define M_SOI 0xD8 // Start Of Image (beginning of datastream) #define M_EOI 0xD9 // End Of Image (end of datastream) #define M_SOS 0xDA // Start Of Scan (begins compressed data) #define M_JFIF 0xE0 // Jfif marker #define M_EXIF 0xE1 // Exif marker. Also used for XMP data! #define M_XMP 0x10E1 // Not a real tag (same value in file as Exif!) #define M_COM 0xFE // COMment #define M_DQT 0xDB #define M_DHT 0xC4 #define M_DRI 0xDD #define M_IPTC 0xED // IPTC marker typedef unsigned char rint8u; typedef char rint8; typedef unsigned int rint32u; #include #include #include class Exif { public: int getExifOrientation (QFile &file); int readJpegFile (QFile &file, int *Orientation); int readJpegSections (QFile &file, int *Orientation); int processEXIF (QByteArray *barr, int itemlen, int *Orientation); int processEXIFDir (const char *dirStart, const char *offsetBase, rint32u size, rint32u nesting, int MotorolaOrder, int *numOrientations, int *Orientation); }; int get_exif_orientation (const QString &fname); #endif // EXIF_H tea-qt-47.1.0/fman.cpp000066400000000000000000000340171346332167200144370ustar00rootroot00000000000000 /************************************************************************** * 2007-2018 by Peter Semiletov * * peter.semiletov@gmail.com * * * * 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, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * **************************************************************************/ #include #include #include #include #include #include #include #include #include "fman.h" #include "utils.h" #include "logmemo.h" extern QSettings *settings; void CFMan::dir_up() { if (dir.path() == "/") return; QString oldcurdir = dir.dirName(); dir.cdUp(); nav (dir.path()); QModelIndex index = index_from_name (oldcurdir); selectionModel()->setCurrentIndex(index, QItemSelectionModel::Rows | QItemSelectionModel::NoUpdate); scrollTo (index); } void CFMan::nav (const QString &path) { if (file_exists (path)) dir.setPath (path); else dir.setPath (QDir::homePath()); if (! dir.exists()) return; setModel (0); QDir::SortFlags sort_flags = 0; if (sort_order == Qt::DescendingOrder) sort_flags |= QDir::Reversed; if (sort_mode == 0) sort_flags |= QDir::Name; if (sort_mode == 1) sort_flags |= QDir::Size; if (sort_mode == 2) sort_flags |= QDir::Time; sort_flags |= QDir::DirsFirst; sort_flags |= QDir::IgnoreCase; sort_flags |= QDir::LocaleAware; mymodel->removeRows (0, mymodel->rowCount()); QFileInfoList lst = dir.entryInfoList (QDir::Dirs | QDir::Hidden | QDir::NoDotAndDotDot | QDir::Files | QDir::Drives, sort_flags); /*QFileInfoList lst = dir.entryInfoList (QDir::Dirs | QDir::Hidden | QDir::NoDotAndDotDot | QDir::Files | QDir::Drives, QDir::Name | QDir::DirsFirst | QDir::IgnoreCase | QDir::LocaleAware); */ /* QDir::Name 0x00 Sort by name. QDir::Time 0x01 Sort by time (modification time). QDir::Size 0x02 Sort by file size. QDir::Type 0x80 Sort by file type (extension). QDir::Unsorted 0x03 Do not sort. QDir::NoSort -1 Not sorted by default. QDir::DirsFirst 0x04 Put the directories first, then the files. QDir::DirsLast 0x20 Put the files first, then the directories. QDir::Reversed 0x08 Reverse the sort order. QDir::IgnoreCase 0x10 Sort case-insensitively. QDir::LocaleAware 0x40 Sort items appropriately using the current locale settings. */ #if defined(Q_OS_WIN) || defined(Q_OS_OS2) if (path != "/") append_dot_entry (".."); #else if (path.size() != 2) append_dot_entry (".."); #endif foreach (QFileInfo fi, lst) add_entry (fi); setModel (mymodel); connect (selectionModel(), SIGNAL(currentChanged (const QModelIndex &, const QModelIndex &)), this, SLOT(cb_fman_currentChanged (const QModelIndex &, const QModelIndex &))); emit dir_changed (path); } const QModelIndex CFMan::index_from_name (const QString &name) { QList lst = mymodel->findItems (name); if (lst.size() > 0) return mymodel->indexFromItem (lst[0]); else return QModelIndex(); } void CFMan::tv_activated (const QModelIndex &index) { QString item_string = index.data().toString(); QString dpath = dir.path(); if (dpath.size() > 1) if (dpath.endsWith("/") || dpath.endsWith("\\")) dpath.truncate(dpath.size() - 1); QString full_path; if (dpath == "/") full_path = "/" + item_string; else full_path = dpath + "/" + item_string; if (item_string == ".." && dir.path() != "/") { dir_up(); return; } if (is_dir (full_path)) { nav (full_path); QModelIndex index = mymodel->index (0, 0); selectionModel()->setCurrentIndex (index, QItemSelectionModel::Select | QItemSelectionModel::Rows); return; } else emit file_activated (full_path); } void CFMan::add_entry (const QFileInfo &fi) { QList items; QStandardItem *item = new QStandardItem (fi.fileName()); if (fi.isDir()) { QFont f = item->font(); f.setBold (true); item->setFont(f); } item->setFlags (Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled); items.append (item); item = new QStandardItem (QString::number (fi.size())); item->setFlags (Qt::ItemIsSelectable | Qt::ItemIsEnabled); items.append (item); item = new QStandardItem (fi.lastModified().toString ("yyyy-MM-dd")); item->setFlags (Qt::ItemIsSelectable | Qt::ItemIsEnabled); items.append (item); mymodel->appendRow (items); } void CFMan::append_dot_entry (const QString &fname) { QList items; QStandardItem *item = new QStandardItem (fname); item->setFlags (Qt::ItemIsSelectable | Qt::ItemIsEnabled); items.append (item); item = new QStandardItem ("-"); item->setFlags (Qt::ItemIsSelectable | Qt::ItemIsEnabled); items.append (item); item = new QStandardItem ("-"); item->setFlags (Qt::ItemIsSelectable | Qt::ItemIsEnabled); items.append (item); mymodel->appendRow (items); } void CFMan::header_view_sortIndicatorChanged (int logicalIndex, Qt::SortOrder order) { // qDebug() << "header col = " << logicalIndex << " order = " << order; sort_order = order; sort_mode = logicalIndex; settings->setValue ("fman_sort_mode", sort_mode); settings->setValue ("fman_sort_order", sort_order); refresh(); } CFMan::CFMan (QWidget *parent): QTreeView (parent) { sort_mode = settings->value ("fman_sort_mode", 0).toInt(); sort_order = Qt::SortOrder (settings->value ("fman_sort_order", 0).toInt()); mymodel = new QStandardItemModel (0, 3, parent); mymodel->setHeaderData (0, Qt::Horizontal, QObject::tr ("Name")); mymodel->setHeaderData (1, Qt::Horizontal, QObject::tr ("Size")); mymodel->setHeaderData (2, Qt::Horizontal, QObject::tr ("Modified at")); setRootIsDecorated (false); setAlternatingRowColors (true); setAllColumnsShowFocus (true); setModel (mymodel); setDragEnabled (true); #if QT_VERSION >= 0x050000 header()->setSectionResizeMode (QHeaderView::ResizeToContents); header()->setSectionsClickable (true); #else header()->setResizeMode (QHeaderView::ResizeToContents); header()->setClickable (true); #endif header()->setSortIndicator (sort_mode, sort_order); header()->setSortIndicatorShown (true); connect (header(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)), this, SLOT(header_view_sortIndicatorChanged(int, Qt::SortOrder))); header()->setStretchLastSection (false); setSelectionMode (QAbstractItemView::ExtendedSelection); setSelectionBehavior (QAbstractItemView::SelectRows); connect (this, SIGNAL(activated(const QModelIndex &)), this, SLOT(tv_activated(const QModelIndex &))); } void CFMan::cb_fman_currentChanged (const QModelIndex ¤t, const QModelIndex &previous ) { int row = current.row(); if (row < 0) { emit current_file_changed ("", ""); return; } QModelIndex i = model()->index (row, 0); QString item_string = i.data().toString(); QString full_path = dir.path() + "/" + item_string; // if (! is_dir (full_path)) emit current_file_changed (full_path, item_string); } QString CFMan::get_sel_fname() { if (! selectionModel()->hasSelection()) return QString(); QModelIndex index = selectionModel()->currentIndex(); QString item_string = index.data().toString(); return dir.path() + "/" + item_string; //return the full path } QStringList CFMan::get_sel_fnames() { if (! selectionModel()->hasSelection()) return QStringList(); QModelIndexList il = selectionModel()->QItemSelectionModel::selectedRows (0); QStringList li; foreach (QModelIndex index, il) { QString item_string = index.data().toString(); if (item_string != "..") { QString full_path = dir.path() + "/" + item_string; li.append (full_path); } } return li; } void CFMan::refresh() { QString current; if (selectionModel()->hasSelection()) { QModelIndex index = selectionModel()->currentIndex(); current = index.data().toString(); } nav (dir.path()); QModelIndex index = index_from_name (current); selectionModel()->setCurrentIndex (index, QItemSelectionModel::Select | QItemSelectionModel::Rows); scrollTo (index); } const QModelIndex CFMan::index_from_idx (int idx) { QStandardItem *item = mymodel->item (idx); if (item) return mymodel->indexFromItem (item); else return QModelIndex(); } int CFMan::get_sel_index() { if (! selectionModel()->hasSelection()) return -1; QModelIndex index = selectionModel()->currentIndex(); return index.row(); } void CFMan::mouseMoveEvent (QMouseEvent *event) { if (! (event->buttons() & Qt::LeftButton)) return; QStringList l = get_sel_fnames(); if (l.size() < 1) return; QDrag *drag = new QDrag (this); QMimeData *mimeData = new QMimeData; QList list; foreach (QString fn, l) list.append (QUrl::fromLocalFile (fn)); mimeData->setUrls (list); drag->setMimeData (mimeData); if (drag->exec (Qt::CopyAction | Qt::MoveAction | Qt::LinkAction) == Qt::MoveAction) refresh(); event->accept(); } void CFMan::keyPressEvent (QKeyEvent *event) { if (event->key() == Qt::Key_Insert) { bool sel = false; QModelIndex index = selectionModel()->currentIndex(); int row = index.row(); if (selectionModel()->isSelected (index)) sel = true; sel = ! sel; if (sel) selectionModel()->select (index, QItemSelectionModel::Select | QItemSelectionModel::Rows); else selectionModel()->select (index, QItemSelectionModel::Deselect | QItemSelectionModel::Rows); if (row < mymodel->rowCount() - 1) { QModelIndex newindex = mymodel->index (++row, 0); selectionModel()->setCurrentIndex (newindex, QItemSelectionModel::Current | QItemSelectionModel::Rows); scrollTo (newindex); } event->accept(); return; } if (event->key() == Qt::Key_Backspace) { dir_up(); event->accept(); return; } if (event->key() == Qt::Key_Return) { tv_activated (currentIndex()); event->accept(); return; } if (event->key() == Qt::Key_Up) { if (currentIndex().row() == 0) { event->accept(); return; } selectionModel()->setCurrentIndex (indexAbove (currentIndex()), QItemSelectionModel::Rows | QItemSelectionModel::NoUpdate); event->accept(); return; } if (event->key() == Qt::Key_Down) { if (currentIndex().row() == mymodel->rowCount() - 1) { event->accept(); return; } selectionModel()->setCurrentIndex (indexBelow(currentIndex()), QItemSelectionModel::Rows | QItemSelectionModel::NoUpdate); event->accept(); return; } if (event->key() == Qt::Key_PageUp) { QModelIndex idx = moveCursor (QAbstractItemView::MovePageUp, Qt::NoModifier); selectionModel()->setCurrentIndex (idx, QItemSelectionModel::Rows | QItemSelectionModel::NoUpdate); event->accept(); return; } if (event->key() == Qt::Key_PageDown) { QModelIndex idx = moveCursor (QAbstractItemView::MovePageDown, Qt::NoModifier); selectionModel()->setCurrentIndex (idx, QItemSelectionModel::Rows | QItemSelectionModel::NoUpdate); event->accept(); return; } if (event->key() == Qt::Key_End) { QModelIndex idx = mymodel->index (mymodel->rowCount() - 1, 0); selectionModel()->setCurrentIndex (idx, QItemSelectionModel::Rows | QItemSelectionModel::NoUpdate ); event->accept(); return; } if (event->key() == Qt::Key_Home) { QModelIndex idx = mymodel->index (0, 0); selectionModel()->setCurrentIndex (idx, QItemSelectionModel::Rows | QItemSelectionModel::NoUpdate); event->accept(); return; } QTreeView::keyPressEvent (event); } void CFMan::drawRow (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { if (index.row() == currentIndex().row()) { QStyleOptionViewItem current_option = option; QTreeView::drawRow (painter, current_option, index); QStyleOptionFocusRect o; o.rect = option.rect.adjusted(1,1,-1,-1); o.state |= QStyle::State_KeyboardFocusChange; o.state |= QStyle::State_Item; //o.backgroundColor = palette().color(QPalette::Background); //o.backgroundColor = QColor ("red"); QApplication::style()->drawPrimitive (QStyle::PE_FrameFocusRect, &o, painter); QRect r = option.rect.adjusted (1, 1, -1,-1); painter->drawRect (r); } else QTreeView::drawRow (painter, option, index); } tea-qt-47.1.0/fman.h000066400000000000000000000054611346332167200141050ustar00rootroot00000000000000 /************************************************************************** * 2007-2018 by Peter Semiletov * * peter.semiletov@gmail.com * * * * 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, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * **************************************************************************/ #ifndef FMAN_H #define FMAN_H #include #include #include #include #include #include #include #include "tzipper.h" class CFMan: public QTreeView { Q_OBJECT public: CZipper zipper; QDir dir; int sort_mode; Qt::SortOrder sort_order; QStandardItemModel *mymodel; QList list; CFMan (QWidget *parent = 0); void add_entry (const QFileInfo &fi); void append_dot_entry (const QString &fname); const QModelIndex index_from_name (const QString &name); const QModelIndex index_from_idx (int idx); int get_sel_index(); void nav (const QString &path); QString get_sel_fname(); QStringList get_sel_fnames(); public slots: void tv_activated (const QModelIndex &index); void refresh(); void dir_up(); void cb_fman_currentChanged (const QModelIndex ¤t, const QModelIndex &previous); void header_view_sortIndicatorChanged (int logicalIndex, Qt::SortOrder order); signals: void file_activated (const QString &path); void dir_changed (const QString &path); void current_file_changed (const QString &path, const QString &just_name); protected: void mouseMoveEvent (QMouseEvent *event); void keyPressEvent (QKeyEvent *event); void drawRow (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; }; #endif tea-qt-47.1.0/fontbox.cpp000066400000000000000000000021751346332167200151750ustar00rootroot00000000000000/* this code is Public Domain */ #include #include #include #include #include #include "fontbox.h" CFontBox::CFontBox (QWidget *parent): QWidget (parent) { QVBoxLayout *h_box = new QVBoxLayout; setLayout (h_box); QFontComboBox *cf = new QFontComboBox(); QSpinBox *spb_font_size = new QSpinBox (this); spb_font_size->setRange (6, 64); spb_font_size->setValue (12); connect (spb_font_size, SIGNAL(valueChanged (int)), this, SLOT(slot_font_size_changed (int ))); h_box->addWidget (cf); h_box->addWidget (spb_font_size); h_box->addWidget (&edit); edit.setPlainText (tr("Example string")); connect (cf, SIGNAL(currentIndexChanged (const QString &)), this, SLOT(slot_fontname_changed(const QString &))); setWindowTitle (tr ("Font gallery")); setAttribute (Qt::WA_DeleteOnClose, true); } void CFontBox::slot_fontname_changed (const QString &text) { QFont f = edit.font(); f.setFamily (text); edit.setFont (f); } void CFontBox::slot_font_size_changed (int i) { QFont f = edit.font(); f.setPointSize (i); edit.setFont (f); } tea-qt-47.1.0/fontbox.h000066400000000000000000000005211346332167200146330ustar00rootroot00000000000000#ifndef FONTBOX_H #define FONTBOX_H #include #include #include class CFontBox: public QWidget { Q_OBJECT public slots: void slot_fontname_changed (const QString &text); void slot_font_size_changed (int i); public: QPlainTextEdit edit; CFontBox (QWidget *parent = 0); }; #endif tea-qt-47.1.0/gui_utils.cpp000066400000000000000000000137031346332167200155210ustar00rootroot00000000000000/* this code is Public Domain */ #include #include #include #include #include #include #include #include #include #include "gui_utils.h" #include "utils.h" void create_menu_from_list (QObject *handler, QMenu *menu, const QStringList &list, const char *method ) { menu->setTearOffEnabled (true); foreach (QString s, list) { if (! s.startsWith ("#")) { QAction *act = new QAction (s, menu->parentWidget()); handler->connect (act, SIGNAL(triggered()), handler, method); menu->addAction (act); } } } void create_menu_from_dir (QObject *handler, QMenu *menu, const QString &dir, const char *method ) { menu->setTearOffEnabled (true); QDir d (dir); if (! d.exists()) return; QFileInfoList lst_fi = d.entryInfoList (QDir::NoDotAndDotDot | QDir::AllEntries, QDir::DirsFirst | QDir::IgnoreCase | QDir::LocaleAware | QDir::Name); foreach (QFileInfo fi, lst_fi) { if (fi.isDir()) { QMenu *mni_temp = menu->addMenu (fi.fileName()); create_menu_from_dir (handler, mni_temp, fi.filePath(), method); } else { QAction *act = new QAction (fi.fileName(), menu->parentWidget()); act->setData (fi.filePath()); handler->connect (act, SIGNAL(triggered()), handler, method); menu->addAction (act); } } } //uses dir name as menuitem, no recursion /* void create_menu_from_dir_dir (QObject *handler, QMenu *menu, const QString &dir, const char *method ) { menu->setTearOffEnabled (true); QDir d (dir); if (! d.exists()) return; QFileInfoList lst_fi = d.entryInfoList (QDir::NoDotAndDotDot | QDir::Dirs, QDir::IgnoreCase | QDir::LocaleAware | QDir::Name); foreach (QFileInfo fi, lst_fi) { if (fi.isDir()) { QAction *act = new QAction (fi.fileName(), menu->parentWidget()); act->setData (fi.filePath()); handler->connect (act, SIGNAL(triggered()), handler, method); menu->addAction (act); } } } */ QImage image_scale_by (const QImage &source, bool by_side, int value, Qt::TransformationMode mode) { if (source.isNull()) return source; bool horisontal = (source.width() > source.height()); int width; int height; if (by_side) { width = value; height = value; } else { width = get_value (source.width(), value); height = get_value (source.height(), value); } if (horisontal) return source.scaledToWidth (width, mode); else return source.scaledToHeight (height, mode); } QLineEdit* new_line_edit (QBoxLayout *layout, const QString &label, const QString &def_value) { QHBoxLayout *lt_h = new QHBoxLayout; QLabel *l = new QLabel (label); QLineEdit *r = new QLineEdit; r->setText (def_value); lt_h->insertWidget (-1, l, 0, Qt::AlignLeft); lt_h->insertWidget (-1, r, 1, Qt::AlignLeft); layout->addLayout (lt_h); return r; } QSpinBox* new_spin_box (QBoxLayout *layout, const QString &label, int min, int max, int value, int step) { QHBoxLayout *lt_h = new QHBoxLayout; QLabel *l = new QLabel (label); QSpinBox *r = new QSpinBox; r->setSingleStep (step); r->setRange (min, max); r->setValue (value); lt_h->insertWidget (-1, l, 0, Qt::AlignLeft); lt_h->insertWidget (-1, r, 1, Qt::AlignLeft); layout->addLayout (lt_h, 1); return r; } QComboBox* new_combobox (QBoxLayout *layout, const QString &label, const QStringList &items, const QString &def_value) { QHBoxLayout *lt_h = new QHBoxLayout; QLabel *l = new QLabel (label); QComboBox *r = new QComboBox; r->addItems (items); r->setCurrentIndex (r->findText (def_value)); lt_h->insertWidget (-1, l, 0, Qt::AlignLeft); lt_h->insertWidget (-1, r, 1, Qt::AlignLeft); layout->addLayout (lt_h); return r; } QComboBox* new_combobox (QBoxLayout *layout, const QString &label, const QStringList &items, int index) { QHBoxLayout *lt_h = new QHBoxLayout; QLabel *l = new QLabel (label); QComboBox *r = new QComboBox; r->addItems (items); r->setCurrentIndex (index); lt_h->insertWidget (-1, l, 0, Qt::AlignLeft); lt_h->insertWidget (-1, r, 1, Qt::AlignLeft); layout->addLayout (lt_h); return r; } /* CTextListWindow::CTextListWindow (const QString &title, const QString &label_text): QDialog (0) { //setAttribute (Qt::WA_DeleteOnClose); QVBoxLayout *lt = new QVBoxLayout; QLabel *l = new QLabel (label_text); list = new QListWidget (this); lt->addWidget (l); lt->addWidget (list); QHBoxLayout *lt_h = new QHBoxLayout; QPushButton *bt_apply = new QPushButton (tr ("OK")); QPushButton *bt_exit = new QPushButton (tr ("Exit")); connect (list, SIGNAL(itemActivated (QListWidgetItem *)), this, SLOT(accept())); connect (bt_apply, SIGNAL(clicked()), this, SLOT(accept())); connect (bt_exit, SIGNAL(clicked()), this, SLOT(reject())); lt_h->addWidget (bt_apply); lt_h->addWidget (bt_exit); lt->addLayout (lt_h); setLayout (lt); setWindowTitle (title); } */ tea-qt-47.1.0/gui_utils.h000066400000000000000000000034131346332167200151630ustar00rootroot00000000000000#ifndef GUI_UTILS_H #define GUI_UTILS_H #include #include #include #include #include #include #include #include /* class CTextListWindow: public QDialog { Q_OBJECT public: QListWidget *list; CTextListWindow (const QString &title, const QString &label_text); }; */ void create_menu_from_list (QObject *handler, QMenu *menu, const QStringList &list, const char *method ); void create_menu_from_dir (QObject *handler, QMenu *menu, const QString &dir, const char *method ); /* void create_menu_from_dir_dir (QObject *handler, QMenu *menu, const QString &dir, const char *method ); */ QImage image_scale_by (const QImage &source, bool by_side, int value, Qt::TransformationMode mode); QLineEdit* new_line_edit (QBoxLayout *layout, const QString &label, const QString &def_value); QSpinBox* new_spin_box (QBoxLayout *layout, const QString &label, int min, int max, int value, int step = 1); QComboBox* new_combobox (QBoxLayout *layout, const QString &label, const QStringList &items, const QString &def_value); QComboBox* new_combobox (QBoxLayout *layout, const QString &label, const QStringList &items, int index); #endif // GUI_UTILS_H tea-qt-47.1.0/hls/000077500000000000000000000000001346332167200135735ustar00rootroot00000000000000tea-qt-47.1.0/hls/awk.xml000066400000000000000000000025451346332167200151050ustar00rootroot00000000000000 \b(BEGIN|END|if|for|function|in|else|while|do|break|continue|exit)\b \b(ARGIND|ARGC|ARGV|BINMODE|ENVIRON|ERRNO|FILENAME|FIELDWIDTHS|FS|FNR|IGNORECASE|IF|LINT|PROCINFO|TEXTDOMAIN|NF|NR|OFMT|OFS|ORS|RLENGTH|RS|RSTART|SUBSEP)\b \b(print|printf|atan2|cos|exp|int|log|rand|sin|sqrt|srand|asort|asorti|gsub|index|length|match|split|sprintf|strtonum|sub|substr|tolower|toupper|systime|mktime|strftime|and|compl|lshift|rshift|or|xor|close|delete|exit|fflush|getline|next|nextfile|return|system)\b ^#.* ("[^\"]*") ('[^']*') #.* /\* \*/ #%s #%s tea-qt-47.1.0/hls/bash.xml000066400000000000000000000021431346332167200152320ustar00rootroot00000000000000 \b(break|builtin|caller|case|command|continue|coproc|declare|do|done|elif|else|enable|esac|exit|export|fi|for|getopts|if|let|local|logout|mapfile|return|select|set|shift|shopt|test|then|typeset|until|while)\b \b(alias|bind|cd|chown|echo|eval|exec|hash|help|mdir|mkdir|printf|pwd|read|readarray|readonly|rm|source|times|trap|type|ulimit|umask|unalias|unset)\b ^#include ("[^\"]*") ('[^']*') #.* /\* \*/ #%s tea-qt-47.1.0/hls/basic.xml000066400000000000000000000027171346332167200154050ustar00rootroot00000000000000 \b(and|andalso|as|byref|call|cast|circle|cls|color|const|cptr|declare|defint|defsng|defstr|delete|dim|do|draw|dynamic|else|end|enum|eqv|erase|exit)|explicit|extern|for|function|get|getkey|if|imp|inkey|input|is|line|locate|loop|mod|new|next|not|option|or|orelse|peek|poke|printprivate|procptr|public|put|redim|return|scope|screen|screenres|shared|shl|shr|sleep|strptr|sub|then|type|union|until|var|varptr|wend|while|with|xor\b \b(byte|const|double|integer|long|longint|pointer|ptr|short|single|static|string|ubyte|uinteger|ulong|ulongint|unsigned|wstring|zstring)\b ^#include ^#.* ("[^\"]*") '[^\n]* rem [^\n]* /\* \*/ ' %s tea-qt-47.1.0/hls/clike.xml000066400000000000000000000034311346332167200154050ustar00rootroot00000000000000 \b(asm|asm|auto|break|case|catch|catch|class|const|const_cast|const_cast|continue|default|delete|do|dynamic_cast|dynamic_cast|else|enum|explicit|export|extern|false|for|foreach|friend|goto|if|inline|mutable|namespace|namespace|new|noexcept|operator|private|protected|public|register|reinterpret_cast|reinterpret_cast|return|signals|sizeof|slots|static|static_cast|static_cast|struct|switch|template|this|throw|throw|true|try|typedef|typeid|typename|union|using|virtual|volatile|while)\b \b(bool|char|double|float|int|long| short|signed|size_t|unsigned|uint|void|wchar_t)\b \bQ[A-Za-z0-9_]+\b \bC[A-Za-z0-9_]+\b [-=\+\*\/\(\)\[]|] ^#include ^[a-zA-Z_][a-zA-Z0-9_]*\:$ ^#.* ("[^\"]*") ('[^']*') //[^\n]* /\* \*/ /*%s*/ //%s tea-qt-47.1.0/hls/cs.xml000066400000000000000000000024361346332167200147270ustar00rootroot00000000000000 \b(as|base|break|case|catch|checked|class|const|continue|default|delegate|do|else|enum|event|explicit|extern|false|finally|fixed|for|foreach|goto|if|implicit|in|interface|internal|is|lock|namespace|new|null|operator|out|override|params|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|struct|switch|this|throw|true|try|typeof|unchecked|unsafe|using|virtual|volatile|while)\b \b(bool|byte|char|decimal|double|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void)\b ^#.* ("[^\"]*") ('[^']*') //[^\n]* /\* \*/ /*%s*/ //%s tea-qt-47.1.0/hls/d.xml000066400000000000000000000022401346332167200145360ustar00rootroot00000000000000 \b(alias|align|assert|auto|body|break|case|cast|catch|class|const|continue|default|delegate|delete|do|else|enum|finally|for|foreach|function|if|import|in|is|module|new|out|private|private|public|return|scope|static|struct|super|switch|template|this|throw|try|typedef|typeof|union|version|volatile|while)\b \b(bit|bool||byte|cdouble|cent|cfloat|char|creal|dchar|double|float|ifloat|ifoduble|int|ireal|long|real|short|ubyte|ucent|uint|ulong|ushort|void|wchar)\b ("[^\"]*") ('[^']*') //[^\n]* /\* \*/ /*%s*/ //%s tea-qt-47.1.0/hls/fortran.xml000066400000000000000000000025051346332167200157720ustar00rootroot00000000000000 \b(.and.|.eq.|.eqv.|.ge.|.gt.|.le.|.lt.|.ne.|.neqv.|.not.|.or.|call|case|contains|continue|cycle|default|do|else|elsewhere|end|enddo|ednforall|endwhere|endif|exit|forall|function|if|implicit|include|interface|module|module|print|program|recursive|return|select|stop|subroutine|then|type|use|where|while|write)\b \b(character|complex|data|double|integer|logical|real)\b \b(parameter|pointer|target|allocatable|dimension|pure|public|private|intent|optional|result|save|external|intrinsic)\b ("[^\"]*") ('[^']*') [-=\+\*\/\(\)\[]|] ![^\n]* /\* \*/ !%s tea-qt-47.1.0/hls/java.xml000066400000000000000000000025231346332167200152400ustar00rootroot00000000000000 \b(boolean|byte|char|double|float|int|long|short|void)\b \b(abstract|assert|break|byte|case|catch|class|const|continue|default|do|else|enum|extends|false|final|finally|for|goto|if|implements|import|instanceof|interface|native|new|package|private|protected|public|return|static|strictfp|super|switch|synchronized|this|throw|throws|transient|true|try|volatile|while)\b \b[A-Za-z0-9_]+(?=\() ^#import ^#.* ("[^\"]*") ('[^']*') //[^\n]* /\* \*/ /*%s*/ //%s tea-qt-47.1.0/hls/lilypond.xml000066400000000000000000000012451346332167200161510ustar00rootroot00000000000000 \\[A-Za-z]+\b ("[^\"]*") ('[^']*') %[^\n]* %\{ %\} %{%s%} %%s tea-qt-47.1.0/hls/lout.xml000066400000000000000000000011571346332167200153040ustar00rootroot00000000000000 @[A-Z,a-z]+ ("[^\"]*") ('[^']*') #[^\n]* /\* \*/ #%s tea-qt-47.1.0/hls/lua.xml000066400000000000000000000022261346332167200151000ustar00rootroot00000000000000 \b(and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b \b(_G|_VERSION|assert|collectgarbage|dofile|error|getenv|getmetatable|ipairs|load|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\b ^#.* ("[^\"]*") ('[^']*') --[^\n]* --\[\[ --\]\] --[[%s--]] --%s tea-qt-47.1.0/hls/nasm.xml000066400000000000000000000326771346332167200152720ustar00rootroot00000000000000 \b(aaa|aad|aam|aas|abb|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aepl|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andl|andnpd|andnps|andpd|andps|blendpd|blendps|blendvpd|blendvps|bound|bsf|bswap|bt|btc|btr|bts|call|cbw|cdq|cdqe|clc|cld|clflush|clgi|cli|clts|cmc|cmovcc|cmp|cmpeqpd|cmpeqps|cmpeqsd|cmpeqss|cmplepd|cmpleps|cmplesd|cmpless|cmpltpd|cmpltps|cmpltsd|cmpltss|cmpneqpd|cmpneqps|cmpneqsd|cmpneqss|cmpnlepd|cmpnleps|cmpnlesd|cmpnless|cmpnltpd|cmpnltps|cmpnltsd|cmpnltss|cmpordpd|cmpordps|cmpordsd|cmpordss|cmppd|cmpps|cmpsb|cmpsd|cmpsq|cmpss|cmpsw|cmpunordpd|cmpunordps|cmpunordsd|cmpunordss|cmpxchg|cmpxchg16b|cmpxchg8b|comeqpd|comeqps|comeqsd|comeqss|comfalsepd|comfalseps|comfalsesd|comfalsess|comisd|comiss|comlepd|comleps|comlesd|comless|comltpd|comltps|comltsd|comltss|comneqpd|comneqps|comneqsd|comneqss|comnlepd|comnleps|comnlesd|comnless|comnltpd|comnltps|comnltsd|comnltss|comordpd|comordps|comordsd|comordss|compd|comps|comsd|comss|comtruepd|comtrueps|comtruesd|comtruess|comueqpd|comueqps|comueqsd|comueqss|comulepd|comuleps|comulesd|comuless|comultpd|comultps|comultsd|comultss|comuneqpd|comuneqps|comuneqsd|comuneqss|comunlepd|comunleps|comunlesd|comunless|comunltpd|comunltps|comunltsd|comunltss|comunordpd|comunordps|comunordsd|comunordss|cqo|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtph2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2ph|cvtps2pi|cvtsd2si|cvtsd2ss|cvtsi2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvttpd2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cwde|db|dd|dec|div|divpd|divps|divsd|divss|do|dppd|dpps|dq|dt|dw|dy|emms|endstruc|enter|equ|extractps|extrq|fadd|faddp|fbld|fbstp|fchs|fclex|fcmovb|fcmovbe|fcmove|fcmovnb|fcmovnbe|fcmovne|fcmovnu|fcmovu|fcom|fcomi|fcomip|fcomp|fcompp|fcos|fdecstp|fdisi|fdiv|fdivp|fdivr|fdivrp|femms|feni|ffree|ffreep|fiadd|ficom|ficomp|fidiv|fidivr|fild|fimul|fincstp|finit|fist|fistp|fisttp|fisub|fisubr|fld|fld1|fldcw|fldenv|fldl2e|fldl2t|fldlg2|fldln2|fldpi|fldz|fmaddpd|fmaddps|fmaddsd|fmaddss|fmsubpd|fmsubps|fmsubsd|fmsubss|fmul|fmulp|fnclex|fndisi|fneni|fninit|fnmaddpd|fnmaddps|fnmaddsd|fnmaddss|fnmsubpd|fnmsubps|fnmsubsd|fnmsubss|fnop|fnsave|fnstcw|fnstenv|fnstsw|fpatan|fprem|fprem1|fptan|frczpd|frczps|frczsd|frczss|frndint|frstor|fsave|fscale|fsetpm|fsin|fsincos|fsqrt|fst|fstcw|fstenv|fstp|fstsw|fsub|fsubp|fsubr|fsubrp|ftst|fucom|fucomi|fucomip|fucomp|fucompp|fwait|fxam|fxch|fxrstor|fxsave|getsec|haddpd|haddps|hlt|hsubpd|hsubps|ibts|icebp|idiv|imul|in|inc|incbin|insb|insd|insertps|insertq|insw|int|int01|int03|int1|int3|into|invd|invept|invlpg|invlpga|invvpid|iret|iretd|iretq|iretw|ja|jae|jb|jbe|jcc|jcxz|je|jecxz|jge|jl|jle|jmp|jmpe|jne|jo|jrcxz|jz|lahf|lar|lddqu|ldmxcsr|lds|lea|leave|les|lfence|lfs|lgdt|lgs|lidt|lldt|lmsw|loadall|loadall286|lock|lodsb|lodsd|lodsq|lodsw|loop|loope|loopne|loopnz|loopx|loopz|lsl|lss|ltr|lzcnt|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|montmul|mov|movapd|movaps|movbe|movd|movddup|movdq2q|movdqa|movdqu|movhlps|movhpd|movhps|movl|movlhps|movlpd|movlps|movmskpd|movmskps|movntdq|movntdqa|movnti|movntpd|movntps|movntq|movntsd|movntss|movq|movq2dq|movs|movsb|movsbl|movsbw|movsd|movshdup|movsldup|movsq|movss|movsw|movswl|movsx|movsxd|movupd|movups|movz|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|nop|not|notl|or|orl|orpd|orps|out|outsb|outsd|outsw|pabsb|pabsd|pabsw|packssdw|packsswb|packusdw|packuswb|paddb|paddd|paddq|paddsb|paddsiw|paddsw|paddusb|paddusw|paddw|palignr|pand|pandn|pause|paveb|pavgb|pavgusb|pavgw|pblendvb|pblendw|pclmulhqhqdq|pclmulhqlqdq|pclmullqhqdq|pclmullqlqdq|pclmulqdq|pcmov|pcmpeqb|pcmpeqd|pcmpeqq|pcmpeqw|pcmpestri|pcmpestrm|pcmpgtb|pcmpgtd|pcmpgtq|pcmpgtw|pcmpistri|pcmpistrm|pcomb|pcomd|pcomeqb|pcomeqd|pcomeqq|pcomequb|pcomequd|pcomequq|pcomequw|pcomeqw|pcomfalseb|pcomfalsed|pcomfalseq|pcomfalseub|pcomfalseud|pcomfalseuq|pcomfalseuw|pcomfalsew|pcomgeb|pcomged|pcomgeq|pcomgeub|pcomgeud|pcomgeuq|pcomgeuw|pcomgew|pcomgtb|pcomgtd|pcomgtq|pcomgtub|pcomgtud|pcomgtuq|pcomgtuw|pcomgtw|pcomleb|pcomled|pcomleq|pcomleub|pcomleud|pcomleuq|pcomleuw|pcomlew|pcomltb|pcomltd|pcomltq|pcomltub|pcomltud|pcomltuq|pcomltuw|pcomltw|pcomneqb|pcomneqd|pcomneqq|pcomnequb|pcomnequd|pcomnequq|pcomnequw|pcomneqw|pcomq|pcomtrueb|pcomtrued|pcomtrueq|pcomtrueub|pcomtrueud|pcomtrueuq|pcomtrueuw|pcomtruew|pcomub|pcomud|pcomuq|pcomuw|pcomw|pdistib|permpd|permps|pextrb|pextrd|pextrq|pextrw|pf2id|pf2iw|pfacc|pfadd|pfcmpeq|pfcmpge|pfcmpgt|pfmax|pfmin|pfmul|pfnacc|pfpnacc|pfrcp|pfrcpit1|pfrcpit2|pfrcpv|pfrsqit1|pfrsqrt|pfrsqrtv|pfsub|pfsubr|phaddbd|phaddbq|phaddbw|phaddd|phadddq|phaddsw|phaddubd|phaddubq|phaddubw|phaddudq|phadduwd|phadduwq|phaddw|phaddwd|phaddwq|phminposuw|phsubbw|phsubd|phsubdq|phsubsw|phsubw|phsubwd|pi2fd|pi2fw|pinsrb|pinsrd|pinsrq|pinsrw|pmachriw|pmacsdd|pmacsdqh|pmacsdql|pmacssdd|pmacssdqh|pmacssdql|pmacsswd|pmacssww|pmacswd|pmacsww|pmadcsswd|pmadcswd|pmaddubsw|pmaddwd|pmagw|pmaxsb|pmaxsd|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsxbd|pmovsxbq|pmovsxbw|pmovsxdq|pmovsxwd|pmovsxwq|pmovzxbd|pmovzxbq|pmovzxbw|pmovzxdq|pmovzxwd|pmovzxwq|pmuldq|pmulhriw|pmulhrsw|pmulhrwa|pmulhrwc|pmulhuw|pmulhw|pmulld|pmullw|pmuludq|pmvgezb|pmvlzb|pmvnzb|pmvzb|pop|popa|popad|popaw|popcnt|popf|popfd|popfq|popfw|por|pperm|prefetch|prefetchnta|prefetcht0|prefetcht1|prefetcht2|prefetchw|protb|protd|protq|protw|psadbw|pshab|pshad|pshaq|pshaw|pshlb|pshld|pshlq|pshlw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignd|psignw|pslld|pslldq|psllq|psllw|psrad|psraw|psrld|psrldq|psrlq|psrlw|psubb|psubd|psubq|psubsb|psubsiw|psubsw|psubusb|psubusw|psubw|pswapd|ptest|punpckhbw|punpckhdq|punpckhqdq|punpckhwd|punpcklbw|punpckldq|punpcklqdq|punpcklwd|push|pusha|pushad|pushaw|pushf|pushfd|pushfq|pushfw|pxor|rcl|rcpps|rcpss|rcr|rdm|rdmsr|rdpmc|rdshr|rdtsc|rdtscp|resb|resd|reso|resq|rest|resw|resy|ret|retf|retn|rol|ror|roundpd|roundps|roundsd|roundss|rsdc|rsldt|rsm|rsqrtps|rsqrtss|rsts|sahf|sal|salc|sar|sbb|scasb|scasd|scasq|scasw|scl|scr|setcc|sfence|sgdt|shl|shld|shr|shrd|shufpd|shufps|sidt|skinit|sldt|smi|smint|smintold|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stgi|sti|stmxcsr|stosb|stosd|stosq|stosw|str|strict|struc|sub|subpd|subps|subsd|subss|svdc|svldt|svts|swapgs|syscall|sysenter|sysexit|sysret|systenter|test|times|ucomisd|ucomiss|ud0|ud1|ud2|ud2a|ud2b|umov|unpckhpd|unpckhps|unpcklpd|unpcklps|vaddpd|vaddps|vaddsd|vaddss|vaddsubpd|vaddsubps|vaesdec|vaesdeclast|vaesenc|vaesenclast|vaesimc|vaeskeygenassist|vandnpd|vandnps|vandpd|vandps|vblendpd|vblendps|vblendvpd|vblendvps|vbroadcastf128|vbroadcastsd|vbroadcastss|vcmpeq_ospd|vcmpeq_osps|vcmpeq_ossd|vcmpeq_osss|vcmpeq_uqpd|vcmpeq_uqps|vcmpeq_uqsd|vcmpeq_uqss|vcmpeq_uspd|vcmpeq_usps|vcmpeq_ussd|vcmpeq_usss|vcmpeqpd|vcmpeqps|vcmpeqsd|vcmpeqss|vcmpfalse_ospd|vcmpfalse_osps|vcmpfalse_ossd|vcmpfalse_osss|vcmpfalsepd|vcmpfalseps|vcmpfalsesd|vcmpfalsess|vcmpge_oqpd|vcmpge_oqps|vcmpge_oqsd|vcmpge_oqss|vcmpgepd|vcmpgeps|vcmpgesd|vcmpgess|vcmpgt_oqpd|vcmpgt_oqps|vcmpgt_oqsd|vcmpgt_oqss|vcmpgtpd|vcmpgtps|vcmpgtsd|vcmpgtss|vcmple_oqpd|vcmple_oqps|vcmple_oqsd|vcmple_oqss|vcmplepd|vcmpleps|vcmplesd|vcmpless|vcmplt_oqpd|vcmplt_oqps|vcmplt_oqsd|vcmplt_oqss|vcmpltpd|vcmpltps|vcmpltsd|vcmpltss|vcmpneq_oqpd|vcmpneq_oqps|vcmpneq_oqsd|vcmpneq_oqss|vcmpneq_ospd|vcmpneq_osps|vcmpneq_ossd|vcmpneq_osss|vcmpneq_uspd|vcmpneq_usps|vcmpneq_ussd|vcmpneq_usss|vcmpneqpd|vcmpneqps|vcmpneqsd|vcmpneqss|vcmpnge_uqpd|vcmpnge_uqps|vcmpnge_uqsd|vcmpnge_uqss|vcmpngepd|vcmpngeps|vcmpngesd|vcmpngess|vcmpngt_uqpd|vcmpngt_uqps|vcmpngt_uqsd|vcmpngt_uqss|vcmpngtpd|vcmpngtps|vcmpngtsd|vcmpngtss|vcmpnle_uqpd|vcmpnle_uqps|vcmpnle_uqsd|vcmpnle_uqss|vcmpnlepd|vcmpnleps|vcmpnlesd|vcmpnless|vcmpnlt_uqpd|vcmpnlt_uqps|vcmpnlt_uqsd|vcmpnlt_uqss|vcmpnltpd|vcmpnltps|vcmpnltsd|vcmpnltss|vcmpord_spd|vcmpord_sps|vcmpord_ssd|vcmpord_sss|vcmpordpd|vcmpordps|vcmpordsd|vcmpordss|vcmppd|vcmpps|vcmpsd|vcmpss|vcmptrue_uspd|vcmptrue_usps|vcmptrue_ussd|vcmptrue_usss|vcmptruepd|vcmptrueps|vcmptruesd|vcmptruess|vcmpunord_spd|vcmpunord_sps|vcmpunord_ssd|vcmpunord_sss|vcmpunordpd|vcmpunordps|vcmpunordsd|vcmpunordss|vcomisd|vcomiss|vcvtdq2pd|vcvtdq2ps|vcvtpd2dq|vcvtpd2ps|vcvtph2ps|vcvtps2dq|vcvtps2pd|vcvtps2ph|vcvtsd2si|vcvtsd2ss|vcvtsi2sd|vcvtsi2ss|vcvtss2sd|vcvtss2si|vcvttpd2dq|vcvttps2dq|vcvttsd2si|vcvttss2si|vdivpd|vdivps|vdivsd|vdivss|vdppd|vdpps|verr|verw|vextractf128|vextractps|vfmadd123pd|vfmadd123ps|vfmadd123sd|vfmadd123ss|vfmadd132pd|vfmadd132ps|vfmadd132sd|vfmadd132ss|vfmadd213pd|vfmadd213ps|vfmadd213sd|vfmadd213ss|vfmadd231pd|vfmadd231ps|vfmadd231sd|vfmadd231ss|vfmadd312pd|vfmadd312ps|vfmadd312sd|vfmadd312ss|vfmadd321pd|vfmadd321ps|vfmadd321sd|vfmadd321ss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsub123pd|vfmaddsub123ps|vfmaddsub132pd|vfmaddsub132ps|vfmaddsub213pd|vfmaddsub213ps|vfmaddsub231pd|vfmaddsub231ps|vfmaddsub312pd|vfmaddsub312ps|vfmaddsub321pd|vfmaddsub321ps|vfmaddsubpd|vfmaddsubps|vfmsub123pd|vfmsub123ps|vfmsub123sd|vfmsub123ss|vfmsub132pd|vfmsub132ps|vfmsub132sd|vfmsub132ss|vfmsub213pd|vfmsub213ps|vfmsub213sd|vfmsub213ss|vfmsub231pd|vfmsub231ps|vfmsub231sd|vfmsub231ss|vfmsub312pd|vfmsub312ps|vfmsub312sd|vfmsub312ss|vfmsub321pd|vfmsub321ps|vfmsub321sd|vfmsub321ss|vfmsubadd123pd|vfmsubadd123ps|vfmsubadd132pd|vfmsubadd132ps|vfmsubadd213pd|vfmsubadd213ps|vfmsubadd231pd|vfmsubadd231ps|vfmsubadd312pd|vfmsubadd312ps|vfmsubadd321pd|vfmsubadd321ps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfmsubss|vfnmadd123pd|vfnmadd123ps|vfnmadd123sd|vfnmadd123ss|vfnmadd132pd|vfnmadd132ps|vfnmadd132sd|vfnmadd132ss|vfnmadd213pd|vfnmadd213ps|vfnmadd213sd|vfnmadd213ss|vfnmadd231pd|vfnmadd231ps|vfnmadd231sd|vfnmadd231ss|vfnmadd312pd|vfnmadd312ps|vfnmadd312sd|vfnmadd312ss|vfnmadd321pd|vfnmadd321ps|vfnmadd321sd|vfnmadd321ss|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsub123pd|vfnmsub123ps|vfnmsub123sd|vfnmsub123ss|vfnmsub132pd|vfnmsub132ps|vfnmsub132sd|vfnmsub132ss|vfnmsub213pd|vfnmsub213ps|vfnmsub213sd|vfnmsub213ss|vfnmsub231pd|vfnmsub231ps|vfnmsub231sd|vfnmsub231ss|vfnmsub312pd|vfnmsub312ps|vfnmsub312sd|vfnmsub312ss|vfnmsub321pd|vfnmsub321ps|vfnmsub321sd|vfnmsub321ss|vfnmsubpd|vfnmsubps|vfnmsubsd|vfnmsubss|vfrczpd|vfrczps|vfrczsd|vfrczss|vhaddpd|vhaddps|vhsubpd|vhsubps|vinsertf128|vinsertps|vlddqu|vldmxcsr|vldqqu|vmaskmovdqu|vmaskmovpd|vmaskmovps|vmaxpd|vmaxps|vmaxsd|vmaxss|vmcall|vmclear|vminpd|vminps|vminsd|vminss|vmlaunch|vmload|vmmcall|vmovapd|vmovaps|vmovd|vmovddup|vmovdqa|vmovdqu|vmovhlps|vmovhpd|vmovhps|vmovlhps|vmovlpd|vmovlps|vmovmskpd|vmovmskps|vmovntdq|vmovntdqa|vmovntpd|vmovntps|vmovntqq|vmovq|vmovqqa|vmovqqu|vmovsd|vmovshdup|vmovsldup|vmovss|vmovupd|vmovups|vmpsadbw|vmptrld|vmptrst|vmread|vmresume|vmrun|vmsave|vmulpd|vmulps|vmulsd|vmulss|vmwrite|vmxoff|vmxon|vorpd|vorps|vpabsb|vpabsd|vpabsw|vpackssdw|vpacksswb|vpackusdw|vpackuswb|vpaddb|vpaddd|vpaddq|vpaddsb|vpaddsw|vpaddusb|vpaddusw|vpaddw|vpalignr|vpand|vpandn|vpavgb|vpavgw|vpblendvb|vpblendw|vpclmulhqhqdq|vpclmulhqlqdq|vpclmullqhqdq|vpclmullqlqdq|vpclmulqdq|vpcmov|vpcmpeqb|vpcmpeqd|vpcmpeqq|vpcmpeqw|vpcmpestri|vpcmpestrm|vpcmpgtb|vpcmpgtd|vpcmpgtq|vpcmpgtw|vpcmpistri|vpcmpistrm|vpcomb|vpcomd|vpcomq|vpcomub|vpcomud|vpcomuq|vpcomuw|vpcomw|vperm2f128|vpermil2pd|vpermil2ps|vpermilmo2pd|vpermilmo2ps|vpermilmz2pd|vpermilmz2ps|vpermilpd|vpermilps|vpermiltd2pd|vpermiltd2ps|vpextrb|vpextrd|vpextrq|vpextrw|vphaddbd|vphaddbq|vphaddbw|vphaddd|vphadddq|vphaddsw|vphaddubd|vphaddubq|vphaddubwd|vphaddudq|vphadduwd|vphadduwq|vphaddw|vphaddwd|vphaddwq|vphminposuw|vphsubbw|vphsubd|vphsubdq|vphsubsw|vphsubw|vphsubwd|vpinsrb|vpinsrd|vpinsrq|vpinsrw|vpmacsdd|vpmacsdqh|vpmacsdql|vpmacssdd|vpmacssdqh|vpmacssdql|vpmacsswd|vpmacssww|vpmacswd|vpmacsww|vpmadcsswd|vpmadcswd|vpmaddubsw|vpmaddwd|vpmaxsb|vpmaxsd|vpmaxsw|vpmaxub|vpmaxud|vpmaxuw|vpminsb|vpminsd|vpminsw|vpminub|vpminud|vpminuw|vpmovmskb|vpmovsxbd|vpmovsxbq|vpmovsxbw|vpmovsxdq|vpmovsxwd|vpmovsxwq|vpmovzxbd|vpmovzxbq|vpmovzxbw|vpmovzxdq|vpmovzxwd|vpmovzxwq|vpmuldq|vpmulhrsw|vpmulhuw|vpmulhw|vpmulld|vpmullw|vpmuludq|vpor|vpperm|vprotb|vprotd|vprotq|vprotw|vpsadbw|vpshab|vpshad|vpshaq|vpshaw|vpshlb|vpshld|vpshlq|vpshlw|vpshufb|vpshufd|vpshufhw|vpshuflw|vpsignb|vpsignd|vpsignw|vpslld|vpslldq|vpsllq|vpsllw|vpsrad|vpsraw|vpsrld|vpsrldq|vpsrlq|vpsrlw|vpsubb|vpsubd|vpsubq|vpsubsb|vpsubsw|vpsubusb|vpsubusw|vpsubw|vptest|vpunpckhbw|vpunpckhdq|vpunpckhqdq|vpunpckhwd|vpunpcklbw|vpunpckldq|vpunpcklqdq|vpunpcklwd|vpxor|vrcpps|vrcpss|vroundpd|vroundps|vroundsd|vroundss|vrsqrtps|vrsqrtss|vshufpd|vshufps|vsqrtpd|vsqrtps|vsqrtsd|vsqrtss|vstmxcsr|vsubpd|vsubps|vsubsd|vsubss|vtestpd|vtestps|vucomisd|vucomiss|vunpckhpd|vunpckhps|vunpcklpd|vunpcklps|vxorpd|vxorps|vzeroall|vzeroupper|wait|wbinvd|wrmsr|wrshr|xadd|xbts|xchg|xchgb|xchgl|xchgw|xcryptcbc|xcryptcfb|xcryptctr|xcryptecb|xcryptofb|xgetbv|xlat|xlatb|xor|xorl|xorpd|xorps|xrstor|xsave|xsetbv|xsha1|xsha256|xstore|segment)\b %[A-Za-z]*\b ^[a-zA-Z_][a-zA-Z0-9_]*\: ^#include ("[^\"]*") ('[^']*') ;[^\n]* /\* \*/ #%s tea-qt-47.1.0/hls/nsis.xml000066400000000000000000000033151346332167200152730ustar00rootroot00000000000000 \b(abort|break|call|case|crccheck|createdirectory|default|do|else|endif|endswitch|endwhile|file|for|function|functionend|goto|if|installdir|insttype|loopuntil|name|name|next|outfile|outfile|page|pageex|pageexend|requestexecutionlevel|requestexecutionlevel|section|sectionend|sectionend|sectiongroup|sectionin|setcompressor|setoutpath|setshellvarcontext|showinstdetails|showuninstdetails|switch|var|while|writeregstr|writeuninstaller)\b \b(addbrandingimage|allowrootdirinstall|autoclosewindow|bgfont|bggradient|brandingtext|caption|changeui|checkbitmap|completedtext|componenttext|crccheck|detailsbuttontext|dirtext|dirvar|dirverify|fileerrortext|icon|installbuttontext|installcolors|installdir|installdirregkey)\b \b(createshortcut|delete|deleteregkey|detailprint|dialog|findwindow|getdlgitem|intcmp|intop|messagebox|readregstr|rmdir|sectiongettext|sendmessage|setctlcolors|strcpy)\b ("[^\"]*") ('[^']*') ^\!.* \;[^\n]* /\* \*/ ;%s tea-qt-47.1.0/hls/pascal.xml000066400000000000000000000041141346332167200155600ustar00rootroot00000000000000 \b(absolute|and|array|as|asm|begin|break|case|class|const|constructor|continue|destructor|dispose|div|do|downto|else|end|except|exit|exports|false|file|finalization|finally|for|function|goto|if|implementation|in|inherited|initialization|inline|interface|is|label|library|mod|new|nil|not|object|of|on|on|operator|or|out|packed|procedure|program|property|raise|record|reintroduce|repeat|self|set|shl|shr|string|then|threadvar|to|true|try|type|unit|until|uses|var|while|with|xor)\b \b(abstract|alias|assembler|cdecl|cppdecl|default|export|external|far|far16|forward|index|local|name|near|nostackframe|oldfpccall|override|pascal|private|protected|public|published|read|register|safecall|softfloat|stdcall|virtual|write)\b \b(ansistring|boolean|byte|bytebool|cardinal|char|comp|currency|double|extended|int64|integer|longbool|longint|longword|pchar|qword|real|shortint|single|smallint|string|widechar|word)\b \bT[A-Za-z0-9_]+\b \bP[A-Za-z0-9_]+\b \bR[A-Za-z0-9_]+\b ^[a-zA-Z_][a-zA-Z0-9_]*\: ^#uses ('[^']*') ('[^']*') //[^\n]* \{ \} {%s} //%s tea-qt-47.1.0/hls/perl.xml000066400000000000000000000017231346332167200152620ustar00rootroot00000000000000 \b(\bmy|chdir|chomp|close|closedir|continue|defined|die|do|elsif|eof|eval|exists|foreach|getpwnam|given|glob|goto|grep|if|import|join|last|last|length|local|next|open|pop|print|printf|push|readline|redo|require|reset|return|say|scalar|shift|split|split|stat|sub|syscall|system|undef|unimport|unless|until|use|wait|waitpid|wantarray|warn|when|while)\b ("[^\"]*") ('[^']*') #[^\n]* #%s =begin* *=end tea-qt-47.1.0/hls/php.xml000066400000000000000000000022571346332167200151120ustar00rootroot00000000000000 \b(\b(and|abstract|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|false|final|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|interface|isset|list|namespace|new|old_function|or|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|true|try|unset|use|var|while|xor)\b \$[A-Za-z_][0-9A-Za-z_]*\b ('[^']*') ("[^\"]*") //.*$ //%s /\* \*/ tea-qt-47.1.0/hls/po.xml000066400000000000000000000011021346332167200147250ustar00rootroot00000000000000 \b(msgid|msgstr)\b ("[^\"]*") ^#.* #%s /\* \*/ tea-qt-47.1.0/hls/python.xml000066400000000000000000000027711346332167200156450ustar00rootroot00000000000000 \b(and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|yield)\b \b(__import__|abs|all|any|apply|basestring|bin|bool|buffer|bytearray|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b [=\+\*\/\(\)\[]|] ("[^\"]*"|'[^']*') ('[^']*') #[^\n]* """ """ """%s\n""" #/%s tea-qt-47.1.0/hls/r.xml000066400000000000000000000027301346332167200145600ustar00rootroot00000000000000 \b(FALSE|Inf|NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|NaN|NextMethod|TRUE|UseMethod|apply|break|else|for|for|function|if|in|lapply|next|repeat|switch|tapply|while)\b \b(array|complex|matrix|library)\b \b(logical|integer|real|complex|character|raw)\b \bC[A-Za-z]+\b [=\+\*\/\(\)\[]|] ^#include ^[a-zA-Z_][a-zA-Z0-9_]*\:$ ^#.* ("[^\"]*") ('[^']*') #.* /\* \*/ /*%s*/ #%s tea-qt-47.1.0/hls/seed7.xml000066400000000000000000000023271346332167200153300ustar00rootroot00000000000000 \b(action|and|array|attr|begin|case|category|const|conv|cross|digits|div|do|downto|else|elsif|end|for|found|hash|if|in|inout|is|local|loop|lpad|lpad0|mdiv|mod|not|of|otherwise|parse|range|ref|rem|repeat|result|rpad|search|set|struct|system|then|to|until|var|when|while)\b \b(biginteger|bigrational|boolean|char|color|complex|duration|expr|file|float|func|integer|object|proc|rational|string|text|time|void)\b .*include.*" ("[^\"]*") ('[^']*') #[^\n]* \(\* \*\) (* %s *) #%s tea-qt-47.1.0/hls/tex.xml000066400000000000000000000012031346332167200151110ustar00rootroot00000000000000 \\(?:[\w@]+|.) (``[^\``]*'') (`[^`]*') %.* %%s /\* \*/ tea-qt-47.1.0/hls/vala.xml000066400000000000000000000027161346332167200152460ustar00rootroot00000000000000 \b(break|case|catch|continue|default|do|else|false|finally|for|foreach|if|in|lock|null|return|switch|throw|true|try|using|while|yield)\b \b(abstract|base|class|const|construct|delegate|dynamic|ensures|enum|errordomain|extern|get|interface|namespace|out|override|private|protected|public|ref|requires|set|signal|static|struct|throws|unowned|value|var|virtual|weak|yields)\b \b(bool|char|double|float|int|int16|int32|int64|int8|long|short|size_t|ssize_t|string|uchar|uint|uint16|uint32|uint64|uint8|ulong|unichar|ushort|void)\b ^#include ^#.* ("[^\"]*") ('[^']*') //[^\n]* /\* \*/ /*%s*/ //%s tea-qt-47.1.0/hls/verilog.xml000066400000000000000000000044511346332167200157700ustar00rootroot00000000000000 \b(\cleartrace|\error|\listb;log|always|always_comb|always_ff|always_latch|and|assert|assign|begin|bitstoread|break|buf|bufif0|bufif1|case|casex|casez|cast|class|cmos|constraint|continue|countdrivers|covergroup|coverpoint|deassign|default|defparam|disable|display|do|edge|else|end|endcase|endclass|endfunction|endgroup|endinterface|endmodule|endprimitive|endprogram|endproperty|endsequence|endspecify|endtable|endtask|enum|event|exit|export|fclose|fdisplay|final|finish|fmonitor|fopen|for|force|foreach|forever|fork|fstrobe|function|fwrite|getpattern|highz0|highz1|history|if|ifnone|import|incsave|initial|inout|input|input|interface|itor|join|key|large|macromodule|medium|module|monitor|nand|negedge|new|nmos|nokey|nor|not|notif0|notif1|or|output|packed|parameter|pmos|posedge|primitive|priority|program|property|pull0|pull1|pulldown|pullup|rcmos|readmemb|readmemh|real|realtime|reg|release|repeat|req|return|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|scope|sequence|settrace|showscopes|showvars|small|specify|specparam|stop|strength|strong0|strong1|struct|struct|supply0|supply1|table|task|time|time|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|typedef|unique|vectored|virtual|wait|wand|weak0|weak1|while|wire|wor|xnor|xor)\b \b(bit|byte|chandle|int|integer|logic|logint|rand|randc|real|reg|shortint|shortreal|signed|string|time|unsigned|void)\b \bQ[A-Za-z]+\b ^`include ^`.* ("[^\"]*") ('[^']*') //[^\n]* /\* \*/ /*%s*/ //%s tea-qt-47.1.0/hls/wikitext.xml000066400000000000000000000015631346332167200161720ustar00rootroot00000000000000 (<[a-zA-Z\d:]+\b|<\?[a-zA-Z\d:]+\b|\?>|>|/>|</[a-zA-Z\d:]+>) [a-zA-Z:]+= &[a-zA-Z_][a-zA-Z0-9.:_-]*; \[|\] ("[^\"]*"|'[^']*') <!-- --> <!-- %s --> <!-- %s --> tea-qt-47.1.0/hls/xml.xml000066400000000000000000000011721346332167200151160ustar00rootroot00000000000000 <(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+> ("[^\"]*"|'[^']*') <!-- --> <!-- %s --> <!-- %s --> tea-qt-47.1.0/icons/000077500000000000000000000000001346332167200141205ustar00rootroot00000000000000tea-qt-47.1.0/icons/128/000077500000000000000000000000001346332167200144325ustar00rootroot00000000000000tea-qt-47.1.0/icons/128/tea.png000066400000000000000000000223051346332167200157130ustar00rootroot00000000000000PNG  IHDR>asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<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~Y -p',T25S;SqT\8 DGX+#Ӟ1=+)#jmiO LٍN o֖/ ؃> HqtC˒؁N]h-Ϣv,~)`Ɯri'pЈH!^^o?gă_Y$";ˉ߉^?yc,z{lzճ @V*-]IENDB`tea-qt-47.1.0/icons/32/000077500000000000000000000000001346332167200143445ustar00rootroot00000000000000tea-qt-47.1.0/icons/32/tea.png000066400000000000000000000037631346332167200156340ustar00rootroot00000000000000PNG  IHDR szzbKGD@I pHYs B(xtIME "jnUIDATXåilW{7=xf<׮ 84 qBA(M+VhTQR);" jՒj"JNuﻗhws#FZ8M`bA/<KD#4@8XZڏZgkU| L Ue,q&d]CJ[?MDXUi? 5&<AK#tdF ׾G2t1D4~t%X]r}Gk$ y HIX,t˫,yS'b-8:V=رP #I?o+Ը\.sڢgFnWk_~㙭g;y`$<ݪh zxfꈌwiSV׾Dž$jg\9Ʃm;izsQpU͝x%R~SWykHC.vm4Bsjwzn-l?̑-#Y-Oio||:t}# U LkK*K*iqZ8E+\+! ^ p1-+zdΟDi aHҞb;Y$/+zwr)܇mCyse;ȶ2onAc m%]2<9␲!qkyolyL_6Y"S- s o"M[jMޕ&".L[F;LF8Z28prS03$WJ K 5Gx,ĐMh8~Sft)"|iߞҽ7<#xop8'y͡d凴70g R. 62S]!Ac_J5|1͗*\ I2@[p[H? Y]JG  tKOdz;ía SOma2Z8;f{>s˼6q9  {.tqx2Rɂ Uh,MeaS\o ](6h"%rLτ1T%J[&ಽW/d/şgETΠ"r5xr>0t.%I hAڵT`R70f*"n9|ԩXxYM\ȁقrsuьp4*X Y2RuMDQ<90^z{#+TqĖ#>OFrGHVym{1BH˃p_&x&`vi7 ÑjDJ[$6i[Fik30RԖUVb}J1@`0:04 Z&hGbmIENDB`tea-qt-47.1.0/icons/48/000077500000000000000000000000001346332167200143535ustar00rootroot00000000000000tea-qt-47.1.0/icons/48/tea.png000066400000000000000000000072041346332167200156350ustar00rootroot00000000000000PNG  IHDR00WbKGD@I pHYs B(xtIME  &O-IDATh޵i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gPiFl'~7۳qthfID]F{Lc`W0%(dϵJ}9Nx>K,C^bzЈ;R^U8~SV[b;bfpZ;1ݕP v~OiT"sҬut`1L˺wt( |YY#FJ%F  v/u;_Ofl[3vϟ rgopbVR>;:0w-'TB}f+ j~XϋH%|z6p …G8T9>;`;,F@ 8J$K{C<uNBJN]5)cs*i8%>f5'ȓD\ _1[(B%S=|)V?G>!L1XQ/ϥ rA *ً Ϻn1$y2Dx8+7IENDB`tea-qt-47.1.0/icons/64/000077500000000000000000000000001346332167200143515ustar00rootroot00000000000000tea-qt-47.1.0/icons/64/tea.png000066400000000000000000000113151346332167200156310ustar00rootroot00000000000000PNG  IHDR@@iqbKGD@I pHYs B(xtIME 7ZIDATx՛ip\ՕzZnٖ,K,jab@6*J C*He*dj" 0T%as^l#K[%Y~;^?#˛ܪ.u^{s+x47 'X4hląpKyFO^Qj-4J8"2YHdP*0c8F5x c~R2Z? x466ݺ.L<Zhj)OH"P(Ba@hIk8G.jÕ6ROzW=0o_p ‘?9}Kq^;VHoA:ʚ.jPX)`wMB\KD)t.`I-IYS{R/ƣ5sPd%Yr+%(ftF߳$Mu[pطD  T+ztƕvƂQxy CYL Epx4x!PA y#Yɼvλhq Mu/!`m;vVƮc8rGc/ʭf)J 2޿3d%s3)^BHYk2?$p^p̱A\= gՍ 5A-ezsu[88wa͗<\eJM6PT/;Jh%P&ncV>ƞ?'/V@Znm3;U[*i4BKl Vk4~y trꎲs *{J-9RDs_}%Gc[2ri G2C?+䘠4޽2ja2aL6M^[DF;J]:7W767tv H灲P*;2X\e._rLBC@G]0΄ovI!HZlYAZ*mK4k Q ź2yCY4սpM.| ׄI)]:5,%ق'Y`W0w9QV ;כHeRŘ ‚ f:Z0CItK8ΫV`@R3J:v7Z˞fb]dzJTAV$y w p;9TrCģ v m6W5Am{u& +~ݭhOhR#(H_d8[w]Ki]($ I |67§ >R*vO*y禱}6fa:fW j<oTwdIYF(I9_=ye& `cr:/ 9AjX<$О|qe:֗+H-ߌGcu n-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G(hՎ#e<6luodl&;sg{sW\0dZLcL "6Y69LCL ;%@D<|4yƢ.zlu}:s9 "ӁIyz7 v`N7syp׵AX`.1&n Dd0<=a2h\_"Rμ#NM9UnRxXZV08 l Z勞v="TqGEd(/wum-i4- #yX`ޕ}OG9A9(2Ar*C=hPN% ]L`7SV\jK!Y [B^ >`_*E>95WYUY]b TJ.FYH6؁#@i\y"omvo^htTQ(Ua윾>kNP+ Dƻ: "b)~]:TSx>XݻܶC]VTwY`zh|fΔx0 vglTbcON}سxNxpոq׸y~IjJau|~Jb7yx?ݣC}R<9 ,'`-?0nX\֎ze⥷SUY/_x/]!ň)lٺ-d8Ϟ}#5 -p|W2yR>7͝rc^'sRUYNUe9K1屯}x?1s.l6[x<]$`TTmӍٳ)TVu/eSLʚJs㆙!FןTO@Q(^딘 0kPuxp%Ξ|Bk|́ a"u4J=F3<'("ӀJBf ڀ.`:QsP2S pVΏIENDB`tea-qt-47.1.0/icons/current-list.png000066400000000000000000000031311346332167200172570ustar00rootroot00000000000000PNG  IHDR@@iqsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDATx[lU;iK6"n i%-RbJ$0 h4D.r UC^ Q"*ƒTj@-BRӖ-!Bt=3w9sfv$`#N^fO1Eی)tS<8Kw1E@#Nmj~'/=x<n7Wz=ݞu7WUþ X4mm׌l$''aOf( 6 :nCQl9UF48w'#0 15  l{ Df(^o}b0{hrx .lu PťRqBZ(--ء,( \#(Pw7H?Bu_&IX,<4hǸ L`vfc0.Amm=^Kooo_z}}ruYfr= b>5Gu ΢UV+VjE>|, #??ψX gՇ1? WcVv* QӉ#{{Ynooҥj S=b`[M8&yf h Իj!čpmc\p8*4n)8y;z{}Tj8|o@!())TMt8P[#X+P@"◔&$ISRR]UN\\\G.{|1M%zE\23 ̘~6>9z*@)p$̎4GwH3b M6ԑӭ/wp`XYIENDB`tea-qt-47.1.0/icons/edit-copy-active.png000066400000000000000000000031151346332167200177740ustar00rootroot00000000000000PNG  IHDR@@iqs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c:pgϔ)S4''G'Oh?Qc555`Ͳo Ƙ&Lnݺ1k5+W6_YY-gddQ.ŋ'3gΨV7oެH3|7 no>Z^^S5333n *Ƨcμ)[UjaǏͮr ROM]$}JEjf~2(U5? ~GڢzFFO6/?y)] !2>~d/saډΒ$&LJe4,81m.hJ"8 =@@bLgIENDB`tea-qt-47.1.0/icons/edit-cut.png000066400000000000000000000046651346332167200163570ustar00rootroot00000000000000PNG  IHDR@@iqsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< 2IDATxlV?=[euؘH4q ͩc$AFhe :ؠ3 ۍ8HXaHGii{g6y~[QU> 5 0/Pj"D _q]y9_nApsYUȃT꺮[`yAD>7pXgAMfK J7&N7t Jw1(,,c6Hv@3̹KU vjF.#(`+EUD~ 0c5kPkDq*"q`U@7nܨZPPc!"> X+"10xS cN͝;Wz!D"qC@8Դ#.xKVV֪VW\A"~G+))I_mjզ&0aB_ #dwc}GTEDm TY~5ā_D<x٣vRcL\DD{4 cL̙3%K%1攈.\.\Њ 6lk\׫FXKKK:nܸ1@L` ǏUVVV<#FE"}}!l@wUTUU%/ ,cL1&tRmllTkhvvv`t @_vUXku o6|m~u̘11ċ8M(ŋncIs.>677OFI s˗;eAEEE" 6hEEEnuuu'A]qZ;5$Z]lYb29s)55]nTܬw}w\D܁a ."+Vt)@ssN45\nwЩS555">4 ac] `cǎiZZk \NKKmذA[[[hѢׂm9,"G}!^s 8S,̫.JaSxU<(%Ȃo=r:7 2nh"1 8?ǫ "rJ:::\Bq- 0.HIENDB`tea-qt-47.1.0/icons/edit-paste-active.png000066400000000000000000000054431346332167200201440ustar00rootroot00000000000000PNG  IHDR@@iqsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< IDATxyx?'ɂX[KZڒvSh"BI)b A-Q;AT-JEIlum, ddi2I{s}ϻ͙s(k+PJu"b@2b-JӊxxV ɀ4j@ΟMHHDt@vޢ }=9===$QB- /svj52gǩIRkAh z}y:َ_lmmH\Fz@\];JB|zxzz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w У}ģcCFs80D|||,{ډ԰aCZCh]j64Bvڵk+@LBp|Ϟp\Ωt֯__z]I G }SGkd{+!>pK/B#G>$@c-E5<ƌY*ԔD5j'@k>Y0x'P好{wFZf l^noyyy?ֆ.-[\1{ p*]YalS_PfMu!C oF , #̚=J\F^=Nn]ٷwaak%LzM-(r8ڵi  [|Y]]j޼Ξ-PWu ]pJ030 yyF/9K>_J#xM>>6ҚZM<|@;w4)>44#xEEHqQ&OdvO=5;Ø~,,Tv) Т^ q +{*y<8L-ǜ%5k43 ixDQB^HxЭV^nz9QQ m֍@妛 ///6^ /6SW\\Z:yԩ)@ZltwkIqf̘jGM{E_ls3?yoO-_ȱfY[G HhZjA&||gؼy3mgI իկ﫥KڟTAB Ut*ojua k[;}o= A.z sGD`={9W=I@k +ˁMI>Y̾м93伒]#m%EX\KrjۻCm۶-nҦ~Peaẗ́?u]ŋrOA;zs`[yP5YZMS¥KxlܓD+W0iB$۷Va O<8{6s&%%P- 6yb i6''Oi}~Gسs3#zFK֭xd9<8lyy6f[ LxvnylVV6 c޼xyyW_aur5b97"di̞=n6oF@@K|6b;.dobɒeUۋ w0N=wq`vBRIK;WDi ???gjJbBaF7'OTZ'7V0  Xa+Пcv FС|}}yw1n9GkHJNB=.b |Oӧ`vB=J£`F J+Ec)K x0(vy|a r], ?856 sIENDB`tea-qt-47.1.0/icons/file-new.png000066400000000000000000000012351346332167200163350ustar00rootroot00000000000000PNG  IHDR@@iqsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDATx훿N@L9 e^wHtI< @^ Lj DJEpIsC|n;4jw=;uU%e 9sfˑ}yLV!l-@ =z3! T p@5G^m\` ggww7YEFF)qW|Ry*?/K(n\8F\>G6piӦU( yJA~ƯUkWG.gNg߯Ɉ$0p:~AQEJogx)&Ֆ'E8z@&}V9uj jv’ پm +e} rO^+5emB=vt * @Y`{?5j|s>嗋%.nJ\<.RW!QQ*a: &.5KbI >T6~~KL~kxxYf%*wKyLN:a;%44DR}.Mc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`9d2at]ag/.9`i30,/wR^R?^ՊYK0 IENDB`tea-qt-47.1.0/icons/file-save.png000066400000000000000000000017761346332167200165140ustar00rootroot00000000000000PNG  IHDR@@iqsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<{IDATx?H#Y?H"]cdP"XmX6:;> VvvvXlVQ/E 0J?$-"hdg{ę y7d~¼Rd;)hW1$YJ鈔?p[;wW^B^_!Dq\.繿 :V D{{{Sqf4ս/2hmm՞7 p`g8::X,Ң]]]\P(!HRB8 &ɸR)a ښN-OHó}}}LMMNAd2I2ԩ a XT8>>֩45 dnnNYW666hooWـx<֖ϗ@&VWR)QΣd@.JYƴQ2 Nka 8;;cuuՄO+Ż6EI_ %3WQHH$iJ`hm -6B6H$DQy]f.%bhi[Nj͆KQ:::T ՍGOX__TD6:ž=!H /&4-u驎ŀ}id ZnL҅o~M>qm@4ezzڄH)\011aB5_...z>ݥT*+? ,abޫ}얚Fsq!/` i$J|>O\KJ8X9ZAݞ:ah=BaෟRh@ok`S~FIENDB`tea-qt-47.1.0/icons/fn-spell-check.png000066400000000000000000000030521346332167200174210ustar00rootroot00000000000000PNG  IHDR@@iqsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDATxkUUku|L@XFaL"iD؃,5M}) "QXQY"Շow{<ε{>kQUes8"Pc8R 'UԀ:c)q88S"ґ*HS@DF]EUUUE8D,"17e~/"#R\r.BK~S W(|Jk 3 DtK+,$`9BPݔXӒ*|QE,Af+4`vR;kgp>ČFB!"'=}6 geORDw! rd|["c=ygLuGG/ȹ:!}\:k;~U=$@m.Mt;łtOUYoxV`UtnhV5堊'JӿG͚IENDB`tea-qt-47.1.0/icons/go.png000066400000000000000000000054421346332167200152400ustar00rootroot00000000000000PNG  IHDR@@iqsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< IDATx{TU? AIDiebZjoDSI| *5V$Q{t|hTDAQP1# C{Y!okwg_! k `m56Xz4ƠB{o p N@!a,Rˍ*˝8!'>@op%@*|%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ABLC.yyx=zމrEEGc;8q+n7@)&HBM>4Mf|^(sgJZ˥S"sVVa$E:fz=zhk7С@l]~j&LxoXPJMf" }iڛJ/0[E\\ΕL}ed0S]]RKt| :o2`;]FqkXq`ĴBz6ޥ?,Y+V .uEseD=;uE7fzx1ؼv ˃ߔRז-{=Z {? rϗ_VV6}lzP%"]@Kѣ돊8^faw')юjsJB/DdR@J4/g&<u)4-ǵrH*8."n;b>O)5cG#.J]׭{m67*pj1-"y)b)-Ѐ1>$y@kC~d0DD| iJ#7 8l/Wx[k7{y ~k@](rOip/"o|)(B1MaY0Ajz770jCp*D H2R;Hkg4Su d "k,("Uho)PJ^"U4+Y IENDB`tea-qt-47.1.0/icons/svg/000077500000000000000000000000001346332167200147175ustar00rootroot00000000000000tea-qt-47.1.0/icons/svg/tea.svg000066400000000000000000000117701346332167200162170ustar00rootroot00000000000000 image/svg+xml tea-qt-47.1.0/icons/tea-icon-v3-01.png000066400000000000000000000223051346332167200170730ustar00rootroot00000000000000PNG  IHDR>asBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< IDATxwx?3M"$vlɲ*qӳ'ٻlr&Onf78.68t;cqؖlI#%R)61,$~9w*hƹ,@9ɹD@gOaF~Yb~sM$+OL>١8Uŕ|UPP"Ӟ1C U;UkG;2& v;P 4!a >$M ,291zʇț:r="' [-:XNC|9 k;{RR-]tELS/ӞQz[.y3ﰓv̀SB~Y>|p[:@Ip#z/;UK%G7,?H|h@XîtC`3"C{/";J7TQqO|~-kF~Yr17^ESળnWEvֵϚ_.5sGh輜ẴtŒ{/2X=|8 ɿHw?N~Yz+@[މSHk0&hNY ǫșaÜҊ-_7-$Ϥi%,}gs'ֶɟ(O۽a"kCb2kز/#ImN6iG5Wtn!$wi!,93+]ϖzR~ߥ0׍\QG$qzS۵sz#Լ`'t7$pr[ x#]%rhI{6:dfuO04 $T/,0 ~F$Gv_J_Qf]FoL~ǥQN߉CuP2|.Ky4 [L*3#htQsoB=Gώ?w_Y u/(#ٔ5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ڝ,~xzPI4 Pfedh퉉#:y4\]\P^|=0j=&#R)-p+OFȸ ]|{yj?.0xG[[O[pp-!nB H !^FO"Z 'zWMV\>S<D?αajvcKj!oab@jrKsP&rI<0/"b` \ai@mԻ&<F!x e 4?ՇR0uV5po55{JvZŨ#XL)E wL|ȱ‡囗\ѓ. .yN--lXs}`m`Y%^'g r?tu{W[Zb_qT*]x,yB3ary mTCB }z۶mkty_V6=p\x|p#Rbq8 r2px8^_[OHk+ɰI8MO!h:`ܨ^a#؃AJ'ndޥᔤ8av[jfXA$BzEOI$M&aw888,; e{|p#xs1ӜD _< \rc_e>,y3 Qn Bܬȃq{W-ݟDʌR c`;mQyݰI\_2de 3x¾zg h wtH[<=X4 khد:K1+&[׏nR_I$tc ~u=Sh{B fuQW^'!ka݃{y/MCZ"! ]QܽEtQ{"DLwɏkA/![u RF+>8Fs ʚXIpknV;ݶ-\mD^b8^_۪IENDB`tea-qt-47.1.0/images/000077500000000000000000000000001346332167200142525ustar00rootroot00000000000000tea-qt-47.1.0/images/happy-people-bw.png000066400000000000000000000031031346332167200177660ustar00rootroot00000000000000PNG  IHDR>߃WsRGBPLTEU~ pHYs  tIMEQtEXtCommentCreated with GIMPWIDATXõM'i]e.+UH^ D^d䅱TM7Oc<__E0c_4 }y\B+` ``5ɲh0,q|ӱ`Xn`% ڛ w@q;xa=[V+( ƭw#EXYUB K##g~  &5Oб6^dEItlW k>uK7[e[dn/yGP[n$ !u-!2WQzŢh˽JK3f>, !l^ت%^}7&PuUUfUaFøR [@!(<7A %V\3Ry#Fu/EmWɳ.3 ~'/?8[5Eng)nѵw<͗Go4zf2 $YA?@NV ^*2yrv,BTX-Jh05]"GT;cEu@'5ak <e6SxqD bMb ^ y@3`FދW]fD#`͵z*:YELsI%'d/g "ROF^U|_*Cd>@~k6frSdWyG5,Z-I)OE4H[5uߒ% oDXϣxO?: Mhg!yX]hk:(DS`<*^S5=A_@l2j^4!AbsLo<;R I l ZD< !Jo=#{8r ;!5y*7[&h&L\5ciF2{Fu|m)^/)˼>3c21fcC)@VnZt[\,RͤUľ۾dp,T)f -e:˰M~m3]yyQUZl%6;u`K Lw$yxXģJI;4^.Q*be,/ \k|НjZ_#x$X_SqB+*@Bo|h'7@rX4^6?0}Ǯ\vb+i]<]9,-Ck| \3[XiXc-xW^6/gah{d!`B>Ll|7̥{ZL|?L:jˊlK˸OEiQʷl+1[Kgx#Svl7Yd2wԆcl-{̞o69djiy- 3aVdNB` _̙nUc%wZrZur{ͣR|A=Wh {32SY-c_N3U´a6on Rs[E2'N^)V86$&|)!%[wq0pF|` UḶP{f<ާ4!Wlx{}Aqfs<g-w'sozb O-?N:Gaa-j|*ĴĠg^ tLQDQɁO|rx#IaA6&mcet=Mģ?ؑ<ГTГ\b&t@)+qLMLO33|#ȤT'e d0+醧&+l4J!ZIVz2ڗ$چƉns'EX̶bn^-xIENDB`tea-qt-47.1.0/images/moon-phases.png000066400000000000000000001114361346332167200172170ustar00rootroot00000000000000PNG  IHDRzpZ^sRGB`PLTE___wwwgggoooOOOWWWGGG///777???'''ϵF pHYs--aitIME1M4tEXtCommentCreator: PolyView? Version 4.22 by Polybytes Quality: 80 Software: Polybytes PolyImagePro Comments: Software: Polybytes PolyImagePro QCV IDATx}L,%@Fdi2#~?3է 2e1Yp8?ϰOƕsae >_f! G{>׻PC*ٯdRz,|G=[&Bϥ>_Wϥ[fZ&1b~3k s ޫπ|a);?ןw~_\o #/5ŕ)[gK 5Z&+."K ?FQ?V/b }/_P_ 7| o _S[s-1GY1V4"]Uow}\Z7r")V`VD>YlW#nJv [TD?bJAX~qRY2~tGOb z+?XmS|,+6oOQaTV(~AAz@|.&_JD:E ?Af;TLg1?ˊu*b]tOC2_d Wl𙿣BP~gP1;P!a\VJ-%cY!mTLYR+k$9_X`ؗX2s s 5Ѝ*,\Tʌl(Inʚ%8&*֝܁<gHm,y R:l˰OeŰܭ*j{uEծV8Ęٳzj7zT>ږ ?n?oeB|j$?=v"6LS=VQ3AQAhQvvy~`T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j]p~(f#-(i0/ذAp0G )M{hg=9b t}KJLܾo'm]>k LQ/_osƎ f ?raҽ\\n=wc1Y&/GAS'|ڙ% exW7!}-+.8L!<氙m[v{LZ"x/**` %׌lKOiP12M2y#*86^8/$)}uTQV|ZoK˔opu܂1-fX&? CS` fY!LlӆH kϟVD`oE +$[ٻyEƟ&xJړhȸ(^`O& 2Ʉۈ ~Cb;[!VBfsVTAWl%vƍͳjX0K]f0Ϛ?S7b%uIUvm#}&7alA?_݈ emy6GBoȹ>5D9ߎ * oj8g o%_Yp/[wجBt-KwxPDTmC/wj7*$6$& GvKn'#} 䋊*TYq}jPaH4o;۔E>e->HTXB͸ az>KThըlc/  C|;*01)ϢѥR{4Mӑԋߘ]qOD,*WgFjsgF 8lFH4Z2E63x̊ <wy\ l'^, PQgQl>AIZ 7 xjOAXV 1U] {O7gc''BW|*$ݼMVP"/u;F3`4 b8rNK> |5GA>tDᡥ77\EeS0;?\CTz~Q`y[`l2֎ F&7osQ>Z5aul Z `uQ)^ v^,a\|:ξl$L! ~Mq|DŷJcQk=@ڎ Lөp\s:C0 ؿ=;3w5!1/两 `ؚ5Tj}-5D̊/*>BZʧsF1aAEҺEH|&QEgBJ3EN NyNo_Adtrr/H0kgŦ|efY|h0֏'P!<AޙxQQx9մJ 2K#/*>O--8};.+p5"]3L m5۔ft #include #include #include #include #include #include #include #include #include #include "img_viewer.h" #include "exif.h" #include "utils.h" extern QSettings *settings; CImgViewer::CImgViewer (QObject *parent): QObject (parent) { window_mini.setWindowFlags (Qt::Tool); window_mini.resize (200, 200); img_mini = new QLabel (tr ("preview")); img_mini->setAlignment (Qt::AlignCenter); QVBoxLayout *lt = new QVBoxLayout; lt->addWidget (img_mini); window_mini.setLayout (lt); } void CImgViewer::set_image_mini (const QString &fname) { window_mini.resize (200, 200); window_mini.setWindowTitle (QFileInfo (fname).fileName()); QString fn = get_the_thumb_name (fname); if (! fn.isEmpty()) { QPixmap pm (fn); img_mini->setPixmap (pm); } else { QPixmap pm (fname); if ((pm.width() > (window_mini.width() - 10)) || (pm.height() > (window_mini.height() - 10))) img_mini->setPixmap (pm.scaled (190, 190, Qt::KeepAspectRatio)); else img_mini->setPixmap (pm); } } void CImgViewer::set_image_full (const QString &fname) { // window_full.show_image (fname); window_full.load_image (fname); //qDebug() << "get_exif_orintation " << get_exif_orintation (fname); } QString CImgViewer::get_the_thumb_name (const QString &img_fname) { //FIXME: add OS2 tweak! #if !defined(Q_OS_WIN) || !defined(Q_OS_OS2) QCryptographicHash h (QCryptographicHash::Md5); QString uri (img_fname); uri.prepend ("file://"); h.addData (uri.toUtf8()); QString digest = h.result().toHex(); QString fname (QDir::homePath()); fname.append ("/.thumbnails/large"); fname.append ("/").append (digest).append (".png"); if (file_exists (fname)) return fname; fname.clear(); fname.append (QDir::homePath()); fname.append ("/.thumbnails/normal"); fname.append ("/").append (digest).append (".png"); if (file_exists (fname)) return fname; #endif return QString(); } /* CViewerWindow::CViewerWindow (QWidget *parent): QWidget (parent) { current_index = 0; angle = 0.0; scale = 100; img_full = new QLabel (tr ("preview")); img_full->setAlignment (Qt::AlignCenter); QVBoxLayout *lt = new QVBoxLayout; lt->addWidget (img_full); setLayout (lt); } void CViewerWindow::show_image (const QString &fname) { if (fname.isEmpty()) return; if (! file_exists (fname)) return; QPixmap pm (fname); if (file_name != fname) scale = 100; if (scale != 100) pm = pm.scaledToWidth (get_value (pm.width(), scale)); resize (pm.width() + 5, pm.height() + 5); img_full->setPixmap (pm); if (get_file_path (file_name) != get_file_path (fname)) //re-read dir contents if the new file is at the another dir //than the previous one { QStringList filters; QList a = QImageReader::supportedImageFormats(); foreach (QByteArray x, a) { QString t (x.data()); t.prepend ("*."); filters.append (t); }; QDir dir (get_file_path (fname)); fi = dir.entryInfoList (filters, QDir::Files | QDir::Readable, QDir::Name); } file_name = fname; for (int i = 0; i < fi.size(); i++) if (fi.at(i).filePath() == file_name) { current_index = i; break; }; QString s_wnd_title (QFileInfo (fname).fileName()); s_wnd_title.append (QString (" - %1x%2").arg (pm.width()).arg(pm.height())); setWindowTitle (s_wnd_title); } void CViewerWindow::show_again() { if (file_name.isEmpty()) return; QImage pm (file_name); if (scale != 100) pm = pm.scaledToWidth (get_value (pm.width(), scale)); QTransform transform; transform.rotate (angle); QPixmap pixmap = QPixmap::fromImage (pm.transformed (transform)); resize (pixmap.width() + 5, pixmap.height() + 5); img_full->setPixmap (pixmap); QString s_wnd_title (QFileInfo (file_name).fileName()); s_wnd_title.append (QString (" - %1x%2").arg (pm.width()).arg(pm.height())); setWindowTitle (s_wnd_title); } void CViewerWindow::keyPressEvent (QKeyEvent *event) { if (event->key() == Qt::Key_Escape) { event->accept(); close(); } if ((event->key() == Qt::Key_Space) || event->key() == Qt::Key_PageDown) { if (current_index < (fi.size() - 1)) show_image (fi.at(++current_index).filePath()); event->accept(); return; } if (event->key() == Qt::Key_PageUp) { if (current_index != 0) show_image (fi.at(--current_index).filePath()); event->accept(); return; } if (event->key() == Qt::Key_Home) { current_index = 0; show_image (fi.at(current_index).filePath()); event->accept(); return; } if (event->key() == Qt::Key_End) { current_index = fi.size() - 1; show_image (fi.at(current_index).filePath()); event->accept(); return; } if (event->key() == Qt::Key_BracketRight) { angle += 90.0; if (angle >= 360.0) angle = 0.0; show_again(); event->accept(); return; } if (event->key() == Qt::Key_BracketLeft) { angle -= 90.0; if (angle <= 0) angle = 360; show_again(); event->accept(); return; } if (event->key() == Qt::Key_Plus) { scale += 10; show_again(); event->accept(); return; } if (event->key() == Qt::Key_Minus) { if (scale > 10) scale -= 10; show_again(); event->accept(); return; } QWidget::keyPressEvent (event); } */ /* void CViewerWindow::show_image_from_clipboard() { QClipboard *clipboard = QApplication::clipboard(); const QMimeData *mimeData = clipboard->mimeData(); if (! mimeData->hasImage()) return; QPixmap pm (qvariant_cast(mimeData->imageData())); if (scale != 100) pm = pm.scaledToWidth (get_value (pm.width(), scale)); resize (pm.width() + 5, pm.height() + 5); img_full->setPixmap (pm); file_name = ""; QString s_wnd_title (tr ("Clipboard")); s_wnd_title.append (QString (" - %1x%2").arg (pm.width()).arg(pm.height())); setWindowTitle (s_wnd_title); } */ void CZORWindow::closeEvent (QCloseEvent *event) { event->accept(); } CZORWindow::CZORWindow (QWidget *parent): QWidget (parent) { /*settings = new QSettings (QSettings::NativeFormat, QSettings::UserScope, "zor", "zor"); */ //fname_image = settings->value ("fname_image", "none").toString(); //if (fname_image != "none") // load_image (fname_image); // setWindowTitle (tr ("ZOR. Press F1 for help")); //setWindowOpacity (0.5f); // setWindowOpacity (1.0f); setMinimumSize (16, 16); //setAttribute (Qt::WA_QuitOnClose,true); // setWindowFlags (Qt::WindowStaysOnTopHint); //QAction *quitAction = new QAction (tr ("E&xit"), this); //quitAction->setShortcut (tr ("Ctrl+Q")); //connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); //addAction(quitAction); } CZORWindow::~CZORWindow() { //qDebug() << "~CZORWindow()"; //settings->setValue ("fname_image", fname_image); //delete settings; } void CZORWindow::paintEvent (QPaintEvent *event) { QPainter painter (this); painter.drawImage (0, 0, source_image); } /* void CZORWindow::resizeEvent(QResizeEvent *event) { if (transform.isRotating()) { QImage tmp = source_image.transformed (transform); transformed_image = tmp.scaled (size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); } else transformed_image = source_image.scaled (size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); update(); } */ void CZORWindow::load_image (const QString &fname) { if (! file_exists (fname)) return; // qDebug() << "CZORWindow::load_image " << fname; if (! source_image.load (fname)) qDebug() << "cannot load " << fname; fname_image = fname; bool orientation_portrait = false; int exif_orientation = get_exif_orientation (fname); // qDebug() << "exif_orientation: " << exif_orientation; if (settings->value ("zor_use_exif_orientation", 0).toInt()) if (exif_orientation == 6 || exif_orientation == 8) orientation_portrait = true; bool need_to_scale = false; if (source_image.size().height() > source_image.size().height()) orientation_portrait = true; if (source_image.size().height() > 600 || source_image.size().width() > 800) need_to_scale = true; if (exif_orientation == 3) { QTransform transform; transform.rotate (180); QImage transformed_image = source_image.transformed (transform); transformed_image = transformed_image.scaled (size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); source_image = transformed_image; } if (orientation_portrait) { QTransform transform; qreal angle = 0.0; if (exif_orientation == 6) angle = 90; else if (exif_orientation == 8) //make clockwise angle = 270; transform.rotate (angle); QImage transformed_image = source_image.transformed (transform); transformed_image = transformed_image.scaled (size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); source_image = transformed_image; } if (need_to_scale) { if (orientation_portrait) source_image = source_image.scaled (QSize (600, 800), Qt::KeepAspectRatio, Qt::SmoothTransformation); else source_image = source_image.scaled (QSize (800, 600), Qt::KeepAspectRatio, Qt::SmoothTransformation); } resize (source_image.size()); QString s_wnd_title (QFileInfo (fname_image).fileName()); s_wnd_title.append (" "); s_wnd_title.append (tr ("scaled to: ")); s_wnd_title.append (QString ("%1x%2").arg (source_image.width()).arg(source_image.height())); setWindowTitle (s_wnd_title); update(); raise(); activateWindow(); } void CZORWindow::keyPressEvent (QKeyEvent * event) { if (event->key() == Qt::Key_Escape) { event->accept(); close(); } event->accept(); } void CGIFWindow::keyPressEvent (QKeyEvent * event) { if (event->key() == Qt::Key_Escape) { event->accept(); close(); } event->accept(); } void CGIFWindow::load_image (const QString &fname) { if (! file_exists (fname)) return; if (movie) delete movie; movie = new QMovie (fname); setMovie (movie); movie->jumpToFrame (0); resize (movie->currentImage().size()); show(); movie->start(); } CGIFWindow::CGIFWindow (QWidget *parent): QLabel (parent) { movie = 0; } CGIFWindow::~CGIFWindow() { if (movie) delete movie; } void CGIFWindow::closeEvent (QCloseEvent *event) { event->accept(); } tea-qt-47.1.0/img_viewer.h000066400000000000000000000031111346332167200153070ustar00rootroot00000000000000#ifndef IMG_VIEWER_H #define IMG_VIEWER_H #include #include #include #include #include class CGIFWindow: public QLabel { Q_OBJECT public: QMovie *movie; CGIFWindow (QWidget *parent = 0); ~CGIFWindow(); void load_image (const QString &fname); //void paintEvent (QPaintEvent *event); // void resizeEvent (QResizeEvent *event); void keyPressEvent ( QKeyEvent * event); void closeEvent (QCloseEvent *event); }; class CZORWindow : public QWidget { Q_OBJECT public: QString fname_image; QImage source_image; CZORWindow (QWidget *parent = 0); ~CZORWindow(); void load_image (const QString &fname); // void resizeEvent (QResizeEvent *event); void paintEvent (QPaintEvent *event); void keyPressEvent ( QKeyEvent * event); void closeEvent (QCloseEvent *event); }; /* class CViewerWindow: public QWidget { Q_OBJECT public: qreal angle; int scale; QFileInfoList fi; QString file_name; int current_index; QLabel *img_full; CViewerWindow (QWidget *parent = 0); void show_image (const QString &fname); void show_again(); protected: void keyPressEvent (QKeyEvent *event); }; */ class CImgViewer: public QObject { Q_OBJECT public: QWidget window_mini; CZORWindow window_full; QLabel *img_mini; //void set_image_full_clipboard(); CImgViewer (QObject *parent = 0); void set_image_mini (const QString &fname); void set_image_full (const QString &fname); QString get_the_thumb_name (const QString &img_fname); }; #endif // IMG_VIEWER_H tea-qt-47.1.0/ioapi.h000066400000000000000000000157401346332167200142660ustar00rootroot00000000000000/* ioapi.h -- IO base function header for compress/uncompress .zip part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) Modified by Sergey A. Tachenov to allow QIODevice API usage. For more info read MiniZip_info.txt Changes Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. More if/def section may be needed to support other platforms Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. (but you should use iowin32.c for windows instead) */ #ifndef _ZLIBIOAPI64_H #define _ZLIBIOAPI64_H #if (!defined(_WIN32)) && (!defined(WIN32)) // Linux needs this to support file operation on files larger then 4+GB // But might need better if/def to select just the platforms that needs them. #ifndef __USE_FILE_OFFSET64 #define __USE_FILE_OFFSET64 #endif #ifndef __USE_LARGEFILE64 #define __USE_LARGEFILE64 #endif #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif #ifndef _FILE_OFFSET_BIT #define _FILE_OFFSET_BIT 64 #endif #endif #include #include #include "zlib.h" #if defined(USE_FILE32API) #define fopen64 fopen #define ftello64 ftell #define fseeko64 fseek #else #ifdef _MSC_VER #define fopen64 fopen #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) #define ftello64 _ftelli64 #define fseeko64 _fseeki64 #else // old MSC #define ftello64 ftell #define fseeko64 fseek #endif #endif #endif /* #ifndef ZPOS64_T #ifdef _WIN32 #define ZPOS64_T fpos_t #else #include #define ZPOS64_T uint64_t #endif #endif */ #ifdef HAVE_MINIZIP64_CONF_H #include "mz64conf.h" #endif /* a type choosen by DEFINE */ #ifdef HAVE_64BIT_INT_CUSTOM typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; #else #ifdef HAS_STDINT_H #include "stdint.h" typedef uint64_t ZPOS64_T; #else #if defined(_MSC_VER) || defined(__BORLANDC__) typedef unsigned __int64 ZPOS64_T; #else typedef unsigned long long int ZPOS64_T; #endif #endif #endif #ifdef __cplusplus extern "C" { #endif #ifndef OF #define OF _Z_OF #endif #define ZLIB_FILEFUNC_SEEK_CUR (1) #define ZLIB_FILEFUNC_SEEK_END (2) #define ZLIB_FILEFUNC_SEEK_SET (0) #define ZLIB_FILEFUNC_MODE_READ (1) #define ZLIB_FILEFUNC_MODE_WRITE (2) #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) #define ZLIB_FILEFUNC_MODE_EXISTING (4) #define ZLIB_FILEFUNC_MODE_CREATE (8) #ifndef ZCALLBACK #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) #define ZCALLBACK CALLBACK #else #define ZCALLBACK #endif #endif typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, voidpf file, int mode)); typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); typedef uLong (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); typedef int (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); /* here is the "old" 32 bits structure structure */ typedef struct zlib_filefunc_def_s { open_file_func zopen_file; read_file_func zread_file; write_file_func zwrite_file; tell_file_func ztell_file; seek_file_func zseek_file; close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; } zlib_filefunc_def; typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); typedef int (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, voidpf file, int mode)); typedef struct zlib_filefunc64_def_s { open64_file_func zopen64_file; read_file_func zread_file; write_file_func zwrite_file; tell64_file_func ztell64_file; seek64_file_func zseek64_file; close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; close_file_func zfakeclose_file; // for no-auto-close flag } zlib_filefunc64_def; void fill_qiodevice64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); void fill_qiodevice_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); /* now internal definition, only for zip.c and unzip.h */ typedef struct zlib_filefunc64_32_def_s { zlib_filefunc64_def zfile_func64; open_file_func zopen32_file; tell_file_func ztell32_file; seek_file_func zseek32_file; } zlib_filefunc64_32_def; #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) //#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) //#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) #define ZFAKECLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zfakeclose_file)) ((filefunc).zfile_func64.opaque,filestream)) #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf file,int mode)); int call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) #ifdef __cplusplus } #endif #endif tea-qt-47.1.0/libretta_calc.cpp000066400000000000000000000117471346332167200163130ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #include #include "utils.h" using namespace std; class CItem { public: char op; double val; CItem (char a_op, double a_val); }; CItem::CItem (char a_op, double a_val) { op = a_op; val = a_val; } double calculate (string expression) { list items; lconv *l = localeconv(); string sep_need = l->decimal_point; string sep_find; if (sep_need == ".") sep_find = ","; else sep_find = "."; size_t position = expression.find (sep_find); while (position != string::npos) { expression.replace (position, 1, sep_need); position = expression.find (sep_find, position + 1); } //open braces size_t end_pos = expression.find (")"); // cout << " end pos = " << end_pos << endl; size_t start_pos = 0; if (end_pos != string::npos) do { // for (size_t i = end_pos; i >= 0; i--) for (size_t i = end_pos; i-- > 0 ;) { if (expression[i] == '(') { start_pos = i; break; } } //end_pos = expression.find (")"); string s_temp_value = expression.substr (start_pos + 1, end_pos - start_pos - 1); //cout << "start_pos = " << start_pos << " end pos = " << end_pos << endl; //cout << "s_temp_value = " << s_temp_value << endl; double f_temp_value = calculate (s_temp_value); std::ostringstream float_stream; float_stream << f_temp_value; string temp_s (float_stream.str()); //cout << "temp_s = " << temp_s << endl; expression = expression.replace (start_pos + 1, end_pos - start_pos - 1, temp_s); } while (end_pos == string::npos); //parse expression to list: bool new_operator = false; string t_operand; char t_operator = '0'; size_t stop_size = expression.length() - 1; for (size_t i = 0; i < expression.length(); i++) { char t = expression[i]; if (isdigit (t) || t == '.' || t == ',') t_operand += t; if (t == '+' || t == '-' || t == '/' || t == '*' || t == '^' || t == '%' || i == stop_size) { new_operator = true; t_operator = t; if (i == stop_size) t_operator = '0'; } if (new_operator) { //добавляем в items double f = atof (t_operand.c_str()); items.push_back (CItem (t_operator, f)); t_operand = ""; t_operator = '0'; new_operator = false; } } list::iterator p = items.begin(); //степень и процент do { CItem current = *p; list::iterator t = p; ++t; CItem next = *t; if (current.op == '^' || current.op == '%') { if (current.op == '^') { next.val = pow (current.val, next.val); *t = next; } else if (current.op == '%') { next.val = (float) get_value (current.val, next.val); *t = next; } p = items.erase (p); continue; } p++; } while (p != items.end()); //умножаем и делим p = items.begin(); do { CItem current = *p; list::iterator t = p; ++t; CItem next = *t; if (current.op == '*' || current.op == '/') { if (current.op == '*') { next.val = current.val * next.val; *t = next; } else if (current.op == '/') { next.val = current.val / next.val; *t = next; } p = items.erase (p); continue; } p++; } while (p != items.end()); //складываем и вычитаем p = items.begin(); do { CItem current = *p; list::iterator t = p; t++; CItem next = *t; if (current.op == '+' || current.op == '-') { if (current.op == '+') { next.val = current.val + next.val; *t = next; } else if (current.op == '-') { next.val = current.val - next.val; *t = next; } p = items.erase (p); continue; } p++; } while (p != items.end()); list::iterator start = items.begin(); CItem item = *start; return item.val; } tea-qt-47.1.0/libretta_calc.h000066400000000000000000000002101346332167200157370ustar00rootroot00000000000000#ifndef LIBRETTA_CALC_H #define LIBRETTA_CALC_H #include using namespace std; double calculate (string expression); #endif tea-qt-47.1.0/logmemo.cpp000066400000000000000000000103001346332167200151420ustar00rootroot00000000000000/*************************************************************************** * 2007-2018 by Peter Semiletov * * peter.semiletov@gmail.com * * * * 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, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include #include #include #include #if QT_VERSION >= 0x050000 #include #include #endif #include "logmemo.h" CLogMemo::CLogMemo (QWidget *parent): QPlainTextEdit (parent) { setObjectName ("logmemo"); no_jump = false; terminal_output = false; setFocusPolicy (Qt::ClickFocus); setUndoRedoEnabled (false); setReadOnly (true); setTextInteractionFlags (Qt::LinksAccessibleByMouse | Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); } #if QT_VERSION >= 0x050000 void CLogMemo::log_terminal (const QString &text) { if (no_jump) return; QString txt = text; QString tb = txt; //QRegularExpression re ("[a-zA-Z_]+\\.[a-zA-Z]+:\\d+:\\d+:"); QRegularExpression re ("\\w+\\.\\w+:\\d+:\\d+:"); QRegularExpressionMatch match = re.match (txt, 1); if (match.hasMatch()) { QString matched = match.captured (0); matched = matched.remove (matched.size() - 1, 1); tb.replace (matched, "" + matched + ""); } txt = tb; QTextCursor cr = textCursor(); cr.movePosition (QTextCursor::Start); cr.movePosition (QTextCursor::Down, QTextCursor::MoveAnchor, 0); setTextCursor (cr); textCursor().insertHtml (txt + "
"); cr = textCursor(); cr.movePosition (QTextCursor::Start); cr.movePosition (QTextCursor::Down, QTextCursor::MoveAnchor, 0); setTextCursor (cr); } #endif void CLogMemo::log (const QString &text) { #if QT_VERSION >= 0x050000 if (terminal_output) { log_terminal (text); return; } #endif if (no_jump) return; QTextCursor cr = textCursor(); cr.movePosition (QTextCursor::Start); cr.movePosition (QTextCursor::Down, QTextCursor::MoveAnchor, 0); setTextCursor (cr); if (! terminal_output) { QTime t = QTime::currentTime(); textCursor().insertHtml ("[" + t.toString("hh:mm:ss") + "] " + text + "
"); } else textCursor().insertHtml (text + "
"); cr = textCursor(); cr.movePosition (QTextCursor::Start); cr.movePosition (QTextCursor::Down, QTextCursor::MoveAnchor, 0); setTextCursor (cr); } void CLogMemo::mouseDoubleClickEvent (QMouseEvent *event) { QTextCursor cur = cursorForPosition (event->pos()); QString txt = toPlainText(); int pos = cur.position(); int idx_right = txt.indexOf (" ", pos); if (idx_right == -1) { event->accept(); return; } int idx_left = 0; for (int i = pos; i != -1; i--) { if (txt[i] == ' ') { idx_left = i; break; } } txt = txt.mid (idx_left, idx_right - idx_left + 1); //qDebug() << txt; // txt = txt.remove ('\n'); emit double_click (txt.simplified()); event->accept(); } tea-qt-47.1.0/logmemo.h000066400000000000000000000036521346332167200146230ustar00rootroot00000000000000/*************************************************************************** * 2007-2017 by Peter Semiletov * * peter.semiletov@gmail.com * * * * 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, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef LOGMEMO_H #define LOGMEMO_H #include #include #include class CLogMemo: public QPlainTextEdit { Q_OBJECT public: bool no_jump; bool terminal_output; CLogMemo (QWidget *parent = 0); Q_INVOKABLE void log (const QString &text); #if QT_VERSION >= 0x050000 void log_terminal (const QString &text); #endif void mouseDoubleClickEvent(QMouseEvent *event); signals: void double_click (const QString &text); }; #endif // LOGMEMO_H tea-qt-47.1.0/main.cpp000066400000000000000000000062701346332167200144420ustar00rootroot00000000000000/*************************************************************************** * Copyleft 2007-2018 by Peter Semiletov * * * * * * 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, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include #include #include #include "rvln.h" #include "single_application.h" #ifndef Q_OS_OS2 #include "single_application_shared.h" #endif extern rvln *mainWindow; int main (int argc, char *argv[]) { #if defined(Q_OS_OS2) || defined (NO_SINGLE_APP) QApplication app (argc, argv); qApp->setApplicationName ("TEA"); mainWindow = new rvln(); mainWindow->show(); return app.exec(); #endif #if defined(Q_OS_WIN) && ! defined (NO_SINGLE_APP) CSingleApplication app (argc, argv, "tea unique id 1977"); if (app.isRunning()) { if (argc > 1) for (int i = 1; i < argc; i++) app.sendMessage (QString(argv[i])); return 0; } #endif #if defined(Q_OS_UNIX) && ! defined (NO_SINGLE_APP) CSingleApplicationShared app (argc, argv, "tea unique id 1977"); bool single_mode = true; if (argc > 1) if (strcmp(argv[1], "--m") == 0) single_mode = false; if (single_mode && app.alreadyExists()) { if (argc > 1) for (int i = 1; i < argc; i++) app.sendMessage (QString(argv[i])); return 0; } #endif mainWindow = new rvln(); #if defined(Q_OS_WIN) QObject::connect(&app, SIGNAL(messageAvailable(QString)), mainWindow, SLOT(receiveMessage(QString))); #endif #if defined(Q_OS_UNIX) QObject::connect(&app, SIGNAL(messageAvailable(QStringList)), mainWindow, SLOT(receiveMessageShared(QStringList))); // QObject::connect(&app, SIGNAL(signal_commit_data()), mainWindow, SLOT(app_commit_data())); // QObject::connect(&app, SIGNAL(commitDataRequest(QSessionManager & )), mainWindow, SLOT(slot_commitDataRequest(QSessionManager & ))); #endif mainWindow->show(); return app.exec(); } tea-qt-47.1.0/manuals/000077500000000000000000000000001346332167200144455ustar00rootroot00000000000000tea-qt-47.1.0/manuals/en.html000066400000000000000000002070131346332167200157400ustar00rootroot00000000000000 TEA Fine Manual

TEA Fine Manual


Table of content



Introduction
Interface
File manager
Dates panel
File
Calendar
Edit
Markup
Search
Functions
Functions - Spell checking
Functions - Plugins
IDE
Run
Nav
Fm
View
Preferences
Keyboard
Secret power
Notes
Other author's projects

Introduction

TEA has a long history of the development. At the autumn of year 2000, there was first implementation of TEA, written in Object Pascal using Borland Delphi. Since then, TEA was many times rewritten from zero (Pascal - C/Gtk - C++/Qt) and opened its source. The initial TEA UI was inspired by Impulse Tracker and Sound Forge. Later, the conception of sliding panels and tabs has been implemented.

Now TEA has THREE branches. This, TEA-Qt, is the modern one. There also outdated TEA-GTK (Gtk 2) and TEA-GTK (GTK 3), the buggy one! So use TEA-Qt.

TEA has two homesites: semiletov.org/tea and tea.ourproject.org. If one of them is down, go to another one.

Normally, TEA holds its configuration data and other support files at $HOME/.config/tea (or, under Window, at drive:\Documents and Settings\username\tea). But if you want to start TEA from the flash drive in the portable mode, TEA must read/write configuration data into the directory with the TEA binary. To start TEA in the portable mode, use "--p" command line option:

tea --p

As you know, TEA under *NIX is a single binary. Under Windows TEA installation directory contains all what you need to start TEA portable. Please note, that your NORMAL-MODE settings are stills exists and available anytime when you start TEA WITHOUT the "--p" key. TEA preferences of portable and normal modes are each other independent and exists in parallel.


Interface

From the top to bottom, there are:

1. The main menu. Note that you can tear submenus off and place them somewhere over the desktop. Menu items are highly depended on the current task or even editor mode. Some menus can be visible or hidden according to the task (editing, file browsing, etc.).

2. The toolbars area. Actually, toolbars can be parked at the any side of TEA window. Positions are saved between sessions. To turn the toolbar on and off, use the context menu for the toolbar (right click on the toolbar). If no toolbar is visible, do the right click on the menu bar.

3. The tabbed area. It contains 5 main tabs - editor, files, options, , and manual. Editor - that where you see opened documents. Files - a built-in file manager. Options - here you can change TEA preferences. All changes will be applied immediately. Dates - the simple calendar with the organizer functions. Manual - the built-in User manual. This, the excellent one!

4. Logmemo. It is a notification area. Destination: all warnings, information messages and the results of some text-processing functions.

5. The Famous input field (FIF). An input text field to put here values for text-processing functions. Also it is used for Find/Replace (read about a Search menu for details). FIF has three buttons - Find, Find previous and Find next. FIF is used also for a search in the TEA manual, menu items list (at the hotkeys customization page) and even the built-in file manager.

6. The status bar. You can setup the status bar's content via the preferences Interface page.


File manager

The TEA's file manager is hidden under the files tab. It is not an additional bloatware tool, but an essential part of the editor. It replaces the standard File save/open dialogs (by the way, you can bring them back using Options > Common > Use traditional File Save/Open dialogs option).

Let's see on the shining force of TEA's file manager.

The directory bar is located on the top. There is an entry with the current directory path, and a nice toolbar with following buttons:

Go - navigates to the directory with the path from the text entry.

Home - teleports you to your cozy home directory.

Refresh - refreshes a files list to your pleasure.

File operations button with submenu. It contains some utility actions such as Create new directory, Rename and Delete file. Please note that TEA does not delete the directories.

The right panel of the file manager.

At the top you see the file name field. Here you can give the name for a file to open or save it. To save the current file under some name, just put the filename into the Name text entry and press the Save as button. To open a file, do the double click on the file name at the files list, or put the file name into the Name entry and press the Open button. You can use the Enter key inside of this input field. The action is related to the menu item (File open or Save as) that you used to open the file manager tab.

You can also select files multiply (Ctrl-click or INSERT key) and then press the Open button. All files are being saved/opened with the encoding that is selected at the list below from the Name entry. There is also a "?" button. Select some file and press this button - it tries to autodetect the file's character set and activate it at the encodings list. Currently only HTML files or Russian charsets are supported for automatic detection.

Bookmarks list. You can easily add and remove the directory bookmarks using the "+" and "-" buttons. The "+" button adds a bookmark to the file system tree's current directory. The "-" button removes the selected bookmark. To activate the bookmark and navigate to the respective directory, double click on the bookmark.

There are some special bookmarks at the top of the list: snippets, templates, scripts. You can't remove them. They point to the TEA special directories for user's items such as templates, snippets, etc.

You can enable the Options > Common > Automatic preview images at file manager option to show a small preview window near the file manager. Also, when the cursor is located on the image file, you can use Open at cursor (F2) function to view the image at the full-size in another built-in image viewer (see the Open at cursor description).


Dates panel

As you can notice, TEA has the built-in calendar-organizer under the dates tab of the main window. By double-clicking on the days, you create or open the file-per-day text documents. When you close such file, its content will be saved automatically. To remove the day record, use Calendar > Remove day record.

At the text you can specify the time signature for the alarm event. This signature has the format [hh:mm] in the 24 hour day. All text after such signature and before the next one will be treated as the alarm message. For example:

[20:00] go to the theater
[23:00] howl at the moon

For sure, you need to have TEA running to see the alarm message!

Single click on the date cell shows the day record (if any) at the logmemo area.

At the Options page, you can set the Start week on Sunday option to the "on". The calendar widget can work in two modes - the normal and the lunar one. Read the Calendar section for details.


File

New. Impossible! It's a kind of magic. This menu item creates a new blank document where you can type any words those you want. For example, type the word "hello". It's a very cheerful word. That what we usually say to all good people around. Hello! And your world becomes brighter. So, if you can type this word, it means that you can type any another one, and more than once. It's a true miracle.

Open - for sure, this menu item helps you to open any file that you already stored at your hard disk. There are many files, including the evil mature rating violent games - don't even try to open them with TEA. Oh, no! TEA is good.

If you are using the build-in file manager, read the File manager chapter. Otherwise, read the words of true about the File open dialog window.

There is a small secret at the File open dialog window. The character set combobox. Yes. With that fine tool in the box, you can open a text file in any encoding that is known by a human being. But be careful! You must know exactly which encoding you need to use to read your file correctly. Otherwise you shall see many weird letters that can harm your spiritual calmness. If so, close your eyes quickly and type "hello" at seven times! Or you can try to load your file with another encoding selected. So choose wise. By the way, TEA can try to auto-detect the encoding - just press the "?" button (on the right from the character set list).

TEA can open all plain text files, and also ODT (OpenDocument Text), KWD (old KWord's format), FB2, DOCX, RTF, SXW (old OOo/StarOffice format), ABW (Abiword) formats and gzipped files. But only the plain text files can be saved with TEA. About other mentioned formats - TEA just can extract text from them, trying to preserve the basic layout (indents, paragraphs).

Save - if your file is already saved, this menu item saves it again. That is how it works. But, if a file is not saved, you shall see a surprise! A File manager. There, put the file name into the Name entry and press the Save as button.

Now you already know how to save and load your work. If you see the mushroom cloud from a nuclear explosion, what you gonna do? Yes, save and cover. Want to be one of those happy people on the picture below?

Save and cover! But remember, you need to place your PC to the safe place. Otherwise, the nuclear heat can destroy your files.

This man is looking disappointed. What's happen? Oh no, he lost his files!

Let's ask him: "Hey mister, why are you sad?" And he'll answer: "I'd forgotten to save and cover". That's it. He'd forgotten. He is not happy anymore. At least he'd survived.

Last closed file - opens a last closed file. This sentence is a greater paradox of XXI century CE.

Open at cursor, or F2 as a shortcut - this feature transforms a user into the so-called "F2 addict". Strange mind and body transformations can happen, so you warned!

Put the cursor at the file name in the href-link or LaTeX includegraphics, input, include etc.. Press F2. See THAT miracle? TEA opens a file with the file name that was pointed. If this file is already opened, its tab will be focused. If the file is an image, TEA show it in the build-in image browser. But, what if you don't work with the [X]HTML code, but use a real file names in your text and want to open them? TEA can handle that - just select the file name (not just put a cursor on it) and press F2.

What is the difference? TEA can open a "file under cursor" when the file name is enclosed with quotes. As in HTML or most of the code sources. In other cases, you need to select file name manually with Shift-cursor keys or using the mouse.

And a bit more - using Open at cursor you can navigate through local href-links.

You can also use Open at cursor at the built-in file manager to open the image file with the preview window.

Also, you can open file at cursor with any external program. Read about the "Run" menu for details.

Crapbook - opens a special file where you can put some notes, pieces of a text, etc. The crapbook file will be saved automatically when you close it. If the Crapbook file is opened and you exiting TEA, the content of a Crapbook is saved too.

Notes - a kind of crapbook, but connected to the current file. Useful to put the notes related to the current file's content. The .notes file is autosaved on exit.

Save as different > Save .bak - saves a content of the current document with name, where the "bak" extension added.

Save as different > Save timestamped version - saves a content of the current document with name, where the timestamp is added. So you shall know the date and time related to the saved version. Note about timestamp format. Is is yyyy-MM-dd-hh-mm-ss. So the first comes a year, then a month, then days, hours, minutes and seconds.

Recent files. From this submenu you can open one of the last dozen opened files. TEA remembers the name, the encoding and the current position of the file when you close the document, so at the next time TEA already know the charset and the position, where to start an editing.

Templates - to create a new file from the template, select a template from this menu. To create a new template, save a text file into the TEA templates directory. It is available from templates bookmark at the TEA's file manager (or at the left sidebar at File save dialog). And vice versa, to open the template use the file manager's templates bookmark again. The character set of templates is always UTF-8. TEA sets it automatically even if you choose another encoding.

To delete or rename the template, use the file manager or File save/open dialogs.

Sessions - at this menu sessions are available. The session is a simple list of opened files. To load them all, just choose a session name from this menu. To save a session, put the name of the session into the Famous input field, then use File > Save different > Save session. At the preferences Common page you can check the Restore the last session on start-up option. If this option is turned on, TEA will save the session on exit (under the name def-session-777), and then load this session when starting.

Bookmarks - this menu is similar to Recent files, but the files list is updating by you, not by TEA. To add a current file to this list, use Edit bookmarks > Add to bookmarks function. If the bookmarks list already contains the adding file, its record will be updated with new position and charset values. To delete the bookmark, open the bookmarks list from the File > Configs menu, delete the needed line and save the list in a usual way. The wrong bookmark can be temporarily disabled with the "#" prefix. To search wrong paths and disable such bookmarks automatically, use Edit bookmarks > Find obsolete paths function.

File actions submenu. From this menu you can do some magical things. Set UNIX end of line, Set Windows end of line, Set traditional Mac end of line - those functions allow you to override the file's end of line (EOL). When you save the file, the chosen EOL will be applied. To check the file's EOL, select a file at the built-in file manager and use Fm > File information > Full info.

Do not add to recent - temporarily disable the recent files list update. This function is useful if you need to open many files and do not want to overwrite your recent files list. So use "do not add" before close "unwanted" files, work with them, close, then switch "do not add" off to bring the normal recent list functionality.

Exit - closes TEA. To reduce the annoyance, TEA does not ask to confirm it. And another thing related to confirmations - TEA automatically proposes to save the modified existing files only. I.e. if you close (with TEA or by Ctrl-W) the modified new, no-named file, TEA silently will close it.


Calendar

This menu is available only when the todo panel is active.

Moon mode on/off - switch calendar widget to the moon/normal modes. In the first one, the moon phases are shown. Also you'll see the moon day number after the slash (before the Gregorian day number). I.e. the format is: normal day number / moon day number.

Some words about the calculation of moon day. First of all, you need to select the right Earth hemisphere at Options - Common - Northern hemisphere (on/off). The other important thing is the algorithm (Options - Common - Moon phase algorithm). The speed and precision vary, try for yourself. There are several algorithms were been used. Some of them are based on Ben Danglish's article at http://www.ben-daglish.net/moon.shtml, another one on the Alexander Leushkanov's article - http://www.astrogalaxy.ru/275.html.

Due to some technical source, the image of moon phase for days 12 and 13 are the same.

Add or subtract years/months/days - allows one to navigate through the calendar back and forward on N years, or months, or days. For example, you need to see the day +6 after the current one. Put "6" into the Famous Input Field, and then use Add or subtract > days. If you want to move backward, put the negative value into the FIF, i.e. "-6" instead of "6".

Number of days between two dates - calculates the number of days between two dates. Select the first date at the Calendar and use Mark first date menu item. Select the last date at the Calendar and use Mark last date. Use Number of days between two dates functions to measure the difference between the first and second dates.

Calculate moon days between dates - creates a list with moon days between two dates (Mark first/last date).


Edit

About the rectangular or block selection. TEA has such limited ability that does not fit TEA's architecture well, and text-processing functions cannot be used with block selections. All what you can do with them it is select using Block start and Block end, and then Copy block, Cut block and Paste block.

Some notes about Indent/Un-indent functions. There are two hardcoded keyboard shortcuts are assigned to this functions - Tab and Shift-Tab. If no text selected, Indent (Tab) inserts a tab character or a space (spaces). Such behavior is depended from Options > Interface > Use spaces instead of tabs and Tab width in spaces options.

If Use spaces instead of tabs is checked on, the editor will insert (by Tab key) the number of spaces that defined at Tab width in spaces. Otherwise, TEA inserts a single tab.

TEA also has the Automatic indent option, disabled by default.

Indent by first line - this function indents all selected lines with the same indent as the first lines of selection indent.

Storage files - you can use some file as a "storage" file to copy text directly to it from different sources. Set as storage file chooses the current opened file as the storage file. Then, if you want copy and paste some text into that file, just use Copy to storage file. Also you can capture the system's clipboard for the text and put it to the storage using Start/stop capture clipboard to storage file. You may have just one storage file per session. When you close the storage file, all further pasting to it will be disabled until you not set a storage file again.

To control the text that inserts to the storage you can use the template file called cliptpl.txt at the TEA config directory. Just create such file with some macros, for example:

---
%date
%time
%s
---
Here is: %s - the text from the clipboard, %date - current date, %time - current time.

Markup

The functions from this menu are mainly working depending of the selected markup Mode. There are several modes available - HTML, XHTML, LaTeX, Wikitext, Markdown, Lout and DocBook. When you select some mode from the Mode menu, you set the markup mode for the current document. So different documents have different, separated modes. It allows one to edit one file as HTML and another one as DocBook XML with the same menu item. So, menu items act differently according to the document's markup mode. To use Wikitext mode, set this mode manually from the menu Mode, or use .wiki as the filename extension.

You can select a text and use some function, for example the "Paragraph". If you don't select any text, TEA just insert tags at the cursor position.

Beside the tag-related functions, Markup menu has a set of [X]HTML tools.

[X]HTML tools - Rename selected file - renames the file and changes the selected text. For example, you have (in your HTML document) a h-ref link to some file. You want to rename that file. Select its file name at the text, then put into the FIF a new file name (without the full path, just the name.ext), and use this function. Voila!

[X]HTML tools > Document weight - calculates a total document weight including all SRC-staff (images, flashes etc). Look for the result at the Logmemo.

[X]HTML tools > Convert tags to entities - if you want to show some HTML-tagged code in your [X]HTML-document, select your code and use this function. You'll get, for example:

&lt;b&gt;demo&lt;/b&gt;

[X]HTML tools > Text to HTML - this function converts a plain text into the nice HTML/XHTML-formatted code using CSS.

[X]HTML tools > Preview selected color - previews the selected (within the text) color at the Famous input field. The color can be in the form of the hex value or the named color (darkBlue, red, white, etc).

Antispam e-mail - makes a selected mailto-link possibly invisible to those damned spammer e-mail harvesters, by converting an address into integer-coded entities. For example, if you will look at the source of that document, mailto:tea@list.ru will look like the heap of a garbage. I hope that spam harvesters do not understand it.



Search

TEA has no dialog windows for find/replace functions. TEA uses the Famous input field and menu-driven interface.

To find a substring within the text, put your substring into the Famous input field (Use Ctrl-F to focus it) and press Enter. Then you can use Find next or Find previous functions. There are also three buttons near the Famous input field. They are: Find, Find previous and Find next. On search, TEA starts from the cursor position. You can set Whole words and Case sensitive options by checking the respective menu items.

To replace the selected (i.e. text that been found) text with a new one, put the new value to the Famous input field and use the Replace with function. Thus, you can walk through the text using Find next and apply Replace with when you need.

To replace all occurrences of a substring in the selected text, put a special command into the Famous input field:

old value~new value

So, the "~" is the delimiter. For example, you want to replace all occurrences of the word "cat" to the "mouse". The command will be:

cat~mouse

So put such command to the Famous input field and apply the Replace all function.

If you want to delete some substring from the text, use the substring~ formula. For example, to remove all occurrences of the word "weapon" from the text you can use "weapon~".

While search or replace you can use regular expressions. To do so, turn on the Regexp mode option (below the Whole words). For example, to convert HTML italic tag into the TeX tag you can use the following formulae:

<i>([^<]*)</i>~\emph{\1}

Please note that \1 acts like a content of the captured (with "parentheses") part of the source string. To have the access to the second such part, use \2, \3 for the third, etc.

Another example - how to find all numbers at the text? Use the (\d+) regexp at the FIF.

Don't forget to disable the Regexp mode when you need to do a usual searching. Also the Regexp mode overrides the Case insensitive mode, i.e. with Regexp mode the Case sensitive is ON by default.

Fuzzy mode - enables very basic "fuzzy search" support. For example, you need to find some word, but don't remember how exactly it is written. So in fuzzy mode, TEA can find similar word (if they have the same length, i.e "fender", "lender", etc). The factor of similarity can be defined at Options - Functions - Miscellaneous - Fuzzy search factor.

In the file manager mode, "Replace all" works with all selected files and the charset from the charset selector of the file manager panel.

At the last, Replace all in opened files works as the Replace all, but in the scope of all opened files.

Search in files - searches the text given at FIF within all text files, starting from the current directory at the built-in file manager (the Files tab), and deeper into the subdirectories. For a text encoding, TEA uses the charset that is selected at the charset list on the Files tab.

Actually, TEA searches not in the ALL files. For the central processing unit, there is no difference between text files or mp3, or images. Programs must know the difference, but how? And why it is so important to identify the text file? If the program cannot do that, it will search the text in all files - images, sounds, videos, etc.. Too much time! Thus, TEA must know the difference. So TEA presumes that text files are the files with extensions those TEA recognizes for syntax highlighting. Also, TEA knows that text files are txt, odt, kwd, docx and other formats those TEA support. Finally, TEA know about some definitely text files those have names such as README, ChangeLog, etc.

So, TEA cannot search in all other files and currently there is no way to define custom file-name mask or something like that.

Mark all found/Unmark - colorize or decolorize all search results at the text. This function can produce incorrect text color settings when using View - Darker, until you restart TEA or open and work with another file.


Functions

To use text-processing functions, you need to select some text first. Some functions (such as Text statistics) can work with a whole text if no fragment is selected. Also there are some special cases when TEA can treat the current word as a selection when there is no text is actually selected. For example, it is a behavior of UPCASE and lowcase functions. But such behavior is a rare exception from the rule.

Some functions take the parameter that you must place into the Famous Input Field (FIF, the input entry at the bottom of the main window). For example, the function Remove lines < N size gets N value from the Famous input field, so first you type the value, then call a function. There are no default values.

Functions > Repeat last - repeat the last used function. Actually, it works with almost all menu items, not just at the Functions menu.

Functions > Tools > Scale image - scales the image. In the text, select the image file name or set the cursor on it. Put into the FIF parameters of the scaling. Apply this function.

The format of parameters is: filename~new size

Filename is the output filename. It can be "hardcoded" (i.e. something like "out.jpg") or contain macros: %filename (filename + extension), %basename (the file name without extension), %ext (extension). Thus, the full source file name is %basename.%ext. The full path with the filename is the macro %s. If you don't want to overwrite the source file, you can use some prefix or suffix to alter the file name:

foo-%basename-bar.%ext~1024

In this example, the output image file name shall be prefixed with "foo-", and suffixed "with -bar".

The second parameter is a new size. It can be in pixels or percents (just add "%" after the value):

foo-%basename.%ext~1024

foo-%basename.%ext~50%

Cells submenu is used for all table-like data processing. It can be LaTeX tables, CSV-data, etc. In all cases you need to define (at FIF) the column separator to tell TEA how to parse the strings.

Functions > Cells > Sort table by column ABC - sorts the text table by the column with the ABC order.

Format string for FIF: separator~column number

Columns range starts from 0, i.e. the first columns is 0, the second is 1, etc.

For example, we have LaTeX table with 4 rows, 2 columns:

dog&cat
lamb&cow
snake&wombat
wolf&tiger

Now we want to sort it by the second (1) column (where the "cat", "cow", etc.). Select the text, put "&~1" into the FIF, and call this function. The table will be sorted by the second column.

It is good to process the table without line-breaks (such as "\\" in LaTeX), and then add line-breaks to the result using the "Apply to each line" function with FIF value "%s\\".

Functions > Cells > Swap cells - swaps the cells of the table by columns.

FIF format string: separator~column1~column2

For example (with the previous sample table) we want to swap column 0 with 1 - the column with "cat" must be before "dog" column. Select the text, put into the FIF "&~0~1", and call Swap cells.

Functions > Cells > Delete by column - delete column by the given number (0..n).

FIF format: separator~column number

0 - first column, 1 - second, etc.

Functions > Cells > Copy by column[s] - copy columns to the clipboard.

FIF format: separator~column 1[~column 2]

If the column2 is not given, the column1 will be copied, else - from column1 to column 2.

Functions > Analysis > Text statistics - outputs text statistics for the whole text or the selection into the Logmemo.

Functions > Analysis > Words lengths - how much words with length from 1 to 32.

Functions > Analysis > UNITAZ - the UNIversal Text AnalyZer that computes frequencies of words and gives some other related information.

Functions > Analysis > Count the substring - the number of occurrences of the substring (put it to the Famous Input Field) in the document. See the result at the logmemo. The "Search - Case sensitive" is used as an option.

Functions > Analysis > Extract words - extracts all word from the document and place them into the newly created one.

Functions > Tables

In TEA, the tables is a something like a set of rules for the text replacing. At the first, you need to create the file with a table (key=value format). Here is an example:

cat=dog
mew=bow-wow

Then save this file as a replacement table file at the special TEA directory called tables. It is available at the file manager's bookmarks panel or file save dialog favourities. After you save the table under some name, it shows at the Functions > Tables menu.

Now try to apply this table. Create a new file and write some text like this: The cat say: "mew". Select this text, then select your table from the menu and see what will happen. As a result we have a new sentence: The dog say: "bow-wow". So the tables is a way to do a multiple replacement.

If the Regexp mode at the Search options is turned on, the table will use the keys as the regexps.

In the file manager mode, tables work with all selected files and the charset from the charset selector of the file manager panel.

Functions > Snippets

The snippet is the piece of code, which you can insert into the text. TEA keeps each snippet as the single file in the $HOME/.tea/snippets directory. The file name of a snippet is the menu item in Snippets-menu, i.e. the content of Snippets menu is the list of files from $HOME/.tea/snippets. To create a new snippet, you need:

1. Write some text.
2. File > Save As. Click the "snippets" bookmark to open a snippets directory, then save your file as a usual one. Note: Do not save a snippet under the name of any other TEA menu item! Menu item names should not duplicates, otherwise TEA cannot set keyboard shortcuts properly. It is important when you give a name for the snippet, or the script, template, session name, etc.
3. Enjoy :)

You can create a snippet that uses a text selection in some way. For example, you want to make a snippet which encloses the selected text into some HTML-tags. The %s macro represents a text selection. Here is the example of such snippet:

<a href="%s">%s</a>

When this snippet will be applied, %s will be replaced with the selected text. If there no text is selected, snippet content will be inserted into the text (but without the "%s" macro).

To open a snippet for the editing, use snippets directory bookmark at the TEA file manager or File save/open dialog. From there you can also rename or delete snippets (use the context menu - the right click - in File save/open dialogs).

Functions > Scripts

Scripts from the user's point of view

With TEA you can use scripts to process a selected text, just as you use a built-in TEA functions. If the script can handle some parameters, put them into the Famous input field.

TEA can work with scripts those written in Python, Perl, Ruby and Bash (Sh). To install a script, just copy it to $HOME/.config/tea/scripts (you can use "scripts" shortcut at the Save As dialog to save your file as a TEA script). If a script is packed, please unpack it first. TEA will "see" the newly installed scripts after restart or when you save the script from TEA. The scripts management stuff is similar to snippets.

Scripts from the developer's point of view

How to write a script for TEA? It's quite simple. But the first thing that you must to know it is how TEA gives a text to the script and how TEA takes a processed text back to replace the selection with it.

TEA runs each script with one or two parameters. Both of them are file names. The first file contains the text (UTF-8). This text is a selected text that TEA gets in the current document. And the second file (if exists) contains a text (UTF-8) from the Famous input field. So your script can read the first file to obtain the text data, and read the second file to get some optional parameters for your script.

Be careful with the text handling - TEA internally operates with UTF-8 encoding, so all text processing at the script must be UTF-8-safe. OK, now let's see how a script can return a processed text. Just write that processed text to the first file again, i.e. to the file, which file name you take from the first parameter of your script.

Below these lines you shall see an example of UTF8-safe Python-script that takes a text, swaps the case, and returns the processed text back to the TEA.

import sys
import string
import codecs
f = codecs.open(sys.argv[1], "r", "utf-8" )
u = f.read()
f.close
u = u.swapcase()
f = codecs.open(sys.argv[1], "w+", "utf-8" )
f.write (u)
f.close

sys.argv[1] contains a name of file with the text from TEA. We read the whole content of that file, then we process this content, and then we write it back to the sys.argv[1]-file. Voila! Please note how to use the codecs.

And another example - the "inline" calculator. Here we don't use any codecs because we work with a numerical data:

import sys
f = file (sys.argv[1], 'r')
s = f.read()
f.close
t = eval (s)
f = file (sys.argv[1], 'w+')
f.write (str (t))
f.close

But what if we need to get some additional user's parameters to the script? They are available as a string, and you can read it from the file that named at sys.argv[2] (in Python). At Bash-script, use $1 to get the first parameter, and $2 for the second. Summing this all, the second parameter is a file which contains a text from the Famous input field. Note that Ruby scripts take the first parameter in ARGV[0], and the second in ARGV[1].

Some notes about the BASH-scripts and sed/ed/etc stuff. The trick is to use a temporal file. First copy the $1 into some temp. file, then process this temporal file and put the result back into the $1. Here is an example (replacing all "dog" with "cat") of such script:

cp $1 /tmp/xyz.xyz
sed 's/dog/cat/g' /tmp/xyz.xyz > $1

If you wish to contribute some scripts to the TEA site scripts repository, please consider contributing your script with a public domain status. Or at least with the Free license. There is also will be useful to put the credits and the description somewhere in the comments in your script.

Sort > Sort case sensitively - sorts selected lines alphabetically and case sensitively.

Sort > Sort case sensitively, with separator - sorts substring those separated by the delimiter. Put the delimiter into the FIF, then use this function on the text. Thus, you can sort "three|four|one|two" with the "|" as the delimiter.

Sort > Flip a list - reverses lines order. Was:

Dog
Cat
Cow

Will be:

Cow
Cat
Dog

Sort > Flip a list with separator - reverses substrings order separated by the delimiter at FIF.

Filter > Remove duplicates - useful when the string list has duplicated elements. Any duplicated item AFTER the original one will be removed. Can be slow on slow machines.

Filter > Remove empty lines - no empty lines will surrender! Empty lines are useless.

Filter > Remove lines < N size - remove lines with the length less than N. N is the number of characters. Write the number into the Famous input field.

Filter > Remove lines > N size - acts like the previous function, but removes all strings those larger than N characters.

Filter > Filter with regexp - filter a list using the regular expression. For more info, see www.regular-expressions.info. However, here is a brief example. Let's presume you have a list:

hello.doc
example.txt
nature.jpeg
mytext.txt

And you want to filter all items with "txt"-extension. So the regexp (regular expression) for this will be:

.*\.txt$

Put it into the Famous input field, select the text and apply a function. Voila!

Filter > Remove after delimiter at each line. Removes the substring after the delimiter at each selected line. You need to put the delimiter into the FIF. For example, the delimiter is ")", and the selected text is:

1.) Nirvana
2.) Grajdanskaya Oborona
3.) The Cranberries

Apply the filter, and you'll get this:

1.
2.
3.

Filter > Remove before delimiter at each line. Removes the substring BEFORE the delimiter at each selected line. You need to put the delimiter into the FIF. For example, the delimiter is ")", and the selected text is:

1.) Nirvana
2.) Grajdanskaya Oborona
3.) The Cranberries

Apply the filter, and you'll get this:

Nirvana
Grajdanskaya Oborona
The Cranberries

Math > deg min sec > dec degrees converts coordinates from "degrees minutes seconds" format to "decimal degrees". Example:

Was: 40° 26′ 46″ N 79° 58′ 56″ W, result: 40.446° N 79.982° W.

Math > dec degrees > deg min sec converts coordinates from "decimal degrees" format to "degrees minutes seconds". Example:

Was: 40.446° N 79.982° W, result: 40° 26′ 46″ N 79° 58′ 56″ W.

Math > Sum by last column - sums values of each last column at the selection. For example, we can calculate the simple text list:

Carrots 14
Apples 45.8
Oranges 11

Math > Evaluate - calculates the expression that selected at the text. For example you can write 2+2, then select it and apply Evaluate. After such action you shall see the result at the logmemo. In your expression can may use the following operators: +, -, *, /, ^ (power), % (get percent value). The braces are supported. Here are some examples:

2/3*123
5+5+5
1-200*89
2^8
250%4 //what is 4 per cent of 250?

Math > Decimal to binary - converts the decimal integer into its binary representation. Example: was 255, will be 0000 0000 0000 0000 0000 0000 1111 1111.

Math > Binary to decimal - works with unsigned int binary numbers only.

Math > Flip bits (bitwise complement) -use this function to flip a bit at the binary value. Example: was 0000 0010, will be 1111 1101.

Math > Enumerate - Enumerates lines from the selected text. Place the parameter string of this function into the Famous input field. Syntax: step~zero_padding~prefix.

Step is the step of an increment. For example, step 1 gives a numbers 1, 2, 3 etc. Step = 10 will give us 10, 20, 30.

Zero padding defines how many digits are in each number. For example, if zero padding = 3, and step = 1, we shall have 001, 002, 003 etc.

Prefix is a prefix after the number and before the string. Prefix can have significant trailing spaces.

Here are some examples and results:

example 1, parameters are "1~3~) " (without quotes). Result is:

001) dog
002) cat
003) mouse

example 2, parameters are "10~1 " (without quotes). Result is:

10 dog
20 cat
30 mouse

example 3, the parameter is "1" (without quotes). Result is:

1dog
2cat
3mouse

You can use this function even without the parameters - in such case, padding = 0, step = 1, and the prefix is an empty string. You can use the single step parameter or the pair step and padding, or all three parameters.

Math > Arabic to Roman - converts "usual" numbers into the Roman form (i.e 20 to XX).

Functions > Morse code

From Morse To English. I am not a guru in Morse codes, but I hope that my effort to implement such function is right. With this menu item you can translate the English text into the Morse code. For example, was:

tea and coffee

Will be:

- . .- .- -. -.. -.-. --- ..-. ..-. . .

Note that TEA puts a single space between two Morse codes.

From Morse To English. The inverse action for the previous function. You can decode any English Morse-coded message. You must know that TEA supposes that there are single spaces between Morse-codes, as in the example written before.

Text > Compress - removes all whitespaces at the selection.

Text > Remove formatting at each line - removes the formatting (tabs, new lines, double spaces etc.) at each selected line.

Text > Remove formatting - removes the formatting from the whole selected text, so the text will be converted to the one big string without new lines, double spaces, etc.

Text > Apply to each line is a powerful tool to add some text into each line of the selection. And again we use the Famous input field. For example, I want to add br-tag at the end of each line. So I type into the entry:

%s<br>

And then I apply this function to get br-tag added at the end of each line. The %s macro points to each line of the selection. So consider that the %s represents a text of each line. In another example, I want to enclose each line into a pair of li-tags. The formula for the Famous input field will be:

<li>%s</li>

And another example:

<a href="%s">%s</a>

You can also apply the snippets (from the TEA's snippets directory). To do such thing, use the @@snippetname at the FIF. For example, if you have the snipped named "myitalic", use @@myitalic. As you remember, snippets can contain the %s macro to substitute the selected text. In the case of "Apply to each line" function, %s will mean the text of each selected line.

Text > Escape regexp useful to escape regexp special characters such as $, *, +, [, ], etc .



Functions > Spell-checking

TEA can use two spell checking engines: Aspell and Hunspell. To switch between them use the list Spell checker engine at Options - Functions page.

Aspell engine uses system-wide installed dictionaries (use your Linux distro package manager to install them). At the Windows, you need some extra things to do. First, download and install Aspell full installer from the http://aspell.net/win32/. Then, from the same page, download and install some dictionaries. You need to put them into the directory, where Aspell is installed. By default, it is C:\Program Files\Aspell. Finally, at TEA, you need to set the path to the Aspell - go to the Options - Functions, change the Aspell directory option to the correct one and restart TEA.

For Hunspell, you also need to set the path to the dictionaries by yourself, manually. It is possible that the dictionaries are already installed because Hunspell is the spell checking engine for Firefox and LibreOffice.org. For example, Firefox (in a case of the user local home directory installation) holds the dictionaries at firefox/dictionaries directory. Also you can download dictionaries from LibreOffice and OpenOffice.org extension repositories. There are files with OXT extension. Internally they are common ZIP-files. So download and rename filename.oxt to filenname.zip. Create some directory for dictionaries and unpack the .aff and .dic files from ZIP. Then select this directory using Select button at the Options - Functions - Hunspell dictionaries path option.

When the dictionary stuff is configured, you need to go to the menu Functions - Spell checker languages and select the language what you need. Without this last step the spell checking will fail. Also select the language in this way after you change the engine from Aspell to Hunspell or vice versa.

It's a good idea to restart TEA after adding the dictionary.

Spell-checker languages - At this menu you can find the list of dictionaries which installed for aspell (from the distro or so). To spell check, use one of those menu items. It works with the whole text, not with the selection only.

The menu item with the language name is used also to set the default spell-checker language. The default value is a language of your locale. To do a simple check with the default language, use Spell check menu item.

Suggest - shows the list with suggestions for the current misspelled word (actually, the word under the cursor). To use this function, use Spell check first. Possibly incorrect words will be underlined.

You can fix them with the Suggest functions or by the hand. When you fix the error you can see that the fixed word is colored as before. That is because the nature of the TEA spellchecker - it updates manually, so to update error marks select the same spell checking menu item again. To turn error marks off, use View > Hide error marks.

Add to dictionary - add the underlined as incorrect word to the user's local dictionary. Actually, this function adds to the dictionary any word at the cursor.

Beware that some correct words TEA can mark as incorrect. It's due to the current word parsing, it will be fixed soon as possible.

Remove from dictionary- this function is Hunspell-only. An updated dictionary will be loaded after the next session.


Functions > Plugins. TEA (Qt5-builds) can run the plugins written in QML (see the source code tarball/manuals/plugins for the details how to write TEA plugins). The plugins are snipped as archived directories (TEA itself can unpack ZIPped plugin to plugins folder if you try open such archive in TEA). To install the plugin. just unpack it WITH its directory to $HOME/.config/tea/plugins (UNIX-way) or drive:\Documents and Settings\username\tea\plugins (Windows-way). Then restart TEA to rescan the plugins list. Delete plugin's directory to uninstall it. I am not responsible on how plugin work - it can do everything just like the normal stand-alone program, so trust your plugin developer or don't use it.



IDE

TEA has some basic IDE functions. The use TEA as IDE is simple.

The first, you need to create the project file. To do this, just create the new file and insert TEA project file template from Functions - Place - TEA project template.

Save it at the your project's source top directory, under any file name, but with the "teaproject" extention, i.e. filename.teaproject.

teaproject file is a simple key=value text file. It holds the project settings. Thus, you can hold many teaproject file at the same directory. Here are, for example, TEA's teaproject files for different build systems (qmake, cmake and meson):

tea-make.teaproject

command_build=make
command_clean=make clean
command_run=bin/tea --m&

tea-meson.teaproject

dir_build=b
command_build=ninja
command_clean=ninja -t clean
command_run=./tea --m&

tea-cmake.teaproject

dir_build=cmake
command_build=make
command_clean=make clean
command_run=./tea --m&

The syntax is clear:

dir_build - the directory, where command_build will run for the building. If there is no dir_build, then the teaproject file directory will be used as dir_build. The directory can be absolute, if not, the relative one to the teaproject file directory will be used.

command_build can be any, as you wish: make, ninja, etc.

command_run - runs at dir_build to run compiled binary.

command_clean - runs at dir_build to clean the project.

When you open, save or switch (by the tab) to the teaproject file, TEA reads it into the inner structures and uses the commands from teaproject when run menu items from IDE menu: Run program, Build program, Clean program. Please note that TEA reads the SAVED contents of the teaproject file, not the current edited state.

The IDE menu is useful in a pair with View - Profiles menu. For example, you can create the "ide-profile" with some font settings, wide window, no word wrap; and "text-profile" with another font set, word wrap, smaller window, etc. Then you can quickly switch between the profiles via menu or by the hotkeys.

When building program, TEA shows compiler output at Logmemo. Double-click on the bold text (filename:line:column) to open the error or the warning place at the editor.



Run

This menu is designed for running the current file with external programs, browsers for example. To add some items to menu, go to File > Configs > Programs list config, edit that file and then save it. The configuration file has the simple ini-like format. Each line has the following format:

meni item caption=command line

An example of the command line for a browser starting:

konqueror=konqueror %s

%s is a needful macro for a current filename, so use it in the proper place. For Win32 you need to use the full path for the executable file, with the double quotes (macro %s needs its quotes too!). For example:

opera="C:\Program Files\Opera\opera.exe" "%s"

Some more precise macros are available: %basename, %filename, %ext, %dir. This allows to use the parts of the path. Thus, if we have the full path "/mnt/foo/bar.txt", %dir = "/mnt/foo", %basename = "bar", %filename = "bar.txt", %fext = "txt". So the full path at the command line can be presented in the following way: %dir/%basename.%ext

To open the currently selected file or file at cursor at the text (as by F2, but with an external program) use %i macro.

For example, if you want to open the image file with gimp, put the following command line to the config file:

gimp=gimp %i

Then, at HTML or LaTeX file, move the cursor to the image file name. Then call "gimp" menu item from the "Run" menu. Enjoy.


Nav

Labels, Update labels. You can put some specially formatted labels into the text and then switch between them from the Labels menu (or drop-down list on the toolbar). How does it work? The label is just a text embraced with the opening and the ending sequences ("[?" and "?]" by default, this values can be redefined at Options - Functions - Labels).

For example, put into your text some lines such as "[? dogs ?]", "[? cats ?]". Then make TEA know this labels using Update labels menu item or press the button on the toolbar. The Labels menu and drop-down list will be filled with labels "dogs" and "cats". You can select them from the menu or the list and navigate to the text near the selected label. Please note that labels are updating manually only.

Go to line - moves the cursor position to the line number that you provide in the Famous input field.

Save position/Go to saved position - these functions are good to make a quick jump through a large text, when you need to look something at the one place, then return to the currently editing place, etc.


Fm

Fm is meaning the File manager. This menu contains functions those related to TEA file manager. For example, you can rename files or directories or get the MD5 checksum. Explore and use!

For some function such as MD5 checksum, select the file first, and then apply the function.

Fm > Multi-rename submenu helps to flexibly rename file names. All those functions use the parameter from FIF.

Fm > Multi-rename > Zero pad file names - prepend zeroes to each selected filename that has the numbering as the part of file name. For example: page1, page100. Such files cannot be sorted properly.

So set the filename length at FIF. Files will be numbered correctly, but with the removal of all non-digit characters. Example:

We have files:
page1.txt
page100.txt

Put 5 to the FIF, apply the function.

Now we have:
00001.txt
00100.txt

Fm > Multi-rename > Delete N first chars at file names - N is a number from FIF. Deletes N first characters from each selected file name.

Fm > Multi-rename > Replace in file names - replaces the substing at each selected file name. FIF format: old~new. Example: .jpeg~.jpg

Fm > Multi-rename > Apply template - apply the template to each selected file name. Available macros with parts of the original file name: %filename (= filename.ext), %ext (= ext), %basename ( = filename). For example, you need to rename 01.jpeg, 02.jpeg to 01.jpg, 02.jpg. So the template must be: %basename.jpg, i.e. %basename (file name without extension) will be appended with ".jpg".

Fm > Select by regexp/Deselect by regexp - use this functions to select or deselect files by regexp pattern. For example, to select all txt-files at the current dir, put the following regexps into the FIF:".*\.txt$" (without quotes!) then, use Select by regexp. Then you can press Open button to open all selected files.

Fm > File information > Full info - gives you a full information about the file (creation/modification time, etc). For the 16 bit PCM WAV files it calculates the RMS (for the both channels). For other WAV's shows just the properties such as bit depth, etc.

Fm > File information > Count lines in selected files - please note that empty lines will be also counted.

Fm > Images > Scale by percentages/Scale by side - among other non-text related functions TEA has the ability of batch conversion of images. It is useful when you want to scale them or convert to another format.

For example, we want to scale selected images by 50 per cents, put the processed images into the new directory and zip that directory:

1. Select files at the File manager. To select them multiply, use Ctrl-Click (or Ctrl-A to select all).
2. Put the desired percentage into the Famous Input Field. The value must be a simple integer number without the % sign.
3. At the Options > Images check the Zip directory with processed images option.
4. Apply the Scale by percentages function.

After that, TEA creates a new directory as a subdirectory of a current one. This new directory has the random name that starts with "images-out-". Into this directory TEA put all converted images, leaving the originals unmodified.

You can want to scale images in a more precise way and define the size manually. To do that, put the image side size into the Famous Input Field and apply Scale by side. As you know, each photo has dimensions. For example, 640x480. If the width is larger than height, the image has a horizontal orientation (TEA does not support EXIF data), and vise versa. So we can use the side - the larger side of an image. Usually all photos have a standard dimensions with some aspect ratio in a mind, so the larger side for all of photos is the same.

For example, we want to scale all images (photos with a right aspect ratio/dimension) to width 640 and, if the image has a vertical orientation, to the height 640. Put that 640 into the Famous Input Field and apply Scale by side.

Image conversion options are places at the Options > Images page. With the Image conversion output format list you can set the output format. The Output images quality (from 0 to 100) is used mainly for JPEG. A default value is -1 that means the internally defined value. The Scale images with bilinear filtering checkbox affects images when you scale them, to smooth the image and make it less "rough".

Fm > Images > Create web gallery - yes, TEA can create a simple table-based web gallery. Dp the following steps:

1. Put your images in some directory. Save the html-file there. Open that file with TEA.

2. Go to the TEA's file manager, select image files those you want to put into the web gallery.

3. Use the Create web gallery function.

4. The thumbnails and the HTML-table shall be created.

You can customize the gallery using the Options > Images > Web gallery options. There is a thumbnail size, cells per row, et cetera.

TEA as a ZIP packer/unpacker

TEA provides simple functions to pack files (not directories) to the archive. To do such thing, set the archive name first (do that at the directory where you want to create the archive):
Fm > ZIP > Create new ZIP
The input dialog box will be provided. Then, walk through your directories. Select any files and use Add to ZIP to add them into the archive. Please note - all that happens virtually until you do not use a Save ZIP function. To pack the files physically, apply Save ZIP.

All files will be packed into the archive that has a one subdirectory names as the archive name, but without .zip-extension.

You can also unpack the selected ZIP-file into the current directory. Use the Unpack ZIP to current directory function. Please note that the file names charset (inside of the ZIP-archive) are controlled via Options - Common - ZIP unpacking: file names charset/ZIP packing: file names charset options. So, if you see weird characters after you unpacked ZIP-file, try to tune the charset. To do this less painful, select some charset at ZIP unpacking: file names charset and try how is looking file name - use List ZIP content menu item. It simply lists the archive content (file names) into the Logmemo using selected charset.

And another note - TEA does not support password-protected ZIPs.


View

Highlighting mode - from this submenu you can set the highlighting mode manually. It is useful for new unsaved files or for a file without extensions.

Hide error marks - hides the underlined marks those were set by the spell-checker.

Toggle word wrap - turn word wrapping on/off for the current document.

Palettes - from this submenu you can select the color scheme that affects a text editing area. To define your own colors you can create your own palette based on some build-in palettes (see the source directory, palettes subdir). Then save your palette into the $HOME/.config/tea/palettes directory and choose one from the Palettes menu.

TEA partially supports Eclipse IDE themes (eclipsecolorthemes.org) - just put XML file of the theme to TEA palettes directory and select it from the menu as the native TEA palette. Please note that TEA palette format supports more highlighting elements than Eclipse Color Theme plugin, so Eclipse themes will be not so colorful as TEA native palettes.

Profiles - this menu allows you to switch between view profiles (they includes parameters such as window position, size, fonts, word wrap and line numbering settings, etc.). So you can save your current settings via Save profile function, and named profile will appear in the Profiles menu. In any time you can select it to recall saved settings.


Preferences

On Keyboard tab you can assign the shortcuts with the menu items. To set a new hotkey, select a menu item from the list, then press some hotkey combination at the entry to the right from the list, and press the Assign button. To remove a hotkey, select the menu item from the list and press Remove button. To reassign the hotkey that already in use, do Remove for this shortcut first.

For Linux, you can use the joystick/joypad to scroll the text and move the cursor. It is disabled by default and can be enabled via Preferences - Common - Use joystick as cursor keys. When enabled, it reads joystick device each 100 milliseconds. I was needed in joystick support to scroll texts for Youtube online videos, when I need to sit in the same position.

Word wrap - use word wrapping globally for all documents, including new ones.

Use wrap setting from highlighting module on the Interface page means that the word wrap settings will be taken from the syntax highlighting modules, not from the global Word wrap option. Some modules have word wrapping turned on, and some turned off. For example, for C++ the word wrap setting is on. For the plain text or for the HTML - is off.


Keyboard

In addition to the standard keyboard operations TEA supports left-handed cursor operations those can be enabled at Options - Common - Use Left Alt WASD.

When enabled, use Left Alt plus WASD for cursor movement, Left Alt plus E and C for page up/down. Use Left Win key with WASDEC to select the text.


The secret power

Know the truth! The reptiloids will prevail over the humankind if you do not have the courage and the knowledge of TEA secret options. They don't have GUI and you need to add and edit them manually to the TEA main config file $HOME/.config/tea\tea.conf (or, under Window, at drive:\Documents and Settings\username\tea\tea.conf). Some of the changes will work after TEA restart. So know the truth:

recent_list.max_items=maximum recent list items, default 21


Notes

The legacy "--charset=codepage" command line option is supported. This command sets the codepage for the following files. For example:

tea --charset=window-1251 file1.txt file2.txt --charset=utf-8 file3.txt

By default (if no charset defined manually) TEA uses UTF-8.

This manual and all TEA media stuff (palettes, images, etc) is the public domain. TEA source code is licensed under GPL v3.

User's syntax hl files can be added to the $HOME/.config/tea/hls directory. See the working hl files at the TEA source directory, the hls subdirectory. Feel free to contribute your hl files. Please use color references from the palette files (look at palettes directory at the source). I.e. use "preproc" or "types" color instead of the hexadecimal value.


Other author's projects

My home site with the prose, programs, music and other things.

Drymba studio - the indie film studio that makes ultra-low-budget movies and clay/3D cartoons. I'm one of the creators. Public domain.

Atomnaya Smena - my one-person music project. Rock/Indietronica/Symphonic/Psytrance. All music is in the public domain.

Nesmeyana - the band where I am one of the members. All music is in the public domain.

Kostny Mozg - the indie/hip-hop/techno band, where I am one of the members. Public domain and Artistic License.

tea-qt-47.1.0/manuals/plugins/000077500000000000000000000000001346332167200161265ustar00rootroot00000000000000tea-qt-47.1.0/manuals/plugins/examples/000077500000000000000000000000001346332167200177445ustar00rootroot00000000000000tea-qt-47.1.0/manuals/plugins/examples/click-and-close/000077500000000000000000000000001346332167200226745ustar00rootroot00000000000000tea-qt-47.1.0/manuals/plugins/examples/click-and-close/main.qml000066400000000000000000000011621346332167200243330ustar00rootroot00000000000000import QtQuick 2.0 Rectangle { id: root width: 640 height: 480 property int counter: 1 function reactToClick() { documents.create_new(); documents.get_current().set_selected_text ("hello world"); Qt.quit(); } Text { id: text text: qsTr("Click me to create new document and close this window") anchors.centerIn: parent } MouseArea { id: mouseArea anchors.fill: parent onClicked: { reactToClick() } } Component.onCompleted: { console.debug("LOADED"); } } tea-qt-47.1.0/manuals/plugins/examples/run-and-close/000077500000000000000000000000001346332167200224135ustar00rootroot00000000000000tea-qt-47.1.0/manuals/plugins/examples/run-and-close/main.qml000066400000000000000000000006341346332167200240550ustar00rootroot00000000000000import QtQuick 2.0 Rectangle { id: root width: 640 height: 480 property bool close_on_complete: true Component.onCompleted: //run it on plugin load { console.debug ("Rectangle Component.onCompleted"); documents.create_new(); //create new document documents.get_current().set_selected_text ("hello world"); //insert text at the cursor position } } tea-qt-47.1.0/manuals/plugins/examples/settings-via-qmap/000077500000000000000000000000001346332167200233155ustar00rootroot00000000000000tea-qt-47.1.0/manuals/plugins/examples/settings-via-qmap/main.qml000066400000000000000000000007371346332167200247630ustar00rootroot00000000000000import QtQuick 2.0 //this example shows the access to TEA settings //using QMap Rectangle { id: root width: 640 height: 480 property bool close_on_complete: true Component.onCompleted: { console.debug ("Rectangle Component.onCompleted"); for (var prop in hs_path) //console.log (prop, "=", hs_path[prop]) log.log (prop + "=" + hs_path[prop]); } } tea-qt-47.1.0/manuals/plugins/examples/use-fif/000077500000000000000000000000001346332167200213025ustar00rootroot00000000000000tea-qt-47.1.0/manuals/plugins/examples/use-fif/main.qml000066400000000000000000000010211346332167200227330ustar00rootroot00000000000000import QtQuick 2.0 Rectangle { id: root width: 640 height: 480 property int counter: 1 function reactToClick() { text.text = tea.fif_get_text(); } Text { id: text text: qsTr("Click me to show the FIF value") anchors.centerIn: parent } MouseArea { id: mouseArea anchors.fill: parent onClicked: { reactToClick() } } Component.onCompleted: { console.debug("LOADED"); } } tea-qt-47.1.0/manuals/plugins/readme-en.txt000066400000000000000000000047721346332167200205360ustar00rootroot00000000000000TEA PLUGINS DEVELOPER GUIDE 1. What is the TEA plugin? The TEA plugin is QML-program that has access to inner TEA classes and variables. TEA plugin's files must be placed to its own directory. The main file must have the name "main.qml". It is the entry point. Plugin's directory name is the name of the plugin for TEA "Functions - Plugins" menu. The set of plugin directories can be placed into the top-level directory. For example, TEA source snips with "examples" plugins directory. When you put it to $HOME/.config/tea/plugins, you'll have the "examples" menu at the "Functions - Plugins" menu. 2. How to distribute TEA plugin? Pack it into the ZIP archive. It must contain the plugin's files WITH their directory. To install the plugin, just unpack such zipped directory to $HOME/.config/tea/plugins. 3. What can do TEA plugin? All things that can do QML programs. There are two types of plugins - the visible (that runs in separated windows) and invisible (that intended to be finished after the exacution). The basic example of the second type see at "run-and-close" example. To show TEA that plugin must be closed after execution, you need to set close_on_complete at the root QML component: property bool close_on_complete: true Then, put all your code to Component.onCompleted. After the execution will done, TEA closes the plugin with close_on_complete == true. Without close_on_complete == true, TEA does not close plugin until the user close it manually. 4. TEA API There are some inner TEA objects are available: document_holder documents CLog log rvln tea QSettings settings QVariantMap hs_path See the TEA source for details about class members. You can call (from the QML plugin) all public slots and Q_INVOKABLE functions of the classes above. The basic way to interact with TEA is to get the instance of current object, get the all or selected text, process the text, change the all text or the selection. For example: documents.create_new(); //create new document documents.get_current().set_selected_text ("hello world"); //insert text at the cursor position or replaces the selection documents.get_current() returns the pointer to CDocument. To set selection or insert the text use: documents.get_current().set_selected_text ("some string"); To get rhe current selection, use: documents.get_current().get_selected_text() To write some text at the logmemo, use log.log ("some text"); To get access to TEA settings and paths, use settings and hs_path objects. To get FIF value, use tea.fif_get_text(); tea-qt-47.1.0/manuals/ru.html000066400000000000000000004111471346332167200157710ustar00rootroot00000000000000 Руководство

Руководство к действию


Содержание



Введение
Интерфейс
Панель Даты
Файловый приказчик
Файл
Правка
Вёрстка
Поиск
Календарь
Функции
Функции - Проверка правописания
Функции - Плагины
Запуск
ИДЕ
Фп
Нав
Вид
Настройки
Клавиатура
Тайная власть
Примечания
Другие проекты автора

Введение

В городе Вязьме вокзал похож на изумрудную шкатулку. Зеленый с белым, уголками, терем. Совсем другой вид имеет небольшой, серенький частный дом возле церкви Петра и Павла. Запущенный садик вокруг строения, двускатная крыша, две трубы.

По пятницам, ближе к вечеру, начинают туда собираться люди. Как они говорят, "на чаёк". Если заглянуть в окна домика - а будто ничего не скрыто - то видно, как за большим столом сидят гости. На столе самовар, с настоящим кирзовым сапогом сверху. Люди чинно пьют чай из блюдечек. Иной выпьет, зачешет кудри рукой, да пустится в пляс, вприсядку! А потом успокоится и сядет.

Неторопливо завязывается беседа. Начинаются чтения "Руководства TEA", относящегося к первой, или, как говорят адепты, истинной версии редактора (то бишь примерно 2000-2002 годов). Цитируют. Трактуют. По рукам ходят ценные списки черновой документации. Именно на них опираются некоторые спорщики, желая поразить собеседника резкой отсылкой к истинному первоисточнику. Когда хозяева выносят на стол блюдо с домашним печеньем и конфетами, на эти кулинарные дары уже никто не обращает внимание. Идут ЧТЕНИЯ. Всё больше людей вовлекается, чаепития заводятся в других домах, особо не таясь, однако и не напоказ. Продавая последнее, покупают самовар, пакеты чаю, сахар, печенье.

Эта опасная секта возникла в одной из окрестных деревень, название которой приводить не будем. Зима, стыло, скучно. Среди семьи Мотыгальниковых - супругов-уфологов и их сына-студента, редактирующих свои тексты в TEA, возникло нездоровое увлечение чтением документации к программе. В документации якобы были зашифрованы пророчества. По утверждению Мотыгальникова-старшего, он встретился в сарае с иномирным существом, открывшим ему истину, учение. Что-де в виде руководства к TEA человечеству дано руководство к жизни вообще.

Мотыгальниковы позвали односельчан на чаепитие (Первое чаепитие, как именуют его сейчас адепты секты) и попытались разъяснить суть, но крестьяне в грубых выражениях заявили уфологам, что те ведут себя еще более странно, чем обычно. Ранее у Мотыгальниковых (они приехали из Калуги) уже были столкновения с местным населением на почве того, что Могытальниковы ложились под комбайны, препятствуя жатве на поле, где среди пшеницы проявились загадочные концентрические круги.

Под давлением местного населения, охваченные "чайным учением" Мотыгальниковы были вынуждены переселиться в город, в Вязьму. Там Мотыгальников-старший устроился работать завхозом в школу номер N, и уже в конце учебного года весь учительский состав обратился в новое учение. А Мотыгальникова Анна, супруга, продавала на базаре гипсовых кошечек-копилок, в каждую из которых вкладывала бумажку с приглашением на чай. Человек, скопив в копилке деньги, разбивал кошечку, находил там умеренно большую сумму и, пребывая в хорошем настроении, читал записку. "А почему бы не пойти?" - решал человек. И шел. И секта росла.

Задача настоящего руководства к TEA - выбить основу из-под ног сектантов и вернуть их в лоно общественной жизни. Руководство полностью переписано - стало быть, все места, трактуемые сектантами как пророческие, перестали существовать. Можно возразить - но ведь учение основано именно на прошлой, "истинной" версии документации. Однако, согласно римскому праву, новый закон отменяет старый. Да и что поделаешь, коли сам автор утверждает, что никаких пророчеств он в документацию никогда не вкладывал, и к пророчествам относится крайне скептически.

В заключение этого предисловия еще немного о "чайной" секте, душевном облике ее членов. О вреде, наносимом сакральными чаепитиями, красноречиво говорят рисунки, ходящие между адептами. Рисунки эти созданы во время продолжительных трансов, в которые члены секты впадают после чаепитий.

Полное художественное убожество, скудность изобразительных средств представлены в популярной, срисованной во многих копиях картинке "Встреча блага":

Мы видим людей, готовых ко встрече некоего абстрактного блага. Одинаковые неряшливые прически, оттопыренные уши - не означает ли это видение сектантами идеальных, "избранных" людей будущего таковыми? Дескать, лишь такие вот чаелюбы получат благо? Но что за благо? Наверное, его природу точно знает основатель секты, Мотыгальников:

Это слащаво-утрированное изображение нагловатого человека, бородкой и волосьями косящего под старорежимного юродивого, проявляет нам по-детски наивное отношение сектантов к своему "духовному отцу". На рисунке Мотыгальников будто протягивает руку - пойдем со мной, я знаю истину. Обманчивое предложение. Левый глаз хитро прищурен. Вот где надо усматривать намерения уфолога в отставке.

И о другом.

У TEA два сайта: semiletov.org/tea и tea.ourproject.org. Если один не работает, зайдите на другой. Есть еще третий, на SourceForge, он не обновляется, а с SourceForge невозможно удалить проект, поэтому я оставил там сайт, чтобы не было пустой страницы.

Пара слов о запуске TEA. В обычном режиме TEA хранит файлы настройки и прочие сопутствующие в $HOME/.config/tea (а под Windows в диск:\Documents and Settings\имя пользователя\tea). И это здорово! Но у некоторых пользователей возникает желание использовать portable-вариант TEA, запуская его например с флэшки. В таком случае надо, чтобы TEA хранил свои настройки на самой флэшке в каталоге, где находится исполняемый файл TEA. Чтобы TEA понял, откуда ему читать свои данные и куда их писать, есть ключик командной строки "--p". Если запустить TEA вот так: "tea --p", то редактор будет запущен в portable-режиме, и файлы его настроек и сопутствующие (включая crapbook, сниппеты и т.д.) будут сохраняться/читаться в каталоге с исполняемым файлом TEA, то есть на флэшке. А если запускать без ключика "--p", то всё будет как обычно, с настройками из стандартного места хранения. Настройки portable и обычного режима не переносятся автоматически туда-сюда и существуют параллельно.

TEA в сборке для *NIX представляет собой один бинарный файл - "tea". Для запуска Windows-версии TEA достаточно содержимого каталога, куда установлен TEA - там есть все нужные ему библиотеки.


Интерфейс

Ежели считать сверху вниз, то в главном окне расположены:

1. Главное меню. Обратите внимание, что у каждого подменю есть эдакая полоска отрыва. Если взяться за нее, то подменю можно оторвать и поместить где-нибудь в сторонке. Меню зависит от текущей задачи. Например, в задаче "Правка" будут одни пункты, в "Наладке" часть скроется, в "Файлах" часть откроется. Это сделано, чтобы TEA не занимал много места в ширину. Экраны-то разные бывают. Забота о ближнем!

2. Область инструментальных панелей. Вообще говоря, панели эти перемещаются и вовне главного окна, а паркуются по внутренним его краям сверху, снизу, слева и справа. Чтобы отключить панель, сделать ее невидимой, щелкните на ней правой кнопкой мыши. Появится меню, в котором поставьте либо снимите галочку с названия панели. Если все панели выключены, то для вызова контекстного меню панелей щелкните правой кнопкой мыши по главному меню.

3. Область вкладок. Состоит из пяти основных вкладок, соответствующих разным задачам. Правка - тут открываются документы, тоже каждый в своей вкладке. Файлы - файловый приказчик. О нем подробно в следующей главе. Наладка - под этой чудной надписью скрываются настройки. То, что в других программах обычно выносится в отдельное окно Настроек, в TEA находится в том же окне, где всё остальное. Изменение настроек сразу же вступает в силу и сохраняется автоматически.

Надо

- тут календарь с возможностью ведения разных дел. Становится доступным и особое меню. Наконец, на вкладке Узнать доступно руководство, которое вы сейчас читаете. Спасибо вам за это!

4. Логмемо. Этим ужасным названием именуется область, куда выводятся всякие сообщения. Эти всякие сообщения могут просто отмечать, что файл был сохранен, а могут и уведомлять про ошибку - как правило, текст сообщения при этом назойливо-красный, чтобы привлечь ваше внимание.

5. Знаменитое поле ввода (ЗПВ). Служит для ввода всяких параметров для функций обработки текста, а также для поиска и замены введенных слов. Подробности читайте в разделе про меню Поиск. ЗПВ работает для поиска как в тексте документа, так и руководства, которое вы сейчас читаете. А также умеет искать в списке пунктов меню для "горячих клавиш" и в файловом приказчике.

6. Строка состояния. Её содержимым можно управлять через настройки - например, отключить отображение положения курсора. Вычисление этого положения отнимает некоторый процессорный ресурс, что может быть заметно на совсем стареньких компьютерах при редактировании больших текстов.


Панель Даты

Это только с виду - обычный календарь. В него можно записывать всякие дела. Дважды щелкаем мышью по дню - и создается или открывается файл с таким же именем, как выбранная дата. Вписали туда что надо, закрыли - файл сам по себе сохранился где надо. А точнее, в служебном каталоге TEA. А если просто один раз на дате щелкнуть, то, ежели есть запись по дню, она покажется в логмемо.

В текста записи можно еще указать время, чтобы напомнить себе о важном деле. Просто в тексте надобно предварить напоминание временем в квадратных скобках, в 24-часовом формате [чч:мм]. То есть ежели надо написать 9 утра, то пишем [09:00], а не [9] и не [9:0]. Помним про нули! Вот примеры:

[20:00] сходить в театр
[21:00]посетить буфет и туалет, как будто в театр ходят чтоб пожрать и

Напоминалки TEA показывает в отдельном окне в левом верхнем углу экрана. Происходит сие зачастую с опозданием в пределах меньше одной минуты - так уж программно сделано.

Чтобы удалить запись, относящуюся к выбранному дню, воспользуйтесь пунктом меню Календарь > Удалить данные о дне.

Календарь может работать в режиме лунного, для этого есть переключатель в меню Календарь - Лунный режим вкл/выкл. Больше о функциях, связанных в календарем, читайте в разделе Календарь, а покамест отмечу еще две штуки. Лунные дни вычисляются по такому-то алгоритму, который выбирается в Наладка - Общие - Алгоритм фазы Луны. Там же, для правильного отображения фаз, надобно выбрать, где вы находитесь - в северном или южном полушарии. В графическом отображении фаз есть ошибка - за 12 и 13 лунные дни картинка одна и та же. Почему, долго объяснять.

В "лунном" режиме, даты в календаре отображаются через косую черту. Сначала идет "григорианский" номер дня, потом, через косую черту - лунный день.


Файловый приказчик

Поясню, почему приказчик. В русском языке есть отличные слова - приказчик, управляющий. Нет нужды в "менеджере".

Этот приказчик в TEA служит вместо набивших оскомину диалоговых окон Открыть файл/Сохранить как. Впрочем, можете пользоваться ими, поставив галочку в настройках на Наладка > Общие > Использовать традиционные окна Открыть/Сохранить.

Давайте разберемся, как работать с файловым приказчиком. В самом верху находится текстовое поле, отображающее путь текущего каталога. Можно набрать там другой каталог и нажать "Enter" или кнопку "Перейти". Справа от поля - панель с кнопками:

Кнопка Перейти (похожа на синий бумеранг) - направляет приказчика в каталог, указанный в поле.

Кнопка Домой - переносит вас в домашний каталог.

Кнопка Освежить - обновить содержимое дерева файлов.

Кнопка Действия - открывает подменю, из которого можно переименовать выделенный файл или каталог, удалить файл либо создать новый каталог. Эти же функции повторяются в пункте Фп главного меню. Зачем? Чтобы вы могли навесить на них свои сочетания клавиш.

Теперь поглядим на правую панель приказчика.

Сверху ее расположено поле имени файла. Чтобы открыть файл, можно вписать туда его имя и нажать кнопку Открыть. Имя может быть как полным путем, как и просто названием файла - в последнем случае подставляется текущий каталог. В поле работает клавиша Enter - в зависимости от того, как вы попали на его вкладку - через пункт меню Открыть или Сохранить как. Если первое, то Enter открывает вписанный файл, второе - сохраняет.

Дабы открыть несколько файлов, выделите их в списке файлов (с помощью нажатой клавиши Ctrl и мыши, либо клавиши Insert вы можете выделять несколько пунктов) и нажмите опять-таки кнопку Открыть. Рядом с полем имени файла есть список кодировок. Все файлы открываются согласно выбранной кодировке. Для автоматического определения кодировки установите на файл курсор и нажмите кнопку со знаком вопроса, расположенную справа от списка кодировок. TEA попытается определить кодировку и выберет её в списке. Эта штука работает только для русских и украинских кодировок, а также для HTML-файлов.

Файл можно открыть также двойным щелчком по его имени на списке файлов.

А чтобы сохранить текущий файл под нужным вам именем, достаточно вписать это имя в поле имени файла и нажать кнопку Сохранить как. По умолчанию TEA настроен таким образом, что при выборе пункта меню Сохранить как или Открыть вы переноситесь в файловый приказчик, где и делаете всё, что вам нужно.

Еще ниже - панель закладок. Вот уж лепота так лепота. Кнопкой + туда добавляется закладка на текущий каталог, а кнопкой "-" удаляется выбранная в списке закладка. Двойной щелчок по закладке - и приказчик переносит вас в нужный каталог. Первые пункты в списке - шаблоны, сниппеты и тому подобное - предустановленные, их удалять нельзя. С их помощью вы попадаете в каталоги шаблонов и сниппетов, которые TEA отображает в особых менюшках.

Если поставлена галочка в Наладка > Общие > Авто-показ картинок в файловом приказчике, то при установке курсора на файл с картинкой, эта картинка будет показана уменьшенной в окошке рядом с окном TEA. Другой способ просмотра картинки - нажать на ее файле F2 (меню Файл > Открыть под курсором).


Файл

Новый. Создает новый пустой документ. Можете текст набирать, а можете просто на белый фон смотреть.

Открыть - открыть файл. Появится файловый приказчик либо диалоговое окно открытия файла (смотря по настройкам). Там есть список "Кодировка". Выберите нужную, потом открывайте файл. Пользователи Windows, стандартная русская кодировка в этой системе - Windows 1251. Кнопочка "?" справа от списка кодировок - чтобы TEA попытался определить кодировку выбранного файла автоматически.

Вообще почитайте главу Файловый приказчик - там подробно описано, как с ним работать для открытия и сохранения файлов. Диалоговые окна не столь удобны.

О поддерживаемых форматах. TEA читает/пишет обычные текстовые файлы, а также может вытаскивать текст из ODT (OpenOffice.org Writer), FB2, DOCX, RTF, KWD (старый формат KWord), ABW (Abiword) и SXW (старый формат OOo/StarOffice). А еще читает файлы, сжатые gzip'ом. Относительно офисных форматов, то поддержка их в состоянии разной степени кривизны. Но читать можно.

Сохранить - сохранить файл. Если он не был сохранен ранее, то редактор спросит, под каким именем сохранить. В окне выбора имени файла (или в файловом приказчике) можно также указать кодировку. Я советую использовать UTF-8. Кстати, внутренне TEA держит текст в UTF-16. UTF-8 и UTF-16 - варианты юникода.

Последний открытый - открывает последний открытый файл, который был закрыт. Проще говоря, первый файл из списка Последние файлы.

Открыть под курсором (F2) - одна из моих любимых вещей в TEA. Позволяет открыть файл, на имени которого (в HTML-документе) стоит курсор. Если картинка - редактор вам покажет ее. Ежели текстовый файл - откроет. Если уже открыт - сделает текущим его вкладку. Коли имя файла не заключено в кавычки, выделите его - тогда тоже можно применить Открыть под курсором. Пользуйтесь на здоровье! Кроме того, эта штука умеет переносить вас по локальным href-ссылкам.

Если же курсор стоит не на тексте, а в списке файлов в приказчике, то нажатие F2 на файле с картинкой (любой из поддерживаемых TEA форматов от JPEG до TIFF) откроет уменьшенное изображение во встроенной смотрелке.

Существует также способ открывать файл по месту курсора вообще в произвольной программе. Как это сделать, читайте в разделе про меню "Запуск".

Фигня - открывает особый файл, чтобы вы заносили туда всякие заметки и прочую ерунду. Файл автоматически сохраняется при закрытии себя отдельно или всего TEA.

Заметки - почти то же, что Фигня, только для текущего файла. TEA создает для него файл с расширением .notes, автоматически сохраняемый, куда вы можете помещать заметки, относящиеся к текущему файлу. Мне, например, удобно выкидывать туда текст, я хочу временно или навсегда убрать из файла, или разные сведения для дальнейшего использования в файле.

Сохранить иначе > Сохранить запасную копию - сохраняет содержимое текущего файла под именем, составленным из имени текущего файла и расширения "bak".

Сохранить иначе > Сохранить версию по времени - тоже сохраняет копию, только имя этой копии составляется с добавлением к нему текущих даты и времени (включая миллисекунды).

Последние файлы. Из этого подменю вам доступен для быстрого открытия любой из дюжины последних открытых файлов. При этом TEA знает, в какой файл кодировке, а также перемещает курсор в место текста, с которым вы работали в последний раз.

Шаблоны - чтобы создать новый файл на основе шаблона, просто выберите в этом меню имя файла-шаблона. Как создать свой шаблон? Достаточно сохранить любой файл в папке шаблонов. Для этого выберите пункт меню Сохранить как и, в открывшемся файловом приказчике воспользуйтесь закладкой шаблоны (или в стандартном диалоговом окне сохранения файла, щелкните на templates в левой панели быстрого доступа).

Сходным образом, для открытия шаблона на редактирование, открывайте файл-шаблон как обычный файл. Удалить или переименовать шаблон можно либо в файловом приказчике, или в диалоговом окне через контекстное меню (правая кнопка мыши).

Шаблоны должны быть в кодировке UTF-8. При сохранении шаблона внутри TEA (не в другом редакторе), TEA принудительно устанавливает эту кодировку.

Сессии. Сессия - это просто список файлов. Чтобы можно было их сразу загрузить. Выбор сессии в этом меню открывает все файлы, которые включены в сессию. Чтобы сохранить сессию, надо набрать ее имя в Знаменитом поле ввода, а потом воспользоваться менюшкой Файл > Сохранить иначе > Сохранить сессию. В настройках, на вкладке Общие, можно поставить галочку на Загружать последнюю сессию при запуске. Это значит, что при выходе список файлов будет сохраняться в сессию по умолчанию, а потом при запуске редактора - загружаться.

Закладки - меню, подобное Последним файлам за исключением того, что список ведется вручную, вами самими. Правильнее было бы назвать это меню Избранное. Итак, вы можете добавить туда любой файл - пунктом Править закладки > Добавить в закладки. Для редактирования файла закладок надо пойти в Конфиги > Список закладок. Откроется в режиме редактирования обычный текстовый файл со списком закладок. Каждая строка списка содержит в себе полный путь к файлу, кодировку и положение курсора. Удаляете ненужные строки, сохраняете файл - и меню Закладки автоматически обновляется.

Строки закладок можно временно отключать, предваряя их символом #. Такая строчка не будет отображаться в меню. Функция Править закладки > Найти ошибочные пути проверит пути к файлам, на кои указывают закладки, и закомментирует те закладки, для которых файлы не найдены по указанному в закладке пути.

Действия над файлом - полезное подменю. Кроме прочего, отсюда можно жестко задать параметры конца строки. Установить конец строки как в UNIX, Установить конец строки как в Windows, Установить конец строки как в Mac - этими функциями вы указываете TEA, какой конец строки применить при сохранении. А чтобы проверить, какой конец строки у файла, пойдите в файловый приказчик, установите курсор на нужный файл, и выберите пункт меню Фм > Сведения о файле > Полные сведения.

Не добавлять в Последние файлы - временно отключает добавление закрываемых файлов в список "Последние файлы". Удобно, если вы не хотите нарушить свой список последних открытых файлов какими-то случайными гостями. Отключите добавление, поработайте с этими ненужными для списка файлами, потом включите добавление обратно.

Выход - закрывает TEA. Обратите внимание, что редактор не задает лишних вопросов. TEA может разве что полюбопытствовать, желаете ли вы сохранить измененный файл - и то, в случае, если он уже был сохранен ранее. То бишь, подтверждение на сохранение не запрашивается, если файл новый, безымянный. Это же относится и к функции Закрыть текущий файл (Ctrl-W). Почему так, а не иначе? Чтобы не раздражать вас лишними запросами подтверждений.


Правка

О прямоугольном или блочном выделении. Оно не шибко вписывается в архитектуру TEA. Функции обработки текста к нему неприменимы. Всё, что можно делать с прямоугольным выделением, это создать его при помощи Начало блока и Конец блока, а затем Копировать блок, Вставить блок или Вырезать блок.

Пара замечаний о пунктах меню Отступ и Отменить отступ. За ними железно закреплены клавиши Tab и Shift-Tab. Если выделен текст (много строк), то происходит его сдвиг влево или вправо путем вставки или удаления пробелов либо табов. Если текст не выделен, в место курсора вставляется один таб либо пробелы числом, заданным в Наладка > Функции > Ширина таба в пробелах. На поведение нажатия Tab влияет опция Наладка > Интерфейс > Использовать пробелы вместо табов.

Отступ по первой строке - делает отступ всем выделенным строкам такой же, как в первой выделенной строке.

Файлы-хранилища.

Некоторые люди испытывают потребность копировать текст из множества файлов в какой-то один. И приходится переключаться туда-сюда с документа на документ. Чтобы избежать этой, в прямом смысле, мышиной возни, в TEA есть возможность пометить файл как хранилище, и затем копировать текст напрямую в него, без дополнительных усилий. Для этого достаточно при открытом документе, который вы хотите сделать хранилищем, использовать пункт меню Установить как файл хранилища. Затем, в каком-нибудь другом документе, выделяем текст, и, чтобы скопировать его сразу в хранилище, воспользуемся функцией Копировать в файл хранилища. Если вы потом закроете файл хранилища, то Копировать в файл хранилища не будет работать, пока вы не сделаете другой файл - хранилищем.

Захватить/нет буфер обмена в файл хранилища - если включено, то, когда в буфер обмена попадает какой-то текст, он будет скопирован на файл-хранилище. Под MacOS сие работает в пределах только TEA, в других системах - на всю систему, то бишь если вы копируете что-то например в браузере, скопированный текст автоматом помещается в хранилище.

Для форматирования помещаемого в хранилище текста можно использовать файл-шаблон под именем cliptpl.txt, который надо сохранить в основном каталоге конфига TEA. Пример такого файла с макросами:

---
%date
%time
%s
---
Здесь: %s - текст из буфера обмена, %date - текущая дата, %time - текущее время.

Вёрстка

В этом меню собраны функции для быстрой разметки текста в режимах HTML, XHTML, Docbook, Wikitext и Lout и LaTeX. Режим разметки переключается в списке Режим и устанавливается локально для текущего документа. То бишь разные документы могут иметь разные режимы разметки. При загрузке файла для него автоматически выбирается режим смотря по расширению файла. Если расширение файла - .wiki, либо выбран вручную режим Wikitext, то работает разметки Wikitext.

В основном пункты меню Вёрстка служат для ввода тэгов - в зависимости от выбранного режима размётки вставляется нужный тэг. Если был выделен текст, он будет обрамлен тэгами (в случае, ежели таковые предназначены обрамлять).

Кроме того, в меню содержится ряд инструментов, полезных для работы с HTML и XHTML-документами.

Инструменты [X]HTML > Переименовать выделенный файл - переименовывает файл, чье имя выделено в тексте, а попутно и сам выделенный текст. Допустим, у нас в HTML-документе есть ссылка на файл dog.html. Мы хотим одним действием переименовать его на диске в cat.html, а также чтобы в самой ссылке текст, выделенное имя файла, превратилось в cat. Выделяем имя файла в ссылке href (ну или в img src, где угодно). Затем, в Знаменитом Поле Ввода набираем "cat". Применяем Переименовать выделенный файл. Готово! При этом, TEA понимает относительные пути, а также еще учитывает некоторые мелочи в формате путей.

Инструменты [X]HTML > Взвесить документ - вычисляет общий объем не токмо HTML-страницы, но и связанных с оной объектов - картинок, флэшек и так далее. Короче говоря всего, что упомянуто в SRC. Итоги взвешивания выводятся в логмемо.

Инструменты [X]HTML > Смотреть выделенный цвет - чтобы узреть цвет воочию, выделите его в текста, примените сию функцию и глядите в логмемо - там будет образец. Выделять надо шестнадцатеричное значение либо название вроде red, magenta и тому подобное.

Инструменты [X]HTML > Перевести тэги в сущности - как известно, в HTML недопустимы некоторые символы (например, "больше" и "меньше"), поскольку они используются как ограничители тэгов. Поэтому, чтобы показать такие символы на веб-странице, желательно перевести их в так называемые сущности - записанные в особом формате символьные обозначения тэгов. Итак, если вам нужно где-то на веб-странице показать пример HTML-кода, выделите его и примените Перевести тэги в сущности. Получится примерно такое:

&lt;b&gt;демо&lt;/b&gt;

При отрисовке веб-страницы такой пример будет выглядеть как обычный HTML-код, как исходник.

Инструменты [X]HTML > Из текста в [X]HTML - переводит обычный текст в [X]HTML, красиво форматированный с помощью CSS. Режим HTML или XHTML зависит от режима вёрстки документа.

Кодировать адрес e-mail супротив спама - функция нужна для перевода mailto-ссылок в числовой код символов, составляющих адрес e-mail. Такой код отображается браузером как обычные буквы, однако для спаммерских программ, собирающих адреса электронной почты, он выглядит невразумительно и не воспринимается как почтовый адрес.


Поиск

В TEA нет диалоговых окон поиска и замены. Вместо этого используется Знаменитое поле ввода. Допустим, вы хотите найти в тексте (документа или руководства) слово. Набираете его в Знаменитом поле ввода (Ctrl-F для быстрого перемещения в него) и жмете Enter. Всё! Затем, чтобы найти следующее или предыдущее вхождение слова в текст, есть пункты меню "Найти дальше" (клавиша F3), "Найти назад" - им же соответствуют и кнопки рядом со Знаменитым полем ввода. Там три кнопки. Первая - Поиск, вторая - найти предыдущее, третья - найти дальше. При первом поиске TEA ищет слова, начиная с места курсора.

Управлять настройками поиска можно, помечая галочками пункты меню Целый слова и Чуткость к регистру и Нечеткое условие. Последнее - это когда вы хотите найти слово, но не знаете точно, как оно пишется. Например - Семилетов или Самолётов. И вот при включенном Нечетком условии редактор найдет оба похожих слова. Степень похожести можно настроить в Наладка - Функции - Разное - Коэффициент поиска по нечеткому условию. Чем он меньше, тем больше похожих слов найдет TEA. Ограничение - TEA находит в этом режиме лишь слова с одинаковым количеством букв.

Чтобы заменить найденный текст (он будет выделен) на другой, надобно ввести этот другой текст опять же в Знаменитое поле ввода и применить пункт меню "Заменить на". Это удобно в сочетании с "Найти дальше". Нашли, посмотрели - надо заменить - жмем "Заменить на", не надо - делаем "Найти дальше".

Либо, как я делаю - копирую в буфер обмена слово, на которое хочу производить замену. Потом по "Найти дальше" (F3) шагаю по заменам, и где хочу, там нажимаю Ctrl-V (вставить).

А чтобы заменить некое слово на другое, по выделенному тексту, надо в ЗПВ поместить правило особого формата, вот такого:

старое слово~новое слово

То бишь разделителем между ними служит символ "тильда" - "~". Пример - мы хотим поменять в тексте все слова "кошка" на "мышка":

кошка~мышка

Затем применяем "Заменить всё". Генная инженерия бессильна объяснить результат.

Функцией замены можно пользоваться также, чтобы убирать из текста нежелательные подстроки. Для этого не пишем после тильды второй параметр. Например, чтобы убрать из текста все слова "оружие", надо задать в ЗПВ "оружие~" и применить Заменить всё.

Можно включить опцию В режиме регулярных выражений - в этом случае, при поиске и замене текст из ЗПВ будет трактоваться как регэксп. Например, чтобы перевести HTML-курсив в TeX-аналог, можно использовать такую формулу в ЗПВ:

<i>([^<]*)</i>~\emph{\1}

Обратите внимание, что \1 служит как бы обозначением той части текста, которая была "захвачена" регулярным выражением. Вот тут в примере мы поймали весь текст между тэгами. "Улов" по второму условию доступен как \2, по третьему как \3 и так далее.

А вот другой пример. Чтобы найти в тексте только числа - любые числа - вводим в ЗПВ следующее регулярное выражение: (\d+).

Не забудьте отключить режим регулярных выражений, когда захотите вернуться к обычному поиску или замене. Замечание - при включенном режиме регулярных выражений, переключатель Чуткость к регистру расценивается как включенный, даже если он выключен.

В режиме файлового приказчика, функция Заменить всё работает с выделенными файлами, используя в качестве кодировки кодировку, выбранную в приказчике в списке кодировок.

Заменить всё в открытых файлах - действует так же, как и обычная Заменить всё, однако применительно ко всем файлам, которые сейчас открыты в TEA.

Найти в файлах - ищет слово, заданное в Знаменитом поле ввода, начиная в текущем каталоге файлового приказчика (на вкладке Файлы) и далее по вложенным каталогам. Для ускорения поиска, TEA смотрит только в файлы, которые считает текстовыми - а это файлы исходников, для которых TEA поддерживает подсветку синтаксиса, а также файлы с расширением txt и все форматы документов вроде ODT, DOCX, которые понимаются TEA. Кроме того, TEA глядит в файлы с именами вроде Changelog. Поиск осуществляется в кодировке, которая выбрана в том же приказчике в списке кодировок. Завершив поиск, TEA выводит окно со списком файлов, где найден текст. Двойным щелчком мыши по названию файла вы откроете его в редакторе.

Пометить всё найденное/Снять пометки - помечает в тексте цветом все найденные подстроки или снимает пометки. Эта функция может переглючить цвета вообще, при использовании одновременно с Вид - Темнее. Всё исправится после перезапуска редактора либо в новом открытом документе. Ничего страшного. Ничё-ничё! Луна не падает.


Календарь

В этом меню, доступном лишь когда вы находитесь на вкладке Даты и глядите на календарь, собраны всякие связанные с ним функции.

Добавить или вычесть - дни, месяцы, годы. Допустим, вы хотите посмотреть, какой будет день через 7 дней. Вводим в ЗПВ число 7, и выбираем пункт меню Добавить или вычесть > дни. Хотим 7 лет? Делаем то же самое, только выбираем уже не "дни", но "годы". А если нужно не ЧЕРЕЗ, а ДО? Какой день был 15 дней назад? Указываем в ЗПВ число с минусом, то есть "-15".

Количество дней между двумя датами - подсчитывает, сколько дней находится между двумя датами. Выбираем в календаре первую дату и закрепляем её выбором пункта меню Пометить первую дату (это впрочем никак не отобразится на календаре). Затем выбираем в календаре вторую дату и вызываем Пометить вторую дату. Сразу получаем разницу в днях.

Вычислить лунные дни между датами - составляет эдакий лунный календарик между из дней между двумя отмеченными датами.


Функции

Чтобы использовать функции обработки текста, надо сначала этот текст выделить. Некоторые функции, например Статистика по тексту, могут работать вдобавок и со всем текстом документа. В совсем редких случаях, таких как изменение регистра, если текст не выделен, то в качестве обрабатываемых данных берется слово, на котором стоит курсор.

Некоторые функции принимают параметры. Параметры следует прописывать в Знаменитом Поле Ввода (ЗПВ, строка внизу главного окна) - до применения функции. Например, функция Удалить строки < размера N должна получить этот самый размер, число, из Знаменитого поля ввода. Значений по умолчанию нет, зато всегда можно выполнить отмену примененной функции.

Функции > Инструменты > Масштабировать картинку - масштабирует картинку, на имени которой в тексте стоит курсор или имя просто выделено. Пропишите в ЗПВ параметры преобразования и примените эту функцию.

Формат параметров: имя файла~новый размер

Имя файлы это имя выходного файла, то есть файла-результата. Оно может быть просто задано жестко, например "out.jpg", а может быть составлено из исходного при помощи макросов %basename (имя файла без расширения), %ext (расширения). Таким образом полное исходное имя составляется из строки %basename.%ext

Имя файла + расширение заменяются также макросом %filename

Однако если вы не хотите записывать масштабированный файл под исходным именем, можно добавить какую-то приставку или добавить что-то после имени. Например:

перед-%basename-bar.%после~1024

В этом примере, исходное имя файла будет предварено"перед-", и дополнено "-после".

Второй параметр - новый размер картинки, может быть в пикселах и процентах (добавьте % после числа):

новое-%basename.%ext~1024

новое-%basename.%ext~50%

Ячейки - это подменю используется для обработки табличных данных, коими могут быть, например, таблицы LaTeX или CSV-строки. Все функции требуют, чтобы вы задали в ЗПВ по крайней мере один параметр - разделитель столбцов, чтобы TEA знал, как ему разбирать строки.

Функции > Ячейки > Упорядочить таблицу по столбцу в алфавитном порядке - делает то, что сказано.

Строка формата для ЗПВ: разделитель~номер столбца

Столбцы (колонки) нумеруются с нуля, то есть нулевой это первый, первый - второй, и так далее.

Например, у нас есть LaTeX-таблица с 5 рядами по 2 столбца:

собака&кот
баран&корова
змея&суслик
волк&тигр

И теперь мы хотим сортировать таблицу по второму столбцу, там где "кот", "корова". Выделим текст, в ЗПВ вобьем формат "&~1" и применим эту функцию. Таблица будет упорядочена по второму столбцу.

Удобно обрабатывать таблицу, на включая в нее поначалу переносы строк, например "\\" в LaTeX. Их лучше добавить после обработки, посредством Текст - Применить к каждой строке со значением "%s\\" в ЗПВ.

Функции > Ячейки > Поменять местами ячейки - меняет местами столбцы по номеру.

Формат значения для ЗПВ: разделитель~столбец1~столбец2

Скажем, в случае таблицы из примера выше, мы хотим поменять местами столбы 0 и 1, то есть чтобы столбце с "кот" был перед столбцом с "пес". Выберем текст, поместим в ЗПВ значение "&~0~1", и применим Поменять местами ячейки.

Функции > Ячейки > Удалить по столбцу - удаляется столбец по его номеру (нумерация с нуля).

Формат для ЗПВ: разделитель~номер столбца

0 - первый столбец, 1 - второй, и так далее.

Функции > Ячейки > Копировать по столбцу[цам] - копирует столбцы в буфер обмена.

Формат для ЗПВ: разделитель~столбец 1[~столбец 2]

Если столбец 2 не задан, будет скопирован только столбец 1, иначе - от столбца 1 по столбец 2 включительно. Хо-хо-хоооо!

Функции > Анализ > Статистика по тексту - выводит в логмемо разную статистику по всем или выделенному тексту - количество символов с пробелами, без них и так далее.

Функции > Анализ > УНИТАЗ - УНИТАЗ, или УНИверсальный Текстовый АналиЗатор - это научное средство для частотного анализа текста. Дается статистика частоты употребления слов, а также некоторые соотношения, например, слов повторяющихся и без повторов. Что имею в виду? Допустим, в тексте трижды встречается слово "кот". Так вот, количество этого слова без повторов равно 1, а с повторами - 3. Именно такие количественные определения действуют в УНИТАЗе.

Функции > Анализ > Извлечь слова - извлекает из текста все слова и помещает их списком в новый документ. Полезно для создания словарей. Может занять большое время в зависимости от размера обрабатываемого файла и скорости вашего компьютера.

Функции > Анализ > Подсчитать вхождение подстроки - вычисляет, сколько раз подстрока (заданная в Знаменитом поле ввода), входит в текст документа. И выводит полученное число в логмемо.

Функции > Анализ > Длины слов - выводит статистику, сколько слов такой-то длины в документе.

Функции > Таблицы

Таблица - это чудесное средство для замены в одном документе сразу множества слов, а не по одному. Сначала создаем таблицу - в виде обычного текстового файла. Примерно так:

кошка=собака
мяукает=лает

Сохраняем этот файл в особом каталоге - он доступен под названием таблицы на панели закладок в файловом приказчике или в окне сохранения. Под именем, с которым вы сохранили файл, он появится в меню Функции > Таблицы. Попробуем применить таблицу.

В новом файле введем (конечно, не введем, а скопируем туда) текст: "кошка мяукает", выделяем его, затем выбираем в меню нашу таблицу, применяя ее к тексту. Что получилось? В тексте произошли множественные замены и теперь он гласит: "собака лает". Замечательно!

Если в меню Поиск включен пункт В режиме регулярных выражений, это сказывается и на обработке текста таблицами. При этом в таблице заменяемые слова задаются регэкспами.

В режиме файлового приказчика, функция замены при помощи таблиц работает с выделенными файлами, используя в качестве кодировки кодировку, выбранную в приказчике в списке кодировок.

Функции > Сниппеты

Сниппет - это кусочек текста, который можно быстро вставить в документ. TEA хранит сниппеты как отдельные файлы в каталоге $HOME/.tea/snippets. Выбор сниппета из меню вставляет текст сниппета в документ по месту курсора.

Чтобы создать сниппет, достаточно бодро сохранить файл (в котором набран текст сниппета) в указанный выше каталог. Перейти туда можно по закладке сниппеты в файловом приказчике либо snippets в окне Сохранить как. Там же сниппеты можно переименовывать и удалять (в диалоге Сохранить как эти функции - в контекстном меню по правому щелчку мыши). Давая имя сниппету, скрипту, шаблону или сессии, следите, чтобы оно не совпадало с уже существующими названиями пунктов меню. Иначе редактор не сможет правильно назначать "горячие клавиши".

Сниппеты пригодны не только для простой вставки в текст. Ими можно обрамлять выделение. Например, мы хотим сниппетом оформить тэгами выделенный текст. Пример сниппета, который помещает выделенный текст в тэг ссылки (A с параметром HREF):

<a href="%s">%s</a>

Здесь в теле сниппета мы используем макрос %s, который представляет выделенный текст. Когда сниппет будет применен, т.е. выбран из меню, он заменит собой выделенный в документе текст, однако вместо макроса %s будет подставлено содержимое выделения. Если же текст не был выделен, сниппет просто вставится по месту курсора, и при вставке макрос %s чудесным образом исчезнет.

Открыть сниппет для редактирования можно тем же способом, что и обычный файл.

Функции > Скрипты

Скрипты с точки зрения пользователя

В TEA, вы можете использовать скрипты для обработки текста точно так же, как и встроенные функции. То есть, грубо говоря - выделяете текст, вызываете из меню скрипт. Если скрипт принимает какой-нибудь управляющий параметр, то его, этот параметр, надо вписать в Знаменитое поле ввода.

TEA "понимает" скрипты, написанные на Python, Perl, Ruby and Bash (Sh). Чтобы установить скрипт, просто скопируйте его в $HOME/.config/tea/scripts (либо сохраните его в этой папке, выбрав в файловом приказчике папку скрипты. Если скрипт находится в архиве, то распакуйте его. TEA "увидит" установленные скрипты после перезапуска редактора либо сохранения скрипта. Удалять и переименовывать скрипты можно так же, как и сниппеты, шаблоны и т.д. - через файловый приказчик либо диалоговые окна открытия/сохранения.

Скрипты с точки зрения разработчика

Как написать скрипт для TEA? Да очень просто. Во-первых, вам нужно знать, как TEA передает текст в скрипт, и как получает обработанный текст обратно, чтобы заменить им выделение.

TEA запускает каждый скрипт с двумя параметрами. Первый параметр всегда указывает на имя файла, в котором содержится переданный из TEA текст (в UTF-8). Текст этот - выделенный фрагмент из текущего документа. То есть, чтобы получить из TEA текст, вам нужно в коде скрипта прочитать содержимое файла, чье имя передано в первом параметре к скрипту. Второй параметр (если существует) содержит имя файла, в который TEA записывает текст (UTF-8) из Знаменитого поля ввода. Итак, чтобы получить содержимое Знаменитого поля ввода, вам нужно внутри скрипта прочитать файл, на имя которого указывает второй параметр скрипта.

При обработке текста обратите внимание на кодировку - TEA передает текст в скрипты в кодировке UTF-8 и предполагает, что в этой же кодировке текст будет возвращен ему обратно. А как возвращать? Тоже просто. Надо записать обработанный текст в тот же файл, откуда текст был прочитан. То есть в файл, чье имя в первом параметре к скрипту.

Ниже я приведу пример UTF-8-безопасного скрипта на Python. Этот скрипт "переворачивает" регистр символов полученного текста и возвращает обработанный текст обратно в TEA.

import sys
import string
import codecs
f = codecs.open(sys.argv[1], "r", "utf-8" )
u = f.read()
f.close
u = u.swapcase()
f = codecs.open(sys.argv[1], "w+", "utf-8" )
f.write (u)
f.close

Итак, sys.argv[1] (первый параметр скрипта) содержит имя файла, который нам нужно прочитать, чтобы получить текст из TEA. Когда мы обработали текст, мы записываем его все в тот же файл, имя которого содержится в sys.argv[1]. Обратите внимание на использование кодеков (в Python). Это необходимо для правильной работы скрипта с UTF-8.

И другой пример - эдакий калькулятор. Он получает выделенный текст, а в тексте - какое-то математическое выражение. Скрипт вычисляет его и возвращает результат. Поскольку мы имеем дело только с числами, мы можем не заботиться о кодировке:

import sys
f = file (sys.argv[1], 'r')
s = f.read()
f.close
t = eval (s)
f = file (sys.argv[1], 'w+')
f.write (str (t))
f.close

А что, ежели нам нужно получить некий параметр, с помощью которого пользователь, введя этот параметр в Знаменитое поле ввода, хочет повлиять на работу скрипта? В Python, для получения этого параметра, надо прочитать файл, чье имя находится в sys.argv[2]. А в Bash-скрипте, используйте $1 для получения имени файла с текстом документа, и $2 - для получения имени файла с содержимым Знаменитого поля ввода.

Примечания о BASH-скриптах и вызовах sed и подобных программ. Для их правильной работы внутри скрипта надо скопировать буферный файл TEA - $1 в какой-нибудь временный файл, обработать этот временный файл и вывести результат обратно в $1. Вот пример такого скрипта (он заменяет все слова cat на dog):

cp $1 /tmp/xyz.xyz
sed 's/cat/dog/g' /tmp/xyz.xyz > $1

Если вы собираетесь пожертвовать какие-то скрипты для коллекции скриптов на сайте TEA, то было бы здорово, если б вы дали свой скрипт со статусом "общественное достояние" (public domain). Во всяком случае, не под собственнической (proprietary) лицензией. Еще в комментариях внутри скрипта укажите авторство и описание скрипта.

Сортировка > Сортировать учитывая регистр - сортирует выделенные строки по алфавиту, учитывая регистр. То бишь "собака" это не "Собака".

Сортировка > Перевернуть список - переворачивает порядок строк. Было:

Собака
Кот
Коза

Будет:

Коза
Кот
Собака

Сортировка > Сортировать зависимо от регистра, по разделителю - упорядочивает по алфавиту слова в строке, разделенные неким разделителем, который надо прописать в ЗПВ. Например, разделителем может быть "|", а строка: "собака|кот|попугай".

Сортировка > Перевернуть список, размежеванный разделителями - переворачивает слова, разделенные неким ограничителем. Например, можно в обратном порядке выстроить слова в таком тексте: "собака|кот|коза". Разделитель записываем предварительно в ЗПВ.

Фильтр > Удалить повторения - удобно, когда у вас список строк, содержащий повторы. После применения этой функции, все повторы, следующие за первым встречающимся повторно элементом, будут удалены. На слабых компьютерах выполнение сей функции может затянуться.

Фильтр > Удалить пустые строки - пустые строки столь же полезны, как пустые глаза, в отличие от пустых бутылок. Поэтому необходимо средство для удаления пустых строк. И в TEA оно есть.

Фильтр > Удалить строки < размера N - удаляет в списке строки, чья длина меньше, чем значение N. N - число, которое надо ввести в Знаменитое поле ввода.

Фильтр > Удалить строки > размера N - почти то же самое, только удаляет строки с длиной больше заданной.

Фильтр > Фильтровать по регэкспу. Регэксп - сокращение от регулярного выражения. Регулярное выражение это, грубо говоря, шаблон для задания нечеткого критерия отбора. Допустим, можно отфильтровать текст, начинающейся с некоего сочетfния букв, или текст, содержащий только цифры. Регулярные выражения - большая тема, здесь я не буду ее касаться, читайте лучше сайт regexp.ru или Википедию. Однако дам пример. Допустим, у нас есть список с именами файлов:

hello.doc
example.txt
nature.jpeg
mytext.txt

И вот мы хотим, чтобы в этом списке остались лишь имена, заканчивающиеся на ".txt". Для этого регулярное выражение (которое надобно ввести в Знаменитое поле ввода) будет таким:

.*\.txt$

Итак, задаем этот регэксп, выделяем список, применяем функцию. Потрясаем руками с возгласами: "Отлично! Превосходно!" и идем гулять с ручным жуком-богомолом.

Фильтр > Удалить после разделителя в каждой строке. Удаляет из каждой строки часть, находящуюся после разделителя, заданного в Знаменитом поле ввода. Например, если разделителем вписать ")" и выделить следующий текст:

1.) Янка
2.) Гражданская Оборона
3.) Нирвана

То после применения фильтра получим:

1.
2.
3.

Фильтр > Удалить до разделителя в каждой строке. Удаляет из каждой строки часть, находящуюся ДО разделителя, заданного в Знаменитом поле ввода. Например, если разделителем вписать ")" и выделить следующий текст:

1.) Янка
2.) Гражданская Оборона
3.) Нирвана

То после применения фильтра вот что останется:

Янка
Гражданская Оборона
Нирвана

Математика > град мин сек > дес град переводит координаты из формата "градусы минуты секунды" в "десятичные градусы". Пример:

Было: 40° 26′ 46″ N 79° 58′ 56″ W, будет: 40.446° N 79.982° W.

Математика > дес град > град мин сек переводит координаты из формата "десятичные градусы" в "градусы минуты секунды". Пример:

Было: 40.446° N 79.982° W, Будет: 40° 26′ 46″ N 79° 58′ 56″ W.

Математика > Сложить по последнему столбцу - складывает числа из каждого последнего столбца выделения. Пример - можно вычислить вот такой текст:

картошка 60
морковка 40,5
капуста 14

TEA сложит из каждой строки последние колонки (столбцы).

Математика > Десятичное в двоичное - переводит десятичное целое число в его двоичное представление. Пример: было 255, становится 0000 0000 0000 0000 0000 0000 1111 1111.

Математика > Двоичное в десятичное - а эт наоборот. Работает токмо для беззнаковых целых чисел.

Математика > Перевернуть биты - поясню на примере: было 0000 0010, станет 1111 1101.

Математика > Вычислить - вычисляет математическое выражение, выделенное в тексте, и выводит результат в логмемо. Например, просто наберите в тексте "2+2", выделите это дело, а затем примените "Вычислить". В мат. выражениях можно использовать следующие операторы: +, -, *, /, ^ (возведение в степень), % (проценты). Скобки поддерживаются. Вот еще несколько примеров:

2/3*123
5+5+5
1-200*89
2^8
250%5 //сколько будет - 5 процентов от числа 250?

Математика > Арабское в римское - переводит "обычные" числа в римские (т.е. 20 в XX).

Математика > Нумеровать - нумерует выделенные строки согласно заданному образцу, который надобно поместить в Знаменитое поле ввода. Синтаксис следующий: шаг~количество цифр~префикс.

Шаг - шаг, с которым будет увеличиваться значение счетчика. Например, шаг 1 даст нам числа 1, 2, 3 и так далее. Шаг, равный 10, даст нам ряд 10, 20, 30.

Количество цифр определяет, как много цифр должен содержать счетчик - недостающие будут заменены нулями. Например, если количество цифр = 3, а шаг = 1, то мы получим 001, 002, 003, 004 и так далее.

Префикс - это префикс, который будет вставлен в каждую обрабатываемую строку после счетчика, но до текста строки. Пробелы в конце префикса - значимые, они тоже идут в ход.

Несколько примеров:

пример 1, параметры таковы "1~3~) " (без кавычек). Получается:

001) собака
002) кот
003) мышь

пример 2, параметры следующие: "10~1 " (без кавычек). Получается:

10 собака
20 кот
30 мышь

пример 3, параметр "1" (без кавычек). Выходит это:

1собака
2кот
3мышь

Вы можете использовать эту функцию и без параметров, в таком случае шаг будет равен 1, количество цифр - нулю (т.е. нули не будут добавляться), префикс - пустой строке. Каждый последующий параметр - необязателен. То есть, можно задать только шаг, или только шаг и количество цифр, либо шаг, количество цифр и префикс.

Функции > Азбука Морзе

Поддерживаются русский и английский. После перевода в морзянку, коды букв разделены пробелами. Пробелы между словами теряются. Эти функции полезны, наверное, для начинающих радиолюбителей и жертв кораблекрушения - чтоб фонариками о беде сигналить. Пролетает самолет - посигналь. Проплывает мимо баржа - посигналь.

Статистика > Статистика по тексту - показывает количество символов всего, символов без пробелов и прочие сведения, которые полезно знать приличному человеку.

Текст > Сжать - удаляет из выделения все пробелы, переводы строки и символы табуляции.

Текст > Удалить форматирование в каждой строке - убирает форматирование (табуляцию, пустые строки, многократные пробелы) в каждой строке выделенного текста. В итоге у вас получается набор строк, в каждой из которых нет форматирования.

Текст > Удалить форматирование - удаляет вообще всё форматирование в выделенном тексте. То бишь набор вероятно форматированных строк превращается в одну здоровенную строку без каких-либо разделителей.

Текст > Применить к каждой строке - мощнейшее средство для добавления заданного вами текста к каждой строке выделения. Например, вы хотите добавить тэг BR в конец каждой строки. Пишем в Знаменитом поле ввода:

%s<br>

Затем выделяем текст и используем Применить к каждой строке. Как видите, макрос %s служит заменителем изначального содержимого обрабатываемой строки. Вот другой пример - мы хотим заключить каждую строку в пару тэгов LI. Очевидно, что в "формуле" макрос %s следует поместить между тэгами, дабы указать, где именно в каждой строке надо размещать текст из этой строки. Формула для Знаменитого поля ввода будет такова:

<li>%s</li>

И еще пример:

<a href="%s">%s</a>

Можно использовать и сниппеты. Чтобы применить сниппет к каждой строке, надо ЗПВ до использования Применить к каждой строке поместить @@имя_сниппета. Например, если у вас сниппет (файл в каталоге сниппетов) называется hello, то надо будет написать: @@hello. Поскольку в сниппете используется макрос %s для подстановки выделенного текста, то в случае Применить к каждой строке роль выделенного текста будет играть каждая выделенная строка.

Текст > Перевернуть - просто переворачивает строку. Было "носоглотка", станет "актолгосон".


Запуск

Это меню предназначено для запуска внешних программ с текущим открытым файлом. В частности, для запуска браузеров. Список программ настраивается через обычный текстовый файл, который открывается пунктом меню Файл > Конфиги > Список программ. Файл состоит из записей вида:

название пункта меню=командная строка

Например, в Linux, строчка для браузера Konqueror будет таковой:

konqueror=konqueror %s

%s - макрос, вместо коего при запуске программы будет подставлено имя текущего файла. В Windows, в командной строке вам надо прописывать полный путь к исполняемому файлу, и желательно заключать его и макрос %s в кавычки (отдельные пары кавычек и для пути, и для макроса). Пример:

opera="C:\Program Files\Opera\opera.exe" "%s"

Есть и более подробные макросы: %basename, %filename, %ext, %dir. Они позволяют использовать части полного пути. Так, если у нас есть полный путь "/mnt/foo/bar.txt", то %dir = "/mnt/foo", %basename = "bar", %filename = "bar.txt", %ext = "txt". И полный путь текущего файла можно задать так: %dir/%basename.%ext

Также можно вместо макроса %s использовать %i, который при вызове программы будет заменен на имя файла, на коем стоит курсор в тексте. Иными словами, функция та же, что по "Открыть под курсором", только с нужной вам программой. Так удобно, скажем, использовать какой-нибудь графический редактор, если вам надо быстро подправить картинку в HTML или LaTeX. Пример:

gimp=gimp %s


Функции > Проверка правописания

Для проверки правописания в TEA используются движкиASpell и Hunspell.

Во-первых надо решить, какой движок использовать. Выбрать движок можно на странице Наладка > Функции, там есть список Движок проверки правописания. Количество пунктов в нем зависит от вашей сборки TEA - я не знаю, какая у вас. В Linux, TEA может быть собран с обоими движками, с каким-то одним, или вообще без проверки правописания. Для Windows я делаю сборки сам, с обоими движками. Сам использую в работе Hunspell.

Как настроить Aspell для Windows? Скачайте полный установщик Aspell с http://aspell.net/win32/. Затем, с той же страницы, скачайте и установите словари - при установке вас будут спрашивать, в какую папку - и предлагать папку, где уже установлен Aspell. Соглашайтесь. По умолчанию это C:\Program Files\Aspell. Иногда при установке словаря появляется консольное окошко с запросом - мол, переписать ли файл или тому подобное - там надо нажать "A" (английскую), - мол, All - переписать все файлы. Далее, установив словари, задаем в TEA путь к Aspell, в Наладка - Функции - Папка Aspell. И перезагружаем TEA. Теперь в Функции - Языки проверки правописания, выбираем язык, а потом через Функции - Проверка правописания, запускаем проверку.

В Linux, при использовании Aspell предполагается, что у вас в системе установлены Aspell-словари, соответствующие вашей локали. При первом запуске TEA полагает, что такой словарь есть, поэтому по умолчанию таковой будет использован. Иначе же можно сменить язык проверки орфографии вручную, с помощью меню Языки проверки правописания. Выбранный язык сохранится до следующего раза работы с TEA и далее, пока вы снова его не поменяете.

Для Hunspell нет "общесистемных" словарей, и существует два варианта установки словарей для этого движка. Вариант первый - скачать архивы со словарями с хранилищ расширений для LibreOffice и OpenOffice.org. Там предлагается скачать файлы с расширением OXT. На деле это обычный ZIP-архив. Просто переименуйте скачанный файл, дав ему расширение ZIP. Создайте каталог для словарей, распакуйте туда получившийся ZIP. Собственно, оттуда нужны только файлы с расширениями AFF и DIC. Каталог со словарными файлами укажите в настройках TEA, в поле Каталог со словарями для Hunspell на странице Наладка > Функции, а затем выбрать нужный словарь в меню Функции > Языки проверки правописания. Этот же пункт выбираем после каждой смены движка. И он запомнится - можно будет потом просто вызывать "Проверить правописание", без постоянного выбора языка. Хороший русский словарь можно взять по адресу http://code.google.com/p/hunspell-ru/. После добавления словарей лучше перезапустить TEA.

Второй вариант - подключение к TEA словарей Hunspell, которые уже установлены для других программ - например Firefox или OpenOffice.org. При установленном в локальный каталог пользователя Firefox, словари лежат в firefox/dictionaries.

Пункт Проверить правописание проверяет текст используя именно этот вот запомненный язык. Ошибочные слова (вернее те, которых нет в словаре) будут подчеркнуты красным. Исправить слово можно вручную, либо выбрав вариант из списка, предложенного TEA по выбору пункта меню Предположить. После этого исправленное слово остается подчеркнутым, ибо движок проверки орфографии действует в ручном режиме и не обновляет раскраску ошибок до повторной проверки. А чтобы скрыть раскраску вообще, есть пункт меню Вид > Скрыть помеченное как ошибки. Исправленное слово, да и вообще любое, на котором стоит курсор, можно добавить в словарь с помощью пункта Добавить в словарь.

Удалить из словаря - удаляет слово (по месту курсора) из пользовательского словаря, только для Hunspell. Измененный словарь подгружается при перезапуске движка - это происходит после повторного запуска редактора, либо смены текущего движка.


Функции > Плагины. TEA (в сборках под Qt5, а не Qt4) поддерживает плагины, написанные на QML (руководство по созданию плагинов читайте в исходнике TEA, в каталоге /manuals/plugins). Плагины распространяются в виде сжатых каким-нибудь архиватором папок. Чтобы установить плагин, надо распаковать его вместе с папкой в каталог $HOME/.config/tea/plugins (под UNIX) или буква_диска:\Documents and Settings\username\tea\plugins (под Windows). Потом перезапустите TEA и увидите плагин в списке. А чтобы удалить плагин, сотрите его папку. Плагины TEA, по сути, это полноценные программы с доступом к внутренним функциям TEA. Я не отвечаю за действия, выполняемые плагинами.


Нав

Метки, Обновить метки. Эта штука полезна для правки больших текстов. Вы можете прямо в тексте делать поименованные метки и потом быстро перемещаться между ними при помощи меню Метки либо через выпадающий список рядом с кнопкой на панели инструментов. Как создавать метки? Пишете к тексте любое слово и обрамляете его "[?" и "?]". Эти вот начальные и замыкающие отметки можно переопределить в Наладка - Функции - Метки. Итак, написали такую метку, нажали или выбрали пункт меню Обновить метки, и к меню Меток и к выпадающему списку добавится новая метка. Выбираем её - перемещаемся в то место текста, где она написана. Метки обновляются только вручную, то есть если вы загрузили файл с метками, надо всё равно их обновить.

Пример. Создадим в разных местах текста метки "[? собаки ?]" и "[? коты ?]". Обновляем метки. Готово!

К строке - перемещает курсор на строку по номеру, указанному в Знаменитом поле ввода.

Запомнить место/К сохраненному месту - парные функции, служащие для быстрого перемещения туда-сюда по документу. Запомнили место - Запомнить место, потом прокрутили куда надо, посмотрели, потом захотели вернуться назад - выбрали К сохраненному месту. Удобно в работе с большими документами!


ИДЕ

В TEA есть некоторые функции IDE, которые помогают в разработке программ, не усложняя при этом жизнь и не заморачивая вас ненужными настройками и кнопками. Отмечу, что как IDE, ТИА проще использовать на пару с возможностью использования профилей (в меню Вид). Создаете один профиль для допустим правки обычых текстовых файлов, другой профиль для разработки, для правки исходников - и переключаетесь между ними. Например у меня в "текстовом" профиле включен перенос слов, размер окна небольшой, шрифы такие-то. А в профиле "разработки" - перенос строк отключен, окно шире, шрифты другие.

Но как же использовать ТИА в качестве IDE? Сначала надо создать файл проекта ТИА. Проще всего сделать это через Функции - Поместить - Шаблон проекта ТИА.

Сохраните его в корневом каталоге исходника вашей программы, вашего проекта - под любым именем, но с расширением teaproject, например myproject.teaproject.

файл .teaproject это простой текстовый файл с записями вида переменная=значение. Они отражают настройки проекта. Вы можете держать несколько .teaproject-файлов в одном каталоге, под разные конфигурации сборки - скажем, один файла проекта под cmake, другой под meson.

Вот примеры трех файлов проекта, которые я использую при разработке TEA - длоя сборки при помощи qmake/make, meson/ninja и cmake/make.

tea-make.teaproject

command_build=make
command_clean=make clean
command_run=bin/tea --m&

tea-meson.teaproject

dir_build=b
command_build=ninja
command_clean=ninja -t clean
command_run=./tea --m&

tea-cmake.teaproject

dir_build=cmake
command_build=make
command_clean=make clean
command_run=./tea --m&

Синтаксис очень прост:

dir_build - каталог, в котором будет запущена команда сборки command_build. Если dir_build не указана, то в ее качестве будет использован каталог, где лежит файл .teaproject. dir_build может быть как абсолютным путем, так и относительным - в последнем случае за основу берется, опять же, каталог с .teaproject, то есть корневой каталог вашей программы.

command_build может быть любой, на ваш выбор: make, ninja, и т.д.

command_run - запускается dir_build для выполнения скомпилированной программы.

command_clean - запускается в dir_build для очистки проекта.

Когда вы открываете или сохраняете .teaproject-файл, или переключаетесь на его вкладку, TEA перечитывает С ДИСКА его содержимое и делает проект текущим, именно с ним будут работать команды из меню IDE (по запуску, очистке и сборке). Повторюсь - TEA считывает файл-проекст С ДИСКА, а не тот текст файла-проекта, который редактируется в окне. Пока вы этот текст не сохраните, ТИА его не увидит.

Итак, можно открыть несколько файлов-проектов и быстро переключаться между ними. При этом, загруженный файл проекта не влияет на загруженные файлы исходников, вы можете одновременно с этим править любые файлы из любых проектов. Файл проекта, фактически, никак не привязан к исходным файлам, это просто надстройка для сборки программы.

Во время сборки, сообщения компилятора будут выводиться в Логмемо. Если дважды щелкнуть мышью по выделенному жирным шрифтом указанию на место ошибки, TИА откроет нужный файл в нужном месте.


Фп

Как вы уже догадались, ФП - это сокращение от "файловый приказчик". В меню этом сосредоточены функции, относящиеся к ФП. Часть их повторяет действия, закрепленные за кнопками на вкладке приказчика, часть же - дополняет.

Чтобы использовать некоторые функции, например такие как получение проверочной суммы (а вернее, хэш-суммы) по алгоритму MD5, надо сначала выделить файл (сделать его текущим в файловом приказчике с помощью мыши или клавиатуры), а уже потом применить функцию.

ФП > Переименование - это подменю позволяет гибко переименовыми имена файлов. Все функции этого подменю используют переметр из ЗПВ.

ФП > Переименование > Добавить нули к именам - предваряет нулями каждое выбранное имя файла. Имя файла должно содержать нумерацию, например: page1, page100. Такие файлы, без нулей перед числом, не могут быть правильно отсортированы. Как быть?

Надо ввести длину имени файла в ЗПВ и применить функцию Добавить нули к именам. Из имен файлов будут удалены все нечисловые символы, а числа дополнены нужным количество нулей до заданной длины имени файла. Пример:

У нас есть файлы:
page1.txt
page100.txt

Поместим 5 в ЗПВ FIF, применим функцию.

Имена файлов станут такими:
00001.txt
00100.txt

ФП > Переименование > Удалить первые N символов из имен - N это количество, заданное в ЗПВ. Функция удаляет N первых символов из каждого выделенного имени файла.

ФП > Переименование > Заменить в именах файлов - заменить подстроку в каждом выделенном имени файлов. Формат для ЗПВ: старое значение~новое. Например: .jpeg~.jpg

ФП > Переименование > Применить шаблон - применяет шаблон к каждому выделенному имени файла. Доступны макросы, обозначающие части исходного имени файла: %filename (= filename.ext), %ext (= ext), %basename ( = filename). Например, мы хотим переименовать 01.jpeg, 02.jpeg в 01.jpg, 02.jpg. Шаблон для ЗПВ будет таким: %basename.jpg - %basename (имя файла без расширения) и к нему добавится ".jpg".

Смотреть картинку - то же, что нажать F2 на имени файла-картинки. Отображает оный файл во встроенной гляделке.

Отметить по регэкспу/Снять выделение по регэкспу - функции для выделения и его снятия по шаблону, задающемуся с помощью регулярного выражения. Например, чтобы выделить все файлы с расширением txt, надобно в Знаменитое поле ввода вписать регэксп ".*\.txt$" (без кавычек!) и применить Отметить по регэкспу. Затем можно нажать кнопку Открыть, чтобы загрузить выделенные файлы.

Подменю сведения о файле

Тут находится, кроме прочего, любопытнейшая функция Полные сведения. Она не токмо выдает полные сведения о времени создания файла и тому подобным вещам, но и, ежели файл этот в формате WAV, выводит его параметры, а для 16-битного PCM быстро подсчитывает RMS обоих каналов.

А функция Подсчитать строки в выбранных файлах делает то, что написано, считая при этом и пустые строки.

Подменю ZIP

У TEA есть простые средства для создания и распаковки ZIP-архивов (без паролей). Чтобы создать такой архив, сначала надо дать ему имя (перейдя в файловом приказчике в каталог, где хотите создать архив) с помощью пункта меню Создать новый ZIP. Затем вы, блуждая по каталогам, добавляете в архив новые файлы, отмечая их (Ctrl-A чтобы выбрать все, или Ctrl-щелчок мыши - чтобы несколько, иначе берется файл под курсором) и вызывая пункт меню Добавить в ZIP. Когда вы наполните свой архив, его надо сохранить менюшкой Сохранить ZIP - ведь до этого файлы на деле добавлялись не в архив, а в список подготавливаемых к упаковке файлов. Внутри архива создается каталог с тем же именем, что и архив, только без расширения zip. В этот каталог внутри архива и помещаются все упаковываемые файлы.

Для распаковки ZIP'а в текущий каталог надо выделить ZIP-файл, и применить функцию Распаковать ZIP в текущий каталог. Иногда бывают косяки с кодировкой имен файлов, находящихся в ZIP-архивах - однако в TEA вы можете выбрать кодировку имен, делается это в Наладка - Общие - ZIP-распаковка: кодировка имен файлов/ZIP-упаковка: кодировка имен файлов. Обычно это либо IBM866, либо CP1251 или UTF-8. Чтобы не ошибиться с выбором кодировки, можете выставить какую-то кодировку и потом попробовать её, не производя физическую распаковку - используйте пункт меню Показать содержимое ZIP. TEA в логмемо отобразит имена файлов из выбранного архива. Если там крякозяблы - подберите другую кодировку.

Подменю Картинки

Функции Масштабировать по стороне и Масштабировать в процентах служат для массового изменения размера картинок - выделенных файлов. Измененные картинки копируются в новосозданный каталог в той же папке, где вы выделили картинки. Имя этого каталога состоит из слова images-out и случайного числа. При желании каталог будет упакован в ZIP после завершения обработки картинок - для этого надо поставить галочку на Упаковать каталог с преобразованными картинками на вкладке Наладка > Функции. Там же можно выбрать формат выходных файлов - в списке Выходной формат преобразованных картинок, и включить билинейную фильтрацию, которая сглаживает получившиеся изображения.

Итак, чтобы масштабировать картинки, выделите их, а затем, введя в Знаменитое поле ввода количество пикселов или процентов, примените один из пунктов меню: Масштабировать по стороне или Масштабировать в процентах. В чем разница?

Масштабировать в процентах - допустим, вы хотите уменьшить каждую картинку на 50 процентов. Выделите файлы, введите в Знаменитое поле ввода число 50 и примените эту функцию.

Масштабировать по стороне - в этом случае в Знаменитое поле ввода надо ввести размер наибольшей стороны. У обычной, прямоугольной фотографии всегда есть такая сторона - для вертикальной фотки это высота, а для горизонтальной - ширина. Например, вы скинули с мобилы или цифровика фотографии и хотите их преобразовать в разрешение 640x480 (а вертикальные в 480x640). Стало быть, в поле ввода надо задать значение 640. Примечание: нет, TEA не умеет читать данные EXIF.

Создать веб-галерею - это чтобы быстро склепать простенькую табличную веб-галерею. Накидайте в каталог файлов с картинками, там же сохраните HTML-файл и откройте его в TEA. Потом в файловом приказчике перейдите в каталог с этим файлом и картинками. Выделите картинки, примените Создать веб-галерею. Создадутся миниатюры и HTML-табличка, которая вставится в файл по месту курсора.

Всякие настройки веб-галереи (размер миниатюр, количество ячеек в ряду) доступны на странице Наладка > Картинки.


Вид

Палитры - благодать-то какая! Можно выбрать палитру, чтоб иными цветами текст заиграл. Чудо-чудное, диво-дивное. А кто Кулибин, тот может на основе палитр из исходника (см. каталог palettes) создавать свои и сохранять в каталог $HOME/.config/tea/palettes. У пользователей Windows он где-то во глубине сибирских руд. А именно в Documents and Settings/имя пользователя/tea/palettes. А затем выбрать свою палитру в меню Вид > Палитры.

Профили - в этом подменю можно выбрать профиль - поименованный набор настроек, предварительно сохраненный с помощью пункта меню Сохранить профиль. В профиле сохраняются размер, положение главного окна, настройки переноса и нумерации строк и тому подобное.

Скрыть помеченное как ошибки - скрывает цветные подчеркивания, оставленные проверкой правописания.

Переключить перенос строк - переключает оный для текущего документа.


Настройки

В TEA нет отдельного окна настроек. Все настройки доступны прямо из главного окна, на вкладке Наладка. Изменения вступают в силу сразу же и сохраняются автоматически.

Дополнительная подсветка - включает подсветку текущей строки и парных скобок.

Старый движок подсветки синтаксиса - можете включить, если у вас есть какие-то свои модули подсветки, написанные до выхода 36 версии TEA и они вдруг частично или полностью оказались несовместимыми с новым движком подсветки TEA. "Старый движок" на деле тоже переписан по сравнению с версией 35, но совместимость сторонних модулей подсветки осталась. О скорости работы движков. Самый тормозной - тот, что был до 36 версии. "Старый движок" начиная с 36 версии быстрее, чем прежний старый движок. А движок по умолчанию (при выключенном старом движке) - еще быстрее. Словом, если ничего не глючит, не включайте старый движок подсветки.

На вкладке Клавиатура каждому пункту меню, включая разные сниппеты, закладки и тому подобное, можно назначить сочетание "горячих клавиш". Для этого выберите в списке пункт меню, потом в поле ввода справа от списка нажмите нужное вам сочетание клавиш, а затем нажмите кнопку Назначить. Чтобы удалить привязку клавиш, выберите в списке пункт меню и нажмите кнопку Удалить привязку. Чтобы переназначить сочетание клавиш, надо сначала Удалить привязку для пункта, которому было назначено сочетание, а затем назначить его другому пункту.

Перенос строк - включить или выключить оный для всех открытых документов, а также для последующих новых и открываемых.

А вот еще любопытная опция Брать настройку переноса строк из модуля подсветки на странице Интерфейс. Если она включена, то сведения о переносе строк будут браться не из опции Перенос строк, а из настроек, заданных в модулях подсветки. Например, для С++ перенос строк отключен. Для обычного текста или для HTML - включен.


Клавиатура

Вдобавок к привычной работе с клавиатурой, в TEA можно включить режим для левшей и амбидекстеров, делается это в Наладка - Общие - Использовать левый Alt + WASD. В этом режиме, удерживая левый Alt, клавиши WASD служат для перемещения курсора, на подмогу им - E, C (как PageUp/Down).

То же самое, но с удерживаемой левой клавишей Win - выделяет текст.

При включенной же опции Использовать джойстик как курсорные клавиши удобно прокручивать текст, если допустим вы сидите далеко от монитора и читаете текст с экрана, записывая видео для Ютуба. Замечу, что при этом считываются единичные нажатия на крестовину джойпада, а не удержание ее в определенном направлении.


Тайная власть

Познай истину! Рептилоиды возобладают над родом человеческим, если ты не знаешь тайных настроек TEA. К ним нет графического интерфейса, их можно добавлять и править только через главный файл настроек TEA, который сокрыт от любопытных глаз в $HOME/.config/tea\tea.conf (или, под Windows - буква:\Documents and Settings\username\tea\tea.conf). Некоторые изменения вступят в силу после перезапуска TEA. Познай же истину:

recent_list.max_items=максимальное количество элементов в списке последних файлов, по умолчанию 21


Примечания

Поддерживается старорежимная опция командной строки "--charset=codepage". С её помощью вы можете принудительно задать (по умолчанию-то используется UTF-8) кодировку для файла, открываемого через командную строку. Например:

tea --charset=window-1251 file1.txt file2.txt --charset=utf-8 file3.txt

Документация, все картинки прочее в TEA, кроме исходных кодов, являются общественным достоянием (public domain). Код TEA лицензирован под GPL версии 3, текст которой вы можете прочитать в меню Помощь - Лицензия, а неофициальный перевод с английского - по этой ссылке.

О пользователь, взалчущий создавать свои правила подсветки для разных языков программирования. К тебе эти строки! Правила подсветки задаются в xml-файлах, примеры коих ты имеешь счастье видеть в каталоге hls исходника. Свои же файлы правил надобно помещать в каталог настроек TEA, подкаталог hls. Для *nix это $HOME/.config/tea/hls, а под Windows Documents and Settings/имя пользователя/tea/hls. Цвета в правилах подсветки лучше прописывать, ссылаясь на имена из палитры (см. файлы палитр в исходнике), т.е. пишите "preproc" или "types" вместо шестнадцатеричных значений цветов. Это нужно для правильной работы цветовых схем.

Давайте свои палитры и правила подсветки в TEA! Просьба отдавать это со статусом "общественное достояние" - public domain. Именно так распространяются все файлы TEA, кроме исходника. Почему? Хлопот меньше. Не надо таскать с программой лишние лицензии.


Другие проекты автора

Личный сайт - тут вы найдете мою прозу, музыку, программы и другое.

Студия Дрымба - сайт независимой киностудии "Дрымба", снимающей любительские фильмы практически с нулевым бюджетом. Я там один из режиссеров и актеров.

tea-qt-47.1.0/meson.build000066400000000000000000000072471346332167200151610ustar00rootroot00000000000000project('tea', ['cpp','c'], default_options : ['cpp_std=c++11'], version : '47.1.0', license : 'GPLv3') add_global_arguments('-DVERSION_NUMBER="47.0.1"', language : 'cpp') add_global_arguments('-DUSE_QML_STUFF=1', language : 'cpp') #harcoded for now moc_params = ['-DQT_VERSION=0x050000', '-DUSE_QML_STUFF=1'] if build_machine.system() == 'linux' moc_params += ['-DQ_OS_LINUX=1', '-DQ_OS_UNIX=1'] endif compiler = meson.get_compiler('cpp') if compiler.has_header('/usr/include/linux/joystick.h') moc_params += ['-DJOYSTICK_SUPPORTED=1'] add_global_arguments('-DJOYSTICK_SUPPORTED=1', language : 'cpp') endif aspell_dep = compiler.find_library('aspell', required : false) if aspell_dep.found() add_global_arguments('-DASPELL_ENABLE=1', language : 'cpp') moc_params += ['-DASPELL_ENABLE=1'] endif hunspell_dep = dependency('hunspell', required : false) if hunspell_dep.found() # add_global_arguments('-DSPELLCHECK_ENABLE=1', language : 'cpp') add_global_arguments('-DHUNSPELL_ENABLE=1', language : 'cpp') # moc_params += ['-DSPELLCHECK_ENABLE=1'] moc_params += ['-DHUNSPELL_ENABLE=1'] endif poppler_dep = dependency('poppler-qt5', required : false) if poppler_dep.found() add_global_arguments('-DPOPPLER_ENABLE=1', language : 'cpp') moc_params += ['-DPOPPLER_ENABLE=1'] endif ddjvuapi_dep = dependency('ddjvuapi', required : false) if ddjvuapi_dep.found() add_global_arguments('-DDJVU_ENABLE=1', language : 'cpp') moc_params += ['-DDJVU_ENABLE=1'] endif zlib_dep = dependency('zlib', required : true) qt5_dep = dependency('qt5', modules : ['Core', 'Gui', 'Widgets', 'Network', 'Qml', 'Quick']) qt5 = import('qt5') tea_headers_moc = [ 'quagzipfile.h', 'quaziodevice.h', 'quazipfile.h', 'rvln.h', 'todo.h', 'document.h', 'calendar.h', 'fman.h', 'shortcuts.h', 'logmemo.h', 'img_viewer.h', 'tio.h', 'fontbox.h', 'tzipper.h', 'single_application.h', 'single_application_shared.h', 'myjoystick.h'] src_processed = qt5.preprocess( moc_headers : tea_headers_moc, moc_extra_arguments: moc_params, qresources : 'resources.qrc' ) tea_source = ['rvln.cpp', 'main.cpp', 'todo.cpp', 'textproc.cpp', 'libretta_calc.cpp', 'wavinfo.cpp', 'calendar.cpp', 'gui_utils.cpp', 'document.cpp', 'utils.cpp', 'spellchecker.cpp', 'fman.cpp', 'shortcuts.cpp', 'logmemo.cpp', 'img_viewer.cpp', 'fontbox.cpp', 'tio.cpp', 'tzipper.cpp', 'single_application.cpp', 'single_application_shared.cpp', 'exif.cpp', 'myjoystick.cpp', 'qioapi.cpp', 'quaadler32.cpp', 'quacrc32.cpp', 'quagzipfile.cpp', 'quaziodevice.cpp', 'quazip.cpp', 'quazipdir.cpp', 'quazipfile.cpp', 'quazipfileinfo.cpp', 'quazipnewinfo.cpp', 'unzip.c', 'zip.c'] tea_exe = executable ('tea', sources : [src_processed, tea_source], install : true, dependencies : [qt5_dep, hunspell_dep, aspell_dep, zlib_dep, poppler_dep, ddjvuapi_dep] # cpp_args : '-std=c++11' ) install_data(['icons/32/tea.png'], install_dir : 'share/icons/hicolor/32x32/apps') install_data(['icons/48/tea.png'], install_dir : 'share/icons/hicolor/48x48/apps') install_data(['icons/64/tea.png'], install_dir : 'share/icons/hicolor/64x64/apps') install_data(['icons/128/tea.png'], install_dir : 'share/icons/hicolor/128x128/apps') install_data(['icons/svg/tea.svg'], install_dir : 'share/icons/hicolor/scalable/apps') install_data(['desktop/tea.desktop'], install_dir : 'share/applications') tea-qt-47.1.0/minizip_crypt.h000066400000000000000000000113171346332167200160610ustar00rootroot00000000000000/* crypt.h -- base code for crypt/uncrypt ZIPfile Version 1.01e, February 12th, 2005 Copyright (C) 1998-2005 Gilles Vollant This code is a modified version of crypting code in Infozip distribution The encryption/decryption parts of this source code (as opposed to the non-echoing password parts) were originally written in Europe. The whole source package can be freely distributed, including from the USA. (Prior to January 2000, re-export from the US was a violation of US law.) This encryption code is a direct transcription of the algorithm from Roger Schlafly, described by Phil Katz in the file appnote.txt. This file (appnote.txt) is distributed with the PKZIP program (even in the version without encryption capabilities). If you don't need crypting in your application, just define symbols NOCRYPT and NOUNCRYPT. This code support the "Traditional PKWARE Encryption". The new AES encryption added on Zip format by Winzip (see the page http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong Encryption is not supported. */ #include "quazip_global.h" #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) /*********************************************************************** * Return the next byte in the pseudo-random sequence */ static int decrypt_byte(unsigned long* pkeys, const z_crc_t FAR * pcrc_32_tab QUAZIP_UNUSED) { //(void) pcrc_32_tab; /* avoid "unused parameter" warning */ unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an * unpredictable manner on 16-bit systems; not a problem * with any known compiler so far, though */ temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); } /*********************************************************************** * Update the encryption keys with the next byte of plain text */ static int update_keys(unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab,int c) { (*(pkeys+0)) = CRC32((*(pkeys+0)), c); (*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; { register int keyshift = (int)((*(pkeys+1)) >> 24); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); } return c; } /*********************************************************************** * Initialize the encryption keys and the random header according to * the given password. */ static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab) { *(pkeys+0) = 305419896L; *(pkeys+1) = 591751049L; *(pkeys+2) = 878082192L; while (*passwd != '\0') { update_keys(pkeys,pcrc_32_tab,(int)*passwd); passwd++; } } #define zdecode(pkeys,pcrc_32_tab,c) \ (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) #define zencode(pkeys,pcrc_32_tab,c,t) \ (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED #define RAND_HEAD_LEN 12 /* "last resort" source for second part of crypt seed pattern */ # ifndef ZCR_SEED2 # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ # endif static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) const char *passwd; /* password string */ unsigned char *buf; /* where to write header */ int bufSize; unsigned long* pkeys; const z_crc_t FAR * pcrc_32_tab; unsigned long crcForCrypting; { int n; /* index in random header */ int t; /* temporary */ int c; /* random byte */ unsigned char header[RAND_HEAD_LEN-2]; /* random header */ static unsigned calls = 0; /* ensure different random header each time */ if (bufSize> 7) & 0xff; header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); } /* Encrypt random header (last two bytes is high word of crc) */ init_keys(passwd, pkeys, pcrc_32_tab); for (n = 0; n < RAND_HEAD_LEN-2; n++) { buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); } buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); return n; } #endif tea-qt-47.1.0/myjoystick.cpp000066400000000000000000000046011346332167200157170ustar00rootroot00000000000000//this code by Peter Semiletov is the public domain #include #if defined(JOYSTICK_SUPPORTED) #include #include #include "myjoystick.h" CJoystick::~CJoystick() { close (fd); } CJoystick::CJoystick (uint idn, QObject *upper_link) { receiver = upper_link; id = idn; initialized = false; number_of_axis = 0; number_of_buttons = 0; axis_pressed = false; etype = 0; QString filename = "/dev/input/js" + QString::number (id); qDebug() << "Trying to open " << filename; if ((fd = open (filename.toUtf8().data(), O_NONBLOCK)) == -1) { qDebug() << "Cannot open " << filename; return; } qDebug() << "ok"; initialized = true; char num_of_axis = 0; char num_of_buttons = 0; char jname[80]; ioctl (fd, JSIOCGAXES, &num_of_axis); ioctl (fd, JSIOCGBUTTONS, &num_of_buttons); ioctl (fd, JSIOCGNAME(80), &jname); number_of_axis = num_of_axis; number_of_buttons = num_of_buttons; description = jname; read_joystick(); } void CJoystick::read_joystick_depr() { struct JS_DATA_TYPE js; if (read (fd, &js, JS_RETURN) != JS_RETURN) return; //error CJoystickAxisEvent *event = new CJoystickAxisEvent (evtJoystickAxis); if (js.y != 0) { event->axis = 0; event->value = js.y; } if (js.x != 0) { event->axis = 1; event->value = js.x; } QApplication::postEvent(receiver, reinterpret_cast(event)); } void CJoystick::read_joystick() { if (! initialized) return; struct js_event e; while (read (fd, &e, sizeof(e)) > 0) { process_event (e); } if (errno != EAGAIN) { qDebug() << "Joystick read error"; initialized = false; } } void CJoystick::process_event (js_event e) { // qDebug() << "e.type" << e.type << endl; if (e.type & JS_EVENT_BUTTON) { CJoystickButtonEvent *event = new CJoystickButtonEvent (evtJoystickButton); event->button = e.number; //pressed button number event->pressed = e.value; //1 if pressed QApplication::postEvent (receiver, reinterpret_cast(event)); } else if (e.type & JS_EVENT_AXIS) { CJoystickAxisEvent *event = new CJoystickAxisEvent (evtJoystickAxis); event->axis = e.number; event->value = e.value; QApplication::postEvent(receiver, reinterpret_cast(event)); } } #endif tea-qt-47.1.0/myjoystick.h000066400000000000000000000024511346332167200153650ustar00rootroot00000000000000//this code by Peter Semiletov is the public domain #ifndef MYJOYSTICK_H #define MYJOYSTICK_H #include #include #if defined(JOYSTICK_SUPPORTED) #include #include #include #include #include #include const QEvent::Type evtJoystickAxis = QEvent::Type (QEvent::User + 1); const QEvent::Type evtJoystickButton = QEvent::Type (QEvent::User + 2); class CJoystickButtonEvent: public QEvent { public: uint button; bool pressed; CJoystickButtonEvent (QEvent::Type type): QEvent (type), button (0), pressed (false) {} }; class CJoystickAxisEvent: public QEvent { public: uint axis; qint16 value; CJoystickAxisEvent (QEvent::Type type): QEvent (type), axis (0), value (0) {} }; class CJoystick: public QObject { Q_OBJECT public: QObject *receiver; //link to the object that handle joystick events int fd; //joystick file descriptor uint id; //joystick id int etype; bool axis_pressed; QString description; //joystick text description bool initialized; uint number_of_axis; uint number_of_buttons; CJoystick (uint idn, QObject *upper_link); ~CJoystick(); void process_event (js_event e); public slots: void read_joystick(); void read_joystick_depr(); }; #endif #endif tea-qt-47.1.0/palettes/000077500000000000000000000000001346332167200146265ustar00rootroot00000000000000tea-qt-47.1.0/palettes/Berry000066400000000000000000000006761346332167200156450ustar00rootroot00000000000000class=#ff4a83 label=#ffd060 type=#ff418d functions=#55aaff digits=#e8e81f digits-float=#e8e81f operator=white include=darkGreen preproc=darkBlue single comment=gray quotes=#26c5ff mcomment-start=gray text=white background=#663e94 sel-text=black sel-background=#a6ffdd keywords=#ffaa00 error=red cur_line_color=#2e3436 tags=#ff2063 modifiers=#b5b500 brackets=yellow margin_color=gray linenums_bg=#e4e4e4 backgroundmark=#ff79f4 foregroundmark=whitetea-qt-47.1.0/palettes/Linux MC000066400000000000000000000006171346332167200161340ustar00rootroot00000000000000class=#ffffe9 type=#ffffe9 functions=#eeffee digits=#ffff00 include=#4ad5ff preproc=#4ad5ff single comment=#edeaff quotes=#ffff00 mcomment-start=#edeaff text=white background=#3238aa sel-text=#3238aa sel-background=white keywords=#d38448 error=#ff557f cur_line_color=#aaaa7f tags=#eee4f5 modifiers=#f3ffff linenums_bg=#3e4348 brackets=#c4a000 backgroundmark=red foregroundmark=white operator=#c4a000tea-qt-47.1.0/palettes/Morning000066400000000000000000000006701346332167200161650ustar00rootroot00000000000000class=#0c084b label=#ff557f type=#5714dd functions=blue digits=darkGreen digits-float=#005500 operators=#ffaa00 include=darkGreen preproc=darkBlue single comment=gray quotes=#ab0c34 mcomment-start=gray text=black background=#729fcf sel-text=white sel-background=black keywords=black error=red cur_line_color=#EEF6FF tags=darkBlue modifiers=#55557f brackets=yellow margin_color=gray linenums_bg=#e4e4e4 backgroundmark=blue foregroundmark=redtea-qt-47.1.0/palettes/Navigator000066400000000000000000000006701346332167200165060ustar00rootroot00000000000000class=#0c084b label=#ff557f type=#5714dd functions=blue digits=darkGreen digits-float=#005500 operators=#ffaa00 include=darkGreen preproc=darkBlue single comment=gray quotes=#8ae234 mcomment-start=gray text=white background=#555753 sel-text=white sel-background=black keywords=black error=red cur_line_color=#2e3436 tags=darkBlue modifiers=#55557f brackets=yellow margin_color=gray linenums_bg=#e4e4e4 backgroundmark=blue foregroundmark=redtea-qt-47.1.0/palettes/Pines000066400000000000000000000006331346332167200156310ustar00rootroot00000000000000class=#e6eaff type=#e6eaff functions=#e6eaff digits=#e6eaff include=#ffaa7f preproc=#ffaa7f single comment=#f7f0ff quotes=#ffff00 mcomment-start=#f7f0ff text=white background=#002a00 sel-text=#0b7d35 sel-background=white keywords=#fff6fc error=#ff7b72 cur_line_color=#0c75ff tags=white modifiers=#e6eaff brackets=#ff5500 label=#ffaa7f linenums_bg=#002b00 backgroundmark=red foregroundmark=black operator=#50d0ebtea-qt-47.1.0/palettes/TEA000066400000000000000000000006661346332167200151720ustar00rootroot00000000000000class=#5714dd label=#ff557f type=#5714dd functions=blue digits=darkGreen digits-float=#005500 operators=#ffaa00 include=darkGreen preproc=darkBlue single comment=gray quotes=#ab0c34 mcomment-start=gray text=black background=white sel-text=white sel-background=black keywords=black error=red cur_line_color=#EEF6FF tags=darkBlue modifiers=#55557f brackets=yellow margin_color=gray linenums_bg=#e4e4e4 backgroundmark=blue foregroundmark=redtea-qt-47.1.0/palettes/Turbo90000066400000000000000000000006231346332167200160160ustar00rootroot00000000000000class=#ffffe9 type=#ffffe9 functions=#eeffee digits=#ffff00 include=#4ad5ff preproc=#4ad5ff single comment=#edeaff quotes=#ffff00 mcomment-start=#edeaff text=#ffff00 background=#1818b2 sel-text=#1818b2 sel-background=#b2b2b2 keywords=#ffff00 error=#ff557f cur_line_color=#aaaa7f tags=#eee4f5 modifiers=#f3ffff linenums_bg=#3e4348 brackets=#55aaff backgroundmark=red foregroundmark=white operator=#fcaf3etea-qt-47.1.0/palettes/UNIX000066400000000000000000000006031346332167200153330ustar00rootroot00000000000000class=#b0c5ff type=white functions=#c0ccff digits=green include=#f3ffbc preproc=#f3ffbc single comment=#f5edff quotes=#ff7386 mcomment-start=#f5edff text=#00ff00 background=black sel-text=black sel-background=#00ff00 keywords=white tags=white modifiers=white brackets=#ffaa00 label=#ff007f linenums_bg=#0a0d4b backgroundmark=red foregroundmark=white operator=green cur_line_color=#555753tea-qt-47.1.0/palettes/Vinyl000066400000000000000000000006441346332167200156560ustar00rootroot00000000000000class=#ffe9e4 type=#ffebf2 functions=#aaffff digits=#00ff00 include=#4ad5ff preproc=#ffff7f single comment=#e2f9ff quotes=#ff70bd mcomment-start=#e2f9ff text=#f3f4ff background=#64523e sel-text=#64523e sel-background=#f3f4ff keywords=#37dbff error=#ff708f cur_line_color=#452e0c tags=#a0ffa3 modifiers=#f3ffca brackets=#a40000 label=#ffaa00 linenums_bg=#53552f backgroundmark=yellow foregroundmark=black operator=#edd400tea-qt-47.1.0/palettes/paper-old000066400000000000000000000006741346332167200164430ustar00rootroot00000000000000class=darkBlue label=#ff557f type=darkBlue functions=blue digits=darkGreen digits-float=#005500 operators=#ffaa00 include=darkGreen preproc=darkBlue single comment=gray quotes=#0000ff mcomment-start=gray text=black background=#fff7ef sel-text=#fff7ef sel-background=black keywords=black error=red cur_line_color=#EEF6FF tags=darkBlue modifiers=#55557f brackets=yellow margin_color=gray linenums_bg=#e4e4e4 backgroundmark=blue foregroundmark=redtea-qt-47.1.0/palettes/paper-toilet000066400000000000000000000006721346332167200171630ustar00rootroot00000000000000class=#2e0e8c label=#ff557f type=#2e0e8c functions=blue digits=darkGreen digits-float=#005500 operators=#ffaa00 include=darkGreen preproc=darkBlue single comment=gray quotes=#7f1d3d mcomment-start=gray text=black background=#f3f3f3 sel-text=#f3f3f3 sel-background=black keywords=black error=red cur_line_color=#EEF6FF tags=darkBlue modifiers=#55557f brackets=yellow margin_color=gray linenums_bg=#e4e4e4 backgroundmark=blue foregroundmark=redtea-qt-47.1.0/qioapi.cpp000066400000000000000000000256331346332167200150040ustar00rootroot00000000000000/* ioapi.c -- IO base function header for compress/uncompress .zip files using zlib + zip or unzip API Version 1.01e, February 12th, 2005 Copyright (C) 1998-2005 Gilles Vollant Modified by Sergey A. Tachenov to integrate with Qt. */ #include #include #include #include "zlib.h" #include "ioapi.h" #include "quazip_global.h" #include #if (QT_VERSION >= 0x050100) #define QUAZIP_QSAVEFILE_BUG_WORKAROUND #endif #ifdef QUAZIP_QSAVEFILE_BUG_WORKAROUND #include #endif /* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ #ifndef SEEK_CUR #define SEEK_CUR 1 #endif #ifndef SEEK_END #define SEEK_END 2 #endif #ifndef SEEK_SET #define SEEK_SET 0 #endif voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,voidpf file,int mode) { if (pfilefunc->zfile_func64.zopen64_file != NULL) return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,file,mode); else { return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,file,mode); } } int call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) { if (pfilefunc->zfile_func64.zseek64_file != NULL) return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); else { uLong offsetTruncated = (uLong)offset; if (offsetTruncated != offset) return -1; else return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin); } } ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) { if (pfilefunc->zfile_func64.zseek64_file != NULL) return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); else { uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); if ((tell_uLong) == ((uLong)-1)) return (ZPOS64_T)-1; else return tell_uLong; } } /// @cond internal struct QIODevice_descriptor { // Position only used for writing to sequential devices. qint64 pos; inline QIODevice_descriptor(): pos(0) {} }; /// @endcond voidpf ZCALLBACK qiodevice_open_file_func ( voidpf opaque, voidpf file, int mode) { QIODevice_descriptor *d = reinterpret_cast(opaque); QIODevice *iodevice = reinterpret_cast(file); QIODevice::OpenMode desiredMode; if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) desiredMode = QIODevice::ReadOnly; else if (mode & ZLIB_FILEFUNC_MODE_EXISTING) desiredMode = QIODevice::ReadWrite; else if (mode & ZLIB_FILEFUNC_MODE_CREATE) desiredMode = QIODevice::WriteOnly; if (iodevice->isOpen()) { if ((iodevice->openMode() & desiredMode) == desiredMode) { if (desiredMode != QIODevice::WriteOnly && iodevice->isSequential()) { // We can use sequential devices only for writing. delete d; return NULL; } else { if ((desiredMode & QIODevice::WriteOnly) != 0) { // open for writing, need to seek existing device if (!iodevice->isSequential()) { iodevice->seek(0); } else { d->pos = iodevice->pos(); } } } return iodevice; } else { delete d; return NULL; } } iodevice->open(desiredMode); if (iodevice->isOpen()) { if (desiredMode != QIODevice::WriteOnly && iodevice->isSequential()) { // We can use sequential devices only for writing. iodevice->close(); delete d; return NULL; } else { return iodevice; } } else { delete d; return NULL; } } uLong ZCALLBACK qiodevice_read_file_func ( voidpf opaque, voidpf stream, void* buf, uLong size) { QIODevice_descriptor *d = reinterpret_cast(opaque); QIODevice *iodevice = reinterpret_cast(stream); qint64 ret64 = iodevice->read((char*)buf,size); uLong ret; ret = (uLong) ret64; if (ret64 != -1) { d->pos += ret64; } return ret; } uLong ZCALLBACK qiodevice_write_file_func ( voidpf opaque, voidpf stream, const void* buf, uLong size) { QIODevice_descriptor *d = reinterpret_cast(opaque); QIODevice *iodevice = reinterpret_cast(stream); uLong ret; qint64 ret64 = iodevice->write((char*)buf,size); if (ret64 != -1) { d->pos += ret64; } ret = (uLong) ret64; return ret; } uLong ZCALLBACK qiodevice_tell_file_func ( voidpf opaque, voidpf stream) { QIODevice_descriptor *d = reinterpret_cast(opaque); QIODevice *iodevice = reinterpret_cast(stream); uLong ret; qint64 ret64; if (iodevice->isSequential()) { ret64 = d->pos; } else { ret64 = iodevice->pos(); } ret = static_cast(ret64); return ret; } ZPOS64_T ZCALLBACK qiodevice64_tell_file_func ( voidpf opaque, voidpf stream) { QIODevice_descriptor *d = reinterpret_cast(opaque); QIODevice *iodevice = reinterpret_cast(stream); qint64 ret; if (iodevice->isSequential()) { ret = d->pos; } else { ret = iodevice->pos(); } return static_cast(ret); } int ZCALLBACK qiodevice_seek_file_func ( voidpf /*opaque UNUSED*/, voidpf stream, uLong offset, int origin) { QIODevice *iodevice = reinterpret_cast(stream); if (iodevice->isSequential()) { if (origin == ZLIB_FILEFUNC_SEEK_END && offset == 0) { // sequential devices are always at end (needed in mdAppend) return 0; } else { qWarning("qiodevice_seek_file_func() called for sequential device"); return -1; } } uLong qiodevice_seek_result=0; int ret; switch (origin) { case ZLIB_FILEFUNC_SEEK_CUR : qiodevice_seek_result = ((QIODevice*)stream)->pos() + offset; break; case ZLIB_FILEFUNC_SEEK_END : qiodevice_seek_result = ((QIODevice*)stream)->size() - offset; break; case ZLIB_FILEFUNC_SEEK_SET : qiodevice_seek_result = offset; break; default: return -1; } ret = !iodevice->seek(qiodevice_seek_result); return ret; } int ZCALLBACK qiodevice64_seek_file_func ( voidpf /*opaque UNUSED*/, voidpf stream, ZPOS64_T offset, int origin) { QIODevice *iodevice = reinterpret_cast(stream); if (iodevice->isSequential()) { if (origin == ZLIB_FILEFUNC_SEEK_END && offset == 0) { // sequential devices are always at end (needed in mdAppend) return 0; } else { qWarning("qiodevice_seek_file_func() called for sequential device"); return -1; } } qint64 qiodevice_seek_result=0; int ret; switch (origin) { case ZLIB_FILEFUNC_SEEK_CUR : qiodevice_seek_result = ((QIODevice*)stream)->pos() + offset; break; case ZLIB_FILEFUNC_SEEK_END : qiodevice_seek_result = ((QIODevice*)stream)->size() - offset; break; case ZLIB_FILEFUNC_SEEK_SET : qiodevice_seek_result = offset; break; default: return -1; } ret = !iodevice->seek(qiodevice_seek_result); return ret; } int ZCALLBACK qiodevice_close_file_func ( voidpf opaque, voidpf stream) { QIODevice_descriptor *d = reinterpret_cast(opaque); delete d; QIODevice *device = reinterpret_cast(stream); #ifdef QUAZIP_QSAVEFILE_BUG_WORKAROUND // QSaveFile terribly breaks the is-a idiom: // it IS a QIODevice, but it is NOT compatible with it: close() is private QSaveFile *file = qobject_cast(device); if (file != NULL) { // We have to call the ugly commit() instead: return file->commit() ? 0 : -1; } #endif device->close(); return 0; } int ZCALLBACK qiodevice_fakeclose_file_func ( voidpf opaque, voidpf /*stream*/) { QIODevice_descriptor *d = reinterpret_cast(opaque); delete d; return 0; } int ZCALLBACK qiodevice_error_file_func ( voidpf /*opaque UNUSED*/, voidpf /*stream UNUSED*/) { // can't check for error due to the QIODevice API limitation return 0; } void fill_qiodevice_filefunc ( zlib_filefunc_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen_file = qiodevice_open_file_func; pzlib_filefunc_def->zread_file = qiodevice_read_file_func; pzlib_filefunc_def->zwrite_file = qiodevice_write_file_func; pzlib_filefunc_def->ztell_file = qiodevice_tell_file_func; pzlib_filefunc_def->zseek_file = qiodevice_seek_file_func; pzlib_filefunc_def->zclose_file = qiodevice_close_file_func; pzlib_filefunc_def->zerror_file = qiodevice_error_file_func; pzlib_filefunc_def->opaque = new QIODevice_descriptor; } void fill_qiodevice64_filefunc ( zlib_filefunc64_def* pzlib_filefunc_def) { // Open functions are the same for Qt. pzlib_filefunc_def->zopen64_file = qiodevice_open_file_func; pzlib_filefunc_def->zread_file = qiodevice_read_file_func; pzlib_filefunc_def->zwrite_file = qiodevice_write_file_func; pzlib_filefunc_def->ztell64_file = qiodevice64_tell_file_func; pzlib_filefunc_def->zseek64_file = qiodevice64_seek_file_func; pzlib_filefunc_def->zclose_file = qiodevice_close_file_func; pzlib_filefunc_def->zerror_file = qiodevice_error_file_func; pzlib_filefunc_def->opaque = new QIODevice_descriptor; pzlib_filefunc_def->zfakeclose_file = qiodevice_fakeclose_file_func; } void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) { p_filefunc64_32->zfile_func64.zopen64_file = NULL; p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; p_filefunc64_32->zfile_func64.ztell64_file = NULL; p_filefunc64_32->zfile_func64.zseek64_file = NULL; p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; p_filefunc64_32->zfile_func64.zfakeclose_file = NULL; p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; } tea-qt-47.1.0/quaadler32.cpp000066400000000000000000000025471346332167200154640ustar00rootroot00000000000000/* Copyright (C) 2010 Adam Walczak Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include "quaadler32.h" #include "zlib.h" QuaAdler32::QuaAdler32() { reset(); } quint32 QuaAdler32::calculate(const QByteArray &data) { return adler32( adler32(0L, Z_NULL, 0), (const Bytef*)data.data(), data.size() ); } void QuaAdler32::reset() { checksum = adler32(0L, Z_NULL, 0); } void QuaAdler32::update(const QByteArray &buf) { checksum = adler32( checksum, (const Bytef*)buf.data(), buf.size() ); } quint32 QuaAdler32::value() { return checksum; } tea-qt-47.1.0/quaadler32.h000066400000000000000000000026631346332167200151300ustar00rootroot00000000000000#ifndef QUAADLER32_H #define QUAADLER32_H /* Copyright (C) 2010 Adam Walczak Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include #include "quachecksum32.h" /// Adler32 checksum /** \class QuaAdler32 quaadler32.h * This class wrappers the adler32 function with the QuaChecksum32 interface. * See QuaChecksum32 for more info. */ class QUAZIP_EXPORT QuaAdler32 : public QuaChecksum32 { public: QuaAdler32(); quint32 calculate(const QByteArray &data); void reset(); void update(const QByteArray &buf); quint32 value(); private: quint32 checksum; }; #endif //QUAADLER32_H tea-qt-47.1.0/quachecksum32.h000066400000000000000000000044221346332167200156360ustar00rootroot00000000000000#ifndef QUACHECKSUM32_H #define QUACHECKSUM32_H /* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include #include "quazip_global.h" /// Checksum interface. /** \class QuaChecksum32 quachecksum32.h * This is an interface for 32 bit checksums. * Classes implementing this interface can calcunate a certin * checksum in a single step: * \code * QChecksum32 *crc32 = new QuaCrc32(); * rasoult = crc32->calculate(data); * \endcode * or by streaming the data: * \code * QChecksum32 *crc32 = new QuaCrc32(); * while(!fileA.atEnd()) * crc32->update(fileA.read(bufSize)); * resoultA = crc32->value(); * crc32->reset(); * while(!fileB.atEnd()) * crc32->update(fileB.read(bufSize)); * resoultB = crc32->value(); * \endcode */ class QUAZIP_EXPORT QuaChecksum32 { public: virtual ~QuaChecksum32() {} ///Calculates the checksum for data. /** \a data source data * \return data checksum * * This function has no efect on the value returned by value(). */ virtual quint32 calculate(const QByteArray &data) = 0; ///Resets the calculation on a checksun for a stream. virtual void reset() = 0; ///Updates the calculated checksum for the stream /** \a buf next portion of data from the stream */ virtual void update(const QByteArray &buf) = 0; ///Value of the checksum calculated for the stream passed throw update(). /** \return checksum */ virtual quint32 value() = 0; }; #endif //QUACHECKSUM32_H tea-qt-47.1.0/quacrc32.cpp000066400000000000000000000024611346332167200151370ustar00rootroot00000000000000/* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include "quacrc32.h" #include "zlib.h" QuaCrc32::QuaCrc32() { reset(); } quint32 QuaCrc32::calculate(const QByteArray &data) { return crc32( crc32(0L, Z_NULL, 0), (const Bytef*)data.data(), data.size() ); } void QuaCrc32::reset() { checksum = crc32(0L, Z_NULL, 0); } void QuaCrc32::update(const QByteArray &buf) { checksum = crc32( checksum, (const Bytef*)buf.data(), buf.size() ); } quint32 QuaCrc32::value() { return checksum; } tea-qt-47.1.0/quacrc32.h000066400000000000000000000025641346332167200146100ustar00rootroot00000000000000#ifndef QUACRC32_H #define QUACRC32_H /* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include "quachecksum32.h" ///CRC32 checksum /** \class QuaCrc32 quacrc32.h * This class wrappers the crc32 function with the QuaChecksum32 interface. * See QuaChecksum32 for more info. */ class QUAZIP_EXPORT QuaCrc32 : public QuaChecksum32 { public: QuaCrc32(); ~QuaCrc32() {} quint32 calculate(const QByteArray &data); void reset(); void update(const QByteArray &buf); quint32 value(); private: quint32 checksum; }; #endif //QUACRC32_H tea-qt-47.1.0/quagzipfile.cpp000066400000000000000000000103261346332167200160330ustar00rootroot00000000000000/* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include #include "quagzipfile.h" /// \cond internal class QuaGzipFilePrivate { friend class QuaGzipFile; QString fileName; gzFile gzd; inline QuaGzipFilePrivate(): gzd(NULL) {} inline QuaGzipFilePrivate(const QString &fileName): fileName(fileName), gzd(NULL) {} template bool open(FileId id, QIODevice::OpenMode mode, QString &error); gzFile open(int fd, const char *modeString); gzFile open(const QString &name, const char *modeString); }; gzFile QuaGzipFilePrivate::open(const QString &name, const char *modeString) { return gzopen(QFile::encodeName(name).constData(), modeString); } gzFile QuaGzipFilePrivate::open(int fd, const char *modeString) { return gzdopen(fd, modeString); } template bool QuaGzipFilePrivate::open(FileId id, QIODevice::OpenMode mode, QString &error) { char modeString[2]; modeString[0] = modeString[1] = '\0'; if ((mode & QIODevice::Append) != 0) { error = QuaGzipFile::trUtf8("QIODevice::Append is not " "supported for GZIP"); return false; } if ((mode & QIODevice::ReadOnly) != 0 && (mode & QIODevice::WriteOnly) != 0) { error = QuaGzipFile::trUtf8("Opening gzip for both reading" " and writing is not supported"); return false; } else if ((mode & QIODevice::ReadOnly) != 0) { modeString[0] = 'r'; } else if ((mode & QIODevice::WriteOnly) != 0) { modeString[0] = 'w'; } else { error = QuaGzipFile::trUtf8("You can open a gzip either for reading" " or for writing. Which is it?"); return false; } gzd = open(id, modeString); if (gzd == NULL) { error = QuaGzipFile::trUtf8("Could not gzopen() file"); return false; } return true; } /// \endcond QuaGzipFile::QuaGzipFile(): d(new QuaGzipFilePrivate()) { } QuaGzipFile::QuaGzipFile(QObject *parent): QIODevice(parent), d(new QuaGzipFilePrivate()) { } QuaGzipFile::QuaGzipFile(const QString &fileName, QObject *parent): QIODevice(parent), d(new QuaGzipFilePrivate(fileName)) { } QuaGzipFile::~QuaGzipFile() { if (isOpen()) { close(); } delete d; } void QuaGzipFile::setFileName(const QString& fileName) { d->fileName = fileName; } QString QuaGzipFile::getFileName() const { return d->fileName; } bool QuaGzipFile::isSequential() const { return true; } bool QuaGzipFile::open(QIODevice::OpenMode mode) { QString error; if (!d->open(d->fileName, mode, error)) { setErrorString(error); return false; } return QIODevice::open(mode); } bool QuaGzipFile::open(int fd, QIODevice::OpenMode mode) { QString error; if (!d->open(fd, mode, error)) { setErrorString(error); return false; } return QIODevice::open(mode); } bool QuaGzipFile::flush() { return gzflush(d->gzd, Z_SYNC_FLUSH) == Z_OK; } void QuaGzipFile::close() { QIODevice::close(); gzclose(d->gzd); } qint64 QuaGzipFile::readData(char *data, qint64 maxSize) { return gzread(d->gzd, (voidp)data, (unsigned)maxSize); } qint64 QuaGzipFile::writeData(const char *data, qint64 maxSize) { if (maxSize == 0) return 0; int written = gzwrite(d->gzd, (voidp)data, (unsigned)maxSize); if (written == 0) return -1; else return written; } tea-qt-47.1.0/quagzipfile.h000066400000000000000000000071431346332167200155030ustar00rootroot00000000000000#ifndef QUAZIP_QUAGZIPFILE_H #define QUAZIP_QUAGZIPFILE_H /* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include #include "quazip_global.h" #include class QuaGzipFilePrivate; /// GZIP file /** This class is a wrapper around GZIP file access functions in zlib. Unlike QuaZip classes, it doesn't allow reading from a GZIP file opened as QIODevice, for example, if your GZIP file is in QBuffer. It only provides QIODevice access to a GZIP file contents, but the GZIP file itself must be identified by its name on disk or by descriptor id. */ class QUAZIP_EXPORT QuaGzipFile: public QIODevice { Q_OBJECT public: /// Empty constructor. /** Must call setFileName() before trying to open. */ QuaGzipFile(); /// Empty constructor with a parent. /** Must call setFileName() before trying to open. \param parent The parent object, as per QObject logic. */ QuaGzipFile(QObject *parent); /// Constructor. /** \param fileName The name of the GZIP file. \param parent The parent object, as per QObject logic. */ QuaGzipFile(const QString &fileName, QObject *parent = NULL); /// Destructor. virtual ~QuaGzipFile(); /// Sets the name of the GZIP file to be opened. void setFileName(const QString& fileName); /// Returns the name of the GZIP file. QString getFileName() const; /// Returns true. /** Strictly speaking, zlib supports seeking for GZIP files, but it is poorly implemented, because there is no way to implement it properly. For reading, seeking backwards is very slow, and for writing, it is downright impossible. Therefore, QuaGzipFile does not support seeking at all. */ virtual bool isSequential() const; /// Opens the file. /** \param mode Can be either QIODevice::Write or QIODevice::Read. ReadWrite and Append aren't supported. */ virtual bool open(QIODevice::OpenMode mode); /// Opens the file. /** \overload \param fd The file descriptor to read/write the GZIP file from/to. \param mode Can be either QIODevice::Write or QIODevice::Read. ReadWrite and Append aren't supported. */ virtual bool open(int fd, QIODevice::OpenMode mode); /// Flushes data to file. /** The data is written using Z_SYNC_FLUSH mode. Doesn't make any sense when reading. */ virtual bool flush(); /// Closes the file. virtual void close(); protected: /// Implementation of QIODevice::readData(). virtual qint64 readData(char *data, qint64 maxSize); /// Implementation of QIODevice::writeData(). virtual qint64 writeData(const char *data, qint64 maxSize); private: // not implemented by design to disable copy QuaGzipFile(const QuaGzipFile &that); QuaGzipFile& operator=(const QuaGzipFile &that); QuaGzipFilePrivate *d; }; #endif // QUAZIP_QUAGZIPFILE_H tea-qt-47.1.0/quaziodevice.cpp000066400000000000000000000220311346332167200161770ustar00rootroot00000000000000/* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include "quaziodevice.h" #define QUAZIO_INBUFSIZE 4096 #define QUAZIO_OUTBUFSIZE 4096 /// \cond internal class QuaZIODevicePrivate { friend class QuaZIODevice; QuaZIODevicePrivate(QIODevice *io); ~QuaZIODevicePrivate(); QIODevice *io; z_stream zins; z_stream zouts; char *inBuf; int inBufPos; int inBufSize; char *outBuf; int outBufPos; int outBufSize; bool zBufError; bool atEnd; int doFlush(QString &error); }; QuaZIODevicePrivate::QuaZIODevicePrivate(QIODevice *io): io(io), inBuf(NULL), inBufPos(0), inBufSize(0), outBuf(NULL), outBufPos(0), outBufSize(0), zBufError(false), atEnd(false) { zins.zalloc = (alloc_func) NULL; zins.zfree = (free_func) NULL; zins.opaque = NULL; zouts.zalloc = (alloc_func) NULL; zouts.zfree = (free_func) NULL; zouts.opaque = NULL; inBuf = new char[QUAZIO_INBUFSIZE]; outBuf = new char[QUAZIO_OUTBUFSIZE]; #ifdef QUAZIP_ZIODEVICE_DEBUG_OUTPUT debug.setFileName("debug.out"); debug.open(QIODevice::WriteOnly); #endif #ifdef QUAZIP_ZIODEVICE_DEBUG_INPUT indebug.setFileName("debug.in"); indebug.open(QIODevice::WriteOnly); #endif } QuaZIODevicePrivate::~QuaZIODevicePrivate() { #ifdef QUAZIP_ZIODEVICE_DEBUG_OUTPUT debug.close(); #endif #ifdef QUAZIP_ZIODEVICE_DEBUG_INPUT indebug.close(); #endif if (inBuf != NULL) delete[] inBuf; if (outBuf != NULL) delete[] outBuf; } int QuaZIODevicePrivate::doFlush(QString &error) { int flushed = 0; while (outBufPos < outBufSize) { int more = io->write(outBuf + outBufPos, outBufSize - outBufPos); if (more == -1) { error = io->errorString(); return -1; } if (more == 0) break; outBufPos += more; flushed += more; } if (outBufPos == outBufSize) { outBufPos = outBufSize = 0; } return flushed; } /// \endcond // #define QUAZIP_ZIODEVICE_DEBUG_OUTPUT // #define QUAZIP_ZIODEVICE_DEBUG_INPUT #ifdef QUAZIP_ZIODEVICE_DEBUG_OUTPUT #include static QFile debug; #endif #ifdef QUAZIP_ZIODEVICE_DEBUG_INPUT #include static QFile indebug; #endif QuaZIODevice::QuaZIODevice(QIODevice *io, QObject *parent): QIODevice(parent), d(new QuaZIODevicePrivate(io)) { connect(io, SIGNAL(readyRead()), SIGNAL(readyRead())); } QuaZIODevice::~QuaZIODevice() { if (isOpen()) close(); delete d; } QIODevice *QuaZIODevice::getIoDevice() const { return d->io; } bool QuaZIODevice::open(QIODevice::OpenMode mode) { if ((mode & QIODevice::Append) != 0) { setErrorString(trUtf8("QIODevice::Append is not supported for" " QuaZIODevice")); return false; } if ((mode & QIODevice::ReadWrite) == QIODevice::ReadWrite) { setErrorString(trUtf8("QIODevice::ReadWrite is not supported for" " QuaZIODevice")); return false; } if ((mode & QIODevice::ReadOnly) != 0) { if (inflateInit(&d->zins) != Z_OK) { setErrorString(d->zins.msg); return false; } } if ((mode & QIODevice::WriteOnly) != 0) { if (deflateInit(&d->zouts, Z_DEFAULT_COMPRESSION) != Z_OK) { setErrorString(d->zouts.msg); return false; } } return QIODevice::open(mode); } void QuaZIODevice::close() { if ((openMode() & QIODevice::ReadOnly) != 0) { if (inflateEnd(&d->zins) != Z_OK) { setErrorString(d->zins.msg); } } if ((openMode() & QIODevice::WriteOnly) != 0) { flush(); if (deflateEnd(&d->zouts) != Z_OK) { setErrorString(d->zouts.msg); } } QIODevice::close(); } qint64 QuaZIODevice::readData(char *data, qint64 maxSize) { int read = 0; while (read < maxSize) { if (d->inBufPos == d->inBufSize) { d->inBufPos = 0; d->inBufSize = d->io->read(d->inBuf, QUAZIO_INBUFSIZE); if (d->inBufSize == -1) { d->inBufSize = 0; setErrorString(d->io->errorString()); return -1; } if (d->inBufSize == 0) break; } while (read < maxSize && d->inBufPos < d->inBufSize) { d->zins.next_in = (Bytef *) (d->inBuf + d->inBufPos); d->zins.avail_in = d->inBufSize - d->inBufPos; d->zins.next_out = (Bytef *) (data + read); d->zins.avail_out = (uInt) (maxSize - read); // hope it's less than 2GB int more = 0; switch (inflate(&d->zins, Z_SYNC_FLUSH)) { case Z_OK: read = (char *) d->zins.next_out - data; d->inBufPos = (char *) d->zins.next_in - d->inBuf; break; case Z_STREAM_END: read = (char *) d->zins.next_out - data; d->inBufPos = (char *) d->zins.next_in - d->inBuf; d->atEnd = true; return read; case Z_BUF_ERROR: // this should never happen, but just in case if (!d->zBufError) { qWarning("Z_BUF_ERROR detected with %d/%d in/out, weird", d->zins.avail_in, d->zins.avail_out); d->zBufError = true; } memmove(d->inBuf, d->inBuf + d->inBufPos, d->inBufSize - d->inBufPos); d->inBufSize -= d->inBufPos; d->inBufPos = 0; more = d->io->read(d->inBuf + d->inBufSize, QUAZIO_INBUFSIZE - d->inBufSize); if (more == -1) { setErrorString(d->io->errorString()); return -1; } if (more == 0) return read; d->inBufSize += more; break; default: setErrorString(QString::fromLocal8Bit(d->zins.msg)); return -1; } } } #ifdef QUAZIP_ZIODEVICE_DEBUG_INPUT indebug.write(data, read); #endif return read; } qint64 QuaZIODevice::writeData(const char *data, qint64 maxSize) { int written = 0; QString error; if (d->doFlush(error) == -1) { setErrorString(error); return -1; } while (written < maxSize) { // there is some data waiting in the output buffer if (d->outBufPos < d->outBufSize) return written; d->zouts.next_in = (Bytef *) (data + written); d->zouts.avail_in = (uInt) (maxSize - written); // hope it's less than 2GB d->zouts.next_out = (Bytef *) d->outBuf; d->zouts.avail_out = QUAZIO_OUTBUFSIZE; switch (deflate(&d->zouts, Z_NO_FLUSH)) { case Z_OK: written = (char *) d->zouts.next_in - data; d->outBufSize = (char *) d->zouts.next_out - d->outBuf; break; default: setErrorString(QString::fromLocal8Bit(d->zouts.msg)); return -1; } if (d->doFlush(error) == -1) { setErrorString(error); return -1; } } #ifdef QUAZIP_ZIODEVICE_DEBUG_OUTPUT debug.write(data, written); #endif return written; } bool QuaZIODevice::flush() { QString error; if (d->doFlush(error) < 0) { setErrorString(error); return false; } // can't flush buffer, some data is still waiting if (d->outBufPos < d->outBufSize) return true; Bytef c = 0; d->zouts.next_in = &c; // fake input buffer d->zouts.avail_in = 0; // of zero size do { d->zouts.next_out = (Bytef *) d->outBuf; d->zouts.avail_out = QUAZIO_OUTBUFSIZE; switch (deflate(&d->zouts, Z_SYNC_FLUSH)) { case Z_OK: d->outBufSize = (char *) d->zouts.next_out - d->outBuf; if (d->doFlush(error) < 0) { setErrorString(error); return false; } if (d->outBufPos < d->outBufSize) return true; break; case Z_BUF_ERROR: // nothing to write? return true; default: setErrorString(QString::fromLocal8Bit(d->zouts.msg)); return false; } } while (d->zouts.avail_out == 0); return true; } bool QuaZIODevice::isSequential() const { return true; } bool QuaZIODevice::atEnd() const { // Here we MUST check QIODevice::bytesAvailable() because WE // might have reached the end, but QIODevice didn't-- // it could have simply pre-buffered all remaining data. return (openMode() == NotOpen) || (QIODevice::bytesAvailable() == 0 && d->atEnd); } qint64 QuaZIODevice::bytesAvailable() const { // If we haven't recevied Z_STREAM_END, it means that // we have at least one more input byte available. // Plus whatever QIODevice has buffered. return (d->atEnd ? 0 : 1) + QIODevice::bytesAvailable(); } tea-qt-47.1.0/quaziodevice.h000066400000000000000000000065341346332167200156560ustar00rootroot00000000000000#ifndef QUAZIP_QUAZIODEVICE_H #define QUAZIP_QUAZIODEVICE_H /* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include #include "quazip_global.h" #include class QuaZIODevicePrivate; /// A class to compress/decompress QIODevice. /** This class can be used to compress any data written to QIODevice or decompress it back. Compressing data sent over a QTcpSocket is a good example. */ class QUAZIP_EXPORT QuaZIODevice: public QIODevice { Q_OBJECT public: /// Constructor. /** \param io The QIODevice to read/write. \param parent The parent object, as per QObject logic. */ QuaZIODevice(QIODevice *io, QObject *parent = NULL); /// Destructor. ~QuaZIODevice(); /// Flushes data waiting to be written. /** Unfortunately, as QIODevice doesn't support flush() by itself, the only thing this method does is write the compressed data into the device using Z_SYNC_FLUSH mode. If you need the compressed data to actually be flushed from the buffer of the underlying QIODevice, you need to call its flush() method as well, providing it supports it (like QTcpSocket does). Example: \code QuaZIODevice dev(&sock); dev.open(QIODevice::Write); dev.write(yourDataGoesHere); dev.flush(); sock->flush(); // this actually sends data to network \endcode This may change in the future versions of QuaZIP by implementing an ugly hack: trying to cast the QIODevice using qobject_cast to known flush()-supporting subclasses, and calling flush if the resulting pointer is not zero. */ virtual bool flush(); /// Opens the device. /** \param mode Neither QIODevice::ReadWrite nor QIODevice::Append are not supported. */ virtual bool open(QIODevice::OpenMode mode); /// Closes this device, but not the underlying one. /** The underlying QIODevice is not closed in case you want to write something else to it. */ virtual void close(); /// Returns the underlying device. QIODevice *getIoDevice() const; /// Returns true. virtual bool isSequential() const; /// Returns true iff the end of the compressed stream is reached. virtual bool atEnd() const; /// Returns the number of the bytes buffered. virtual qint64 bytesAvailable() const; protected: /// Implementation of QIODevice::readData(). virtual qint64 readData(char *data, qint64 maxSize); /// Implementation of QIODevice::writeData(). virtual qint64 writeData(const char *data, qint64 maxSize); private: QuaZIODevicePrivate *d; }; #endif // QUAZIP_QUAZIODEVICE_H tea-qt-47.1.0/quazip.cpp000066400000000000000000000524301346332167200150260ustar00rootroot00000000000000/* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant, see quazip/(un)zip.h files for details, basically it's zlib license. **/ #include #include #include #include "quazip.h" /// All the internal stuff for the QuaZip class. /** \internal This class keeps all the private stuff for the QuaZip class so it can be changed without breaking binary compatibility, according to the Pimpl idiom. */ class QuaZipPrivate { friend class QuaZip; private: Q_DISABLE_COPY(QuaZipPrivate) /// The pointer to the corresponding QuaZip instance. QuaZip *q; /// The codec for file names. QTextCodec *fileNameCodec; /// The codec for comments. QTextCodec *commentCodec; /// The archive file name. QString zipName; /// The device to access the archive. QIODevice *ioDevice; /// The global comment. QString comment; /// The open mode. QuaZip::Mode mode; union { /// The internal handle for UNZIP modes. unzFile unzFile_f; /// The internal handle for ZIP modes. zipFile zipFile_f; }; /// Whether a current file is set. bool hasCurrentFile_f; /// The last error. int zipError; /// Whether \ref QuaZip::setDataDescriptorWritingEnabled() "the data descriptor writing mode" is enabled. bool dataDescriptorWritingEnabled; /// The zip64 mode. bool zip64; /// The auto-close flag. bool autoClose; inline QTextCodec *getDefaultFileNameCodec() { if (defaultFileNameCodec == NULL) { return QTextCodec::codecForLocale(); } else { return defaultFileNameCodec; } } /// The constructor for the corresponding QuaZip constructor. inline QuaZipPrivate(QuaZip *q1): q(q1), fileNameCodec(getDefaultFileNameCodec()), commentCodec(QTextCodec::codecForLocale()), ioDevice(NULL), mode(QuaZip::mdNotOpen), hasCurrentFile_f(false), zipError(UNZ_OK), dataDescriptorWritingEnabled(true), zip64(false), autoClose(true) { unzFile_f = NULL; zipFile_f = NULL; lastMappedDirectoryEntry.num_of_file = 0; lastMappedDirectoryEntry.pos_in_zip_directory = 0; } /// The constructor for the corresponding QuaZip constructor. inline QuaZipPrivate(QuaZip *q1, const QString &zipName): q(q1), fileNameCodec(getDefaultFileNameCodec()), commentCodec(QTextCodec::codecForLocale()), zipName(zipName), ioDevice(NULL), mode(QuaZip::mdNotOpen), hasCurrentFile_f(false), zipError(UNZ_OK), dataDescriptorWritingEnabled(true), zip64(false), autoClose(true) { unzFile_f = NULL; zipFile_f = NULL; lastMappedDirectoryEntry.num_of_file = 0; lastMappedDirectoryEntry.pos_in_zip_directory = 0; } /// The constructor for the corresponding QuaZip constructor. inline QuaZipPrivate(QuaZip *q1, QIODevice *ioDevice): q(q1), fileNameCodec(getDefaultFileNameCodec()), commentCodec(QTextCodec::codecForLocale()), ioDevice(ioDevice), mode(QuaZip::mdNotOpen), hasCurrentFile_f(false), zipError(UNZ_OK), dataDescriptorWritingEnabled(true), zip64(false), autoClose(true) { unzFile_f = NULL; zipFile_f = NULL; lastMappedDirectoryEntry.num_of_file = 0; lastMappedDirectoryEntry.pos_in_zip_directory = 0; } /// Returns either a list of file names or a list of QuaZipFileInfo. template bool getFileInfoList(QList *result) const; /// Stores map of filenames and file locations for unzipping inline void clearDirectoryMap(); inline void addCurrentFileToDirectoryMap(const QString &fileName); bool goToFirstUnmappedFile(); QHash directoryCaseSensitive; QHash directoryCaseInsensitive; unz64_file_pos lastMappedDirectoryEntry; static QTextCodec *defaultFileNameCodec; }; QTextCodec *QuaZipPrivate::defaultFileNameCodec = NULL; void QuaZipPrivate::clearDirectoryMap() { directoryCaseInsensitive.clear(); directoryCaseSensitive.clear(); lastMappedDirectoryEntry.num_of_file = 0; lastMappedDirectoryEntry.pos_in_zip_directory = 0; } void QuaZipPrivate::addCurrentFileToDirectoryMap(const QString &fileName) { if (!hasCurrentFile_f || fileName.isEmpty()) { return; } // Adds current file to filename map as fileName unz64_file_pos fileDirectoryPos; unzGetFilePos64(unzFile_f, &fileDirectoryPos); directoryCaseSensitive.insert(fileName, fileDirectoryPos); // Only add lowercase to directory map if not already there // ensures only map the first one seen QString lower = fileName.toLower(); if (!directoryCaseInsensitive.contains(lower)) directoryCaseInsensitive.insert(lower, fileDirectoryPos); // Mark last one if (fileDirectoryPos.pos_in_zip_directory > lastMappedDirectoryEntry.pos_in_zip_directory) lastMappedDirectoryEntry = fileDirectoryPos; } bool QuaZipPrivate::goToFirstUnmappedFile() { zipError = UNZ_OK; if (mode != QuaZip::mdUnzip) { qWarning("QuaZipPrivate::goToNextUnmappedFile(): ZIP is not open in mdUnzip mode"); return false; } // If not mapped anything, go to beginning if (lastMappedDirectoryEntry.pos_in_zip_directory == 0) { unzGoToFirstFile(unzFile_f); } else { // Goto the last one mapped, plus one unzGoToFilePos64(unzFile_f, &lastMappedDirectoryEntry); unzGoToNextFile(unzFile_f); } hasCurrentFile_f=zipError==UNZ_OK; if(zipError==UNZ_END_OF_LIST_OF_FILE) zipError=UNZ_OK; return hasCurrentFile_f; } QuaZip::QuaZip(): p(new QuaZipPrivate(this)) { } QuaZip::QuaZip(const QString& zipName): p(new QuaZipPrivate(this, zipName)) { } QuaZip::QuaZip(QIODevice *ioDevice): p(new QuaZipPrivate(this, ioDevice)) { } QuaZip::~QuaZip() { if(isOpen()) close(); delete p; } bool QuaZip::open(Mode mode, zlib_filefunc_def* ioApi) { p->zipError=UNZ_OK; if(isOpen()) { qWarning("QuaZip::open(): ZIP already opened"); return false; } QIODevice *ioDevice = p->ioDevice; if (ioDevice == NULL) { if (p->zipName.isEmpty()) { qWarning("QuaZip::open(): set either ZIP file name or IO device first"); return false; } else { ioDevice = new QFile(p->zipName); } } unsigned flags = 0; switch(mode) { case mdUnzip: if (ioApi == NULL) { if (p->autoClose) flags |= UNZ_AUTO_CLOSE; p->unzFile_f=unzOpenInternal(ioDevice, NULL, 1, flags); } else { // QuaZIP pre-zip64 compatibility mode p->unzFile_f=unzOpen2(ioDevice, ioApi); if (p->unzFile_f != NULL) { if (p->autoClose) { unzSetFlags(p->unzFile_f, UNZ_AUTO_CLOSE); } else { unzClearFlags(p->unzFile_f, UNZ_AUTO_CLOSE); } } } if(p->unzFile_f!=NULL) { if (ioDevice->isSequential()) { unzClose(p->unzFile_f); if (!p->zipName.isEmpty()) delete ioDevice; qWarning("QuaZip::open(): " "only mdCreate can be used with " "sequential devices"); return false; } p->mode=mode; p->ioDevice = ioDevice; return true; } else { p->zipError=UNZ_OPENERROR; if (!p->zipName.isEmpty()) delete ioDevice; return false; } case mdCreate: case mdAppend: case mdAdd: if (ioApi == NULL) { if (p->autoClose) flags |= ZIP_AUTO_CLOSE; if (p->dataDescriptorWritingEnabled) flags |= ZIP_WRITE_DATA_DESCRIPTOR; p->zipFile_f=zipOpen3(ioDevice, mode==mdCreate?APPEND_STATUS_CREATE: mode==mdAppend?APPEND_STATUS_CREATEAFTER: APPEND_STATUS_ADDINZIP, NULL, NULL, flags); } else { // QuaZIP pre-zip64 compatibility mode p->zipFile_f=zipOpen2(ioDevice, mode==mdCreate?APPEND_STATUS_CREATE: mode==mdAppend?APPEND_STATUS_CREATEAFTER: APPEND_STATUS_ADDINZIP, NULL, ioApi); if (p->zipFile_f != NULL) { zipSetFlags(p->zipFile_f, flags); } } if(p->zipFile_f!=NULL) { if (ioDevice->isSequential()) { if (mode != mdCreate) { zipClose(p->zipFile_f, NULL); qWarning("QuaZip::open(): " "only mdCreate can be used with " "sequential devices"); if (!p->zipName.isEmpty()) delete ioDevice; return false; } zipSetFlags(p->zipFile_f, ZIP_SEQUENTIAL); } p->mode=mode; p->ioDevice = ioDevice; return true; } else { p->zipError=UNZ_OPENERROR; if (!p->zipName.isEmpty()) delete ioDevice; return false; } default: qWarning("QuaZip::open(): unknown mode: %d", (int)mode); if (!p->zipName.isEmpty()) delete ioDevice; return false; break; } } void QuaZip::close() { p->zipError=UNZ_OK; switch(p->mode) { case mdNotOpen: qWarning("QuaZip::close(): ZIP is not open"); return; case mdUnzip: p->zipError=unzClose(p->unzFile_f); break; case mdCreate: case mdAppend: case mdAdd: p->zipError=zipClose(p->zipFile_f, p->comment.isNull() ? NULL : p->commentCodec->fromUnicode(p->comment).constData()); break; default: qWarning("QuaZip::close(): unknown mode: %d", (int)p->mode); return; } // opened by name, need to delete the internal IO device if (!p->zipName.isEmpty()) { delete p->ioDevice; p->ioDevice = NULL; } p->clearDirectoryMap(); if(p->zipError==UNZ_OK) p->mode=mdNotOpen; } void QuaZip::setZipName(const QString& zipName) { if(isOpen()) { qWarning("QuaZip::setZipName(): ZIP is already open!"); return; } p->zipName=zipName; p->ioDevice = NULL; } void QuaZip::setIoDevice(QIODevice *ioDevice) { if(isOpen()) { qWarning("QuaZip::setIoDevice(): ZIP is already open!"); return; } p->ioDevice = ioDevice; p->zipName = QString(); } int QuaZip::getEntriesCount()const { QuaZip *fakeThis=(QuaZip*)this; // non-const fakeThis->p->zipError=UNZ_OK; if(p->mode!=mdUnzip) { qWarning("QuaZip::getEntriesCount(): ZIP is not open in mdUnzip mode"); return -1; } unz_global_info64 globalInfo; if((fakeThis->p->zipError=unzGetGlobalInfo64(p->unzFile_f, &globalInfo))!=UNZ_OK) return p->zipError; return (int)globalInfo.number_entry; } QString QuaZip::getComment()const { QuaZip *fakeThis=(QuaZip*)this; // non-const fakeThis->p->zipError=UNZ_OK; if(p->mode!=mdUnzip) { qWarning("QuaZip::getComment(): ZIP is not open in mdUnzip mode"); return QString(); } unz_global_info64 globalInfo; QByteArray comment; if((fakeThis->p->zipError=unzGetGlobalInfo64(p->unzFile_f, &globalInfo))!=UNZ_OK) return QString(); comment.resize(globalInfo.size_comment); if((fakeThis->p->zipError=unzGetGlobalComment(p->unzFile_f, comment.data(), comment.size())) < 0) return QString(); fakeThis->p->zipError = UNZ_OK; return p->commentCodec->toUnicode(comment); } bool QuaZip::setCurrentFile(const QString& fileName, CaseSensitivity cs) { p->zipError=UNZ_OK; if(p->mode!=mdUnzip) { qWarning("QuaZip::setCurrentFile(): ZIP is not open in mdUnzip mode"); return false; } if(fileName.isEmpty()) { p->hasCurrentFile_f=false; return true; } // Unicode-aware reimplementation of the unzLocateFile function if(p->unzFile_f==NULL) { p->zipError=UNZ_PARAMERROR; return false; } if(fileName.length()>MAX_FILE_NAME_LENGTH) { p->zipError=UNZ_PARAMERROR; return false; } // Find the file by name bool sens = convertCaseSensitivity(cs) == Qt::CaseSensitive; QString lower, current; if(!sens) lower=fileName.toLower(); p->hasCurrentFile_f=false; // Check the appropriate Map unz64_file_pos fileDirPos; fileDirPos.pos_in_zip_directory = 0; if (sens) { if (p->directoryCaseSensitive.contains(fileName)) fileDirPos = p->directoryCaseSensitive.value(fileName); } else { if (p->directoryCaseInsensitive.contains(lower)) fileDirPos = p->directoryCaseInsensitive.value(lower); } if (fileDirPos.pos_in_zip_directory != 0) { p->zipError = unzGoToFilePos64(p->unzFile_f, &fileDirPos); p->hasCurrentFile_f = p->zipError == UNZ_OK; } if (p->hasCurrentFile_f) return p->hasCurrentFile_f; // Not mapped yet, start from where we have got to so far for(bool more=p->goToFirstUnmappedFile(); more; more=goToNextFile()) { current=getCurrentFileName(); if(current.isEmpty()) return false; if(sens) { if(current==fileName) break; } else { if(current.toLower()==lower) break; } } return p->hasCurrentFile_f; } bool QuaZip::goToFirstFile() { p->zipError=UNZ_OK; if(p->mode!=mdUnzip) { qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode"); return false; } p->zipError=unzGoToFirstFile(p->unzFile_f); p->hasCurrentFile_f=p->zipError==UNZ_OK; return p->hasCurrentFile_f; } bool QuaZip::goToNextFile() { p->zipError=UNZ_OK; if(p->mode!=mdUnzip) { qWarning("QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode"); return false; } p->zipError=unzGoToNextFile(p->unzFile_f); p->hasCurrentFile_f=p->zipError==UNZ_OK; if(p->zipError==UNZ_END_OF_LIST_OF_FILE) p->zipError=UNZ_OK; return p->hasCurrentFile_f; } bool QuaZip::getCurrentFileInfo(QuaZipFileInfo *info)const { QuaZipFileInfo64 info64; if (info == NULL) { // Very unlikely because of the overloads return false; } if (getCurrentFileInfo(&info64)) { info64.toQuaZipFileInfo(*info); return true; } else { return false; } } bool QuaZip::getCurrentFileInfo(QuaZipFileInfo64 *info)const { QuaZip *fakeThis=(QuaZip*)this; // non-const fakeThis->p->zipError=UNZ_OK; if(p->mode!=mdUnzip) { qWarning("QuaZip::getCurrentFileInfo(): ZIP is not open in mdUnzip mode"); return false; } unz_file_info64 info_z; QByteArray fileName; QByteArray extra; QByteArray comment; if(info==NULL) return false; if(!isOpen()||!hasCurrentFile()) return false; if((fakeThis->p->zipError=unzGetCurrentFileInfo64(p->unzFile_f, &info_z, NULL, 0, NULL, 0, NULL, 0))!=UNZ_OK) return false; fileName.resize(info_z.size_filename); extra.resize(info_z.size_file_extra); comment.resize(info_z.size_file_comment); if((fakeThis->p->zipError=unzGetCurrentFileInfo64(p->unzFile_f, NULL, fileName.data(), fileName.size(), extra.data(), extra.size(), comment.data(), comment.size()))!=UNZ_OK) return false; info->versionCreated=info_z.version; info->versionNeeded=info_z.version_needed; info->flags=info_z.flag; info->method=info_z.compression_method; info->crc=info_z.crc; info->compressedSize=info_z.compressed_size; info->uncompressedSize=info_z.uncompressed_size; info->diskNumberStart=info_z.disk_num_start; info->internalAttr=info_z.internal_fa; info->externalAttr=info_z.external_fa; info->name=p->fileNameCodec->toUnicode(fileName); info->comment=p->commentCodec->toUnicode(comment); info->extra=extra; info->dateTime=QDateTime( QDate(info_z.tmu_date.tm_year, info_z.tmu_date.tm_mon+1, info_z.tmu_date.tm_mday), QTime(info_z.tmu_date.tm_hour, info_z.tmu_date.tm_min, info_z.tmu_date.tm_sec)); // Add to directory map p->addCurrentFileToDirectoryMap(info->name); return true; } QString QuaZip::getCurrentFileName()const { QuaZip *fakeThis=(QuaZip*)this; // non-const fakeThis->p->zipError=UNZ_OK; if(p->mode!=mdUnzip) { qWarning("QuaZip::getCurrentFileName(): ZIP is not open in mdUnzip mode"); return QString(); } if(!isOpen()||!hasCurrentFile()) return QString(); QByteArray fileName(MAX_FILE_NAME_LENGTH, 0); if((fakeThis->p->zipError=unzGetCurrentFileInfo64(p->unzFile_f, NULL, fileName.data(), fileName.size(), NULL, 0, NULL, 0))!=UNZ_OK) return QString(); QString result = p->fileNameCodec->toUnicode(fileName.constData()); if (result.isEmpty()) return result; // Add to directory map p->addCurrentFileToDirectoryMap(result); return result; } void QuaZip::setFileNameCodec(QTextCodec *fileNameCodec) { p->fileNameCodec=fileNameCodec; } void QuaZip::setFileNameCodec(const char *fileNameCodecName) { p->fileNameCodec=QTextCodec::codecForName(fileNameCodecName); } QTextCodec *QuaZip::getFileNameCodec()const { return p->fileNameCodec; } void QuaZip::setCommentCodec(QTextCodec *commentCodec) { p->commentCodec=commentCodec; } void QuaZip::setCommentCodec(const char *commentCodecName) { p->commentCodec=QTextCodec::codecForName(commentCodecName); } QTextCodec *QuaZip::getCommentCodec()const { return p->commentCodec; } QString QuaZip::getZipName() const { return p->zipName; } QIODevice *QuaZip::getIoDevice() const { if (!p->zipName.isEmpty()) // opened by name, using an internal QIODevice return NULL; return p->ioDevice; } QuaZip::Mode QuaZip::getMode()const { return p->mode; } bool QuaZip::isOpen()const { return p->mode!=mdNotOpen; } int QuaZip::getZipError() const { return p->zipError; } void QuaZip::setComment(const QString& comment) { p->comment=comment; } bool QuaZip::hasCurrentFile()const { return p->hasCurrentFile_f; } unzFile QuaZip::getUnzFile() { return p->unzFile_f; } zipFile QuaZip::getZipFile() { return p->zipFile_f; } void QuaZip::setDataDescriptorWritingEnabled(bool enabled) { p->dataDescriptorWritingEnabled = enabled; } bool QuaZip::isDataDescriptorWritingEnabled() const { return p->dataDescriptorWritingEnabled; } template TFileInfo QuaZip_getFileInfo(QuaZip *zip, bool *ok); template<> QuaZipFileInfo QuaZip_getFileInfo(QuaZip *zip, bool *ok) { QuaZipFileInfo info; *ok = zip->getCurrentFileInfo(&info); return info; } template<> QuaZipFileInfo64 QuaZip_getFileInfo(QuaZip *zip, bool *ok) { QuaZipFileInfo64 info; *ok = zip->getCurrentFileInfo(&info); return info; } template<> QString QuaZip_getFileInfo(QuaZip *zip, bool *ok) { QString name = zip->getCurrentFileName(); *ok = !name.isEmpty(); return name; } template bool QuaZipPrivate::getFileInfoList(QList *result) const { QuaZipPrivate *fakeThis=const_cast(this); fakeThis->zipError=UNZ_OK; if (mode!=QuaZip::mdUnzip) { qWarning("QuaZip::getFileNameList/getFileInfoList(): " "ZIP is not open in mdUnzip mode"); return false; } QString currentFile; if (q->hasCurrentFile()) { currentFile = q->getCurrentFileName(); } if (q->goToFirstFile()) { do { bool ok; result->append(QuaZip_getFileInfo(q, &ok)); if (!ok) return false; } while (q->goToNextFile()); } if (zipError != UNZ_OK) return false; if (currentFile.isEmpty()) { if (!q->goToFirstFile()) return false; } else { if (!q->setCurrentFile(currentFile)) return false; } return true; } QStringList QuaZip::getFileNameList() const { QStringList list; if (p->getFileInfoList(&list)) return list; else return QStringList(); } QList QuaZip::getFileInfoList() const { QList list; if (p->getFileInfoList(&list)) return list; else return QList(); } QList QuaZip::getFileInfoList64() const { QList list; if (p->getFileInfoList(&list)) return list; else return QList(); } Qt::CaseSensitivity QuaZip::convertCaseSensitivity(QuaZip::CaseSensitivity cs) { if (cs == csDefault) { #ifdef Q_OS_WIN return Qt::CaseInsensitive; #else return Qt::CaseSensitive; #endif } else { return cs == csSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive; } } void QuaZip::setDefaultFileNameCodec(QTextCodec *codec) { QuaZipPrivate::defaultFileNameCodec = codec; } void QuaZip::setDefaultFileNameCodec(const char *codecName) { setDefaultFileNameCodec(QTextCodec::codecForName(codecName)); } void QuaZip::setZip64Enabled(bool zip64) { p->zip64 = zip64; } bool QuaZip::isZip64Enabled() const { return p->zip64; } bool QuaZip::isAutoClose() const { return p->autoClose; } void QuaZip::setAutoClose(bool autoClose) const { p->autoClose = autoClose; } tea-qt-47.1.0/quazip.h000066400000000000000000000613331346332167200144750ustar00rootroot00000000000000#ifndef QUA_ZIP_H #define QUA_ZIP_H /* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant, see quazip/(un)zip.h files for details, basically it's zlib license. **/ #include #include #include #include "zip.h" #include "unzip.h" #include "quazip_global.h" #include "quazipfileinfo.h" // just in case it will be defined in the later versions of the ZIP/UNZIP #ifndef UNZ_OPENERROR // define additional error code #define UNZ_OPENERROR -1000 #endif class QuaZipPrivate; /// ZIP archive. /** \class QuaZip quazip.h * This class implements basic interface to the ZIP archive. It can be * used to read table contents of the ZIP archive and retreiving * information about the files inside it. * * You can also use this class to open files inside archive by passing * pointer to the instance of this class to the constructor of the * QuaZipFile class. But see QuaZipFile::QuaZipFile(QuaZip*, QObject*) * for the possible pitfalls. * * This class is indended to provide interface to the ZIP subpackage of * the ZIP/UNZIP package as well as to the UNZIP subpackage. But * currently it supports only UNZIP. * * The use of this class is simple - just create instance using * constructor, then set ZIP archive file name using setFile() function * (if you did not passed the name to the constructor), then open() and * then use different functions to work with it! Well, if you are * paranoid, you may also wish to call close before destructing the * instance, to check for errors on close. * * You may also use getUnzFile() and getZipFile() functions to get the * ZIP archive handle and use it with ZIP/UNZIP package API directly. * * This class supports localized file names inside ZIP archive, but you * have to set up proper codec with setCodec() function. By default, * locale codec will be used, which is probably ok for UNIX systems, but * will almost certainly fail with ZIP archives created in Windows. This * is because Windows ZIP programs have strange habit of using DOS * encoding for file names in ZIP archives. For example, ZIP archive * with cyrillic names created in Windows will have file names in \c * IBM866 encoding instead of \c WINDOWS-1251. I think that calling one * function is not much trouble, but for true platform independency it * would be nice to have some mechanism for file name encoding auto * detection using locale information. Does anyone know a good way to do * it? **/ class QUAZIP_EXPORT QuaZip { friend class QuaZipPrivate; public: /// Useful constants. enum Constants { MAX_FILE_NAME_LENGTH=256 /**< Maximum file name length. Taken from \c UNZ_MAXFILENAMEINZIP constant in unzip.c. */ }; /// Open mode of the ZIP file. enum Mode { mdNotOpen, ///< ZIP file is not open. This is the initial mode. mdUnzip, ///< ZIP file is open for reading files inside it. mdCreate, ///< ZIP file was created with open() call. mdAppend, /**< ZIP file was opened in append mode. This refers to * \c APPEND_STATUS_CREATEAFTER mode in ZIP/UNZIP package * and means that zip is appended to some existing file * what is useful when that file contains * self-extractor code. This is obviously \em not what * you whant to use to add files to the existing ZIP * archive. **/ mdAdd ///< ZIP file was opened for adding files in the archive. }; /// Case sensitivity for the file names. /** This is what you specify when accessing files in the archive. * Works perfectly fine with any characters thanks to Qt's great * unicode support. This is different from ZIP/UNZIP API, where * only US-ASCII characters was supported. **/ enum CaseSensitivity { csDefault=0, ///< Default for platform. Case sensitive for UNIX, not for Windows. csSensitive=1, ///< Case sensitive. csInsensitive=2 ///< Case insensitive. }; /// Returns the actual case sensitivity for the specified QuaZIP one. /** \param cs The value to convert. \returns If CaseSensitivity::csDefault, then returns the default file name case sensitivity for the platform. Otherwise, just returns the appropriate value from the Qt::CaseSensitivity enum. */ static Qt::CaseSensitivity convertCaseSensitivity( CaseSensitivity cs); private: QuaZipPrivate *p; // not (and will not be) implemented QuaZip(const QuaZip& that); // not (and will not be) implemented QuaZip& operator=(const QuaZip& that); public: /// Constructs QuaZip object. /** Call setName() before opening constructed object. */ QuaZip(); /// Constructs QuaZip object associated with ZIP file \a zipName. QuaZip(const QString& zipName); /// Constructs QuaZip object associated with ZIP file represented by \a ioDevice. /** The IO device must be seekable, otherwise an error will occur when opening. */ QuaZip(QIODevice *ioDevice); /// Destroys QuaZip object. /** Calls close() if necessary. */ ~QuaZip(); /// Opens ZIP file. /** * Argument \a mode specifies open mode of the ZIP archive. See Mode * for details. Note that there is zipOpen2() function in the * ZIP/UNZIP API which accepts \a globalcomment argument, but it * does not use it anywhere, so this open() function does not have this * argument. See setComment() if you need to set global comment. * * If the ZIP file is accessed via explicitly set QIODevice, then * this device is opened in the necessary mode. If the device was * already opened by some other means, then QuaZIP checks if the * open mode is compatible to the mode needed for the requested operation. * If necessary, seeking is performed to position the device properly. * * \return \c true if successful, \c false otherwise. * * \note ZIP/UNZIP API open calls do not return error code - they * just return \c NULL indicating an error. But to make things * easier, quazip.h header defines additional error code \c * UNZ_ERROROPEN and getZipError() will return it if the open call * of the ZIP/UNZIP API returns \c NULL. * * Argument \a ioApi specifies IO function set for ZIP/UNZIP * package to use. See unzip.h, zip.h and ioapi.h for details. Note * that IO API for QuaZip is different from the original package. * The file path argument was changed to be of type \c voidpf, and * QuaZip passes a QIODevice pointer there. This QIODevice is either * set explicitly via setIoDevice() or the QuaZip(QIODevice*) * constructor, or it is created internally when opening the archive * by its file name. The default API (qioapi.cpp) just delegates * everything to the QIODevice API. Not only this allows to use a * QIODevice instead of file name, but also has a nice side effect * of raising the file size limit from 2G to 4G (in non-zip64 archives). * * \note If the zip64 support is needed, the ioApi argument \em must be NULL * because due to the backwards compatibility issues it can be used to * provide a 32-bit API only. * * \note If the \ref QuaZip::setAutoClose() "no-auto-close" feature is used, * then the \a ioApi argument \em should be NULL because the old API * doesn't support the 'fake close' operation, causing slight memory leaks * and other possible troubles (like closing the output device in case * when an error occurs during opening). * * In short: just forget about the \a ioApi argument and you'll be * fine. **/ bool open(Mode mode, zlib_filefunc_def *ioApi =NULL); /// Closes ZIP file. /** Call getZipError() to determine if the close was successful. * * If the file was opened by name, then the underlying QIODevice is closed * and deleted. * * If the underlying QIODevice was set explicitly using setIoDevice() or * the appropriate constructor, then it is closed if the auto-close flag * is set (which it is by default). Call setAutoClose() to clear the * auto-close flag if this behavior is undesirable. * * Since Qt 5.1, the QSaveFile was introduced. It breaks the QIODevice API * by making close() private and crashing the application if it is called * from the base class where it is public. It is an excellent example * of poor design that illustrates why you should never ever break * an is-a relationship between the base class and a subclass. QuaZIP * works around this bug by checking if the QIODevice is an instance * of QSaveFile, using qobject_cast<>, and if it is, calls * QSaveFile::commit() instead of close(). It is a really ugly hack, * but at least it makes your programs work instead of crashing. Note that * if the auto-close flag is cleared, then this is a non-issue, and * commit() isn't called. */ void close(); /// Sets the codec used to encode/decode file names inside archive. /** This is necessary to access files in the ZIP archive created * under Windows with non-latin characters in file names. For * example, file names with cyrillic letters will be in \c IBM866 * encoding. **/ void setFileNameCodec(QTextCodec *fileNameCodec); /// Sets the codec used to encode/decode file names inside archive. /** \overload * Equivalent to calling setFileNameCodec(QTextCodec::codecForName(codecName)); **/ void setFileNameCodec(const char *fileNameCodecName); /// Returns the codec used to encode/decode comments inside archive. QTextCodec* getFileNameCodec() const; /// Sets the codec used to encode/decode comments inside archive. /** This codec defaults to locale codec, which is probably ok. **/ void setCommentCodec(QTextCodec *commentCodec); /// Sets the codec used to encode/decode comments inside archive. /** \overload * Equivalent to calling setCommentCodec(QTextCodec::codecForName(codecName)); **/ void setCommentCodec(const char *commentCodecName); /// Returns the codec used to encode/decode comments inside archive. QTextCodec* getCommentCodec() const; /// Returns the name of the ZIP file. /** Returns null string if no ZIP file name has been set, for * example when the QuaZip instance is set up to use a QIODevice * instead. * \sa setZipName(), setIoDevice(), getIoDevice() **/ QString getZipName() const; /// Sets the name of the ZIP file. /** Does nothing if the ZIP file is open. * * Does not reset error code returned by getZipError(). * \sa setIoDevice(), getIoDevice(), getZipName() **/ void setZipName(const QString& zipName); /// Returns the device representing this ZIP file. /** Returns null string if no device has been set explicitly, for * example when opening a ZIP file by name. * \sa setIoDevice(), getZipName(), setZipName() **/ QIODevice *getIoDevice() const; /// Sets the device representing the ZIP file. /** Does nothing if the ZIP file is open. * * Does not reset error code returned by getZipError(). * \sa getIoDevice(), getZipName(), setZipName() **/ void setIoDevice(QIODevice *ioDevice); /// Returns the mode in which ZIP file was opened. Mode getMode() const; /// Returns \c true if ZIP file is open, \c false otherwise. bool isOpen() const; /// Returns the error code of the last operation. /** Returns \c UNZ_OK if the last operation was successful. * * Error code resets to \c UNZ_OK every time you call any function * that accesses something inside ZIP archive, even if it is \c * const (like getEntriesCount()). open() and close() calls reset * error code too. See documentation for the specific functions for * details on error detection. **/ int getZipError() const; /// Returns number of the entries in the ZIP central directory. /** Returns negative error code in the case of error. The same error * code will be returned by subsequent getZipError() call. **/ int getEntriesCount() const; /// Returns global comment in the ZIP file. QString getComment() const; /// Sets the global comment in the ZIP file. /** The comment will be written to the archive on close operation. * QuaZip makes a distinction between a null QByteArray() comment * and an empty "" comment in the QuaZip::mdAdd mode. * A null comment is the default and it means "don't change * the comment". An empty comment removes the original comment. * * \sa open() **/ void setComment(const QString& comment); /// Sets the current file to the first file in the archive. /** Returns \c true on success, \c false otherwise. Call * getZipError() to get the error code. **/ bool goToFirstFile(); /// Sets the current file to the next file in the archive. /** Returns \c true on success, \c false otherwise. Call * getZipError() to determine if there was an error. * * Should be used only in QuaZip::mdUnzip mode. * * \note If the end of file was reached, getZipError() will return * \c UNZ_OK instead of \c UNZ_END_OF_LIST_OF_FILE. This is to make * things like this easier: * \code * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) { * // do something * } * if(zip.getZipError()==UNZ_OK) { * // ok, there was no error * } * \endcode **/ bool goToNextFile(); /// Sets current file by its name. /** Returns \c true if successful, \c false otherwise. Argument \a * cs specifies case sensitivity of the file name. Call * getZipError() in the case of a failure to get error code. * * This is not a wrapper to unzLocateFile() function. That is * because I had to implement locale-specific case-insensitive * comparison. * * Here are the differences from the original implementation: * * - If the file was not found, error code is \c UNZ_OK, not \c * UNZ_END_OF_LIST_OF_FILE (see also goToNextFile()). * - If this function fails, it unsets the current file rather than * resetting it back to what it was before the call. * * If \a fileName is null string then this function unsets the * current file and return \c true. Note that you should close the * file first if it is open! See * QuaZipFile::QuaZipFile(QuaZip*,QObject*) for the details. * * Should be used only in QuaZip::mdUnzip mode. * * \sa setFileNameCodec(), CaseSensitivity **/ bool setCurrentFile(const QString& fileName, CaseSensitivity cs =csDefault); /// Returns \c true if the current file has been set. bool hasCurrentFile() const; /// Retrieves information about the current file. /** Fills the structure pointed by \a info. Returns \c true on * success, \c false otherwise. In the latter case structure pointed * by \a info remains untouched. If there was an error, * getZipError() returns error code. * * Should be used only in QuaZip::mdUnzip mode. * * Does nothing and returns \c false in any of the following cases. * - ZIP is not open; * - ZIP does not have current file. * * In both cases getZipError() returns \c UNZ_OK since there * is no ZIP/UNZIP API call. * * This overload doesn't support zip64, but will work OK on zip64 archives * except that if one of the sizes (compressed or uncompressed) is greater * than 0xFFFFFFFFu, it will be set to exactly 0xFFFFFFFFu. * * \sa getCurrentFileInfo(QuaZipFileInfo64* info)const * \sa QuaZipFileInfo64::toQuaZipFileInfo(QuaZipFileInfo&)const **/ bool getCurrentFileInfo(QuaZipFileInfo* info)const; /// Retrieves information about the current file. /** \overload * * This function supports zip64. If the archive doesn't use zip64, it is * completely equivalent to getCurrentFileInfo(QuaZipFileInfo* info) * except for the argument type. * * \sa **/ bool getCurrentFileInfo(QuaZipFileInfo64* info)const; /// Returns the current file name. /** Equivalent to calling getCurrentFileInfo() and then getting \c * name field of the QuaZipFileInfo structure, but faster and more * convenient. * * Should be used only in QuaZip::mdUnzip mode. **/ QString getCurrentFileName()const; /// Returns \c unzFile handle. /** You can use this handle to directly call UNZIP part of the * ZIP/UNZIP package functions (see unzip.h). * * \warning When using the handle returned by this function, please * keep in mind that QuaZip class is unable to detect any changes * you make in the ZIP file state (e. g. changing current file, or * closing the handle). So please do not do anything with this * handle that is possible to do with the functions of this class. * Or at least return the handle in the original state before * calling some another function of this class (including implicit * destructor calls and calls from the QuaZipFile objects that refer * to this QuaZip instance!). So if you have changed the current * file in the ZIP archive - then change it back or you may * experience some strange behavior or even crashes. **/ unzFile getUnzFile(); /// Returns \c zipFile handle. /** You can use this handle to directly call ZIP part of the * ZIP/UNZIP package functions (see zip.h). Warnings about the * getUnzFile() function also apply to this function. **/ zipFile getZipFile(); /// Changes the data descriptor writing mode. /** According to the ZIP format specification, a file inside archive may have a data descriptor immediately following the file data. This is reflected by a special flag in the local file header and in the central directory. By default, QuaZIP sets this flag and writes the data descriptor unless both method and level were set to 0, in which case it operates in 1.0-compatible mode and never writes data descriptors. By setting this flag to false, it is possible to disable data descriptor writing, thus increasing compatibility with archive readers that don't understand this feature of the ZIP file format. Setting this flag affects all the QuaZipFile instances that are opened after this flag is set. The data descriptor writing mode is enabled by default. Note that if the ZIP archive is written into a QIODevice for which QIODevice::isSequential() returns \c true, then the data descriptor is mandatory and will be written even if this flag is set to false. \param enabled If \c true, enable local descriptor writing, disable it otherwise. \sa QuaZipFile::isDataDescriptorWritingEnabled() */ void setDataDescriptorWritingEnabled(bool enabled); /// Returns the data descriptor default writing mode. /** \sa setDataDescriptorWritingEnabled() */ bool isDataDescriptorWritingEnabled() const; /// Returns a list of files inside the archive. /** \return A list of file names or an empty list if there was an error or if the archive is empty (call getZipError() to figure out which). \sa getFileInfoList() */ QStringList getFileNameList() const; /// Returns information list about all files inside the archive. /** \return A list of QuaZipFileInfo objects or an empty list if there was an error or if the archive is empty (call getZipError() to figure out which). This function doesn't support zip64, but will still work with zip64 archives, converting results using QuaZipFileInfo64::toQuaZipFileInfo(). If all file sizes are below 4 GB, it will work just fine. \sa getFileNameList() \sa getFileInfoList64() */ QList getFileInfoList() const; /// Returns information list about all files inside the archive. /** \overload This function supports zip64. \sa getFileNameList() \sa getFileInfoList() */ QList getFileInfoList64() const; /// Enables the zip64 mode. /** * @param zip64 If \c true, the zip64 mode is enabled, disabled otherwise. * * Once this is enabled, all new files (until the mode is disabled again) * will be created in the zip64 mode, thus enabling the ability to write * files larger than 4 GB. By default, the zip64 mode is off due to * compatibility reasons. * * Note that this does not affect the ability to read zip64 archives in any * way. * * \sa isZip64Enabled() */ void setZip64Enabled(bool zip64); /// Returns whether the zip64 mode is enabled. /** * @return \c true if and only if the zip64 mode is enabled. * * \sa setZip64Enabled() */ bool isZip64Enabled() const; /// Returns the auto-close flag. /** @sa setAutoClose() */ bool isAutoClose() const; /// Sets or unsets the auto-close flag. /** By default, QuaZIP opens the underlying QIODevice when open() is called, and closes it when close() is called. In some cases, when the device is set explicitly using setIoDevice(), it may be desirable to leave the device open. If the auto-close flag is unset using this method, then the device isn't closed automatically if it was set explicitly. If it is needed to clear this flag, it is recommended to do so before opening the archive because otherwise QuaZIP may close the device during the open() call if an error is encountered after the device is opened. If the device was not set explicitly, but rather the setZipName() or the appropriate constructor was used to set the ZIP file name instead, then the auto-close flag has no effect, and the internal device is closed nevertheless because there is no other way to close it. @sa isAutoClose() @sa setIoDevice() */ void setAutoClose(bool autoClose) const; /// Sets the default file name codec to use. /** * The default codec is used by the constructors, so calling this function * won't affect the QuaZip instances already created at that moment. * * The codec specified here can be overriden by calling setFileNameCodec(). * If neither function is called, QTextCodec::codecForLocale() will be used * to decode or encode file names. Use this function with caution if * the application uses other libraries that depend on QuaZIP. Those * libraries can either call this function by themselves, thus overriding * your setting or can rely on the default encoding, thus failing * mysteriously if you change it. For these reasons, it isn't recommended * to use this function if you are developing a library, not an application. * Instead, ask your library users to call it in case they need specific * encoding. * * In most cases, using setFileNameCodec() instead is the right choice. * However, if you depend on third-party code that uses QuaZIP, then the * reasons stated above can actually become a reason to use this function * in case the third-party code in question fails because it doesn't * understand the encoding you need and doesn't provide a way to specify it. * This applies to the JlCompress class as well, as it was contributed and * doesn't support explicit encoding parameters. * * In short: use setFileNameCodec() when you can, resort to * setDefaultFileNameCodec() when you don't have access to the QuaZip * instance. * * @param codec The codec to use by default. If NULL, resets to default. */ static void setDefaultFileNameCodec(QTextCodec *codec); /** * @overload * Equivalent to calling * setDefltFileNameCodec(QTextCodec::codecForName(codecName)). */ static void setDefaultFileNameCodec(const char *codecName); }; #endif tea-qt-47.1.0/quazip_global.h000066400000000000000000000033301346332167200160060ustar00rootroot00000000000000#ifndef QUAZIP_GLOBAL_H #define QUAZIP_GLOBAL_H /* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include /** This is automatically defined when building a static library, but when including QuaZip sources directly into a project, QUAZIP_STATIC should be defined explicitly to avoid possible troubles with unnecessary importing/exporting. */ #ifdef QUAZIP_STATIC #define QUAZIP_EXPORT #else /** * When building a DLL with MSVC, QUAZIP_BUILD must be defined. * qglobal.h takes care of defining Q_DECL_* correctly for msvc/gcc. */ #if defined(QUAZIP_BUILD) #define QUAZIP_EXPORT Q_DECL_EXPORT #else #define QUAZIP_EXPORT Q_DECL_IMPORT #endif #endif // QUAZIP_STATIC #ifdef __GNUC__ #define QUAZIP_UNUSED __attribute__((__unused__)) #else #define QUAZIP_UNUSED #endif #define QUAZIP_EXTRA_NTFS_MAGIC 0x000Au #define QUAZIP_EXTRA_NTFS_TIME_MAGIC 0x0001u #endif // QUAZIP_GLOBAL_H tea-qt-47.1.0/quazipdir.cpp000066400000000000000000000400111346332167200155150ustar00rootroot00000000000000/* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include "quazipdir.h" #include #include #include /// \cond internal class QuaZipDirPrivate: public QSharedData { friend class QuaZipDir; private: QuaZipDirPrivate(QuaZip *zip, const QString &dir = QString()): zip(zip), dir(dir), caseSensitivity(QuaZip::csDefault), filter(QDir::NoFilter), sorting(QDir::NoSort) {} QuaZip *zip; QString dir; QuaZip::CaseSensitivity caseSensitivity; QDir::Filters filter; QStringList nameFilters; QDir::SortFlags sorting; template bool entryInfoList(QStringList nameFilters, QDir::Filters filter, QDir::SortFlags sort, TFileInfoList &result) const; inline QString simplePath() const {return QDir::cleanPath(dir);} }; /// \endcond QuaZipDir::QuaZipDir(const QuaZipDir &that): d(that.d) { } QuaZipDir::QuaZipDir(QuaZip *zip, const QString &dir): d(new QuaZipDirPrivate(zip, dir)) { if (d->dir.startsWith('/')) d->dir = d->dir.mid(1); } QuaZipDir::~QuaZipDir() { } bool QuaZipDir::operator==(const QuaZipDir &that) { return d->zip == that.d->zip && d->dir == that.d->dir; } QuaZipDir& QuaZipDir::operator=(const QuaZipDir &that) { this->d = that.d; return *this; } QString QuaZipDir::operator[](int pos) const { return entryList().at(pos); } QuaZip::CaseSensitivity QuaZipDir::caseSensitivity() const { return d->caseSensitivity; } bool QuaZipDir::cd(const QString &directoryName) { if (directoryName == "/") { d->dir = ""; return true; } QString dirName = directoryName; if (dirName.endsWith('/')) dirName.chop(1); if (dirName.contains('/')) { QuaZipDir dir(*this); if (dirName.startsWith('/')) { #ifdef QUAZIP_QUAZIPDIR_DEBUG qDebug("QuaZipDir::cd(%s): going to /", dirName.toUtf8().constData()); #endif if (!dir.cd("/")) return false; } QStringList path = dirName.split('/', QString::SkipEmptyParts); for (QStringList::const_iterator i = path.constBegin(); i != path.end(); ++i) { const QString &step = *i; #ifdef QUAZIP_QUAZIPDIR_DEBUG qDebug("QuaZipDir::cd(%s): going to %s", dirName.toUtf8().constData(), step.toUtf8().constData()); #endif if (!dir.cd(step)) return false; } d->dir = dir.path(); return true; } else { // no '/' if (dirName == ".") { return true; } else if (dirName == "..") { if (isRoot()) { return false; } else { int slashPos = d->dir.lastIndexOf('/'); if (slashPos == -1) { d->dir = ""; } else { d->dir = d->dir.left(slashPos); } return true; } } else { // a simple subdirectory if (exists(dirName)) { if (isRoot()) d->dir = dirName; else d->dir += "/" + dirName; return true; } else { return false; } } } } bool QuaZipDir::cdUp() { return cd(".."); } uint QuaZipDir::count() const { return entryList().count(); } QString QuaZipDir::dirName() const { return QDir(d->dir).dirName(); } QuaZipFileInfo64 QuaZipDir_getFileInfo(QuaZip *zip, bool *ok, const QString &relativeName, bool isReal) { QuaZipFileInfo64 info; if (isReal) { *ok = zip->getCurrentFileInfo(&info); } else { *ok = true; info.compressedSize = 0; info.crc = 0; info.diskNumberStart = 0; info.externalAttr = 0; info.flags = 0; info.internalAttr = 0; info.method = 0; info.uncompressedSize = 0; info.versionCreated = info.versionNeeded = 0; } info.name = relativeName; return info; } static void QuaZipDir_convertInfoList(const QList &from, QList &to) { to = from; } static void QuaZipDir_convertInfoList(const QList &from, QStringList &to) { to.clear(); for (QList::const_iterator i = from.constBegin(); i != from.constEnd(); ++i) { to.append(i->name); } } static void QuaZipDir_convertInfoList(const QList &from, QList &to) { to.clear(); for (QList::const_iterator i = from.constBegin(); i != from.constEnd(); ++i) { QuaZipFileInfo info32; i->toQuaZipFileInfo(info32); to.append(info32); } } /// \cond internal /** An utility class to restore the current file. */ class QuaZipDirRestoreCurrent { public: inline QuaZipDirRestoreCurrent(QuaZip *zip): zip(zip), currentFile(zip->getCurrentFileName()) {} inline ~QuaZipDirRestoreCurrent() { zip->setCurrentFile(currentFile); } private: QuaZip *zip; QString currentFile; }; /// \endcond /// \cond internal class QuaZipDirComparator { private: QDir::SortFlags sort; static QString getExtension(const QString &name); int compareStrings(const QString &string1, const QString &string2); public: inline QuaZipDirComparator(QDir::SortFlags sort): sort(sort) {} bool operator()(const QuaZipFileInfo64 &info1, const QuaZipFileInfo64 &info2); }; QString QuaZipDirComparator::getExtension(const QString &name) { if (name.endsWith('.') || name.indexOf('.', 1) == -1) { return ""; } else { return name.mid(name.lastIndexOf('.') + 1); } } int QuaZipDirComparator::compareStrings(const QString &string1, const QString &string2) { if (sort & QDir::LocaleAware) { if (sort & QDir::IgnoreCase) { return string1.toLower().localeAwareCompare(string2.toLower()); } else { return string1.localeAwareCompare(string2); } } else { return string1.compare(string2, (sort & QDir::IgnoreCase) ? Qt::CaseInsensitive : Qt::CaseSensitive); } } bool QuaZipDirComparator::operator()(const QuaZipFileInfo64 &info1, const QuaZipFileInfo64 &info2) { QDir::SortFlags order = sort & (QDir::Name | QDir::Time | QDir::Size | QDir::Type); if ((sort & QDir::DirsFirst) == QDir::DirsFirst || (sort & QDir::DirsLast) == QDir::DirsLast) { if (info1.name.endsWith('/') && !info2.name.endsWith('/')) return (sort & QDir::DirsFirst) == QDir::DirsFirst; else if (!info1.name.endsWith('/') && info2.name.endsWith('/')) return (sort & QDir::DirsLast) == QDir::DirsLast; } bool result; int extDiff; switch (order) { case QDir::Name: result = compareStrings(info1.name, info2.name) < 0; break; case QDir::Type: extDiff = compareStrings(getExtension(info1.name), getExtension(info2.name)); if (extDiff == 0) { result = compareStrings(info1.name, info2.name) < 0; } else { result = extDiff < 0; } break; case QDir::Size: if (info1.uncompressedSize == info2.uncompressedSize) { result = compareStrings(info1.name, info2.name) < 0; } else { result = info1.uncompressedSize < info2.uncompressedSize; } break; case QDir::Time: if (info1.dateTime == info2.dateTime) { result = compareStrings(info1.name, info2.name) < 0; } else { result = info1.dateTime < info2.dateTime; } break; default: qWarning("QuaZipDirComparator(): Invalid sort mode 0x%2X", static_cast(sort)); return false; } return (sort & QDir::Reversed) ? !result : result; } template bool QuaZipDirPrivate::entryInfoList(QStringList nameFilters, QDir::Filters filter, QDir::SortFlags sort, TFileInfoList &result) const { QString basePath = simplePath(); if (!basePath.isEmpty()) basePath += "/"; int baseLength = basePath.length(); result.clear(); QuaZipDirRestoreCurrent saveCurrent(zip); if (!zip->goToFirstFile()) { return zip->getZipError() == UNZ_OK; } QDir::Filters fltr = filter; if (fltr == QDir::NoFilter) fltr = this->filter; if (fltr == QDir::NoFilter) fltr = QDir::AllEntries; QStringList nmfltr = nameFilters; if (nmfltr.isEmpty()) nmfltr = this->nameFilters; QSet dirsFound; QList list; do { QString name = zip->getCurrentFileName(); if (!name.startsWith(basePath)) continue; QString relativeName = name.mid(baseLength); if (relativeName.isEmpty()) continue; bool isDir = false; bool isReal = true; if (relativeName.contains('/')) { int indexOfSlash = relativeName.indexOf('/'); // something like "subdir/" isReal = indexOfSlash == relativeName.length() - 1; relativeName = relativeName.left(indexOfSlash + 1); if (dirsFound.contains(relativeName)) continue; isDir = true; } dirsFound.insert(relativeName); if ((fltr & QDir::Dirs) == 0 && isDir) continue; if ((fltr & QDir::Files) == 0 && !isDir) continue; if (!nmfltr.isEmpty() && !QDir::match(nmfltr, relativeName)) continue; bool ok; QuaZipFileInfo64 info = QuaZipDir_getFileInfo(zip, &ok, relativeName, isReal); if (!ok) { return false; } list.append(info); } while (zip->goToNextFile()); QDir::SortFlags srt = sort; if (srt == QDir::NoSort) srt = sorting; #ifdef QUAZIP_QUAZIPDIR_DEBUG qDebug("QuaZipDirPrivate::entryInfoList(): before sort:"); foreach (QuaZipFileInfo64 info, list) { qDebug("%s\t%s", info.name.toUtf8().constData(), info.dateTime.toString(Qt::ISODate).toUtf8().constData()); } #endif if (srt != QDir::NoSort && (srt & QDir::Unsorted) != QDir::Unsorted) { if (QuaZip::convertCaseSensitivity(caseSensitivity) == Qt::CaseInsensitive) srt |= QDir::IgnoreCase; QuaZipDirComparator lessThan(srt); //qSort(list.begin(), list.end(), lessThan); std::sort(list.begin(), list.end(), lessThan); } QuaZipDir_convertInfoList(list, result); return true; } /// \endcond QList QuaZipDir::entryInfoList(const QStringList &nameFilters, QDir::Filters filters, QDir::SortFlags sort) const { QList result; if (d->entryInfoList(nameFilters, filters, sort, result)) return result; else return QList(); } QList QuaZipDir::entryInfoList(QDir::Filters filters, QDir::SortFlags sort) const { return entryInfoList(QStringList(), filters, sort); } QList QuaZipDir::entryInfoList64(const QStringList &nameFilters, QDir::Filters filters, QDir::SortFlags sort) const { QList result; if (d->entryInfoList(nameFilters, filters, sort, result)) return result; else return QList(); } QList QuaZipDir::entryInfoList64(QDir::Filters filters, QDir::SortFlags sort) const { return entryInfoList64(QStringList(), filters, sort); } QStringList QuaZipDir::entryList(const QStringList &nameFilters, QDir::Filters filters, QDir::SortFlags sort) const { QStringList result; if (d->entryInfoList(nameFilters, filters, sort, result)) return result; else return QStringList(); } QStringList QuaZipDir::entryList(QDir::Filters filters, QDir::SortFlags sort) const { return entryList(QStringList(), filters, sort); } bool QuaZipDir::exists(const QString &filePath) const { if (filePath == "/" || filePath.isEmpty()) return true; QString fileName = filePath; if (fileName.endsWith('/')) fileName.chop(1); if (fileName.contains('/')) { QFileInfo fileInfo(fileName); #ifdef QUAZIP_QUAZIPDIR_DEBUG qDebug("QuaZipDir::exists(): fileName=%s, fileInfo.fileName()=%s, " "fileInfo.path()=%s", fileName.toUtf8().constData(), fileInfo.fileName().toUtf8().constData(), fileInfo.path().toUtf8().constData()); #endif QuaZipDir dir(*this); return dir.cd(fileInfo.path()) && dir.exists(fileInfo.fileName()); } else { if (fileName == "..") { return !isRoot(); } else if (fileName == ".") { return true; } else { QStringList entries = entryList(QDir::AllEntries, QDir::NoSort); #ifdef QUAZIP_QUAZIPDIR_DEBUG qDebug("QuaZipDir::exists(): looking for %s", fileName.toUtf8().constData()); for (QStringList::const_iterator i = entries.constBegin(); i != entries.constEnd(); ++i) { qDebug("QuaZipDir::exists(): entry: %s", i->toUtf8().constData()); } #endif Qt::CaseSensitivity cs = QuaZip::convertCaseSensitivity( d->caseSensitivity); if (filePath.endsWith('/')) { return entries.contains(filePath, cs); } else { return entries.contains(fileName, cs) || entries.contains(fileName + "/", cs); } } } } bool QuaZipDir::exists() const { return QuaZipDir(d->zip).exists(d->dir); } QString QuaZipDir::filePath(const QString &fileName) const { return QDir(d->dir).filePath(fileName); } QDir::Filters QuaZipDir::filter() { return d->filter; } bool QuaZipDir::isRoot() const { return d->simplePath().isEmpty(); } QStringList QuaZipDir::nameFilters() const { return d->nameFilters; } QString QuaZipDir::path() const { return d->dir; } QString QuaZipDir::relativeFilePath(const QString &fileName) const { return QDir("/" + d->dir).relativeFilePath(fileName); } void QuaZipDir::setCaseSensitivity(QuaZip::CaseSensitivity caseSensitivity) { d->caseSensitivity = caseSensitivity; } void QuaZipDir::setFilter(QDir::Filters filters) { d->filter = filters; } void QuaZipDir::setNameFilters(const QStringList &nameFilters) { d->nameFilters = nameFilters; } void QuaZipDir::setPath(const QString &path) { QString newDir = path; if (newDir == "/") { d->dir = ""; } else { if (newDir.endsWith('/')) newDir.chop(1); if (newDir.startsWith('/')) newDir = newDir.mid(1); d->dir = newDir; } } void QuaZipDir::setSorting(QDir::SortFlags sort) { d->sorting = sort; } QDir::SortFlags QuaZipDir::sorting() const { return d->sorting; } tea-qt-47.1.0/quazipdir.h000066400000000000000000000201541346332167200151700ustar00rootroot00000000000000#ifndef QUAZIP_QUAZIPDIR_H #define QUAZIP_QUAZIPDIR_H /* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ class QuaZipDirPrivate; #include "quazip.h" #include "quazipfileinfo.h" #include #include #include /// Provides ZIP archive navigation. /** * This class is modelled after QDir, and is designed to provide similar * features for ZIP archives. * * The only significant difference from QDir is that the root path is not * '/', but an empty string since that's how the file paths are stored in * the archive. However, QuaZipDir understands the paths starting with * '/'. It is important in a few places: * * - In the cd() function. * - In the constructor. * - In the exists() function. * - In the relativePath() function. * * Note that since ZIP uses '/' on all platforms, the '\' separator is * not supported. */ class QUAZIP_EXPORT QuaZipDir { private: QSharedDataPointer d; public: /// The copy constructor. QuaZipDir(const QuaZipDir &that); /// Constructs a QuaZipDir instance pointing to the specified directory. /** If \a dir is not specified, points to the root of the archive. The same happens if the \a dir is "/". */ QuaZipDir(QuaZip *zip, const QString &dir = QString()); /// Destructor. ~QuaZipDir(); /// The assignment operator. bool operator==(const QuaZipDir &that); /// operator!= /** \return \c true if either this and \a that use different QuaZip instances or if they point to different directories. */ inline bool operator!=(const QuaZipDir &that) {return !operator==(that);} /// operator== /** \return \c true if both this and \a that use the same QuaZip instance and point to the same directory. */ QuaZipDir& operator=(const QuaZipDir &that); /// Returns the name of the entry at the specified position. QString operator[](int pos) const; /// Returns the current case sensitivity mode. QuaZip::CaseSensitivity caseSensitivity() const; /// Changes the 'current' directory. /** * If the path starts with '/', it is interpreted as an absolute * path from the root of the archive. Otherwise, it is interpreted * as a path relative to the current directory as was set by the * previous cd() or the constructor. * * Note that the subsequent path() call will not return a path * starting with '/' in all cases. */ bool cd(const QString &dirName); /// Goes up. bool cdUp(); /// Returns the number of entries in the directory. uint count() const; /// Returns the current directory name. /** The name doesn't include the path. */ QString dirName() const; /// Returns the list of the entries in the directory. /** \param nameFilters The list of file patterns to list, uses the same syntax as QDir. \param filters The entry type filters, only Files and Dirs are accepted. \param sort Sorting mode. */ QList entryInfoList(const QStringList &nameFilters, QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const; /// Returns the list of the entries in the directory. /** \overload The same as entryInfoList(QStringList(), filters, sort). */ QList entryInfoList(QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const; /// Returns the list of the entries in the directory with zip64 support. /** \param nameFilters The list of file patterns to list, uses the same syntax as QDir. \param filters The entry type filters, only Files and Dirs are accepted. \param sort Sorting mode. */ QList entryInfoList64(const QStringList &nameFilters, QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const; /// Returns the list of the entries in the directory with zip64 support. /** \overload The same as entryInfoList64(QStringList(), filters, sort). */ QList entryInfoList64(QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const; /// Returns the list of the entry names in the directory. /** The same as entryInfoList(nameFilters, filters, sort), but only returns entry names. */ QStringList entryList(const QStringList &nameFilters, QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const; /// Returns the list of the entry names in the directory. /** \overload The same as entryList(QStringList(), filters, sort). */ QStringList entryList(QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const; /// Returns \c true if the entry with the specified name exists. /** The ".." is considered to exist if the current directory is not root. The "." and "/" are considered to always exist. Paths starting with "/" are relative to the archive root, other paths are relative to the current dir. */ bool exists(const QString &fileName) const; /// Return \c true if the directory pointed by this QuaZipDir exists. bool exists() const; /// Returns the full path to the specified file. /** Doesn't check if the file actually exists. */ QString filePath(const QString &fileName) const; /// Returns the default filter. QDir::Filters filter(); /// Returns if the QuaZipDir points to the root of the archive. /** Not that the root path is the empty string, not '/'. */ bool isRoot() const; /// Return the default name filter. QStringList nameFilters() const; /// Returns the path to the current dir. /** The path never starts with '/', and the root path is an empty string. */ QString path() const; /// Returns the path to the specified file relative to the current dir. /** * This function is mostly useless, provided only for the sake of * completeness. * * @param fileName The path to the file, should start with "/" * if relative to the archive root. * @return Path relative to the current dir. */ QString relativeFilePath(const QString &fileName) const; /// Sets the default case sensitivity mode. void setCaseSensitivity(QuaZip::CaseSensitivity caseSensitivity); /// Sets the default filter. void setFilter(QDir::Filters filters); /// Sets the default name filter. void setNameFilters(const QStringList &nameFilters); /// Goes to the specified path. /** The difference from cd() is that this function never checks if the path actually exists and doesn't use relative paths, so it's possible to go to the root directory with setPath(""). Note that this function still chops the trailing and/or leading '/' and treats a single '/' as the root path (path() will still return an empty string). */ void setPath(const QString &path); /// Sets the default sorting mode. void setSorting(QDir::SortFlags sort); /// Returns the default sorting mode. QDir::SortFlags sorting() const; }; #endif // QUAZIP_QUAZIPDIR_H tea-qt-47.1.0/quazipfile.cpp000066400000000000000000000345561346332167200156770ustar00rootroot00000000000000/* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant, see quazip/(un)zip.h files for details, basically it's zlib license. **/ #include "quazipfile.h" using namespace std; /// The implementation class for QuaZip. /** \internal This class contains all the private stuff for the QuaZipFile class, thus allowing to preserve binary compatibility between releases, the technique known as the Pimpl (private implementation) idiom. */ class QuaZipFilePrivate { friend class QuaZipFile; private: Q_DISABLE_COPY(QuaZipFilePrivate) /// The pointer to the associated QuaZipFile instance. QuaZipFile *q; /// The QuaZip object to work with. QuaZip *zip; /// The file name. QString fileName; /// Case sensitivity mode. QuaZip::CaseSensitivity caseSensitivity; /// Whether this file is opened in the raw mode. bool raw; /// Write position to keep track of. /** QIODevice::pos() is broken for non-seekable devices, so we need our own position. */ qint64 writePos; /// Uncompressed size to write along with a raw file. quint64 uncompressedSize; /// CRC to write along with a raw file. quint32 crc; /// Whether \ref zip points to an internal QuaZip instance. /** This is true if the archive was opened by name, rather than by supplying an existing QuaZip instance. */ bool internal; /// The last error. int zipError; /// Resets \ref zipError. inline void resetZipError() const {setZipError(UNZ_OK);} /// Sets the zip error. /** This function is marked as const although it changes one field. This allows to call it from const functions that don't change anything by themselves. */ void setZipError(int zipError) const; /// The constructor for the corresponding QuaZipFile constructor. inline QuaZipFilePrivate(QuaZipFile *q1): q(q1), zip(NULL), caseSensitivity(QuaZip::csDefault), raw(false), writePos(0), uncompressedSize(0), crc(0), internal(true), zipError(UNZ_OK) {} /// The constructor for the corresponding QuaZipFile constructor. inline QuaZipFilePrivate(QuaZipFile *q1, const QString &zipName): q(q1), caseSensitivity(QuaZip::csDefault), raw(false), writePos(0), uncompressedSize(0), crc(0), internal(true), zipError(UNZ_OK) { zip=new QuaZip(zipName); } /// The constructor for the corresponding QuaZipFile constructor. inline QuaZipFilePrivate(QuaZipFile *q1, const QString &zipName, const QString &fileName, QuaZip::CaseSensitivity cs): q(q1), raw(false), writePos(0), uncompressedSize(0), crc(0), internal(true), zipError(UNZ_OK) { zip=new QuaZip(zipName); this->fileName=fileName; if (this->fileName.startsWith('/')) this->fileName = this->fileName.mid(1); this->caseSensitivity=cs; } /// The constructor for the QuaZipFile constructor accepting a file name. inline QuaZipFilePrivate(QuaZipFile *q1, QuaZip *zip): q(q1), zip(zip), raw(false), writePos(0), uncompressedSize(0), crc(0), internal(false), zipError(UNZ_OK) {} /// The destructor. inline ~QuaZipFilePrivate() { if (internal) delete zip; } }; QuaZipFile::QuaZipFile(): p(new QuaZipFilePrivate(this)) { } QuaZipFile::QuaZipFile(QObject *parent): QIODevice(parent), p(new QuaZipFilePrivate(this)) { } QuaZipFile::QuaZipFile(const QString& zipName, QObject *parent): QIODevice(parent), p(new QuaZipFilePrivate(this, zipName)) { } QuaZipFile::QuaZipFile(const QString& zipName, const QString& fileName, QuaZip::CaseSensitivity cs, QObject *parent): QIODevice(parent), p(new QuaZipFilePrivate(this, zipName, fileName, cs)) { } QuaZipFile::QuaZipFile(QuaZip *zip, QObject *parent): QIODevice(parent), p(new QuaZipFilePrivate(this, zip)) { } QuaZipFile::~QuaZipFile() { if (isOpen()) close(); delete p; } QString QuaZipFile::getZipName() const { return p->zip==NULL ? QString() : p->zip->getZipName(); } QuaZip *QuaZipFile::getZip() const { return p->internal ? NULL : p->zip; } QString QuaZipFile::getActualFileName()const { p->setZipError(UNZ_OK); if (p->zip == NULL || (openMode() & WriteOnly)) return QString(); QString name=p->zip->getCurrentFileName(); if(name.isNull()) p->setZipError(p->zip->getZipError()); return name; } void QuaZipFile::setZipName(const QString& zipName) { if(isOpen()) { qWarning("QuaZipFile::setZipName(): file is already open - can not set ZIP name"); return; } if(p->zip!=NULL && p->internal) delete p->zip; p->zip=new QuaZip(zipName); p->internal=true; } void QuaZipFile::setZip(QuaZip *zip) { if(isOpen()) { qWarning("QuaZipFile::setZip(): file is already open - can not set ZIP"); return; } if(p->zip!=NULL && p->internal) delete p->zip; p->zip=zip; p->fileName=QString(); p->internal=false; } void QuaZipFile::setFileName(const QString& fileName, QuaZip::CaseSensitivity cs) { if(p->zip==NULL) { qWarning("QuaZipFile::setFileName(): call setZipName() first"); return; } if(!p->internal) { qWarning("QuaZipFile::setFileName(): should not be used when not using internal QuaZip"); return; } if(isOpen()) { qWarning("QuaZipFile::setFileName(): can not set file name for already opened file"); return; } p->fileName=fileName; if (p->fileName.startsWith('/')) p->fileName = p->fileName.mid(1); p->caseSensitivity=cs; } void QuaZipFilePrivate::setZipError(int zipError) const { QuaZipFilePrivate *fakeThis = const_cast(this); // non-const fakeThis->zipError=zipError; if(zipError==UNZ_OK) q->setErrorString(QString()); else q->setErrorString(QuaZipFile::tr("ZIP/UNZIP API error %1").arg(zipError)); } bool QuaZipFile::open(OpenMode mode) { return open(mode, NULL); } bool QuaZipFile::open(OpenMode mode, int *method, int *level, bool raw, const char *password) { p->resetZipError(); if(isOpen()) { qWarning("QuaZipFile::open(): already opened"); return false; } if(mode&Unbuffered) { qWarning("QuaZipFile::open(): Unbuffered mode is not supported"); return false; } if((mode&ReadOnly)&&!(mode&WriteOnly)) { if(p->internal) { if(!p->zip->open(QuaZip::mdUnzip)) { p->setZipError(p->zip->getZipError()); return false; } if(!p->zip->setCurrentFile(p->fileName, p->caseSensitivity)) { p->setZipError(p->zip->getZipError()); p->zip->close(); return false; } } else { if(p->zip==NULL) { qWarning("QuaZipFile::open(): zip is NULL"); return false; } if(p->zip->getMode()!=QuaZip::mdUnzip) { qWarning("QuaZipFile::open(): file open mode %d incompatible with ZIP open mode %d", (int)mode, (int)p->zip->getMode()); return false; } if(!p->zip->hasCurrentFile()) { qWarning("QuaZipFile::open(): zip does not have current file"); return false; } } p->setZipError(unzOpenCurrentFile3(p->zip->getUnzFile(), method, level, (int)raw, password)); if(p->zipError==UNZ_OK) { setOpenMode(mode); p->raw=raw; return true; } else return false; } qWarning("QuaZipFile::open(): open mode %d not supported by this function", (int)mode); return false; } bool QuaZipFile::open(OpenMode mode, const QuaZipNewInfo& info, const char *password, quint32 crc, int method, int level, bool raw, int windowBits, int memLevel, int strategy) { zip_fileinfo info_z; p->resetZipError(); if(isOpen()) { qWarning("QuaZipFile::open(): already opened"); return false; } if((mode&WriteOnly)&&!(mode&ReadOnly)) { if(p->internal) { qWarning("QuaZipFile::open(): write mode is incompatible with internal QuaZip approach"); return false; } if(p->zip==NULL) { qWarning("QuaZipFile::open(): zip is NULL"); return false; } if(p->zip->getMode()!=QuaZip::mdCreate&&p->zip->getMode()!=QuaZip::mdAppend&&p->zip->getMode()!=QuaZip::mdAdd) { qWarning("QuaZipFile::open(): file open mode %d incompatible with ZIP open mode %d", (int)mode, (int)p->zip->getMode()); return false; } info_z.tmz_date.tm_year=info.dateTime.date().year(); info_z.tmz_date.tm_mon=info.dateTime.date().month() - 1; info_z.tmz_date.tm_mday=info.dateTime.date().day(); info_z.tmz_date.tm_hour=info.dateTime.time().hour(); info_z.tmz_date.tm_min=info.dateTime.time().minute(); info_z.tmz_date.tm_sec=info.dateTime.time().second(); info_z.dosDate = 0; info_z.internal_fa=(uLong)info.internalAttr; info_z.external_fa=(uLong)info.externalAttr; if (p->zip->isDataDescriptorWritingEnabled()) zipSetFlags(p->zip->getZipFile(), ZIP_WRITE_DATA_DESCRIPTOR); else zipClearFlags(p->zip->getZipFile(), ZIP_WRITE_DATA_DESCRIPTOR); p->setZipError(zipOpenNewFileInZip3_64(p->zip->getZipFile(), p->zip->getFileNameCodec()->fromUnicode(info.name).constData(), &info_z, info.extraLocal.constData(), info.extraLocal.length(), info.extraGlobal.constData(), info.extraGlobal.length(), p->zip->getCommentCodec()->fromUnicode(info.comment).constData(), method, level, (int)raw, windowBits, memLevel, strategy, password, (uLong)crc, p->zip->isZip64Enabled())); if(p->zipError==UNZ_OK) { p->writePos=0; setOpenMode(mode); p->raw=raw; if(raw) { p->crc=crc; p->uncompressedSize=info.uncompressedSize; } return true; } else return false; } qWarning("QuaZipFile::open(): open mode %d not supported by this function", (int)mode); return false; } bool QuaZipFile::isSequential()const { return true; } qint64 QuaZipFile::pos()const { if(p->zip==NULL) { qWarning("QuaZipFile::pos(): call setZipName() or setZip() first"); return -1; } if(!isOpen()) { qWarning("QuaZipFile::pos(): file is not open"); return -1; } if(openMode()&ReadOnly) // QIODevice::pos() is broken for sequential devices, // but thankfully bytesAvailable() returns the number of // bytes buffered, so we know how far ahead we are. return unztell64(p->zip->getUnzFile()) - QIODevice::bytesAvailable(); else return p->writePos; } bool QuaZipFile::atEnd()const { if(p->zip==NULL) { qWarning("QuaZipFile::atEnd(): call setZipName() or setZip() first"); return false; } if(!isOpen()) { qWarning("QuaZipFile::atEnd(): file is not open"); return false; } if(openMode()&ReadOnly) // the same problem as with pos() return QIODevice::bytesAvailable() == 0 && unzeof(p->zip->getUnzFile())==1; else return true; } qint64 QuaZipFile::size()const { if(!isOpen()) { qWarning("QuaZipFile::atEnd(): file is not open"); return -1; } if(openMode()&ReadOnly) return p->raw?csize():usize(); else return p->writePos; } qint64 QuaZipFile::csize()const { unz_file_info64 info_z; p->setZipError(UNZ_OK); if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1; p->setZipError(unzGetCurrentFileInfo64(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0)); if(p->zipError!=UNZ_OK) return -1; return info_z.compressed_size; } qint64 QuaZipFile::usize()const { unz_file_info64 info_z; p->setZipError(UNZ_OK); if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return -1; p->setZipError(unzGetCurrentFileInfo64(p->zip->getUnzFile(), &info_z, NULL, 0, NULL, 0, NULL, 0)); if(p->zipError!=UNZ_OK) return -1; return info_z.uncompressed_size; } bool QuaZipFile::getFileInfo(QuaZipFileInfo *info) { QuaZipFileInfo64 info64; if (getFileInfo(&info64)) { info64.toQuaZipFileInfo(*info); return true; } else { return false; } } bool QuaZipFile::getFileInfo(QuaZipFileInfo64 *info) { if(p->zip==NULL||p->zip->getMode()!=QuaZip::mdUnzip) return false; p->zip->getCurrentFileInfo(info); p->setZipError(p->zip->getZipError()); return p->zipError==UNZ_OK; } void QuaZipFile::close() { p->resetZipError(); if(p->zip==NULL||!p->zip->isOpen()) return; if(!isOpen()) { qWarning("QuaZipFile::close(): file isn't open"); return; } if(openMode()&ReadOnly) p->setZipError(unzCloseCurrentFile(p->zip->getUnzFile())); else if(openMode()&WriteOnly) if(isRaw()) p->setZipError(zipCloseFileInZipRaw64(p->zip->getZipFile(), p->uncompressedSize, p->crc)); else p->setZipError(zipCloseFileInZip(p->zip->getZipFile())); else { qWarning("Wrong open mode: %d", (int)openMode()); return; } if(p->zipError==UNZ_OK) setOpenMode(QIODevice::NotOpen); else return; if(p->internal) { p->zip->close(); p->setZipError(p->zip->getZipError()); } } qint64 QuaZipFile::readData(char *data, qint64 maxSize) { p->setZipError(UNZ_OK); qint64 bytesRead=unzReadCurrentFile(p->zip->getUnzFile(), data, (unsigned)maxSize); if (bytesRead < 0) { p->setZipError((int) bytesRead); return -1; } return bytesRead; } qint64 QuaZipFile::writeData(const char* data, qint64 maxSize) { p->setZipError(ZIP_OK); p->setZipError(zipWriteInFileInZip(p->zip->getZipFile(), data, (uint)maxSize)); if(p->zipError!=ZIP_OK) return -1; else { p->writePos+=maxSize; return maxSize; } } QString QuaZipFile::getFileName() const { return p->fileName; } QuaZip::CaseSensitivity QuaZipFile::getCaseSensitivity() const { return p->caseSensitivity; } bool QuaZipFile::isRaw() const { return p->raw; } int QuaZipFile::getZipError() const { return p->zipError; } qint64 QuaZipFile::bytesAvailable() const { return size() - pos(); } tea-qt-47.1.0/quazipfile.h000066400000000000000000000470631346332167200153410ustar00rootroot00000000000000#ifndef QUA_ZIPFILE_H #define QUA_ZIPFILE_H /* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant, see quazip/(un)zip.h files for details, basically it's zlib license. **/ #include #include "quazip_global.h" #include "quazip.h" #include "quazipnewinfo.h" class QuaZipFilePrivate; /// A file inside ZIP archive. /** \class QuaZipFile quazipfile.h * This is the most interesting class. Not only it provides C++ * interface to the ZIP/UNZIP package, but also integrates it with Qt by * subclassing QIODevice. This makes possible to access files inside ZIP * archive using QTextStream or QDataStream, for example. Actually, this * is the main purpose of the whole QuaZIP library. * * You can either use existing QuaZip instance to create instance of * this class or pass ZIP archive file name to this class, in which case * it will create internal QuaZip object. See constructors' descriptions * for details. Writing is only possible with the existing instance. * * Note that due to the underlying library's limitation it is not * possible to use multiple QuaZipFile instances to open several files * in the same archive at the same time. If you need to write to * multiple files in parallel, then you should write to temporary files * first, then pack them all at once when you have finished writing. If * you need to read multiple files inside the same archive in parallel, * you should extract them all into a temporary directory first. * * \section quazipfile-sequential Sequential or random-access? * * At the first thought, QuaZipFile has fixed size, the start and the * end and should be therefore considered random-access device. But * there is one major obstacle to making it random-access: ZIP/UNZIP API * does not support seek() operation and the only way to implement it is * through reopening the file and re-reading to the required position, * but this is prohibitively slow. * * Therefore, QuaZipFile is considered to be a sequential device. This * has advantage of availability of the ungetChar() operation (QIODevice * does not implement it properly for non-sequential devices unless they * support seek()). Disadvantage is a somewhat strange behaviour of the * size() and pos() functions. This should be kept in mind while using * this class. * **/ class QUAZIP_EXPORT QuaZipFile: public QIODevice { friend class QuaZipFilePrivate; Q_OBJECT private: QuaZipFilePrivate *p; // these are not supported nor implemented QuaZipFile(const QuaZipFile& that); QuaZipFile& operator=(const QuaZipFile& that); protected: /// Implementation of the QIODevice::readData(). qint64 readData(char *data, qint64 maxSize); /// Implementation of the QIODevice::writeData(). qint64 writeData(const char *data, qint64 maxSize); public: /// Constructs a QuaZipFile instance. /** You should use setZipName() and setFileName() or setZip() before * trying to call open() on the constructed object. **/ QuaZipFile(); /// Constructs a QuaZipFile instance. /** \a parent argument specifies this object's parent object. * * You should use setZipName() and setFileName() or setZip() before * trying to call open() on the constructed object. **/ QuaZipFile(QObject *parent); /// Constructs a QuaZipFile instance. /** \a parent argument specifies this object's parent object and \a * zipName specifies ZIP archive file name. * * You should use setFileName() before trying to call open() on the * constructed object. * * QuaZipFile constructed by this constructor can be used for read * only access. Use QuaZipFile(QuaZip*,QObject*) for writing. **/ QuaZipFile(const QString& zipName, QObject *parent =NULL); /// Constructs a QuaZipFile instance. /** \a parent argument specifies this object's parent object, \a * zipName specifies ZIP archive file name and \a fileName and \a cs * specify a name of the file to open inside archive. * * QuaZipFile constructed by this constructor can be used for read * only access. Use QuaZipFile(QuaZip*,QObject*) for writing. * * \sa QuaZip::setCurrentFile() **/ QuaZipFile(const QString& zipName, const QString& fileName, QuaZip::CaseSensitivity cs =QuaZip::csDefault, QObject *parent =NULL); /// Constructs a QuaZipFile instance. /** \a parent argument specifies this object's parent object. * * \a zip is the pointer to the existing QuaZip object. This * QuaZipFile object then can be used to read current file in the * \a zip or to write to the file inside it. * * \warning Using this constructor for reading current file can be * tricky. Let's take the following example: * \code * QuaZip zip("archive.zip"); * zip.open(QuaZip::mdUnzip); * zip.setCurrentFile("file-in-archive"); * QuaZipFile file(&zip); * file.open(QIODevice::ReadOnly); * // ok, now we can read from the file * file.read(somewhere, some); * zip.setCurrentFile("another-file-in-archive"); // oops... * QuaZipFile anotherFile(&zip); * anotherFile.open(QIODevice::ReadOnly); * anotherFile.read(somewhere, some); // this is still ok... * file.read(somewhere, some); // and this is NOT * \endcode * So, what exactly happens here? When we change current file in the * \c zip archive, \c file that references it becomes invalid * (actually, as far as I understand ZIP/UNZIP sources, it becomes * closed, but QuaZipFile has no means to detect it). * * Summary: do not close \c zip object or change its current file as * long as QuaZipFile is open. Even better - use another constructors * which create internal QuaZip instances, one per object, and * therefore do not cause unnecessary trouble. This constructor may * be useful, though, if you already have a QuaZip instance and do * not want to access several files at once. Good example: * \code * QuaZip zip("archive.zip"); * zip.open(QuaZip::mdUnzip); * // first, we need some information about archive itself * QByteArray comment=zip.getComment(); * // and now we are going to access files inside it * QuaZipFile file(&zip); * for(bool more=zip.goToFirstFile(); more; more=zip.goToNextFile()) { * file.open(QIODevice::ReadOnly); * // do something cool with file here * file.close(); // do not forget to close! * } * zip.close(); * \endcode **/ QuaZipFile(QuaZip *zip, QObject *parent =NULL); /// Destroys a QuaZipFile instance. /** Closes file if open, destructs internal QuaZip object (if it * exists and \em is internal, of course). **/ virtual ~QuaZipFile(); /// Returns the ZIP archive file name. /** If this object was created by passing QuaZip pointer to the * constructor, this function will return that QuaZip's file name * (or null string if that object does not have file name yet). * * Otherwise, returns associated ZIP archive file name or null * string if there are no name set yet. * * \sa setZipName() getFileName() **/ QString getZipName()const; /// Returns a pointer to the associated QuaZip object. /** Returns \c NULL if there is no associated QuaZip or it is * internal (so you will not mess with it). **/ QuaZip* getZip()const; /// Returns file name. /** This function returns file name you passed to this object either * by using * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*) * or by calling setFileName(). Real name of the file may differ in * case if you used case-insensitivity. * * Returns null string if there is no file name set yet. This is the * case when this QuaZipFile operates on the existing QuaZip object * (constructor QuaZipFile(QuaZip*,QObject*) or setZip() was used). * * \sa getActualFileName **/ QString getFileName() const; /// Returns case sensitivity of the file name. /** This function returns case sensitivity argument you passed to * this object either by using * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*) * or by calling setFileName(). * * Returns unpredictable value if getFileName() returns null string * (this is the case when you did not used setFileName() or * constructor above). * * \sa getFileName **/ QuaZip::CaseSensitivity getCaseSensitivity() const; /// Returns the actual file name in the archive. /** This is \em not a ZIP archive file name, but a name of file inside * archive. It is not necessary the same name that you have passed * to the * QuaZipFile(const QString&,const QString&,QuaZip::CaseSensitivity,QObject*), * setFileName() or QuaZip::setCurrentFile() - this is the real file * name inside archive, so it may differ in case if the file name * search was case-insensitive. * * Equivalent to calling getCurrentFileName() on the associated * QuaZip object. Returns null string if there is no associated * QuaZip object or if it does not have a current file yet. And this * is the case if you called setFileName() but did not open the * file yet. So this is perfectly fine: * \code * QuaZipFile file("somezip.zip"); * file.setFileName("somefile"); * QString name=file.getName(); // name=="somefile" * QString actual=file.getActualFileName(); // actual is null string * file.open(QIODevice::ReadOnly); * QString actual=file.getActualFileName(); // actual can be "SoMeFiLe" on Windows * \endcode * * \sa getZipName(), getFileName(), QuaZip::CaseSensitivity **/ QString getActualFileName()const; /// Sets the ZIP archive file name. /** Automatically creates internal QuaZip object and destroys * previously created internal QuaZip object, if any. * * Will do nothing if this file is already open. You must close() it * first. **/ void setZipName(const QString& zipName); /// Returns \c true if the file was opened in raw mode. /** If the file is not open, the returned value is undefined. * * \sa open(OpenMode,int*,int*,bool,const char*) **/ bool isRaw() const; /// Binds to the existing QuaZip instance. /** This function destroys internal QuaZip object, if any, and makes * this QuaZipFile to use current file in the \a zip object for any * further operations. See QuaZipFile(QuaZip*,QObject*) for the * possible pitfalls. * * Will do nothing if the file is currently open. You must close() * it first. **/ void setZip(QuaZip *zip); /// Sets the file name. /** Will do nothing if at least one of the following conditions is * met: * - ZIP name has not been set yet (getZipName() returns null * string). * - This QuaZipFile is associated with external QuaZip. In this * case you should call that QuaZip's setCurrentFile() function * instead! * - File is already open so setting the name is meaningless. * * \sa QuaZip::setCurrentFile **/ void setFileName(const QString& fileName, QuaZip::CaseSensitivity cs =QuaZip::csDefault); /// Opens a file for reading. /** Returns \c true on success, \c false otherwise. * Call getZipError() to get error code. * * \note Since ZIP/UNZIP API provides buffered reading only, * QuaZipFile does not support unbuffered reading. So do not pass * QIODevice::Unbuffered flag in \a mode, or open will fail. **/ virtual bool open(OpenMode mode); /// Opens a file for reading. /** \overload * Argument \a password specifies a password to decrypt the file. If * it is NULL then this function behaves just like open(OpenMode). **/ inline bool open(OpenMode mode, const char *password) {return open(mode, NULL, NULL, false, password);} /// Opens a file for reading. /** \overload * Argument \a password specifies a password to decrypt the file. * * An integers pointed by \a method and \a level will receive codes * of the compression method and level used. See unzip.h. * * If raw is \c true then no decompression is performed. * * \a method should not be \c NULL. \a level can be \c NULL if you * don't want to know the compression level. **/ bool open(OpenMode mode, int *method, int *level, bool raw, const char *password =NULL); /// Opens a file for writing. /** \a info argument specifies information about file. It should at * least specify a correct file name. Also, it is a good idea to * specify correct timestamp (by default, current time will be * used). See QuaZipNewInfo. * * The \a password argument specifies the password for crypting. Pass NULL * if you don't need any crypting. The \a crc argument was supposed * to be used for crypting too, but then it turned out that it's * false information, so you need to set it to 0 unless you want to * use the raw mode (see below). * * Arguments \a method and \a level specify compression method and * level. The only method supported is Z_DEFLATED, but you may also * specify 0 for no compression. If all of the files in the archive * use both method 0 and either level 0 is explicitly specified or * data descriptor writing is disabled with * QuaZip::setDataDescriptorWritingEnabled(), then the * resulting archive is supposed to be compatible with the 1.0 ZIP * format version, should you need that. Except for this, \a level * has no other effects with method 0. * * If \a raw is \c true, no compression is performed. In this case, * \a crc and uncompressedSize field of the \a info are required. * * Arguments \a windowBits, \a memLevel, \a strategy provide zlib * algorithms tuning. See deflateInit2() in zlib. **/ bool open(OpenMode mode, const QuaZipNewInfo& info, const char *password =NULL, quint32 crc =0, int method =Z_DEFLATED, int level =Z_DEFAULT_COMPRESSION, bool raw =false, int windowBits =-MAX_WBITS, int memLevel =DEF_MEM_LEVEL, int strategy =Z_DEFAULT_STRATEGY); /// Returns \c true, but \ref quazipfile-sequential "beware"! virtual bool isSequential()const; /// Returns current position in the file. /** Implementation of the QIODevice::pos(). When reading, this * function is a wrapper to the ZIP/UNZIP unztell(), therefore it is * unable to keep track of the ungetChar() calls (which is * non-virtual and therefore is dangerous to reimplement). So if you * are using ungetChar() feature of the QIODevice, this function * reports incorrect value until you get back characters which you * ungot. * * When writing, pos() returns number of bytes already written * (uncompressed unless you use raw mode). * * \note Although * \ref quazipfile-sequential "QuaZipFile is a sequential device" * and therefore pos() should always return zero, it does not, * because it would be misguiding. Keep this in mind. * * This function returns -1 if the file or archive is not open. * * Error code returned by getZipError() is not affected by this * function call. **/ virtual qint64 pos()const; /// Returns \c true if the end of file was reached. /** This function returns \c false in the case of error. This means * that you called this function on either not open file, or a file * in the not open archive or even on a QuaZipFile instance that * does not even have QuaZip instance associated. Do not do that * because there is no means to determine whether \c false is * returned because of error or because end of file was reached. * Well, on the other side you may interpret \c false return value * as "there is no file open to check for end of file and there is * no end of file therefore". * * When writing, this function always returns \c true (because you * are always writing to the end of file). * * Error code returned by getZipError() is not affected by this * function call. **/ virtual bool atEnd()const; /// Returns file size. /** This function returns csize() if the file is open for reading in * raw mode, usize() if it is open for reading in normal mode and * pos() if it is open for writing. * * Returns -1 on error, call getZipError() to get error code. * * \note This function returns file size despite that * \ref quazipfile-sequential "QuaZipFile is considered to be sequential device", * for which size() should return bytesAvailable() instead. But its * name would be very misguiding otherwise, so just keep in mind * this inconsistence. **/ virtual qint64 size()const; /// Returns compressed file size. /** Equivalent to calling getFileInfo() and then getting * compressedSize field, but more convenient and faster. * * File must be open for reading before calling this function. * * Returns -1 on error, call getZipError() to get error code. **/ qint64 csize()const; /// Returns uncompressed file size. /** Equivalent to calling getFileInfo() and then getting * uncompressedSize field, but more convenient and faster. See * getFileInfo() for a warning. * * File must be open for reading before calling this function. * * Returns -1 on error, call getZipError() to get error code. **/ qint64 usize()const; /// Gets information about current file. /** This function does the same thing as calling * QuaZip::getCurrentFileInfo() on the associated QuaZip object, * but you can not call getCurrentFileInfo() if the associated * QuaZip is internal (because you do not have access to it), while * you still can call this function in that case. * * File must be open for reading before calling this function. * * \return \c false in the case of an error. * * This function doesn't support zip64, but will still work fine on zip64 * archives if file sizes are below 4 GB, otherwise the values will be set * as if converted using QuaZipFileInfo64::toQuaZipFileInfo(). * * \sa getFileInfo(QuaZipFileInfo64*) **/ bool getFileInfo(QuaZipFileInfo *info); /// Gets information about current file with zip64 support. /** * @overload * * \sa getFileInfo(QuaZipFileInfo*) */ bool getFileInfo(QuaZipFileInfo64 *info); /// Closes the file. /** Call getZipError() to determine if the close was successful. **/ virtual void close(); /// Returns the error code returned by the last ZIP/UNZIP API call. int getZipError() const; /// Returns the number of bytes available for reading. virtual qint64 bytesAvailable() const; }; #endif tea-qt-47.1.0/quazipfileinfo.cpp000066400000000000000000000147341346332167200165470ustar00rootroot00000000000000/* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include "quazipfileinfo.h" static QFile::Permissions permissionsFromExternalAttr(quint32 externalAttr) { quint32 uPerm = (externalAttr & 0xFFFF0000u) >> 16; QFile::Permissions perm = 0; if ((uPerm & 0400) != 0) perm |= QFile::ReadOwner; if ((uPerm & 0200) != 0) perm |= QFile::WriteOwner; if ((uPerm & 0100) != 0) perm |= QFile::ExeOwner; if ((uPerm & 0040) != 0) perm |= QFile::ReadGroup; if ((uPerm & 0020) != 0) perm |= QFile::WriteGroup; if ((uPerm & 0010) != 0) perm |= QFile::ExeGroup; if ((uPerm & 0004) != 0) perm |= QFile::ReadOther; if ((uPerm & 0002) != 0) perm |= QFile::WriteOther; if ((uPerm & 0001) != 0) perm |= QFile::ExeOther; return perm; } QFile::Permissions QuaZipFileInfo::getPermissions() const { return permissionsFromExternalAttr(externalAttr); } QFile::Permissions QuaZipFileInfo64::getPermissions() const { return permissionsFromExternalAttr(externalAttr); } bool QuaZipFileInfo64::toQuaZipFileInfo(QuaZipFileInfo &info) const { bool noOverflow = true; info.name = name; info.versionCreated = versionCreated; info.versionNeeded = versionNeeded; info.flags = flags; info.method = method; info.dateTime = dateTime; info.crc = crc; if (compressedSize > 0xFFFFFFFFu) { info.compressedSize = 0xFFFFFFFFu; noOverflow = false; } else { info.compressedSize = compressedSize; } if (uncompressedSize > 0xFFFFFFFFu) { info.uncompressedSize = 0xFFFFFFFFu; noOverflow = false; } else { info.uncompressedSize = uncompressedSize; } info.diskNumberStart = diskNumberStart; info.internalAttr = internalAttr; info.externalAttr = externalAttr; info.comment = comment; info.extra = extra; return noOverflow; } static QDateTime getNTFSTime(const QByteArray &extra, int position, int *fineTicks) { QDateTime dateTime; for (int i = 0; i <= extra.size() - 4; ) { unsigned type = static_cast(static_cast( extra.at(i))) | (static_cast(static_cast( extra.at(i + 1))) << 8); i += 2; unsigned length = static_cast(static_cast( extra.at(i))) | (static_cast(static_cast( extra.at(i + 1))) << 8); i += 2; if (type == QUAZIP_EXTRA_NTFS_MAGIC && length >= 32) { i += 4; // reserved while (i <= extra.size() - 4) { unsigned tag = static_cast( static_cast(extra.at(i))) | (static_cast( static_cast(extra.at(i + 1))) << 8); i += 2; int tagsize = static_cast( static_cast(extra.at(i))) | (static_cast( static_cast(extra.at(i + 1))) << 8); i += 2; if (tag == QUAZIP_EXTRA_NTFS_TIME_MAGIC && tagsize >= position + 8) { i += position; quint64 mtime = static_cast( static_cast(extra.at(i))) | (static_cast(static_cast( extra.at(i + 1))) << 8) | (static_cast(static_cast( extra.at(i + 2))) << 16) | (static_cast(static_cast( extra.at(i + 3))) << 24) | (static_cast(static_cast( extra.at(i + 4))) << 32) | (static_cast(static_cast( extra.at(i + 5))) << 40) | (static_cast(static_cast( extra.at(i + 6))) << 48) | (static_cast(static_cast( extra.at(i + 7))) << 56); // the NTFS time is measured from 1601 for whatever reason QDateTime base(QDate(1601, 1, 1), QTime(0, 0), Qt::UTC); dateTime = base.addMSecs(mtime / 10000); if (fineTicks != NULL) { *fineTicks = static_cast(mtime % 10000); } i += tagsize - position; } else { i += tagsize; } } } else { i += length; } } if (fineTicks != NULL && dateTime.isNull()) { *fineTicks = 0; } return dateTime; } QDateTime QuaZipFileInfo64::getNTFSmTime(int *fineTicks) const { return getNTFSTime(extra, 0, fineTicks); } QDateTime QuaZipFileInfo64::getNTFSaTime(int *fineTicks) const { return getNTFSTime(extra, 8, fineTicks); } QDateTime QuaZipFileInfo64::getNTFScTime(int *fineTicks) const { return getNTFSTime(extra, 16, fineTicks); } tea-qt-47.1.0/quazipfileinfo.h000066400000000000000000000136241346332167200162110ustar00rootroot00000000000000#ifndef QUA_ZIPFILEINFO_H #define QUA_ZIPFILEINFO_H /* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include #include #include #include "quazip_global.h" /// Information about a file inside archive. /** * \deprecated Use QuaZipFileInfo64 instead. Not only it supports large files, * but also more convenience methods as well. * * Call QuaZip::getCurrentFileInfo() or QuaZipFile::getFileInfo() to * fill this structure. */ struct QUAZIP_EXPORT QuaZipFileInfo { /// File name. QString name; /// Version created by. quint16 versionCreated; /// Version needed to extract. quint16 versionNeeded; /// General purpose flags. quint16 flags; /// Compression method. quint16 method; /// Last modification date and time. QDateTime dateTime; /// CRC. quint32 crc; /// Compressed file size. quint32 compressedSize; /// Uncompressed file size. quint32 uncompressedSize; /// Disk number start. quint16 diskNumberStart; /// Internal file attributes. quint16 internalAttr; /// External file attributes. quint32 externalAttr; /// Comment. QString comment; /// Extra field. QByteArray extra; /// Get the file permissions. /** Returns the high 16 bits of external attributes converted to QFile::Permissions. */ QFile::Permissions getPermissions() const; }; /// Information about a file inside archive (with zip64 support). /** Call QuaZip::getCurrentFileInfo() or QuaZipFile::getFileInfo() to * fill this structure. */ struct QUAZIP_EXPORT QuaZipFileInfo64 { /// File name. QString name; /// Version created by. quint16 versionCreated; /// Version needed to extract. quint16 versionNeeded; /// General purpose flags. quint16 flags; /// Compression method. quint16 method; /// Last modification date and time. /** * This is the time stored in the standard ZIP header. This format only allows * to store time with 2-second precision, so the seconds will always be even * and the milliseconds will always be zero. If you need more precise * date and time, you can try to call the getNTFSmTime() function or * its siblings, provided that the archive itself contains these NTFS times. */ QDateTime dateTime; /// CRC. quint32 crc; /// Compressed file size. quint64 compressedSize; /// Uncompressed file size. quint64 uncompressedSize; /// Disk number start. quint16 diskNumberStart; /// Internal file attributes. quint16 internalAttr; /// External file attributes. quint32 externalAttr; /// Comment. QString comment; /// Extra field. QByteArray extra; /// Get the file permissions. /** Returns the high 16 bits of external attributes converted to QFile::Permissions. */ QFile::Permissions getPermissions() const; /// Converts to QuaZipFileInfo /** If any of the fields are greater than 0xFFFFFFFFu, they are set to 0xFFFFFFFFu exactly, not just truncated. This function should be mainly used for compatibility with the old code expecting QuaZipFileInfo, in the cases when it's impossible or otherwise unadvisable (due to ABI compatibility reasons, for example) to modify that old code to use QuaZipFileInfo64. \return \c true if all fields converted correctly, \c false if an overflow occured. */ bool toQuaZipFileInfo(QuaZipFileInfo &info) const; /// Returns the NTFS modification time /** * The getNTFS*Time() functions only work if there is an NTFS extra field * present. Otherwise, they all return invalid null timestamps. * @param fineTicks If not NULL, the fractional part of milliseconds returned * there, measured in 100-nanosecond ticks. Will be set to * zero if there is no NTFS extra field. * @sa dateTime * @sa getNTFSaTime() * @sa getNTFScTime() * @return The NTFS modification time, UTC */ QDateTime getNTFSmTime(int *fineTicks = NULL) const; /// Returns the NTFS access time /** * The getNTFS*Time() functions only work if there is an NTFS extra field * present. Otherwise, they all return invalid null timestamps. * @param fineTicks If not NULL, the fractional part of milliseconds returned * there, measured in 100-nanosecond ticks. Will be set to * zero if there is no NTFS extra field. * @sa dateTime * @sa getNTFSmTime() * @sa getNTFScTime() * @return The NTFS access time, UTC */ QDateTime getNTFSaTime(int *fineTicks = NULL) const; /// Returns the NTFS creation time /** * The getNTFS*Time() functions only work if there is an NTFS extra field * present. Otherwise, they all return invalid null timestamps. * @param fineTicks If not NULL, the fractional part of milliseconds returned * there, measured in 100-nanosecond ticks. Will be set to * zero if there is no NTFS extra field. * @sa dateTime * @sa getNTFSmTime() * @sa getNTFSaTime() * @return The NTFS creation time, UTC */ QDateTime getNTFScTime(int *fineTicks = NULL) const; /// Checks whether the file is encrypted. bool isEncrypted() const {return (flags & 1) != 0;} }; #endif tea-qt-47.1.0/quazipnewinfo.cpp000066400000000000000000000247161346332167200164220ustar00rootroot00000000000000/* Copyright (C) 2005-2014 Sergey A. Tachenov This file is part of QuaZIP. QuaZIP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the License, or (at your option) any later version. QuaZIP 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 QuaZIP. If not, see . See COPYING file for the full LGPL text. Original ZIP package is copyrighted by Gilles Vollant and contributors, see quazip/(un)zip.h files for details. Basically it's the zlib license. */ #include #include "quazipnewinfo.h" #include static void QuaZipNewInfo_setPermissions(QuaZipNewInfo *info, QFile::Permissions perm, bool isDir, bool isSymLink = false) { quint32 uPerm = isDir ? 0040000 : 0100000; if ( isSymLink ) { #ifdef Q_OS_WIN uPerm = 0200000; #else uPerm = 0120000; #endif } if ((perm & QFile::ReadOwner) != 0) uPerm |= 0400; if ((perm & QFile::WriteOwner) != 0) uPerm |= 0200; if ((perm & QFile::ExeOwner) != 0) uPerm |= 0100; if ((perm & QFile::ReadGroup) != 0) uPerm |= 0040; if ((perm & QFile::WriteGroup) != 0) uPerm |= 0020; if ((perm & QFile::ExeGroup) != 0) uPerm |= 0010; if ((perm & QFile::ReadOther) != 0) uPerm |= 0004; if ((perm & QFile::WriteOther) != 0) uPerm |= 0002; if ((perm & QFile::ExeOther) != 0) uPerm |= 0001; info->externalAttr = (info->externalAttr & ~0xFFFF0000u) | (uPerm << 16); } template void QuaZipNewInfo_init(QuaZipNewInfo &self, const FileInfo &existing) { self.name = existing.name; self.dateTime = existing.dateTime; self.internalAttr = existing.internalAttr; self.externalAttr = existing.externalAttr; self.comment = existing.comment; self.extraLocal = existing.extra; self.extraGlobal = existing.extra; self.uncompressedSize = existing.uncompressedSize; } QuaZipNewInfo::QuaZipNewInfo(const QuaZipFileInfo &existing) { QuaZipNewInfo_init(*this, existing); } QuaZipNewInfo::QuaZipNewInfo(const QuaZipFileInfo64 &existing) { QuaZipNewInfo_init(*this, existing); } QuaZipNewInfo::QuaZipNewInfo(const QString& name): name(name), dateTime(QDateTime::currentDateTime()), internalAttr(0), externalAttr(0), uncompressedSize(0) { } QuaZipNewInfo::QuaZipNewInfo(const QString& name, const QString& file): name(name), internalAttr(0), externalAttr(0), uncompressedSize(0) { QFileInfo info(file); QDateTime lm = info.lastModified(); if (!info.exists()) { dateTime = QDateTime::currentDateTime(); } else { dateTime = lm; QuaZipNewInfo_setPermissions(this, info.permissions(), info.isDir(), info.isSymLink()); } } void QuaZipNewInfo::setFileDateTime(const QString& file) { QFileInfo info(file); QDateTime lm = info.lastModified(); if (info.exists()) dateTime = lm; } void QuaZipNewInfo::setFilePermissions(const QString &file) { QFileInfo info = QFileInfo(file); QFile::Permissions perm = info.permissions(); QuaZipNewInfo_setPermissions(this, perm, info.isDir(), info.isSymLink()); } void QuaZipNewInfo::setPermissions(QFile::Permissions permissions) { QuaZipNewInfo_setPermissions(this, permissions, name.endsWith('/')); } void QuaZipNewInfo::setFileNTFSTimes(const QString &fileName) { QFileInfo fi(fileName); if (!fi.exists()) { qWarning("QuaZipNewInfo::setFileNTFSTimes(): '%s' doesn't exist", fileName.toUtf8().constData()); return; } setFileNTFSmTime(fi.lastModified()); setFileNTFSaTime(fi.lastRead()); setFileNTFScTime(fi.created()); } static void setNTFSTime(QByteArray &extra, const QDateTime &time, int position, int fineTicks) { int ntfsPos = -1, timesPos = -1; unsigned ntfsLength = 0, ntfsTimesLength = 0; for (int i = 0; i <= extra.size() - 4; ) { unsigned type = static_cast(static_cast( extra.at(i))) | (static_cast(static_cast( extra.at(i + 1))) << 8); i += 2; unsigned length = static_cast(static_cast( extra.at(i))) | (static_cast(static_cast( extra.at(i + 1))) << 8); i += 2; if (type == QUAZIP_EXTRA_NTFS_MAGIC) { ntfsPos = i - 4; // the beginning of the NTFS record ntfsLength = length; if (length <= 4) { break; // no times in the NTFS record } i += 4; // reserved while (i <= extra.size() - 4) { unsigned tag = static_cast( static_cast(extra.at(i))) | (static_cast( static_cast(extra.at(i + 1))) << 8); i += 2; unsigned tagsize = static_cast( static_cast(extra.at(i))) | (static_cast( static_cast(extra.at(i + 1))) << 8); i += 2; if (tag == QUAZIP_EXTRA_NTFS_TIME_MAGIC) { timesPos = i - 4; // the beginning of the NTFS times tag ntfsTimesLength = tagsize; break; } else { i += tagsize; } } break; // I ain't going to search for yet another NTFS record! } else { i += length; } } if (ntfsPos == -1) { // No NTFS record, need to create one. ntfsPos = extra.size(); ntfsLength = 32; extra.resize(extra.size() + 4 + ntfsLength); // the NTFS record header extra[ntfsPos] = static_cast(QUAZIP_EXTRA_NTFS_MAGIC); extra[ntfsPos + 1] = static_cast(QUAZIP_EXTRA_NTFS_MAGIC >> 8); extra[ntfsPos + 2] = 32; // the 2-byte size in LittleEndian extra[ntfsPos + 3] = 0; // zero the record memset(extra.data() + ntfsPos + 4, 0, 32); timesPos = ntfsPos + 8; // now set the tag data extra[timesPos] = static_cast(QUAZIP_EXTRA_NTFS_TIME_MAGIC); extra[timesPos + 1] = static_cast(QUAZIP_EXTRA_NTFS_TIME_MAGIC >> 8); // the size: extra[timesPos + 2] = 24; extra[timesPos + 3] = 0; ntfsTimesLength = 24; } if (timesPos == -1) { // No time tag in the NTFS record, need to add one. timesPos = ntfsPos + 4 + ntfsLength; extra.resize(extra.size() + 28); // Now we need to move the rest of the field // (possibly zero bytes, but memmove() is OK with that). // 0 ......... ntfsPos .. ntfsPos + 4 ... timesPos //
memmove(extra.data() + timesPos + 28, extra.data() + timesPos, extra.size() - 28 - timesPos); ntfsLength += 28; // now set the tag data extra[timesPos] = static_cast(QUAZIP_EXTRA_NTFS_TIME_MAGIC); extra[timesPos + 1] = static_cast(QUAZIP_EXTRA_NTFS_TIME_MAGIC >> 8); // the size: extra[timesPos + 2] = 24; extra[timesPos + 3] = 0; // zero the record memset(extra.data() + timesPos + 4, 0, 24); ntfsTimesLength = 24; } if (ntfsTimesLength < 24) { // Broken times field. OK, this is really unlikely, but just in case... size_t timesEnd = timesPos + 4 + ntfsTimesLength; extra.resize(extra.size() + (24 - ntfsTimesLength)); // Move it! // 0 ......... timesPos .... timesPos + 4 .. timesEnd //