ColorCode-0.8.7/0000755000175000017500000000000014527705423012054 5ustar dirkdirkColorCode-0.8.7/build_qmake/0000755000175000017500000000000014527705434014333 5ustar dirkdirkColorCode-0.8.7/COPYING0000644000175000017500000010451312610736534013111 0ustar dirkdirk 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 . ColorCode-0.8.7/build_cmake/0000755000175000017500000000000014527705430014311 5ustar dirkdirkColorCode-0.8.7/src/0000755000175000017500000000000014527705442012644 5ustar dirkdirkColorCode-0.8.7/src/buttonscell.h0000644000175000017500000000142112610736534015346 0ustar dirkdirk#ifndef BUTTONSCELL_H #define BUTTONSCELL_H #include #include #include "cellbtn.h" class ButtonsCell : public QWidget { Q_OBJECT public: static const int ACTIONID_NONE; static const int ACTIONID_PLAY; static const int ACTIONID_SAVE; static const int ACTIONID_COPY; static const int ACTIONID_DELETE; ButtonsCell(QWidget* parent = 0, int hideBtn = 0); int GetActionId(); signals: void CellButtonClickedSignal(); protected slots: void ButtonClickedSlot(); private: CellBtn *mDeleteBtn; CellBtn *mPlayBtn; CellBtn *mSaveBtn; CellBtn *mCopyBtn; QList mButtonsList; int mActionId; }; #endif // BUTTONSCELL_H ColorCode-0.8.7/src/changelog0000644000175000017500000001667714526106236014532 0ustar dirkdirk* 0.8.6 released, October 18, 2015 * Summary - small refactoring to build with mingw for windows * 0.8.5 released, October 18, 2015 * Summary - first feature complete QT 5 version of ColorCode - adjustments to compile and run with QT 5 * 0.7.2 released, March 18, 2011 * Summary - pause/resume a game - copy game numbers to clipboard - redesigned preferences dialog - some new settings options like cutomized table row highlight colors and the possibility to hide hundredth and tenth of seconds - some minor bug fixes - this is the latest QT 4 version of ColorCode * 0.7.1 released, February 17, 2011 * Summary - bookmark a game after the game has been finished (bug fix) * 0.7.0 released, February 16, 2011 * Summary - threads, game timer, game numbers, highscores, game lists - some refactoring and minor bug fixes * Threads - solver and timer got separate threads to keep the user interface responsive even under heavy load * Game Timer - takes and displays elapsed game time * Highscores - time and game setting will be taken into account * Game Numbers - this enables you to play the very same game at different computers at any time * Game Lists - dialog for highscores, favorites and previous games, you may select any of the games listed and play those again or you may start a game by arbitrary number input * Settings options - games lists and highscore related settings - if you're afraid to remember a game by number, you may hide the game number displayed at the bottom - you may hide the timer to keep calm ;-) * Translation - czech tarnslation updated - thanks to Pavel Fric - french tarnslation updated - thanks to Filippo Rusconi - added hungarian translation (unfinished yet) - thanks to Németh Gábor - added spanish translation (unfinished yet) - thanks to Marcos del Puerto García * 0.6.1 released, February 16, 2010 * Translation - Added french translation - thanks to Filippo Rusconi. * 0.6.0 released, February 14, 2010 * Summary - Second game mode (Computer vs. Human) - Preferences dialog for persistent settings - Additional settings options * Preferences dialog - To examine all available settings options, a preferences dialog has been introduced. - The chosen preferences/settings are now persistent, so when starting the application, the last used settings are applied. * Settings options - Game modes (Human vs Computer or Computer versus Human) - To get a fair chance you may select a weaker solver strength level for your computer opponent ;-) - Let an impartial part :-) of your computer determine the corresponding hints for the computer's guess. This option affects only Computer vs. Human games. If checked, you only have to place your secret combination. Then the rest of the game runs automatically until the end. - To better watch your computer trying hard to break your code, you may define a timeout between the guesses - Select letters or numbers as text indicators and - if convenient - do not use colors as indicators at all - but it's still ColorCode ;-) * Layout/Design - Some minor changes and new buttons for the second game mode. * 0.5.5 released, October 31, 2009 * Summary - Accessibility and usability improvements * Settings options - For the color sensitive of us ;-) the posibility to change the color order by drag and drop has been added. - Press CTRL while dragging to flip two colors or CTRL+SHIFT to cyclic shift the color order. You can do this even while a game is running - the whole existing display will change. - New 'Reset Color Order' option in the settings menu to revert your changes. - Also - and more important - for the more text aimed a settings option has been added, to toggle the display of letter indicators for the different peg colors. - Make the documentations page accessible from the game's help menu. * Layout/Design - Some minor changes. * 0.5 released, October 21, 2009 * Summary - The number of columns in the game is now customizable. The column count can be any number from 2 untill 5. - Updated translation files * Solver - Changed how the solver determines the first guess. Also - for the following really calculated guesses - if the number of possibilities is very high (mostly at the early phase of a 10 colors/ 5 columns game) the solver will automatically fallback to a weaker algorithm until the number of possibilities has been narrowed, to reduce calculating time * Layout/Design - Some minor changes to handle the variable number of columns. Added toolbar controls to enable the change of all level related settings here. The statusbar now permanently shows the current game's settings. * 0.4 released, October 7, 2009 * Summary - The GUI has been changed completely and the Usability was improved by adding some keyboard shortcuts for often needed interactions. - Added czech translation. Thanks to Pavel Fric. * Fixes - To avoid those 'QGraphicsItem::ungrabMouse: not a mouse grabber' warnings emit the mouse event only if the hint button hasn't been disabled just before ... * License - The License had been changed from the GPL v2 to GPL v3. * Layout/Design - Complete Change, so all paint methods had to be changed and optimized. The background is now drawn by its own class, no more brushed metall background image anymore. * 0.3 released, September 26, 2009 * Summary - Introduced a rather perfect MasterMind solver. It will watch any move you take and any hints you have gotten, so you can at any time in a running game let your computer guess for you. Of course you can change or discard it's suggestion :-) . * Solver - The solver has 3 built in levels of stregth. For the suggestions, currently only the most powerfull is used. For the first guess it will use a reasonable random guess based on pre- calculated combinations to reduce computation time. * Layout/Design - Make the solver's guess action accessible at the toolbar. * 0.2 released, September 10, 2009 * Summary - Added 3 levels of difficulty (Easy, Medium, Hard) based on the possibility to change the available number of colors for a game. You can play games with 6, 8 or 10 colors. * Layout/Design - Added a combo-box (select) control to the toolbar, to easily access the level (color count) settings. - Enable hiding the menubar, toolbar and statusbar. - Changed to a centered layout (message display and game board). * 0.1 released, September 6, 2009 * Summary - This is the initial release of ColorCode, a free MasterMind clone. Try to guess a combination of 8 colors within at most 10 guesses. - You may allow or not pegs of the same color. You can fill the rows by random or duplicate a previous one. * GUI - English and German translations are available. ColorCode-0.8.7/src/gamenodisplay.h0000644000175000017500000000221212610736534015643 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef GAMENODISPLAY_H #define GAMENODISPLAY_H #include #include #include #include class GameNoDisplay : public QGraphicsTextItem { Q_OBJECT public: GameNoDisplay(QGraphicsItem* parent = 0); void ShowStr(QString str); private: QFont mFont; QRectF mUpdateRect; }; #endif // GAMENODISPLAY_H ColorCode-0.8.7/src/gametablesdialog.cpp0000644000175000017500000004356414526106236016643 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "gametablesdialog.h" #include "ui_gametablesdialog.h" #include "gametableview.h" #include "highscoresmodel.h" #include "prevgamesmodel.h" #include "savedgamesmodel.h" #include "buttondelegate.h" #include "ccsolver.h" #include "ccgame.h" #include "settings.h" const int GameTablesDialog::TABIX_INPUT = 0; const int GameTablesDialog::TABIX_PREVIOUS = 1; const int GameTablesDialog::TABIX_BOOKMARKS = 2; const int GameTablesDialog::TABIX_HIGHSCORES = 3; GameTablesDialog::GameTablesDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f), ui(new Ui::GameTablesDialog) { ui->setupUi(this); Init(); } GameTablesDialog::~GameTablesDialog() { delete ui; } void GameTablesDialog::Init() { setModal(true); setMouseTracking(true); setAttribute(Qt::WA_Hover, true); setAttribute(Qt::WA_AlwaysShowToolTips, true); mLastGameProperties = NULL; ui->mDescriptionTe->setFocusPolicy(Qt::NoFocus); ui->mDescriptionTe->setAttribute(Qt::WA_TransparentForMouseEvents); ui->mDescriptionTe->setText(tr("Insert an arbitrary game number greater than 0 in the input field above.

" "The game properties like color count, slot count etc. will be displayed in the corresponding area above.

" "Click the Play button or press key Enter, to play the game. If a game is currently running, it will be aborted.")); ui->mGameNoLe->setValidator(new QIntValidator(1, INT_MAX, this)); connect(ui->mGameNoLe, SIGNAL(textChanged(const QString)), this, SLOT(GameNoInpChangedSlot(const QString))); mPrevTableView = new GameTableView(); mPrevTableView->SetGamesListModel(GetPrevGamesModel()); mPrevTableView->setColumnWidth(GetPrevGamesModel()->GetColIx(GamesListModel::COL_RANKING), 20); mPrevTableView->setColumnWidth(GetPrevGamesModel()->GetColIx(GamesListModel::COL_DATE), 90); mPrevTableView->setColumnWidth(GetPrevGamesModel()->GetColIx(GamesListModel::COL_TIME), 90); mPrevTableView->setColumnWidth(GetPrevGamesModel()->GetColIx(GamesListModel::COL_DELETE), 40); mPrevTableView->setItemDelegateForColumn(GetPrevGamesModel()->GetColIx(GamesListModel::COL_RANKING), new ButtonDelegate()); mPrevTableView->setItemDelegateForColumn(GetPrevGamesModel()->GetColIx(GamesListModel::COL_DATE), new ButtonDelegate()); mPrevTableView->setItemDelegateForColumn(GetPrevGamesModel()->GetColIx(GamesListModel::COL_TIME), new ButtonDelegate()); mPrevTableView->setItemDelegateForColumn(GetPrevGamesModel()->GetColIx(GamesListModel::COL_DELETE), new ButtonDelegate()); GetPrevGamesModel()->SetView(mPrevTableView); ui->mPrevTab->layout()->addWidget(mPrevTableView); connect(mPrevTableView, SIGNAL(HoverRowSignal(int)), this, SLOT(HoverRowSlot(int))); connect(GetPrevGamesModel(), SIGNAL(CloseEditorSignal(QModelIndex)), mPrevTableView, SLOT(CloseEditorSlot(QModelIndex))); connect(GetPrevGamesModel(), SIGNAL(NewGameInputSignal(CCGame*)), this, SLOT(NewGameInputSlot(CCGame*))); mSavedTableView = new GameTableView(); mSavedTableView->SetGamesListModel(GetSavedGamesModel()); mSavedTableView->setColumnWidth(GetSavedGamesModel()->GetColIx(GamesListModel::COL_GAMENO), 70); mSavedTableView->setColumnWidth(GetSavedGamesModel()->GetColIx(GamesListModel::COL_CCNT), 50); mSavedTableView->setColumnWidth(GetSavedGamesModel()->GetColIx(GamesListModel::COL_PCNT), 50); mSavedTableView->setColumnWidth(GetSavedGamesModel()->GetColIx(GamesListModel::COL_DOUBLES), 30); mSavedTableView->setColumnWidth(GetSavedGamesModel()->GetColIx(GamesListModel::COL_DELETE), 40); mSavedTableView->setItemDelegateForColumn(GetSavedGamesModel()->GetColIx(GamesListModel::COL_GAMENO), new ButtonDelegate()); mSavedTableView->setItemDelegateForColumn(GetSavedGamesModel()->GetColIx(GamesListModel::COL_CCNT), new ButtonDelegate()); mSavedTableView->setItemDelegateForColumn(GetSavedGamesModel()->GetColIx(GamesListModel::COL_PCNT), new ButtonDelegate()); mSavedTableView->setItemDelegateForColumn(GetSavedGamesModel()->GetColIx(GamesListModel::COL_DOUBLES), new ButtonDelegate()); mSavedTableView->setItemDelegateForColumn(GetSavedGamesModel()->GetColIx(GamesListModel::COL_DELETE), new ButtonDelegate()); GetSavedGamesModel()->SetView(mSavedTableView); ui->mSavedTab->layout()->addWidget(mSavedTableView); connect(mSavedTableView, SIGNAL(HoverRowSignal(int)), this, SLOT(HoverRowSlot(int))); connect(GetSavedGamesModel(), SIGNAL(CloseEditorSignal(QModelIndex)), mSavedTableView, SLOT(CloseEditorSlot(QModelIndex))); connect(GetSavedGamesModel(), SIGNAL(NewGameInputSignal(CCGame*)), this, SLOT(NewGameInputSlot(CCGame*))); mHighTableView = new GameTableView(); mHighTableView->SetGamesListModel(GetHighScoresModel()); mHighTableView->setColumnWidth(GetHighScoresModel()->GetColIx(GamesListModel::COL_RANKING), 20); mHighTableView->setColumnWidth(GetHighScoresModel()->GetColIx(GamesListModel::COL_SCORE), 60); mHighTableView->setColumnWidth(GetHighScoresModel()->GetColIx(GamesListModel::COL_USERNAME), 120); mHighTableView->setColumnWidth(GetHighScoresModel()->GetColIx(GamesListModel::COL_DELETE), 40); mHighTableView->setItemDelegateForColumn(GetHighScoresModel()->GetColIx(GamesListModel::COL_RANKING), new ButtonDelegate()); mHighTableView->setItemDelegateForColumn(GetHighScoresModel()->GetColIx(GamesListModel::COL_SCORE), new ButtonDelegate()); mHighTableView->setItemDelegateForColumn(GetHighScoresModel()->GetColIx(GamesListModel::COL_USERNAME), new ButtonDelegate()); mHighTableView->setItemDelegateForColumn(GetHighScoresModel()->GetColIx(GamesListModel::COL_DELETE), new ButtonDelegate()); GetHighScoresModel()->SetView(mHighTableView); ui->mHighTab->layout()->addWidget(mHighTableView); connect(mHighTableView, SIGNAL(HoverRowSignal(int)), this, SLOT(HoverRowSlot(int))); connect(GetHighScoresModel(), SIGNAL(CloseEditorSignal(QModelIndex)), mHighTableView, SLOT(CloseEditorSlot(QModelIndex))); connect(GetHighScoresModel(), SIGNAL(NewGameInputSignal(CCGame*)), this, SLOT(NewGameInputSlot(CCGame*))); connect(GetHighScoresModel(), SIGNAL(ValidNameCommitSignal()), this, SLOT(ValidNameCommitSlot())); connect(GetPrevGamesModel(), SIGNAL(SaveListGameSignal(CCGame*)), this, SLOT(InsertSavedGameSlot(CCGame*))); connect(GetHighScoresModel(), SIGNAL(SaveListGameSignal(CCGame*)), this, SLOT(InsertSavedGameSlot(CCGame*))); connect(ui->mTabsWidget, SIGNAL(currentChanged(int)), this, SLOT(CurrentTabChanged(int))); connect(ui->mCloseBtn, SIGNAL(clicked()), this, SLOT(OkBtnSlot())); connect(ui->mClearBtn, SIGNAL(clicked()), this, SLOT(ClearListSlot())); connect(ui->mPlayBtn, SIGNAL(clicked()), this, SLOT(PlayInputSlot())); } void GameTablesDialog::ShowTab(int tabix) { if (ui->mTabsWidget->currentIndex() != tabix) { ui->mTabsWidget->setCurrentIndex(tabix); } else { CurrentTabChanged(tabix); } show(); } void GameTablesDialog::ShowInputSlot() { ShowTab(TABIX_INPUT); } void GameTablesDialog::ShowPrevSlot() { ShowTab(TABIX_PREVIOUS); } void GameTablesDialog::ShowSavedSlot() { ShowTab(TABIX_BOOKMARKS); } void GameTablesDialog::ShowHighSlot() { ShowTab(TABIX_HIGHSCORES); } void GameTablesDialog::HoverRowSlot(const int row) { if (row > -1) { GamesListModel* glm = GetCurModel(); if (glm != NULL) { SetGameProperties(glm->GetGameAt(row)); } else { SetGameProperties(NULL); } } else { SetGameProperties(NULL); } } GamesListModel* GameTablesDialog::GetCurModel() const { GamesListModel* glm; int ix = ui->mTabsWidget->currentIndex(); if (ix == TABIX_PREVIOUS) { glm = qobject_cast(GetPrevGamesModel()); } else if (ix == TABIX_BOOKMARKS) { glm = qobject_cast(GetSavedGamesModel()); } else if (ix == TABIX_HIGHSCORES) { glm = qobject_cast(GetHighScoresModel()); } else { glm = NULL; } return glm; } GameTableView* GameTablesDialog::GetCurView() const { GameTableView* gtv; int ix = ui->mTabsWidget->currentIndex(); if (ix == TABIX_PREVIOUS) { gtv = qobject_cast(mPrevTableView); } else if (ix == TABIX_BOOKMARKS) { gtv = qobject_cast(mSavedTableView); } else if (ix == TABIX_HIGHSCORES) { gtv = qobject_cast(mHighTableView); } else { gtv = NULL; } return gtv; } void GameTablesDialog::SetGameProperties(const CCGame* g) { if (g != NULL && g->IsValidGame()) { if (mLastGameProperties == NULL || mLastGameProperties != g) { mLastGameProperties = const_cast(g); int ix = ui->mTabsWidget->currentIndex(); switch (ix) { case TABIX_PREVIOUS: case TABIX_BOOKMARKS: ui->mUserValLbl->setText(""); ui->mDurationValLbl->setText(""); ui->mDateValLbl->setText(g->GetDateTimeStr()); break; case TABIX_HIGHSCORES: ui->mUserValLbl->setText(g->GetCCUserName()); ui->mDurationValLbl->setText(FormatDuration(g->mDuration)); ui->mDateValLbl->setText(g->GetDateTimeStr()); break; case TABIX_INPUT: ui->mDateValLbl->setText(""); break; } ui->mColorCntValLbl->setText(QString::number(g->mColorCnt)); ui->mPegCntValLbl->setText(QString::number(g->mPegCnt)); QString str = (g->mDoubles == 1) ? tr("Yes") : tr("No"); ui->mDoublesValLbl->setText(str); ui->mGameNoValLbl->setText(QString::number(g->mGameNo)); } } else { mLastGameProperties = NULL; ui->mUserValLbl->setText(""); ui->mColorCntValLbl->setText(""); ui->mPegCntValLbl->setText(""); ui->mDoublesValLbl->setText(""); ui->mGameNoValLbl->setText(""); ui->mDateValLbl->setText(""); ui->mDurationValLbl->setText(""); } } QString GameTablesDialog::FormatDuration(const uint dur) const { QTime t(0, 0, 0, 0); t = t.addMSecs(int(dur)); QString tstr = QString("%1 : %2 : %3 : %4").arg( t.toString("hh"), t.toString("mm"), t.toString("ss"), t.toString("zzz")); return tstr; } void GameTablesDialog::ReadSettingsGamesSlot() { SetSettingsSlot(); GetPrevGamesModel()->ReadList(GetSettings()->mPrevGamesStr); GetSavedGamesModel()->ReadList(GetSettings()->mSavedGamesStr); GetHighScoresModel()->ReadList(GetSettings()->mHighGamesStr); clearFocus(); } void GameTablesDialog::SetSettingsSlot() { GetPrevGamesModel()->SetMaxSize(GetSettings()->mGamesListMaxCnt); GetSavedGamesModel()->SetMaxSize(GetSettings()->mGamesListMaxCnt); GetHighScoresModel()->SetMaxSize(GetSettings()->mGamesListMaxCnt); GetPrevGamesModel()->SetRowHColors(GetSettings()->GetActiveRowHFg(), GetSettings()->GetActiveRowHBg()); GetSavedGamesModel()->SetRowHColors(GetSettings()->GetActiveRowHFg(), GetSettings()->GetActiveRowHBg()); GetHighScoresModel()->SetRowHColors(GetSettings()->GetActiveRowHFg(), GetSettings()->GetActiveRowHBg()); } void GameTablesDialog::InsertHighScoreSlot(CCGame* g) { if (GetSettings()->mHighScoreHandling == Settings::HIGHSCORE_NO) { return; } if (GetHighScoresModel()->IsValidHighScore(g->mScore)) { CCGame game = *g; game.SetUserName(GetSettings()->mHighScoreUserName); if (GetSettings()->mHighScoreHandling != Settings::HIGHSCORE_AUTO || GetSettings()->mHighScoreUserName == "") { ShowTab(GameTablesDialog::TABIX_HIGHSCORES); } GetHighScoresModel()->InsertRow(game); } } void GameTablesDialog::InsertPrevGameSlot(CCGame* g) { CCGame game = *g; game.Anonymize(); GetPrevGamesModel()->InsertRow(game); } void GameTablesDialog::InsertSavedGameSlot(CCGame* g) { CCGame game = *g; game.Anonymize(); game.mTime = QDateTime::currentDateTime().toTime_t(); GetSavedGamesModel()->InsertRow(game); } void GameTablesDialog::OkBtnSlot() { close(); } void GameTablesDialog::ClearListSlot() { GamesListModel* glm = GetCurModel(); if (glm == NULL) { return; } int rcnt = glm->rowCount(); if (rcnt <= 0) { return; } int r = QMessageBox::warning( this, tr("Message"), tr("This will permanently remove all entries from the List.\nDo You want to proceed?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); if (r == QMessageBox::Yes) { rcnt = glm->rowCount(); if (rcnt > 0) { glm->removeRows(0, rcnt); } } } void GameTablesDialog::PlayInputSlot() { if (ui->mTabsWidget->currentIndex() == TABIX_INPUT && ui->mGameNoLe->text() != "") { uint gameno = ui->mGameNoLe->text().toUInt(); if (gameno > 0) { const int* props = ColorCode::INSTANCE->GetCCSolver()->GetGameByNo(gameno); CCGame* g = new CCGame("", 0, 0, gameno, 0, 0, 0, ColorCode::MODE_HVM, props[1], props[2], props[3]); NewGameInputSlot(g); } } } void GameTablesDialog::GameNoInpChangedSlot(const QString &txt) { if (txt != "" && txt.toUInt() > 0) { const int* props = ColorCode::INSTANCE->GetCCSolver()->GetGameByNo(txt.toUInt()); CCGame* g = new CCGame("", 0, 0, txt.toUInt(), 0, 0, 0, ColorCode::MODE_HVM, props[1], props[2], props[3]); SetGameProperties(g); } else { SetGameProperties(NULL); } } void GameTablesDialog::NewGameInputSlot(CCGame* g) { emit NewGameInputSignal(g); close(); } void GameTablesDialog::ValidNameCommitSlot() { if (ui->mTabsWidget->currentIndex() == TABIX_HIGHSCORES) { ui->mCloseBtn->setFocus(); } } void GameTablesDialog::SetRowHeight() { for (int i = 0; i < GetHighScoresModel()->rowCount(); ++i) { mHighTableView->setRowHeight(i, 18); } } void GameTablesDialog::CurrentTabChanged(int ix) { mLastGameProperties = NULL; SetGameProperties(NULL); QString str = ""; QIcon ico; switch (ix) { case TABIX_INPUT: ui->mPlayBtn->setVisible(true); ui->mClearBtn->setVisible(false); ui->mGameNoLe->setFocus(); ui->mUserLbl->setEnabled(false); ui->mDurationLbl->setEnabled(false); ui->mDateLbl->setEnabled(false); GameNoInpChangedSlot(ui->mGameNoLe->text()); str = tr("Game Number Input"); ico = QIcon(":/img/document-new.png"); break; case TABIX_PREVIOUS: ui->mPlayBtn->setVisible(false); ui->mClearBtn->setVisible(true); ui->mUserLbl->setEnabled(false); ui->mDurationLbl->setEnabled(false); ui->mDateLbl->setEnabled(true); str = tr("Recent Games"); ico = QIcon(":/img/history.png"); break; case TABIX_BOOKMARKS: ui->mPlayBtn->setVisible(false); ui->mClearBtn->setVisible(true); ui->mUserLbl->setEnabled(false); ui->mDurationLbl->setEnabled(false); ui->mDateLbl->setEnabled(true); str = tr("Bookmarked Games"); ico = QIcon(":/img/bookmark.png"); break; case TABIX_HIGHSCORES: ui->mPlayBtn->setVisible(false); ui->mClearBtn->setVisible(true); ui->mUserLbl->setEnabled(true); ui->mDurationLbl->setEnabled(true); ui->mDateLbl->setEnabled(true); str = tr("High Score List"); ico = QIcon(":/img/games-highscores.png"); break; default: str = tr("Game Lists"); break; } setWindowTitle(str); setWindowIcon(ico); } void GameTablesDialog::closeEvent(QCloseEvent* e) { GetHighScoresModel()->EditField(); if (GetHighScoresModel()->GetEditIndex().isValid() && GetHighScoresModel()->GetEditValue() == "") { e->ignore(); int r = QMessageBox::warning( this, tr("Message"), tr("Please provide a name!\nOtherwise your score won't be saved."), QMessageBox::Ok | QMessageBox::Discard, QMessageBox::Ok); if (r == QMessageBox::Discard) { GetHighScoresModel()->removeRows(GetHighScoresModel()->GetEditIndex().row(), 1); e->accept(); } else { GetHighScoresModel()->EditField(); } } else { GetHighScoresModel()->SetEditIndex(QModelIndex()); e->accept(); } } void GameTablesDialog::reject() { close(); } void GameTablesDialog::changeEvent(QEvent *e) { QDialog::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: ui->retranslateUi(this); break; default: break; } } ColorCode-0.8.7/src/settings.h0000644000175000017500000000553112610736534014656 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef SETTINGS_H #define SETTINGS_H #include #include #include "ccgame.h" class Settings : public QObject { Q_OBJECT public: Settings(); ~Settings(); static const int INDICATOR_LETTER; static const int INDICATOR_NUMBER; static const int DEF_COLOR_CNT; static const int DEF_PEG_CNT; static const int DEF_DOUBLES; static const int DEF_LIST_MAX_CNT; static const int HIGHSCORE_NO; static const int HIGHSCORE_PROMPT; static const int HIGHSCORE_AUTO; static const int MAX_LENGTH_USERNAME; void Init(); void InitSettings(); void ReadSettings(); void Validate(); void SaveLastSettings(); void RestoreLastSettings(); void RestoreDefSettings(); void WriteSettings(); QMap GetDefaultsMap() const; CCGame* GetCurSettingsGame() const; QString GetActiveRowHFg() const; QString GetActiveRowHBg() const; QSettings mSettings; bool mShowToolBar; bool mShowMenuBar; bool mShowStatusBar; bool mShowTimer; bool mShowTenth; bool mShowGameNo; bool mShowIndicators; int mIndicatorType; bool mHideColors; bool mCustomRowHColor; QString mRowHColorFg; QString mRowHColorBg; int mPegCnt; int mColorCnt; bool mDoubles; int mGameMode; bool mAutoClose; bool mAutoHints; int mSolverStrength; int mHintsDelay; QString mPrevGamesStr; QString mSavedGamesStr; QString mHighGamesStr; int mGamesListMaxCnt; int mHighScoreHandling; QString mHighScoreUserName; public slots: signals: void ReadSettingsGamesDone(); private: void RestoreSettingsMap(QMap &map); void SaveSettingsMap(QMap &map); QMap mDefMap; QMap mLastMap; }; Settings* GetSettings(); #endif // SETTINGS_H ColorCode-0.8.7/src/timedisplay.cpp0000644000175000017500000001000314525377062015667 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "timedisplay.h" #include "gametimer.h" TimeDisplay::TimeDisplay(QGraphicsItem* parent) : QGraphicsTextItem(parent) { setAcceptedMouseButtons(Qt::NoButton); setAcceptHoverEvents(false); mFont = QFont("Arial", 18, QFont::Normal, false); mFont.setStyleHint(QFont::SansSerif); mFont.setPixelSize(24); setFont(mFont); setDefaultTextColor(QColor("#d7d8da")); mShowTenth = true; mSs = mLastSs = ""; mHs = ""; mInterval = 50; mPaused = false; mStopped = true; mGameTime = 0; mTime = 0; mTimer = new GameTimer(this); connect(mTimer, SIGNAL(TimeOutSignal(int)), this, SLOT(DisplayTime(int))); mTimer->Start(); setTextWidth(440); setScale(0.5); } TimeDisplay::~TimeDisplay() { } int TimeDisplay::GetGameTime() const { return mGameTime; } bool TimeDisplay::IsActive() const { return (!mPaused && !mStopped); } bool TimeDisplay::IsPaused() const { return mPaused; } bool TimeDisplay::IsStopped() const { return mPaused; } void TimeDisplay::SetTenth(bool b) { mShowTenth = b; } void TimeDisplay::StartT() { mTime = 0; mT0.start(); DisplayTime(); mPaused = false; mStopped = false; } void TimeDisplay::PauseT() { if (!mStopped && !mPaused) { mTime += mT0.restart(); DisplayTime(); mPaused = true; } } void TimeDisplay::ResumeT() { if (mPaused && !mStopped) { mT0.restart(); mPaused = false; } } void TimeDisplay::StopT() { if (!mStopped && !mPaused) { mTime += mT0.restart(); DisplayTime(); mStopped = true; mPaused = false; mTime = 0; } } void TimeDisplay::DisplayTime(int tick) { if (mPaused || mStopped || !mT0.isValid()) { return; } mGameTime = mT0.elapsed() + mTime; mT1 = QTime(0, 0, 0, 0); mT1 = mT1.addMSecs(mGameTime); if (mShowTenth) { if (tick == 0) { mHs = QString::number((int)(mT1.msec()/10)); } else { mHs = QString::number(((int)(mT1.msec()/50))*5); } if (mHs.length() < 2) { mHs.prepend("0"); } } if (isVisible()) { QString tstr; if (!mShowTenth) { mSs = mT1.toString("ss"); if (mSs == mLastSs) { return; } tstr = QString("
%1:%2:%3
").arg( mT1.toString("hh"), mT1.toString("mm"), mSs); mLastSs = mSs; } else { tstr = QString("
%1:%2:%3:%4
").arg( mT1.toString("hh"), mT1.toString("mm"), mT1.toString("ss"), mHs); } setHtml(tstr); } } ColorCode-0.8.7/src/solutionrow.cpp0000644000175000017500000000543612610736534015761 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "solutionrow.h" using namespace std; SolutionRow::SolutionRow(QObject*) { setCacheMode(QGraphicsItem::DeviceCoordinateCache); InitGraphics(); } SolutionRow::~SolutionRow() { } void SolutionRow::InitGraphics() { mRect = QRectF(0.5, 0.5, 219, 39); mRectC = QRectF(2, 2, 216, 36); QLinearGradient solgrad(0, 0, 0, 40); solgrad.setColorAt(0.0, QColor("#9fa0a2")); solgrad.setColorAt(1.0, QColor("#8c8d8f")); mBgBrush = QBrush(solgrad); QLinearGradient framegrad(0, 0, 0, 40); framegrad.setColorAt(0.0, QColor("#4e4f51")); framegrad.setColorAt(1.0, QColor("#ebecee")); mFramePen = QPen(QBrush(framegrad), 1); mFont = QFont("Arial", 22, QFont::Bold, false); mFont.setStyleHint(QFont::SansSerif); mFont.setPixelSize(29); } void SolutionRow::SetXOffs() { mXOffs = 110 - mPegCnt * 20; } QRectF SolutionRow::boundingRect() const { const double margin = 0.5; return mRect.adjusted(-margin, -margin, 2 * margin, 2 * margin); } void SolutionRow::paint(QPainter *painter, const QStyleOptionGraphicsItem* , QWidget* ) { if (mPegCnt == 0) { return; } int i; painter->setBrush(mBgBrush); painter->setPen(mFramePen); painter->drawRoundedRect(mRect, 20, 20); QPainterPath cpath; cpath.addRoundedRect(mRectC, 19, 19); painter->setClipPath(cpath); painter->setRenderHint(QPainter::TextAntialiasing, true); int x0 = (220 - mPegCnt * 40) / 2; int xpos; for (i = 0; i <= mPegCnt; ++i) { xpos = x0 + i * 40; painter->setPen(Qt::NoPen); painter->setBrush(QBrush(QColor(0x7d, 0x7e, 0x80, 0x80))); painter->drawRect(xpos - 1, 1, 1, 38); painter->setBrush(QBrush(QColor(0xc3, 0xc4, 0xc6, 0x80))); painter->drawRect(xpos, 1, 1, 38); if (i < mPegCnt) { painter->setPen(QPen(QColor("#ff9933"))); painter->setFont(mFont); painter->drawText(QRectF(xpos + 3.0, 3.0, 34.0, 34.0), Qt::AlignCenter, QString('?')); } } } ColorCode-0.8.7/src/trans_cs.ts0000644000175000017500000011337614527465645015053 0ustar dirkdirk About &Author &Autor icon ikona &License &Povolení A needful game to train your brain ;-) Hra potřebná pro udržení bdělosti <br>vašeho mozku :-) ColorCode ColorCode About ColorCode O ColorCode <br><br>Free MasterMind clone including a built in,<br>rather intelligent solver. <br><br>Klon Free MasterMind s vestavěným<br>dost schopným řešitelem - počítačem. Version Verze Author Autor 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. Tento program je svobodným. Můžete jej šířit a/nebo upravovat za podmínek GNU General Public License, jak jsou zveřejněny Free Software Foundation, buď podle verze 3 licence nebo (podle své volby) podle jakékoli pozdější verze. ButtonsCell Play this Game again Přehrát tuto hru znovu Save this Game as Bookmark Uložit tuto hru jako záložku Remove from List Odstranit ze seznamu Copy Game Number to Clipboard Kopírovat číslo hry do schránky ColorCode New Game Nová hra Do you want to give in and start a new Game? Chcete vzdát hru a začít novou? About Qt O Qt &New Game &Nová hra Ctrl+N Ctrl+N &Restart Game &Začít hru znovu Ctrl+R Ctrl+R E&xit &Ukončit Ctrl+Q Ctrl+Q Ctrl+T Ctrl+T Ctrl+C Ctrl+C Ctrl+A Ctrl+A About &Qt O &Qt &Game &Hra &Settings &Nastavení &Help &Nápověda Game Hra Message Hlášení The changed settings will only apply to new games! Do you want to give in the current and start a new Game? Změny v nastavení se projeví teprve po novém spuštění hry! Chcete vzdát nynější hru a začít novou? Place Your pegs ... Umístěte své kameny... Congratulation! You have won! Blahopřejeme! Vyhrál jste! Sorry! You lost! Promiňte, ale nezvládl jste to! Ctrl+I Ctrl+I Give In Vzdát se Do you really want to give in? Skutečně chcete hru vzdát? &Throw In The Towel &Vhodit ručník Ctrl+G Ctrl+G Sure, You're too weak for me! Je jasné, že jste pro mě příliš slabý! Ctrl+Shift+R Ctrl+Shift+R Ctrl+Shift+C Ctrl+Shift+C Fill Row by Random Naplnit řádek náhodně Duplicate Previous Row Zdvojit předchozí řádek Ctrl+D Ctrl+D Clear Row Vyprázdnit řádek &Row &Řádek ColorCode ColorCode About &ColorCode O &ColorCode Ctrl+M Ctrl+M Show Toolbar Ukázat nástrojový pruh Show Menubar Ukázat pruh s hlavní nabídkou Show Statusbar Ukázat stavový pruh Allow Pegs of the Same Color Povolit kameny se stejnou barvou Level Stupeň obtížnosti Computer's Guess Nechat počítač hádat Ctrl+H Ctrl+H Press the Hint Field or Key Enter if You're done. Pokud jste hotov, klepněte na pole s radou. Disallow Pegs of the Same Color Zákázat kameny stejné barvy Close Rows when the last Peg is placed Zavřít řádky po umístění posledního kamene Ctrl+L Ctrl+L Beginner (2 Colors, 2 Slots, Doubles) Začátečník (2 barvy, 2 pole, zdvojení) Easy (4 Colors, 3 Slots, No Doubles) Lehká hra (4 barvy, 3 pole, bez zdvojení) Classic (6 Colors, 4 Slots, Doubles) Klasická hra (6 barev, 4 pole, zdvojení) Challenging (8 Colors, 4 Slots, Doubles) Náročná hra (8 barev, 4 pole, zdvojení) Hard (10 Colors, 5 Slots, Doubles) Těžká hra (10 barev, 5 polí, zdvojení) Level Presets Přednastavení stupně obtížnosti Colors barev Pegs of Same Color Kameny téže barvy Slots pole Yes Ano No Ne Reset Color Order Znovu nastavit pořadí barev Ctrl+Shift+L Ctrl+Shift+L Online &Help &Nápověda po internetu F1 F1 Done Hotovo Ctrl+Shift+N Ctrl+Shift+N Rate it for me Ohodnoť to pro mě Human vs Computer Člověk proti počítači Computer vs Human Počítač proti člověku Game Mode Herní režim Press the button below or Key Enter if You're done. Pokud jste hotov, použijte tlačítko dole nebo klávesu Enter. Place Your secret ColorCode ... Umístěte svůj tajný ColorCode... Please rate the guess. Press OK or Key Enter if You're done. Ohodnoťte, prosím, můj návrh. Pokud jste hotov, použijte tlačítko OK nebo klávesu Enter. The impossible happened, sorry. Bohužel se stalo nemožné. Yeah! I guessed it, man! Jo! Já to tušil! Embarrassing! I lost a game! Trapné! Já tu hru ztratil! Nope! Thats impossible! Did you gave me false hints? Ne! To není možné! Dal jste mi špatné rady? Don't you like to see me winning? ;-) Nelíbí se vám, když vyhrávám? :-) Set Hints automatically Nastavit rady automaticky Ctrl+Shift+H Ctrl+Shift+H Preferences Nastavení Ctrl+P Ctrl+P Show Indicators Ukázat ukazatele The chosen settings do not allow pegs of the same color! Zvolená nastavení nedovolují kameny stejné barvy. &Start particular Game &Spustit zvláštní hru &Bookmark current Game Přidat nynější hru do &záložek Ctrl+B Ctrl+B Ctrl+Alt+H Ctrl+Shift+H &Recent Games &Nedávné hry Ctrl+Alt+R Ctrl+Alt+R &Bookmarks &Záložky Ctrl+Alt+B Ctrl+Alt+B Ctrl+Shift+S Ctrl+Shift+S Game &Lists &Seznamy guessed and rated ... Uhádnuté a hodnocené... Let me think ... Nech mě přemýšlet... Computer vs. Human Člověk proti počítači &Highscores &Nejlepší výsledky Ctrl+Shift+B Ctrl+Shift+B Ctrl+Alt+N Ctrl+Alt+N &Have a Break &Přestávka na přemýšlení &Bookmark Current Game Přidat nynější hru do &záložek Ctrl+Shift+T Ctrl+Shift+T Show Timer Ukázat časomíru Display Game Number Zobrazit číslo hry Allow Pegs of Same Color Povolit kameny téže barvy Disallow Pegs of Same Color Zákázat kameny stejné barvy Ctrl+Alt+C Ctrl+Alt+C Ctrl+Shift+P Ctrl+Shift+P &Resume Game &Pokračovat ve hře Human vs. Computer Člověk proti počítači Game Number Číslo hry Paused Pozastaveno &Copy Game Number &Kopírovat číslo hry GameNoDisplay Human vs. Computer Člověk proti počítači Game Number Číslo hry GameTablesDialog ColorCode Games Hry ColorCode Game Properties Vlastnosti hry User Uživatel Color Count Počet barev Slot Count Počet polí Pegs of Same Color Kameny téže barvy Yes Ano Game Number Číslo hry Date and Time Datum a čas Duration Doba trvání Insert Game Number Vložit číslo hry Play Přehrát Recent Games Nedávné hry Bookmarks Záložky Highscores Nejlepší výsledky Clear List Smazat seznam Close Zavřít No Ne Message Hlášení This will permanently remove all entries from the List. Do You want to proceed? Tímto budou všechny záznamy trvale odstraněny ze seznamu. Chcete pokračovat? Game Number Input Zadání čísla hry Bookmarked Games Hry přidané do záložek High Score List Seznam nejlepších výsledků Please provide a name! Otherwise your score won't be saved. Poskytněte, prosím, název! V opačném případě váš výsledek nebude uložen. Insert an arbitrary game number greater than 0 in the input field above. <br><br>The game properties like color count, slot count etc. will be displayed in the corresponding area above.<br><br>Click the Play button or press key Enter, to play the game. If a game is currently running, it will be aborted. Vložte do zadávacího pole výše libovolné číslo hry větší než 0. <br><br>Vlastnosti hry, jako jsou počet barev, počet polí atd., budou zobrazeny v odpovídající oblasti výše. <br><br>Klepněte na tlačítko Přehrát nebo stiskněte klávesu Enter, aby se hra začala přehrávat. Pokud hra již běží, bude zrušena. Game Lists Seznamy GamesListModel Yes Ano No Ne Pegs of Same Color Kameny téže barvy Actions Činnosti Rank Hodnost User Uživatel Score Výsledek Date Datum Time Čas Colors Barvy Slots Pole Game No. Číslo hry PrefDialog ... Select from predefined level settings ... Vybrat stupeň obtížnosti Beginner (2 Colors, 2 Slots, Doubles) Začátečník (2 barvy, 2 pole, zdvojení) Easy (4 Colors, 3 Slots, No Doubles) Lehká hra (4 barvy, 3 pole, bez zdvojení) Classic (6 Colors, 4 Slots, Doubles) Klasická hra (6 barev, 4 pole, zdvojení) Challenging (8 Colors, 4 Slots, Doubles) Náročná hra (8 barev, 4 pole, zdvojení) Hard (10 Colors, 5 Slots, Doubles) Těžká hra (10 barev, 5 polí, zdvojení) Slots pole Colors barev Human vs. Computer Člověk proti počítači Computer vs. Human Člověk proti počítači Low Nízká Medium Střední High Vysoká Preferences Nastavení Appearance Vzhled Controls Ovládací prvky Show or hide the Menubar. Ukázat nebo skrýt pruh s hlavní nabídkou. Show Menubar Ukázat pruh s hlavní nabídkou Show or hide the Toolbar. Ukázat nebo skrýt nástrojový pruh. Show Toolbar Ukázat nástrojový pruh Show or hide the Statusbar. Ukázat nebo skrýt stavový pruh. Show Statusbar Ukázat stavový pruh Indicators Ukazatelé If this option is checked, an indicator inside each peg is displayed. Když je zapnuta tato volba, je u každého kamene zobrazen dodatečný ukazatel. Show Indicators inside pegs Ukázat dodatečné ukazatele pro kameny Use unique letters as indicators. Použít písmena jako ukazatele. Letter Indicators Písmenní ukazatelé Use unique numbers as indicators. Použít čísla jako ukazatele. Number Indicators Číselní ukazatelé Use the same neutral background color for each peg, when indicators are shown. Pro všechny kameny použít, v případě že jsou zobrazováni ukazatelé, stejnou nenápadnou barvu pozadí. Hide Colors Skrýt barvy Click here if you have changed the color order and now you want to revert it to it's initial state. Klepněte sem, pokud jste změnil pořadí barev, a nyní to chcete vrátit do počátečního stavu. Reset Color Order Znovu nastavit pořadí barev Game Settings Herní nastavení Level Presets Přednastavení stupně obtížnosti Select from predefined combinations of the three different level related settings, the number of colors, the number of slots (columns) and the possibility of pegs of the same color in one row. Vyberte z přednastavených spojení tří různých nastavení souvisejících se stupni obtížnosti: počet barev, počet polí (sloupců) a možnost kamenů stejné barvy v jednom řádku. Number of Slots Počet polí Number of Colors Počet barev Number of pegs in a single row. Higher values are harder to guess. Počet kamenů v jednom řádku. Vyšší hodnoty je těžší uhodnout. Number of all possible colors. Higher values are harder to guess. Celkový počet všech možných barev. Vyšší hodnoty je těžší uhodnout. If this option is checked, the hidden combination may contain one or more (even all would be possible) pegs of the same color. If checked, the combination is generally harder to guess. Když je zapnuta tato volba, skryté spojení může obsahovat jeden nebo více kamenů stejné barvy (dokonce je možné, že všechny). Je-li zaškrtnuto, je spojení obecně obtížněji uhodnutelné. Allow Pegs of Same Color Povolit kameny téže barvy Game Mode Herní režim Select from the different game modes. In the 1. mode you have to to guess the hidden, computer generated combination, In the 2. mode your computer will try to guess your own secret combination. Vyberte z různých herních režimů. V prvním režimu musíte uhodnout skryté, počítačem vytvořené spojení. Ve druhém režimu se počítač pokusí uhodnout vaše vlastní tajné spojení. If checked, a row is closed as soon as you place the last peg and your guess is submitted immediatly. This option only affects the Human vs. Computer game mode. Když je zapnuta tato volba, je řádek uzavřen, jakmile umístíte poslední kámen a váš herní tah je okamžitě vyhodnocen. Tato volba účinkuje pouze v herním režimu, kdy hraje člověk proti počítači. Close Rows when the last Peg is placed Zavřít řádky po umístění posledního kamene If checked, the computer will determine the corresponding hints for the solver's guess. This option affects only Computer vs. Human games. If checked, you only have to place your secret combination. Then the rest of the game runs automatically until the end. But you can set a delay between the guesses. Je-li zapnuta tato volba, budou automaticky vyplněna pole s odpovídajícími radami pro odhad řešitele - počítače. Tato volba účinkuje pouze při hře počítače proti člověku. Je-li zaškrtnuta, musíte pouze umístit své tajné spojení. Pak běží zbytek hry automaticky až do konce. Ovšem mezi herními tahy můžete nastavit zpoždění. Set Hints automatically Nastavit rady automaticky Adjust the delay (in ms) between two guesses. Upravit zpoždění v milisekundách mezi dvěma herními tahy. Delay in ms Zpoždění v ms Solver Strength Síla počítače Select from 3 different strength levels for your computer opponent. This option only affects the Computer vs. Human game mode. For the computer's guess in the Human vs. Computer mode always the highest level will be used. Vyberte jednu ze tří různých herních sil pro vašeho počítačového protivníka. Tato volba účinkuje pouze v herním režimu, kdy hraje počítač proti člověku. Pro počítačův herní tah v režimu, kdy hraje člověk proti počítači se vždy použije nejvyšší úroveň herní síly. Show Game Timer Ukázat herní časomíru Display Game Number Zobrazit číslo hry Game Lists Seznamy Maximum Row Count: Největší počet řádků: Use Highscores Použít nejlepší výsledky Raise the dialog after a game has been won and prompt for the name Vyvolat dialog poté, co hra byla vyhrána, a pobídnout k napsání jména Automatically insert Highscores using the name below Automaticky vložit nejlepší výsledky a přitom použít jméno níže Name (mandatory for the second option) Jméno (povinné pro druhou volbu) User Interface Uživatelské rozhraní Display the current game number in the footer. To avoid remembering, you can hide it here. Zobrazit číslo současné hry v zápatí. Můžete je nechat zde, abyste si je nemusel pamatovat. Timer Časomíra You may hide the timer to keep calm ;-) But note! Even hidden, time's running in the background. Můžete skrýt časomíru, abyste byl víc v klidu. :-) Ale uvědomte si, že i když bude skrytá, čas pořád poběží na pozadí. Game Properties Vlastnosti hry Select One of the Level Presets: Vybrat jedno z přednastavení hry: Or Set the Particular Properties: Nebo nastavit zvláštní vlastnosti: Game Flow Tok hry Solver Počítač Limit the number of rows in game tables like highscores etc. Valid values range from 5 to 50. Omezit počet řádků v tabulkách ke hře, jako jsou nejlepší výsledky atd. Rozsah použitelných hodnot je od 5 do 50 řádků. Use Customized Table Row Highlight Colors Použít uživatelsky stanovené barvy pro zvýraznění řádků v tabulkách Foreground Popředí Background Pozadí Highscores Nejlepší výsledky Provide a name with maximum 20 characters here to be used for highscore entries. If you checked the automatic option above, this name is mandatory, otherwise it will be used as proposal which you may change later in the dialog. Zde napište název, který bude mít nejvíc 20 znaků, který se použije pro záznamy v nejlepších výsledcích. Pokud jste zaškrtli automatickou volbu výše, je tento název povinný, v opačném případě se použije jako návrh, jejž můžete později změnit. Uncheck this if you are confused about the time as fast running ;-) Pokud by vás ukazatel času měl zneklidňovat, zrušte zaškrtnutí této volby Show Tenth and Hundredth Ukázat desetiny a setiny sekund RowHint Commit Your solution Vyzkoušet své řešení Click the circles to rate my guess. Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-) Klepněte na kruhy pro vyhodnocení mého herního tahu. Stiskněte Ctrl+H nebo odpovídající tlačítko v nástrojovém pruhu, abyste přenesl onu záležitost s vyhodnocením na tu moji část, která je v tomto případě zcela nestranná. :-) ColorCode-0.8.7/src/graphicsbtn.h0000644000175000017500000000426212610736534015322 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef GRAPHICSBTN_H #define GRAPHICSBTN_H #include #include #include #include #include #include #include class GraphicsBtn : public QObject, public QGraphicsItem { Q_OBJECT Q_INTERFACES(QGraphicsItem) public: GraphicsBtn(); void SetEnabled(bool b); void SetWidth(int w); void SetLabel(QString str); void ShowBtn(bool b); void SetStatesOpacity(const qreal opOver, const qreal opOut); void InvertStates(); void SetHoverState(); void SetOutState(); void SetPressedState(); void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); QRectF boundingRect() const; signals: void BtnPressSignal(GraphicsBtn* btn); protected: void hoverEnterEvent(QGraphicsSceneHoverEvent* e); void hoverLeaveEvent(QGraphicsSceneHoverEvent* e); void mousePressEvent(QGraphicsSceneMouseEvent* e); void mouseReleaseEvent(QGraphicsSceneMouseEvent* e); virtual void InitGraphics(); virtual void SetShapes(); QString mLabel; int mWidth; int mLabelWidth; int mYOffs; qreal mOpOver; qreal mOpOut; QRectF mRect; QRectF mRectFill; QRectF mIconRect; QBrush mFillOutBrush; QBrush mFillOverBrush; QBrush* mFillBrush; QBrush mFrameOutBrush; QBrush mFrameOverBrush; QBrush* mFrameBrush; QFont mFont; }; #endif // GRAPHICSBTN_H ColorCode-0.8.7/src/CMakeLists.txt0000644000175000017500000000436214527704234015407 0ustar dirkdirkcmake_minimum_required(VERSION 3.5.0) project(colorcode VERSION 0.8.7 LANGUAGES CXX) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) find_package(Qt5 COMPONENTS Core REQUIRED) find_package(Qt5 COMPONENTS Gui REQUIRED) find_package(Qt5 COMPONENTS Widgets REQUIRED) find_package(Qt5 COMPONENTS LinguistTools REQUIRED) set(QMDIR "${CMAKE_CURRENT_BINARY_DIR}/.qm") file(MAKE_DIRECTORY ${QMDIR}) set(TS_FILES trans_de.ts trans_en.ts trans_cs.ts trans_fr.ts trans_hu.ts trans_es.ts ) set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${QMDIR}) qt5_add_translation(QMFILES ${TS_FILES}) set(QMRESFILE "${QMDIR}/cmake_translations.qrc") file(WRITE ${QMRESFILE} "\n\n") foreach(QMFILE ${QMFILES}) file(RELATIVE_PATH QMFILE_NAME ${QMDIR} ${QMFILE}) file(APPEND ${QMRESFILE} " ${QMFILE}\n") endforeach(QMFILE) file(APPEND ${QMRESFILE} "\n\n") qt_add_resources(TRANSRES ${QMRESFILE}) qt5_wrap_ui(UIS_HDRS about.ui prefdialog.ui gametablesdialog.ui ) add_executable(colorcode ${TRANSRES} ${UIS_HDRS} about.cpp colorcode.cpp colorpeg.cpp main.cpp msg.cpp pegrow.cpp rowhint.cpp ccsolver.cpp background.cpp solutionrow.cpp graphicsbtn.cpp settings.cpp prefdialog.cpp pegfactory.cpp gamenodisplay.cpp timedisplay.cpp timedisplaybg.cpp highscore.cpp ccgame.cpp buttonscell.cpp buttondelegate.cpp cellbtn.cpp gametimer.cpp savedgamesmodel.cpp prevgamesmodel.cpp highscoresmodel.cpp gametableview.cpp gametablesdialog.cpp gameslistmodel.cpp docs/GPL.html resource.qrc ) target_link_libraries(colorcode Qt5::Widgets Qt5::Gui Qt5::Core ) target_compile_options(colorcode BEFORE PUBLIC -pipe -O3 -Wall -Wextra -D_REENTRANT -fPIC ) # target_compile_options(colorcode PUBLIC -O3) ColorCode-0.8.7/src/rowhint.h0000644000175000017500000000373412610736534014513 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef ROWHINT_H #define ROWHINT_H #include #include #include #include #include #include #include "colorcode.h" class RowHint : public QObject, public QGraphicsItem { Q_OBJECT Q_INTERFACES(QGraphicsItem) public: RowHint(QObject* parent = 0); ~RowHint(); int mIx; bool mActive; bool mSolved; std::vector mHints; int GetIx() const; bool IsActive() const; std::vector GetHints(); void SetIx(const int ix); void SetPegCnt(const int pegcnt); void SetGameMode(const int gamemode); void SetActive(bool b); void SetPaused(const bool b); void DrawHints(std::vector res); void Reset(const int pegcnt, const int gamemode); void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); QRectF boundingRect() const; QPainterPath shape() const; signals: void HintPressedSignal(int ix); protected: void mousePressEvent(QGraphicsSceneMouseEvent* e); private: static const int mPegPos[4][5][3]; int mPegCnt; int mGameMode; QPen mPen; QBrush mBrush0; QBrush mBrush1; QRectF outlineRect() const; }; #endif // ROWHINT_H ColorCode-0.8.7/src/pegrow.h0000644000175000017500000000433512610736534014322 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef PEGROW_H #define PEGROW_H #include #include #include #include #include #include #include #include "colorcode.h" class ColorPeg; class PegRow : public QObject, public QGraphicsItem { Q_OBJECT Q_INTERFACES(QGraphicsItem) public: PegRow(QObject* parent = 0); ~PegRow(); int GetIx() const; bool IsActive() const; int GetPegCnt() const; ColorPeg** GetPegs(); std::vector GetSolution() const; void SetIx(const int ix); void SetPegCnt(const int pegcnt); void SetGameMode(const int gamemode); void SetActive(const bool b); bool SnapCP(ColorPeg* cp); void ForceSnap(ColorPeg* cp, int posix); void RemovePeg(ColorPeg* cp); void CloseRow(); void OpenRow(); void ClearRow(); void Reset(const int pegcnt, const int gamemode); void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); QRectF boundingRect() const; QPainterPath shape() const; signals: void RowSolutionSignal(int ix); void RemovePegSignal(ColorPeg* cp); protected: std::vector mSolution; QColor mPend; QColor mPenl; QColor mGrad0; QColor mGrad1; bool mIsActive; bool mSolved; int mIx; int mPegCnt; int mGameMode; int mXOffs; virtual void SetXOffs(); void CheckSolution(); ColorPeg** mColorPegs; QRectF outlineRect() const; }; #endif // PEGROW_H ColorCode-0.8.7/src/prefdialog.ui0000644000175000017500000010164212610736534015320 0ustar dirkdirk PrefDialog Qt::ApplicationModal 0 0 476 527 Preferences :/img/configure.png:/img/configure.png true 0 User Interface Indicators 0 0 If this option is checked, an indicator inside each peg is displayed. Show Indicators inside pegs Qt::Horizontal QSizePolicy::Fixed 20 20 Use unique letters as indicators. Letter Indicators true Qt::Horizontal 40 20 Use unique numbers as indicators. Number Indicators Qt::Horizontal 276 20 Use the same neutral background color for each peg, when indicators are shown. Hide Colors Qt::Horizontal 310 20 0 0 Click here if you have changed the color order and now you want to revert it to it's initial state. Reset Color Order true Controls 0 0 Show or hide the Menubar. Show Menubar 0 0 Show or hide the Toolbar. Show Toolbar 0 0 Show or hide the Statusbar. Show Statusbar Qt::Horizontal QSizePolicy::Fixed 70 20 Qt::Horizontal 40 20 Display the current game number in the footer. To avoid remembering, you can hide it here. Display Game Number Timer 0 0 You may hide the timer to keep calm ;-) But note! Even hidden, time's running in the background. Show Game Timer Qt::Horizontal QSizePolicy::Fixed 20 20 Uncheck this if you are confused about the time as fast running ;-) Show Tenth and Hundredth Qt::Horizontal 245 20 Qt::Vertical 20 40 Game Settings Game Properties Select One of the Level Presets: Select from predefined combinations of the three different level related settings, the number of colors, the number of slots (columns) and the possibility of pegs of the same color in one row. Or Set the Particular Properties: Number of pegs in a single row. Higher values are harder to guess. Number of Slots Number of all possible colors. Higher values are harder to guess. Number of Colors If this option is checked, the hidden combination may contain one or more (even all would be possible) pegs of the same color. If checked, the combination is generally harder to guess. Allow Pegs of Same Color Qt::Horizontal 40 20 Qt::Horizontal 40 20 Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Fixed 20 10 Game Flow 0 0 If checked, a row is closed as soon as you place the last peg and your guess is submitted immediatly. This option only affects the Human vs. Computer game mode. Close Rows when the last Peg is placed 0 0 If checked, the computer will determine the corresponding hints for the solver's guess. This option affects only Computer vs. Human games. If checked, you only have to place your secret combination. Then the rest of the game runs automatically until the end. But you can set a delay between the guesses. Set Hints automatically 0 0 Adjust the delay (in ms) between two guesses. Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Delay in ms Qt::Horizontal 40 20 Solver Select from 3 different strength levels for your computer opponent. This option only affects the Computer vs. Human game mode. For the computer's guess in the Human vs. Computer mode always the highest level will be used. Qt::Horizontal 40 20 Solver Strength Game Mode Select from the different game modes. In the 1. mode you have to to guess the hidden, computer generated combination, In the 2. mode your computer will try to guess your own secret combination. Qt::Horizontal 40 20 Qt::Vertical 20 40 Game Lists Game Lists Maximum Row Count: Limit the number of rows in game tables like highscores etc. Valid values range from 5 to 50. Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 50 5 15 Qt::Horizontal 40 20 Use Customized Table Row Highlight Colors Qt::Horizontal QSizePolicy::Fixed 20 20 0 0 24 24 24 24 false Foreground 0 0 24 24 24 24 false Background Qt::Horizontal 40 20 Highscores Use Highscores Qt::Horizontal QSizePolicy::Fixed 20 20 Raise the dialog after a game has been won and prompt for the name true Automatically insert Highscores using the name below Qt::Horizontal 0 20 0 0 Provide a name with maximum 20 characters here to be used for highscore entries. If you checked the automatic option above, this name is mandatory, otherwise it will be used as proposal which you may change later in the dialog. 20 Name (mandatory for the second option) Qt::Horizontal 81 21 Qt::Horizontal 40 20 Qt::Vertical 20 40 Qt::Horizontal QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults 10 10 true true true ColorCode-0.8.7/src/cellbtn.cpp0000644000175000017500000000162312610736534014772 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "cellbtn.h" CellBtn::CellBtn(QWidget *parent) : QToolButton(parent) { setMouseTracking(true); setAttribute(Qt::WA_Hover, true); } ColorCode-0.8.7/src/ccgame.cpp0000644000175000017500000001176114526106236014570 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "ccgame.h" #include "settings.h" using namespace std; CCGame::CCGame() { mUserNm = ""; mTime = 0; mScore = 0; mGameNo = 0; mGuessCnt = 0; mHintCnt = 0; mDuration = 0; mColorCnt = 0; mPegCnt = 0; mDoubles = 0; mGameMode = ColorCode::MODE_HVM; } CCGame::CCGame(const QString &str) { QStringList fields = str.split(QString("|")); if (fields.size() == 11) { SetUserName(QUrl::fromPercentEncoding(fields.at(0).toUtf8())); bool ok; mTime = fields.at(1).toInt(&ok); mScore = fields.at(2).toInt(&ok); mGameNo = fields.at(3).toUInt(&ok); mGuessCnt = fields.at(4).toInt(&ok); mHintCnt = fields.at(5).toInt(&ok); mDuration = fields.at(6).toUInt(&ok); mGameMode = fields.at(7).toInt(&ok); mColorCnt = fields.at(8).toInt(&ok); mPegCnt = fields.at(9).toInt(&ok); mDoubles = fields.at(10).toInt(&ok); } else { mUserNm = ""; mTime = 0; mScore = 0; mGameNo = 0; mGuessCnt = 0; mHintCnt = 0; mDuration = 0; mGameMode = ColorCode::MODE_HVM; mColorCnt = 0; mPegCnt = 0; mDoubles = 0; } } CCGame::CCGame(const QString &unm, const uint t, const int sc, const uint gameno, const int gcnt, const int hcnt, const uint dur, const int gmode, const int ccnt, const int pcnt, const int d) { mUserNm = unm; mTime = t; mScore = sc; mGameNo = gameno; mGuessCnt = gcnt; mHintCnt = hcnt; mDuration = dur; mGameMode = gmode; mColorCnt = ccnt; mPegCnt = pcnt; mDoubles = d; } bool CCGame::operator==(const CCGame &other) const { return ( GetCCUserName() == other.GetCCUserName() && mTime == other.mTime && mScore == other.mScore && mGameNo == other.mGameNo && mGuessCnt == other.mGuessCnt && mHintCnt == other.mHintCnt && mDuration == other.mDuration && mGameMode == other.mGameMode && mColorCnt == other.mColorCnt && mPegCnt == other.mPegCnt && mDoubles == other.mDoubles ); } bool CCGame::operator!=(const CCGame &other) const { return !(*this == other); } QString CCGame::GetCCUserName() const { return mUserNm; } void CCGame::SetUserName(QString unm) { QRegExp rx("[^\\S ]+"); unm.replace(rx, ""); unm = unm.trimmed(); unm.truncate(Settings::MAX_LENGTH_USERNAME); mUserNm = unm; } uint CCGame::GetTime() const { return mTime; } int CCGame::GetScore() const { return mScore; } QString CCGame::GetDatePartStr() const { return QDateTime::fromTime_t(mTime).date().toString(Qt::ISODate); } QString CCGame::GetTimePartStr() const { return QDateTime::fromTime_t(mTime).time().toString(Qt::ISODate); } QString CCGame::GetDateTimeStr() const { return QDateTime::fromTime_t(mTime).toString(Qt::TextDate); } QString CCGame::GetCmbStr() const { return QString::number(mGameNo) + QString(" (") + QString::number(mDoubles) + QString("|") + QString::number(mPegCnt) + QString("|") + QString::number(mColorCnt) + QString(") ") + GetDateTimeStr(); } void CCGame::Anonymize() { SetUserName(""); mHintCnt = mGuessCnt = mDuration = mScore = 0; } QString CCGame::ToString() const { QStringList slist = QStringList(); slist << QString(QUrl::toPercentEncoding(mUserNm)); slist << QString::number(mTime); slist << QString::number(mScore); slist << QString::number(mGameNo); slist << QString::number(mGuessCnt); slist << QString::number(mHintCnt); slist << QString::number(mDuration); slist << QString::number(mGameMode); slist << QString::number(mColorCnt); slist << QString::number(mPegCnt); slist << QString::number(mDoubles); return slist.join("|"); } bool CCGame::HasSameSettings(const CCGame &g) const { return (mGameNo == g.mGameNo && mColorCnt == g.mColorCnt && mPegCnt == g.mPegCnt && mDoubles == g.mDoubles); } bool CCGame::IsValidGame() const { return ( mGameNo > 0 && mColorCnt >= ColorCode::MIN_COLOR_CNT && mColorCnt <= ColorCode::MAX_COLOR_CNT && mPegCnt >= 2 && mPegCnt <= 5 && (mDoubles == 1 || mDoubles == 0) ); } ColorCode-0.8.7/src/pegrow.cpp0000644000175000017500000001633014524754364014662 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "colorpeg.h" #include "pegrow.h" #include "rowhint.h" using namespace std; PegRow::PegRow(QObject*) { setAcceptedMouseButtons(Qt::NoButton); mIx = -1; mPegCnt = 0; mXOffs = 0; mPend = QColor("#646568"); mPenl = QColor("#ecedef"); mGrad0 = QColor("#cccdcf"); mGrad1 = QColor("#fcfdff"); mColorPegs = NULL; Reset(0, 0); } PegRow::~PegRow() { for (int i = 0; i < mPegCnt; ++i) { delete mColorPegs[i]; } delete [] mColorPegs; mColorPegs = NULL; } bool PegRow::IsActive() const { return mIsActive; } void PegRow::Reset(const int pegcnt, const int gamemode) { ClearRow(); mSolution.clear(); SetActive(false); mSolved = false; SetPegCnt(pegcnt); SetGameMode(gamemode); } void PegRow::ClearRow() { if (mColorPegs == NULL) { return; }; for (int i = 0; i < mPegCnt; ++i) { if (mColorPegs[i] != NULL) { emit(RemovePegSignal(mColorPegs[i])); } } } int PegRow::GetIx() const { return mIx; } void PegRow::SetIx(const int ix) { mIx = ix; } void PegRow::SetPegCnt(const int pegcnt) { ClearRow(); for (int i = 0; i < mPegCnt; ++i) { delete mColorPegs[i]; } delete [] mColorPegs; mColorPegs = NULL; mPegCnt = pegcnt; mColorPegs = new ColorPeg* [mPegCnt]; for (int i = 0; i < mPegCnt; ++i) { mColorPegs[i] = NULL; } SetXOffs(); } void PegRow::SetGameMode(const int gamemode) { mGameMode = gamemode; } void PegRow::SetXOffs() { mXOffs = 100 - mPegCnt * 20; } int PegRow::GetPegCnt() const { if (mColorPegs == NULL) { return 0; }; int cnt = 0; int i = 0; for (i = 0; i < mPegCnt; ++i) { if (mColorPegs[i] != NULL) { ++cnt; } } return cnt; } ColorPeg** PegRow::GetPegs() { return mColorPegs; } void PegRow::SetActive(const bool b) { mIsActive = b; update(boundingRect()); } bool PegRow::SnapCP(ColorPeg *cp) { if (mColorPegs == NULL) { return false; } bool snapped = false; if (mIsActive) { QPointF p = mapFromParent(cp->pos()); p.rx() += 18; p.ry() += 18; int ix = -1; int i; if (p.y() >= 0 && p.y() <= 40) { for (i = 0; i < mPegCnt; ++i) { if (p.x() >= mXOffs + i * 40 && p.x() < mXOffs + (i + 1) * 40) { if (mColorPegs[i] != NULL) { emit RemovePegSignal(mColorPegs[i]); mColorPegs[i] = NULL; } mColorPegs[i] = cp; cp->SetPegRow(this); ix = i; cp->setPos(mapToParent(mXOffs + i * 40 + 2, 2)); break; } } } snapped = ix > -1; CheckSolution(); } return snapped; } void PegRow::ForceSnap(ColorPeg* cp, int posix) { if (mColorPegs == NULL) { return; } if (posix > mPegCnt - 1) { return; } if (mIsActive) { if (mColorPegs[posix] != NULL) { emit RemovePegSignal(mColorPegs[posix]); mColorPegs[posix] = NULL; } mColorPegs[posix] = cp; cp->setSelected(false); cp->SetPegRow(this); cp->setPos(mapToParent(mXOffs + posix * 40 + 2, 2)); CheckSolution(); } } void PegRow::CloseRow() { mSolved = true; if (mColorPegs == NULL) { ; } else { for (int i = 0; i < mPegCnt; ++i) { if (mColorPegs[i] != NULL) { mColorPegs[i]->SetEnabled(false); } } } SetActive(false); } void PegRow::OpenRow() { mSolved = false; if (mColorPegs == NULL) { ; } else { for (int i = 0; i < mPegCnt; ++i) { if (mColorPegs[i] != NULL) { mColorPegs[i]->SetEnabled(true); } } } SetActive(true); } void PegRow::CheckSolution() { mSolution.clear(); if (mColorPegs == NULL) { ; } else { for (int i = 0; i < mPegCnt; ++i) { if (mColorPegs[i] != NULL) { mSolution.push_back(mColorPegs[i]->GetPegType()->ix); } } } emit RowSolutionSignal(mIx); } std::vector PegRow::GetSolution() const { return mSolution; } void PegRow::RemovePeg(ColorPeg *cp) { if (mColorPegs == NULL) { return; } for (int i = 0; i < mPegCnt; ++i) { if (mColorPegs[i] == cp) { mColorPegs[i] = NULL; if (mIsActive) { CheckSolution(); } } } } QPainterPath PegRow::shape() const { QPainterPath path; path.addRect(boundingRect()); return path; } QRectF PegRow::boundingRect() const { const int Margin = 1; return outlineRect().adjusted(-Margin, -Margin, +Margin, +Margin); } QRectF PegRow::outlineRect() const { return QRectF(0.0, 0.0, 200.0, 40.0); } void PegRow::paint(QPainter* painter, const QStyleOptionGraphicsItem* , QWidget* ) { if (mPegCnt == 0) { return; } painter->setRenderHint(QPainter::Antialiasing, true); if (mIsActive) { mPend.setAlpha(0xff); mPenl.setAlpha(0xff); mGrad0.setAlpha(0xff); mGrad1.setAlpha(0xff); } else if (mSolved) { mPend.setAlpha(0xa0); mPenl.setAlpha(0xa0); mGrad0.setAlpha(0xa0); mGrad1.setAlpha(0xa0); } else { mPend.setAlpha(0x32); mPenl.setAlpha(0x50); mGrad0.setAlpha(0x32); mGrad1.setAlpha(0x32); } painter->setPen(Qt::NoPen); int i; for (i = 0; i < mPegCnt; i++) { painter->setBrush(QBrush(mPenl)); painter->drawRect(QRectF(mXOffs + i * 40, 0.0, 39, 1)); painter->drawRect(QRectF(mXOffs + i * 40, 0.0, 1, 39)); painter->setBrush(QBrush(mPend)); painter->drawRect(QRectF(mXOffs + i * 40, 39.0, 40, 1)); painter->drawRect(QRectF(mXOffs + i * 40 + 39, 0.0, 1, 40)); QRadialGradient grad(QPointF(mXOffs + i * 40 + 10, 10), 100); grad.setColorAt(0, mGrad0); grad.setColorAt(1, mGrad1); painter->setBrush(QBrush(grad)); painter->drawRect(QRectF(mXOffs + i * 40 + 1, 1.0, 38.0, 38.0)); } } ColorCode-0.8.7/src/trans_es.ts0000644000175000017500000011062214527465645015044 0ustar dirkdirk About &Author &Autor icon icono &License &Licencia A needful game to train your brain ;-) Un juego necesario para entrenar tu cerebro ;-) ColorCode ColorCode About ColorCode Acerca de ColorCode <br><br>Free MasterMind clone including a built in,<br>rather intelligent solver. <br><br>Clon libre de Free MasterMind con un <br>solucionador bastante inteligente. Version Versión Author Autor 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. Este programa es software libre; lo puedes distribuir y/o modificar bajo los términos de la Licencia general pública (GPL) tal y como la publica la Free Software Foundation; ya la bien la versión 3 de la licencia, o (si se desea) cualquier versión posterior. ButtonsCell Play this Game again Save this Game as Bookmark Remove from List Copy Game Number to Clipboard ColorCode New Game Nuevo juego Do you want to give in and start a new Game? ¿Quieres rendirte y comenzar un nuevo juego? About Qt Acerca de Qt &New Game &Nuevo juego Ctrl+N Ctrl+N &Restart Game &Reiniciar el juego Ctrl+R Ctrl+R E&xit &Salir Ctrl+Q Ctrl+Q Ctrl+T Ctrl+T Ctrl+C Ctrl+C Ctrl+A Ctrl+A About &Qt Acerca de &Qt &Game &Juego &Settings &Condiguración &Help &Ayuda Game Juego Message Mensaje The changed settings will only apply to new games! Do you want to give in the current and start a new Game? ¡Los cambies en la configuración solo tendrán efecto en las nuevas partidas! ¿Quieres abandonar la actual y comenzar una nueva partida? Place Your pegs ... Coloca las fichas ... Congratulation! You have won! ¡Felicidades! ¡Has ganado! Sorry! You lost! ¡Lo siento! ¡Has perdido! Ctrl+I Ctrl+I Give In Rendirse Do you really want to give in? ¿Realmente quieres darte por vencido? &Throw In The Towel &Tirar la toalla Ctrl+G Ctrl+G Sure, You're too weak for me! Claro, ¡Eres demasiado débil para mi! Ctrl+Shift+R Ctrl+Shift+R Ctrl+Shift+C Ctrl+Shift+C Fill Row by Random Rellenar una fila de forma aleatoria Duplicate Previous Row Duplicar fila anterior Ctrl+D Ctrl+D Clear Row Despejar fila &Row &Fila ColorCode ColorCode About &ColorCode Acerca de &ColorCode Ctrl+M Ctrl+M Show Toolbar Mostrar barra de herramientas Show Menubar Mostrar barra de menus Show Statusbar Mostrar barra de estado Allow Pegs of the Same Color Permitir fichas del mismo color Level Nivel Computer's Guess Conjetura del ordenador Ctrl+H Ctrl+H Press the Hint Field or Key Enter if You're done. Pulsa el campo pista o la tecla enter si has terminado. Disallow Pegs of the Same Color No permitir fichas del mismo color Close Rows when the last Peg is placed Cerrar filas cuando se coloque la última ficha Ctrl+L Ctrl+L Beginner (2 Colors, 2 Slots, Doubles) Prinicipiante (2 Colores, 2 Ranuras, Dobles) Easy (4 Colors, 3 Slots, No Doubles) Fácil (4 Colores, 2 Ranuras, Dobles) Classic (6 Colors, 4 Slots, Doubles) Clásico (6 Colores, 4 Ranuras, Dobles) Challenging (8 Colors, 4 Slots, Doubles) Desafiante (8 Colores, 4 Ranuras, Dobles) Hard (10 Colors, 5 Slots, Doubles) Difícil (10 Colores, 5 Ranuras, Dobles) Level Presets Valores prefijados del nivel Colors Colores Pegs of Same Color Fichas del mismo color Slots Ranuras Yes No No Reset Color Order Resetear el orden de los colores Ctrl+Shift+L Ctrl+Shift+L Online &Help &Ayuda en línea F1 F1 Done Hecho Ctrl+Shift+N Ctrl+Shift+N Rate it for me Puntúalo por mi Human vs Computer Humano vs Ordenador Computer vs Human Ordenador vs Humano Game Mode Modo de juego Press the button below or Key Enter if You're done. Pulsa el botón a continuación o la tecla enter si has terminado. Place Your secret ColorCode ... Introduce tu código de colores secreto ... Please rate the guess. Press OK or Key Enter if You're done. Por favor, puntúe la conjetura. Pular Ok o la tecla enter una vez listo. The impossible happened, sorry. Lo imposible ha sucedido, lo siento. Yeah! I guessed it, man! ¡Sii! ¡Lo adiviné! Embarrassing! I lost a game! ¡Embarazoso! ¡He perdido un juego! Nope! Thats impossible! Did you gave me false hints? ¡No! ¡Es imposible! ¿Me has dado indicaciones falsas? Don't you like to see me winning? ;-) ¿No quieres verme ganar? ;-) Set Hints automatically Mostar pistas automáticamente Ctrl+Shift+H Ctrl+Shift+H Preferences Preferencias Ctrl+P Ctrl+P Show Indicators Mostrar indicadores The chosen settings do not allow pegs of the same color! ¡La configuración elegida no permite fichas del mismo color! &Start particular Game Ctrl+B &Highscores Ctrl+Alt+H &Recent Games Ctrl+Alt+R &Bookmarks Ctrl+Alt+B Ctrl+Shift+S Game &Lists guessed and rated ... Let me think ... Computer vs. Human Ordenador vs Humano Ctrl+Shift+B Ctrl+Alt+N &Have a Break &Bookmark Current Game Ctrl+Shift+T Show Timer Display Game Number Allow Pegs of Same Color Permitir fichas del mismo color Disallow Pegs of Same Color Ctrl+Alt+C Ctrl+Shift+P &Resume Game Human vs. Computer Humano vs Ordenador Game Number Paused &Copy Game Number GameNoDisplay Human vs. Computer Humano vs Ordenador GameTablesDialog ColorCode Games Game Properties User Color Count Slot Count Pegs of Same Color Fichas del mismo color Game Number Date and Time Duration Insert Game Number Play Recent Games Bookmarks Highscores Clear List Close Insert an arbitrary game number greater than 0 in the input field above. <br><br>The game properties like color count, slot count etc. will be displayed in the corresponding area above.<br><br>Click the Play button or press key Enter, to play the game. If a game is currently running, it will be aborted. Yes No No Message Mensaje This will permanently remove all entries from the List. Do You want to proceed? Game Number Input Bookmarked Games High Score List Please provide a name! Otherwise your score won't be saved. Game Lists GamesListModel Yes No No Pegs of Same Color Fichas del mismo color Actions Rank User Score Date Time Colors Colores Slots Ranuras Game No. PrefDialog ... Select from predefined level settings ... Seleccionar de las configuraciones de niveles predefinidas Beginner (2 Colors, 2 Slots, Doubles) Prinicipiante (2 Colores, 2 Ranuras, Dobles) Easy (4 Colors, 3 Slots, No Doubles) Fácil (4 Colores, 2 Ranuras, Dobles) Classic (6 Colors, 4 Slots, Doubles) Clásico (6 Colores, 4 Ranuras, Dobles) Challenging (8 Colors, 4 Slots, Doubles) Desafiante (8 Colores, 4 Ranuras, Dobles) Hard (10 Colors, 5 Slots, Doubles) Difícil (10 Colores, 5 Ranuras, Dobles) Slots Ranuras Colors Colores Human vs. Computer Humano vs Ordenador Computer vs. Human Ordenador vs Humano Low Bajo Medium Medio High Alto Preferences Preferencias Appearance Apariencia Controls Controles Show or hide the Menubar. Mostrar o ocultar la barra de menus. Show Menubar Mostrar barra de menus Show or hide the Toolbar. Mostrar o ocultar la barra de herramientas. Show Toolbar Mostrar barra de herramientas Show or hide the Statusbar. Mostrar o ocultar la barra de estado. Show Statusbar Mostrar barra de estado Indicators Indicadores If this option is checked, an indicator inside each peg is displayed. Si esta opción esta marcada, se muestra un indicador dentro de cada ficha. Show Indicators inside pegs Mostrar indicadores dentro de las fichas Use unique letters as indicators. Usar letras únicas como indicadores. Letter Indicators Indicadores de letra Use unique numbers as indicators. Usar números únicos como indicadores. Number Indicators Número de indicadores Use the same neutral background color for each peg, when indicators are shown. Usar el mismo fondo neutro por cada ficha, cuando se muestran los indicadores. Hide Colors Ocultar colores Click here if you have changed the color order and now you want to revert it to it's initial state. Haz click aquí si has cambiado el orden de los colores y ahora quieres volver al estado inicial. Reset Color Order Restablecer orden de colores Game Settings Configuración del juego Level Presets Valores prefijados del nivel Select from predefined combinations of the three different level related settings, the number of colors, the number of slots (columns) and the possibility of pegs of the same color in one row. Seleccionar de entra las combinaciones predefinidas de tres niveles de configuraciones relativas al nivel, el número de colores, el número de ranuras (columnas) y la posibilidad de fichas del mismo color en una fila. Number of Slots Número de ranuras Number of Colors Número de colores Number of pegs in a single row. Higher values are harder to guess. Número de fichas en una única línea. Los valores más altos son más difíciles de averiguar. Number of all possible colors. Higher values are harder to guess. Número de colores posible. Los valores más altos son más difíciles de averiguar. If this option is checked, the hidden combination may contain one or more (even all would be possible) pegs of the same color. If checked, the combination is generally harder to guess. Si esta opción esta seleccionada, la combinación oculta puede contener una o más (incluso todas sería posible) fichas del mismo color. Si se marca, la combinación suele ser más difícil de adivinar. Allow Pegs of Same Color Permitir fichas del mismo color Game Mode Modo de juego Select from the different game modes. In the 1. mode you have to to guess the hidden, computer generated combination, In the 2. mode your computer will try to guess your own secret combination. Seleccionar de entre los distintos tipos de partidas. En el modo 1 tienes que adivinar la combinación oculta, generada por el ordenador, en el modo 2 tu ordenador intentará adivinar tu propia combinación secreta. If checked, a row is closed as soon as you place the last peg and your guess is submitted immediatly. This option only affects the Human vs. Computer game mode. Si se marca, una fila se cierra tan pronto como pongas la última ficha y tu conjetura se envía inmediatamente. Esta opción solo afecta a las partidas en modo Humano vs. Ordenador. Close Rows when the last Peg is placed Cerrar filas cuando se coloque la última ficha If checked, the computer will determine the corresponding hints for the solver's guess. This option affects only Computer vs. Human games. If checked, you only have to place your secret combination. Then the rest of the game runs automatically until the end. But you can set a delay between the guesses. Si se marca, el ordenador determinará las correspondientes pistas para la conjetura del solucionador. Esta opción afecta sólo a las aprtidas Ordenador vs. Humano. Si se marca, sólo tienes que fijar la combinación secreta. Entonces el resto del juego se ejecuta automáticamente hasta el final. Pero puedes fijar el retraso entre las conjeturas. Set Hints automatically Mostrar pistas automáticamente Adjust the delay (in ms) between two guesses. Ajustar el retraso (en ms) entre dos conjeturas. Delay in ms Retraso en ms Solver Strength Habilidad del resolvedor Select from 3 different strength levels for your computer opponent. This option only affects the Computer vs. Human game mode. For the computer's guess in the Human vs. Computer mode always the highest level will be used. Seleccionar de entre 3 niveles distintos de dificultar para el ordendor contrincante. Esta opción solo afecta al modo de juego Ordenador vs. Humano. Para la conjetura del ordenador en el modo Humano vs Ordenador siempre se utiliza el nivel máximo. Show Game Timer Display Game Number Game Lists Maximum Row Count: Use Highscores Raise the dialog after a game has been won and prompt for the name Automatically insert Highscores using the name below Name (mandatory for the second option) User Interface Display the current game number in the footer. To avoid remembering, you can hide it here. Timer You may hide the timer to keep calm ;-) But note! Even hidden, time's running in the background. Game Properties Select One of the Level Presets: Or Set the Particular Properties: Game Flow Solver Limit the number of rows in game tables like highscores etc. Valid values range from 5 to 50. Use Customized Table Row Highlight Colors Foreground Background Highscores Provide a name with maximum 20 characters here to be used for highscore entries. If you checked the automatic option above, this name is mandatory, otherwise it will be used as proposal which you may change later in the dialog. Uncheck this if you are confused about the time as fast running ;-) Show Tenth and Hundredth RowHint Commit Your solution Enviar tu solución Click the circles to rate my guess. Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-) Haz click en los círculos para puntuar mi resultado. Pulsa Ctrl+H o el botón correspondiente de la barra de tareas para dejar a una parte imparcial de mi hacerlo ;-) ColorCode-0.8.7/src/gameslistmodel.h0000644000175000017500000000702712610736534016031 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef GAMESLISTMODEL_H #define GAMESLISTMODEL_H #include #include #include #include #include "ccgame.h" #include "buttonscell.h" #include "gametableview.h" class GamesListModel : public QAbstractTableModel { Q_OBJECT public: GamesListModel(QObject* parent = 0); static const int MODEL_ID_DEFAULT; static const int MODEL_ID_PREV; static const int MODEL_ID_SAVED; static const int MODEL_ID_HIGH; static const int COL_RANKING; static const int COL_SCORE; static const int COL_USERNAME; static const int COL_DELETE; static const int COL_GAMENO; static const int COL_DATE; static const int COL_TIME; static const int COL_CCNT; static const int COL_PCNT; static const int COL_DOUBLES; static bool SortListScore(CCGame a, CCGame b); static bool SortListTime(CCGame a, CCGame b); virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; virtual Qt::ItemFlags flags(const QModelIndex &index) const; virtual bool setData(const QModelIndex &index, const QVariant &value, int role); int GetId(); QString GetListStr() const; void SetView(GameTableView* view); void SetMaxSize(const int max); void SetRowHColors(QString fg, QString bg); virtual void InsertRow(CCGame g); void EditField(); void ReadList(const QString &str); void SetEditIndex(QModelIndex ix); QModelIndex GetEditIndex() const; QString GetEditValue() const; const CCGame* GetGameAt(const int row) const; virtual int GetColIx(const int ix) const = 0; virtual int GetMaxColCnt() const = 0; public slots: void HoverRowSlot(int row); signals: void CloseEditorSignal(const QModelIndex &index); void SaveListGameSignal(CCGame* g); void NewGameInputSignal(CCGame* g); void ValidNameCommitSignal(); protected: QString GetHHeaderLabel(const int col) const; virtual void DoSort(QList &list) = 0; void LimitGamesListSize(); int mId; int mMaxSize; int mHoverRow; GameTableView* mView; QList mGamesList; QModelIndex mEditIndex; QColor mRowHFg; QColor mRowHBg; }; #endif // GAMESLISTMODEL_H ColorCode-0.8.7/src/ccsolver.cpp0000644000175000017500000004062014525124731015164 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "ccsolver.h" #include #include using namespace std; const int CCSolver::STRENGTH_LOW = 0; const int CCSolver::STRENGTH_MEDIUM = 1; const int CCSolver::STRENGTH_HIGH = 2; const int CCSolver::STRENGTH_DYNAMIC = 3; const int CCSolver::mFGCnts[4][9][4] = { { {2, 0, 0, 0}, {2, 0, 0, 0}, {1, 1, 0, 0}, {1, 1, 0, 0}, {1, 1, 0, 0}, {1, 1, 0, 0}, {1, 1, 0, 0}, {1, 1, 0, 0}, {1, 1, 0, 0} }, { {3, 0, 0, 0}, {2, 1, 0, 0}, {1, 1, 1, 0}, {1, 1, 1, 0}, {1, 1, 1, 0}, {1, 1, 1, 0}, {1, 1, 1, 0}, {1, 1, 1, 0}, {1, 1, 1, 0} }, { {3, 1, 0, 0}, {3, 1, 0, 0}, {2, 1, 1, 0}, {2, 2, 0, 0}, {2, 2, 0, 0}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1}, {1, 1, 1, 1} }, { {4, 1, 0, 0}, {3, 2, 0, 0}, {3, 1, 1, 0}, {2, 2, 1, 0}, {2, 1, 1, 1}, {2, 2, 1, 0}, {2, 1, 1, 1}, {2, 1, 1, 1}, {2, 1, 1, 1} } }; const int CCSolver::GAME_NOS_CNT = 66; const int CCSolver::mGameNos[66][4] = { { 2, 2, 2, 0}, { 6, 2, 2, 1}, { 12, 3, 2, 0}, { 21, 3, 2, 1}, { 33, 4, 2, 0}, { 49, 4, 2, 1}, { 69, 5, 2, 0}, { 94, 5, 2, 1}, { 124, 6, 2, 0}, { 160, 6, 2, 1}, { 202, 7, 2, 0}, { 251, 7, 2, 1}, { 307, 8, 2, 0}, { 371, 8, 2, 1}, { 443, 9, 2, 0}, { 524, 9, 2, 1}, { 614, 10, 2, 0}, { 714, 10, 2, 1}, { 722, 2, 3, 1}, { 728, 3, 3, 0}, { 755, 3, 3, 1}, { 779, 4, 3, 0}, { 843, 4, 3, 1}, { 903, 5, 3, 0}, { 1028, 5, 3, 1}, { 1148, 6, 3, 0}, { 1364, 6, 3, 1}, { 1574, 7, 3, 0}, { 1917, 7, 3, 1}, { 2253, 8, 3, 0}, { 2765, 8, 3, 1}, { 3269, 9, 3, 0}, { 3998, 9, 3, 1}, { 4718, 10, 3, 0}, { 5718, 10, 3, 1}, { 5734, 2, 4, 1}, { 5815, 3, 4, 1}, { 5839, 4, 4, 0}, { 6095, 4, 4, 1}, { 6215, 5, 4, 0}, { 6840, 5, 4, 1}, { 7200, 6, 4, 0}, { 8496, 6, 4, 1}, { 9336, 7, 4, 0}, { 11737, 7, 4, 1}, { 13417, 8, 4, 0}, { 17513, 8, 4, 1}, { 20537, 9, 4, 0}, { 27098, 9, 4, 1}, { 32138, 10, 4, 0}, { 42138, 10, 4, 1}, { 42170, 2, 5, 1}, { 42413, 3, 5, 1}, { 43437, 4, 5, 1}, { 43557, 5, 5, 0}, { 46682, 5, 5, 1}, { 47402, 6, 5, 0}, { 55178, 6, 5, 1}, { 57698, 7, 5, 0}, { 74505, 7, 5, 1}, { 81225, 8, 5, 0}, {113993, 8, 5, 1}, {129113, 9, 5, 0}, {188162, 9, 5, 1}, {218402, 10, 5, 0}, {318402, 10, 5, 1} }; CCSolver::CCSolver(QObject* parent) : QThread(parent) { mColorCnt = 0; mPegCnt = 0; mDoubles = -1; mLevel = -1; mMaxGuessCnt = 0; mAllCnt = 0; mPosCnt = 0; mHistCnt = 0; mGuessCnt = 0; mMaxRes = 0; mResCnt = 0; mRestartCnt = 0; mResTable = NULL; mCascade = NULL; mPossible = NULL; mPos2AllIx = NULL; mAllTable = NULL; mHist = NULL; mS = NULL; mP = NULL; mInterrupt = false; } CCSolver::~CCSolver() { wait(); FreeTables(); } int CCSolver::GetRandGameNo(const int ccnt, const int pcnt, const int doubles) const { int min = 0; int max = 0; int i; for (i = 0; i < GAME_NOS_CNT; ++i) { if (mGameNos[i][1] == ccnt && mGameNos[i][2] == pcnt && mGameNos[i][3] == doubles) { max = mGameNos[i][0]; if (i > 0) { min = mGameNos[i - 1][0]; } break; } } if (max == 0) { return 1; } int range = max - min; int rndm = (QRandomGenerator::global()->generate() % range) + 1; return min + rndm; } int CCSolver::GetRealGameNo(const uint no) const { int realno = 1; if (no > 0) { realno = no % mGameNos[GAME_NOS_CNT - 1][0]; } return realno; } int CCSolver::GetGameIxByNo(const int no) const { int ix = -1; int i; for (i = 0; i < GAME_NOS_CNT; ++i) { if (mGameNos[i][0] >= no) { ix = i; break; } } if (ix == -1) { ix = 0; } return ix; } const int* CCSolver::GetGameByNo(const int no) const { int realno = GetRealGameNo(no); int ix = GetGameIxByNo(realno); return mGameNos[ix]; } vector CCSolver::GetSolutionByNo(const uint no) const { int realno = GetRealGameNo(no); int gameix = GetGameIxByNo(realno); if (gameix > 0) { realno -= mGameNos[gameix - 1][0]; } vector solvec; int* sol = mAllTable[mPos2AllIx[realno - 1]]; for (int i = 0; i < mPegCnt; ++i) { solvec.push_back(sol[i]); } return solvec; } void CCSolver::NewGame(const int ccnt, const int pcnt, const int doubles, const int level, const int gcnt) { FreeTables(); mColorCnt = ccnt; mPegCnt = pcnt; mDoubles = doubles; mLevel = level; mMaxGuessCnt = gcnt; mMaxPosCnt = 0; mAllCnt = 0; mPosCnt = 0; mHistCnt = 0; mGuessCnt = 0; mMaxRes = 0; mResCnt = 0; mRestartCnt = 0; mLastPosCnt = 0; InitTables(); } void CCSolver::RestartGame() { if (mGuessCnt > 0) { ++mRestartCnt; } for (int i = 0 ; i < mMaxGuessCnt ; ++i) { mHist[i] = NULL; } mGuessCnt = 0; } void CCSolver::Interrupt() { mInterrupt = true; } void CCSolver::run() { mInterrupt = false; mLastGuess = Guess(); if (mLastGuess < 0 || mLastGuess >= mAllCnt) { ; } else { mLastPosCnt = mPosCnt; } } int CCSolver::GetAllCnt() const { return mAllCnt; } void CCSolver::GuessIn(string str) { int ix = Row2Ix(str); mHist[mGuessCnt] = new int[2]; mHist[mGuessCnt][0] = ix; } void CCSolver::GuessIn(const vector* rowsol) { int ix = Row2Ix(rowsol); mHist[mGuessCnt] = new int[2]; mHist[mGuessCnt][0] = ix; } void CCSolver::StartGuess() { if (mPosCnt == mLastPosCnt && (mGuessCnt > 0 || mRestartCnt > 0)) { emit GuessDoneSignal(); return; } mLastGuess = -1; start(QThread::NormalPriority); } int* CCSolver::GuessOut() { if (mLastGuess < 0 || mLastGuess >= mAllCnt) { return NULL; } return mAllTable[mLastGuess]; } int CCSolver::ResIn(const vector* res) { int r = 0; int len = res->size(); int i; for (i = 0; i < len; ++i) { if (res->at(i) == 2) { r += 10; } else if (res->at(i) == 1) { r += 1; } } mHist[mGuessCnt][1] = r; UpdPos(mHist[mGuessCnt][0], r); ++mGuessCnt; return r; } void CCSolver::FreeTables() { int i; delete [] mPos2AllIx; mPos2AllIx = NULL; delete [] mCascade; mCascade = NULL; delete [] mPossible; mPossible = NULL; for (i = 0 ; i < mAllCnt ; ++i) { delete [] mAllTable[i] ; } delete [] mAllTable; mAllTable = NULL; for (i = 0 ; i < mMaxGuessCnt ; ++i) { delete [] mHist[i] ; } delete [] mHist; mHist = NULL; delete [] mResTable; mResTable = NULL; delete [] mS; mS = NULL; delete [] mP; mP = NULL; } void CCSolver::InitTables() { int i, j, k; if (mDoubles != 1 && mColorCnt < mPegCnt) { return; } mMaxPosCnt = CalcPosCnt(mColorCnt, mPegCnt, mDoubles); mPos2AllIx = new int [mMaxPosCnt]; mCascade = new int [mPegCnt]; for (i = 0; i < mPegCnt; ++i) { mCascade[i] = IntPow(mColorCnt, mPegCnt - i - 1); } mAllCnt = CalcAllCnt(mColorCnt, mPegCnt); mAllTable = new int* [mAllCnt]; for (i = 0; i < mAllCnt; ++i) { mAllTable[i] = new int [mPegCnt]; } mPossible = new int [mAllCnt]; for (i = 0; i < mAllCnt; ++i) { FillTable(i); } mHist = new int* [mMaxGuessCnt]; for (i = 0 ; i < mMaxGuessCnt ; ++i) { mHist[i] = NULL; } mS = new int [mColorCnt]; mP = new int [mColorCnt]; mMaxRes = mPegCnt * 10; mResCnt = (IntFac(mPegCnt + 2)) / (IntFac(mPegCnt) * 2) - 1; mResTable = new int[mResCnt]; k = 0; for (i = 0; i <= mPegCnt; ++i) { for (j = 0; j <= mPegCnt - i; ++j, ++k) { if (i == mPegCnt - 1 && j == 1) { --k; continue; } mResTable[k] = i * 10 + j; } } } void CCSolver::FillTable(const int ix) { int i; int v = ix; int pos = 1; int j; for (i = 0; i < mPegCnt; ++i) { mAllTable[ix][i] = 0; } for (i = 0; i < mPegCnt; ++i) { while (v >= mCascade[i]) { ++mAllTable[ix][i]; v -= mCascade[i]; } if (mDoubles != 1 && pos == 1) { for (j = 0; j < i; j++) { if (mAllTable[ix][j] == mAllTable[ix][i]) { pos = 0; break; } } } } if (pos == 1) { mPos2AllIx[mPosCnt] = ix; } mPosCnt += pos; mPossible[ix] = pos; } int CCSolver::RowCmp(const int* sol, const int* pat) { int bl = 0; int wh = 0; int i; for (i = 0; i < mColorCnt; ++i) { mS[i] = mP[i] = 0; } for (i = 0; i < mPegCnt; ++i) { if (sol[i] == pat[i]) { ++bl; } else { if (mP[sol[i]] > 0) { ++wh; --mP[sol[i]]; } else { ++mS[sol[i]]; } if (mS[pat[i]] > 0) { ++wh; --mS[pat[i]]; } else { ++mP[pat[i]]; } } } return (10 * bl + wh); } void CCSolver::UpdPos(const int ix, const int res) { int i; for (i = 0; i < mAllCnt; ++i) { if (!mPossible[i]) { continue; } if (RowCmp(mAllTable[i], mAllTable[ix]) != res) { mPossible[i] = 0; --mPosCnt; } } } string CCSolver::FirstGuess() { int i, j, r; int pegcnt = 0; int diffcnt = 0; const int* fg = mFGCnts[mPegCnt-2][mColorCnt-2]; char s[mPegCnt]; int t[mColorCnt]; for (i = 0; i < mColorCnt; ++i) { t[i] = 0; } if (mDoubles == 1) { for (i = 0; i < 4; ++i) { if (fg[i] == 0) { break; } do { r = rand() % mColorCnt; } while (t[r] > 0); ++t[r]; ++diffcnt; for (j = 0; j < fg[i]; ++j) { s[pegcnt++] = 'A' + r; } if (pegcnt == mPegCnt) { break; } } if (mPegCnt > 2 && diffcnt > 1) { for (int i = 0; i < (mPegCnt - 1); ++i) { r = i + (rand() % (mPegCnt - i)); if (i != r) { char tmp = s[i]; s[i] = s[r]; s[r] = tmp; } } } } else { for (i = 0; i < mPegCnt; ++i) { do { r = rand() % mColorCnt; } while (t[r] > 0); ++t[r]; s[i] = 'A' + r; } } return string(s, mPegCnt); } int CCSolver::Guess() { //clock_t start, finish; //start = clock(); if (mLevel > STRENGTH_LOW && mGuessCnt == 0 && mRestartCnt == 0) { return Row2Ix(FirstGuess()); } int level = mLevel; if (level == STRENGTH_HIGH && mPosCnt > 10000) { level = STRENGTH_MEDIUM; } int i, j; if (level == STRENGTH_LOW) { for (i = 0; i < mAllCnt; ++i) { if (mPossible[i]) { break; } } } else if (level == STRENGTH_MEDIUM) { int m = mPosCnt >> 1; for (i = 0; i < mAllCnt; ++i) { if (mPossible[i]) { if (--m <= 0) { break; } } } } else { // Donald E. Knuth. The Computer as Master Mind. J. Recreational Mathematics, 9 (1976-77), 1-6. // Kenji Koyama, Tony W. Lai. An optimal Mastermind Strategy. J. Recreational Mathematics, 1994. // we'll only take the still possible ones into account, but ... int solix = -1; int shortest = 1000000; int longest; int res2pos[mMaxRes]; for (j = 0; j <= mMaxRes; ++j) { res2pos[j] = 0; } for (i = 0; i < mAllCnt; ++i) { if (mInterrupt) { i = -1; break; } if (!mPossible[i]) { continue; } for (j = 0; j < mAllCnt; ++j) { if (!mPossible[j]) { continue; } ++res2pos[RowCmp(mAllTable[j], mAllTable[i])]; } longest = 0; for (j = 0; j < mResCnt; ++j) { if (res2pos[mResTable[j]] > longest) { longest = res2pos[mResTable[j]]; } res2pos[mResTable[j]] = 0; } if (longest < shortest) { shortest = longest; solix = i; } } i = solix; } //finish = clock(); return i; } string CCSolver::RowOut(const int* r) { char s[mPegCnt]; int i; for (i = 0; i < mPegCnt; ++i) { s[i] = 'A' + r[i]; } return string(s, mPegCnt); } int CCSolver::Row2Ix(const vector* v) { int i; int ix = 0; int len = v->size(); if (len != mPegCnt) { return -1; } int j; for (i = 0; i < mPegCnt; ++i) { j = v->at(i); if (j >= mColorCnt) { ix = -1; break; } ix += j * mCascade[i]; } if (ix >= 0 && ix < mAllCnt) { return ix; } return -1; } int CCSolver::Row2Ix(const string str) { int i; int ix = 0; int len = int(str.size()); if (len != mPegCnt) { return -1; } int j; for (i = 0; i < mPegCnt; ++i) { j = toupper(int(str[i])) - 'A'; if (j >= mColorCnt) { ix = -1; break; } ix += j * mCascade[i]; } if (ix >= 0 && ix < mAllCnt) { return ix; } return -1; } int CCSolver::IntPow(const int b, const int e) const { int i; int ret = 1; for (i = 0; i < e; ++i) { ret *= b; } return ret; } int CCSolver::IntFac(const int n) const { int fac = 1; int i; for (i = n; i > 1; --i) { fac *= i; } return fac; } int CCSolver::CalcAllCnt(const int ccnt, const int pcnt) const { if (ccnt < 2 || pcnt < 2) { return 0; } return IntPow(ccnt, pcnt); } int CCSolver::CalcPosCnt(const int ccnt, const int pcnt, const int doubles) const { if (ccnt < 2 || pcnt < 2 || (doubles != 0 && doubles != 1)) { return 0; } if (ccnt < pcnt && doubles == 0) { return 0; } if (doubles == 1) { return CalcAllCnt(ccnt, pcnt); } return IntFac(ccnt) / IntFac(ccnt - pcnt); } ColorCode-0.8.7/src/about.o0000644000175000017500000006722014526050342014134 0ustar dirkdirkELF>Pf@@!   HHPHHHGfSHH߾[fHHHPHHHGff.@SH_HH߾[@HhÐ@AWAVAUATUHSHHH}0HHPHHUHEH=L$H$11LHH$L$HLLHLHH$ t/H$s H=LuX11LHH$HLHH$ t/H$k H=L11LHH$HLHH$ t/H$ HEhH51LAHHD$H5A1LHL$H5A1HLH$H5A1HHH$H$H5HHD$XIH5LH$H$z H5HH$HHHD$(H$t/H$}H$H$w H$H4$HHD$PH$H$0 H$LHHD$HH$H$ H5HH$HHHD$ H$ t/H$ H$H$7 H$LHHD$@H$H$ H5HH$HHHD$H$S t/H$< H$HT$x HD$xH5HHD$8HT$xHT$p H5HHD$pHHHD$H$t/H$HT$pHT$h& HD$hLHHD$0HT$hHT$`H5HLt$`HLH$t/H$H|$LH|$`t/H|$`H|$ht/H|$hqH|$pt/H|$pH|$xt/H|$xH$t/H$H$t/H$H$t/H$H$t/H$H$t/H$H$t/H$yH$t/H$qH$t/H$iH$xt/H$aH$pt/H$YH$ht/H$QH=H<$H$LLH=HLH$H$t/H$HLH4$HHHLLL$MmLLLLLH$t/H$H$t/H$HHLH$t/H$oH[]A\A]A^A_DH5A1LHLH5LLLH$H$H5HHLH$t/H$LLH$t/H$jH$@t/H$)H$t/H$H$}@&@E@y@o@@@@H|$xCH$HH$PH$XH$`H$hH$pH$xH$H$H$H${@@@@@6@@@} 'YT@lIIHIHHIHHHHHIIHH$HD$HHHHIIHHIHH$HD$(HIHHD$pHD$HHHH$HD$ HIHD$HLt$`HIHHI Htt(tHHAboutvboxLayouttabWidgetmAuthorTabhboxLayoutvboxLayout1mAuthorIconmAuthorTextmLicenseTabhboxLayout1vboxLayout2mLicenseIconmLicenseTextbuttonBoxAbout ColorCodeicon&Author&License1accept()2accepted()AWAVAUATIUSHHHl$HH|$DoL t/H|$8 EuCH5HHLH|$ t/H|$ LHHLHD$ LHIL+LH;A L+H H5HLH|$. t/H|$ 0LHILkH5H HLH|$ t/H|$ H{1011HILkH5H HLH|$& t/H|$ HsHILkLH{A LkHH5 HLH|$t/H|$ HILk LH{ E1111Lk HH5 HLH|$t/H|$0Hs1HILk(H5H HLH|$t/H|$Hs(H{ 11(L5H{ HfoIFHs0HHHFHoqHFHFPpHs H{10HsHILk8H5H HLH|$t/H|$uH{81H{8H{8H{Hs811H{HsHL-Ll$H|$t/H|$011HIL{@H5H HLH|$[t/H|$G Hs@HIL{HLH{HA L{HHH5 HLH|$t/H|$  HIL{PLH{PE1111L{PHH5 HLH|$t/H|$0Hs@1HIL{XH5H HLH|$t/H|$HsXH{P11(H{Pfo HIFHHHFHoqHFHNHs`PpHsPH{H10Hs@HILshH5H HLH|$Mt/H|$9H{h1H{hH{hH{HHsh11H{Hs@HLl$H|$%t/H|$HsH;110LHILkpH5H HLH|$t/H|$H{pL-H{pH;Hsp11Hs8H{HspH{8HshH{pLH1AHHLH|$Ut/H|$AL{(L5L1HALHLH|$&t/H|$LHA1HL{HsH{HLH|${t/H|$gL{XLHA1LHLH|$Kt/H|$7LHA1HLsHs@H{HLH|$t/H|$HspLE1HLHHH{1HL[]A\A]A^A_@@f@@@@@@@@f@@@@@w@@1@_@@@*@HHL HL0HHHL0HHHH(uH)L0HzDL HEg&9;/o2        ;    /      h2d:/img/help-about.png:/img/cc32.png:/img/GNU-icon32.pngAuthorVersion


:
: Dirk Laebisch:/docs/GPL.htmlCourier

Free MasterMind clone including a built in,
rather intelligent solver.A needful game to train your brain ;-)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.LH$uHHLLH<$HLLt/H$uHH\$LH|$0H|$H|$8H|$H|$@H|$ H|$HH|$PH|$(H|$XH<$LLLHHHLLHLLLLHL(HL,LHLLsHL.H|$X3HLLwHLJ9q                 hGCC: (Debian 13.2.0-6) 13.2.0zRx -zPLRx L$J BBB B(D0A8GP? 8D0A(B BBBH AQ!AU PTBBB B(A0D8G| 8A0A(B BBBF <  @FL$R9X@^dXjHpLvU|^afv     & 1 = I U a m y       &6L[x" -" -"J !2X+V'9^|;])Pn4ckz @!p T-_  : W t       C b         Tabout.cpp_ZN5AboutC2EP7QWidget6QFlagsIN2Qt10WindowTypeEE.cold.LC23.LC24.LC25.LC26.LC27.LC28.LC29.LC30.LC31.LC32.LC33.LC34.LC35.LC36.LC37.LC38.LC39.LC40.LC0.LC1.LC2.LC3.LC4.LC5.LC6.LC7.LC8.LC9.LC10.LC11.LC12.LC13.LC14.LC15.LC16.LC17.LC18.LC19.LC20.LC21_ZN7QStringD5Ev_GLOBAL_OFFSET_TABLE_qt_version_tag_ZSt21ios_base_library_initv_ZN7QStringD2Ev_ZN10QArrayData10deallocateEPS_mm_ZN7QStringD1Ev_ZN8Ui_About7setupUiEP7QDialogDW.ref.__gxx_personality_v0_ZNK7QObject10objectNameEv_ZN7QString15fromUtf8_helperEPKci_ZN7QObject13setObjectNameERK7QString_ZN7QWidget17setWindowModalityEN2Qt14WindowModalityE_ZN7QWidget6resizeERK5QSize_Znwm_ZN11QVBoxLayoutC1EP7QWidget_ZN10QBoxLayout10setSpacingEi_ZN7QLayout18setContentsMarginsEiiii_ZN10QTabWidgetC1EP7QWidget_ZN10QTabWidget11setTabShapeENS_8TabShapeE_ZN7QWidgetC1EPS_6QFlagsIN2Qt10WindowTypeEE_ZN11QHBoxLayoutC1EP7QWidget_ZN11QVBoxLayoutC1Ev_ZN6QLabelC1EP7QWidget6QFlagsIN2Qt10WindowTypeEE_ZN10QBoxLayout9addWidgetEP7QWidgeti6QFlagsIN2Qt13AlignmentFlagEE_ZTV11QSpacerItem_ZN10QBoxLayout9addLayoutEP7QLayouti_ZN12QTextBrowserC1EP7QWidget_ZN6QFrame13setFrameShapeENS_5ShapeE_ZN6QFrame14setFrameShadowENS_6ShadowE_ZN12QTextBrowser20setOpenExternalLinksEb_ZN10QArrayData11shared_nullE_ZN10QTabWidget6addTabEP7QWidgetRK7QString_ZN16QDialogButtonBoxC1EP7QWidget_ZN16QDialogButtonBox14setOrientationEN2Qt11OrientationE_ZN16QDialogButtonBox18setStandardButtonsE6QFlagsINS_14StandardButtonEE_ZN7QWidget11setTabOrderEPS_S0__ZN16QCoreApplication9translateEPKcS1_S1_i_ZN7QWidget14setWindowTitleERK7QString_ZN6QLabel7setTextERK7QString_ZNK10QTabWidget7indexOfEP7QWidget_ZN10QTabWidget10setTabTextEiRK7QString_ZN7QObject7connectEPKS_PKcS1_S3_N2Qt14ConnectionTypeE_ZN11QMetaObject10ConnectionD1Ev_ZN10QTabWidget15setCurrentIndexEi_ZN11QMetaObject18connectSlotsByNameEP7QObject_ZdlPvm_Unwind_Resume_ZN5AboutD2Ev_ZTV5About_ZN7QDialogD2Ev_ZN5AboutD1Ev_ZN5AboutD0Ev_ZThn16_N5AboutD1Ev_ZThn16_N5AboutD0Ev_ZNK5About8sizeHintEv_ZN5AboutC2EP7QWidget6QFlagsIN2Qt10WindowTypeEE_ZN7QDialogC2EP7QWidget6QFlagsIN2Qt10WindowTypeEE_ZN7QString16fromAscii_helperEPKci_ZN7QPixmapC1ERK7QStringPKc6QFlagsIN2Qt19ImageConversionFlagEE_ZN5QIconC1ERK7QPixmap_ZN7QWidget13setWindowIconERK5QIcon_ZN5QIconD1Ev_ZN7QPixmapD1Ev_ZN6QLabel9setPixmapERK7QPixmap_ZN5About16staticMetaObjectE_ZNK11QMetaObject2trEPKcS1_i_ZN9ColorCode10GAME_TITLEE_ZN7QString6appendERKS__ZN9ColorCode7VERSIONE_ZN9QTextEdit7setTextERK7QString_ZN5QFile6existsERK7QString_ZN5QFontC1Ev_ZN5QFont12setStyleHintENS_9StyleHintENS_13StyleStrategyE_ZN5QFont9setFamilyERK7QString_ZN7QWidget7setFontERK5QFont_ZN5QFileC1ERK7QString_ZN5QFile4openE6QFlagsIN9QIODevice12OpenModeFlagEE_ZN9QIODevice7readAllEvstrlen_ZN11QFileDevice5closeEv_ZN5QFileD1Ev_ZN5QFontD1Ev_ZN5AboutC1EP7QWidget6QFlagsIN2Qt10WindowTypeEE*c%eC*cyek*c8 lm%n0o8p@qu ~lmrq lm rqG*sY ctj*s| t*st*st;*uv.6;Nvvv;.vv;v'*w4vX`;uvv;v=xlyz{l|, }8 ~E _ s  ; x   C *sU a tm u ; v  ; v x{ 6 6 6 6 6 6 63 6K 6c 6 6 6 6 6 6& 6G 6h 6 6 6 6 66636K6c6{66[6s6d3_]d_BM$.9IVf %v-~5 =EZbj||9o|4,!3)6:P];h<=>?@AB ;<D?RC]j;u<D?E;< ?F,AJBX b;m<?GAB!;<?)H4"A;L<I?*J#K?L$;<JMXNfOwI*PQ?E%;<?.F?A]Bk&u;<?GAB';<+?<HG(T;_<I?#K?L);(<VMdNrOIQI?R*;<9>SLT\IiUvUU+VW,VX/ -8 VE YR Z V X . V Y Z, /3 08 [@ \K ]s 6 6 6 6 6 6 6 63 6K 6c 6{ 6 6 6 6 6 6 6# 6; 6S 6k 6 _ ` _ ` _ ` 7 ` _% `> _F `a ^7!6,4=7MqU7w777777777777777 7d`$q,797A7I7Q7a7q7~pq777777a ?9T] @p!lu!.symtab.strtab.shstrtab.rela.text.data.bss.rela.qtversion.rela.text._ZN7QStringD2Ev.rodata._ZN8Ui_About7setupUiEP7QDialog.str1.1.rela.text._ZN8Ui_About7setupUiEP7QDialog.gcc_except_table._ZN8Ui_About7setupUiEP7QDialog.rodata.str1.1.rodata.str1.8.rela.text.unlikely.gcc_except_table.rodata.cst8.rodata.cst16.rela.data.rel.local.DW.ref.__gxx_personality_v0.comment.note.GNU-stack.rela.eh_frame.group@ 3L 1X8h 9 @0@x&t,t6x1@O F-A@O \2J @O2i!2"pp#@_V%*)&6&I&D@Xcu0&~&&@pc8P( 2 4M dColorCode-0.8.7/src/ccgame.h0000644000175000017500000000366314526106236014237 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef CCGAME_H #define CCGAME_H #include #include #include "colorcode.h" class CCGame { public: CCGame(); CCGame(const QString &str); CCGame(const QString &unm, const uint t, const int sc, const uint gameno, const int gcnt, const int hcnt, const uint dur, const int gmode, const int ccnt, const int pcnt, const int d); bool operator==(const CCGame &other) const; bool operator!=(const CCGame &other) const; uint mTime; int mScore; uint mGameNo; int mGuessCnt; int mHintCnt; uint mDuration; int mGameMode; int mColorCnt; int mPegCnt; int mDoubles; QString GetCCUserName() const; void SetUserName(QString unm); uint GetTime() const; int GetScore() const; QString GetDateTimeStr() const; QString GetDatePartStr() const; QString GetTimePartStr() const; QString GetCmbStr() const; void Anonymize(); QString ToString() const; bool HasSameSettings(const CCGame &g) const; bool IsValidGame() const; private: QString mUserNm; }; #endif // CCGAME_H ColorCode-0.8.7/src/timedisplaybg.cpp0000644000175000017500000000310612610736534016202 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "timedisplaybg.h" TimeDisplayBg::TimeDisplayBg() { setCacheMode(QGraphicsItem::DeviceCoordinateCache); mUpdateRect = QRectF(0, 0, 220, 20); mRect = QRectF(65.5, 3.5, 89, 14); QLinearGradient solgrad(0, 1, 0, 15); solgrad.setColorAt(0.0, QColor("#9fa0a2")); solgrad.setColorAt(1.0, QColor("#8c8d8f")); mBgBrush = QBrush(solgrad); QLinearGradient framegrad(0, 1, 0, 15); framegrad.setColorAt(0.0, QColor("#4e4f51")); framegrad.setColorAt(1.0, QColor("#ebecee")); mFramePen = QPen(QBrush(framegrad), 1); } QRectF TimeDisplayBg::boundingRect() const { return mUpdateRect; } void TimeDisplayBg::paint(QPainter* painter, const QStyleOptionGraphicsItem* , QWidget* ) { painter->setBrush(mBgBrush); painter->setPen(mFramePen); painter->drawRoundedRect(mRect, 7.5, 7.5); } ColorCode-0.8.7/src/gametimer.h0000644000175000017500000000233414525377234014773 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef GAMETIMER_H #define GAMETIMER_H #include #include //#include "colorcode.h" //#include "timedisplay.h" using namespace std; class GameTimer : public QThread { Q_OBJECT public: GameTimer(QObject* parent = 0); ~GameTimer(); void run(); public slots: void Start(); void TimeOut(); signals: void TimeOutSignal(int tick); private: int mInterval; }; #endif // GAMETIMER_H ColorCode-0.8.7/src/trans_fr.ts0000644000175000017500000011350714527465645015051 0ustar dirkdirk About &Author &Auteur icon icône &License &Licence A needful game to train your brain ;-) Un programme incontournable pour entraîner votre cerveau ;-) ColorCode ColorCode About ColorCode À propos de ColorCode <br><br>Free MasterMind clone including a built in,<br>rather intelligent solver. <br><br>Clone du logiciel MasterMind incluant un résolveur plutôt malin. Version Version Author Auteur 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. Ce programme est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier selon les termes de la GNU General Public License (licence générale publique du projet GNU), telle qu'elle est publiée par la Free Software Foundation (Fondation pour le Logiciel Libre), soit sous sa version 3, soit (selon votre choix) sous n'importe quelle version ultérieure. ButtonsCell Play this Game again Rejouer cette partie Save this Game as Bookmark Enregister un signet pour cette partie Remove from List Effacer de la liste Copy Game Number to Clipboard Copier le numéro de partie dans le Presse-papiers ColorCode New Game Nouvelle partie Do you want to give in and start a new Game? Voulez-vous abandonner et démarrer une nouvelle partie ? About Qt À propos de Qt &New Game &Nouvelle partie Ctrl+N &Restart Game &Redémarrer la partie Ctrl+R Ctrl+R E&xit &Quitter Ctrl+Q Ctrl+T Ctrl+C Ctrl+A About &Qt À propos de &Qt &Game &Partie &Settings &Préférences &Help &Aide Game Partie Message The changed settings will only apply to new games! Do you want to give in the current and start a new Game? Les préférences modifiées ne s'appliqueront qu'aux nouvelles parties ! Voulez-vous abandonner la partie et en démarrer une nouvelle ? Place Your pegs ... Placez vos fiches... Congratulation! You have won! Congratulations ! Vous gagnâtes ! Sorry! You lost! Désolé ! Vous perdîtes ! Ctrl+I Give In Abandonner Do you really want to give in? Voulez-vous réellement abandonner ? &Throw In The Towel &Donner sa langue au chat Ctrl+G Sure, You're too weak for me! Vous êtes trop faible pour moi ; c'est sûr ! Ctrl+Shift+R Ctrl+Shift+C Fill Row by Random Garnir la rangée au hasard Duplicate Previous Row Dupliquer la rangée précédente Ctrl+D Clear Row Effacer la rangée &Row &Rangée About &ColorCode À propos de &ColorCode Ctrl+M Show Toolbar Afficher la barre d'outils Show Menubar Afficher la barre de menu Show Statusbar Afficher la barre d'état Allow Pegs of the Same Color Autoriser plusieurs fiches de même couleur Level Niveau Computer's Guess Essai de l'ordinateur Ctrl+H Press the Hint Field or Key Enter if You're done. Cliquer sur le champ des fiches d'indices ou presser la touche Entrée quand vous êtes prêt. Disallow Pegs of the Same Color Interdire plusieurs fiches de même couleur Close Rows when the last Peg is placed Finaliser la rangée quand la dernière fiche est placée Ctrl+L Beginner (2 Colors, 2 Slots, Doubles) Débutant (2 couleurs, 2 trous, doubles) Easy (4 Colors, 3 Slots, No Doubles) Facile (4 couleurs, 3 trous, pas de doubles) Classic (6 Colors, 4 Slots, Doubles) Classique (6 couleurs, 4 trous, doubles) Challenging (8 Colors, 4 Slots, Doubles) Évolué (8 couleurs, 4 trous, doubles) Hard (10 Colors, 5 Slots, Doubles) Difficile (10 couleurs, 5 trous, doubles) Level Presets Niveaux Colors Couleurs Pegs of Same Color Fiches de même couleurs autorisées Slots Trous Yes Oui No Non Reset Color Order Réinitialiser l'ordre des couleurs Ctrl+Shift+L Online &Help &Aide en ligne F1 Done Fait Ctrl+Shift+N Rate it for me Évaluer pour moi Human vs Computer Humain contre Ordinateur Computer vs Human Ordinateur contre Humain Game Mode Mode de jeu Press the button below or Key Enter if You're done. Cliquer le bouton ci-dessous ou presser la touche Entrée quand vous êtes prêt. Place Your secret ColorCode ... Placez votre code couleur secret... Please rate the guess. Press OK or Key Enter if You're done. Evaluer l'essai. Cliquer OK ou presser la touche Entrée quand vous êtes prêt. The impossible happened, sorry. L'impossible advint, désolé. Yeah! I guessed it, man! Youpi! Je l'ai deviné ! Embarrassing! I lost a game! Embarassant ! J'ai perdu la partie ! Nope! Thats impossible! Did you gave me false hints? Nenni ! Ceci est impossible ! M'avez-vous donné de faux indices ? Don't you like to see me winning? ;-) Aimez-vous me voir gagner ? ;-) Set Hints automatically Afficher les indices automatiquement Ctrl+Shift+H Preferences Préférences Ctrl+P Show Indicators Montrer les indicateurs sur les fiches The chosen settings do not allow pegs of the same color! Les préférences choisies ne permettent pas plusieurs fiches de même couleur ! &Start particular Game &Démarrer une partie en particulier &Bookmark current Game &Enregister un signet pour cette partie Ctrl+B Ctrl+B Ctrl+Alt+H Ctrl+Alt+H &Recent Games &Parties récentes Ctrl+Alt+R Ctrl+Alt+R &Bookmarks &Signets Ctrl+Alt+B Ctrl+Alt+B Ctrl+Shift+S Ctrl+Shift+S Game &Lists &Parties guessed and rated ... deviné et évalué... Let me think ... Je réfléchis... Computer vs. Human Ordinateur contre Humain &Highscores &Meilleurs scores Ctrl+Shift+B Ctrl+Alt+N Ctrl+Alt+N &Have a Break &Mettre en pause &Bookmark Current Game &Mettre unsignet au jeu Ctrl+Shift+T Ctrl+Shift+T Show Timer Montrer le minuteur Display Game Number Afficher le numéro de partie Allow Pegs of Same Color Autoriser des fiches de même couleur Disallow Pegs of Same Color Ne pas autoriser des fiches de même couleur Ctrl+Alt+C Ctrl+Alt+C Ctrl+Shift+P Ctrl+Shift+P &Resume Game &Redémarrer le jeu Human vs. Computer Humain contre Ordinateur Game Number Numéro de partie Paused En pause &Copy Game Number &Copier le numéro de partie ColorCode ColorCode GameNoDisplay Human vs. Computer Humain contre Ordinateur Game Number Numéro de partie GameTablesDialog ColorCode Games Jeux ColorCode Game Properties Propriétés de la partie User Utilisateur Color Count Nombre de couleurs Slot Count Nombre de fiches Pegs of Same Color Fiches de même couleur Yes Oui Game Number Numéro de partie Date and Time Date et heure Duration Durée Insert Game Number Insérer un numéro de partie Play Jouer Recent Games Parties récentes Bookmarks Signets Highscores Meilleurs scores Clear List Effacer liste Close Fermer No Non Message Message This will permanently remove all entries from the List. Do You want to proceed? Ceci effacera définitivement tous les éléments de la liste. Voulez-vous continuer ? Game Number Input Entrée numéro de partie Bookmarked Games Jeux marqués avec un signet High Score List Liste des meilleurs scores Please provide a name! Otherwise your score won't be saved. Merci de donner un nom! Votre score ne serait pas enregistré. Insert an arbitrary game number greater than 0 in the input field above. <br><br>The game properties like color count, slot count etc. will be displayed in the corresponding area above.<br><br>Click the Play button or press key Enter, to play the game. If a game is currently running, it will be aborted. Insérer un numéro de partie arbitraire supérieur à 0 dans le champ ci-dessus.<br><br>Les propriétés de la partie, comme le nombre de couleurs, le nombre de fiches, etc. seront affichées dans la zone correspondante ci-dessus.<br><br>Cliquer sur le bouton Jouer ou presser la touche Entrée pour commencer une partie. Si une partie est en cours, elle sera arrêtée. Game Lists Parties GamesListModel Yes Oui No Non Pegs of Same Color Fiches de même couleur Actions Actions Rank Classement User Utilisateur Score Score Date Date Time Heure Colors Couleurs Slots Trous Game No. Partie No. PrefDialog ... Select from predefined level settings ... Sélectionner à partir des préférences de niveau Beginner (2 Colors, 2 Slots, Doubles) Débutant (2 couleurs, 2 trous, doubles) Easy (4 Colors, 3 Slots, No Doubles) Facile (4 couleurs, 3 trous, pas de doubles) Classic (6 Colors, 4 Slots, Doubles) Classique (6 couleurs, 4 trous, doubles) Challenging (8 Colors, 4 Slots, Doubles) Évolué (8 couleurs, 4 trous, doubles) Hard (10 Colors, 5 Slots, Doubles) Difficile (10 couleurs, 5 trous, doubles) Slots Trous Colors Couleurs Human vs. Computer Humain contre Ordinateur Computer vs. Human Ordinateur contre Humain Low Bas Medium Moyen High Élevé Preferences Préférences Appearance Apparence Controls Contrôles Show or hide the Menubar. Afficher ou cacher la barre de menu. Show Menubar Afficher la barre de menu Show or hide the Toolbar. Afficher ou cacher la barre d'outils. Show Toolbar Afficher la barre d'outils Show or hide the Statusbar. Afficher ou cacher la barre d'état. Show Statusbar Afficher la barre d'état Indicators Indicateurs de fiche If this option is checked, an indicator inside each peg is displayed. Si cette option est cochée, un indicateur est affiché à l'intérieur de chaque fiche. Show Indicators inside pegs Montrer les indicateurs sur les fiches Use unique letters as indicators. Utiliser des lettres uniques comme indicateurs. Letter Indicators Lettres indicateur Use unique numbers as indicators. Utiliser des chiffres uniques comme indicateurs. Number Indicators Chiffres indicateur Use the same neutral background color for each peg, when indicators are shown. Utiliser la même couleur de fond neutre pour chaque fiche, quand les indicateurs sont affichés. Hide Colors Cacher les couleurs Click here if you have changed the color order and now you want to revert it to it's initial state. Cliquer ici si vous avez changé l'ordre des couleurs et que vous voulez revenir à son état initial. Reset Color Order Réinitialiser l'ordre des couleurs Game Settings Préférences de jeu Level Presets Niveaux prédéfinis Select from predefined combinations of the three different level related settings, the number of colors, the number of slots (columns) and the possibility of pegs of the same color in one row. Sélectionner un niveau à partir de niveaux prédéfinis. Number of Slots Nombre de trous Number of Colors Nombre de couleurs Number of pegs in a single row. Higher values are harder to guess. Nombre de fiches sur une rangée. Plus le nombre est élevé, plus la combinaison est difficile à deviner. Number of all possible colors. Higher values are harder to guess. Nombre de couleurs autorisées. Plus le nombre est élevé, plus la combinaison est difficile à deviner. If this option is checked, the hidden combination may contain one or more (even all would be possible) pegs of the same color. If checked, the combination is generally harder to guess. Si cette option est cochée, la combinaison cachée peut contenir une ou plusieurs (ou toutes) fiches de même couleur. Dans ce cas, la combinaison est généralement plus difficile à deviner. Allow Pegs of Same Color Autoriser plusieurs fiches de même couleur Game Mode Mode de jeu Select from the different game modes. In the 1. mode you have to to guess the hidden, computer generated combination, In the 2. mode your computer will try to guess your own secret combination. Sélectionner un mode de jeu parmi ceux disponibles. Dans le mode 1 il vous faut deviner la combinaison cachée, telle que choisie par l'ordinateur. Dans mode 2, l'ordinateur doit deviner la combinaison telle que vous l'aurez choisie vous-même. If checked, a row is closed as soon as you place the last peg and your guess is submitted immediatly. This option only affects the Human vs. Computer game mode. Si cette opions est cochée, votre essai est immédiatement évalué dès que la dernière fiche est placée dans son trou. Close Rows when the last Peg is placed Finaliser la rangée quand la dernière fiche est placée If checked, the computer will determine the corresponding hints for the solver's guess. This option affects only Computer vs. Human games. If checked, you only have to place your secret combination. Then the rest of the game runs automatically until the end. But you can set a delay between the guesses. Si cette option est cochée, l'ordinateur déterminera les indices pour l'essai. Cette option affecte uniquement les parties Ordinateur contre Humain. Si cette option est cochée, il vous faut uniquement définir une combinaison secrète. Ensuite, la partie se déroule automatiquement jusques à la fin. Vous pouvez régler un délai entre les essais, cependant. Set Hints automatically Afficher les indices automatiquement Adjust the delay (in ms) between two guesses. Régler le délai (en millisecondes) entre deux essais. Delay in ms Délai en millisecondes Solver Strength Force du résolveur Select from 3 different strength levels for your computer opponent. This option only affects the Computer vs. Human game mode. For the computer's guess in the Human vs. Computer mode always the highest level will be used. Sélectionner la force de votre adversaire parmi trois niveaux prédéfinis. Show Game Timer Afficher le minuteur de partie Display Game Number Afficher le numéro de partie Game Lists Parties Maximum Row Count: Nombre maximum de rangées : Use Highscores Utiliser les meilleurs scores Raise the dialog after a game has been won and prompt for the name Afficher la boîte de dialogue quand une partie est gagnée et demander le nom Automatically insert Highscores using the name below Insérer automatiquement les meilleurs scores en utilisant le nom ci-dessous Name (mandatory for the second option) Nom (obligatoire pour la deuxième option) User Interface Interface utilisateur Display the current game number in the footer. To avoid remembering, you can hide it here. Afficher le numéro de cette partie dans en bas de fenêtre. Pour éviter de vous en souvenir, cachez-le ici. Timer MInuteur You may hide the timer to keep calm ;-) But note! Even hidden, time's running in the background. Cachez-donc le minuteur pour garder votre sang-froid ;-) Attention ! Même caché, le minuteur tourne en arrière-plan. Game Properties Propriétés de la partie Select One of the Level Presets: Choisir l'un des niveaux disponibles: Or Set the Particular Properties: Ou régler les propriétés: Game Flow Flux de jeu Solver Résolveur Limit the number of rows in game tables like highscores etc. Valid values range from 5 to 50. Limiter le nombre de lignes dans les tableaux, comme les meilleurs scores, etc. Valeurs autorisées comprises entres 5 et 50. Use Customized Table Row Highlight Colors Utiliser des couleurs personnalisées pour les lignes du tableau Foreground Avant-plan Background Arrière-plan Highscores Meilleurs scores Provide a name with maximum 20 characters here to be used for highscore entries. If you checked the automatic option above, this name is mandatory, otherwise it will be used as proposal which you may change later in the dialog. Donner un nom de 20 caractères au plus pour identifier les valeurs des meilleurs scores. Si l'option automatique ci-dessus est cochée, ce nom est obligatoire, sinon il sera employé comme proposition qu'il sera possible de modifier plus loin dans cette boîte de dialogue. Uncheck this if you are confused about the time as fast running ;-) Décocher cette case si vous êtes gêné par le temps qui court ;-) Show Tenth and Hundredth Montrer les dizièmes et les centièmes RowHint Commit Your solution Envoyer votre solution Click the circles to rate my guess. Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-) Cliquer les cercles pour évaluer mon essai. Pressez Ctrl+H ou le bouton de barre d'outils pour que je le fasse à votre place de la manière la plus impartiales possible ;-) ColorCode-0.8.7/src/buttondelegate.h0000644000175000017500000000315612610736534016025 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef BUTTONDELEGATE_H #define BUTTONDELEGATE_H #include #include "buttonscell.h" #include "highscoresmodel.h" #include "gametableview.h" #include "gameslistmodel.h" class ButtonDelegate : public QStyledItemDelegate { Q_OBJECT public: ButtonDelegate(QWidget* parent = 0); QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; void setEditorData(QWidget* editor, const QModelIndex &index) const; void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex &index) const; private: GamesListModel* GetGamesListModel(const QModelIndex &index) const; private slots: void ButtonClickedSlot(); }; #endif // BUTTONDELEGATE_H ColorCode-0.8.7/src/cc32.ico0000644000175000017500000001027612610736534014075 0ustar dirkdirk  ( @ u~}^YSMRLd^rrrghh/:5   LChhh/ggg/||, ggg/:/wwoHJ xt{{{ssszyt F=fhv    $VXm   PQa " #" !  #VUN %$%$# ! F@YYYrrm!&&%$ " !  yvHHH0/,))'%# ! 94NNN5*'&" &%bbbqqq - &#  DEaaaMMM\[Q68K-60:8?RVHHHYYY{{{Ro%a`j-{[[>3;T~^l opnje^XU6==;98,IVx~~|xtojcSMBCDBA?;94=uzsjcXeFIKJIGDA=83W{Ќ3|sj^|[JPQRROMIFA=8-ywuzoek-jSWYXWTRNIE@:1lxnbuj_a\_`__[WRMIC=7^k`S !! xna\dgigea\WQLF@9`[VR "#""!|po%Qlppmke`ZTNG@8jINV۬&%&%$" ~oQ. */ #include "highscore.h" using namespace std; HighScore::HighScore() { mCombinationsCnt = 0; mRowsCnt = 0; mTime = 0; } void HighScore::NewGame(int ccnt) { mRowsCnt = 0; mTime = 0; mCombinationsCnt = ccnt; } int HighScore::GetScore(int rcnt, int t) { mRowsCnt = rcnt; mTime = t; return GetScore(); } int HighScore::GetScore() const { if (mCombinationsCnt == 0 || mRowsCnt == 0 || mTime == 0) { return 0; } double dd = mCombinationsCnt * 10000; double dv = mRowsCnt * mTime / 100; return int(dd / dv); } ColorCode-0.8.7/src/highscoresmodel.h0000644000175000017500000000267512610736534016203 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef HIGHSCORESMODEL_H #define HIGHSCORESMODEL_H #include #include #include #include #include "ccgame.h" #include "buttonscell.h" #include "gametableview.h" #include "gameslistmodel.h" class HighScoresModel : public GamesListModel { Q_OBJECT public: HighScoresModel(QObject* parent = 0); virtual void InsertRow(CCGame g); virtual int GetColIx(const int ix) const; virtual int GetMaxColCnt() const; bool IsValidHighScore(const int score) const; protected: virtual void DoSort(QList &list); }; HighScoresModel* GetHighScoresModel(); #endif // HIGHSCORESMODEL_H ColorCode-0.8.7/src/gametablesdialog.ui0000644000175000017500000003341712610736534016474 0ustar dirkdirk GameTablesDialog 0 0 320 520 0 0 320 520 320 520 ColorCode Games false true 6 9 12 75 true Game Properties Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 9 1 3 5 9 50 false User 9 75 true dirk Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 9 50 false Color Count 9 75 true 10 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 9 50 false Slot Count 9 75 true 5 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 9 50 false Pegs of Same Color 9 75 true Yes Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::NoTextInteraction 9 50 false Game Number 9 75 true 2338702 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::TextSelectableByMouse 9 50 false Date and Time 9 75 true 16.08.2010 16:35 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 9 50 false Duration 9 75 true 10250 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 9 75 true 0 46 16 false false :/img/document-new_tab.png:/img/document-new_tab.png Insert Game Number 0 4 Qt::ImhNone 10 Arial 50 false Play 50 false Qt::NoFocus QFrame::NoFrame 0 true Qt::TextSelectableByMouse :/img/history_tab.png:/img/history_tab.png Recent Games 6 0 :/img/bookmark_tab.png:/img/bookmark_tab.png Bookmarks 6 0 :/img/games-highscores_tab.png:/img/games-highscores_tab.png Highscores 0 Qt::Horizontal 40 20 Clear List Close ColorCode-0.8.7/src/savedgamesmodel.cpp0000644000175000017500000000317514524760043016511 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "savedgamesmodel.h" #include "gametableview.h" SavedGamesModel* GetSavedGamesModel() { static SavedGamesModel* m = new SavedGamesModel(); return m; } SavedGamesModel::SavedGamesModel(QObject* parent) : GamesListModel(parent) { mId = MODEL_ID_SAVED; mEditIndex = QModelIndex(); mMaxSize = 20; } int SavedGamesModel::GetColIx(const int ix) const { int ret = -1; if (ix == COL_GAMENO) { ret = 0; } else if (ix == COL_CCNT) { ret = 1; } else if (ix == COL_PCNT) { ret = 2; } else if (ix == COL_DOUBLES) { ret = 3; } else if (ix == COL_DELETE) { ret = 4; } return ret; } int SavedGamesModel::GetMaxColCnt() const { return 5; } void SavedGamesModel::DoSort(QList &list) { std::sort(list.begin(), list.end(), GamesListModel::SortListTime); } ColorCode-0.8.7/src/trans_de.ts0000644000175000017500000011073214527472132015014 0ustar dirkdirk About &Author &Autor icon &License &Lizenz A needful game to train your brain ;-) Ein Spiel, um den Verstand<br>wachzuhalten ;-) About ColorCode Info ColorCode <br><br>Free MasterMind clone including a built in,<br>rather intelligent solver. <br><br>Freie MasterMind-Variante mit ziemlich <br>intelligentem Rechner-Spieler. Version Version Author Autor 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. Dieses Programm ist freie Software. Sie können es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation veröffentlicht, weitergeben und/oder modifizieren, entweder gemäß Version 3 der Lizenz oder (nach Ihrer Option) jeder späteren Version. ButtonsCell Play this Game again Spiel starten Save this Game as Bookmark Spiel als Favorit speichern Remove from List Aus der Liste löschen Copy Game Number to Clipboard Spiel-Nummer in die Zwischenablage kopieren ColorCode New Game Neues Spiel Do you want to give in and start a new Game? Wollen Sie aufgeben und ein neues Spiel beginnen? About Qt Info Qt &New Game &Neues Spiel Ctrl+N &Restart Game Spiel neu &beginnen Ctrl+R E&xit B&eenden Ctrl+Q Ctrl+T Ctrl+C Ctrl+A About &Qt Info &Qt &Game &Spiel &Settings &Einstellungen &Help &Hilfe Game Spiel Message Hinweis The changed settings will only apply to new games! Do you want to give in the current and start a new Game? Die geänderten Einstellungen werden erst in neuen Spielen berücksichtigt! Möchten Sie das gegenwärtige Spiel aufgeben und ein neues Spiel beginnen? Place Your pegs ... Setzen Sie Ihre Steine ... Congratulation! You have won! Glückwunsch! Sie haben gewonnen! Sorry! You lost! Schade, aber Sie haben es nicht vermocht! Ctrl+I Give In Aufgeben Do you really want to give in? Wollen Sie wirklich aufgeben? &Throw In The Towel &Handtuch werfen Ctrl+G Sure, You're too weak for me! Klar, Sie sind zu schwach für mich! Ctrl+Shift+R Ctrl+Shift+C Fill Row by Random Reihe zufällig füllen Duplicate Previous Row Vorherige Reihe duplizieren Ctrl+D Clear Row Reihe leeren &Row &Reihe About &ColorCode Info &ColorCode Ctrl+M Show Toolbar Werkzeugleiste anzeigen Show Menubar Menüleiste anzeigen Show Statusbar Statusleiste anzeigen Allow Pegs of the Same Color Steine gleicher Farbe erlauben Level Schwierigkeitsstufe Computer's Guess Lassen Sie Ihren Rechner raten Ctrl+H Press the Hint Field or Key Enter if You're done. Fertig? Benutzen Sie das Hinweis-Feld oder die Eingabetaste. Disallow Pegs of the Same Color Keine Steine gleicher Farbe erlauben Close Rows when the last Peg is placed Reihen nach Setzen des letzten Steins auswerten Ctrl+L Beginner (2 Colors, 2 Slots, Doubles) Anfänger (2 Farben, 2 Slots, Doppelte) Easy (4 Colors, 3 Slots, No Doubles) Leicht (4 Farben, 3 Slots, Keine Doppelten) Classic (6 Colors, 4 Slots, Doubles) Klassisch (6 Farben, 4 Slots, Doppelte) Challenging (8 Colors, 4 Slots, Doubles) Fordernd (8 Farben, 4 Slots, Doppelte) Hard (10 Colors, 5 Slots, Doubles) Schwer (10 Farben, 5 Slots, Doppelte) Level Presets Schwierigkeitsstufen Colors Farben Pegs of Same Color Steine gleicher Farbe Slots Felder Yes Ja No Nein Reset Color Order Farbreihenfolge zurücksetzen Ctrl+Shift+L Online &Help Online-&Hilfe F1 Done Fertig Ctrl+Shift+N Rate it for me Bewerte für mich Human vs Computer Mensch gegen Rechner Computer vs Human Rechner gegen Mensch Game Mode Spiel Modus Press the button below or Key Enter if You're done. Fertig? Benutzen Sie den Button oder die Eingabetaste. Place Your secret ColorCode ... Platzieren Sie den geheimen ColorCode ... Please rate the guess. Press OK or Key Enter if You're done. Bitte bewerten Sie meinen Vorschlag. Nutzen Sie Ok-Button oder Eingabetaste wenn fertig. The impossible happened, sorry. Das Unmögliche ist eingetreten, leider. Yeah! I guessed it, man! Ich hab's geahnt! Embarrassing! I lost a game! Peinlich! Ich hab ein Spiel verloren! Nope! Thats impossible! Did you gave me false hints? Nein! Das ist unmöglich! Haben Sie falsch bewertet? Don't you like to see me winning? ;-) Ertragen Sie es nicht, mich gewinnen zu sehen? ;-) Set Hints automatically Hinweise automatisch setzen Ctrl+Shift+H Preferences Einstellungen Ctrl+P Show Indicators Bezeichner anzeigen The chosen settings do not allow pegs of the same color! Die gewählten Einstellungen erlauben keine Steine gleicher Farbe! &Start particular Game &Bestimmtes Spiel starten Ctrl+B Strg+B Ctrl+Alt+H Strg+Alt+H &Recent Games &Zuletzt gespielte Spiele Ctrl+Alt+R Strg+Alt+R &Bookmarks &Favoriten Ctrl+Alt+B Strg+Alt+B Ctrl+Shift+S Strg+Umschalt+S Game &Lists Spiele-&Listen guessed and rated ... geraten und bewertet ... Let me think ... Ich muß nachdenken ... Computer vs. Human Rechner gegen Mensch &Highscores &Bestenliste Ctrl+Shift+B Strg+Umschalt+B Ctrl+Alt+N &Have a Break &Denk-Pause &Bookmark Current Game &Spiel in den Favoriten speichern Ctrl+Shift+T Show Timer Spielzeit anzeigen Display Game Number Spiel-Nummer anzeigen Allow Pegs of Same Color Steine gleicher Farbe erlauben Disallow Pegs of Same Color Keine Steine gleicher Farbe erlauben Ctrl+Alt+C Ctrl+Shift+P &Resume Game Spiel &weiterspielen Human vs. Computer Mensch gegen Rechner Game Number Spiel-Nummer Paused Pause &Copy Game Number Spiel &Nummer kopieren ColorCode ColorCode GameTablesDialog ColorCode Games ColorCode-Spiele Game Properties Spiel-Eigenschaften User Spieler Color Count Farben Slot Count Felder Pegs of Same Color Steine gleicher Farbe Yes Ja Game Number Spiel-Nummer Date and Time Datum Duration Spieldauer Insert Game Number Spiel-Nummer eingeben Play Spielen Recent Games Letzte Spiele Bookmarks Favoriten Highscores Bestenliste Clear List Liste leeren Close Schließen No Nein Message Hinweis This will permanently remove all entries from the List. Do You want to proceed? Es werden unwideruflich alle Einträge aus der Liste entfernt Möchten Sie fortfahren? Game Number Input Spiel-Nummern Bookmarked Games Favoriten High Score List Bestenliste Please provide a name! Otherwise your score won't be saved. Bitte vergeben Sie einen Namen. Ansonsten wird das Spiel nicht gespeichert. Insert an arbitrary game number greater than 0 in the input field above. <br><br>The game properties like color count, slot count etc. will be displayed in the corresponding area above.<br><br>Click the Play button or press key Enter, to play the game. If a game is currently running, it will be aborted. Geben Sie eine beliebige Spiel-Nummer größer als 0 in das Eingabefeld ein.&lt;br&gt;&lt;br&gt;Die Spieleigenschaften wie Anzahl der Farben und Felder etc. werden im Eigenschaftsbereich darüber angezeigt.&lt;br&gt;&lt;br&gt;Drücken Sie auf Spielen oder die Eingabetaste, um ein Spiel zu spielen. Falls gerade ein Spiel läuft, wird dieses abgebrochen. Game Lists Spiele-Listen GamesListModel Yes Ja No Nein Pegs of Same Color Steine gleicher Farbe Actions Aktionen Rank Platz User Spieler Score Punkte Date Datum Time Zeit Colors Farben Slots Felder Game No. Spiel-Nr. PrefDialog ... Select from predefined level settings ... Schwierigkeitsstufe auswählen Beginner (2 Colors, 2 Slots, Doubles) Anfänger (2 Farben, 2 Slots, Doppelte) Easy (4 Colors, 3 Slots, No Doubles) Leicht (4 Farben, 3 Slots, Keine Doppelten) Classic (6 Colors, 4 Slots, Doubles) Klassisch (6 Farben, 4 Slots, Doppelte) Challenging (8 Colors, 4 Slots, Doubles) Fordernd (8 Farben, 4 Slots, Doppelte) Hard (10 Colors, 5 Slots, Doubles) Schwer (10 Farben, 5 Slots, Doppelte) Slots Felder Colors Farben Human vs. Computer Mensch gegen Rechner Computer vs. Human Rechner gegen Mensch Low Schwach Medium Mittel High Stark Preferences Einstellungen Controls Bedienelemente Show or hide the Menubar. Menüleiste anzeigen oder ausblenden. Show Menubar Menüleiste anzeigen Show or hide the Toolbar. Werkzeugleiste anzeigen oder ausblenden. Show Toolbar Werkzeugleiste anzeigen Show or hide the Statusbar. Statusleiste anzeigen oder ausblenden. Show Statusbar Statusleiste anzeigen Indicators Bezeichner If this option is checked, an indicator inside each peg is displayed. Wenn diese Option aktiv ist, wird ein zusätzlicher Bezeichner für jeden Stein angezeigt. Show Indicators inside pegs Bezeichner für Steine anzeigen Use unique letters as indicators. Buchstaben als Bezeichner verwenden. Letter Indicators Buchstaben-Bezeichner Use unique numbers as indicators. Zahlen als Bezeichner verwenden. Number Indicators Zahlen-Bezeichner Use the same neutral background color for each peg, when indicators are shown. Die gleiche, neutrale Farbe für alle Steine verwenden, falls Bezeichner angezeigt werden. Hide Colors Farben ausblenden Click here if you have changed the color order and now you want to revert it to it's initial state. Klicken Sie hier, falls Sie die Farben-Anordnung geändert haben, um diese wieder in den ursprünglichen Zustand zurückzuversetzen. Reset Color Order Farbreihenfolge zurücksetzen Game Settings Spiel-Einstellungen Select from predefined combinations of the three different level related settings, the number of colors, the number of slots (columns) and the possibility of pegs of the same color in one row. Wählen Sie eine vordefinierte Kombination der drei verschiedenen, die Schwierigkeitsstufe beeinflussenden Einstellungen. Number of Slots Anzahl der Felder Number of Colors Anzahl der Farben Number of pegs in a single row. Higher values are harder to guess. Die Anzahl der Steine in einer einzelnen Reihe. Höhere Werte sind schwerer zu erraten. Number of all possible colors. Higher values are harder to guess. Gesamtanzahl der möglichen Farben. Höhere Werte sind schwerer zu erraten. If this option is checked, the hidden combination may contain one or more (even all would be possible) pegs of the same color. If checked, the combination is generally harder to guess. Wenn diese Option aktiv ist, können Kombinationen Steine gleicher Farbe enthalten. Solche Kombinationen sind etwas schwerer zu erraten. Allow Pegs of Same Color Steine gleicher Farbe erlauben Game Mode Spiel Modus Select from the different game modes. In the 1. mode you have to to guess the hidden, computer generated combination, In the 2. mode your computer will try to guess your own secret combination. Wählen Sie einen Spiel-Modus aus. Im 1. Fall müssen Sie versuchen, die verborgene, rechnergenerierte Kombination zu erraten. Im 2. Fall wird Ihr Rechner versuchen, eine geheime Kombination Ihrer Wahl zu erraten. If checked, a row is closed as soon as you place the last peg and your guess is submitted immediatly. This option only affects the Human vs. Computer game mode. Wenn aktiv, wird eine Reihe als geschlossen betrachtet, sobald Sie den letzten Stein platziert haben, und Ihr Vorschlag wird sofort ausgewertet. Diese Option hat nur Auswirkungen in Mensch-gegen-Rechner-Spielen. Close Rows when the last Peg is placed Reihen nach Setzen des letzten Steins auswerten If checked, the computer will determine the corresponding hints for the solver's guess. This option affects only Computer vs. Human games. If checked, you only have to place your secret combination. Then the rest of the game runs automatically until the end. But you can set a delay between the guesses. Wenn aktiv, werden die Hinweisfelder zu den Rechner-Schätzungen automatisch ausgefüllt. Diese Option betrifft nur Rechner-gegen-Mensch-Spiele. Falls aktiv, müssen Sie nur Ihre geheime Kombination anordnen. Der Rest des Spiels läuft dann automatisch bis zum Ende ab. Sie können allerdings eine Verzögerung bestimmen. Set Hints automatically Hinweise automatisch setzen Adjust the delay (in ms) between two guesses. Verzögerung (in ms) zwischen den Spielzügen. Delay in ms Verzögerung in ms Solver Strength Rechner-Stärke Select from 3 different strength levels for your computer opponent. This option only affects the Computer vs. Human game mode. For the computer's guess in the Human vs. Computer mode always the highest level will be used. Wählen Sie eine der 3 verschiedenen Spielstärken für Ihren Rechner-Gegner aus. Diese Option hat nur Einfluß auf Rechner-gegen-Mensch-Spiele. Für die Rechner-Rat-Funktion im Mensch-gegen-Rechner-Modus wird immer die höchste Spielstärke verwendet. Show Game Timer Spiel-Zeit anzeigen Display Game Number Spiel-Nummer anzeigen Game Lists Spiele-Listen Maximum Row Count: Maximale Zeilenanzahl: Use Highscores Bestenliste verwenden Raise the dialog after a game has been won and prompt for the name Bestenliste mit Namens-Eingabe anzeigen, wenn ein Spiel gewonnen wurde Automatically insert Highscores using the name below Automatischer Eintrag in die Bestenliste mit untenstehendem Namen Name (mandatory for the second option) Name (erforderlich für die zweite Option) User Interface Benutzeroberfläche Display the current game number in the footer. To avoid remembering, you can hide it here. Zeigt die gegenwärtige Spiel-Nummer unterhalb des Spieles an. Um Erinnerungen zu vermeiden, kann die Anzeige hiermit unterdrückt werden. Timer Zeitmesser You may hide the timer to keep calm ;-) But note! Even hidden, time's running in the background. Um die Ruhe zu bewahren ;-), können Sie den Zeitmesser verbergen. Doch wie stets, auch verborgen läuft die Zeit hinterrücks weiter. Uncheck this if you are confused about the time as fast running ;-) Sollte Sie die Zeitanzeige unruhig machen, wählen Sie diese Option ab Show Tenth and Hundredth Zehntel- und Hunderstel-Sekunden anzeigen Game Properties Spiel-Eigenschaften Select One of the Level Presets: Wählen Sie eine Schwierigkeitsstufe: Or Set the Particular Properties: Oder setzen Sie die einzelnen Eigenschaften: Game Flow Spielablauf Solver Rechner-Spieler Limit the number of rows in game tables like highscores etc. Valid values range from 5 to 50. Begrenzen Sie die Anzahl der Einträge in den Tabellen wie etwa der Bestenliste etc. Werte zwischen 5 und 50 sind möglich. Use Customized Table Row Highlight Colors Farben zur Markierung der gegenwärtigen Zeile ändern Foreground Vordergrund Background Hintergrund Highscores Bestenliste Provide a name with maximum 20 characters here to be used for highscore entries. If you checked the automatic option above, this name is mandatory, otherwise it will be used as proposal which you may change later in the dialog. Geben Sie einen Namen mit maximal 20 Zeichen für Einträge in die Bestenliste an. Sollten Sie die obenstehende Option für automatische Einträge gewählt haben, ist dieser Name zwingend erforderlich. Sollten Sie die andere Option gewählt haben, wird dieser Name als Vorschlag genutzt, den Sie jedoch im Dialogfenster ändern können. RowHint Commit Your solution Kombination testen Click the circles to rate my guess. Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-) Klicken Sie die Kreise, um meinen Vorschlag zu bewerten. Drücken Sie Strg+H oder die entsprechende Werkzeugleisten-Schaltfläche, um die Bewertung einem unparteiischen Teil von mir zu übertragen ;-) ColorCode-0.8.7/src/ccsolver.h0000644000175000017500000000566012610736534014641 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef CCSOLVER_H #define CCSOLVER_H #include #include #include "colorcode.h" using namespace std; class CCSolver : public QThread { Q_OBJECT public: static const int STRENGTH_LOW; static const int STRENGTH_MEDIUM; static const int STRENGTH_HIGH; static const int STRENGTH_DYNAMIC; CCSolver(QObject* parent = 0); ~CCSolver(); vector GetSolutionByNo(const uint no) const; int GetAllCnt() const; void NewGame(const int ccnt, const int pcnt = 4, const int doubles = 1, const int level = 2, const int gcnt = 10); void RestartGame(); string FirstGuess(); void GuessIn(string str); void GuessIn(const vector* rowsol); int ResIn(const vector* res); int* GuessOut(); void StartGuess(); void Interrupt(); int GetRandGameNo(const int ccnt, const int pcnt, const int doubles) const; const int* GetGameByNo(const int uint) const; int CalcAllCnt(const int ccnt, const int pcnt) const; int CalcPosCnt(const int ccnt, const int pcnt, const int doubles) const; void run(); signals: void GuessDoneSignal(); private: static const int mFGCnts[4][9][4]; static const int mGameNos[66][4]; static const int GAME_NOS_CNT; volatile bool mInterrupt; int mMaxGuessCnt; int mColorCnt; int mPegCnt; int mDoubles; int mLevel; volatile int mLastGuess; int mLastPosCnt; int mAllCnt; int mPosCnt; int mMaxPosCnt; int mHistCnt; int mGuessCnt; int mMaxRes; int mResCnt; int mRestartCnt; int* mResTable; int* mCascade; int* mPossible; int* mPos2AllIx; int** mAllTable; int** mHist; int* mS; int* mP; void FreeTables(); void InitTables(); void FillTable(const int ix); int RowCmp(const int* sol, const int* pat); void UpdPos(const int ix, const int res); int Guess(); string RowOut(const int* r); int Row2Ix(const string str); int Row2Ix(const vector* v); int IntPow(const int b, const int e) const; int IntFac(const int n) const; int GetRealGameNo(const uint no) const; int GetGameIxByNo(const int no) const; }; #endif // CCSOLVER_H ColorCode-0.8.7/src/gamenodisplay.cpp0000644000175000017500000000247512610736534016211 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "gamenodisplay.h" #include "settings.h" using namespace std; GameNoDisplay::GameNoDisplay(QGraphicsItem* parent) : QGraphicsTextItem(parent) { mFont = QFont("Arial", 18, QFont::Normal, false); mFont.setStyleHint(QFont::SansSerif); mFont.setPixelSize(24); setFont(mFont); setDefaultTextColor(QColor("#808183")); mUpdateRect = QRectF(0, 0, 600, 40); setTextWidth(600); setScale(0.5); } void GameNoDisplay::ShowStr(QString str) { str = QString("
") + str + QString("
"); setHtml(str); } ColorCode-0.8.7/src/prevgamesmodel.h0000644000175000017500000000252612610736534016031 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef PREVGAMESMODEL_H #define PREVGAMESMODEL_H #include #include #include #include #include "ccgame.h" #include "buttonscell.h" #include "gametableview.h" #include "gameslistmodel.h" class PrevGamesModel : public GamesListModel { Q_OBJECT public: PrevGamesModel(QObject* parent = 0); virtual int GetColIx(const int ix) const; virtual int GetMaxColCnt() const; protected: virtual void DoSort(QList &list); }; PrevGamesModel* GetPrevGamesModel(); #endif // PREVGAMESMODEL_H ColorCode-0.8.7/src/resource.qrc0000644000175000017500000000305214527367555015213 0ustar dirkdirk docs/GPL.html img/application-exit.png img/document-new.png img/GNU-icon16.png img/GNU-icon32.png img/GNU-icon64.png img/GNU-icon.png img/help-about.png img/qt.png img/story-editor.png img/view-refresh.png img/face-sad.png img/edit-clear.png img/edit-copy.png img/system-switch-user.png img/cc16.png img/cc32.png img/cc64.png cc32.ico img/business_user.png img/same_color_0.png img/same_color_1.png img/help.png img/icon_female16.png img/configure.png img/document-save.png img/edit-delete.png img/games-highscores.png img/bookmark_add.png img/bookmark.png img/history.png img/resume.png img/pause.png img/same_color_header.png img/document-new_tab.png img/bookmark_tab.png img/history_tab.png img/games-highscores_tab.png ColorCode-0.8.7/src/timedisplaybg.h0000644000175000017500000000232512610736534015651 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef TIMEDISPLAYBG_H #define TIMEDISPLAYBG_H #include #include class TimeDisplayBg : public QGraphicsItem { public: TimeDisplayBg(); protected: QRectF boundingRect() const; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); private: QRectF mRect; QRectF mUpdateRect; QBrush mBgBrush; QPen mFramePen; }; #endif // TIMEDISPLAYBG_H ColorCode-0.8.7/src/about.h0000644000175000017500000000214014524753555014131 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef ABOUT_H #define ABOUT_H #include "ui_about.h" #include "colorcode.h" #include #include class About : public QDialog, public Ui::About { Q_OBJECT public: About(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); ~About(); virtual QSize sizeHint () const; }; #endif // ABOUT_H ColorCode-0.8.7/src/settings.cpp0000644000175000017500000002557512610736534015223 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "settings.h" #include "colorcode.h" #include "ccsolver.h" #include "prevgamesmodel.h" #include "savedgamesmodel.h" #include "highscoresmodel.h" using namespace std; Settings* GetSettings() { static Settings* s = new Settings(); return s; } const int Settings::INDICATOR_LETTER = 0; const int Settings::INDICATOR_NUMBER = 1; const int Settings::DEF_COLOR_CNT = 8; const int Settings::DEF_PEG_CNT = 4; const int Settings::DEF_DOUBLES = 1; const int Settings::DEF_LIST_MAX_CNT = 15; const int Settings::HIGHSCORE_NO = 0; const int Settings::HIGHSCORE_PROMPT = 1; const int Settings::HIGHSCORE_AUTO = 2; const int Settings::MAX_LENGTH_USERNAME = 20; Settings::Settings() { } void Settings::Init() { mSettings.setDefaultFormat(QSettings::IniFormat); mSettings.setFallbacksEnabled(false); InitSettings(); SaveSettingsMap(mDefMap); ReadSettings(); SaveSettingsMap(mLastMap); emit ReadSettingsGamesDone(); } Settings::~Settings() { } void Settings::InitSettings() { mShowToolBar = true; mShowMenuBar = true; mShowStatusBar = false; mShowTimer = true; mShowTenth = true; mShowGameNo = true; mShowIndicators = false; mIndicatorType = INDICATOR_LETTER; mHideColors = false; mPegCnt = DEF_PEG_CNT; mColorCnt = DEF_COLOR_CNT; mDoubles = (bool)DEF_DOUBLES; mGameMode = ColorCode::MODE_HVM; mAutoClose = false; mAutoHints = false; mHintsDelay = 500; mSolverStrength = CCSolver::STRENGTH_HIGH; mPrevGamesStr = ""; mSavedGamesStr = ""; mHighGamesStr = ""; mGamesListMaxCnt = DEF_LIST_MAX_CNT; mCustomRowHColor = false; mRowHColorFg = QApplication::palette().color(QPalette::Active, QPalette::ButtonText).name(); mRowHColorBg = QApplication::palette().color(QPalette::Active, QPalette::Button).name(); mHighScoreHandling = HIGHSCORE_PROMPT; mHighScoreUserName = ""; } QMap Settings::GetDefaultsMap() const { return mDefMap; } void Settings::SaveLastSettings() { SaveSettingsMap(mLastMap); } void Settings::RestoreLastSettings() { RestoreSettingsMap(mLastMap); } void Settings::RestoreDefSettings() { RestoreSettingsMap(mDefMap); } void Settings::RestoreSettingsMap(QMap &map) { mShowToolBar = map["ShowToolBar"].toBool(); mShowMenuBar = map["ShowMenuBar"].toBool(); mShowStatusBar = map["ShowStatusBar"].toBool(); mShowTimer = map["ShowTimer"].toBool(); mShowTenth = map["ShowTenth"].toBool(); mShowGameNo = map["ShowGameNo"].toBool(); mShowIndicators = map["ShowIndicators"].toBool(); mIndicatorType = map["IndicatorType"].toInt(); mHideColors = map["HideColors"].toBool(); mPegCnt = map["ColumnCount"].toInt(); mColorCnt = map["ColorCount"].toInt(); mDoubles = map["Doubles"].toBool(); mGameMode = map["GameMode"].toInt(); mAutoClose = map["AutoClose"].toBool(); mAutoHints = map["AutoHints"].toBool(); mHintsDelay = map["HintsDelay"].toInt(); mSolverStrength = map["SolverStrength"].toInt(); mGamesListMaxCnt = map["GamesListMaxCnt"].toInt(); mCustomRowHColor = map["CustomRowHColor"].toBool(); mRowHColorFg = map["RowHColorFg"].toString(); mRowHColorBg = map["RowHColorBg"].toString(); mHighScoreHandling = map["HighScoreHandling"].toInt(); mHighScoreUserName = map["HighScoreUserName"].toString(); Validate(); } void Settings::SaveSettingsMap(QMap &map) { map["ShowToolBar"] = mShowToolBar; map["ShowMenuBar"] = mShowMenuBar; map["ShowStatusBar"] = mShowStatusBar; map["ShowTimer"] = mShowTimer; map["ShowTenth"] = mShowTenth; map["ShowGameNo"] = mShowGameNo; map["ShowIndicators"] = mShowIndicators; map["IndicatorType"] = mIndicatorType; map["HideColors"] = mHideColors; map["ColumnCount"] = mPegCnt; map["ColorCount"] = mColorCnt; map["Doubles"] = mDoubles; map["GameMode"] = mGameMode; map["AutoClose"] = mAutoClose; map["AutoHints"] = mAutoHints; map["HintsDelay"] = mHintsDelay; map["SolverStrength"] = mSolverStrength; map["GamesListMaxCnt"] = mGamesListMaxCnt; map["CustomRowHColor"] = mCustomRowHColor; map["RowHColorFg"] = mRowHColorFg; map["RowHColorBg"] = mRowHColorBg; map["HighScoreHandling"] = mHighScoreHandling; map["HighScoreUserName"] = mHighScoreUserName; } void Settings::ReadSettings() { mSettings.beginGroup("Appearance"); mShowToolBar = mSettings.value("ShowToolBar", mShowToolBar).toBool(); mShowMenuBar = mSettings.value("ShowMenuBar", mShowMenuBar).toBool(); mShowStatusBar = mSettings.value("ShowStatusBar", mShowStatusBar).toBool(); mShowTimer = mSettings.value("ShowTimer", mShowTimer).toBool(); mShowTenth = mSettings.value("ShowTenth", mShowTenth).toBool(); mShowGameNo = mSettings.value("ShowGameNo", mShowGameNo).toBool(); mShowIndicators = mSettings.value("ShowIndicators", mShowIndicators).toBool(); mIndicatorType = mSettings.value("IndicatorType", mIndicatorType).toInt(); mHideColors = mSettings.value("HideColors", mHideColors).toBool(); mSettings.endGroup(); mSettings.beginGroup("Game"); mPegCnt = mSettings.value("ColumnCount", mPegCnt).toInt(); mColorCnt = mSettings.value("ColorCount", mColorCnt).toInt(); mDoubles = mSettings.value("Doubles", mDoubles).toBool(); mGameMode = mSettings.value("GameMode", mGameMode).toInt(); mAutoClose = mSettings.value("AutoClose", mAutoClose).toBool(); mAutoHints = mSettings.value("AutoHints", mAutoHints).toBool(); mHintsDelay = mSettings.value("HintsDelay", mHintsDelay).toInt(); mSolverStrength = mSettings.value("SolverStrength", mSolverStrength).toInt(); mSettings.endGroup(); mSettings.beginGroup("History"); mPrevGamesStr = mSettings.value("PrevGames", "").toString(); mSavedGamesStr = mSettings.value("SavedGames", "").toString(); mHighGamesStr = mSettings.value("HighScoreList", "").toString(); mGamesListMaxCnt = mSettings.value("GamesListMaxCnt", mGamesListMaxCnt).toInt(); mCustomRowHColor = mSettings.value("CustomRowHColor", mCustomRowHColor).toBool(); mRowHColorFg = mSettings.value("RowHColorFg", mRowHColorFg).toString(); mRowHColorBg = mSettings.value("RowHColorBg", mRowHColorBg).toString(); mHighScoreHandling = mSettings.value("HighScoreHandling", mHighScoreHandling).toInt(); mHighScoreUserName = mSettings.value("HighScoreUserName", mHighScoreUserName).toString(); mSettings.endGroup(); Validate(); } void Settings::Validate() { if (mIndicatorType != INDICATOR_LETTER && mIndicatorType != INDICATOR_NUMBER) { mIndicatorType = INDICATOR_LETTER; } if (mPegCnt < 2 || mPegCnt > 5) { mPegCnt = 4; } if (mColorCnt < 2 || mColorCnt > 10) { mColorCnt = 8; } if (mGameMode != ColorCode::MODE_HVM && mGameMode != ColorCode::MODE_MVH) { mGameMode = ColorCode::MODE_HVM; } if (mSolverStrength < CCSolver::STRENGTH_LOW || mSolverStrength > CCSolver::STRENGTH_HIGH) { mSolverStrength = CCSolver::STRENGTH_HIGH; } if (mHintsDelay > 10000) { mHintsDelay = 10000; } else if (mHintsDelay < 0) { mHintsDelay = 0; } if (mHighScoreHandling == HIGHSCORE_AUTO && mHighScoreUserName == "") { mHighScoreHandling = HIGHSCORE_PROMPT; } else if (mHighScoreHandling < HIGHSCORE_NO || mHighScoreHandling > HIGHSCORE_AUTO) { mHighScoreHandling = HIGHSCORE_PROMPT; } if (mGamesListMaxCnt < 5 || mGamesListMaxCnt > 50) { mGamesListMaxCnt = DEF_LIST_MAX_CNT; } QColor color; color.setNamedColor(mRowHColorFg); if (!color.isValid()) { mRowHColorFg = mDefMap["RowHColorFg"].toString(); } color.setNamedColor(mRowHColorBg); if (!color.isValid()) { mRowHColorBg = mDefMap["RowHColorBg"].toString(); } } CCGame* Settings::GetCurSettingsGame() const { CCGame* g = new CCGame(); g->mColorCnt = mColorCnt; g->mPegCnt = mPegCnt; g->mDoubles = int(mDoubles); g->mGameMode = mGameMode; g->mTime = QDateTime::currentDateTime().toTime_t(); return g; } QString Settings::GetActiveRowHFg() const { if (mCustomRowHColor) { return mRowHColorFg; } return mDefMap["RowHColorFg"].toString(); } QString Settings::GetActiveRowHBg() const { if (mCustomRowHColor) { return mRowHColorBg; } return mDefMap["RowHColorBg"].toString(); } void Settings::WriteSettings() { mSettings.beginGroup("Appearance"); mSettings.setValue("ShowToolBar", mShowToolBar); mSettings.setValue("ShowMenuBar", mShowMenuBar); mSettings.setValue("ShowStatusBar", mShowStatusBar); mSettings.setValue("ShowTimer", mShowTimer); mSettings.setValue("ShowTenth", mShowTenth); mSettings.setValue("ShowGameNo", mShowGameNo); mSettings.setValue("ShowIndicators", mShowIndicators); mSettings.setValue("IndicatorType", mIndicatorType); mSettings.setValue("HideColors", mHideColors); mSettings.endGroup(); mSettings.beginGroup("Game"); mSettings.setValue("ColumnCount", mPegCnt); mSettings.setValue("ColorCount", mColorCnt); mSettings.setValue("Doubles", mDoubles); mSettings.setValue("GameMode", mGameMode); mSettings.setValue("AutoClose", mAutoClose); mSettings.setValue("AutoHints", mAutoHints); mSettings.setValue("HintsDelay", mHintsDelay); mSettings.setValue("SolverStrength", mSolverStrength); mSettings.endGroup(); mSettings.beginGroup("History"); mSettings.setValue("PrevGames", GetPrevGamesModel()->GetListStr()); mSettings.setValue("SavedGames", GetSavedGamesModel()->GetListStr()); mSettings.setValue("HighScoreList", GetHighScoresModel()->GetListStr()); mSettings.setValue("GamesListMaxCnt", mGamesListMaxCnt); mSettings.setValue("CustomRowHColor", mCustomRowHColor); mSettings.setValue("RowHColorFg", mRowHColorFg); mSettings.setValue("RowHColorBg", mRowHColorBg); mSettings.setValue("HighScoreUserName", mHighScoreUserName); mSettings.setValue("HighScoreHandling", mHighScoreHandling); mSettings.endGroup(); mSettings.sync(); } ColorCode-0.8.7/src/savedgamesmodel.h0000644000175000017500000000254512610736534016160 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef SAVEDGAMESMODEL_H #define SAVEDGAMESMODEL_H #include #include #include #include #include "ccgame.h" #include "buttonscell.h" #include "gametableview.h" #include "gameslistmodel.h" class SavedGamesModel : public GamesListModel { Q_OBJECT public: SavedGamesModel(QObject* parent = 0); virtual int GetColIx(const int ix) const; virtual int GetMaxColCnt() const; protected: virtual void DoSort(QList &list); }; SavedGamesModel* GetSavedGamesModel(); #endif // SAVEDGAMESMODEL_H ColorCode-0.8.7/src/solutionrow.h0000644000175000017500000000244612610736534015424 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef SOLUTIONROW_H #define SOLUTIONROW_H #include #include #include #include "pegrow.h" class SolutionRow : public PegRow { public: SolutionRow(QObject* parent = 0); ~SolutionRow(); void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); QRectF boundingRect() const; protected: void SetXOffs(); private: void InitGraphics(); QRectF mRect; QRectF mRectC; QBrush mBgBrush; QPen mFramePen; QFont mFont; }; #endif // SOLUTIONROW_H ColorCode-0.8.7/src/prefdialog.h0000644000175000017500000000460712610736534015135 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef PREFDIALOG_H #define PREFDIALOG_H #include "ui_prefdialog.h" #include "settings.h" #include "colorcode.h" #include "ccsolver.h" #include #include class PrefDialog : public QDialog, public Ui::PrefDialog { Q_OBJECT public: PrefDialog(QWidget* parent = 0, Qt::WindowFlags f = Qt::Dialog); ~PrefDialog(); void InitSettings(); void SetSettings(); virtual QSize sizeHint () const; signals: void ResetColorOrderSignal(); private slots: void ApplySlot(); void RestoreDefSlot(); void CancelSlot(); void OkSlot(); void LevelPresetChangedSlot(); void ColorCntChangedSlot(); void PegCntChangedSlot(); void DoublesChangedSlot(); void ShowIndicatorsChangedSlot(int state); void ResetColorOrderSlot(); void UseHighscoresChangedSlot(int state); void ShowTimerChangedSlot(int state); void CustomRowHColorChangedSlot(int state); void SetBtnColorSlot(); private: bool SetSuppressSlots(bool b, bool force = false); void InitControls(); void CheckLevelPresets(); void CheckDoubles(); void SetSwatchStyleSheet(QPushButton* btn, const QString colorstr); void SetBtnColor(QPushButton* btn); QColor GetCurBtnColor(const QPushButton* btn); QColor Desaturate(QColor c); void ApplySettings(); QPushButton* mRestoreBtn; QPushButton* mOkBtn; QPushButton* mApplyBtn; QPushButton* mCancelBtn; Settings* mSettings; bool mSuppressSlots; }; #endif // PREFDIALOG_H ColorCode-0.8.7/src/gametablesdialog.h0000644000175000017500000000467412610736534016311 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef GAMETABLESDIALOG_H #define GAMETABLESDIALOG_H #include #include class GamesListModel; class GameTableView; class CCGame; namespace Ui { class GameTablesDialog; } class GameTablesDialog : public QDialog { Q_OBJECT public: static const int TABIX_INPUT; static const int TABIX_PREVIOUS; static const int TABIX_BOOKMARKS; static const int TABIX_HIGHSCORES; GameTablesDialog(QWidget* parent = 0, Qt::WindowFlags f = Qt::Dialog); ~GameTablesDialog(); void ShowTab(int tabix); GameTableView* mPrevTableView; GameTableView* mSavedTableView; GameTableView* mHighTableView; public slots: void ShowInputSlot(); void ShowPrevSlot(); void ShowSavedSlot(); void ShowHighSlot(); void HoverRowSlot(const int row); void ReadSettingsGamesSlot(); void SetSettingsSlot(); void InsertHighScoreSlot(CCGame* g); void InsertPrevGameSlot(CCGame* g); void InsertSavedGameSlot(CCGame* g); void NewGameInputSlot(CCGame* g); void OkBtnSlot(); void ClearListSlot(); void CurrentTabChanged(int ix); virtual void reject(); signals: void NewGameInputSignal(CCGame* g); protected: void changeEvent(QEvent *e); virtual void closeEvent(QCloseEvent* e); private: void Init(); void SetRowHeight(); GamesListModel* GetCurModel() const; GameTableView* GetCurView() const; void SetGameProperties(const CCGame* g); QString FormatDuration(const uint dur) const; CCGame* mLastGameProperties; Ui::GameTablesDialog *ui; private slots: void GameNoInpChangedSlot(const QString &txt); void PlayInputSlot(); void ValidNameCommitSlot(); }; #endif // GAMETABLESDIALOG_H ColorCode-0.8.7/src/pegfactory.cpp0000644000175000017500000002362612610736534015521 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "pegfactory.h" using namespace std; const int PegFactory::XPOS_BTNS_COL = 279; PegFactory::PegFactory() { mWin = ColorCode::INSTANCE; mSettings = GetSettings(); mHideColors = false; InitTypesMap(); InitPegBtns(); } ColorPeg* PegFactory::CreatePeg(int ix) { if (ix < 0 || ix >= ColorCode::mColorCnt) { ix = mAllPegs.size() % ColorCode::mColorCnt; } QPoint btnpos = mBtnPos[ix]; PegType *pt = mTypesMap[ix]; ColorPeg *peg; if (mPegBuff.empty()) { peg = new ColorPeg; peg->SetPegType(pt); peg->SetBtn(true); peg->SetIndicator(mSettings->mShowIndicators, mSettings->mIndicatorType, mHideColors); peg->SetId(mAllPegs.size()); mWin->mScene->addItem(peg); peg->setPos(btnpos); peg->setZValue(ColorCode::LAYER_PEGS); mAllPegs.push_back(peg); mWin->mScene->clearSelection(); mWin->mScene->update(btnpos.x(), btnpos.y(), 38, 38); connect(peg, SIGNAL(PegPressSignal(ColorPeg *)), this, SLOT(PegPressSlot(ColorPeg *))); connect(peg, SIGNAL(PegSortSignal(ColorPeg *)), this, SLOT(PegSortSlot(ColorPeg *))); connect(peg, SIGNAL(PegReleasedSignal(ColorPeg *)), this, SLOT(PegReleasedSlot(ColorPeg *))); } else { unsigned int sz = mPegBuff.size(); peg = mPegBuff.at(sz - 1); mPegBuff.resize(sz - 1); peg->setVisible(true); peg->SetPegType(pt); peg->SetBtn(true); peg->SetEnabled(true); peg->setPos(btnpos); mWin->mScene->clearSelection(); mWin->mScene->update(btnpos.x(), btnpos.y(), 38, 38); } return peg; } ColorPeg* PegFactory::GetPegBtn(int ix) { return mPegBtns[ix]; } void PegFactory::RemovePegSlot(ColorPeg* cp) { if (cp != NULL) { cp->Reset(); cp->setVisible(false); mPegBuff.push_back(cp); mWin->mScene->update(cp->pos().x(), cp->pos().y(), 45, 45); } } void PegFactory::PegPressSlot(ColorPeg* cp) { if (cp == NULL) { return; } cp->setZValue(ColorCode::LAYER_DRAG); if (cp->IsBtn()) { cp->SetBtn(false); mPegBtns[cp->GetPegType()->ix] = CreatePeg(cp->GetPegType()->ix); mPegBtns[cp->GetPegType()->ix]->SetEnabled(false); } } void PegFactory::PegSortSlot(ColorPeg* cp) { if (cp == NULL) { return; } cp->setZValue(ColorCode::LAYER_DRAG); if (cp->IsBtn()) { cp->SetBtn(false); mPegBtns[cp->GetPegType()->ix] = CreatePeg(cp->GetPegType()->ix); mPegBtns[cp->GetPegType()->ix]->SetEnabled(false); } } void PegFactory::PegReleasedSlot(ColorPeg* cp) { if (cp == NULL || !cp) { return; } cp->setZValue(ColorCode::LAYER_PEGS); mWin->mScene->clearSelection(); mWin->mScene->clearFocus(); if (cp->GetSort() == 0) { emit(SnapPegSignal(cp)); } else { int ystart = ColorCode::mRowY0 + (ColorCode::MAX_COLOR_CNT - ColorCode::mColorCnt) * 40; int ix1 = qRound((cp->pos().y() - ystart + 18) / 40); ix1 = min(ColorCode::mColorCnt - 1, max(0, ix1)); int ix0 = cp->GetPegType()->ix; if (ix0 != ix1) { ChangeColorOrder(cp->GetSort(), ix0, ix1); } RemovePegSlot(cp); } if (!mPegBtns[cp->GetPegType()->ix]->isEnabled()) { mPegBtns[cp->GetPegType()->ix]->SetEnabled(true); } } void PegFactory::SetPaused() { bool paused = (mWin->GetGameState() == ColorCode::STATE_PAUSED); vector dragged; vector::iterator it; for (it = mAllPegs.begin(); it < mAllPegs.end(); it++) { if ((*it)->GetIsDragged()) { dragged.push_back(*it); } (*it)->SetPaused(paused); } if (!paused) { for (it = dragged.begin(); it < dragged.end(); it++) { (*it)->ForceRelease(); } } SetIndicators(); } void PegFactory::SetIndicators() { bool show_indicators; if (mWin->GetGameState() == ColorCode::STATE_PAUSED) { mHideColors = true; show_indicators = false; } else if (!mSettings->mShowIndicators) { mHideColors = false; show_indicators = false; } else { mHideColors = mSettings->mHideColors; show_indicators = mSettings->mShowIndicators; } vector::iterator it; for (it = mAllPegs.begin(); it < mAllPegs.end(); it++) { (*it)->SetIndicator(show_indicators, mSettings->mIndicatorType, mHideColors); } } void PegFactory::ChangeColorOrder(const int sorttype, const int ix0, const int ix1) { QRadialGradient tmp = mGradMap[ix0]; if (sorttype == 1) { mGradMap[ix0] = mGradMap[ix1]; } else { int step = (ix1 > ix0) ? 1 : -1; int i; for (i = ix0;; i += step) { mGradMap[i] = mGradMap[i + step]; if (i == ix1 - step) { break; } } } mGradMap[ix1] = tmp; } void PegFactory::ResetColorsOrderSlot() { int ix; for (ix = 0; ix < ColorCode::MAX_COLOR_CNT; ++ix) { mGradMap[ix] = mGradBuff[ix]; } mWin->mScene->update(mWin->mScene->sceneRect()); } void PegFactory::ApplyColorCnt() { int ccnt = mSettings->mColorCnt; ccnt = max(2, min(10, ccnt)); if (ColorCode::mColorCnt == ccnt) { return; } ColorCode::mColorCnt = ccnt; int ystart = ColorCode::mRowY0 + (ColorCode::MAX_COLOR_CNT - ccnt) * 40; int ypos; int i; for (i = 0; i < ColorCode::MAX_COLOR_CNT; ++i) { ypos = ystart + i * 40 + 2; mBtnPos[i] = QPoint(XPOS_BTNS_COL, ypos); if (i < ColorCode::mColorCnt) { if (mPegBtns[i] == NULL) { mPegBtns[i] = CreatePeg(i); } mPegBtns[i]->setPos(mBtnPos[i]); mPegBtns[i]->setVisible(true); } else if (mPegBtns[i] != NULL) { mPegBtns[i]->setVisible(false); } } } void PegFactory::InitTypesMap() { int ix; QRadialGradient grad = QRadialGradient(20, 20, 40, 5, 5); QRadialGradient grad2 = QRadialGradient(18, 18, 18, 12, 12); ix = 0; mTypesMap[ix] = new PegType; grad.setColorAt(0.0, QColor("#FFFF80")); grad.setColorAt(1.0, QColor("#C05800")); mGradMap[ix] = grad; mTypesMap[ix]->grad = &mGradMap[ix]; mTypesMap[ix]->ix = ix; mTypesMap[ix]->pencolor = Qt::green; ix = 1; mTypesMap[ix] = new PegType; grad.setColorAt(0.0, QColor("#FF3300")); grad.setColorAt(1.0, QColor("#400040")); mGradMap[ix] = grad; mTypesMap[ix]->grad = &mGradMap[ix]; mTypesMap[ix]->ix = ix; mTypesMap[ix]->pencolor = Qt::green; ix = 2; mTypesMap[ix] = new PegType; grad.setColorAt(0.0, QColor("#33CCFF")); grad.setColorAt(1.0, QColor("#000080")); mGradMap[ix] = grad; mTypesMap[ix]->grad = &mGradMap[ix]; mTypesMap[ix]->ix = ix; mTypesMap[ix]->pencolor = Qt::red; ix = 3; mTypesMap[ix] = new PegType; grad2.setColorAt(0.0, Qt::white); grad2.setColorAt(0.5, QColor("#f8f8f0")); grad2.setColorAt(0.7, QColor("#f0f0f0")); grad2.setColorAt(1.0, QColor("#d0d0d0")); mGradMap[ix] = grad2; mTypesMap[ix]->grad = &mGradMap[ix]; mTypesMap[ix]->ix = ix; mTypesMap[ix]->pencolor = Qt::green; ix = 4; mTypesMap[ix] = new PegType; grad.setColorAt(0.0, QColor("#808080")); grad.setColorAt(1.0, Qt::black); mGradMap[ix] = grad; mTypesMap[ix]->grad = &mGradMap[ix]; mTypesMap[ix]->ix = ix; mTypesMap[ix]->pencolor = Qt::red; ix = 5; mTypesMap[ix] = new PegType; grad.setColorAt(0.0, QColor("#66FF33")); grad.setColorAt(1.0, QColor("#385009")); mGradMap[ix] = grad; mTypesMap[ix]->grad = &mGradMap[ix]; mTypesMap[ix]->ix = ix; mTypesMap[ix]->pencolor = Qt::red; ix = 6; mTypesMap[ix] = new PegType; grad.setColorAt(0.0, QColor("#FF9900")); grad.setColorAt(1.0, QColor("#A82A00")); mGradMap[ix] = grad; mTypesMap[ix]->grad = &mGradMap[ix]; mTypesMap[ix]->ix = ix; mTypesMap[ix]->pencolor = Qt::red; ix = 7; mTypesMap[ix] = new PegType; grad.setColorAt(0.0, QColor("#BA88FF")); grad.setColorAt(1.0, QColor("#38005D")); mGradMap[ix] = grad; mTypesMap[ix]->grad = &mGradMap[ix]; mTypesMap[ix]->ix = ix; mTypesMap[ix]->pencolor = Qt::green; ix = 8; mTypesMap[ix] = new PegType; grad.setColorAt(0.0, QColor("#00FFFF")); grad.setColorAt(1.0, QColor("#004040")); mGradMap[ix] = grad; mTypesMap[ix]->grad = &mGradMap[ix]; mTypesMap[ix]->ix = ix; mTypesMap[ix]->pencolor = Qt::green; ix = 9; mTypesMap[ix] = new PegType; grad.setColorAt(0.0, QColor("#FFC0FF")); grad.setColorAt(1.0, QColor("#800080")); mGradMap[ix] = grad; mTypesMap[ix]->grad = &mGradMap[ix]; mTypesMap[ix]->ix = ix; mTypesMap[ix]->pencolor = Qt::green; for (ix = 0; ix < ColorCode::MAX_COLOR_CNT; ++ix) { mTypesMap[ix]->let = 'A' + ix; mGradBuff[ix] = mGradMap[ix]; } } void PegFactory::InitPegBtns() { for (int i = 0; i < ColorCode::MAX_COLOR_CNT; ++i) { mPegBtns[i] = NULL; } } ColorCode-0.8.7/src/buttondelegate.cpp0000644000175000017500000000721012610736534016353 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "highscoresmodel.h" #include "buttondelegate.h" #include "settings.h" ButtonDelegate::ButtonDelegate(QWidget* parent) : QStyledItemDelegate(parent) { } GamesListModel* ButtonDelegate::GetGamesListModel(const QModelIndex &index) const { if (!index.isValid()) { return NULL; } GamesListModel* glm = qobject_cast(const_cast(index.model())); return glm; } QSize ButtonDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { return QStyledItemDelegate::sizeHint(option, index); } QWidget* ButtonDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { GamesListModel* glm = GetGamesListModel(index); if (glm != NULL && index.column() == glm->GetColIx(GamesListModel::COL_DELETE)) { ButtonsCell* editor; if (glm->GetId() != GamesListModel::MODEL_ID_SAVED) { editor = new ButtonsCell(parent); } else { editor = new ButtonsCell(parent, ButtonsCell::ACTIONID_SAVE); } editor->setMouseTracking(true); editor->setAttribute(Qt::WA_Hover, true); editor->setAttribute(Qt::WA_AlwaysShowToolTips, true); connect(editor, SIGNAL(CellButtonClickedSignal()), this, SLOT(ButtonClickedSlot())); return editor; } else if (glm != NULL && index.column() == glm->GetColIx(GamesListModel::COL_USERNAME)) { QLineEdit* editor = new QLineEdit(parent); editor->setMaxLength(Settings::MAX_LENGTH_USERNAME); #ifdef Q_WS_X11 editor->setFrame(false); #endif editor->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter); return editor; } else { return QStyledItemDelegate::createEditor(parent, option, index); } } void ButtonDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { GamesListModel* glm = GetGamesListModel(index); if (glm != NULL && index.column() == glm->GetColIx(GamesListModel::COL_DELETE)) { ; } else { QStyledItemDelegate::setEditorData(editor, index); } } void ButtonDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex &index) const { if (!index.isValid() || editor == NULL) { return; } GamesListModel* glm = GetGamesListModel(index); if (glm != NULL && index.column() == glm->GetColIx(GamesListModel::COL_DELETE)) { ButtonsCell* editor = qobject_cast(sender()); if (editor != NULL) { glm->setData(index, editor->GetActionId(), Qt::EditRole); } } else { QStyledItemDelegate::setModelData(editor, model, index); } } void ButtonDelegate::ButtonClickedSlot() { ButtonsCell* editor = qobject_cast(sender()); emit commitData(editor); } ColorCode-0.8.7/src/gametimer.cpp0000644000175000017500000000225612610736534015324 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "gametimer.h" GameTimer::GameTimer(QObject* parent) : QThread(parent) { mInterval = 50; } GameTimer::~GameTimer() { wait(); } void GameTimer::run() { QTimer* timer = new QTimer(); connect(timer, SIGNAL(timeout()), this, SLOT(TimeOut()), Qt::DirectConnection); timer->start(mInterval); exec(); } void GameTimer::Start() { start(); } void GameTimer::TimeOut() { emit TimeOutSignal(1); } ColorCode-0.8.7/src/timedisplay.h0000644000175000017500000000327014525377167015352 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef TIMEDISPLAY_H #define TIMEDISPLAY_H #include #include #include #include #include class GameTimer; class TimeDisplay : public QGraphicsTextItem { Q_OBJECT public: TimeDisplay(QGraphicsItem* parent = 0); ~TimeDisplay(); int GetGameTime() const; bool IsActive() const; bool IsPaused() const; bool IsStopped() const; void SetTenth(bool b); public slots: void StartT(); void PauseT(); void ResumeT(); void StopT(); void DisplayTime(int tick = 0); private: GameTimer* mTimer; bool mPaused; bool mStopped; int mTime; int mGameTime; QElapsedTimer mT0; QTime mT1; int mInterval; bool mShowTenth; QString mSs; QString mLastSs; QString mHs; QFont mFont; }; #endif ColorCode-0.8.7/src/cellbtn.h0000644000175000017500000000173612610736534014444 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef CELLBTN_H #define CELLBTN_H #include #include #include class CellBtn : public QToolButton { Q_OBJECT public: CellBtn(QWidget * parent = 0); }; #endif // CELLBTN_H ColorCode-0.8.7/src/msg.cpp0000644000175000017500000000443212610736534014136 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "msg.h" using namespace std; Msg::Msg() { mFont = QFont("Arial", 12, QFont::Bold, false); mFont.setStyleHint(QFont::SansSerif); mFont.setPixelSize(16); mLay = new QTextLayout(); mLay->setFont(mFont); mLay->setTextOption(QTextOption(Qt::AlignHCenter)); mUpdateRect = QRectF(0, 0, 10, 10); } Msg::~Msg() { } void Msg::ShowMsg(const QString str) { mUpdateRect = boundingRect(); mLay->setText(str); int leading = -3; qreal h = 0; qreal maxw = 0; qreal maxh = 0; mLay->beginLayout(); while (1) { QTextLine line = mLay->createLine(); if (!line.isValid()) { break; } line.setLineWidth(280); h += leading; line.setPosition(QPointF(0, h)); h += line.height(); maxw = qMax(maxw, line.naturalTextWidth()); } mLay->endLayout(); float ypos = 4 + (70 - mLay->boundingRect().height()) / 2; maxw = qMax(mUpdateRect.width(), mLay->boundingRect().width()); maxh = qMax(mUpdateRect.height(), mLay->boundingRect().height() + ypos); mUpdateRect = QRectF(0, 0, maxw, maxh + ypos); update(boundingRect()); } QRectF Msg::boundingRect() const { return mUpdateRect; } void Msg::paint(QPainter* painter, const QStyleOptionGraphicsItem* , QWidget* ) { painter->setRenderHint(QPainter::TextAntialiasing, true); painter->setPen(QPen(QColor("#303133"))); float ypos = 4 + (70 - mLay->boundingRect().height()) / 2; mLay->draw(painter, QPointF(0, ypos)); } ColorCode-0.8.7/src/prevgamesmodel.cpp0000644000175000017500000000306514524757577016403 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "prevgamesmodel.h" #include "gametableview.h" PrevGamesModel* GetPrevGamesModel() { static PrevGamesModel* m = new PrevGamesModel(); return m; } PrevGamesModel::PrevGamesModel(QObject* parent) : GamesListModel(parent) { mId = MODEL_ID_PREV; mEditIndex = QModelIndex(); mMaxSize = 20; } int PrevGamesModel::GetColIx(const int ix) const { int ret = -1; if (ix == COL_RANKING) { ret = 0; } else if (ix == COL_DATE) { ret = 1; } else if (ix == COL_TIME) { ret = 2; } else if (ix == COL_DELETE) { ret = 3; } return ret; } int PrevGamesModel::GetMaxColCnt() const { return 4; } void PrevGamesModel::DoSort(QList &list) { std::sort(list.begin(), list.end(), GamesListModel::SortListTime); } ColorCode-0.8.7/src/about.cpp0000644000175000017500000000445514524753465014477 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "about.h" About::About(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f) { setupUi(this); setWindowIcon(QIcon(QPixmap(":/img/help-about.png"))); mAuthorIcon->setPixmap(QPixmap(":/img/cc32.png")); mLicenseIcon->setPixmap(QPixmap(":/img/GNU-icon32.png")); mAuthorText->setText("" + ColorCode::GAME_TITLE + "
" + tr("A needful game to train your brain ;-)") + tr("

Free MasterMind clone including a built in,
rather intelligent solver.") + "

" + tr("Version") + ": " + ColorCode::VERSION + "
" + tr("Author") + ": Dirk Laebisch"); QString license_file = ":/docs/GPL.html"; if (QFile::exists(license_file)) { QFont fixed_font; fixed_font.setStyleHint(QFont::TypeWriter); fixed_font.setFamily("Courier"); mLicenseText->setFont(fixed_font); QFile f(license_file); if (f.open(QIODevice::ReadOnly)) { mLicenseText->setText(QString::fromUtf8(f.readAll().constData())); } f.close(); } else { mLicenseText->setText( "" + tr("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.") + "" ); } } About::~About() { } QSize About::sizeHint () const { return QSize(360, 270); } ColorCode-0.8.7/src/colorpeg.h0000644000175000017500000000573614524755374014650 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef COLORPEG_H #define COLORPEG_H #include #include #include #include #include #include #include "colorcode.h" #include "pegrow.h" #include "rowhint.h" #include "settings.h" class ColorPeg : public QObject, public QGraphicsItem { Q_OBJECT Q_INTERFACES(QGraphicsItem) public: ColorPeg(QObject* parent = nullptr); ~ColorPeg(); int mId; void SetId(int id); void SetPegType(PegType* pt); void SetPegRow(PegRow* pr); QRectF boundingRect() const; QPainterPath shape() const; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); void SetType(const int t); void SetPaused(const bool b); void SetEnabled(const bool b); void SetIndicator(const bool b, const int t, const bool c); void SetCursorShape( Qt::CursorShape shape = Qt::ArrowCursor, const bool force = false); PegType* GetPegType(); int GetType() const; QColor GetPenColor() const; QColor GetBrushColor() const; bool GetIsDragged() const; bool IsBtn() const; int GetSort() const; void SetBtn(bool b); void Reset(); void ForceRelease(); signals: void PegReleasedSignal(ColorPeg* cp); void PegPressSignal(ColorPeg* cp); void PegSortSignal(ColorPeg* cp); protected: PegType* mPegType; QVariant itemChange(GraphicsItemChange change, const QVariant &value); void mousePressEvent(QGraphicsSceneMouseEvent* e); void mouseReleaseEvent(QGraphicsSceneMouseEvent* e); private: static const QFont mFont; static QFont GetLetterFont(); static const QBrush mShadowBrush; static QBrush GetShadowBrush(); static const QBrush mOutlineBrush; static QBrush GetOutlineBrush(); static const QBrush mGlossyBrush; static QBrush GetGlossyBrush(); static const QBrush mNeutralBrush; static QBrush GetNeutralBrush(); QRectF GetColorRect() const; QRectF outlineRect() const; void SetIsDragged(bool b); PegRow* mPegRow; const QBrush mBrush; int mType; int mSort; bool mIsBtn; bool mIsDragged; bool mShowIndicator; int mIndicatorType; bool mHideColor; bool mEnabledBuff; }; #endif // COLORPEG_H ColorCode-0.8.7/src/pegfactory.h0000644000175000017500000000372712610736534015166 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef PEGFACTORY_H #define PEGFACTORY_H #include #include #include "colorcode.h" #include "colorpeg.h" #include "settings.h" class PegFactory : public QObject { Q_OBJECT public: PegFactory(); static const int XPOS_BTNS_COL; ColorPeg* CreatePeg(int ix); ColorPeg* GetPegBtn(int ix); void SetPaused(); void SetIndicators(); void ChangeColorOrder(const int sorttype, const int ix0, const int ix1); void ApplyColorCnt(); public slots: void RemovePegSlot(ColorPeg* cp); void ResetColorsOrderSlot(); void PegPressSlot(ColorPeg* cp); void PegSortSlot(ColorPeg* cp); void PegReleasedSlot(ColorPeg* cp); signals: void SnapPegSignal(ColorPeg* cp); private: ColorCode* mWin; Settings* mSettings; PegType* mTypesMap[10]; ColorPeg* mPegBtns[10]; QPoint mBtnPos[10]; QRadialGradient mGradMap[10]; QRadialGradient mGradBuff[10]; std::vector mAllPegs; std::vector mPegBuff; bool mHideColors; void InitTypesMap(); void InitPegBtns(); }; #endif // PEGFACTORY_H ColorCode-0.8.7/src/highscore.h0000644000175000017500000000207012610736534014764 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef HIGHSCORE_H #define HIGHSCORE_H #include class HighScore { public: HighScore(); void NewGame(int ccnt); int GetScore(int rcnt, int t); int GetScore() const; int mCombinationsCnt; int mRowsCnt; int mTime; }; #endif // HIGHSCORE_H ColorCode-0.8.7/src/colorpeg.cpp0000644000175000017500000001727014524756674015203 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "colorpeg.h" using namespace std; const QFont ColorPeg::mFont = ColorPeg::GetLetterFont(); const QBrush ColorPeg::mShadowBrush = ColorPeg::GetShadowBrush(); const QBrush ColorPeg::mOutlineBrush = ColorPeg::GetOutlineBrush(); const QBrush ColorPeg::mGlossyBrush = ColorPeg::GetGlossyBrush(); const QBrush ColorPeg::mNeutralBrush = ColorPeg::GetNeutralBrush(); QFont ColorPeg::GetLetterFont() { QFont lf("Arial", 12, QFont::Bold, false); lf.setStyleHint(QFont::SansSerif); lf.setPixelSize(16); return lf; } QBrush ColorPeg::GetNeutralBrush() { QRadialGradient rgrad(20, 20, 40, 5, 5); rgrad.setColorAt(0.0, QColor(0xff, 0xff, 0xff, 0xff)); rgrad.setColorAt(1.0, QColor(0x80, 0x80, 0x80, 0xff)); return QBrush(rgrad); } QBrush ColorPeg::GetShadowBrush() { QRadialGradient rgrad(22, 22, 22, 22, 22); rgrad.setColorAt(0.3, QColor(0, 0, 0, 0xff)); rgrad.setColorAt(1.0, QColor(0, 0, 0, 0)); return QBrush(rgrad); } QBrush ColorPeg::GetOutlineBrush() { QLinearGradient lgrad(0, 0, 38, 38); lgrad.setColorAt(0.0, QColor(0, 0, 0, 0xa0)); lgrad.setColorAt(1.0, QColor(0xff, 0xff, 0xff, 0xa0)); return QBrush(lgrad); } QBrush ColorPeg::GetGlossyBrush() { QLinearGradient lgrad(20, 4, 20, 20); lgrad.setColorAt(0.0, QColor(0xff, 0xff, 0xff, 0x80)); lgrad.setColorAt(1.0, QColor(0xff, 0xff, 0xff, 0x00)); return QBrush(lgrad); } ColorPeg::ColorPeg(QObject*) { setFlags(QGraphicsItem::GraphicsItemFlags()); mPegType = NULL; mPegRow = NULL; SetBtn(true); mIsDragged = false; mShowIndicator = false; mHideColor = false; mSort = 0; mId = -1; } ColorPeg::~ColorPeg() { } void ColorPeg::SetPegType(PegType *pt) { mPegType = pt; setFlags(ItemIsMovable | ItemIsSelectable); } void ColorPeg::SetPegRow(PegRow *pr) { mPegRow = pr; } PegType* ColorPeg::GetPegType() { return mPegType; } void ColorPeg::SetId(int id) { mId = id; } bool ColorPeg::IsBtn() const { return mIsBtn; } int ColorPeg::GetSort() const { return mSort; } void ColorPeg::SetBtn(bool b) { mIsBtn = b; SetCursorShape(); } int ColorPeg::GetType() const { return mType; } void ColorPeg::SetType(const int t) { mType = t; } void ColorPeg::Reset() { SetIsDragged(false); setSelected(false); if (mPegRow != NULL) { mPegRow->RemovePeg(this); mPegRow = NULL; } } bool ColorPeg::GetIsDragged() const { return mIsDragged; } void ColorPeg::SetIsDragged(bool b) { if (false == b) { update(boundingRect()); } mIsDragged = b; } void ColorPeg::SetEnabled(const bool b) { setEnabled(b); SetCursorShape(); } void ColorPeg::SetPaused(const bool b) { bool enable; if (b) { mEnabledBuff = isEnabled(); enable = false; } else { enable = mEnabledBuff; } SetEnabled(enable); } void ColorPeg::SetIndicator(const bool b, const int t, const bool c) { if (mShowIndicator != b || mIndicatorType != t || mHideColor != c) { mShowIndicator = b; mIndicatorType = t; mHideColor = c; update(boundingRect()); } } void ColorPeg::SetCursorShape(Qt::CursorShape shape, const bool force) { if (!force) { if (mIsDragged && isEnabled()) { if (mSort == 0) { shape = Qt::ClosedHandCursor; } else if (mSort == 1) { shape = Qt::SizeVerCursor; } else { shape = Qt::SplitVCursor; } } else if (isEnabled()) { shape = Qt::OpenHandCursor; } } if (cursor().shape() != shape) { setCursor(QCursor(shape)); } } QVariant ColorPeg::itemChange(GraphicsItemChange change, const QVariant &value) { if (change == ItemSelectedHasChanged) { scene()->update(scene()->sceneRect()); } return QGraphicsItem::itemChange(change, value); } void ColorPeg::ForceRelease() { QGraphicsSceneMouseEvent re(QEvent::GraphicsSceneMouseRelease); re.setButton(Qt::LeftButton); mouseReleaseEvent(&re); } void ColorPeg::mousePressEvent(QGraphicsSceneMouseEvent *e) { QGraphicsItem::mousePressEvent(e); if (mPegType != NULL) { if (e->button() == Qt::LeftButton) { Reset(); SetIsDragged(true); if (IsBtn() && (e->modifiers() & Qt::ControlModifier) != 0) { if ((e->modifiers() & Qt::ShiftModifier) == 0) { mSort = 1; } else { mSort = 2; } } else { mSort = 0; } emit PegPressSignal(this); SetCursorShape(); } } } void ColorPeg::mouseReleaseEvent (QGraphicsSceneMouseEvent *e) { QGraphicsItem::mouseReleaseEvent(e); if (mPegType != NULL) { if (e->button() == Qt::LeftButton) { SetIsDragged(false); emit PegReleasedSignal(this); SetCursorShape(); } } } QPainterPath ColorPeg::shape() const { QPainterPath path; path.addEllipse(boundingRect()); return path; } QRectF ColorPeg::boundingRect() const { int margin; if (mIsDragged) { margin = 8; } else { margin = 1; } return outlineRect().adjusted(-margin, -margin, +margin, +margin); } QRectF ColorPeg::outlineRect() const { QRectF rect(0.0, 0.0, 36.0, 36.0); return rect; } QRectF ColorPeg::GetColorRect() const { QRectF rect(1.0, 1.0, 34.0, 34.0); return rect; } void ColorPeg::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*) { painter->setPen(Qt::NoPen); if (!mIsDragged) { painter->setBrush(ColorPeg::mOutlineBrush); painter->drawEllipse(outlineRect()); } else { painter->translate(QPointF(-2, -2)); painter->setBrush(ColorPeg::mShadowBrush); painter->drawEllipse(QRectF(0, 0, 44, 44)); painter->translate(QPointF(2, 2)); } if (!mHideColor) { painter->setBrush(QBrush(*mPegType->grad)); painter->drawEllipse(GetColorRect()); } else { painter->setBrush(mNeutralBrush); painter->drawEllipse(GetColorRect()); } painter->setBrush(mGlossyBrush); painter->drawEllipse(QRectF(5, 3, 24, 20)); if (mShowIndicator) { painter->setPen(QPen(QColor("#303133"))); painter->setRenderHint(QPainter::TextAntialiasing, true); painter->setFont(mFont); QString ind; if (mIndicatorType == Settings::INDICATOR_LETTER) { ind = QString(mPegType->let); } else { ind.setNum((mPegType->ix + 1)); } painter->drawText(QRectF(1.5, 2.0, 32.0, 32.0), Qt::AlignCenter, ind); } } ColorCode-0.8.7/src/about.ui0000644000175000017500000001123412610736534014313 0ustar dirkdirk About Qt::ApplicationModal 0 0 360 270 About ColorCode 6 9 QTabWidget::Rounded 0 &Author 6 9 6 0 icon Qt::Vertical 20 111 QFrame::NoFrame QFrame::Plain true &License 6 9 6 0 icon Qt::Vertical 20 111 QFrame::NoFrame QFrame::Plain true Qt::Horizontal QDialogButtonBox::Ok tabWidget mAuthorText buttonBox mLicenseText buttonBox accepted() About accept() 248 254 157 274 ColorCode-0.8.7/src/colorcode.h0000644000175000017500000002077412610736534014775 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef COLORCODE_H #define COLORCODE_H #include #include struct PegType { int ix; char let; QRadialGradient* grad; QColor pencolor; }; class QAction; class QActionGroup; class QComboBox; class QLabel; class QGraphicsItem; class QGraphicsTextItem; class QGraphicsScene; class QGraphicsView; class PrefDialog; class Settings; class CCSolver; class ColorPeg; class PegRow; class RowHint; class Msg; class BackGround; class SolutionRow; class GraphicsBtn; class PegFactory; class CCGame; class GameNoDisplay; class TimeDisplay; class TimeDisplayBg; class HighScore; class GameTablesDialog; class ColorCode : public QMainWindow { Q_OBJECT public: ColorCode(); ~ColorCode(); static ColorCode* INSTANCE; static const QString VERSION; static QString GAME_TITLE; static const int STATE_NONE; static const int STATE_RUNNING; static const int STATE_PAUSED; static const int STATE_WON; static const int STATE_LOST; static const int STATE_GAVE_UP; static const int STATE_ERROR; static const int LAYER_BG; static const int LAYER_ROWS; static const int LAYER_HINTS; static const int LAYER_SOL; static const int LAYER_MSG; static const int LAYER_PEGS; static const int LAYER_BTNS; static const int LAYER_DRAG; static const int MODE_HVM; static const int MODE_MVH; static const int MAX_COLOR_CNT; static const int MIN_COLOR_CNT; static const int SOLUTION_ROW_IX; static const int LEVEL_SETTINGS[5][3]; static int mMaxRowCnt; static int mRowY0; static int mColorCnt; Settings* mSettings; GameTablesDialog* mGameTablesDialog; QGraphicsScene* mScene; QGraphicsView* mView; int GetGameState() const; int GetGameModeInput() const; int GetDoublesInput() const; int GetColorCntInput() const; int GetPegCntInput() const; CCSolver* GetCCSolver() const; public slots: void SnapPegSlot(ColorPeg *cp); void RowSolutionSlot(int ix); void HintPressedSlot(int ix); void ShowMsgSlot(QString msg); void DoneBtnPressSlot(GraphicsBtn* btn = NULL); void SetSolverGuessSlot(); void ApplyPreferencesSlot(); signals: void NewHighScoreSignal(CCGame* g); protected : void resizeEvent(QResizeEvent* e); void contextMenuEvent(QContextMenuEvent* e); void keyPressEvent(QKeyEvent *e); private slots: void InitRows(); void NewGameSlot(); void NewGameInputSlot(CCGame* g); void SavePrevGameSlot(); void NewGame(); void RestartGameSlot(); void GiveInSlot(); void PauseGameSlot(GraphicsBtn* = NULL); void ResetRows(); void OnlineHelpSlot(); void AboutSlot(); void AboutQtSlot(); void OpenPreferencesSlot(); void ApplySettingsSlot(); void ShowToolbarSlot(); void ShowMenubarSlot(); void ShowStatusbarSlot(); void ShowTimerSlot(); void ShowGameNoSlot(); void CloseHighScoreDialogSlot(); void SetIndicatorsSlot(); void DoublesChangedSlot(bool checked); void SetDoublesSlot(bool checked); void AutoCloseSlot(); void AutoHintsSlot(); void SetLevelSlot(); void SetGameModeSlot(); void CopyGameNoSlot(); void RandRowSlot(); void PrevRowSlot(); void ClearRowSlot(); void ColorCntChangedSlot(); void PegCntChangedSlot(); void UpdateRowMenuSlot(); void SetGuessSlot(); void SetHintsSlot(); void SetAutoHintsSlot(); void TestSlot(); private: static int mGameMode; static int mLevel; static int mPegCnt; static int mDoubles; static int mMaxZ; static int mXOffs; volatile static bool mNoAct; volatile static bool mIgnoreGuess; int mGameState; int mGameId; int mGuessCnt; int mHintsCnt; int mGameCnt; int mSolverStrength; std::vector mSolution; QSize* mOrigSize; CCSolver* mSolver; PegFactory* mPegFactory; Msg* mMsg; BackGround* mBg; GraphicsBtn* mDoneBtn; GraphicsBtn* mOkBtn; GraphicsBtn* mTimerBtn; GraphicsBtn* mSolutionRowBg; PrefDialog* mPrefDialog; PegRow* mCurRow; SolutionRow* mSolutionRow; PegRow* mPegRows[10]; RowHint* mHintBtns[10]; QTimer* mHintsDelayTimer; TimeDisplay* mGameTimer; TimeDisplayBg* mGameTimerBg; GameNoDisplay* mGameNoDisplay; CCGame* mGameInput; CCGame* mFinishedGameInput; HighScore* mHighScore; void Init(); void InitSolution(); void InitActions(); void InitMenus(); void InitToolBars(); void CreatePrefDialog(); void ShowTimer(); void UpdateGameNoDisplay(); CCGame* GetCurrentGameInput() const; bool NeedsRestart() const; void TryNewGame(); void SetGameMode(); void UpdateActions(); void SetPegCnt(); void SetColorCnt(); void ApplyGameMode(); void ApplyPegCnt(); void ApplySolverStrength(); void CheckLevel(); void CheckDoublesSetting(); void SetState(const int s); void ResetGame(); void SetSolution(); void GetSolution(); void ShowSolution(); void NextRow(); void SetCurRow(PegRow* const &row); void ResolveRow(); std::vector RateSol2Guess(const std::vector sol, const std::vector guess); void ResolveHints(); void ResolveGame(); void WaitForSolver(); bool ForceRepaint(); bool GamesRunning(); void Scale(); CCGame* GetRandGameInput(); QMenu* mMenuGame; QMenu* mMenuRow; QMenu* mMenuRowContext; QMenu* mMenuSettings; QMenu* mMenuModes; QMenu* mMenuLevels; QMenu* mMenuGames; QMenu* mMenuHelp; QMenuBar* mMenuBar; QToolBar* mGameToolbar; QToolBar* mLevelToolbar; QComboBox* mColorCntCmb; QComboBox* mPegCntCmb; QLabel* mStatusLabel; QActionGroup* mActGroupLevels; QActionGroup* mActGroupModes; QAction* mActNewGame; QAction* mActSelectGame; QAction* mActCopyGameNo; QAction* mActRestartGame; QAction* mActGiveIn; QAction* mActSaveGame; QAction* mActPauseGame; QAction* mActShowHighScores; QAction* mActShowPrevGames; QAction* mActShowSavedGames; QAction* mActExit; QAction* mActShowToolbar; QAction* mActShowMenubar; QAction* mActShowStatusbar; QAction* mActShowTimer; QAction* mActShowGameNo; QAction* mActDoubles; QAction* mActResetColorsOrder; QAction* mActShowIndicators; QAction* mActDoublesIcon; QAction* mActAutoClose; QAction* mActAutoHints; QAction* mActPreferences; QAction* mActAbout; QAction* mActAboutQt; QAction* mActSetPegCnt; QAction* mActModeHvM; QAction* mActModeMvH; QAction* mActLevelEasy; QAction* mActLevelClassic; QAction* mActLevelMedium; QAction* mActLevelChallenging; QAction* mActLevelHard; QAction* mLaunchHelpAction; QAction* mActRandRow; QAction* mActPrevRow; QAction* mActClearRow; QAction* mActSetGuess; QAction* mActSetHints; }; #endif // COLORCODE_H ColorCode-0.8.7/src/img/0000755000175000017500000000000014527472027013420 5ustar dirkdirkColorCode-0.8.7/src/img/cc16.png0000644000175000017500000000216412610736534014662 0ustar dirkdirkPNG  IHDRasRGBtIME .6IDAT8cI?A8%8 3" ɿID ^ycI?AEgMYFM E9B BXaq>C$8 2$  1E( /# Fs5%!I3 F( , ?"͗ uz%AAVVV552JHAAA11+!D552###  %"=?^ +- ^uA, (%B< $$$^oxIENDB`ColorCode-0.8.7/src/img/configure.png0000644000175000017500000000203712610736534016106 0ustar dirkdirkPNG  IHDRagAMA7tEXtSoftwareAdobe ImageReadyqe<IDATxbY --_턦}ųg&~}222LMǏ_ ~adQ 7WW[E`xAggLuu50{υ̻_Z͛XYky{j~NKEE@bfx=×o=93}gx |54DD}``exÇ/ w$O1r 1& A((9: I 14˗/@ ?999yy4~BHL0AD$D}dexm_L/@ʲ[?}ؿ/ܦQ _ L?Xra@1kk[ǿ^`GC_>*gkƗ€g`diʑ3 l322  ¿ r7NQL[}0G_f`} ȸ ^`6i9[03gx#KDpzZh-N{/ 0{~ax`a&IENDB`ColorCode-0.8.7/src/img/help.png0000644000175000017500000000170314527471235015057 0ustar dirkdirkPNG  IHDR(-S cHRMz%u0`:o_FPLTEo&i& FCOKO_AU~p+iMnA5, = @'6=#Fpg<3٘~1^?8N.0A'OQ@2FTNB$3;>Q:A#.UGM.o ]34G>Xy@LZ?=i2KJ()8,2R'}k`g7()5Y 2"g)+nq<8T;Z+{y~X@C`++1!FkQ=!0E\k$ wC|Mj% g%rsWf%7}kqjUu@;6.3 1 0嵡a\VoaGaUJT?ZNd+MTd!Xy6Na˳ĮxZSZDi%Q!v2YC!V9ۢPmUUbw:֊u^(h-y;\P`tRNS@VmwfyvmY1!W%+cY&d]UرQpr|C syqq*{".vbKGDH pHYs  tIME WIDATc`F&fV8`cHLySR32 |ܼ¢b WPHTDTL\B\JAF6BN^(TY^֫QSŠSW 1LQ߀Ш"`Ғnj`flOf`r{z[]\=&LJN c #8B8B8B", ", c #8F8F8F", "' c #909090", ") c #919191", "! c #929292", "~ c #7A7A7A", "{ c #6A6A6C", "] c #5A5B5F", "^ c #4E5056", "/ c #4C4E56", "( c #56585E", "_ c #606268", ": c #6D6D71", "< c #737475", "[ c #707070", "} c #62605F", "| c #3C322F", "1 c #353433", "2 c #3D505B", "3 c #43627A", "4 c #477190", "5 c #4B7A99", "6 c #4F7C9D", "7 c #567C99", "8 c #627C8E", "9 c #707981", "0 c #7E7A74", "a c #817E7C", "b c #818180", "c c #939393", "d c #949494", "e c #959595", "f c #7F7F7F", "g c #6E6E6E", "h c #383940", "i c #2C2C32", "j c #535041", "k c #766E4F", "l c #928758", "m c #A09260", "n c #A49763", "o c #A19668", "p c #988D6E", "q c #898374", "r c #747579", "s c #75767A", "t c #737374", "u c #757575", "v c #5E5E5E", "w c #28201C", "x c #222B2F", "y c #2C678A", "z c #2D93C6", "A c #27A9E3", "B c #22B2F0", "C c #1DB4F4", "D c #1AB1F4", "E c #18A8F2", "F c #1A9FEC", "G c #2296E3", "H c #308ED6", "I c #458CC1", "J c #6786A0", "K c #8A8784", "L c #838180", "M c #8A8A8A", "N c #979797", "O c #989898", "P c #2D2E34", "Q c #21201F", "R c #786F3F", "S c #C4B759", "T c #E5D861", "U c #F4E765", "V c #FBEE62", "W c #FDEE5E", "X c #FDEC5A", "Y c #F9E656", "Z c #F3DC56", "` c #E7CE5A", " . c #D6BE64", ".. c #B4A472", "+. c #8A8984", "@. c #797B7F", "#. c #747474", "$. c #717171", "%. c #161616", "&. c #226283", "*. c #27B4E4", "=. c #24CBF9", "-. c #22CEFC", ";. c #21C5F8", ">. c #20BDF5", ",. c #20B7F3", "'. c #20B0F1", "). c #1FABF0", "!. c #1CA6EE", "~. c #199FED", "{. c #1698ED", "]. c #1491EC", "^. c #1E8AE2", "/. c #3B89CB", "(. c #7C8FA1", "_. c #8A8785", ":. c #888988", "<. c #9B9B9B", "[. c #9C9C9C", "}. c #898989", "|. c #4A4A4B", "1. c #141417", "2. c #5B5731", "3. c #DED664", "4. c #FAF375", "5. c #FFF976", "6. c #FEF570", "7. c #FCF26B", "8. c #FAEE68", "9. c #F9EB61", "0. c #F9E960", "a. c #F9E65A", "b. c #F9E556", "c. c #F9E351", "d. c #F9E04B", "e. c #F4D94C", "f. c #E3C759", "g. c #B6A57B", "h. c #87888B", "i. c #737474", "j. c #24201E", "k. c #162529", "l. c #26A2CE", "m. c #29D9FD", "n. c #27D8FD", "o. c #26CFFA", "p. c #25C9F8", "q. c #23C4F6", "r. c #22BEF5", "s. c #21B8F3", "t. c #20B4F2", "u. c #1FAFF0", "v. c #1DA8EE", "w. c #1CA2EC", "x. c #1B9BEB", "y. c #1A94E8", "z. c #168EE8", "A. c #1485E6", "B. c #1F81DD", "C. c #5F8EB8", "D. c #8F8F8E", "E. c #9E9E9E", "F. c #9F9F9F", "G. c #39393B", "H. c #181715", "I. c #AAA54D", "J. c #FBF87F", "K. c #FFFC84", "L. c #FEF97C", "M. c #FCF576", "N. c #FBF372", "O. c #FBF16E", "P. c #FAEF69", "Q. c #F9EC64", "R. c #F9E85D", "S. c #F8E559", "T. c #F7E255", "U. c #F6DF51", "V. c #F7DC4C", "W. c #F7DA46", "X. c #F2D246", "Y. c #D1B96A", "Z. c #979591", "`. c #767677", " + c #727272", ".+ c #241F1D", "++ c #162D35", "@+ c #28BFE7", "#+ c #2AE2FF", "$+ c #28DAFD", "%+ c #27D4FB", "&+ c #26D0F9", "*+ c #25CBF8", "=+ c #23C6F7", "-+ c #22C1F5", ";+ c #21BBF4", ">+ c #20B6F2", ",+ c #20B1F1", "'+ c #1EABEF", ")+ c #1DA4ED", "!+ c #1C9DEB", "~+ c #1B96E9", "{+ c #1A91E7", "]+ c #188AE5", "^+ c #1682E4", "/+ c #167BDF", "(+ c #518CC1", "_+ c #90908E", ":+ c #90908F", "<+ c #A1A1A1", "[+ c #A2A2A2", "}+ c #3B3B3D", "|+ c #191915", "1+ c #CBC95D", "2+ c #FFFE8B", "3+ c #FEFC85", "4+ c #FDF981", "5+ c #FDF87C", "6+ c #FCF678", "7+ c #FBF473", "8+ c #FBF26F", "9+ c #FAF06B", "0+ c #F9ED65", "a+ c #F9EB62", "b+ c #F9E85E", "c+ c #F8E65A", "d+ c #F7E356", "e+ c #F6DF52", "f+ c #F6DD4F", "g+ c #F5D94B", "h+ c #F5D646", "i+ c #F4D241", "j+ c #DDC05E", "k+ c #9C9892", "l+ c #757576", "m+ c #767676", "n+ c #343331", "o+ c #162429", "p+ c #2BE3FF", "q+ c #29DBFD", "r+ c #28D9FC", "s+ c #27D0FA", "t+ c #26CCF8", "u+ c #24C7F7", "v+ c #23C2F5", "w+ c #22BCF4", "x+ c #21B7F3", "y+ c #20B2F1", "z+ c #1EACF0", "A+ c #1DA6EE", "B+ c #1C9FEC", "C+ c #1B98EB", "D+ c #1A92E8", "E+ c #188BE6", "F+ c #1784E3", "G+ c #157CE2", "H+ c #1375DE", "I+ c #588DBD", "J+ c #908E8C", "K+ c #999999", "L+ c #A4A4A4", "M+ c #A5A5A5", "N+ c #9A9A9A", "O+ c #565758", "P+ c #141313", "Q+ c #C7C55C", "R+ c #FFFF8E", "S+ c #FEFC88", "T+ c #FEFB84", "U+ c #FCF473", "V+ c #FAF06C", "W+ c #FAEE66", "X+ c #F9E860", "Y+ c #F8E65C", "Z+ c #F7E358", "`+ c #F7E054", " @ c #F6DE50", ".@ c #F5DA4C", "+@ c #F5D748", "@@ c #F4D345", "#@ c #F4D03F", "$@ c #DBBE5E", "%@ c #959491", "&@ c #5B5B5B", "*@ c #29DAFC", "=@ c #28D7FB", "-@ c #27D3FB", ";@ c #25CCF8", ">@ c #25C7F7", ",@ c #23C2F6", "'@ c #1DA7EE", ")@ c #1CA0EC", "!@ c #1A95E8", "~@ c #188EE6", "{@ c #1787E4", "]@ c #167FE2", "^@ c #1376E1", "/@ c #1671DB", "(@ c #7493B1", "_@ c #8E8D8C", ":@ c #A7A7A7", "<@ c #111115", "[@ c #9E9847", "}@ c #FEFD88", "|@ c #FEFB87", "1@ c #FDFA84", "2@ c #FDF87B", "3@ c #FCF475", "4@ c #FBF370", "5@ c #F9EA61", "6@ c #F9E75D", "7@ c #F8E459", "8@ c #F7E154", "9@ c #F6DB4D", "0@ c #F4D84A", "a@ c #F4D346", "b@ c #F4D042", "c@ c #F3CC3B", "d@ c #CDB66E", "e@ c #828486", "f@ c #737373", "g@ c #27211D", "h@ c #216283", "i@ c #27D5FB", "j@ c #27D1FA", "k@ c #26CEF9", "l@ c #25CAF8", "m@ c #24C6F7", "n@ c #198EE7", "o@ c #1888E5", "p@ c #1781E3", "q@ c #177BE0", "r@ c #0F6FDF", "s@ c #2978D1", "t@ c #8E969D", "u@ c #AAAAAA", "v@ c #313237", "w@ c #4F4D2F", "x@ c #F8F379", "y@ c #FFFD87", "z@ c #FDFA82", "A@ c #FDF87E", "B@ c #FCF779", "C@ c #F7E155", "D@ c #F6DB4F", "E@ c #F4D547", "F@ c #F3D042", "G@ c #F4CE3B", "H@ c #EDC63F", "I@ c #B1A589", "J@ c #767778", "K@ c #5F5C5B", "L@ c #232B2F", "M@ c #28B4E4", "N@ c #27D8FE", "O@ c #25CCF9", "P@ c #25C8F7", "Q@ c #1A8FE7", "R@ c #167BE0", "S@ c #1673DE", "T@ c #0D69DC", "U@ c #648FBB", "V@ c #908F8F", "W@ c #ADADAD", "X@ c #7F7F80", "Y@ c #272727", "Z@ c #C4BC58", "`@ c #FFFD84", " # c #FDF97F", ".# c #FCF77B", "+# c #FCF575", "@# c #FBF26E", "## c #F9E75C", "$# c #F6DC4F", "%# c #F5D84B", "&# c #F3D144", "*# c #F3CE40", "=# c #F4CA36", "-# c #D7BA5F", ";# c #878686", "># c #3A332E", ",# c #2B6789", "'# c #25CBF9", ")# c #26CFF9", "!# c #24C3F6", "~# c #21B6F3", "{# c #1782E3", "]# c #126CDC", "^# c #2672CE", "/# c #929699", "(# c #A6A6A6", "_# c #B0B0B0", ":# c #4F4F53", "<# c #57533A", "[# c #F7EF6F", "}# c #FEF97B", "|# c #FDF77B", "1# c #FBF36F", "2# c #FAED66", "3# c #F8E75C", "4# c #F7E459", "5# c #F3CA3A", "6# c #ECC33B", "7# c #ABA28A", "8# c #777879", "9# c #727271", "0# c #343433", "a# c #2C93C6", "b# c #21CEFC", "c# c #1FAFF1", "d# c #1EA9F0", "e# c #1B99EB", "f# c #146EDC", "g# c #1064D8", "h# c #8597AC", "i# c #B3B3B3", "j# c #3F3F40", "k# c #9B914E", "l# c #FFF875", "m# c #FCF676", "n# c #F9EC65", "o# c #F6DE51", "p# c #F2CA3C", "q# c #F2C530", "r# c #C6B177", "s# c #7B7B7B", "t# c #666362", "u# c #3D4F5A", "v# c #28A9E3", "w# c #21C5F9", "x# c #24C2F6", "y# c #22BFF5", "z# c #21BAF3", "A# c #20B5F2", "B# c #1FB1F1", "C# c #1FACF0", "D# c #1CA4EC", "E# c #1681E2", "F# c #1675DE", "G# c #1166D9", "H# c #5586BC", "I# c #979796", "J# c #B5B5B5", "K# c #848485", "L# c #4E4D48", "M# c #D4C65C", "N# c #FDF36E", "O# c #FAF16C", "P# c #FAEF68", "Q# c #F7DF54", "R# c #F5DB4C", "S# c #F5D84A", "T# c #F4D446", "U# c #F2CA3E", "V# c #F2C635", "W# c #D9B758", "X# c #868482", "Y# c #5E5955", "Z# c #22B2EF", "`# c #20BCF5", " $ c #20B6F3", ".$ c #1FB0F1", "+$ c #1EA6EE", "@$ c #1B9CEB", "#$ c #1A96E9", "$$ c #1785E3", "%$ c #167EE2", "&$ c #1679E0", "*$ c #146CDB", "=$ c #1165DA", "-$ c #3776C4", ";$ c #989897", ">$ c #B8B8B8", ",$ c #5B5950", "'$ c #ECDD61", ")$ c #FBF069", "!$ c #FBF06B", "~$ c #FBF16C", "{$ c #F8E458", "]$ c #F3CD40", "^$ c #F2C93C", "/$ c #F2C637", "($ c #E4BB44", "_$ c #938F88", ":$ c #59524E", "<$ c #1EA8EE", "[$ c #1CA3ED", "}$ c #1C9FEB", "|$ c #1B99EA", "1$ c #1A95E9", "2$ c #198FE7", "3$ c #198AE6", "4$ c #167CE1", "5$ c #1676DF", "6$ c #1572DD", "7$ c #1164D9", "8$ c #266ACA", "9$ c #9B9A9A", "0$ c #BABABA", "a$ c #676769", "b$ c #696659", "c$ c #F6E760", "d$ c #FAED65", "e$ c #FAF069", "f$ c #FAEC66", "g$ c #F9EC62", "h$ c #F8E75D", "i$ c #F8E356", "j$ c #F3CF41", "k$ c #F3CD3F", "l$ c #F2C93B", "m$ c #F2C638", "n$ c #ECBE36", "o$ c #A0998F", "p$ c #5C544F", "q$ c #4A7A9A", "r$ c #19B1F5", "s$ c #1EA9EF", "t$ c #1DA4EE", "u$ c #1DA0EC", "v$ c #198CE6", "w$ c #1787E5", "x$ c #1570DD", "y$ c #136BDB", "z$ c #1162D9", "A$ c #1E66CB", "B$ c #9C9C9A", "C$ c #BCBCBC", "D$ c #666667", "E$ c #726F60", "F$ c #F9EB64", "G$ c #F6DD50", "H$ c #F5DB4D", "I$ c #F3D245", "J$ c #F2CC3F", "K$ c #F2C83B", "L$ c #F1C438", "M$ c #EEBF30", "N$ c #A59D90", "O$ c #4F7D9D", "P$ c #1EABF0", "Q$ c #1B98EA", "R$ c #1784E4", "S$ c #1675DF", "T$ c #156FDC", "U$ c #1369DA", "V$ c #1061D8", "W$ c #2065C8", "X$ c #9C9C9B", "Y$ c #BFBFBF", "Z$ c #717272", "`$ c #797568", " % c #F7E559", ".% c #F8E55A", "+% c #F8E358", "@% c #F5D64A", "#% c #F2CB3E", "$% c #F2C73A", "%% c #F1C437", "&% c #ECBB31", "*% c #9F998D", "=% c #587D99", "-% c #1B9FEC", ";% c #1FA9F0", ">% c #1A98EA", ",% c #1A8FE8", "'% c #188CE6", ")% c #1887E4", "!% c #1681E3", "~% c #167CE0", "{% c #146CDC", "]% c #1366DA", "^% c #1060D8", "/% c #2B6AC3", "(% c #C1C1C1", "_% c #818282", ":% c #7D7B6F", "<% c #F1DC59", "[% c #F8E558", "}% c #F9E65C", "|% c #F8E85D", "1% c #F8E85E", "2% c #F7DF52", "3% c #F7DE51", "4% c #F5DC4F", "5% c #F5DA4B", "6% c #F4D447", "7% c #F4D244", "8% c #F2CC3E", "9% c #F2CA3B", "0% c #F1C638", "a% c #F1C235", "b% c #E5B838", "c% c #938F87", "d% c #2295E3", "e% c #1CA3EC", "f% c #177EE2", "g% c #1679DF", "h% c #1575DE", "i% c #1469DA", "j% c #1264D9", "k% c #105DD5", "l% c #4379BA", "m% c #A1A0A0", "n% c #C2C2C2", "o% c #7F7D77", "p% c #E5CD5C", "q% c #F9E354", "r% c #F7E355", "s% c #F5DD4F", "t% c #F5D94A", "u% c #F4D647", "v% c #F1C539", "w% c #F1C132", "x% c #DAB348", "y% c #888682", "z% c #7C7B7B", "A% c #2F8ED6", "B% c #1698EC", "C% c #177FE2", "D% c #146BDB", "E% c #1262D8", "F% c #0F59D2", "G% c #6A89AF", "H% c #ABABAB", "I% c #C4C4C4", "J% c #A8A8A8", "K% c #D0B964", "L% c #F9E150", "M% c #F7E052", "N% c #F1C639", "O% c #F1C338", "P% c #F1BD2D", "Q% c #CAAE61", "R% c #818181", "S% c #838383", "T% c #7C7774", "U% c #1491EB", "V% c #1A94E9", "W% c #1887E5", "X% c #1678DF", "Y% c #1573DE", "Z% c #1469DB", "`% c #1365D9", " & c #1260D7", ".& c #1158CB", "+& c #9198A0", "@& c #BEBEBE", "#& c #C5C5C5", "$& c #808284", "%& c #B0A476", "&& c #F8DE4B", "*& c #F7E055", "=& c #F7DF51", "-& c #F4D748", ";& c #F4D245", ">& c #F3D041", ",& c #F1C538", "'& c #F1C236", ")& c #EBB82A", "!& c #AEA07C", "~& c #848484", "{& c #8C8C8C", "]& c #807D7B", "^& c #6787A2", "/& c #168CE8", "(& c #1361D8", "_& c #0B58D5", ":& c #3B71BB", "<& c #9FA0A1", "[& c #C7C7C7", "}& c #98989A", "|& c #948E81", "1& c #EACD56", "2& c #F8DC48", "3& c #F6DC4D", "4& c #F5D74A", "5& c #F5D747", "6& c #F4D144", "7& c #F3CB3E", "8& c #F1C337", "9& c #F0BD2F", "0& c #DAB041", "a& c #8E8A84", "b& c #878581", "c& c #188AE6", "d& c #146FDC", "e& c #146BDA", "f& c #1362D8", "g& c #105DD6", "h& c #0E54CB", "i& c #8391A3", "j& c #B9B9B8", "k& c #C8C8C8", "l& c #838688", "m& c #C4B073", "n& c #F6D845", "o& c #F5DA4D", "p& c #F4D74A", "q& c #F4D648", "r& c #F3CC3E", "s& c #F1C135", "t& c #EBB82B", "u& c #B7A16E", "v& c #858586", "w& c #828180", "x& c #7B8FA0", "y& c #1681E4", "z& c #1264D8", "A& c #115ED7", "B& c #0951D1", "C& c #4B79B4", "D& c #C9C9C9", "E& c #CACACA", "F& c #9F9FA0", "G& c #93918B", "H& c #E4C658", "I& c #F6D741", "J& c #F2CB3C", "K& c #F2C639", "L& c #F0C136", "M& c #F0BC2D", "N& c #D6AE45", "O& c #8C8A87", "P& c #898685", "Q& c #5F8EB9", "R& c #1160D7", "S& c #0A54D3", "T& c #2865C0", "U& c #94999E", "V& c #CBCBCB", "W& c #8E9092", "X& c #B1A485", "Y& c #EECB49", "Z& c #F5D340", "`& c #F4D445", " * c #F0C236", ".* c #E1B336", "+* c #A29883", "@* c #8F8E8E", "#* c #518BC1", "$* c #1378E1", "%* c #1365DA", "&* c #0A53D3", "** c #1F5EC2", "=* c #8993A0", "-* c #BBBBBB", ";* c #8F9093", ">* c #BDAC7D", ",* c #EFCB44", "'* c #F4D03E", ")* c #F3CF42", "!* c #F3D142", "~* c #F3CC3F", "{* c #F0BD2E", "]* c #E2B232", "^* c #AC9D78", "/* c #8C8C8B", "(* c #588CBD", "_* c #0851D1", ":* c #B7B7B7", "<* c #CCCCCC", "[* c #B6B6B6", "}* c #919295", "|* c #BCAC81", "1* c #EAC647", "2* c #F5CD38", "3* c #F1C237", "4* c #F1BF35", "5* c #EFBB2B", "6* c #DFB137", "7* c #AB9C7A", "8* c #8D8D8E", "9* c #90908D", "0* c #7492B0", "a* c #0E68DC", "b* c #116CDC", "c* c #0B57D4", "d* c #4979B3", "e* c #94989E", "f* c #BCBBBB", "g* c #CDCDCD", "h* c #929497", "i* c #AEA48E", "j* c #DCBD5A", "k* c #F1C737", "l* c #F3C938", "m* c #F1C73A", "n* c #F1C63A", "o* c #F0BD30", "p* c #EAB72A", "q* c #CFAA4D", "r* c #9E9788", "s* c #929293", "t* c #8F8E8C", "u* c #8E969C", "v* c #628FBB", "w* c #0F58D2", "x* c #1156CA", "y* c #3A71BA", "z* c #8492A3", "A* c #C3C3C3", "B* c #CECECE", "C* c #A1A1A2", "D* c #9A9996", "E* c #BDAD83", "F* c #DEBC51", "G* c #EDC236", "H* c #F2C537", "I* c #F2C437", "J* c #F1C336", "K* c #F0C033", "L* c #EFBD31", "M* c #E8B62E", "N* c #D5B049", "O* c #B0A07F", "P* c #92918F", "Q* c #999A9A", "R* c #1E66CC", "S* c #2066C9", "T* c #2A6AC3", "U* c #6A89AE", "V* c #9097A0", "W* c #9D9D9E", "X* c #9B9A97", "Y* c #ADA593", "Z* c #C5AF77", "`* c #D4B55A", " = c #DEB749", ".= c #E2B93F", "+= c #E2B73F", "@= c #DAB446", "#= c #D0B057", "$= c #BEA872", "%= c #A49D8D", "&= c #949391", "*= c #9C9B9B", "== c #A0A0A0", "-= c #BDBDBD", ";= c #A9A9AA", ">= c #9E9E9F", ",= c #9B9C9C", "'= c #9A9B9C", ")= c #9B9B9C", "!= c #989899", "~= c #848585", "{= c #686969", "]= c #666767", "^= c #727373", "/= c #797979", "(= c #696969", "_= c #626262", ":= c #6A6A6A", "<= c #858585", "[= c #969696", "}= c #808181", "|= c #4F5556", "1= c #404344", "2= c #4D4745", "3= c #594C4B", "4= c #665452", "5= c #6E5A58", "6= c #75605F", "7= c #7A6967", "8= c #7D7472", "9= c #7B7979", "0= c #818585", "a= c #404040", "b= c #4A4A4A", "c= c #545454", "d= c #5F5F5F", "e= c #656565", "f= c #6B6B6B", "g= c #6F6F6F", "h= c #333C3D", "i= c #532F2A", "j= c #8D3126", "k= c #C12C1B", "l= c #DA2614", "m= c #E2210F", "n= c #E31E0E", "o= c #DF1D0F", "p= c #D52116", "q= c #C72D25", "r= c #B4433D", "s= c #9F6160", "t= c #8D7A7A", "u= c #868B8B", "v= c #9FA0A0", "w= c #505050", "x= c #262626", "y= c #474747", "z= c #D5D5D5", "A= c #DEDEDE", "B= c #D6D6D6", "C= c #C6C6C6", "D= c #B2B2B2", "E= c #595B5B", "F= c #12191B", "G= c #4B2119", "H= c #BA2915", "I= c #ED2509", "J= c #F62205", "K= c #F12107", "L= c #EC2009", "M= c #E9200B", "N= c #E61F0C", "O= c #E31E0D", "P= c #DF1C0E", "Q= c #DD1A0F", "R= c #DA160E", "S= c #D6150E", "T= c #C42B26", "U= c #AC5856", "V= c #918888", "W= c #909393", "X= c #1F1F1F", "Y= c #363636", "Z= c #878787", "`= c #EDEDED", " - c #ECECEC", ".- c #EBEBEB", "+- c #EAEAEA", "@- c #E9E9E9", "#- c #E8E8E8", "$- c #E6E6E6", "%- c #E5E5E5", "&- c #E3E3E3", "*- c #CFCFCF", "=- c #8E8E8E", "-- c #3C3F3F", ";- c #141212", ">- c #972410", ",- c #F32906", "'- c #FC2603", ")- c #F72505", "!- c #F22507", "~- c #F02308", "{- c #ED220A", "]- c #EB210B", "^- c #E7200B", "/- c #E51F0D", "(- c #E11D0F", "_- c #DD1C0F", ":- c #DA1B10", "<- c #D61A12", "[- c #D4150F", "}- c #CE1310", "|- c #BE3030", "1- c #A17878", "2- c #909494", "3- c #121212", "4- c #5C5C5C", "5- c #F1F1F1", "6- c #F2F2F2", "7- c #EFEFEE", "8- c #F1F1F0", "9- c #EFEFEF", "0- c #383B3C", "a- c #1A1110", "b- c #C5250B", "c- c #FE2A01", "d- c #FD2802", "e- c #F82704", "f- c #F62605", "g- c #F42507", "h- c #F12308", "i- c #EE2209", "j- c #EC210B", "k- c #E6200C", "l- c #DB1C10", "m- c #D81B11", "n- c #D41A13", "o- c #CF1714", "p- c #CB120F", "q- c #C21F20", "r- c #A96A6A", "s- c #929595", "t- c #DCDCDC", "u- c #F4F4F4", "v- c #F3F3F0", "w- c #F4F4F0", "x- c #F5F5F0", "y- c #F2F2F0", "z- c #F0F0F0", "A- c #E4E4E4", "B- c #D8D8D8", "C- c #7E7E7E", "D- c #888888", "E- c #48494A", "F- c #171312", "G- c #C9250A", "H- c #FF2B01", "I- c #FC2902", "J- c #FA2804", "K- c #F62705", "L- c #F42607", "M- c #F22408", "N- c #EF2309", "O- c #EC220A", "P- c #EA210B", "Q- c #E7200C", "R- c #E01D0F", "S- c #DC1C10", "T- c #D91B11", "U- c #D51A12", "V- c #D01814", "W- c #CC1716", "X- c #C81313", "Y- c #BF1B1D", "Z- c #A96E70", "`- c #949898", " ; c #E2E2E2", ".; c #F7F7F0", "+; c #F8F8F0", "@; c #F8F8F1", "#; c #F6F6F0", "$; c #E0E0E0", "%; c #D9D9D9", "&; c #AEAEAE", "*; c #7D7D7D", "=; c #141919", "-; c #A5230E", ";; c #FC2A02", ">; c #FB2A02", ",; c #F92804", "'; c #F02309", "); c #E41E0E", "!; c #D11814", "~; c #CD1715", "{; c #C81616", "]; c #C41113", "^; c #BA2024", "/; c #A18588", "(; c #A1A3A3", "_; c #212121", ":; c #5D5D5D", "<; c #F0F0F1", "[; c #F9F9F2", "}; c #F9F9F3", "|; c #F9F9F4", "1; c #DFDFDF", "2; c #D7D7D7", "3; c #2C3435", "4; c #571E15", "5; c #F72904", "6; c #FB2903", "7; c #FA2903", "8; c #F72705", "9; c #F62606", "0; c #F22508", "a; c #D71A12", "b; c #D21814", "c; c #C91616", "d; c #C61716", "e; c #C10E10", "f; c #B4383E", "g; c #979595", "h; c #4E4E4E", "i; c #353535", "j; c #FAFAF5", "k; c #FAFAF6", "l; c #FBFBF7", "m; c #FAFAF7", "n; c #FBFBF5", "o; c #FAFAF3", "p; c #EEEEEE", "q; c #8D8D8D", "r; c #6A6B6B", "s; c #201F1F", "t; c #D4280F", "u; c #FB2704", "v; c #F92704", "w; c #F82705", "x; c #F52507", "y; c #F32507", "z; c #D71A11", "A; c #D31A13", "B; c #CE1815", "C; c #C91716", "D; c #C61616", "E; c #C21517", "F; c #BA0F15", "G; c #A97376", "H; c #9D9E9E", "I; c #FBFBF6", "J; c #FCFCF9", "K; c #FCFCFA", "L; c #FDFDF9", "M; c #F9F9F1", "N; c #EBEBEC", "O; c #DDDDDD", "P; c #848383", "Q; c #384344", "R; c #6D2A21", "S; c #F82605", "T; c #F12407", "U; c #F02409", "V; c #EE220A", "W; c #E9210B", "X; c #D21914", "Y; c #CA1716", "Z; c #C51616", "`; c #C21617", " > c #BD1016", ".> c #B23138", "+> c #999597", "@> c #BDBEBE", "#> c #484848", "$> c #FDFDFC", "%> c #FEFEFD", "&> c #FDFDFB", "*> c #FAFAF4", "=> c #2C3334", "-> c #B42D1C", ";> c #F82204", ">> c #F42606", ",> c #F22407", "'> c #F12408", ")> c #E8200B", "!> c #E31F0E", "~> c #BD1419", "{> c #B3121A", "]> c #A38C8D", "^> c #A9AAAA", "/> c #FEFEFE", "(> c #EAEAEB", "_> c #DBDBDB", ":> c #6B6E6E", "<> c #4F3B38", "[> c #D42915", "}> c #F32106", "|> c #F02408", "1> c #E8200C", "2> c #E21D0F", "3> c #DA1B11", "4> c #C21618", "5> c #BC141A", "6> c #B51119", "7> c #A86166", "8> c #F0F0EF", "9> c #FBFBF8", "0> c #F8F8F2", "a> c #E1E1E1", "b> c #5C6263", "c> c #6E3F3C", "d> c #E3240F", "e> c #EE2108", "f> c #EE230A", "g> c #EF2308", "h> c #EF2208", "i> c #EE2309", "j> c #ED2209", "k> c #E31F0D", "l> c #E11E0E", "m> c #DF1C0F", "n> c #B61119", "o> c #AB3D46", "p> c #9A9A9B", "q> c #FDFDFA", "r> c #515A5B", "s> c #84463F", "t> c #E91E0B", "u> c #EB200B", "v> c #EC210A", "w> c #E61F0D", "x> c #E51E0D", "y> c #E21E0E", "z> c #DD1C10", "A> c #D31913", "B> c #CF1915", "C> c #C71616", "D> c #C41617", "E> c #BF1518", "F> c #BB141A", "G> c #AB2933", "H> c #D1D1D1", "I> c #4E5A5C", "J> c #904A43", "K> c #EA1A09", "L> c #EA200B", "M> c #E71F0C", "N> c #E41E0D", "O> c #DD1D10", "P> c #D81A11", "Q> c #D11913", "R> c #C31617", "S> c #BE1518", "T> c #BA131A", "U> c #AC1F29", "V> c #636363", "W> c #586263", "X> c #944F49", "Y> c #E71809", "Z> c #E41F0D", "`> c #DE1D0F", " , c #DB1B0F", "., c #D41913", "+, c #D01914", "@, c #BD1519", "#, c #B8131B", "$, c #B4101A", "%, c #AB1F2A", "&, c #9A9B9B", "*, c #E7E7E7", "=, c #636C6C", "-, c #915551", ";, c #DF1A0C", ">, c #E11D0E", ",, c #DB1C0F", "', c #D41A12", "), c #CD1814", "!, c #C11518", "~, c #BC1519", "{, c #B7131B", "], c #B2101A", "^, c #A72731", "/, c #989999", "(, c #6D7171", "_, c #8C5F5C", ":, c #D61F15", "<, c #DF1A0E", "[, c #E01E0F", "}, c #D91B10", "|, c #D11813", "1, c #CC1815", "2, c #C81716", "3, c #BA1419", "4, c #B6131B", "5, c #B0101B", "6, c #A53B45", "7, c #989998", "8, c #F2F2F1", "9, c #EEEEEF", "0, c #747676", "a, c #826C6C", "b, c #C72B25", "c, c #DB170D", "d, c #DB1B10", "e, c #DE1C0F", "f, c #D91A11", "g, c #CF1815", "h, c #C61617", "i, c #C31618", "j, c #BB1419", "k, c #B7131A", "l, c #B4121C", "m, c #AE0F1A", "n, c #A25E66", "o, c #ECECED", "p, c #DADADA", "q, c #B4B4B4", "r, c #787878", "s, c #767A7B", "t, c #B8403D", "u, c #D9140C", "v, c #D81A12", "w, c #CC1715", "x, c #BC1419", "y, c #B8141A", "z, c #B5131B", "A, c #B1121C", "B, c #A60E1B", "C, c #9B878B", "D, c #757B7B", "E, c #A05F5D", "F, c #D01A15", "G, c #D41711", "H, c #D21913", "I, c #C21518", "J, c #BE1519", "K, c #B4131B", "L, c #AE0D18", "M, c #A22C38", "N, c #929091", "O, c #747575", "P, c #878383", "Q, c #C0302D", "R, c #D0140F", "S, c #CE1814", "T, c #C51617", "U, c #C11617", "V, c #BF1519", "W, c #B8131A", "X, c #B1111C", "Y, c #A60B16", "Z, c #9C7176", "`, c #A9A9A9", " ' c #7A7F7F", ".' c #A36969", "+' c #C81817", "@' c #CC1614", "#' c #CD1815", "$' c #CF1914", "%' c #CB1715", "&' c #C41618", "*' c #B5131C", "=' c #B2121D", "-' c #AB0915", ";' c #A2333E", ">' c #918E8F", ",' c #888C8C", "'' c #B34A4C", ")' c #C71414", "!' c #CA1616", "~' c #CB1716", "{' c #C31518", "]' c #B5121C", "^' c #B2121C", "/' c #AC0C18", "(' c #A41925", "_' c #958285", ":' c #938F8F", "<' c #B8393A", "[' c #C41214", "}' c #BA141A", "|' c #AC0D18", "1' c #A31420", "2' c #986F75", "3' c #929393", "4' c #988E8F", "5' c #B53D3F", "6' c #C01114", "7' c #C31214", "8' c #AB0B16", "9' c #A31824", "0' c #986B72", "a' c #939090", "b' c #AE5357", "c' c #B9191E", "d' c #BD0D12", "e' c #BE1216", "f' c #AE0B16", "g' c #A70B16", "h' c #A22935", "i' c #957A7F", "j' c #848687", "k' c #A37D7E", "l' c #B14147", "m' c #B5171F", "n' c #B60A11", "o' c #B70E16", "p' c #B71018", "q' c #B7121A", "r' c #B6131A", "s' c #B5121B", "t' c #B2111A", "u' c #B10F18", "v' c #AE0A15", "w' c #A70A15", "x' c #A4232E", "y' c #9D5C64", "z' c #8A8687", "A' c #8C8D8D", "B' c #ACACAC", "C' c #777978", "D' c #868586", "E' c #9F8183", "F' c #AB6167", "G' c #AC3A42", "H' c #B0222A", "I' c #AF141D", "J' c #AF0E17", "K' c #AD0F19", "L' c #A91723", "M' c #A72A35", "N' c #A64852", "O' c #9B7277", "P' c #8A8283", "Q' c #858686", "R' c #787979", "S' c #7B7C7C", "T' c #848181", "U' c #8F8687", "V' c #988B8C", "W' c #9C8C8E", "X' c #97898A", "Y' c #8E8485", "Z' c #868182", "`' c #818080", " ) c #808080", " . + @ # $ % & * = - ; > , , ' ) ) ! ! ! ! ! ! ! ! ! ! ) ) ' , , > ; ~ { ] ^ / ( _ : < . ", " [ } | 1 2 3 4 5 6 7 8 9 0 a b , c d d e e e e e e e e e e d d c , f g h i j k l m n o p q r s t ", " u v w x y z A B C D E F G H I J K L M N O O O O O O O O O O O O N > [ P Q R S T U V W X Y Z ` ...+.@.#. ", " $.1 %.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.<.<.<.<.[.[.<.<.<.<.<.}.|.1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.f.g.h.i. ", " $.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.D.> E.E.E.F.F.F.F.E.E.E.M G.H.I.J.K.L.M.N.O.P.Q.9.R.S.T.U.V.W.X.Y.Z.`. ", " +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+^+/+(+_+:+<+<+[+[+[+[+<+<+' }+|+1+2+3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+ ", " m+n+o+@+p+q+r+%+s+t+u+v+w+x+y+z+A+B+C+D+E+F+G+H+I+J+K+L+L+M+M+L+L+N+O+P+Q+R+S+T+4+5+6+U+8+V+W+Q.X+Y+Z+`+ @.@+@@@#@$@%@l+ ", " &@%.l.#+q+*@=@-@&+;@>@,@w+x+y+z+'@)@x.!@~@{@]@^@/@(@_@:@:@:@:@:@:@f <@[@2+}@|@1@4+2@6+3@4@V+8.Q.5@6@7@8@U.9@0@a@b@c@d@e@ ", " f@g@h@m.$+r+=@i@j@k@l@m@v+w+x+y+z+'@)@x.!@n@o@p@q@r@s@t@O u@u@u@u@O v@w@x@y@z@1@4+A@B@M.7+8+V+W+Q.5@6@7@C@U.D@g+E@F@G@H@I@J@ ", " K@L@M@N@%+%+-@j@k@O@P@q.-+w+x+y+z+'@)@x.!@Q@o@p@R@S@T@U@V@W@W@W@W@X@Y@Z@`@ # # #A@.#6++#N.@#9+W+Q.0.##7@C@U.$#%#E@&#*#=#-#;# ", ". >#,#'#o.)#s+)#k@O@p.u+!#r.;+~#,+z+A+)@x.!@n@o@{#R@S@]#^#/#(#_#_#:@:#<#[#}#|#5+|#|#6++#7+1#O.9+2#a+0.3#4#8@U.D@g+E@&#*#5#6#7#8#", "9#0#a#b#p.*+t+;@l@P@m@!#-+w+s.t.c#d#A+B+e#y.n@o@p@R@S@f#g#h#<.i#i#O j#k#l#7+M.m#m#M.U+N.4@@#9+8.n#a+X+Y+Z+8@o#9@g+E@&#*#p#q#r#s#", "t#u#v#w#q.=+u+>@m@q.x#y#r.z#A#B#C#'@D#B+e#y.E+{@E#R@F#f#G#H#I#J#J#K#L#M#N#8+N.N.U+N.4@8+O.O#P#0+a+0.6@S.Z+Q#o#R#S#T#F@*#U#V#W#X#", "Y#3 Z#`#r.-+v+,@v+-+r.w+z# $y+.$'++$w.@$#${+E+$$%$&$S@*$=$-$;$>$>$i.,$'$)$!$O.@#8+@#~$~$9+P#2#Q.5@b+Y+{$T.U.f+.@+@a@F@]$^$/$($_$", ":$4 C ,.s.;+w+w+w+w+;+s.A#y+c#z+<$[$}$|$1$2$3$F+4$5$6$*$7$8$9$0$0$a$b$c$d$8.P.9+9+9+e$P.8.f$g$9.b+h$c+i$`+o#$#.@+@@@j$k$l$m$n$o$", "p$q$r$'.t.>+x+x+x+x+~#t.B#c#z+s$t$u$@$#$D+v$w${#4$5$x$y$z$A$B$C$C$D$E$R.5@Q.0+W+8.8.W+2#n#F$a+0.h$c+7@T.e+G$H$%#E@I$j$J$K$L$M$N$", "& O$E P$u.,+y+y+y+y+,+c#C#'+<$t$u$@$Q$y.2$3$R$]@&$S$T$U$V$W$X$Y$Y$Z$`$ %R.0.9.a+a+a+a+9.5@0.b+3#.%+%T.Q#o#9@.@@%a@&#*##%$%%%&%*%", "* =%-%!.v.'+z+z+z+z+z+;%'@+$[$u$@$>%y.,%'%)%!%~%5$6${%]%^%/%<.(%(%_%:%<%[%}%|%b+b+0.b+b+1%h$}%S.Z+T.2%3%4%5%S#6%7%j$8%9%0%a%b%c%", "= 8 d%~.w.)+A+'@'@'@A+A+e%w.}$@$Q$y.2$E+o@{#f%g%h%T$i%j%k%l%m%n%n%e o%p%q%Z+S.c+c+Y+c+c+c+S.{$r%8@Q# @s%R#t%u%a@F@*#p#$%v%w%x%y%", "z%9 A%B%x.!+B+)@)@)@)@B+B+@$|$#$y.,%E+o@F+C%R@5$x$D%]%E%F%G%H%I%I%J%- K%L%`+T.d+Z+Z+Z+Z+d+d+T.M%U. @f+.@t%u%T#7%j$J$l$N%O%P%Q%R%", "S%T%I U%V%~+C+x.x.x.x.e#e##$1$D+2$'%W%F+{#4$X%Y%f#Z%`% &.&+&@&#&#&@&$&%&&& @U.`+`+8@*&8@`+`+=&o#G$$#.@t%-&T#;&>&]$U#$%,&'&)&!&~&", "{&]&^&^./&{+D+!@!@!@!@y.D+{+2$v$3$)%{#C%4$X%Y%T$D%]%(&_&:&<&[&[&[&[&}&|&1&2&3&f+G$ @ @ @G$G$f+9@.@g+4&5&T#6&F@*#7&K$v%8&9&0&a&{&", ", S%b&/.A.c&E+~@n@Q@n@n@E+E+3$w$R$!%f%R@X%Y%d&e&]%f&g&h&i&j&k&k&k&k&>$l&m&n&t%5%.@.@H$o&o&.@.@g+p&q&6%a@6&j$*#r&l$N%8&s&t&u&v&, ", ", ' w&x&B.y&F+{@o@o@o@o@{@$$F+{#]@~%g%5$Y%T$e&]%z&A&B&C&L+D&E&E&E&E&D&F&G&H&I&u%-&-&S#S#S#-&q&u%T#@@7%F@*#J$J&l$K&%%L&M&N&O&' , ", "' c > P&Q&/+G+]@p@p@{#p@E#%$4$4$&$5$h%x$f#D%]%z&R&S&T&U&n%V&V&V&V&V&V&(%W&X&Y&Z&;&`&T#T#T#T#;&7%&#F@j$*#8%^$K$N%L$ *9&.*+*{&c ' ", ") d N }.@*#*H+$*R@R@R@R@R@&$5$5$S$x$T$D%D%%*z&A&&***=*C$V&V&V&V&V&V&V&V&-*;*>*,*'*)*!*!*!*!*F@j$j$*#~*U#K$$%v%O% *{*]*^*{&N d ) ", ") d O <./*:+(*/@r@S@S@S@S@S@6$x$T$*$i%]%`%(&g&_*T&=*:*V&V&<*<*<*<*<*<*V&V&[*}*|*1*2*k$k$k$k$k$r&#%p#l$$%v%L$3*4*5*6*7*8*<.O d ) ", "! e O <.E.V@9*0*s@a*b*f#f#*$*$y$U$]%j%f& &c*h&d*e*f*V&<*<*g*g*g*g*g*g*<*<*V&0$h*i*j*k*l*^$^$^$K$m*n*v%L$8&L&o*p*q*r*s*E.<.O e ! ", "! e O <.E.<+K+t*u*v*^#g#G#=$7$z$V$^%k%w*x*y*z*L+A*V&V&<*g*B*B*B*B*B*B*g*<*V&V&n%C*D*E*F*G*%%H*I*J*J*a%K*L*M*N*O*P*Q*<+E.<.O e ! ", "! e O <.E.<+L+(#O V@/#h#H#-$8$R*S*T*l%U*V*F&j&D&V&V&<*g*B*B*B*B*B*B*B*B*g*<*V&V&D&>$W*X*Y*Z*`* =.=+=@=#=$=%=&=K+(#L+<+E.<.O e ! ", "! e O <.F.[+L+:@u@W@(#<.I#;$*=B$[.*===H%@&[&k&E&V&V&<*g*B*B*B*B*B*B*B*B*g*<*V&V&E&k&[&-=;=>=N+,='=)=!=O ,=:@W@u@:@L+[+F.<.O e ! ", "! e O [.F.[+M+:@u@W@_#i#J#>$0$C$Y$(%n%I%#&[&k&E&V&V&<*g*B*B*B*B*B*B*B*B*g*<*V&V&E&k&[&#&I%n%(%Y$C$0$>$J#i#_#W@u@:@M+[+F.[.O e ! ", "! e O [.F.[+M+:@u@W@_#i#J#>$0$C$Y$(%n%I%#&[&k&E&V&V&<*g*B*B*B*B*B*B*B*B*g*<*V&V&E&k&[&#&I%n%(%Y$C$0$>$J#i#_#W@u@:@M+[+F.[.O e ! ", "! e O <.F.[+L+:@u@W@:@N ~=i.{=]=^=_%d J%-=[&k&E&V&V&<*g*B*B*B*B*B*B*B*B*g*<*V&V&E&k&[&-=J%, /=(=_=:=m+<=[=(#W@u@:@L+[+F.<.O e ! ", "! e O <.E.<+L+(#[=}=|=1=2=3=4=5=6=7=8=9=0=Q*:*D&V&V&<*g*B*B*B*B*B*B*B*B*g*<*V&V&D&[*c v a=b=c=d=e=f=g g=g [ ; [=(#L+<+E.<.O e ! ", "! e O <.E.<+K+R%h=Y@i=j=k=l=m=n=o=p=q=r=s=t=u=v=n%V&V&<*g*B*B*B*B*B*B*g*<*V&V&n%K+w=x=y=$.F.(%z=A=A=B=C=D=[=; +S%O <+E.<.O e ! ", "! e O <.E., E=F=G=H=I=J=K=L=M=N=O=P=Q=R=S=T=U=V=W=0$V&<*<*g*g*g*g*g*g*<*<*V&0$f@X=Y=Z=D&`=`= -.-+-@-#-$-%-&-*-W@<=/==-E.<.O e ! ", ") d O <.> --;->-,-'-)-!-~-{-]-^-/-(-_-:-<-[-}-|-1-2-[*V&V&<*<*<*<*<*<*V&V&[*_=3-4-A*5-6-7-8-8-8-8-8-9-`=+-$-%-&-g*F.~ }.<.O d ) ", ") d N }.0-a-b-c-d-e-f-g-h-i-j-M=k-O=o=l-m-n-o-p-q-r-s--*V&V&V&V&V&V&V&V&-*_=3-m+t-u-8-v-w-x-x-x-x-w-v-y-z-`=@-A-&-B-W@C-D-N d ) ", "' c {&E-F-G-H-I-J-e-K-L-M-N-O-P-Q-n=R-S-T-U-V-W-X-Y-Z-`-(%V&V&V&V&V&V&n%#.3-m+ ;z-y-w-.;+;+;@;+;+;.;#;w-y-8-9-@-A-$;%;&;*;M c ' ", ", ' g==;-;c-;;>;,;e-f-L-M-';O-P-Q-);R-_-:-<-!;~;{;];^;/;(;D&E&E&E&E&D&N+_;:;t-<;v-#;+;[;};|;|;[;[;@;+;.;w-y-8-9-@-A-1;2;[+*;' , ", ", ; 3;4;5;6;7;,;,;8;9;g-0;';O-P-Q-);(-_-:-a;b;~;c;d;e;f;g;>$k&k&k&k&>$h;i;A*u-8-#;@;};j;k;l;m;n;|;o;@;+;#;w-v-8-p;#- ;1;<*q;; , ", "{&r;s;t;u;v;e-w;8;9;x;y;h-i-O-P-Q-);(-_-:-z;A;B;C;D;E;F;G;H;[&[&[&[&! x=Z=5-z-w-@;};I;J;K;L;J;l;I;j;};M;+;#;x-v-z-N;$-$;O;D=*;{&", "P;Q;R;0;S;f-K-9;9;g-y;T;U;V;j-W;k-n=R-_-:-a;X;B;Y;Z;`; >.>+>@>#&#&@&d=#>E&6-y-.;[;j;J;$>%>$>&>J;l;k;*>};@;.;x-w-8-p;@-A-1;g*q;; ", "~ =>->;>y;g->>g-g-y;,>'>i-O-]-)>N=!>R-_-:-<-X;B;C;Z;`;~>{>]>^>I%I%J%a= +`=7-w-+;};k;K;%>/>%>K;J;l;I;j;};@;+;#;w-y-9-(>%-1;_>M+s#", ":><>[>}>T;,>!-!-,>T;|>N-V;j-W;1>/-2>o=S-3><-!;~;C;D;4>5>6>7>F.n%n%' b=F.`=8>x-+;|;l;L;$>%>$>&>J;9>I;j;*>0>+;#;x-y-z- -$-a>O;>$*;", "b>c>d>e>f>g>|>|>|>h>i>j>j-P-^-N=k>l>m>l-T-U-V-~;c;D;4>5>n>o>p>(%(%/=c=(%.-8-x-@;|;m;J;&>K;&>q>J;l;I;j;*>0>+;.;w-v-8-`=#- ;O;[&S%", "r>s>t>u>]-v>{-{-{-O-j-]-M=1>w>x>y>o=z>3>a;A>B>W-C>D>E>F>n>G>,=Y$Y$:=v z=.-8-x-+;[;n;l;J;J;J;J;l;I;j;*>};@;+;.;w-v-8-`=#-&-O;H>M ", "I>J>K>Q-)>L>]-]-]-P-P-)>M>w>N>y>o=O>:-P>U-Q>~;Y;D;R>S>T>6>U>,=C$C$V>e=A=+-8-x-+;[;|;I;l;l;9>l;I;k;j;*>};@;+;#;w-v-8-`=#-&-O;z=, ", "W>X>Y>Z>N=Q-1>)>)>1>Q-N=/-n=y>R-`> ,T-<-.,+,W-c;D;`;@,#,$,%,&,0$0$(=f=A=@-8-w-.;@;o;j;k;I;I;I;j;j;*>};[;+;.;#;w-y-z-`=*, ;O;z={&", "=,-,;,>,n=k>Z>/-/-/-Z>k>y>l>o=`>,,3>a;',Q>),Y;C>D>!,~,{,],^,/,>$>$m+g=B=*,8>v-#;+;@;};*>j;j;j;*>*>};[;M;+;.;x-v-y-z- -*, ;t-B*Z=", "(,_,:,<,o=[,l>y>y>y>l>l>m>o=_-l-},a;',|,B;1,2,Z;`;S>3,4,5,6,7,J#J#<=g=C=$-`=8,w-#;+;M;};};*>*>};};[;[;+;.;#;w-v-8-9,+-$-a>t-A*C-", "0,a,b,c,d,S-_-e,e,e,e,e,S-d,3>f,a;',!;g,~;C;h,i,E>j,k,l,m,n,[.i#i#[=g=i#$-+-8>y-w-.;+;@;@;0>0>@;@;+;+;.;x-w-v-y-8>o,#-A-1;p,q,/=", "r,s,t,u,v,m-3>:-:-:-:-:-T-P>a;U-A>|,B;w,Y;C>D>!,x,y,z,A,B,C,:@_#_#:@[ [=A-$-o,8-y-w-#;.;+;+;+;+;+;.;.;#;w-v-y-8-p;+-%-a>O;B-F.. ", " D,E,F,G,U-<-P>P>P>P>a;<-U-.,H,+,B;w,C;{;Z;I,J,F>k,K,L,M,N,W@W@W@W@R%; *-%-@-9-8-v-x-x-#;#;.;.;#;#;x-w-v-y-8-9- -#-&-$;t-[&<= ", " O,P,Q,R,+,Q>A>A>n-A>A>Q>Q>+,S,1,Y;C;C>T,U,V,x,W,z,X,Y,Z,Q*u@u@u@u@N $.W@&-A-@-7-8-v-w-w-x-w-w-w-w-v-y-8-8-9- -@-%-a>t-2;`,m+ ", " '.'+'@'#'),$'B>$'$'S,S,#'%'c;{;Z;&'`;S>x,y,*'='-';'>':@:@:@:@:@:@; <=g*&-A-@-`=8>8-y-y-v-v-v-y-y-8-z-p; -@-$- ;A=p,I%~& ", " u ,''')'{;!'Y;Y;~'Y;!'c;{;C>D;D>{'!,~>F>W,]'^'/'('_'N+L+L+M+M+L+L+K+. F.B-a>A-#-.-p;9-z-8-8-8-z-z-p; -+-#-%- ;A=_>*-N+m+ ", " i.:'<'['D;D;D;D;D;D;T,D>R>`;E>@,x,}'k,]'A,|'1'2'3'<+<+[+[+[+[+<+<+=-s#W@%;1; ;$-@-(> -`=`=`=`= -+-#-%-&-a>A=_>H>(#. ", " . 4'5'6'7'R>R>R>R>4>!,E>J,~>}'W,4,K,X,8'9'0'=-E.E.E.F.F.F.F.E.E.E.}.C-&;2;1;$;A-%-$-#-#-#-*,*,$-A-a>$;t-p,*-(#r, ", " u a'b'c'd'e'J,@,~,~,j,}'k,4,z,^'f'g'h'i'{&<.<.<.<.<.[.[.<.<.<.<.<.D-*;[+<*t-1;1;a> ;&-&- ; ;a>1;O;t-B-I%K+. ", " u j'k'l'm'n'o'p'q'r's't'u'v'w'x'y'z'A'N O O O O O O O O O O O O N M *;q;D=g*_>O;A=O;O;O;t-t-_>2;[&B'~&u ", " C'D'E'F'G'H'I'J'K'L'M'N'O'P'Q', c d d e e e e e e e e e e d d c , R%C-=-M+>$[&H>z=z=B*A*J#F.<=m+ ", " R'S'T'U'V'W'X'Y'Z'`'~&> , , ' ) ) ! ! ! ! ! ! ! ! ! ! ) ) ' , , > ; s#*;S%> , {&Z= )/=. "}; ColorCode-0.8.7/src/img/bookmark_tab.png0000644000175000017500000000414112610736534016556 0ustar dirkdirkPNG  IHDR w}YsRGBIDATH *"no"ِi)/7x  "')nmEQ` %ǚkL8/11&.15 8$H4p ?    !>@@Ll @:7C ȭ/%+ #թk/'/! "jttt ')# *k7 z   ,slV2 d l3rl&m7_eIENDB`ColorCode-0.8.7/src/img/same_color_header.png0000644000175000017500000000113112610736534017552 0ustar dirkdirkPNG  IHDRvsRGBIDAT( \&S/=DyA#;44 ϖVi θHLJ dC6L2ιT{7B~3H2[Y !61Zq ?6L i3 Z   /J 369*'6o`n0LNtr ">'3JqJ  /^( , LL * 3;jIENDB`ColorCode-0.8.7/src/img/bookmark.png0000644000175000017500000000124112610736534015726 0ustar dirkdirkPNG  IHDRahIDAT8}OQ} X S 8q/0F(31QF]\q0h!2qp$% 4 m{Z4 p''99O瞋5vs8xm,9hqq : !i[vr~dz%+pׯjZ;Zٞ֠y3z>{e=e>nN@T[gH"9XoՓ@>Rհ?(1̓ic&޼\āt a6nDTe99h7˫nf̂d6=>nrs=LMM=3L/sjH$CGRΗ^wf||媪Ov'KKKM~D"iW455m,^i{{{G\>^XX@2a{{{g_HT#˲;oH$ëX,iXD2d<r! (lNszt:YTa$G"A-tU FvCQ(I G7yrQ0 ;&Ƣ$\2g 074D n@ ٬6Olݑ锯$:j*q5vengn9=#~Mp\*TŲUlc)dm(2$NA=Mk9$[? ^b  pX#Wlr3G0hlO;>Xgh4O![>j5]#T\t_%^*rJ= w#/Ҷ>ȅnF&L-I}BMw`T(pfWwW` W;= vr ×}i߬e08D.4a$h$CG+dohݓaGse;4_\aпpvZ?B][1sXoђ़m3c+q rN)i+ me8 1 (lBјt!%0a=Q~f.z |սbYy\7VSW \h 3x=G3g&nw (r%]%z_|g^fm0Y5d?\g[b~T- ޔ?bk zO&김~/ MYa: W׻K\Sc\W x6\Z=Z .B;a".  "Rs2Or8" ;@$A kZNdx\ן`C&QQDL-58BʣEa[QV(OI$ I2? ܭ[1]"fWN:^ҳ,d4tzxJh_g?={ES!_ 1RG\c[b{Sj_%yLErWhQ(+[|p|4*DxB)!"Q!_xkF^Ϝzeoof&6UYl>oُ1wDR]iϾ]Z2YH `|dT 29vX:`OBX@SJ uz>Gzh|; J7حA& 1;&جPj*LNLΪekLk9MM5mDw·o]LƾHKpfϿ媨())*Q% B?D#ooq<%]IENDB`ColorCode-0.8.7/src/img/history.png0000644000175000017500000000203112610736534015620 0ustar dirkdirkPNG  IHDRa pHYs  gAMA|Q cHRMz%u0`:o_FIDATxbd@*o*?}ߟ?^M 9{;8ß=p#_ן|O⻋`zԒW6&~6FV0ccc\@ }}P@LE) 6Ro~2|zEk@'@1XߞnYj" ʲ@00pꙇ r@g30:|*r''5O ī} "BtTp;eN =SqS { VE g&FIENDB`ColorCode-0.8.7/src/img/application-exit.png0000644000175000017500000000151212610736534017374 0ustar dirkdirkPNG  IHDRabKGD pHYsvv}ՂtIME  )xoIDATxڍkTW?7o^f2$'u\4?Ԫ *Em.ڕJv]A6]tbn\ؒt!313̼_yxt!҅spUk~hݛ}[ `w{je匪_t/5E ʹTΝcX$􌷶F$:@'E|6aD\I߀"[JT6Cd1:Fg0Zby_wV p~r+s( Ey_Q[¼ m a)s [782ٯ.&m2dȴ P7VjrNr*ji?1^.i;ju-_7ATV=buwp"@Al [YB$CZV;[_MxPZ#*jR!:yIENDB`ColorCode-0.8.7/src/img/resume.png0000644000175000017500000000076512610736534015433 0ustar dirkdirkPNG  IHDR7sBITUF pHYs:tEXtSoftwarewww.inkscape.org<tIDATAKS;ڡ}.]= h,/hsrr=hn7(  T|`z 38"|HC  $       . BW5'*Es;&$ 4 : ?)}@E6"110B$ J   .X6&*"  B*.,,% 666 606TU200III "" $$$666g 999T    666     %"*/72ErgOOOppp0bbcY0hhg/",:7NE 999 0u| *% 儎} 'mALIENDB`ColorCode-0.8.7/src/img/document-new_tab.png0000644000175000017500000000414112610736534017356 0ustar dirkdirkPNG  IHDR w}YsRGBIDATH *uN)3)_22ֆa*ޞBB*{y ˝ג߱uYC1_et)t  ee H:; : :~9~ 2"G%IIENDB`ColorCode-0.8.7/src/img/cc64.png0000644000175000017500000004027412610736534014671 0ustar dirkdirkPNG  IHDR@@iqsRGBtIME ,MWX IDATx@@AAA666      KKK%%%(  '$#  uuu¾  <[,< "# WO LH!! KKK&&& LmRa AGC3 "JJJ&&& 7/@ 08QS2< $'(((#' ?H45.# 4vvv$  H682  '++.ŁQQQ~#%489/8" KKK""" Lm7/ ><Z[2 /!+,-NNN Ra uo) &KKL)))  '95 %                   '  '  "!0   H  - @ B(!   @ I ""!- > 0; a.(# -+)4B ? a..$'&#=.  C 8!! A(K(#G. #;   )J! #!6  .0$  '& (('     B   #  KBv IDAT        ,M4 ##"" !!!111..."""  9o3 -002 *''QQQBBB$$$\  HH&""JJJggg... IIIP  dddsss%%% 6-)) dddlll,,, 5 KKKfff)))%%%CRfff***} RRR...%%%M  """CCCG ***####  --- """(            #!)%    $&E> 9<(( ##25OG Ɓ/..0/ YS  ~67 UP!  }76ZS uuu96*# %%%KKK,.-   *%   IJJ///   KIDATVkIENDB`ColorCode-0.8.7/src/img/same_color_0.png0000644000175000017500000000140612610736534016466 0ustar dirkdirkPNG  IHDRatEXtSoftwareAdobe ImageReadyqe<IDATxڤ[Haަhd7D[ԕ52*(A+D "衇Ǡz |H + ],J C%5a.ʺuٝ[gm <9s1]ױo!!3ac dcKȘĴI5CiE?pi-j Bm:_A:`Xm3h6xsXxQ>`WAFcי`T6/ ܰ%v༄n"6CMu7c@?%皲E E r>i,E5B JYd0ҎZw ҹ }}2EZFtqpKW0p_ "˪ك)WMQ)QPuUGP @)Pn^ a,T.0my ,e,EM}5PFI4C… 㟿HZC4+`# |ƹ b $>>!Zxl E 7 Ό~Nn88F.@Y`5WUlccьؒE_!9<}=) 2]==K.xޓm᳜&R(DMr<{;C{3XvP(tAӴA?4r$H'09'v#7O^â `dفt:C\ˑIvLٍ#"Tˋ^%I!_x`IENDB`ColorCode-0.8.7/src/img/bookmark_add.png0000644000175000017500000000137312610736534016544 0ustar dirkdirkPNG  IHDRaIDAT8}MhTgޛ 77Q$Ăh@"XUP]((JMWh(B&Sݨ i7mRL)P&ڦt~2wE8x,9yp^Tʱ m#T UZj~:_ȥ3LeSPM熵?A sPȀJ/fuկ2 b*Ubh!=t O7BJo|g4Es蚎xȩѲ7ևU[|UJ.]W!b4o`Ҩ5 $Vz?ksisIDF^>7$2'ꂥNIw/uqVʟ>`PȈDAF ̌XG27$_,{ w-֏6Ke=]6p;mIENDB`ColorCode-0.8.7/src/img/view-refresh.png0000644000175000017500000000164312610736534016535 0ustar dirkdirkPNG  IHDRasBIT|d pHYs:tEXtSoftwarewww.inkscape.org< IDATxmk\UƟs$3I'I'M4N(BhТEuUE7 7;EQj!&%6it$s3q=xG fgqÞ]iIEѠ6v]lZh7J$w8 ϘG8|-Bt/B2.VB߭ mW"DN&ZwZ0 i$Yr"HgLvvnJricԴL5)bC5(t'\!FMPe\ [̾pm8> P. OyD\i؝KӉոnZl.&Yr2Vdu\kYSox;\"~|7\uQrkIp,IENDB`ColorCode-0.8.7/src/img/gplv3-80x32.png0000644000175000017500000000626312610736534015747 0ustar dirkdirkPNG  IHDRP 3ltEXtSoftwareAdobe ImageReadyqe< UIDATx ]X@AArrAbF 94FL2ĊIPCJRKgeE%IPnV©r(ײ{̟{3R!zׯկ_41ybIZ(ZG|B3ۋGX=R&u&H Ei$R7wnA¹ws~ǼaX$?C3yqs8ףFQ`3puv!~Bo񽒺.Yn$^*\[v5@GЄԙzFy;B>^i<+-@`$xPOfl&g/=<'+{پE іC@n^MsCoya_~5UMV0\L{ _z;¸'r Ђ̹{YlqD+]YS/-'aE{Wغ"\c+?>C oz؅fz.2]i`ʻ4H]v4 gX4"j]b'tgWDu;v})^LET|;mphF@vɷügɲcC^ .532ih_Nsԇbsس6x_O}`\B3F@zJ {vYQ8kAsm\"&4.#1Q6~J}A`ph2xH!uqH0Tۄ!s5UR[yD|6m]a/Rft3[s\3;v.L,G}ȽT)u::w-c Av_Nl_QBD"JҌ47!ڂ2q hCثhLYwoVyY< ɦhf LݗPa]#@usHFş)Z)$ݦ@[7?s1,%u\\jKI\ЩS@:R _N[K+ANr)vRE |}ةct^@V ?ޯhh3L v}UaIE,|f&$YuX)E{1%D$cBAw9Nwy$6%HAݘo`} :xH%Y.^DN&\b>ܜăy|"VOR@HHVy 5UBx "FRE-&|RO澕X1u*:/1x~Ţٱh#Bػ΢Mא7"5ȗx1g p tlҐ4;aq/MTkLB?Yɦby\X>Y jX<&o]nR$Dǎ?Lшz]Yf+[_`6ߧ3|8bƈ t5<܉W1b!dY)p_hE)9ZJ-{=)S?y ,HR4=Q/Z_ԃz@/CF'BvQ˦4b {4b`@h˼ls.m\]VE?i~wӬaKǁ*w;y ͊91o"|HB9}~". sCg'xZsrJT5K*?Nsi[!t/](+`d+%~LNa%(_:;M /0񬘦kE^ԖJy-ew l3$;uYJeOo= 7ykTO F\`eީT;j OBÔGy J vb9Oc rx5LK{wyHYrxT|/@ԫށoqC\+ t \G|Oc$"o&?d4oQ9??8dWI&M-M- CnRs}D%T nOS^%vV{06 ]6$撨.rD4"1rɶ0\jͷђ}ǑRgdIfVUUڕ/^ig;mʘ{G\cf7<'p"!_N7/Y …M}xyiҵIqo'sLg̯0ԪS&c ӁE]-jXH{k;7@  YOF kiRA?Kl1!? PGkS)( `Tw5N(Il?Va ܘ1Pn3"Ti+ZΡlP]N L+~;3IENDB`ColorCode-0.8.7/src/img/story-editor.png0000644000175000017500000000137412610736534016574 0ustar dirkdirkPNG  IHDRasBIT|d pHYs:tEXtSoftwarewww.inkscape.org<yIDAT8[HTA9{vm54+3RTdtK$[tH"} ؊BR N衢2麞\t7-gg~%"TUU i*;Uy{3^ ])5 (J0(y'jxdyRȲRs~[Tuuu|뜸򜤀}ftFL{w819^xz|엁A R$h.ݥ;l,b4W{5='K6}xrY(n +`PLӔOV,+9sTDHL5$hFR MӐ{l:@99[q疗HS">6Rbوw24{N  |Sᙒ.# iX1ׇ8[}#*0 @G\ B}<Xɺ*4 23ɾI]Ӏ6\r1 gG+}gk7dw##"4b L&fy,"<1<IENDB`ColorCode-0.8.7/src/img/help-about.png0000644000175000017500000000133612610736534016166 0ustar dirkdirkPNG  IHDRasBIT|d pHYs:tEXtSoftwarewww.inkscape.org<[IDATxڥ1hA73;{].\R)DBP,J,D4Vbc!h#&UBbi*v6*6b]5]nnw]ic7;xCJ)Y1mNcShW"\VN;B;{X]@)U(^1K+b' j.L]ZCB'Pxm;YӀ.9\+HR 169z$P.J͇P:/ Yk=4qp0w @CWUpՐ0q`hoԧ< iN TA(p}x):(DLĠMj9K48ܖoa@{GImO l5 unK+/] ;G HW} (*H q(& &$FFu&"1F_sqc:@,$kh/2c̆4u37ʠ&b ~Nf|kŞ/E}i҃e&u3_3Iv-;E0#6yyuuc"" Յq4> Ϛ%vIENDB`ColorCode-0.8.7/src/img/history_tab.png0000644000175000017500000000414112610736534016452 0ustar dirkdirkPNG  IHDR w}YsRGBIDATH $_P? a%aP 51% ai&c&if|m;%&cP'j2 P%bBN'_2   whaKPPԷH=P Y8vga3CJ.%P? $wgap)>A)?  ?6yqGjy ???dJ  9R2p  @]8ǭ`9;   PRִ    [a      xa C Ǽ0'&# 77zY #P31XT-$a P? )Fh5#IENDB`ColorCode-0.8.7/src/img/GNU-icon.png0000644000175000017500000001412412610736534015504 0ustar dirkdirkPNG  IHDR@?PbKGDtIME  )"IDAThZwXW M`(QQ;&D@E̪# JuQ5D]5PQƬ-X %qA"2H20P$}sO{{9^ڀ%%% 0P^GGD__NVվ@Anbwؑoyu|Z6533VPYYxZJ#F1m4A~V #99r~!ۇ˗/zlڴof .))W^L:Uh׮_*"##IIIǏg mꀅ ~ĉ{bݻPTX~=йsg(J@*ԩ֬Yܤ:T*MMM]Í6nX s]# /X~* F~~>1`ŋ_hee5w֭^>\``mmz̘1wt Gmm-tqơUUU:t( pMDGG{O?|)`nn飏>y53g<`ر>B! }R {=\~cǎ >(ٹsڗ7AAA)۷yyyɁ/tO>ĩSʲ2JP =z@  //W^U\}ޗkVVnذAEvvvA$bTWWO2e %%Edȑ(..FbbÇ{bqXssLMMT*#ZR*O>155V&-?rqryS:j|y&M[n=6mZ;ۮCzz:rrrPSS'''8p`\@@1Ν$11$yY۟6mj5”+V:TPT*Ϟ=˱cǖ}&߿_˗/S:E;wϙ3D&ƆD "\NySNeaa!===̙:66A|ٻwo27XSSZ__ؠ]N<ɂFGGsȑH$ٳgI2K.}͛ӧ%N>$P(u ʦiM6qٲe.m5>000z$C~~ttt駟RVs422b׮]ʁ?^1|r9ӚN˗/_@HQXx$rKʢX,n5n… H$IݻBY_͟?%%%T*Ƞ3SRRhooO7774755˗)JsN8qIŋ+u #GJ-GDDضrJ[rM۶m6o ===O‚ 3\p%%%;vl#zLWWWdff",,=??ɨt]SWWW@8|p={@GGG_#~[~X`HhjڵD"Ammm:D"XYYa3BCC[/MΞ= ógT*TVVCCCxzzBP2;;={Lnݺ9s漶z5}$PuӧOJ\dH$̌}}}zz/J Z :%xwP__ f .H$2zqj\\\ L> @ -FW^Xx1?~@z1 dĤItRX[[7᝜+V`͚5U*hY# 0~x1c4 ŰaXPPI&%g>}4:uD{{{z{{s׮],,,ԬjM?3?E@JJJĉu׭[Y8LΛ7+ fϞC;v$oߞW^%I+ᑮV5aA?ON2'Hd .2nܸ$>zHHyASrrrWLFZR~\r%yԩFtv횦T*h";_~>>>iaaa#bq3g~-Ғx% //"̞=Pjj*I255ڵ#s& gBB;t@===XJRB! ̀LJJ<ۼy3###Y[['OLJΝ76M+XPPm۶166Vc&''kf̙C,..inC"H$$ɂ^Q=p ͦpȑ_xQ$O?>kZ钓@`pp0wA2e /QQQr2DoΝyi1223gXŋL<7ryԩF֭[5cƌɓ'rԨQ,**Js瘐UVQ*$/]IJF k6_/_&IfeeQP7n*5j.[B299~ݺuZ͞=ŌŅ[l!InذAhѢF˥[zff&e29BXL@,~Y|/waZZZ<22uuuvUU]\\ˣGrn SSS( ?~IIIkщ@!!!ضLEEN:}}}{V^pttD=0tP|} _"77UjR>}%I[ÇBBBtrr9yd^pMoʕ+\xqtuuu<}tt'N3gfʹnΝc^ddÇnm+عsEDDDpk_^[=cccDV9rdՖ-[ͅẺ:~'?6>_~}ڽ9:t]tA&oٳg֭[ã]ں/\pRK<VUUe]zz:mۆD뷕=ِdZ,7n0d۷(aAAv˖-z{@ߖdGG쐐odddnܸ޽{R{m@^^-[sss(**Bhh(DƔ)S zȑ#5t$GE0U*JRݵk3[lhB"toLKKk3h@uu5׮]ϷH\G.\k78@MmrIٳׯo3})tڵ6Zk3ڜ 5&9񥲲63ݻwVD___T>>&L0sym!r(--Emm-p=tر-%QQQ].L}7-N{BG2,,NNNXXX\\\<==J$d+-:K,--պ\YYdΘ1FݻyqZXXpɒ%!=o8&]|y=z(yٓ6mj8p@D"yw/t9w]XTTıcjN###)Zu-[8o޼o^F=ehR{U߾}^^^01iSz<==?7w>OhqBLLL1cHֶL6{&(ɘn[XDwL(͛ 673fg}ơCUyI$;;ꀀMNNNҒw!I:t=z\|?[oo&E%K>4C:j#j# {<2Y![!93 33MH::92  >>D?NJFF VVWTe`b^`]caha/*0,2-2.sqmmvu鍉cA!4tRNS222HHHHHHIIIJKOPQRnbIDATE("vwwbbwϡt 6 #όЧ_>rMͅfD|y&ΓȘؠ?lq?tl7"4aVjcdzVVM}YxlcC@F8,\Ckzl?IENDB`ColorCode-0.8.7/src/img/GNU-icon32.png0000644000175000017500000000426412610736534015655 0ustar dirkdirkPNG  IHDR szzsRGBtIME!6/E$[IDATXõV{LW=Ye@|FlZV(v"ٶ)3UAvKQF_AdA0026BQcca~gq&@%=$|~wA`_FLH$v&777caaavvv6۶mRHRUVA|񏅅E?ZUU#X 3f >>:N9sE__͛7޻woۛH.^X>k֬ z/_s >>>HNNTRRr l@&mߚ5kXRR"hZΝ;:W__8yԩwvv7&OIIA{{=//E{Lv&i~EEJ%.^acccVTYXb_4 cccEAzꋖoSa…{׭['buu5.] 6d } w^v-rcJJ+W\~ ix,--98֭[!J] zqqqQRRO>>LKKcNNSSSy}&ljj… NT*ܻwoF*++qܹ.HA-^psٜv+??i˗DDȠNSjxq'Odnnncyyy>g}_tww'nڴIꢯ/H($5 O

{J|i4YRRBQYWWGcbḇcǒ$W\yYYYϟF%ɐYL&^~^"IFdAA %&& V߀kL{{{*999c|$Μ9pr"dKKeºVT({.fvR_lyS@@7^{-..>Ri`˗/Ŝn޼-22p-{Rɓ'OoYWWǚIR1""#ʕ+199ӧO1{O__ˍwvvc8&$$p߾}Cȉȶ6OFD`7~H @ )|G喊,`yy9 U>|h]f~jeW#T*kk2vN<,l,YӛFC$OOoK" Tn݊CٺkǍ Aga̘10^۷o[چ݃7~~~ׇ7UmǿkfpP}vظ:u(11ø!7n[8j(aʔ):Nׁr""":(r``TLJJ͛ QŁ & EF\`AHivy (γ?twwA@nn.>iӦ㏄l~KP| w ׮]T*q,w!`0kjkkӳLףX\\KoXXسP%>?8rqq@??#!D/_dg4_ОU5ngIENDB`ColorCode-0.8.7/src/img/edit-copy.png0000644000175000017500000000074512610736534016026 0ustar dirkdirkPNG  IHDRasRGBbKGD pHYsu85tIME#;bgeIDATxڕJ@g7^<VTJ%w:l蚐||owV|FpXH~!CMW71`5U7 A)8٦s&q  - v9Nȩ5+/FHl61sH VV^# =y" 1L{U3gHS`@l6`> hBD( :z=u]Qݬv+7ggZ?&ߐo$ fY /_ TJa8Q)hȀ4M1sj'w&65*%~.W8}/}>45 "[hf +0h q{+}IENDB`ColorCode-0.8.7/src/img/document-save.png0000644000175000017500000000106312610736534016675 0ustar dirkdirkPNG  IHDRasBIT|d pHYs:tEXtSoftwarewww.inkscape.org<IDATxڥ?H@_t:UAЭE$ M謸Ag7BRA5x_"B }|=\0VICRU Pܧ'EhZTi%&RXX\'( Aۛ+T*Du]h1 .^)B#H.^ݮ+Ӵ>LB=rY' W>3Gkӛ62d&VtIrpA=F"D4h:Lja|:$_t:ڃiA*˸8;e[8( +59G>!y$qc0Ma@uѓ$ުH42mJ 0mf[@|5 VA^Q<@R 4 PO\IENDB`ColorCode-0.8.7/src/img/same_color_1.png0000644000175000017500000000115212610736534016465 0ustar dirkdirkPNG  IHDRatEXtSoftwareAdobe ImageReadyqe< IDATxk`ǿI$ֵnv0uT(X=h*xҫ2tGAD <=8l9n-mƤM;x|/NfG0K֨fC;.REVg+Vkz:t|*j8}~<'UM~]Ĭ1mVzj_ ж uοtĉm@eec 6YZ6TyZmͿ:h^`Z$V#4u"A:7̚敿9lj@x\2:fvaT2yE*o,EҫɀBր8>>}=7O ;1ցpgBWX//O:co^&Kf64a)35 N(-%M~ǁt﫚-#bZ?EԄzȸ|As*`lj,BIENDB`ColorCode-0.8.7/src/img/document-new.png0000644000175000017500000000110312610736534016523 0ustar dirkdirkPNG  IHDRasBIT|d pHYs:tEXtSoftwarewww.inkscape.org<IDATxڍkSQsrAR*9݌uS?h%ԂC j=BM%͇p_?q}.+\,e/gr@I0ƞAkmJvxiMΥ%6NO>W AMcX R)o@{Nˋe#5B vYg c #6D6E71", ", c #4D4D53", "' c #656155", ") c #746E5D", "! c #7C776D", "~ c #737478", "{ c #6D6E74", "] c #4A4542", "^ c #1E4C60", "/ c #27ACDC", "( c #20BDF8", "_ c #1AB6F9", ": c #17A8F4", "< c #1B97EA", "[ c #338BD0", "} c #768897", "| c #8D8A88", "1 c #9A9A9A", "2 c #999999", "3 c #848484", "4 c #2E2D2F", "5 c #9C954A", "6 c #F5EA6B", "7 c #FFF467", "8 c #FFF15D", "9 c #FDE855", "0 c #F2D954", "a c #C8B567", "b c #838182", "c c #322C2A", "d c #23A1C1", "e c #28DEFF", "f c #25CCF8", "g c #22C2F5", "h c #20B7F2", "i c #1EACEF", "j c #1C9FEB", "k c #1992E7", "l c #1183E7", "m c #568ABA", "n c #94918D", "o c #A0A0A0", "p c #838383", "q c #363520", "r c #F9F67F", "s c #FEFA80", "t c #FBF474", "u c #FAF06C", "v c #F8EB62", "w c #F8E65B", "x c #F6E053", "y c #F7DB4A", "z c #F1D148", "A c #9B9584", "B c #4A4441", "C c #23A0C1", "D c #29DEFE", "E c #27D5FB", "F c #26CEF8", "G c #23C4F6", "H c #21B9F3", "I c #1EAFF0", "J c #1CA3EC", "K c #1A96E9", "L c #1789E4", "M c #0F77E2", "N c #5E89B5", "O c #9D9C9B", "P c #A5A5A5", "Q c #A2A2A1", "R c #2E2C21", "S c #FFFF88", "T c #FDFA85", "U c #FDF87E", "V c #FCF476", "W c #FAF16D", "X c #F9ED65", "Y c #F8E75E", "Z c #F7E156", "` c #F5DC4E", " . c #F4D547", ".. c #F3CE3F", "+. c #8E8C83", "@. c #737272", "#. c #1E4C61", "$. c #26D1F9", "%. c #25CBF8", "&. c #22C3F5", "*. c #1FAFF0", "=. c #1A98E9", "-. c #188BE6", ";. c #177EE1", ">. c #0D6CDE", ",. c #8C949A", "'. c #ADADAD", "). c #505158", "!. c #CCC764", "~. c #FDFA81", "{. c #FDF980", "]. c #FCF77A", "^. c #F9ED64", "/. c #F9E85E", "(. c #F7E257", "_. c #F5DD50", ":. c #F4D649", "<. c #F3CF40", "[. c #E0C055", "}. c #72757E", "|. c #564E49", "1. c #26ACDB", "2. c #26CDF8", "3. c #24C6F7", "4. c #22BFF5", "5. c #20B7F3", "6. c #1EADF0", "7. c #1CA2ED", "8. c #1A97E9", "9. c #167EE1", "0. c #146FDD", "a. c #517FBA", "b. c #AAA9A8", "c. c #AEAEAE", "d. c #4F4C3C", "e. c #FFFF78", "f. c #FCF678", "g. c #FBF36F", "h. c #FAEF6B", "i. c #F9EB63", "j. c #F6E256", "k. c #F6DC4F", "l. c #F4D749", "m. c #F2CF42", "n. c #F4C831", "o. c #948F82", "p. c #52565B", "q. c #20BCF8", "r. c #22BEF5", "s. c #21BAF3", "t. c #1FB2F1", "u. c #1EA8EE", "v. c #1BA0EB", "w. c #1A95E8", "x. c #1788E4", "y. c #157CE1", "z. c #1570DC", "A. c #256FCF", "B. c #ABA8A3", "C. c #9B9B9C", "D. c #978F51", "E. c #FDF26C", "F. c #FAF270", "G. c #FBF270", "H. c #FBF16D", "I. c #FAF06B", "J. c #F9E960", "K. c #F8E55A", "L. c #F6E054", "M. c #F3CE40", "N. c #F3C838", "O. c #B4A06A", "P. c #53606B", "Q. c #1AB7F9", "R. c #1FB1F1", "S. c #1EACF0", "T. c #1DA3ED", "U. c #1A9AEA", "V. c #1990E7", "W. c #1786E4", "X. c #1678DF", "Y. c #146EDC", "Z. c #1161D4", "`. c #B2AEA7", " + c #8F8F91", ".+ c #B3A95C", "++ c #F9EC64", "@+ c #F9EE67", "#+ c #FAEF69", "$+ c #FAEE67", "%+ c #F9EC65", "&+ c #F9EB61", "*+ c #F8E65C", "=+ c #F7E357", "-+ c #F6DE51", ";+ c #F5DA4C", ">+ c #F4D446", ",+ c #F2CD40", "'+ c #F1C639", ")+ c #C8AD60", "!+ c #626E78", "~+ c #1FADF0", "{+ c #1EA9EE", "]+ c #1B9CEB", "^+ c #1A93E8", "/+ c #188BE5", "(+ c #167FE2", "_+ c #1575DE", ":+ c #136ADB", "<+ c #125FD1", "[+ c #B5B0AA", "}+ c #9C9C9D", "|+ c #B7AC61", "1+ c #F9E75C", "2+ c #F8E95F", "3+ c #F9E95F", "4+ c #F8E85F", "5+ c #F7DF52", "6+ c #F5DB4D", "7+ c #F3D143", "8+ c #F2CB3D", "9+ c #F1C537", "0+ c #C0A65E", "a+ c #1783E3", "b+ c #167AE0", "c+ c #146FDC", "d+ c #1265D9", "e+ c #2D6BC5", "f+ c #B9B6B2", "g+ c #B2B2B2", "h+ c #A89B6A", "i+ c #F9E353", "j+ c #F7E457", "k+ c #F7E459", "l+ c #F7E458", "m+ c #F7E254", "n+ c #F6DF52", "o+ c #F4D849", "p+ c #F4D345", "q+ c #F2CE40", "r+ c #F1C73A", "s+ c #F3C231", "t+ c #A9996C", "u+ c #857F7B", "v+ c #338CD0", "w+ c #1991E8", "x+ c #1A94E8", "y+ c #1782E3", "z+ c #167CE1", "A+ c #1573DD", "B+ c #0F5ED8", "C+ c #5B7CAD", "D+ c #C7C7C7", "E+ c #C8C8C8", "F+ c #8C8A84", "G+ c #FADE4A", "H+ c #F6DE50", "I+ c #F6DF51", "J+ c #F6DE52", "K+ c #F6DD4F", "L+ c #F5D849", "M+ c #F3D346", "N+ c #F3D041", "O+ c #F2CA3D", "P+ c #F1C538", "Q+ c #EFBB2D", "R+ c #8D8C89", "S+ c #8C8C8D", "T+ c #758796", "U+ c #1182E7", "V+ c #136ADA", "W+ c #1263D8", "X+ c #1158CC", "Y+ c #B2B1AE", "Z+ c #C9C9C9", "`+ c #A5A7AB", " @ c #CEB865", ".@ c #F5D846", "+@ c #F5D94B", "@@ c #F4D84A", "#@ c #F3D447", "$@ c #F3D244", "%@ c #F3CE41", "&@ c #F1C638", "*@ c #F1C133", "=@ c #C1A457", "-@ c #8B8B8D", ";@ c #5689BB", ">@ c #0F78E2", ",@ c #1574DE", "'@ c #0753D3", ")@ c #8493A8", "!@ c #CBCBCB", "~@ c #CACACA", "{@ c #989899", "]@ c #EAC84D", "^@ c #F3D142", "/@ c #F3D243", "(@ c #F3D042", "_@ c #F2CF41", ":@ c #F2CC3F", "<@ c #F2C93B", "[@ c #F1C539", "}@ c #F1C234", "|@ c #DCB13D", "1@ c #8E8E91", "2@ c #95918D", "3@ c #1365D9", "4@ c #1058CB", "5@ c #8493A7", "6@ c #CCCCCC", "7@ c #9C9B9B", "8@ c #DEBF55", "9@ c #F5CB36", "0@ c #F1C83B", "a@ c #F0C338", "b@ c #F2BE2C", "c@ c #D1AB49", "d@ c #949393", "e@ c #9D9C9A", "f@ c #527FBA", "g@ c #1161D5", "h@ c #1260D1", "i@ c #2D6AC4", "j@ c #5B7BAC", "k@ c #B3B1AE", "l@ c #CDCDCD", "m@ c #CECECE", "n@ c #CCCCCB", "o@ c #AAABB0", "p@ c #AFA382", "q@ c #D5B65B", "r@ c #E9BE3E", "s@ c #EEBF33", "t@ c #E6BB3B", "u@ c #CFAD54", "v@ c #A79B7E", "w@ c #9A9CA0", "x@ c #B3AEA7", "y@ c #B5B0AB", "z@ c #B8B6B2", "A@ c #B1B2B5", "B@ c #A9ABB2", "C@ c #A6A9B1", "D@ c #A3A5AB", "E@ c #A8A9AB", "F@ c #9B9C9C", "G@ c #8F9191", "H@ c #9C9E9E", "I@ c #C8C7C7", "J@ c #B4B4B4", "K@ c #8F8F8F", "L@ c #ABABAB", "M@ c #A2A1A1", "N@ c #515B5C", "O@ c #4B3836", "P@ c #8D362D", "Q@ c #A63A30", "R@ c #A83F38", "S@ c #985652", "T@ c #898080", "U@ c #A7ACAC", "V@ c #9F9F9F", "W@ c #484848", "X@ c #595959", "Y@ c #A3A3A3", "Z@ c #9C9C9C", "`@ c #818181", " # c #7B7B7B", ".# c #9B9B9B", "+# c #838484", "@# c #2D201E", "## c #C6260C", "$# c #FC2303", "%# c #F02007", "&# c #E8200B", "*# c #E21D0D", "=# c #DD170C", "-# c #D5150E", ";# c #B24544", "># c #979999", ",# c #616161", "'# c #4D4D4D", ")# c #D7D7D7", "!# c #F5F5F5", "~# c #EFEFEF", "{# c #EDEDED", "]# c #EBEBEB", "^# c #EAEAEA", "/# c #D6D6D6", "(# c #959595", "_# c #888888", ":# c #351612", "<# c #FF2A02", "[# c #F92703", "}# c #F52605", "|# c #F02208", "1# c #EA200A", "2# c #E41F0C", "3# c #DD1C0F", "4# c #D61A11", "5# c #CD1412", "6# c #BF2526", "7# c #9C9999", "8# c #626262", "9# c #717171", "0# c #F3F3EF", "a# c #F6F6EF", "b# c #F6F6F0", "c# c #F3F3F0", "d# c #F0F0EF", "e# c #E9E9E9", "f# c #E3E3E3", "g# c #868686", "h# c #909090", "i# c #2C2F30", "j# c #F62904", "k# c #FA2902", "l# c #F82704", "m# c #F52506", "n# c #F12308", "o# c #EA210A", "p# c #E51F0D", "q# c #DE1C0E", "r# c #D81A10", "s# c #CF1714", "t# c #C71415", "u# c #B53439", "v# c #ABB2B2", "w# c #4E4E4E", "x# c #F5F5F0", "y# c #F9F9F2", "z# c #F9F9F5", "A# c #F9F9F4", "B# c #F8F8F2", "C# c #F7F7F0", "D# c #F1F1F0", "E# c #E8E8E8", "F# c #E1E1E1", "G# c #8C8C8C", "H# c #6D7272", "I# c #932112", "J# c #F92603", "K# c #F72605", "L# c #F22406", "M# c #EF2209", "N# c #E41E0D", "O# c #DE1C0F", "P# c #D01814", "Q# c #C71615", "R# c #BF0C10", "S# c #A07679", "T# c #F2F2EF", "U# c #FCFCF9", "V# c #FDFDFB", "W# c #FAFAF6", "X# c #F4F4EF", "Y# c #EEEEEF", "Z# c #E4E4E4", "`# c #D3D3D3", " $ c #4E5556", ".$ c #E7250C", "+$ c #F22407", "@$ c #F22506", "#$ c #F02307", "$$ c #EC2109", "%$ c #E9200B", "&$ c #D81A11", "*$ c #BF1518", "=$ c #AC4046", "-$ c #B2B5B5", ";$ c #B5B5B5", ">$ c #FDFDFD", ",$ c #FBFBF6", "'$ c #F8F8F0", ")$ c #F0F0F0", "!$ c #E0E0E0", "~$ c #615150", "{$ c #F01E08", "]$ c #EC2209", "^$ c #EE2309", "/$ c #EE2208", "($ c #EC210A", "_$ c #E61E0C", ":$ c #E11E0D", "<$ c #DC1B10", "[$ c #D61911", "}$ c #CE1715", "|$ c #C61516", "1$ c #BE1419", "2$ c #B11A23", "3$ c #ACB3B3", "4$ c #FCFCF8", "5$ c #FAFAF5", "6$ c #F2F2F0", "7$ c #A8A8A8", "8$ c #6D5856", "9$ c #EC1806", "0$ c #E71F0B", "a$ c #E7200B", "b$ c #E51E0D", "c$ c #D21912", "d$ c #CA1615", "e$ c #C41616", "f$ c #BB1419", "g$ c #B00F19", "h$ c #A9B3B2", "i$ c #F9F9F3", "j$ c #DFDFDF", "k$ c #B1B1B1", "l$ c #766866", "m$ c #E2170A", "n$ c #E11E0E", "o$ c #E31E0D", "p$ c #E21E0D", "q$ c #E01D0E", "r$ c #D91A10", "s$ c #D41912", "t$ c #CD1814", "u$ c #C11517", "v$ c #B8131A", "w$ c #AC1824", "x$ c #A6AEAD", "y$ c #F8F8F1", "z$ c #F7F7EF", "A$ c #A4A4A4", "B$ c #74797A", "C$ c #D12019", "D$ c #D91B11", "E$ c #DB1B0F", "F$ c #DC1B0F", "G$ c #D71A11", "H$ c #D31912", "I$ c #CE1714", "J$ c #C91615", "K$ c #C31517", "L$ c #BB1418", "M$ c #B4121B", "N$ c #A33D46", "O$ c #A9ACAB", "P$ c #828282", "Q$ c #F4F4F0", "R$ c #DEDEDE", "S$ c #8D8D8D", "T$ c #6F7777", "U$ c #AF4A48", "V$ c #D21610", "W$ c #D51911", "X$ c #D51912", "Y$ c #D11813", "Z$ c #CC1815", "`$ c #BE1418", " % c #B7131A", ".% c #AE0914", "+% c #977478", "@% c #F1F1EF", "#% c #EEEEEE", "$% c #737373", "%% c #828181", "&% c #C71A1A", "*% c #CA1715", "=% c #CB1615", "-% c #BD1418", ";% c #B1101B", ">% c #A12F3A", ",% c #9DA1A1", "'% c #949494", ")% c #E2E2E2", "!% c #DCDCDC", "~% c #937C7C", "{% c #C21416", "]% c #C41515", "^% c #BA1319", "/% c #B6131A", "(% c #B10F19", "_% c #A3202C", ":% c #939293", "<% c #898989", "[% c #A2A2A2", "}% c #8A7F80", "|% c #B6353A", "1% c #BA0A10", "2% c #B91016", "3% c #B91319", "4% c #B6121A", "5% c #B30C16", "6% c #AB0915", "7% c #9B434C", "8% c #CFCFCF", "9% c #758180", "0% c #8E7D7E", "a% c #9B595E", "b% c #A44D53", "c% c #9E4C52", "d% c #945E64", "e% c #8B8889", "f% c #8B8E8D", " . + @ # $ % & * = = - - - - = = ; > , ' ) ! ~ { ", " ] ^ / ( _ : < [ } | 1 2 2 2 2 1 3 4 5 6 7 8 9 0 a b ", " c d e f g h i j k l m n o o o o p q r s t u v w x y z A ", " B C D E F G H I J K L M N O P P Q R S T U V W X Y Z ` ...+. ", "@.#.e E $.%.&.H *.J =.-.;.>.,.'.'.).!.~.{.].t W ^./.(._.:.<.[.}.", "|.1.f 2.%.3.4.5.6.7.8.-.9.0.a.b.c.d.e.f.f.t g.h.i.Y j.k.l.m.n.o.", "p.q.g G &.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.X J.K.L.` .M.N.O.", "P.Q.h H H 5.R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+", "!+: i I *.~+{+T.]+^+/+(+_+:+<+[+}+|+1+2+J.3+4+w =+5+6+l.7+8+9+0+", "% < j J J 7.v.U.^+-.a+b+c+d+e+f+g+h+i+j+k+l+j+m+n+` o+p+q+r+s+t+", "u+v+w+K =.8.x+V./+y+z+A+:+B+C+D+E+F+G+H+I+n+J+K+6+L+M+N+O+P+Q+R+", "S+T+U+L -.-.x.W.(+b+A+V+W+X+Y+Z+Z+`+ @.@o++@@@l.#@$@%@8+&@*@=@-@", "= | ;@>@9.9.y.X.,@c+:+W+'@)@!@~@~@!@{@]@^@/@$@(@_@:@<@[@}@|@1@= ", "= 1 2@N >.0.z.Y.V+3@B+4@5@Z+!@6@6@!@Z+7@8@9@8+O+0@'+a@b@c@d@1 = ", "- 2 o e@,.f@A.g@h@i@j@k@!@!@l@m@m@l@!@n@o@p@q@r@s@t@u@v@w@o 2 - ", "- 2 o P '.b.B.x@y@z@D+Z+~@6@m@m@m@m@6@~@Z+D+A@B@C@D@E@'.P o 2 - ", "- 2 o P '.c.F@G@H@g+I@Z+~@6@m@m@m@m@6@~@Z+Z+J@2 K@1 L@'.P o 2 - ", "- 2 o M@N@O@P@Q@R@S@T@U@6@!@l@m@m@l@!@6@V@W@X@K@Y@Z@`@ #.#o 2 - ", "= 1 +#@###$#%#&#*#=#-#;#>#Z+!@6@6@!@6@,#'#)#!#~#{#]#^#/#(#_#1 = ", "= p :#<#[#}#|#1#2#3#4#5#6#7#!@~@~@6@8#9#!#0#a#b#a#c#d#e#f#L@g#= ", "h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#Z+Z+o w#!#x#y#z#A#B#C#c#D#E#F#1 G#", "H#I#J#K#m#L#M#o#N#O#r#P#Q#R#S#D+Z+W@)#T#y#U#V#U#W#y#C#X#Y#Z#`#`@", " $.$+$@$L##$$$%$N#3#&$s#Q#*$=$-$;$X@!#a#z#V#>$U#,$A#'$x#)$E#!$= ", "~${$]$^$/$($%$_$:$<$[$}$|$1$2$3$2 K@~#b#A#U#U#4$5$A#C#x#6$^#!$7$", "8$9$0$%$%$a$b$*#3#r#c$d$e$f$g$h$K@Y@{#a#B#W#,$5$5$i$C#x#D#^#j$k$", "l$m$n$o$o$p$q$3#r$s$t$Q#u$v$w$x$1 Z@]#c#C#y#A#A#i$y$z$0#)$E#j$A$", "B$C$D$E$E$F$r$G$H$I$J$K$L$M$N$O$L@P$^#d#Q$C#'$C#C#z$c#6${#Z#R$S$", "T$U$V$s$W$X$H$Y$Z$J$e$`$ %.%+%'.'. #/#e#@%Q$x#x#x#c#D##%E#j$l@$%", " %%&%*%Z$Z$=%J$|$K$-%v$;%>%,%P P .#'%f#E##%)$6$D#d#{#E#)%!%h# ", " ~%{%]%e$e$u$*$^%/%(%_%:%o o o o <%L@F#Z#E#^#^#E#Z#j$!%[% ", " }%|%1%2%3%4%5%6%7%G@1 2 2 2 2 1 g#1 `#!$!$j$j$R$8%K@ ", " 9%0%a%b%c%d%e%f%= = - - - - = = * `@= 7$k$P S$. "}; ColorCode-0.8.7/src/img/GNU-icon64.png0000644000175000017500000001370512610736534015662 0ustar dirkdirkPNG  IHDR@@iqsRGBtIME!@%OlIDATxzwXW=Ta(QQ;&D@E̪#."Ķ(APQ Ƭ-X %qA"2H20?"}]s]99sshBCCǖ(BA}}}Z=zݱcG"~c̛7#jI}MMdTF??pTpԨQO.0`j5`ee@.?@ }pҥ\kkkM6xۂZ~ݧOM;tPkڥR)233|Q@ J X`_M4OPPrssqT*_ڵ+J% JQ__{{{tk֬A|||}^^^rNv*ʁccc .4ظqc !79uᅦJjjjPPPh 4pYXXnݺu^|,--Ѐ3gΝ;.]`CnBTWWc(,,č73ɓs}755G4xYfu4hv؁B:tۇ HR 2&&&xp5?"88x@@dΝk[)۷kͅ7uO>ɓ'rJP---u ^zA  ??W\Q^HJJrym$!PVV{!??RfffѥKA&֭[ [) 88حĉq5233cĨ뷯w .,quuuꌍmll}||*')Xp_촵uI6ԩM33={933ӶCWW6((СC˗/8www(LLLflܸfHTZYYɒ5hllhÜ2eJg}6c:tH;,,l\\Dѡkѱ"88HgI.]"QHN%!<<| T$iccC2dI'bF#(1uT@jjѣQRRrx u555ظJ2P*Rxcccod2Ç/cMMM;uUV@ճgϲHnںuiӦUޣoݺ2`ddd 77pttDRR!|}}$&&$Ϝ9YӧSV3<<\bŊ"B//\J3gp񥁁?I...%kߥKԞi]3;wΝ;T&ʊHo "{\NqFӦMcQQbw"ܹsW64N_o߾6l͛ׯuޱ w:q ѣGƆ"gΜ!Id2,]W;#}O<5pƌ$IBA/hlzzFܴi-[^ׯ_@<OKK~)j5CBBh``ݻŅL&}Cr<~esZ|$D"͎ ŋe$)5ZСT^,X0W"(Hr޽ /$$T*̤SSSikkKWWW5766K(Jue<?~\ĉ$ŋWiuCCC= ###(PYYmʕ[nrym6l޼:::ӧ8>>_6F]]]Mee%gϞB----F‘#GjٳgTC߿|֭+̟?$_eijH$kF___H 9rfXX[[rљ3g~utqT*Сb1 q[srrٳ͛;w+ ߧO<{LܿTVV$! [OORŷ$I'Coo_B_::@jZJ011s;_~%,--M,X0%"ѣGiqqq+++1c (@kkk3VVVA>}xb|P3lhhh1ehh(_ rd2j5sʕɓ'%&&իgRExQJq֬Yݼy477'^xQãs9FLKK>PWWcǎe^^]FWWWX, /((`BB;uDXJEGwww B5111|wyyfFFF?Ϟ=˿/kӓ+V۶mcllѣGLIINΝ;$YRRӧ߂D"'HH\zuDBYT=Z .5裏xUgt)))LHH IVVV288;v IN:&&&Y[[˨&}r9 o׮]y)322fҴDŋL2qelmm(~~~--+WtjD"rP(8vמJ.BCCm[CJL|SNU 2ÇH$>|XT*JuOoٲ%⍷D"dkkR3vXxИH#Gplt`LL wtvv+6mZӓc&k׶8;wP,HZƭ6lә٤-##AAAiuh"ב6`֬Ysrr}|| GEHHJoo333GG[`sssL2GTT\\\gĀyf\rW^mz[_0̙35Ç9b+Guk޽i}}}ҙLLLdeee7n`QQR)H??f\.o1bLNNٳ:m5xvvvJJӧ ٍB0ڬ;b;q> ann(TVVg-!==FFF޺z칧X1cƌ%*2<<< ZMVYD[äIgϞرc(--E޽VVV}6Ǝ*#!!N,OBү_?pڵ  o͔ E҃.Сlll\`lQZZ?Eoii# kkkeffOU+ws֏?hj3fhV k9f̘;HrHfXXX߿Y]%HR|1ݮӧb Ι3"gYؿuPP7D}[j}o0jԨ2† pCWW 2dlll QSS,N2.**'/!oVOzGkuƶ &d !ޠo5 YYYJg[Ͽ^P A"@Z r=qD###̝;CYY```wsioڲ%QQQ/L}mn{B#G0<<bqr``^Db %%rms$ɲ+UUULII̙39f޽ǎ,Y1zt{HLLٻwonڴqJD{V/tiwsHd*`˖-7obZoOehwUJ?,Y?Xi/.qKJ;n8)Z[[כ}Ve2X[[˸8zxxb%QP7o.zx$|`̙8|p<=Y7$M&GGGhnn۷o$<^zi.>lO-Ydɒ9RARйs"heӧOQ\\+V@,#?BRAV _|&ssoh-j wޡKz 4,,l' W.֭gU nj# ~jSVVY;wXrŋG~jhhH333U*GGl###ͥٳgʕ+o=^្_~6 BРA{JJJƗ[v;޸qE=wLcpIENDB`ColorCode-0.8.7/src/img/games-highscores.png0000644000175000017500000000325012610736534017353 0ustar dirkdirkPNG  IHDROc#" pHYs7\7\Ǥ vpAg\ƭbKGD XIDATxSUyk* ^Lڜ] sm-ҬevLlˑ-]䠵[k(h(7A>s`߿fΙs#I8 f@bBC(@ :HLvtЏ$]C@0] {+9AE55bn'Bf _+RY  -Wfɵ^#K: }4RZ  1w9 x&1\Ͼ kzXM>U#RĦOǏW3nc`k¥{r\G{Iw3ږtjJhjLF5LgC,  eMy6O2A_?8$o(MyͣDǷ1#:8WcA_]$d >S)&?5c;,- )Hggto/f, ɘad#q_OX2*j힦"Z`s*sw q~A1if^$=h(ʍ 4wOT`j=+b H7fs;`3b}g|ܙ|[Kj{դXN4Jv$?Me'PLOBq!'@.3O2'Y7#|_5?$*Ӳ,'~"+tm?<("<4V xY gH.RJȧtnp-́ By 8rXY*{&,Kfp)7; pj9@TOq nRE- u^FO*k-)rVGz] ڂ/UQeVc=PSk_ڙV5]5g]X\ ^AY%NH(]Uel 7o{Nu+Jfoo[BڠX|f.iF5e$s&qZ,(J BiTokJjzh=ʍ$yOA\; ]9{FK9h7KvA-[3fLVˋ~@/[4eLfQ(FRUσ]yئ&Y'#DAo6"K}Gا>I=52G+֔?r=03vXwŰ#9? 2"@t5 " Vȍ*t? j啤4gG{vR^J;O\:Yz Xsv&Ѹa ,ѢIoY4AZ5B}ۿSy_)$t"zTXtSoftwarex+//.NN,H/J6XS\IENDB`ColorCode-0.8.7/src/graphicsbtn.cpp0000644000175000017500000001172112610736534015653 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include #include "graphicsbtn.h" using namespace std; GraphicsBtn::GraphicsBtn() { mWidth = 152; setAcceptHoverEvents (true); mLabel = ""; mLabelWidth = 0; mYOffs = 0; mOpOver = 1.0; mOpOut = 1.0; InitGraphics(); SetShapes(); mFillBrush = &mFillOutBrush; mFrameBrush = &mFrameOutBrush; mFont = QFont("Arial", 12, QFont::Bold, false); mFont.setStyleHint(QFont::SansSerif); mFont.setStyleStrategy(QFont::PreferAntialias); SetEnabled(true); } void GraphicsBtn::SetEnabled(bool b) { if (b) { setCursor(Qt::PointingHandCursor); } else { setCursor(Qt::ArrowCursor); } setEnabled(b); } void GraphicsBtn::SetWidth(int w) { mWidth = w; SetShapes(); } void GraphicsBtn::SetLabel(QString str) { mLabel = str; } void GraphicsBtn::ShowBtn(bool b) { if (b) { mFillBrush = &mFillOutBrush; mFrameBrush = &mFrameOutBrush; } setVisible(b); } void GraphicsBtn::SetStatesOpacity(const qreal opOver, const qreal opOut) { mOpOver = opOver; mOpOut = opOut; setOpacity(mOpOut); } void GraphicsBtn::InvertStates() { QBrush tmp = mFillOutBrush; mFillOutBrush = mFillOverBrush; mFillOverBrush = tmp; } void GraphicsBtn::SetHoverState() { if (mFillBrush != &mFillOverBrush) { mFillBrush = &mFillOverBrush; } setOpacity(mOpOver); update(mRect); } void GraphicsBtn::SetOutState() { if (mFillBrush != &mFillOutBrush) { mFillBrush = &mFillOutBrush; } setOpacity(mOpOut); update(mRect); } void GraphicsBtn::SetPressedState() { if (mFrameBrush != &mFrameOverBrush) { mFrameBrush = &mFrameOverBrush; } mYOffs = 1; update(mRect); } void GraphicsBtn::hoverEnterEvent(QGraphicsSceneHoverEvent* e) { SetHoverState(); QGraphicsItem::hoverEnterEvent(e); } void GraphicsBtn::hoverLeaveEvent(QGraphicsSceneHoverEvent* e) { SetOutState(); QGraphicsItem::hoverLeaveEvent(e); } void GraphicsBtn::mousePressEvent(QGraphicsSceneMouseEvent* e) { if (e->button() != Qt::LeftButton) { return; } SetPressedState(); } void GraphicsBtn::mouseReleaseEvent(QGraphicsSceneMouseEvent* e) { if (e->button() != Qt::LeftButton) { return; } mFrameBrush = &mFrameOutBrush; mYOffs = 0; if ( e->pos().x() >= 0 && e->pos().x() <= boundingRect().width() && e->pos().y() >= 0 && e->pos().y() <= boundingRect().height() ) { emit BtnPressSignal(this); } update(mRect); } void GraphicsBtn::InitGraphics() { QLinearGradient fillgrad(0, 2, 0, 36); fillgrad.setColorAt(0.0, QColor("#f7f8fa")); fillgrad.setColorAt(0.5, QColor("#b9babc")); mFillOutBrush = QBrush(fillgrad); QLinearGradient fillovergrad(0, 2, 0, 36); fillovergrad.setColorAt(0.0, QColor("#f7f8fa")); fillovergrad.setColorAt(1.0, QColor("#b9babc")); mFillOverBrush = QBrush(fillovergrad); QLinearGradient framegrad(0, 0, 0, 40); framegrad.setColorAt(1.0, QColor(0, 0, 0, 0xa0)); framegrad.setColorAt(0.0, QColor(0xff, 0xff, 0xff, 0xa0)); mFrameOutBrush = QBrush(framegrad); QLinearGradient frameovergrad(0, 0, 0, 40); frameovergrad.setColorAt(0.0, QColor(0, 0, 0, 0xa0)); frameovergrad.setColorAt(1.0, QColor(0xff, 0xff, 0xff, 0xa0)); mFrameOverBrush = QBrush(frameovergrad); } void GraphicsBtn::SetShapes() { mRect = QRectF(0, 0, mWidth, 38); mRectFill = QRectF(1, 1, mWidth - 2, 36); } QRectF GraphicsBtn::boundingRect() const { const double margin = 0.5; return mRect.adjusted(-margin, -margin, 2 * margin, 2 * margin); } void GraphicsBtn::paint(QPainter *painter, const QStyleOptionGraphicsItem * , QWidget* ) { painter->setPen(Qt::NoPen); painter->setBrush(*mFrameBrush); painter->drawRoundedRect(mRect, 20, 20); painter->setBrush(*mFillBrush); painter->drawRoundedRect(mRectFill, 18, 18); if (mLabel != "") { painter->setRenderHint(QPainter::TextAntialiasing, true); painter->setPen(QPen(QColor("#303133"))); painter->setFont(mFont); painter->drawText(mRectFill.adjusted(0, mYOffs, 0, mYOffs), Qt::AlignCenter, mLabel); } } ColorCode-0.8.7/src/docs/0000755000175000017500000000000012610736534013571 5ustar dirkdirkColorCode-0.8.7/src/docs/GPL.html0000644000175000017500000011053312610736534015104 0ustar dirkdirk GNU General Public License - GNU Project - Free Software Foundation (FSF)

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

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.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 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 <http://www.gnu.org/licenses/>.

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:

    <program>  Copyright (C) <year>  <name of author>
    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 <http://www.gnu.org/licenses/>.

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 <http://www.gnu.org/philosophy/why-not-lgpl.html>.

ColorCode-0.8.7/src/gametableview.cpp0000644000175000017500000000627114524761273016173 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "highscoresmodel.h" #include "gametableview.h" GameTableView::GameTableView(QWidget *parent) : QTableView(parent) { setFocusPolicy(Qt::NoFocus); mGamesListModel = NULL; mHoverRow = -1; setMouseTracking(true); setAttribute(Qt::WA_Hover, true); setAttribute(Qt::WA_AlwaysShowToolTips, true); horizontalHeader()->setStretchLastSection(true); verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); verticalHeader()->setDefaultSectionSize(18); verticalHeader()->hide(); horizontalHeader()->setFixedHeight(18); setGridStyle(Qt::NoPen); setShowGrid(false); setSelectionBehavior(QAbstractItemView::SelectItems); setAlternatingRowColors(true); setFrameStyle(QFrame::NoFrame); setFont(QApplication::font()); horizontalHeader()->setHighlightSections(false); verticalScrollBar()->setTracking(true); connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(ScrollSliderChangedSlot(int))); connect(verticalScrollBar(), SIGNAL(sliderReleased()), this, SLOT(ScrollSliderChangedSlot())); viewport()->setMouseTracking(true); viewport()->setAttribute(Qt::WA_Hover, true); viewport()->setAttribute(Qt::WA_AlwaysShowToolTips, true); viewport()->setFocus(); } void GameTableView::SetGamesListModel(GamesListModel* glm) { mGamesListModel = glm; setModel(glm); connect(this, SIGNAL(HoverRowSignal(int)), mGamesListModel, SLOT(HoverRowSlot(int))); } void GameTableView::CloseEditorSlot(const QModelIndex &index) { if (mGamesListModel != NULL && index.isValid() && index.column() == mGamesListModel->GetColIx(HighScoresModel::COL_USERNAME)) { closeEditor(indexWidget(index), QAbstractItemDelegate::SubmitModelCache); } } void GameTableView::ScrollSliderChangedSlot(int) { SetHoverRowByY((mapFromGlobal(QCursor::pos()).y() - horizontalHeader()->height())); } void GameTableView::SetHoverRowByY(const int y) { int row = rowAt(y); if (row == mHoverRow) { return; } mHoverRow = row; emit HoverRowSignal(mHoverRow); } void GameTableView::mouseMoveEvent(QMouseEvent* e) { QTableView::mouseMoveEvent(e); SetHoverRowByY(e->y()); } void GameTableView::wheelEvent(QWheelEvent* e) { QTableView::wheelEvent(e); SetHoverRowByY(e->position().y()); } void GameTableView::leaveEvent(QEvent*) { if (mHoverRow == -1) { return; } mHoverRow = -1; emit HoverRowSignal(mHoverRow); } ColorCode-0.8.7/src/gameslistmodel.cpp0000644000175000017500000003006314526106236016356 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "gameslistmodel.h" #include "gametableview.h" const int GamesListModel::MODEL_ID_DEFAULT = 0; const int GamesListModel::MODEL_ID_PREV = 1; const int GamesListModel::MODEL_ID_SAVED = 2; const int GamesListModel::MODEL_ID_HIGH = 3; const int GamesListModel::COL_RANKING = 0; const int GamesListModel::COL_SCORE = 1; const int GamesListModel::COL_USERNAME = 2; const int GamesListModel::COL_DELETE = 3; const int GamesListModel::COL_GAMENO = 4; const int GamesListModel::COL_DATE = 5; const int GamesListModel::COL_TIME = 6; const int GamesListModel::COL_CCNT = 7; const int GamesListModel::COL_PCNT = 8; const int GamesListModel::COL_DOUBLES = 9; bool GamesListModel::SortListScore(CCGame a, CCGame b) { if (a.GetScore() > b.GetScore()) { return true; } return false; } bool GamesListModel::SortListTime(CCGame a, CCGame b) { if (a.mTime > b.mTime) { return true; } return false; } GamesListModel::GamesListModel(QObject* parent) : QAbstractTableModel(parent) { mId = MODEL_ID_DEFAULT; mEditIndex = QModelIndex(); mMaxSize = 20; mHoverRow = -1; mRowHFg = QApplication::palette().color(QPalette::Active, QPalette::ButtonText); mRowHBg = QApplication::palette().color(QPalette::Active, QPalette::Button); } int GamesListModel::GetId() { return mId; } QString GamesListModel::GetListStr() const { QStringList strl; for (int i = 0; i < mGamesList.size(); ++i) { strl << mGamesList.at(i).ToString(); } return strl.join(";"); } void GamesListModel::SetView(GameTableView* view) { mView = view; } void GamesListModel::SetMaxSize(const int max) { if (max != mMaxSize) { mMaxSize = max; LimitGamesListSize(); } } void GamesListModel::SetRowHColors(QString fg, QString bg) { mRowHFg.setNamedColor(fg); mRowHBg.setNamedColor(bg); } void GamesListModel::InsertRow(CCGame g) { mView->clearSelection(); bool found = false; for (int i = 0; i < mGamesList.size(); ++i) { if (mGamesList.at(i).mGameNo == g.mGameNo) { mGamesList.replace(i, g); found = true; break; } } if (!found) { beginInsertRows(QModelIndex(), rowCount(), rowCount()); mGamesList.push_back(g); endInsertRows(); QModelIndex mix = index(rowCount() - 1, GetColIx(COL_DELETE), QModelIndex()); mView->openPersistentEditor(mix); } DoSort(mGamesList); LimitGamesListSize(); emit layoutChanged(); } void GamesListModel::LimitGamesListSize() { if (!mGamesList.isEmpty() && mGamesList.size() > mMaxSize) { removeRows(mMaxSize, mGamesList.size() - mMaxSize); } } void GamesListModel::EditField() { if (mView != NULL && mEditIndex.isValid()) { mView->setCurrentIndex(mEditIndex); mView->selectRow(mEditIndex.row()); mView->edit(mEditIndex); } } void GamesListModel::SetEditIndex(QModelIndex ix) { mEditIndex = ix; } QModelIndex GamesListModel::GetEditIndex() const { return mEditIndex; } QString GamesListModel::GetEditValue() const { QString val = ""; const CCGame* eg; if (mEditIndex.isValid()) { eg = GetGameAt(mEditIndex.row()); val = eg->GetCCUserName(); } return val; } const CCGame* GamesListModel::GetGameAt(const int row) const { if (row > -1 && mGamesList.size() > row) { return &mGamesList.at(row); } return NULL; } void GamesListModel::ReadList(const QString &str) { mEditIndex = QModelIndex(); if (rowCount() > 0) { removeRows(0, rowCount()); } QStringList games = str.split(QString(";")); CCGame* g; QModelIndex mix; for (int i = 0; i < games.size(); ++i) { g = new CCGame(games.at(i)); if (g->IsValidGame()) { beginInsertRows(QModelIndex(), rowCount(), rowCount()); mGamesList.push_back(*g); endInsertRows(); mix = index(rowCount() - 1, GetColIx(COL_DELETE), QModelIndex()); mView->openPersistentEditor(mix); } } DoSort(mGamesList); LimitGamesListSize(); emit layoutChanged(); } void GamesListModel::HoverRowSlot(int row) { if (mHoverRow == row) { return; } int tmprow; if (row == -1) { tmprow = mHoverRow; } else { tmprow = row; } mHoverRow = row; emit dataChanged(index(tmprow, 0), index(tmprow, columnCount() - 1)); } bool GamesListModel::removeRows(int row, int count, const QModelIndex &parent) { if (row < 0 || row + count > rowCount() || count == 0) { return false; } if (mEditIndex.isValid()) { if (mEditIndex.row() >= row && mEditIndex.row() < row + count) { mEditIndex = QModelIndex(); } else if (mEditIndex.row() >= row + count) { mEditIndex = createIndex(mEditIndex.row() - count, GetColIx(COL_USERNAME)); } } beginRemoveRows(parent, row, row + count - 1); for (int i = row; i < row + count; ++i) { mGamesList.removeAt(row); } endRemoveRows(); return true; } Qt::ItemFlags GamesListModel::flags(const QModelIndex &index) const { if (index.isValid() && index == mEditIndex) { return Qt::ItemIsEnabled|Qt::ItemIsEditable; } return Qt::ItemIsEnabled; } bool GamesListModel::setData(const QModelIndex &index, const QVariant &value, int role) { if (role == Qt::EditRole && index.isValid() && index.row() < rowCount()) { if (index.column() == GetColIx(COL_USERNAME)) { if (index == mEditIndex) { CCGame g = mGamesList.at(index.row()); g.SetUserName(value.toString()); mGamesList.replace(index.row(), g); if (g.GetCCUserName() != "") { emit ValidNameCommitSignal(); } } } else if (index.column() == GetColIx(COL_DELETE)) { bool ok; int aid = value.toInt(&ok); if (ok) { if (aid == ButtonsCell::ACTIONID_DELETE) { removeRows(index.row(), 1); } else { CCGame g = mGamesList.at(index.row()); if (aid == ButtonsCell::ACTIONID_SAVE) { CCGame* gc = new CCGame(g.ToString()); emit SaveListGameSignal(gc); } else if (aid == ButtonsCell::ACTIONID_PLAY) { CCGame* gc = new CCGame(g.ToString()); emit NewGameInputSignal(gc); } else if (aid == ButtonsCell::ACTIONID_COPY) { QClipboard* cb = QApplication::clipboard(); cb->setText(QString::number(g.mGameNo)); } } } } return true; } return false; } int GamesListModel::rowCount(const QModelIndex &) const { return mGamesList.size(); } int GamesListModel::columnCount(const QModelIndex &) const { return GetMaxColCnt(); } QVariant GamesListModel::data(const QModelIndex &index, int role) const { if (!(index.row() < mGamesList.size()) || !index.isValid()) { return QVariant(); } else if (role == Qt::TextAlignmentRole) { if (index.column() == GetColIx(COL_USERNAME) || index.column() == GetColIx(COL_DATE) || index.column() == GetColIx(COL_TIME) || index.column() == GetColIx(COL_DOUBLES)) { return QVariant(Qt::AlignHCenter | Qt::AlignVCenter); } return QVariant(Qt::AlignRight | Qt::AlignVCenter); } else if (role == Qt::BackgroundRole) { if (index == mEditIndex) { return QVariant(QApplication::palette().color(QPalette::Active, QPalette::Highlight)); } else if (index.row() == mHoverRow) { return QVariant(mRowHBg); } } else if (role == Qt::ForegroundRole) { if (index == mEditIndex) { return QVariant(QApplication::palette().color(QPalette::Active, QPalette::HighlightedText)); } else if (index.row() == mHoverRow) { return QVariant(mRowHFg); } } else if (role == Qt::DisplayRole || role == Qt::EditRole) { CCGame g = mGamesList.at(index.row()); if (index.column() == GetColIx(COL_RANKING)) { return index.row() + 1; } else if (index.column() == GetColIx(COL_USERNAME)) { return g.GetCCUserName(); } else if (index.column() == GetColIx(COL_SCORE)) { return g.GetScore(); } else if (index.column() == GetColIx(COL_DATE)) { return g.GetDatePartStr(); } else if (index.column() == GetColIx(COL_TIME)) { return g.GetTimePartStr(); } else if (index.column() == GetColIx(COL_CCNT)) { return g.mColorCnt; } else if (index.column() == GetColIx(COL_PCNT)) { return g.mPegCnt; } else if (index.column() == GetColIx(COL_GAMENO)) { return g.mGameNo; } else if (index.column() == GetColIx(COL_DOUBLES)) { return (g.mDoubles == 1) ? tr("Yes") : tr("No"); } else { return QVariant(); } } return QVariant(); } QVariant GamesListModel::headerData(int section, Qt::Orientation orientation, int role) const { if (role == Qt::DisplayRole && orientation == Qt::Horizontal) { return GetHHeaderLabel(section); } else if (role == Qt::DecorationRole && orientation == Qt::Horizontal) { if (section == GetColIx(COL_DOUBLES)) { return QVariant(QIcon(":/img/same_color_header.png")); } } else if (role == Qt::ToolTipRole && orientation == Qt::Horizontal) { if (section == GetColIx(COL_DOUBLES)) { return QVariant(QString(tr("Pegs of Same Color"))); } else if (section == GetColIx(COL_DELETE)) { return QVariant(QString(tr("Actions"))); } else if (section == GetColIx(COL_RANKING)) { return QVariant(QString(tr("Rank"))); } } return QVariant(); } QString GamesListModel::GetHHeaderLabel(const int col) const { QString str; if (col == GetColIx(COL_RANKING)) { str = ""; } else if (col == GetColIx(COL_USERNAME)) { str = tr("User"); } else if (col == GetColIx(COL_SCORE)) { str = tr("Score"); } else if (col == GetColIx(COL_DATE)) { str = tr("Date"); } else if (col == GetColIx(COL_TIME)) { str = tr("Time"); } else if (col == GetColIx(COL_CCNT)) { str = tr("Colors"); } else if (col == GetColIx(COL_PCNT)) { str = tr("Slots"); } else if (col == GetColIx(COL_GAMENO)) { str = tr("Game No."); } else { str = ""; } return str; } ColorCode-0.8.7/src/gametableview.h0000644000175000017500000000276012610736534015633 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef GAMETABLEVIEW_H #define GAMETABLEVIEW_H #include class GamesListModel; class GameTableView : public QTableView { Q_OBJECT public: GamesListModel* mGamesListModel; GameTableView(QWidget * parent = 0); void SetGamesListModel(GamesListModel* glm); public slots: void CloseEditorSlot(const QModelIndex &index); signals: void HoverRowSignal(const int row); protected: void mouseMoveEvent(QMouseEvent* e); void wheelEvent(QWheelEvent* e); void leaveEvent(QEvent* e); protected slots: void ScrollSliderChangedSlot(int v = 0); private: int mHoverRow; void SetHoverRowByY(const int y); }; #endif // GAMETABLEVIEW_H ColorCode-0.8.7/src/background.cpp0000644000175000017500000001126514524757357015505 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "background.h" #include "pegfactory.h" using namespace std; BackGround::BackGround(QObject*) { setCacheMode(QGraphicsItem::DeviceCoordinateCache); setAcceptedMouseButtons(Qt::NoButton); QLinearGradient topgrad(0, 16, 0, 129); topgrad.setColorAt(0.0, QColor(0xf8, 0xf8, 0xf8)); topgrad.setColorAt(0.6, QColor(0xb8, 0xb9, 0xbb)); topgrad.setColorAt(1, QColor(0xd4, 0xd5, 0xd7)); mTopGrad = QBrush(topgrad); QLinearGradient botgrad(0, 530, 0, 557); botgrad.setColorAt(0.0, QColor("#d4d5d7")); botgrad.setColorAt(0.3, QColor("#cecfd1")); botgrad.setColorAt(1.0, QColor("#b0b1b3")); mBotGrad = QBrush(botgrad); QLinearGradient lgrad(0, 190, 320, 370); lgrad.setColorAt(0.0, QColor(0xff, 0xff, 0xff, 0xa0)); lgrad.setColorAt(0.49, QColor(0xff, 0xff, 0xff, 0xa0)); lgrad.setColorAt(0.50, QColor(0, 0, 0, 0x80)); lgrad.setColorAt(1.0, QColor(0, 0, 0, 0x80)); mFramePen = QPen(QBrush(lgrad), 1); mPend = QColor("#646568"); mPenl = QColor("#ecedef"); mGrad0 = QColor("#cccdcf"); mGrad1 = QColor("#fcfdff"); mPend.setAlpha(0x32); mPenl.setAlpha(0x50); mGrad0.setAlpha(0x32); mGrad1.setAlpha(0x32); } BackGround::~BackGround() { scene()->removeItem(this); } QRectF BackGround::boundingRect() const { const int margin = 1; return outlineRect().adjusted(-margin, -margin, +margin, +margin); } QRectF BackGround::outlineRect() const { return QRectF(0.0, 0.0, 320.0, 560.0); } void BackGround::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget* /* widget */) { int i; painter->setPen(Qt::NoPen); QRectF cr = QRectF(3, 3, 314, 554); QPainterPath cpath; cpath.addRoundedRect(cr, 10.1, 10.1); painter->setClipPath(cpath); painter->setClipping(true); painter->setBrush(mTopGrad); painter->drawRect(QRect(4, 4, 312, 125)); painter->setBrush(QBrush(QColor("#707173"))); painter->drawRect(QRect(1, 129, 318, 1)); painter->setPen(Qt::NoPen); for (i = 0; i < 10; ++i) { painter->setBrush(QBrush(QColor("#9e9fa0"))); painter->drawRect(QRect(1, i * 40 + 130, 318, 1)); QLinearGradient rowgrad(0, i * 40 + 131, 0, i * 40 + 169); rowgrad.setColorAt(0.0, QColor("#9a9b9d")); rowgrad.setColorAt(1.0, QColor("#949597")); painter->setBrush(QBrush(rowgrad)); painter->drawRect(QRect(1, i * 40 + 131, 318, 38)); painter->setBrush(QBrush(QColor("#88898b"))); painter->drawRect(QRect(1, i * 40 + 169, 318, 1)); painter->setBrush(QBrush(mPenl)); painter->drawRect(QRectF(277, i * 40 + 130, 39, 1)); painter->drawRect(QRectF(277, i * 40 + 130, 1, 39)); painter->setBrush(QBrush(mPend)); painter->drawRect(QRectF(277, i * 40 + 130 + 39, 40, 1)); painter->drawRect(QRectF(277 + 39, i * 40 + 130, 1, 40)); QRadialGradient grad(QPointF(277 + 10, i * 40 + 130 + 10), 100); grad.setColorAt(0, mGrad0); grad.setColorAt(1, mGrad1); painter->setBrush(QBrush(grad)); painter->drawRect(QRectF(277 + 1, i * 40 + 131, 38.0, 38.0)); painter->setBrush(Qt::NoBrush); QPointF x0 = QPointF(PegFactory::XPOS_BTNS_COL, i * 40 + 130 + 2); QLinearGradient lgrad(x0, QPointF(x0.x() + 36, x0.y() + 36)); lgrad.setColorAt(0.0, QColor(0, 0, 0, 0x80)); lgrad.setColorAt(1.0, QColor(0xff, 0xff, 0xff, 0xa0)); painter->setPen(QPen(QBrush(lgrad), 0.5)); painter->drawEllipse(QRectF(x0.x(), x0.y(), 36, 36)); painter->setPen(Qt::NoPen); } painter->setBrush(mBotGrad); painter->drawRect(QRect(1, 531, 318, 27)); painter->setBrush(QBrush(QColor("#eff0f2"))); painter->drawRect(QRect(1, 530, 318, 1)); painter->setClipping(false); QRectF r = QRectF(3.5, 3.5, 313, 553); painter->setBrush(Qt::NoBrush); painter->setPen(mFramePen); painter->drawRoundedRect(r, 9.8, 9.8); } ColorCode-0.8.7/src/trans_hu.ts0000644000175000017500000011045714527465645015057 0ustar dirkdirk About ColorCode ColorCode A needful game to train your brain ;-) Az agytekervények megmozgatására szolgáló játék ;-) <br><br>Free MasterMind clone including a built in,<br>rather intelligent solver. <br><br>Egy ingyenes MasterMind klón,<br> kiegészítve egy meglehetősen intelligens megoldóval. Version Verzió Author Szerző About ColorCode Névjegy: ColorCode &Author &Szerző icon ikon &License &Licensz 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. Ez a program egy szabad szoftver, amit továbbadhatsz és/vagy módosíthatsz a GNU General Public Licensz alapján, amit a Free Software Foundation adott ki; a 3. Licensz verzió szerint, vagy bármely későbbi (tetszés szerint) verzió alapján. ButtonsCell Play this Game again Save this Game as Bookmark Remove from List Copy Game Number to Clipboard ColorCode ColorCode ColorCode Done Befejez &New Game &Új játék Ctrl+N Ctrl+N &Restart Game &Játék újrakezdése Ctrl+Shift+N Ctrl+Shift+N &Throw In The Towel Játék &feladása Ctrl+G Ctrl+G E&xit &Kilép Ctrl+Q Ctrl+Q Show Toolbar Eszköztár mutatása Ctrl+T Ctrl+T Show Menubar Menüsor mutatása Ctrl+M Ctrl+M Show Statusbar Állapotsor mutatása Reset Color Order Szín sorrend nullázása Ctrl+Shift+R Ctrl+Shift+R Show Indicators Jelzők használata Ctrl+Shift+L Ctrl+Shift+L Allow Pegs of the Same Color Azonos színű ékek engedélyezése Ctrl+Shift+C Ctrl+Shift+C Disallow Pegs of the Same Color Azonos színű ékek tiltása Close Rows when the last Peg is placed Sor zárolása az utolsó ék behelyezése után Ctrl+L Ctrl+L Set Hints automatically Automatikus útmutatások Ctrl+Shift+H Ctrl+Shift+H Online &Help Online &segítség F1 F1 About &ColorCode Névejgy: &ColorCode Ctrl+A Ctrl+A About &Qt Névjegy: &Qt Ctrl+I Ctrl+I Fill Row by Random Sorok kitöltése véletlenszerűen Ctrl+R Ctrl+R Duplicate Previous Row Előző sor duplázása Ctrl+D Ctrl+D Clear Row Sor törlése Ctrl+C Ctrl+C Beginner (2 Colors, 2 Slots, Doubles) Kezdő (2 szín, 2 lyuk, duplázás) Easy (4 Colors, 3 Slots, No Doubles) Könnyű (4 szín, 3 lyuk, nincs duplázás) Classic (6 Colors, 4 Slots, Doubles) Klasszikus (6 szín, 4 lyuk, duplázás) Challenging (8 Colors, 4 Slots, Doubles) Kihívás (8 szín, 4 lyuk, duplázás) Hard (10 Colors, 5 Slots, Doubles) Nehéz (10 szín, 5 lyuk, duplázás) Computer's Guess Gép tippje Ctrl+H Ctrl+H Rate it for me Értékeld nekem Human vs Computer Ember kontra számítógép Computer vs Human Számítógép kontra ember Preferences Beállítások Ctrl+P Ctrl+P &Game &Játék &Row &Sor &Settings &Beállítások Game Mode Játék mód Level Presets Nehézség beállítása &Help &Segítség Game Játék Colors Színek Slots Lyukak Level Nehézség Message Üzenet The changed settings will only apply to new games! Do you want to give in the current and start a new Game? A megváltozott beállítások csak az új játékra lesznek érvényesek! Feladod a jelenlegi játékot, és indítasz egy újat? New Game Új játék Do you want to give in and start a new Game? Feladod, és kezdesz egy újat? Give In Felad Do you really want to give in? Tényleg feladod? About Qt Névjegy: Qt Press the Hint Field or Key Enter if You're done. Nyomd meg az útmutatás mezőt, vagy üsd le az entert ha kész vagy. Place Your pegs ... Helyezd el az ékeket... Press the button below or Key Enter if You're done. Nyomd meg a fenti gombot, vagy üsd le az entert ha végeztél. The chosen settings do not allow pegs of the same color! A megadott beállítások nem engedélyezik az azonos színeket! Place Your secret ColorCode ... Helyezd el a titkos színkombinációt... Yes Igen No Nem Pegs of Same Color Azonos színű ékek Please rate the guess. Press OK or Key Enter if You're done. Értékeld a tippet. Kattints az OK-ra, vagy üss entert ha kész vagy. Congratulation! You have won! Gratulálok! Nyertél! Sorry! You lost! Sajnálom! Vesztettél! Sure, You're too weak for me! Biztos, Túl kevés vagy hozzám! The impossible happened, sorry. A lehetetlen megtörtént, bocsi. Yeah! I guessed it, man! Fain! Kitalátam öcsém! Embarrassing! I lost a game! Lenyűgöző! Elvesztettem a játékot! Don't you like to see me winning? ;-) Nem akarsz győzni látni engem? ;-) Nope! Thats impossible! Did you gave me false hints? Neee! Ez hihetetlen! Hamis útmutatást adtál nekem? &Start particular Game Ctrl+B Ctrl+Alt+H &Recent Games Ctrl+Alt+R &Bookmarks Ctrl+Alt+B Ctrl+Shift+S Game &Lists guessed and rated ... Let me think ... Computer vs. Human Számítógép kontra ember &Highscores Ctrl+Shift+B Ctrl+Alt+N &Have a Break &Bookmark Current Game Ctrl+Shift+T Show Timer Display Game Number Allow Pegs of Same Color Azonons színű ékek engedélyezése Disallow Pegs of Same Color Ctrl+Alt+C Ctrl+Shift+P &Resume Game Human vs. Computer Ember kontra számítógép Game Number Paused &Copy Game Number GameNoDisplay Human vs. Computer Ember kontra számítógép GameTablesDialog ColorCode Games Game Properties User Color Count Slot Count Pegs of Same Color Azonos színű ékek Yes Igen Game Number Date and Time Duration Insert Game Number Play Recent Games Bookmarks Highscores Clear List Close No Nem Message Üzenet This will permanently remove all entries from the List. Do You want to proceed? Game Number Input Bookmarked Games High Score List Please provide a name! Otherwise your score won't be saved. Insert an arbitrary game number greater than 0 in the input field above. <br><br>The game properties like color count, slot count etc. will be displayed in the corresponding area above.<br><br>Click the Play button or press key Enter, to play the game. If a game is currently running, it will be aborted. Game Lists GamesListModel Yes Igen No Nem Pegs of Same Color Azonos színű ékek Actions Rank User Score Date Time Colors Színek Slots Lyukak Game No. PrefDialog ... Select from predefined level settings ... Válassz az előre meghatározott szint beállítások közül Beginner (2 Colors, 2 Slots, Doubles) Kezdő (2szín, 2 lyuk, duplázás) Easy (4 Colors, 3 Slots, No Doubles) Könnyű (4 szín, 3 lyuk, nincs duplázás) Classic (6 Colors, 4 Slots, Doubles) Klasszikus (6 szín, 4 lyuk, duplázás) Challenging (8 Colors, 4 Slots, Doubles) Kihívás (8 szín, 4 lyuk, duplázás) Hard (10 Colors, 5 Slots, Doubles) Nehéz (10 szín, 5 lyuk, duplázás) Slots Lyukak Colors Színek Human vs. Computer Ember kontra számítógép Computer vs. Human Számítógép kontra ember Low Könnyű Medium Közepes High Nehéz Preferences Beállítások Appearance Megjelenés Controls Gombok Show or hide the Menubar. Menüsor mutatása vagy elrejtése. Show Menubar Meüsor mutatása Show or hide the Toolbar. Eszköztár mutatása vagy elrejtése. Show Toolbar Eszköztár mutatása Show or hide the Statusbar. Állapotsor mutatása vagy elrejtése. Show Statusbar Állapotsor mutatása Indicators Jelzők If this option is checked, an indicator inside each peg is displayed. Ha ez az opció be van jelölve, akkor minden ékben megjelenik egy jelző. Show Indicators inside pegs Jelzők mutatása az ékeken belül Use unique letters as indicators. Egyedi betűk használata jelzőként. Letter Indicators Betű jelzők Use unique numbers as indicators. Egydi számok használata jelzőként. Number Indicators Szám jelzők Use the same neutral background color for each peg, when indicators are shown. Egyforma sima háttér használata az ékeknél, amikor a jelzők látszanak. Hide Colors Színek elrejtése Click here if you have changed the color order and now you want to revert it to it's initial state. Kattints ide ha megváltoztattad a szín sorrendet, és visszakarod állatani az eredetire. Reset Color Order Szín sorrend nullázása Game Settings Játék beállítások Level Presets Nehézségi beállítások Select from predefined combinations of the three different level related settings, the number of colors, the number of slots (columns) and the possibility of pegs of the same color in one row. Válassz az előre meghatározott nehézségi szint 3 különböző lehetősége közül, színek száma, lyukak (oszlop) száma, és az egy sorban lehetséges azonos színek száma. Number of Slots Lyukak száma Number of Colors Színek száma Number of pegs in a single row. Higher values are harder to guess. Ékek száma egy sorban. A nyagyobb értéket nehezebb eltalálni. Number of all possible colors. Higher values are harder to guess. A lehetséges színek száma. A nagyobb értéket nehezebb eltalálni. If this option is checked, the hidden combination may contain one or more (even all would be possible) pegs of the same color. If checked, the combination is generally harder to guess. Amennyiben ez a lehetőség be van kapcsolva, akkor a rejtett kombináció tartalmazhat egy vagy több (akár az összes) azonos színű éket. Ha be van kapcsolva, nehezebb megfejteni a kombinációt. Allow Pegs of Same Color Azonons színű ékek engedélyezése Game Mode Játék mód Select from the different game modes. In the 1. mode you have to to guess the hidden, computer generated combination, In the 2. mode your computer will try to guess your own secret combination. Válassz a különböző játék módok közül. Az 1. módban neked kell kitalálnod a titkos kombinációt, amit a gép kigondolt. A 2. módban a gépnek kell kitalálnia az általad megadott kombinációt. If checked, a row is closed as soon as you place the last peg and your guess is submitted immediatly. This option only affects the Human vs. Computer game mode. Ha ez be van kapcsolva, akkor a sor zárolásra kerül, amint beraktad az utolsó éket, és a tipped azonnal ki lesz értékelve. Ez az opció csak az Ember kontra számítógép módban működik. Close Rows when the last Peg is placed Sor zárolása, amint az utolsó ék is a helyére került If checked, the computer will determine the corresponding hints for the solver's guess. This option affects only Computer vs. Human games. If checked, you only have to place your secret combination. Then the rest of the game runs automatically until the end. But you can set a delay between the guesses. Ha ezt bekapcsolod, akkor a gép automatikusan kiértékeli a tippet a jelzők segítségével. Ez a lehetőség csak a Számítógép kontra ember módnál működik. Bekapcsolt állapotban, csak titkos kombinációt kell megadnod, majd a játék hátralevő részét a gép automatikusan lejátsza. De meg tudsz adni késleltetést a tippek közé. Set Hints automatically Jelzők automatikus használata Adjust the delay (in ms) between two guesses. Tippek közti késleltetés megadása. Delay in ms Késleltelés ms-ban Solver Strength Megoldási nehézség Select from 3 different strength levels for your computer opponent. This option only affects the Computer vs. Human game mode. For the computer's guess in the Human vs. Computer mode always the highest level will be used. Válassz a 3 különböző nehézség közül a gépi ellenfél számára. Ez az opció csak a Számítógép kontra ember módot befolyásolja. A gép tippjeinél az Ember kontra számítógép módban a legnehezebb nehézségi szint lesz használva. Show Game Timer Display Game Number Game Lists Maximum Row Count: Use Highscores Raise the dialog after a game has been won and prompt for the name Automatically insert Highscores using the name below Name (mandatory for the second option) User Interface Display the current game number in the footer. To avoid remembering, you can hide it here. Timer You may hide the timer to keep calm ;-) But note! Even hidden, time's running in the background. Game Properties Select One of the Level Presets: Or Set the Particular Properties: Game Flow Solver Limit the number of rows in game tables like highscores etc. Valid values range from 5 to 50. Use Customized Table Row Highlight Colors Foreground Background Highscores Provide a name with maximum 20 characters here to be used for highscore entries. If you checked the automatic option above, this name is mandatory, otherwise it will be used as proposal which you may change later in the dialog. Uncheck this if you are confused about the time as fast running ;-) Show Tenth and Hundredth RowHint Commit Your solution Kövesd a megoldásodat Click the circles to rate my guess. Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-) Kattints a körökbe, hogy kiértékeld a tippemet. Vagy nyomd le a Ctrl+H billentyűkombinációt, vagy használd az eszköztár adott gombját, hogy megtegyem ezt helyetted;-) ColorCode-0.8.7/src/rowhint.cpp0000644000175000017500000002151012610736534015036 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "rowhint.h" using namespace std; const int RowHint::mPegPos[4][5][3] = { { { 6, 14, 12 }, { 22, 14, 12 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, }, { { 6, 7, 12 }, { 22, 7, 12 }, { 14, 21, 12 }, { 0, 0, 0 }, { 0, 0, 0 }, }, { { 6, 6, 12 }, { 22, 6, 12 }, { 6, 22, 12 }, { 22, 22, 12 }, { 0, 0, 0 }, }, { { 4, 4, 12 }, { 24, 4, 12 }, { 14, 14, 12 }, { 4, 24, 12 }, { 24, 24, 12 } } }; RowHint::RowHint(QObject*) { mIx = -1; mPegCnt = 0; mPen = QPen(QColor("#808080")); mPen.setWidth(2); QRadialGradient grad(QPointF(10, 10), 100); grad.setColorAt(0, QColor("#d8d8d8")); grad.setColorAt(1, QColor("#ffffff")); mBrush1 = QBrush(grad); grad.setColorAt(0, QColor(216, 216, 216, 51)); grad.setColorAt(1, QColor(255, 255, 255, 51)); mBrush0 = QBrush(grad); Reset(0, 0); } RowHint::~RowHint() { scene()->removeItem(this); } void RowHint::Reset(const int pegcnt, const int gamemode) { mActive = true; mSolved = false; SetPegCnt(pegcnt); mHints.clear(); mHints.assign(mPegCnt, 0); SetGameMode(gamemode); SetActive(false); } int RowHint::GetIx() const { return mIx; } void RowHint::SetIx(const int ix) { mIx = ix; } void RowHint::SetPegCnt(const int pegcnt) { mPegCnt = pegcnt; } void RowHint::SetGameMode(const int gamemode) { mGameMode = gamemode; } bool RowHint::IsActive() const { return mActive; } void RowHint::SetActive(bool b) { if (b == mActive) { return; } mActive = b; setAcceptHoverEvents(b); setEnabled(b); if (b) { if (mGameMode == ColorCode::MODE_HVM) { setCursor(Qt::PointingHandCursor); setToolTip(tr("Commit Your solution")); } else if (mGameMode == ColorCode::MODE_MVH) { mSolved = true; mHints.assign(mPegCnt, 0); setCursor(Qt::ArrowCursor); setToolTip(tr("Click the circles to rate my guess.\nHit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-)")); } } else { setCursor(Qt::ArrowCursor); setToolTip(QString("")); } update(boundingRect()); } void RowHint::SetPaused(const bool b) { if (b) { setCursor(Qt::ArrowCursor); setToolTip(QString("")); } else if (mActive) { setCursor(Qt::PointingHandCursor); setToolTip(tr("Commit Your solution")); } update(boundingRect()); } std::vector RowHint::GetHints() { return mHints; } void RowHint::DrawHints(std::vector res) { mHints.clear(); mHints.assign(mPegCnt, 0); for (unsigned i = 0; i < res.size(); ++i) { mHints.at(i) = res.at(i); } mSolved = true; update(boundingRect()); } void RowHint::mousePressEvent(QGraphicsSceneMouseEvent* e) { if (ColorCode::INSTANCE->GetGameState() == ColorCode::STATE_PAUSED) { return; } if (e->button() != Qt::LeftButton) { return; } if (mGameMode == ColorCode::MODE_HVM) { bool disabled = false; if (mActive && !mSolved) { if (e->button() == Qt::LeftButton) { SetActive(false); emit HintPressedSignal(mIx); disabled = true; } } if (!disabled) { QGraphicsItem::mousePressEvent(e); } } else if (mGameMode == ColorCode::MODE_MVH) { qreal xm = e->pos().x(); qreal ym = e->pos().y(); int posix = mPegCnt - 2; for (int i = 0; i < mPegCnt; i++) { if ( xm >= mPegPos[posix][i][0] && xm <= mPegPos[posix][i][0] + mPegPos[posix][i][2] && ym >= mPegPos[posix][i][1] && ym <= mPegPos[posix][i][1] + mPegPos[posix][i][2]) { ++mHints.at(i); if (mHints.at(i) > 2) { mHints.at(i) = 0; } } } update(boundingRect()); } } QPainterPath RowHint::shape() const { QPainterPath path; path.addRect(boundingRect()); return path; } QRectF RowHint::boundingRect() const { const int margin = 1; return outlineRect().adjusted(-margin, -margin, 2 * margin, 2 * margin); } QRectF RowHint::outlineRect() const { return QRectF(0.0, 0.0, 40.0, 40.0); } void RowHint::paint(QPainter* painter, const QStyleOptionGraphicsItem* , QWidget* ) { if (mPegCnt == 0) { return; } int i; QColor pend = QColor("#646568"); QColor penl = QColor("#ecedef"); QColor grad0 = QColor("#cccdcf"); QColor grad1 = QColor("#fcfdff"); if (mActive) { pend.setAlpha(0xff); penl.setAlpha(0xff); grad0.setAlpha(0xff); grad1.setAlpha(0xff); } else if (mSolved) { pend.setAlpha(0xa0); penl.setAlpha(0xa0); grad0.setAlpha(0xa0); grad1.setAlpha(0xa0); } else { pend.setAlpha(0x32); penl.setAlpha(0x50); grad0.setAlpha(0x32); grad1.setAlpha(0x32); } painter->setPen(Qt::NoPen); painter->setBrush(QBrush(penl)); painter->drawRect(QRectF(0.0, 0.0, 39, 1)); painter->drawRect(QRectF(0.0, 0.0, 1, 39)); painter->setBrush(QBrush(pend)); painter->drawRect(QRectF(0.0, 39.0, 40, 1)); painter->drawRect(QRectF(39, 0.0, 1, 40)); QRadialGradient grad(QPointF(10, 10), 100); grad.setColorAt(0, grad0); grad.setColorAt(1, grad1); painter->setBrush(QBrush(grad)); painter->drawRect(QRectF(1, 1.0, 38.0, 38.0)); painter->setBrush(Qt::NoBrush); int posix = mPegCnt - 2; QPointF x0; for (i = 0; i < mPegCnt; i++) { x0 = QPointF(mPegPos[posix][i][0], mPegPos[posix][i][1]); QLinearGradient lgrad(x0, QPointF(x0.x() + 10, x0.y() + 10)); lgrad.setColorAt(0.0, QColor(0, 0, 0, 0xa0)); lgrad.setColorAt(1.0, QColor(0xff, 0xff, 0xff, 0xa0)); painter->setPen(QPen(QBrush(lgrad), 0.5)); painter->drawEllipse(QRectF(mPegPos[posix][i][0], mPegPos[posix][i][1], mPegPos[posix][i][2], mPegPos[posix][i][2])); } if (mSolved && ColorCode::INSTANCE->GetGameState() != ColorCode::STATE_PAUSED) { painter->setPen(Qt::NoPen); for (unsigned i = 0; i < mHints.size(); i++) { if (mHints.at(i) == 0) { continue; } if (mHints.at(i) == 2) { painter->setBrush(QBrush(Qt::black)); } else { painter->setBrush(QBrush(Qt::white)); } painter->drawEllipse(QRectF(mPegPos[posix][i][0], mPegPos[posix][i][1], mPegPos[posix][i][2], mPegPos[posix][i][2])); } } } ColorCode-0.8.7/src/highscoresmodel.cpp0000644000175000017500000000456014524760073016532 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "highscoresmodel.h" #include "gametableview.h" HighScoresModel* GetHighScoresModel() { static HighScoresModel* m = new HighScoresModel(); return m; } HighScoresModel::HighScoresModel(QObject* parent) : GamesListModel(parent) { mId = MODEL_ID_HIGH; mEditIndex = QModelIndex(); mMaxSize = 20; } bool HighScoresModel::IsValidHighScore(const int score) const { if (mGamesList.size() < mMaxSize || mGamesList.last().mScore < score) { return true; } return false; } void HighScoresModel::InsertRow(CCGame g) { if (mEditIndex.isValid()) { emit CloseEditorSignal(mEditIndex); } mView->clearSelection(); beginInsertRows(QModelIndex(), rowCount(), rowCount()); mGamesList.push_back(g); endInsertRows(); QModelIndex mix = index(rowCount() - 1, GetColIx(COL_DELETE), QModelIndex()); mView->openPersistentEditor(mix); DoSort(mGamesList); LimitGamesListSize(); int ix = mGamesList.indexOf(g); emit layoutChanged(); if (ix > -1) { mEditIndex = createIndex(ix, GetColIx(COL_USERNAME)); EditField(); } } int HighScoresModel::GetColIx(const int ix) const { int ret = -1; if (ix == COL_RANKING) { ret = 0; } else if (ix == COL_SCORE) { ret = 1; } else if (ix == COL_USERNAME) { ret = 2; } else if (ix == COL_DELETE) { ret = 3; } return ret; } int HighScoresModel::GetMaxColCnt() const { return 4; } void HighScoresModel::DoSort(QList &list) { std::sort(list.begin(), list.end(), GamesListModel::SortListScore); } ColorCode-0.8.7/src/colorcode.cpp0000644000175000017500000020350214526107154015316 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include "settings.h" #include "ccsolver.h" #include "colorcode.h" #include "colorpeg.h" #include "pegrow.h" #include "rowhint.h" #include "msg.h" #include "background.h" #include "about.h" #include "prefdialog.h" #include "solutionrow.h" #include "graphicsbtn.h" #include "pegfactory.h" #include "gamenodisplay.h" #include "timedisplay.h" #include "timedisplaybg.h" #include "highscore.h" #include "gametablesdialog.h" using namespace std; ColorCode* ColorCode::INSTANCE = NULL; const QString ColorCode::VERSION = "0.8.7"; volatile bool ColorCode::mNoAct = false; volatile bool ColorCode::mIgnoreGuess = false; const int ColorCode::STATE_NONE = 0; const int ColorCode::STATE_RUNNING = 1; const int ColorCode::STATE_PAUSED = 2; const int ColorCode::STATE_WON = 3; const int ColorCode::STATE_LOST = 4; const int ColorCode::STATE_GAVE_UP = 5; const int ColorCode::STATE_ERROR = 6; const int ColorCode::MODE_HVM = 0; const int ColorCode::MODE_MVH = 1; const int ColorCode::MAX_COLOR_CNT = 10; const int ColorCode::MIN_COLOR_CNT = 2; const int ColorCode::SOLUTION_ROW_IX = -1; const int ColorCode::LAYER_BG = 1; const int ColorCode::LAYER_ROWS = 2; const int ColorCode::LAYER_HINTS = 3; const int ColorCode::LAYER_SOL = 4; const int ColorCode::LAYER_MSG = 5; const int ColorCode::LAYER_PEGS = 6; const int ColorCode::LAYER_BTNS = 7; const int ColorCode::LAYER_DRAG = 8; const int ColorCode::LEVEL_SETTINGS[5][3] = { { 2, 2, 1}, { 4, 3, 0}, { 6, 4, 1}, { 8, 4, 1}, {10, 5, 1} }; int ColorCode::mMaxRowCnt = 10; int ColorCode::mRowY0 = 130; int ColorCode::mColorCnt = 0; int ColorCode::mPegCnt = 0; int ColorCode::mDoubles = 1; int ColorCode::mXOffs = 0; int ColorCode::mMaxZ = 0; int ColorCode::mLevel = -1; int ColorCode::mGameMode = ColorCode::MODE_HVM; QString ColorCode::GAME_TITLE = ""; ColorCode::ColorCode() { SetState(STATE_NONE); GAME_TITLE = tr("ColorCode"); setWindowTitle(GAME_TITLE + " "); setWindowIcon(QIcon(QPixmap(":/img/cc16.png"))); setIconSize(QSize(16, 16)); setMouseTracking(true); setAttribute(Qt::WA_Hover, true); setAttribute(Qt::WA_AlwaysShowToolTips, true); INSTANCE = this; QCoreApplication::setOrganizationName("dirks"); QCoreApplication::setOrganizationDomain("laebisch.com"); QCoreApplication::setApplicationName("colorcode"); // QTime midnight(0, 0, 0); // qsrand(midnight.secsTo(QTime::currentTime())); Init(); } ColorCode::~ColorCode() { mIgnoreGuess = true; mSettings->WriteSettings(); WaitForSolver(); } void ColorCode::Init() { mGameTablesDialog = new GameTablesDialog(this); mGameInput = NULL; mFinishedGameInput = NULL; mPrefDialog = NULL; mSettings = GetSettings(); connect(mSettings, SIGNAL(ReadSettingsGamesDone()), mGameTablesDialog, SLOT(ReadSettingsGamesSlot())); connect(this, SIGNAL(NewHighScoreSignal(CCGame*)), mGameTablesDialog, SLOT(InsertHighScoreSlot(CCGame*))); connect(mGameTablesDialog, SIGNAL(NewGameInputSignal(CCGame*)), this, SLOT(NewGameInputSlot(CCGame*))); mSettings->Init(); mHighScore = new HighScore(); mCurRow = NULL; mColorCnt = 0; mGameCnt = 0; mGameId = 0; mGuessCnt = 0; mHintsCnt = 0; mSolverStrength = CCSolver::STRENGTH_HIGH; mOrigSize = NULL; mMenuBar = menuBar(); // as long as menuBar's size is invalid populated initially ... done for 4.6 #ifdef Q_WS_X11 #if QT_VERSION < 0x040600 mScene = new QGraphicsScene(0, 0, 320, 580); #else mScene = new QGraphicsScene(0, 0, 320, 560); #endif #else mScene = new QGraphicsScene(0, 0, 320, 560); #endif mScene->setBackgroundBrush(QBrush(QColor("#b0b1b3"))); mView = new QGraphicsView; mView->setScene(mScene); mView->setGeometry(0, 0, 320, 560); mView->setDragMode(QGraphicsView::NoDrag); mView->setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); mView->setContextMenuPolicy(Qt::NoContextMenu); mView->setAlignment(Qt::AlignCenter); mView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); mView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); mView->setFrameStyle(QFrame::NoFrame); setCentralWidget(mView); mBg = new BackGround(); mScene->addItem(mBg); mBg->setPos(0, 0); mBg->setZValue(LAYER_BG); mMsg = new Msg; mScene->addItem(mMsg); mMsg->setPos(20, 0); mMsg->setZValue(LAYER_MSG); mGameNoDisplay = new GameNoDisplay; mScene->addItem(mGameNoDisplay); mGameNoDisplay->setPos(10, 534); mGameNoDisplay->setZValue(LAYER_MSG); mDoneBtn = new GraphicsBtn; mDoneBtn->SetLabel(tr("Done")); mScene->addItem(mDoneBtn); mDoneBtn->setPos(84, 118); mDoneBtn->setZValue(LAYER_BTNS); mDoneBtn->ShowBtn(false); connect(mDoneBtn, SIGNAL(BtnPressSignal(GraphicsBtn *)), this, SLOT(DoneBtnPressSlot(GraphicsBtn *))); mOkBtn = new GraphicsBtn; mOkBtn->SetWidth(38); mOkBtn->SetLabel("ok"); mScene->addItem(mOkBtn); mOkBtn->setPos(5, 329); mOkBtn->setZValue(LAYER_BTNS); mOkBtn->ShowBtn(false); connect(mOkBtn, SIGNAL(BtnPressSignal(GraphicsBtn *)), this, SLOT(DoneBtnPressSlot(GraphicsBtn *))); mTimerBtn = new GraphicsBtn; mTimerBtn->SetWidth(261); mTimerBtn->SetLabel(""); mScene->addItem(mTimerBtn); mTimerBtn->setScale(0.44); mTimerBtn->setPos(102, 110); mTimerBtn->setZValue(LAYER_HINTS); mTimerBtn->InvertStates(); mTimerBtn->ShowBtn(true); connect(mTimerBtn, SIGNAL(BtnPressSignal(GraphicsBtn *)), this, SLOT(PauseGameSlot(GraphicsBtn *))); mSolutionRowBg = new GraphicsBtn; mSolutionRowBg->SetEnabled(false); mSolutionRowBg->SetWidth(219); mSolutionRowBg->SetLabel(""); mScene->addItem(mSolutionRowBg); mSolutionRowBg->setScale(1.14); mSolutionRowBg->setPos(35, 66); mSolutionRowBg->setZValue(LAYER_ROWS); mSolutionRowBg->SetStatesOpacity(1.0, 0.1); mSolutionRowBg->InvertStates(); mSolutionRowBg->ShowBtn(true); mPegFactory = new PegFactory(); connect(mPegFactory, SIGNAL(SnapPegSignal(ColorPeg*)), this, SLOT(SnapPegSlot(ColorPeg*))); mSolver = new CCSolver(this); connect(mSolver, SIGNAL(finished()), this, SLOT(SetSolverGuessSlot())); connect(mSolver, SIGNAL(GuessDoneSignal()), this, SLOT(SetSolverGuessSlot())); mHintsDelayTimer = new QTimer(); mHintsDelayTimer->setSingleShot(true); mHintsDelayTimer->setInterval(500); connect(mHintsDelayTimer, SIGNAL(timeout()), this, SLOT(SetAutoHintsSlot())); mGameTimerBg = new TimeDisplayBg(); mScene->addItem(mGameTimerBg); mGameTimerBg->setPos(50, 108); mGameTimerBg->setZValue(LAYER_SOL); mGameTimer = new TimeDisplay(); mScene->addItem(mGameTimer); mGameTimer->setPos(49, 109); mGameTimer->setZValue(LAYER_MSG); InitActions(); InitMenus(); InitToolBars(); statusBar()->setStyleSheet("QStatusBar::item { border: 0px solid black }; "); mStatusLabel = new QLabel(); statusBar()->addPermanentWidget(mStatusLabel, 0); InitSolution(); InitRows(); ApplySettingsSlot(); } void ColorCode::InitSolution() { mSolutionRow = new SolutionRow(); mSolutionRow->SetIx(SOLUTION_ROW_IX); mSolutionRow->setPos(50, 68); mSolutionRow->setZValue(LAYER_SOL); mScene->addItem(mSolutionRow); connect(mSolutionRow, SIGNAL(RemovePegSignal(ColorPeg*)), mPegFactory, SLOT(RemovePegSlot(ColorPeg*))); connect(mSolutionRow, SIGNAL(RowSolutionSignal(int)), this, SLOT(RowSolutionSlot(int))); } void ColorCode::InitRows() { PegRow* row; RowHint* hint; int xpos = 60; int ypos = mRowY0; int i; for (i = 0; i < mMaxRowCnt; ++i) { row = new PegRow(); row->SetIx(i); row->setPos(QPoint(xpos, ypos + (mMaxRowCnt - (i + 1)) * 40)); row->setZValue(LAYER_ROWS); row->SetActive(false); mScene->addItem(row); mPegRows[i] = row; connect(row, SIGNAL(RemovePegSignal(ColorPeg*)), mPegFactory, SLOT(RemovePegSlot(ColorPeg*))); connect(row, SIGNAL(RowSolutionSignal(int)), this, SLOT(RowSolutionSlot(int))); hint = new RowHint; hint->SetIx(i); hint->setPos(QPoint(4, ypos + (mMaxRowCnt - (i + 1)) * 40)); hint->setZValue(LAYER_HINTS); hint->SetActive(false); mScene->addItem(hint); mHintBtns[i] = hint; connect(hint, SIGNAL(HintPressedSignal(int)), this, SLOT(HintPressedSlot(int))); } } void ColorCode::InitActions() { mActNewGame = new QAction(tr("&New Game"), this); mActNewGame->setIcon(QIcon(":/img/document-new.png")); mActNewGame->setShortcut(tr("Ctrl+N")); connect(mActNewGame, SIGNAL(triggered()), this, SLOT(NewGameSlot())); mActSelectGame = new QAction(tr("&Start particular Game"), this); mActSelectGame->setIcon(QIcon(":/img/document-new.png")); mActSelectGame->setShortcut(tr("Ctrl+Alt+N")); connect(mActSelectGame, SIGNAL(triggered()), mGameTablesDialog, SLOT(ShowInputSlot())); mActCopyGameNo = new QAction(tr("&Copy Game Number"), this); mActCopyGameNo->setIcon(QIcon(":/img/edit-copy.png")); mActCopyGameNo->setShortcut(tr("Ctrl+C")); connect(mActCopyGameNo, SIGNAL(triggered()), this, SLOT(CopyGameNoSlot())); mActRestartGame = new QAction(tr("&Restart Game"), this); mActRestartGame->setIcon(QIcon(":/img/view-refresh.png")); mActRestartGame->setShortcut(tr("Ctrl+Shift+R")); connect(mActRestartGame, SIGNAL(triggered()), this, SLOT(RestartGameSlot())); mActGiveIn = new QAction(tr("&Throw In The Towel"), this); mActGiveIn->setIcon(QIcon(":/img/face-sad.png")); mActGiveIn->setShortcut(tr("Ctrl+G")); connect(mActGiveIn, SIGNAL(triggered()), this, SLOT(GiveInSlot())); mActPauseGame = new QAction(tr("&Have a Break"), this); mActPauseGame->setIcon(QIcon(":/img/pause.png")); mActPauseGame->setShortcut(tr("Ctrl+P")); connect(mActPauseGame, SIGNAL(triggered()), this, SLOT(PauseGameSlot())); mActSaveGame = new QAction(tr("&Bookmark Current Game"), this); mActSaveGame->setIcon(QIcon(":/img/bookmark_add.png")); mActSaveGame->setShortcut(tr("Ctrl+B")); connect(mActSaveGame, SIGNAL(triggered()), this, SLOT(SavePrevGameSlot())); mActShowHighScores = new QAction(tr("&Highscores"), this); mActShowHighScores->setIcon(QIcon(":/img/games-highscores.png")); mActShowHighScores->setShortcut(tr("Ctrl+Alt+H")); connect(mActShowHighScores, SIGNAL(triggered()), mGameTablesDialog, SLOT(ShowHighSlot())); mActShowPrevGames = new QAction(tr("&Recent Games"), this); mActShowPrevGames->setIcon(QIcon(":/img/history.png")); mActShowPrevGames->setShortcut(tr("Ctrl+Alt+R")); connect(mActShowPrevGames, SIGNAL(triggered()), mGameTablesDialog, SLOT(ShowPrevSlot())); mActShowSavedGames = new QAction(tr("&Bookmarks"), this); mActShowSavedGames->setIcon(QIcon(":/img/bookmark.png")); mActShowSavedGames->setShortcut(tr("Ctrl+Alt+B")); connect(mActShowSavedGames, SIGNAL(triggered()), mGameTablesDialog, SLOT(ShowSavedSlot())); mActExit = new QAction(tr("E&xit"), this); mActExit->setIcon(QIcon(":/img/application-exit.png")); mActExit->setShortcut(tr("Ctrl+Q")); connect(mActExit, SIGNAL(triggered()), this, SLOT(close())); mActShowToolbar = new QAction(tr("Show Toolbar"), this); mActShowToolbar->setCheckable(true); mActShowToolbar->setChecked(true); mActShowToolbar->setShortcut(tr("Ctrl+Shift+T")); connect(mActShowToolbar, SIGNAL(triggered()), this, SLOT(ShowToolbarSlot())); mActShowMenubar = new QAction(tr("Show Menubar"), this); mActShowMenubar->setCheckable(true); mActShowMenubar->setChecked(true); mActShowMenubar->setShortcut(tr("Ctrl+M")); connect(mActShowMenubar, SIGNAL(triggered()), this, SLOT(ShowMenubarSlot())); mActShowStatusbar = new QAction(tr("Show Statusbar"), this); mActShowStatusbar->setCheckable(true); mActShowStatusbar->setChecked(true); mActShowStatusbar->setShortcut(tr("Ctrl+Shift+B")); connect(mActShowStatusbar, SIGNAL(triggered()), this, SLOT(ShowStatusbarSlot())); mActShowTimer = new QAction(tr("Show Timer"), this); mActShowTimer->setCheckable(true); mActShowTimer->setChecked(true); mActShowTimer->setShortcut(tr("Ctrl+T")); connect(mActShowTimer, SIGNAL(triggered()), this, SLOT(ShowTimerSlot())); mActShowGameNo = new QAction(tr("Display Game Number"), this); mActShowGameNo->setCheckable(true); mActShowGameNo->setChecked(true); mActShowGameNo->setShortcut(tr("Ctrl+Shift+N")); connect(mActShowGameNo, SIGNAL(triggered()), this, SLOT(ShowGameNoSlot())); mActResetColorsOrder = new QAction(tr("Reset Color Order"), this); mActResetColorsOrder->setShortcut(tr("Ctrl+Shift+C")); connect(mActResetColorsOrder, SIGNAL(triggered()), mPegFactory, SLOT(ResetColorsOrderSlot())); mActShowIndicators = new QAction(tr("Show Indicators"), this); mActShowIndicators->setCheckable(true); mActShowIndicators->setChecked(false); mActShowIndicators->setShortcut(tr("Ctrl+Shift+L")); connect(mActShowIndicators, SIGNAL(triggered()), this, SLOT(SetIndicatorsSlot())); mActDoubles = new QAction(tr("Allow Pegs of the Same Color"), this); mActDoubles->setCheckable(true); mActDoubles->setChecked(true); mActDoubles->setShortcut(tr("Ctrl+Shift+S")); connect(mActDoubles, SIGNAL(triggered(bool)), this, SLOT(DoublesChangedSlot(bool))); mActDoublesIcon = new QAction(tr("Allow Pegs of Same Color"), this); mActDoublesIcon->setCheckable(true); mActDoublesIcon->setChecked(true); mActDoublesIcon->setToolTip(tr("Disallow Pegs of Same Color")); mActDoublesIcon->setIcon(QIcon(":/img/same_color_1.png")); connect(mActDoublesIcon, SIGNAL(triggered(bool)), this, SLOT(DoublesChangedSlot(bool))); mActAutoClose = new QAction(tr("Close Rows when the last Peg is placed"), this); mActAutoClose->setCheckable(true); mActAutoClose->setChecked(false); mActAutoClose->setShortcut(tr("Ctrl+L")); connect(mActAutoClose, SIGNAL(triggered()), this, SLOT(AutoCloseSlot())); mActAutoHints = new QAction(tr("Set Hints automatically"), this); mActAutoHints->setCheckable(true); mActAutoHints->setChecked(false); mActAutoHints->setShortcut(tr("Ctrl+Shift+H")); connect(mActAutoHints, SIGNAL(triggered()), this, SLOT(AutoHintsSlot())); mLaunchHelpAction = new QAction(tr("Online &Help"), this); mLaunchHelpAction->setIcon(QIcon(":/img/help.png")); mLaunchHelpAction->setShortcut(tr("F1")); connect(mLaunchHelpAction, SIGNAL(triggered()), this, SLOT(OnlineHelpSlot())); mActAbout = new QAction(tr("About &ColorCode"), this); mActAbout->setIcon(QIcon(":/img/help-about.png")); mActAbout->setShortcut(tr("Ctrl+A")); connect(mActAbout, SIGNAL(triggered()), this, SLOT(AboutSlot())); mActAboutQt = new QAction(tr("About &Qt"), this); mActAboutQt->setIcon(QIcon(":/img/qt.png")); mActAboutQt->setShortcut(tr("Ctrl+I")); connect(mActAboutQt, SIGNAL(triggered()), this, SLOT(AboutQtSlot())); mActRandRow = new QAction(tr("Fill Row by Random"), this); mActRandRow->setIcon(QIcon(":/img/system-switch-user.png")); mActRandRow->setShortcut(tr("Ctrl+R")); connect(mActRandRow, SIGNAL(triggered()), this, SLOT(RandRowSlot())); mActPrevRow = new QAction(tr("Duplicate Previous Row"), this); mActPrevRow->setIcon(QIcon(":/img/edit-copy.png")); mActPrevRow->setShortcut(tr("Ctrl+D")); connect(mActPrevRow, SIGNAL(triggered()), this, SLOT(PrevRowSlot())); mActClearRow = new QAction(tr("Clear Row"), this); mActClearRow->setIcon(QIcon(":/img/edit-clear.png")); mActClearRow->setShortcut(tr("Ctrl+Alt+C")); connect(mActClearRow, SIGNAL(triggered()), this, SLOT(ClearRowSlot())); mActLevelEasy = new QAction(tr("Beginner (2 Colors, 2 Slots, Doubles)"), this); mActLevelEasy->setData(0); mActLevelEasy->setCheckable(true); mActLevelEasy->setChecked(false); connect(mActLevelEasy, SIGNAL(triggered()), this, SLOT(SetLevelSlot())); mActLevelClassic = new QAction(tr("Easy (4 Colors, 3 Slots, No Doubles)"), this); mActLevelClassic->setData(1); mActLevelClassic->setCheckable(true); mActLevelClassic->setChecked(false); connect(mActLevelClassic, SIGNAL(triggered()), this, SLOT(SetLevelSlot())); mActLevelMedium = new QAction(tr("Classic (6 Colors, 4 Slots, Doubles)"), this); mActLevelMedium->setData(2); mActLevelMedium->setCheckable(true); mActLevelMedium->setChecked(true); connect(mActLevelMedium, SIGNAL(triggered()), this, SLOT(SetLevelSlot())); mActLevelChallenging = new QAction(tr("Challenging (8 Colors, 4 Slots, Doubles)"), this); mActLevelChallenging->setData(3); mActLevelChallenging->setCheckable(true); mActLevelChallenging->setChecked(false); connect(mActLevelChallenging, SIGNAL(triggered()), this, SLOT(SetLevelSlot())); mActLevelHard = new QAction(tr("Hard (10 Colors, 5 Slots, Doubles)"), this); mActLevelHard->setData(4); mActLevelHard->setCheckable(true); mActLevelHard->setChecked(false); connect(mActLevelHard, SIGNAL(triggered()), this, SLOT(SetLevelSlot())); mActSetGuess = new QAction(tr("Computer's Guess"), this); mActSetGuess->setIcon(QIcon(":/img/business_user.png")); mActSetGuess->setShortcut(tr("Ctrl+H")); connect(mActSetGuess, SIGNAL(triggered()), this, SLOT(SetGuessSlot())); mActSetHints = new QAction(tr("Rate it for me"), this); mActSetHints->setIcon(QIcon(":/img/icon_female16.png")); mActSetHints->setShortcut(tr("Ctrl+H")); connect(mActSetHints, SIGNAL(triggered()), this, SLOT(SetHintsSlot())); mActModeHvM = new QAction(tr("Human vs Computer"), this); mActModeHvM->setData(MODE_HVM); mActModeHvM->setCheckable(true); mActModeHvM->setChecked(true); connect(mActModeHvM, SIGNAL(triggered()), this, SLOT(SetGameModeSlot())); mActModeMvH = new QAction(tr("Computer vs Human"), this); mActModeMvH->setData(MODE_MVH); mActModeMvH->setCheckable(true); mActModeMvH->setChecked(false); connect(mActModeMvH, SIGNAL(triggered()), this, SLOT(SetGameModeSlot())); mActPreferences = new QAction(tr("Preferences"), this); mActPreferences->setIcon(QIcon(":/img/configure.png")); mActPreferences->setShortcut(tr("Ctrl+Shift+P")); connect(mActPreferences, SIGNAL(triggered()), this, SLOT(OpenPreferencesSlot())); } void ColorCode::InitMenus() { mMenuGame = mMenuBar->addMenu(tr("&Game")); mMenuGame->addAction(mActNewGame); mMenuGame->addAction(mActSelectGame); mMenuGame->addAction(mActRestartGame); mMenuGame->addSeparator(); mMenuGame->addAction(mActPauseGame); mMenuGame->addAction(mActGiveIn); mMenuGame->addSeparator(); mMenuGame->addAction(mActCopyGameNo); mMenuGame->addAction(mActSaveGame); mMenuGame->addSeparator(); mMenuGame->addAction(mActExit); mMenuRow = mMenuBar->addMenu(tr("&Row")); mMenuRow->addAction(mActRandRow); mMenuRow->addAction(mActPrevRow); mMenuRow->addAction(mActClearRow); mMenuRow->addSeparator(); mMenuRow->addAction(mActSetGuess); mMenuRow->addAction(mActSetHints); connect(mMenuRow, SIGNAL(aboutToShow()), this, SLOT(UpdateRowMenuSlot())); mMenuGames = mMenuBar->addMenu(tr("Game &Lists")); mMenuGames->addAction(mActShowHighScores); mMenuGames->addAction(mActShowSavedGames); mMenuGames->addAction(mActShowPrevGames); mMenuSettings = mMenuBar->addMenu(tr("&Settings")); mMenuModes = mMenuSettings->addMenu(tr("Game Mode")); mActGroupModes = new QActionGroup(mMenuModes); mActGroupModes->setExclusive(true); mActGroupModes->addAction(mActModeHvM); mActGroupModes->addAction(mActModeMvH); QList modeacts = mActGroupModes->actions(); mMenuModes->addActions(modeacts); mMenuSettings->addSeparator(); mMenuSettings->addAction(mActShowMenubar); mMenuSettings->addAction(mActShowToolbar); mMenuSettings->addAction(mActShowStatusbar); mMenuSettings->addSeparator(); mMenuSettings->addAction(mActShowTimer); mMenuSettings->addAction(mActShowGameNo); mMenuSettings->addSeparator(); mMenuSettings->addAction(mActResetColorsOrder); mMenuSettings->addAction(mActShowIndicators); mMenuSettings->addSeparator(); mMenuLevels = mMenuSettings->addMenu(tr("Level Presets")); mActGroupLevels = new QActionGroup(mMenuLevels); mActGroupLevels->addAction(mActLevelEasy); mActGroupLevels->addAction(mActLevelClassic); mActGroupLevels->addAction(mActLevelMedium); mActGroupLevels->addAction(mActLevelChallenging); mActGroupLevels->addAction(mActLevelHard); QList levelacts = mActGroupLevels->actions(); mMenuLevels->addActions(levelacts); mMenuSettings->addSeparator(); mMenuSettings->addAction(mActDoubles); mMenuSettings->addSeparator(); mMenuSettings->addAction(mActAutoClose); mMenuSettings->addAction(mActAutoHints); mMenuSettings->addSeparator(); mMenuSettings->addAction(mActPreferences); mMenuHelp = mMenuBar->addMenu(tr("&Help")); mMenuHelp->addAction(mLaunchHelpAction); mMenuHelp->addSeparator(); mMenuHelp->addAction(mActAbout); mMenuHelp->addAction(mActAboutQt); mMenuRowContext = new QMenu(); mMenuRowContext->addAction(mActRandRow); mMenuRowContext->addAction(mActPrevRow); mMenuRowContext->addAction(mActClearRow); mMenuRowContext->addSeparator(); mMenuRowContext->addAction(mActSetGuess); mMenuRowContext->addAction(mActSetHints); mMenuRowContext->addSeparator(); mMenuRowContext->addAction(mActNewGame); mMenuRowContext->addAction(mActRestartGame); mMenuRowContext->addAction(mActGiveIn); mMenuRowContext->addSeparator(); mMenuRowContext->addAction(mActExit); addActions(mMenuBar->actions()); } void ColorCode::InitToolBars() { mGameToolbar = addToolBar(tr("Game")); mGameToolbar->setAllowedAreas(Qt::NoToolBarArea); mGameToolbar->setFloatable(false); mGameToolbar->setIconSize(QSize(16, 16)); mGameToolbar->setMovable(false); mGameToolbar->addAction(mActNewGame); mGameToolbar->addAction(mActRestartGame); mGameToolbar->addAction(mActGiveIn); mGameToolbar->addSeparator(); mGameToolbar->addAction(mActSetGuess); mGameToolbar->addAction(mActSetHints); mColorCntCmb = new QComboBox(); mColorCntCmb->setLayoutDirection(Qt::LeftToRight); mColorCntCmb->setFixedWidth(84); mColorCntCmb->addItem("2 " + tr("Colors"), 2); mColorCntCmb->addItem("3 " + tr("Colors"), 3); mColorCntCmb->addItem("4 " + tr("Colors"), 4); mColorCntCmb->addItem("5 " + tr("Colors"), 5); mColorCntCmb->addItem("6 " + tr("Colors"), 6); mColorCntCmb->addItem("7 " + tr("Colors"), 7); mColorCntCmb->addItem("8 " + tr("Colors"), 8); mColorCntCmb->addItem("9 " + tr("Colors"), 9); mColorCntCmb->addItem("10 " + tr("Colors"), 10); mColorCntCmb->setCurrentIndex(6); connect(mColorCntCmb, SIGNAL(currentIndexChanged(int)), this, SLOT(ColorCntChangedSlot())); mPegCntCmb = new QComboBox(); mPegCntCmb->setLayoutDirection(Qt::LeftToRight); mPegCntCmb->setFixedWidth(76); mPegCntCmb->addItem("2 " + tr("Slots"), 2); mPegCntCmb->addItem("3 " + tr("Slots"), 3); mPegCntCmb->addItem("4 " + tr("Slots"), 4); mPegCntCmb->addItem("5 " + tr("Slots"), 5); mPegCntCmb->setCurrentIndex(2); connect(mPegCntCmb, SIGNAL(currentIndexChanged(int)), this, SLOT(PegCntChangedSlot())); mLevelToolbar = addToolBar(tr("Level")); mLevelToolbar->setAllowedAreas(Qt::NoToolBarArea); mLevelToolbar->setFloatable(false); mLevelToolbar->setIconSize(QSize(16, 16)); mLevelToolbar->setMovable(false); mLevelToolbar->setLayoutDirection(Qt::RightToLeft); mLevelToolbar->addWidget(mColorCntCmb); QWidget* spacer = new QWidget(); spacer->setMinimumWidth(4); mLevelToolbar->addWidget(spacer); mLevelToolbar->addWidget(mPegCntCmb); QWidget* spacer2 = new QWidget(); spacer2->setMinimumWidth(4); mLevelToolbar->addWidget(spacer2); mLevelToolbar->addAction(mActDoublesIcon); } void ColorCode::ApplySettingsSlot() { bool restart = NeedsRestart(); mNoAct = true; mActShowToolbar->setChecked(mSettings->mShowToolBar); ShowToolbarSlot(); mActShowMenubar->setChecked(mSettings->mShowMenuBar); ShowMenubarSlot(); mActShowStatusbar->setChecked(mSettings->mShowStatusBar); ShowStatusbarSlot(); mActShowTimer->setChecked(mSettings->mShowTimer); ShowTimer(); mActShowGameNo->setChecked(mSettings->mShowGameNo); UpdateGameNoDisplay(); mActShowIndicators->setChecked(mSettings->mShowIndicators); SetIndicatorsSlot(); mActAutoClose->setChecked(mSettings->mAutoClose); mActAutoHints->setChecked(mSettings->mAutoHints); SetDoublesSlot(mSettings->mDoubles); int i; i = mColorCntCmb->findData(mSettings->mColorCnt); if (i != -1 && mColorCntCmb->currentIndex() != i) { mColorCntCmb->setCurrentIndex(i); } i = mPegCntCmb->findData(mSettings->mPegCnt); if (i != -1 && mPegCntCmb->currentIndex() != i) { mPegCntCmb->setCurrentIndex(i); } CheckLevel(); if (mSettings->mGameMode == MODE_HVM) { mActModeHvM->setChecked(true); UpdateGameNoDisplay(); } else { mActModeMvH->setChecked(true); } mHintsDelayTimer->setInterval(mSettings->mHintsDelay); mNoAct = false; if (restart) { TryNewGame(); } } void ColorCode::TryNewGame() { int r = QMessageBox::Yes; if (GamesRunning()) { r = QMessageBox::question( this, tr("Message"), tr("The changed settings will only apply to new games!\nDo you want to give in the current and start a new Game?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); } if (r == QMessageBox::Yes) { mGameInput = NULL; NewGame(); } } bool ColorCode::NeedsRestart() const { bool need = false; if ( mSettings->mDoubles != mActDoubles->isChecked() || mSettings->mColorCnt != mColorCnt || mSettings->mPegCnt != mPegCnt || mSettings->mGameMode != mGameMode || (mGameMode == MODE_MVH && mSolverStrength != mSettings->mSolverStrength) ) { need = true; } return need; } void ColorCode::contextMenuEvent(QContextMenuEvent* e) { QList list = mView->items(mView->mapFromGlobal(e->globalPos())); int i = 0; bool isrow = false; if (mGameState == STATE_RUNNING && mCurRow != NULL) { for (i = 0; i < list.size(); ++i) { if (list.at(i) == mCurRow || list.at(i) == mHintBtns[mCurRow->GetIx()]) { isrow = true; break; } } } if (isrow) { UpdateRowMenuSlot(); mMenuRowContext->exec(e->globalPos()); } else { mMenuGame->exec(e->globalPos()); } } void ColorCode::resizeEvent (QResizeEvent* e) { Q_UNUSED(e); Scale(); } void ColorCode::keyPressEvent(QKeyEvent *e) { if (mCurRow == NULL || mGameState != STATE_RUNNING) { return; } switch (e->key()) { case Qt::Key_Return: case Qt::Key_Enter: if (mGameMode == MODE_HVM) { int ix = mCurRow->GetIx(); if (mHintBtns[ix]->mActive) { std::vector s = mCurRow->GetSolution(); if (s.size() == (unsigned) mPegCnt) { mHintBtns[ix]->SetActive(false); HintPressedSlot(ix); } } } else if (mGameMode == MODE_MVH) { if (mDoneBtn->isVisible() || mOkBtn->isVisible()) { DoneBtnPressSlot(mOkBtn); } } break; } } void ColorCode::UpdateActions() { if (mGameState == STATE_PAUSED) { mActSelectGame->setEnabled(true); mActSaveGame->setEnabled(true); mActSetGuess->setEnabled(false); mActRestartGame->setEnabled(false); mActGiveIn->setEnabled(false); return; } bool running = (mGameState == STATE_RUNNING && mCurRow != NULL); if (mGameMode == MODE_HVM) { mActSelectGame->setVisible(true); mActSelectGame->setEnabled(true); mActSaveGame->setVisible(true); mActSaveGame->setEnabled(true); mActPauseGame->setVisible(true); mActShowTimer->setVisible(true); mActShowTimer->setEnabled(true); mActShowGameNo->setVisible(true); mActShowGameNo->setEnabled(true); mActCopyGameNo->setVisible(true); mActCopyGameNo->setEnabled(true); if (running) { mActSetGuess->setEnabled(true); mActRestartGame->setEnabled(true); mActGiveIn->setEnabled(true); mActPauseGame->setEnabled(true); } else { mActSetGuess->setEnabled(false); mActRestartGame->setEnabled(false); mActGiveIn->setEnabled(false); mActPauseGame->setEnabled(false); } } else if (mGameMode == MODE_MVH) { mActSelectGame->setVisible(false); mActSelectGame->setEnabled(false); mActSaveGame->setVisible(false); mActSaveGame->setEnabled(false); mActPauseGame->setVisible(false); mActPauseGame->setEnabled(false); mActShowTimer->setVisible(false); mActShowTimer->setEnabled(false); mActShowGameNo->setVisible(false); mActShowGameNo->setEnabled(false); mActCopyGameNo->setVisible(false); mActCopyGameNo->setEnabled(false); if (running) { mActRestartGame->setEnabled(true); mActGiveIn->setEnabled(true); if (mCurRow == mSolutionRow) { mActSetHints->setEnabled(false); } else { mActSetHints->setEnabled(!mSettings->mAutoHints && !mSolver->isRunning()); } UpdateRowMenuSlot(); } else { mActSetHints->setEnabled(false); mActRestartGame->setEnabled(false); mActGiveIn->setEnabled(false); } } } void ColorCode::UpdateRowMenuSlot() { if (mGameMode == MODE_HVM) { if (mGameState != STATE_RUNNING || mCurRow == NULL) { mActRandRow->setEnabled(false); mActPrevRow->setEnabled(false); mActClearRow->setEnabled(false); mActSetGuess->setEnabled(false); return; } else { mActRandRow->setEnabled(true); } if (mCurRow->GetIx() < 1) { mActPrevRow->setEnabled(false); } else { mActPrevRow->setEnabled(true); } if (mCurRow->GetPegCnt() == 0) { mActClearRow->setEnabled(false); } else { mActClearRow->setEnabled(true); } } else if (mGameMode == MODE_MVH) { if (mGameState == STATE_RUNNING) { if (mCurRow == mSolutionRow) { mActSetHints->setEnabled(false); mActRandRow->setEnabled(true); if (mSolutionRow->GetPegCnt() == 0) { mActClearRow->setEnabled(false); } else { mActClearRow->setEnabled(true); } } else { mActSetHints->setEnabled(!mSettings->mAutoHints && !mSolver->isRunning()); mActRandRow->setEnabled(false); mActClearRow->setEnabled(false); } } else { mActRandRow->setEnabled(false); mActClearRow->setEnabled(false); mActSetHints->setEnabled(false); } } } void ColorCode::PauseGameSlot(GraphicsBtn*) { if (mCurRow == NULL) { return; } bool paused = (mGameState == STATE_PAUSED); if (mGameState == STATE_RUNNING) { mGameTimer->PauseT(); mActPauseGame->setText(tr("&Resume Game")); mActPauseGame->setIcon(QIcon(":/img/resume.png")); SetState(STATE_PAUSED); UpdateGameNoDisplay(); ResolveGame(); } else if (paused) { mGameTimer->ResumeT(); mActPauseGame->setText(tr("&Have a Break")); mActPauseGame->setIcon(QIcon(":/img/pause.png")); SetState(STATE_RUNNING); UpdateGameNoDisplay(); RowSolutionSlot(mCurRow->GetIx()); } mPegFactory->SetPaused(); for (int i = 0; i < mMaxRowCnt; ++i) { mHintBtns[i]->SetPaused(paused); } UpdateActions(); } void ColorCode::RestartGameSlot() { if (mSolver->isRunning()) { WaitForSolver(); } if (mGameMode == MODE_HVM) { ResetRows(); SetState(STATE_RUNNING); SetCurRow(NULL); mSolver->RestartGame(); NextRow(); } else if (mGameMode == MODE_MVH) { mHintsDelayTimer->stop(); mOkBtn->ShowBtn(false); ResetRows(); SetCurRow(NULL); mSolver->NewGame(mColorCnt, mPegCnt, mDoubles, mSolverStrength, mMaxRowCnt); mSolutionRow->OpenRow(); GetSolution(); SetState(STATE_RUNNING); RowSolutionSlot(mSolutionRow->GetIx()); } } void ColorCode::NewGameSlot() { if (mGameState == STATE_RUNNING && mCurRow != NULL) { int r = QMessageBox::warning( this, tr("New Game"), tr("Do you want to give in\nand start a new Game?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); if (r == QMessageBox::Yes) { mGameInput = NULL; NewGame(); } } else { mGameInput = NULL; NewGame(); } } void ColorCode::GiveInSlot() { int r = QMessageBox::Yes; if (mGameState == STATE_RUNNING && mCurRow != NULL) { r = QMessageBox::warning( this, tr("Give In"), tr("Do you really want to give in?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); } if (r == QMessageBox::Yes) { SetState(STATE_GAVE_UP); if (mSolver->isRunning()) { WaitForSolver(); } if (mCurRow != NULL) { mCurRow->CloseRow(); mHintBtns[mCurRow->GetIx()]->SetActive(false); } ResolveGame(); } } void ColorCode::CopyGameNoSlot() { uint no = 0; if (mGameInput != NULL) { no = mGameInput->mGameNo; } else if (mFinishedGameInput != NULL) { no = mFinishedGameInput->mGameNo; } if (no > 0) { QClipboard* cb = QApplication::clipboard(); cb->setText(QString::number(no)); } } void ColorCode::OpenPreferencesSlot() { if (mPrefDialog == NULL) { CreatePrefDialog(); } if (mPrefDialog == NULL) { return; } mSettings->SaveLastSettings(); mPrefDialog->SetSettings(); int r = mPrefDialog->exec(); if (r == QDialog::Accepted) { ApplySettingsSlot(); } else { mSettings->RestoreLastSettings(); } } void ColorCode::OnlineHelpSlot() { QDesktopServices::openUrl(QUrl("http://colorcode.laebisch.com/documentation", QUrl::TolerantMode)); } void ColorCode::AboutSlot() { About ab(this); ab.exec(); } void ColorCode::AboutQtSlot() { QMessageBox::aboutQt( this, tr("About Qt")); } void ColorCode::ShowToolbarSlot() { mSettings->mShowToolBar = mActShowToolbar->isChecked(); if (!mActShowToolbar->isChecked()) { mGameToolbar->hide(); mLevelToolbar->hide(); } else { mGameToolbar->show(); mLevelToolbar->show(); } Scale(); } void ColorCode::ShowMenubarSlot() { mSettings->mShowMenuBar = mActShowMenubar->isChecked(); if (!mActShowMenubar->isChecked()) { mMenuBar->hide(); } else { mMenuBar->show(); } Scale(); } void ColorCode::ShowStatusbarSlot() { mSettings->mShowStatusBar = mActShowStatusbar->isChecked(); if (!mActShowStatusbar->isChecked()) { statusBar()->hide(); } else { statusBar()->show(); } Scale(); } void ColorCode::ShowTimerSlot() { mSettings->mShowTimer = mActShowTimer->isChecked(); ShowTimer(); } void ColorCode::ShowTimer() { if (mGameMode == MODE_HVM) { mGameTimer->SetTenth(mSettings->mShowTenth); mGameTimer->setVisible(mSettings->mShowTimer); mGameTimer->update(); mGameTimerBg->setVisible(mSettings->mShowTimer); mTimerBtn->ShowBtn(mSettings->mShowTimer); } else { mGameTimer->setVisible(false); mGameTimerBg->setVisible(false); mTimerBtn->ShowBtn(false); } } void ColorCode::ShowGameNoSlot() { mSettings->mShowGameNo = mActShowGameNo->isChecked(); UpdateGameNoDisplay(); } void ColorCode::UpdateGameNoDisplay() { if (mGameMode == MODE_HVM) { QString str = tr("Human vs. Computer"); CCGame* g = GetCurrentGameInput(); if (mSettings->mShowGameNo && g != NULL && mGameState != STATE_PAUSED) { str += QString(" :: ") + QString(tr("Game Number")) + QString(": ") + QString::number(g->mGameNo); } mGameNoDisplay->ShowStr(str); } else if (mGameMode == MODE_MVH) { mGameNoDisplay->ShowStr(tr("Computer vs. Human")); } } CCGame* ColorCode::GetCurrentGameInput() const { if (mGameInput != NULL && mGameInput->IsValidGame()) { return mGameInput; } else if (mFinishedGameInput != NULL && mFinishedGameInput->IsValidGame()) { return mFinishedGameInput; } return NULL; } void ColorCode::CloseHighScoreDialogSlot() { ; } void ColorCode::SetIndicatorsSlot() { mSettings->mShowIndicators = mActShowIndicators->isChecked(); mPegFactory->SetIndicators(); } void ColorCode::AutoCloseSlot() { mSettings->mAutoClose = mActAutoClose->isChecked(); } void ColorCode::AutoHintsSlot() { mSettings->mAutoHints = mActAutoHints->isChecked(); if (mGameMode == MODE_MVH && mGameState == STATE_RUNNING && mCurRow != NULL && mCurRow != mSolutionRow) { mActSetHints->setEnabled(!mSettings->mAutoHints); if (mSettings->mAutoHints) { SetHintsSlot(); SetAutoHintsSlot(); } } } void ColorCode::ColorCntChangedSlot() { SetColorCnt(); if (mNoAct) { return; } int r = QMessageBox::Yes; if (GamesRunning()) { r = QMessageBox::question( this, tr("Message"), tr("The changed settings will only apply to new games!\nDo you want to give in the current and start a new Game?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); } if (r == QMessageBox::Yes) { mGameInput = NULL; NewGame(); } } void ColorCode::PegCntChangedSlot() { SetPegCnt(); if (mNoAct) { return; } int pcnt = GetPegCntInput(); if (pcnt == mPegCnt) { return; } int r = QMessageBox::Yes; if (GamesRunning()) { r = QMessageBox::question( this, tr("Message"), tr("The changed settings will only apply to new games!\nDo you want to give in the current and start a new Game?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); } if (r == QMessageBox::Yes) { mGameInput = NULL; NewGame(); } } void ColorCode::DoublesChangedSlot(bool checked) { if (mNoAct) { return; } SetDoublesSlot(checked); if (mDoubles == mSettings->mDoubles) { return; } int r = QMessageBox::Yes; if (GamesRunning()) { r = QMessageBox::question( this, tr("Message"), tr("The changed settings will only apply to new games!\nDo you want to give in the current and start a new Game?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); } if (r == QMessageBox::Yes) { mGameInput = NULL; NewGame(); } } void ColorCode::SetLevelSlot() { mNoAct = true; int ix = mActGroupLevels->checkedAction()->data().toInt(); if (ix < 0 || ix > 4) { return; } int i; i = mColorCntCmb->findData(LEVEL_SETTINGS[ix][0]); if (i != -1 && mColorCntCmb->currentIndex() != i) { mColorCntCmb->setCurrentIndex(i); SetColorCnt(); } i = mPegCntCmb->findData(LEVEL_SETTINGS[ix][1]); if (i != -1 && mPegCntCmb->currentIndex() != i) { mPegCntCmb->setCurrentIndex(i); SetPegCnt(); } SetDoublesSlot((LEVEL_SETTINGS[ix][2] == 1)); int r = QMessageBox::Yes; if (GamesRunning()) { r = QMessageBox::question( this, tr("Message"), tr("The changed settings will only apply to new games!\nDo you want to give in the current and start a new Game?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); } mNoAct = false; if (r == QMessageBox::Yes) { mGameInput = NULL; NewGame(); } } void ColorCode::SetGameModeSlot() { SetGameMode(); int r = QMessageBox::Yes; if (GamesRunning()) { r = QMessageBox::question( this, tr("Message"), tr("The changed settings will only apply to new games!\nDo you want to give in the current and start a new Game?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); } if (r == QMessageBox::Yes) { mGameInput = NULL; NewGame(); } } void ColorCode::SetPegCnt() { mSettings->mPegCnt = GetPegCntInput(); } void ColorCode::SetColorCnt() { mSettings->mColorCnt = GetColorCntInput(); } void ColorCode::SetGameMode() { mSettings->mGameMode = GetGameModeInput(); } void ColorCode::ShowMsgSlot(QString msg) { mMsg->ShowMsg(msg); } void ColorCode::SnapPegSlot(ColorPeg* cp) { int i; bool snapped = false; if (mGameMode == MODE_HVM) { QList list = mScene->items(QPointF(cp->pos().x() + 18, cp->pos().y() + 18)); if (mSolver->isRunning()) { WaitForSolver(); } for (i = 0; i < list.size(); ++i) { if (mCurRow != NULL && list.at(i) == mCurRow) { snapped = mCurRow->SnapCP(cp); break; } } } else if (mGameMode == MODE_MVH) { snapped = mSolutionRow->SnapCP(cp); } if (!snapped) { mPegFactory->RemovePegSlot(cp); } } void ColorCode::RowSolutionSlot(int ix) { if (mGameMode == MODE_HVM) { if (ix == SOLUTION_ROW_IX) { return; } std::vector s = mPegRows[ix]->GetSolution(); if (s.size() == (unsigned) mPegCnt) { if (mActAutoClose->isChecked()) { HintPressedSlot(ix); } else { mHintBtns[ix]->SetActive(true); ShowMsgSlot(tr("Press the Hint Field or Key Enter if You're done.")); } } else { mHintBtns[ix]->SetActive(false); ShowMsgSlot(tr("Place Your pegs ...")); } } else if (mGameMode == MODE_MVH) { if (ix == SOLUTION_ROW_IX) { std::vector s = mSolutionRow->GetSolution(); if (s.size() == (unsigned) mPegCnt) { bool valid = true; if (!mActDoubles->isChecked()) { int i; int check[mColorCnt]; for (i = 0; i < mColorCnt; ++i) { check[i] = 0; } for (i = 0; (unsigned)i < s.size(); ++i) { if (s[i] >= mColorCnt) { valid = false; break; } if (check[s[i]] != 0) { valid = false; break; } check[s[i]] = 1; } } if (valid) { mDoneBtn->ShowBtn(true); ShowMsgSlot(tr("Press the button below or Key Enter if You're done.")); } else { ShowMsgSlot(tr("The chosen settings do not allow pegs of the same color!")); } } else { mDoneBtn->ShowBtn(false); ShowMsgSlot(tr("Place Your secret ColorCode ...")); } } } } void ColorCode::HintPressedSlot(int) { mCurRow->CloseRow(); ResolveRow(); NextRow(); ResolveGame(); } void ColorCode::RandRowSlot() { if (mCurRow == NULL || !mCurRow->IsActive() || mGameState != STATE_RUNNING) { return; } if (mGameMode == MODE_HVM || (mGameMode == MODE_MVH && mCurRow == mSolutionRow)) { mCurRow->ClearRow(); int i, rndm; int check[mColorCnt]; ColorPeg* peg; for (i = 0; i < mColorCnt; ++i) { check[i] = 0; } for (i = 0; i < mPegCnt; ++i) { rndm = QRandomGenerator::global()->generate() % mColorCnt; if (mDoubles == 0 && check[rndm] != 0) { --i; continue; } check[rndm] = 1; peg = mPegFactory->CreatePeg(rndm); mCurRow->ForceSnap(peg, i); } } } void ColorCode::SetSolverGuessSlot() { if (mIgnoreGuess) { mIgnoreGuess = false; return; } if (mGameState != STATE_RUNNING || mCurRow == NULL) { return; } int* row = mSolver->GuessOut(); if (row == NULL) { SetState(STATE_ERROR); } else { ColorPeg* peg; int i; for (i = 0; i < mPegCnt; ++i) { peg = mPegFactory->CreatePeg(row[i]); mCurRow->ForceSnap(peg, i); } if (mGameMode == MODE_HVM) { return; } } if (mGameState == STATE_RUNNING) { mCurRow->CloseRow(); mHintBtns[mCurRow->GetIx()]->SetActive(true); if (mActAutoHints->isChecked()) { if (mOkBtn->isVisible()) { mOkBtn->ShowBtn(false); } ShowMsgSlot(tr("guessed and rated ...")); SetHintsSlot(); mHintBtns[mCurRow->GetIx()]->SetActive(false); std::vector rowhints = mHintBtns[mCurRow->GetIx()]->GetHints(); int b = 0; for (unsigned i = 0; i < rowhints.size(); ++i) { if (rowhints.at(i) == 2) { ++b; } } if (b == mPegCnt) { SetState(STATE_WON); ResolveGame(); } else { mHintsDelayTimer->start(); } } else { ShowMsgSlot(tr("Please rate the guess. Press OK or Key Enter if You're done.")); mOkBtn->setPos(5, mCurRow->pos().y() - 39); mOkBtn->ShowBtn(true); } } else { mCurRow->SetActive(false); ResolveGame(); } UpdateActions(); } void ColorCode::SetGuessSlot() { if (mCurRow == NULL || mCurRow == mSolutionRow || mGameState != STATE_RUNNING || mSolver->isRunning()) { return; } mCurRow->ClearRow(); ShowMsgSlot(tr("Let me think ...")); mSolver->StartGuess(); UpdateActions(); } void ColorCode::SetHintsSlot() { if (mCurRow == NULL || mGameState != STATE_RUNNING) { return; } if (mGameMode == MODE_MVH) { if (mCurRow == mSolutionRow || !mHintBtns[mCurRow->GetIx()]->IsActive()) { return; } std::vector hints = RateSol2Guess(mSolution, mCurRow->GetSolution()); mHintBtns[mCurRow->GetIx()]->DrawHints(hints); } } void ColorCode::PrevRowSlot() { if (mCurRow == NULL || mGameState != STATE_RUNNING) { return; } if (mCurRow->GetIx() < 1) { return; } mCurRow->ClearRow(); ColorPeg* peg; std::vector prev = mPegRows[mCurRow->GetIx() - 1]->GetSolution(); int i; for (i = 0; i < mPegCnt; ++i) { peg = mPegFactory->CreatePeg(prev.at(i)); mCurRow->ForceSnap(peg, i); } } void ColorCode::ClearRowSlot() { if (mCurRow == NULL || mGameState != STATE_RUNNING) { return; } mCurRow->ClearRow(); } void ColorCode::DoneBtnPressSlot(GraphicsBtn*) { mDoneBtn->ShowBtn(false); mOkBtn->ShowBtn(false); if (mCurRow == mSolutionRow) { SetSolution(); NextRow(); } else { ResolveHints(); } } void ColorCode::SetAutoHintsSlot() { DoneBtnPressSlot(mOkBtn); } void ColorCode::TestSlot() { ; } void ColorCode::ApplyPreferencesSlot() { ; } void ColorCode::CreatePrefDialog() { mPrefDialog = new PrefDialog(this); mPrefDialog->setModal(true); mPrefDialog->InitSettings(); connect(mPrefDialog, SIGNAL(accepted()), this, SLOT(ApplyPreferencesSlot())); connect(mPrefDialog, SIGNAL(accepted()), mGameTablesDialog, SLOT(SetSettingsSlot())); connect(mPrefDialog, SIGNAL(ResetColorOrderSignal()), mPegFactory, SLOT(ResetColorsOrderSlot())); } void ColorCode::CheckDoublesSetting() { if (mColorCnt < mPegCnt) { if (mActDoubles->isEnabled()) { mActDoubles->setEnabled(false); } if (mActDoublesIcon->isEnabled()) { mActDoublesIcon->setEnabled(false); } if (!mActDoubles->isChecked()) { mActDoubles->setChecked(true); } if (!mActDoublesIcon->isChecked()) { mActDoublesIcon->setChecked(true); } } else { if (!mActDoubles->isEnabled()) { mActDoubles->setEnabled(true); } if (!mActDoublesIcon->isEnabled()) { mActDoublesIcon->setEnabled(true); } } if (mActDoublesIcon->isChecked()) { mActDoublesIcon->setIcon(QIcon(":/img/same_color_1.png")); mActDoublesIcon->setToolTip(tr("Disallow Pegs of the Same Color")); } else { mActDoublesIcon->setIcon(QIcon(":/img/same_color_0.png")); mActDoublesIcon->setToolTip(tr("Allow Pegs of the Same Color")); } } void ColorCode::SetDoublesSlot(bool checked) { mSettings->mDoubles = checked; mActDoubles->setChecked(checked); mActDoublesIcon->setChecked(checked); if (checked) { mActDoublesIcon->setIcon(QIcon(":/img/same_color_1.png")); mActDoublesIcon->setToolTip(tr("Disallow Pegs of the Same Color")); } else { mActDoublesIcon->setIcon(QIcon(":/img/same_color_0.png")); mActDoublesIcon->setToolTip(tr("Allow Pegs of the Same Color")); } } void ColorCode::CheckLevel() { int ix = -1; for (int i = 0; i < 5; ++i) { if ( LEVEL_SETTINGS[i][0] == mColorCnt && LEVEL_SETTINGS[i][1] == mPegCnt && LEVEL_SETTINGS[i][2] == mDoubles ) { ix = i; break; } } if (ix > -1) { QList levelacts = mActGroupLevels->actions(); levelacts.at(ix)->setChecked(true); } else { QAction* act = mActGroupLevels->checkedAction(); if (act != NULL) { act->setChecked(false); } } } void ColorCode::ResetGame() { mDoneBtn->ShowBtn(false); mOkBtn->ShowBtn(false); ApplyPegCnt(); mSolutionRow->Reset(mPegCnt, mGameMode); ResetRows(); mGameId = QRandomGenerator::global()->generate(); mGuessCnt = 0; ++mGameCnt; mPegFactory->ApplyColorCnt(); CheckDoublesSetting(); mDoubles = GetDoublesInput(); CheckLevel(); ApplySolverStrength(); } void ColorCode::ResetRows() { for (int i = 0; i < mMaxRowCnt; ++i) { mPegRows[i]->Reset(mPegCnt, mGameMode); mHintBtns[i]->Reset(mPegCnt, mGameMode); } } void ColorCode::NewGameInputSlot(CCGame* g) { if (g != NULL && g->IsValidGame()) { mGameInput = g; mGameInput->Anonymize(); mNoAct = true; if (mGameInput->mGameMode == MODE_HVM) { mActModeHvM->setChecked(true); } else { mActModeMvH->setChecked(true); } SetDoublesSlot((bool) mGameInput->mDoubles); int i; i = mColorCntCmb->findData(mGameInput->mColorCnt); if (i != -1 && mColorCntCmb->currentIndex() != i) { mColorCntCmb->setCurrentIndex(i); } i = mPegCntCmb->findData(mGameInput->mPegCnt); if (i != -1 && mPegCntCmb->currentIndex() != i) { mPegCntCmb->setCurrentIndex(i); } CheckLevel(); mNoAct = false; } NewGame(); } CCGame* ColorCode::GetRandGameInput() { int gameno = mSolver->GetRandGameNo(mColorCnt, mPegCnt, mDoubles); CCGame* g = mSettings->GetCurSettingsGame(); g->mGameNo = gameno; return g; } void ColorCode::NewGame() { if (mGameState == STATE_PAUSED) { PauseGameSlot(); } mHintsDelayTimer->stop(); if (mSolver->isRunning()) { WaitForSolver(); } ApplyGameMode(); ResetGame(); QString doubles = (mDoubles == 1) ? tr("Yes") : tr("No"); QString colors = QString::number(mColorCnt, 10); QString pegs = QString::number(mPegCnt, 10); mStatusLabel->setText(tr("Pegs of Same Color") + ": " + doubles + " :: " + tr("Slots") + ": " + pegs + " :: " + tr("Colors") + ": " + colors + " "); SetState(STATE_RUNNING); SetCurRow(NULL); if (mGameMode == MODE_HVM) { mFinishedGameInput = NULL; mSolver->NewGame(mColorCnt, mPegCnt, mDoubles, CCSolver::STRENGTH_HIGH, mMaxRowCnt); mHighScore->NewGame(mSolver->CalcPosCnt(mColorCnt, mPegCnt, mDoubles)); if (mGameInput == NULL) { mGameInput = mSettings->GetCurSettingsGame(); } if (mGameInput->mColorCnt != mColorCnt) { mGameInput->mColorCnt = mColorCnt; } if (mGameInput->mPegCnt != mPegCnt) { mGameInput->mPegCnt = mPegCnt; } if (mGameInput->mDoubles != mDoubles) { mGameInput->mDoubles = mDoubles; } if (mGameInput->mGameMode != mGameMode) { mGameInput->mGameMode = mGameMode; } mGameInput->mDuration = 0; mGameInput->mTime = QDateTime::currentDateTime().toTime_t(); if (mGameInput->mGameNo == 0) { mGameInput->mGameNo = mSolver->GetRandGameNo(mColorCnt, mPegCnt, mDoubles); } mGameTablesDialog->InsertPrevGameSlot(mGameInput); SetSolution(); mGameTimer->StartT(); NextRow(); } else if (mGameMode == MODE_MVH) { mSolver->NewGame(mColorCnt, mPegCnt, mDoubles, mSolverStrength, mMaxRowCnt); GetSolution(); } UpdateGameNoDisplay(); } void ColorCode::NextRow() { if (mGameState != STATE_RUNNING) { return; } if (mCurRow == NULL) { SetCurRow(mPegRows[0]); } else if (mCurRow->GetIx() < mMaxRowCnt - 1) { SetCurRow(mPegRows[mCurRow->GetIx() + 1]); } else { SetCurRow(NULL); SetState(STATE_LOST); } if (mCurRow != NULL) { ++mGuessCnt; mCurRow->SetActive(true); if (mGameMode == MODE_HVM) { ++mHighScore->mRowsCnt; ShowMsgSlot(tr("Place Your pegs ...")); } else if (mGameMode == MODE_MVH) { SetGuessSlot(); } } } void ColorCode::SetCurRow(PegRow* const &row) { mCurRow = row; UpdateActions(); } void ColorCode::ResolveRow() { std::vector rowsol = mCurRow->GetSolution(); mSolver->GuessIn(&rowsol); std::vector hints = RateSol2Guess(mSolution, rowsol); if (hints.size() == (unsigned) mPegCnt) { int bl = 0; for (int i = 0; i < mPegCnt; ++i) { if (hints.at(i) == 2) { ++bl; } } if (bl == mPegCnt) { SetState(STATE_WON); } } mSolver->ResIn(&hints); mHintBtns[mCurRow->GetIx()]->DrawHints(hints); } std::vector ColorCode::RateSol2Guess(const std::vector sol, const std::vector guess) { std::vector hints; std::vector left1; std::vector left0; int i, p0, p1; for (i = 0; i < mPegCnt; ++i) { p0 = guess.at(i); p1 = sol.at(i); if (p0 == p1) { hints.push_back(2); } else { left0.push_back(p0); left1.push_back(p1); } } if (hints.size() < (unsigned) mPegCnt) { int len0 = left0.size(); for (i = 0; i < len0; ++i) { p0 = left0.at(i); for (unsigned j = 0; j < left1.size(); ++j) { p1 = left1.at(j); if (p0 == p1) { hints.push_back(1); left1.erase(left1.begin() + j); break; } } } } return hints; } void ColorCode::ResolveHints() { if (mCurRow == NULL) { return; } mHintBtns[mCurRow->GetIx()]->SetActive(false); std::vector rowsol = mCurRow->GetSolution(); mSolver->GuessIn(&rowsol); std::vector rowhints = mHintBtns[mCurRow->GetIx()]->GetHints(); int b = 0; int w = 0; for (unsigned i = 0; i < rowhints.size(); ++i) { if (rowhints.at(i) == 2) { ++b; } else if (rowhints.at(i) == 1) { ++w; } } if (b == mPegCnt) { SetState(STATE_WON); ResolveGame(); } else if (b == mPegCnt - 1 && w == 1) { ; } else { mSolver->ResIn(&rowhints); NextRow(); ResolveGame(); } } void ColorCode::ResolveGame() { if (mGameMode == MODE_HVM) { switch (mGameState) { case STATE_WON: { ShowMsgSlot(tr("Congratulation! You have won!")); mHighScore->mTime = mGameTimer->GetGameTime(); mGameInput->mScore = mHighScore->GetScore(); mGameInput->mDuration = mGameTimer->GetGameTime(); CCGame* g = new CCGame(mGameInput->ToString()); emit NewHighScoreSignal(g); } break; case STATE_LOST: ShowMsgSlot(tr("Sorry! You lost!")); break; case STATE_GAVE_UP: ShowMsgSlot(tr("Sure, You're too weak for me!")); break; case STATE_ERROR: ShowMsgSlot(tr("The impossible happened, sorry.")); break; case STATE_PAUSED: ShowMsgSlot(tr("Paused")); return; break; case STATE_RUNNING: default: return; break; } mFinishedGameInput = new CCGame(mGameInput->ToString()); mGameInput = NULL; mGameTimer->StopT(); ShowSolution(); } else if (mGameMode == MODE_MVH) { switch (mGameState) { case STATE_WON: ShowMsgSlot(tr("Yeah! I guessed it, man!")); break; case STATE_LOST: ShowMsgSlot(tr("Embarrassing! I lost a game!")); break; case STATE_GAVE_UP: ShowMsgSlot(tr("Don't you like to see me winning? ;-)")); break; case STATE_ERROR: ShowMsgSlot(tr("Nope! Thats impossible! Did you gave me false hints?")); break; case STATE_RUNNING: default: return; break; } mDoneBtn->ShowBtn(false); mOkBtn->ShowBtn(false); } SetCurRow(NULL); } void ColorCode::ApplyGameMode() { mGameMode = GetGameModeInput(); if (mGameMode == MODE_HVM) { mActSetHints->setVisible(false); mActSetGuess->setVisible(true); mActPrevRow->setVisible(true); } else if (mGameMode == MODE_MVH) { mActSetHints->setVisible(true); mActSetGuess->setVisible(false); mActPrevRow->setVisible(false); } ShowTimer(); } int ColorCode::GetGameState() const { return mGameState; } int ColorCode::GetGameModeInput() const { int ix = mActGroupModes->checkedAction()->data().toInt(); if (ix != MODE_HVM && ix != MODE_MVH) { ix = MODE_HVM; } return ix; } int ColorCode::GetDoublesInput() const { return (int) mActDoubles->isChecked(); } int ColorCode::GetColorCntInput() const { int ccnt = mColorCntCmb->itemData(mColorCntCmb->currentIndex(), Qt::UserRole).toInt(); ccnt = max(2, min(10, ccnt)); return ccnt; } int ColorCode::GetPegCntInput() const { int pegcnt = mPegCntCmb->itemData(mPegCntCmb->currentIndex(), Qt::UserRole).toInt(); pegcnt = max(2, min(5, pegcnt)); return pegcnt; } void ColorCode::ApplyPegCnt() { mPegCnt = GetPegCntInput(); mXOffs = 160 - mPegCnt * 20; } void ColorCode::ApplySolverStrength() { mSolverStrength = mSettings->mSolverStrength; } void ColorCode::SetSolution() { mSolution.clear(); if (mGameMode == MODE_HVM) { mSolutionRow->ClearRow(); mSolution = mSolver->GetSolutionByNo(mGameInput->mGameNo); } else if (mGameMode == MODE_MVH) { std::vector s = mSolutionRow->GetSolution(); if (s.size() == (unsigned) mPegCnt) { mSolutionRow->CloseRow(); mDoneBtn->ShowBtn(false); for (int i = 0; i < mPegCnt; ++i) { mSolution.push_back(s.at(i)); } } } } void ColorCode::GetSolution() { ShowMsgSlot(tr("Place Your secret ColorCode ...")); mSolutionRow->SetActive(true); SetCurRow(mSolutionRow); } void ColorCode::ShowSolution() { mSolutionRow->SetActive(true); ColorPeg* peg; for (int i = 0; i < mPegCnt; ++i) { peg = mPegFactory->CreatePeg(mSolution.at(i)); peg->SetBtn(false); mSolutionRow->ForceSnap(peg, i); } mSolutionRow->CloseRow(); } void ColorCode::SetState(const int s) { if (mGameState != s) { mGameState = s; } } bool ColorCode::GamesRunning() { if (mGameMode == MODE_HVM) { return ((mGameState == STATE_RUNNING || mGameState == STATE_PAUSED) && mGuessCnt > 1); } else if (mGameMode == MODE_MVH) { return (mGameState == STATE_RUNNING && mCurRow != mSolutionRow); } return false; } void ColorCode::Scale() { if (mGameCnt == 0) { return; } qreal w = geometry().width(); qreal h = geometry().height(); if (mActShowStatusbar->isChecked()) { h -= statusBar()->height(); } if (mActShowMenubar->isChecked()) { h -= mMenuBar->height(); } if (mActShowToolbar->isChecked()) { h -= mGameToolbar->height(); } if (w < 50 || h < 50) { return; } if (mOrigSize == NULL) { mOrigSize = new QSize(320, 560); mScene->setSceneRect(QRectF(0, 0, 320, 560)); } else { qreal sc = min(w / mOrigSize->width(), h / mOrigSize->height()); mView->resetTransform(); mView->scale(sc, sc); } } CCSolver* ColorCode::GetCCSolver() const { return mSolver; } void ColorCode::WaitForSolver() { mIgnoreGuess = true; mSolver->Interrupt(); mSolver->wait(); } bool ColorCode::ForceRepaint() { mView->viewport()->repaint(); QApplication::processEvents(); return true; } void ColorCode::SavePrevGameSlot() { CCGame* g = GetCurrentGameInput(); if (g != NULL) { mGameTablesDialog->InsertSavedGameSlot(g); } } ColorCode-0.8.7/src/trans_en.ts0000644000175000017500000010161014527465645015034 0ustar dirkdirk About &Author icon &License A needful game to train your brain ;-) About ColorCode <br><br>Free MasterMind clone including a built in,<br>rather intelligent solver. Version Author This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. ButtonsCell Play this Game again Save this Game as Bookmark Remove from List Copy Game Number to Clipboard ColorCode New Game Do you want to give in and start a new Game? About Qt &New Game Ctrl+N &Restart Game Ctrl+R E&xit Ctrl+Q Ctrl+T Ctrl+C Ctrl+A About &Qt &Game &Settings &Help Game Message The changed settings will only apply to new games! Do you want to give in the current and start a new Game? Place Your pegs ... Congratulation! You have won! Sorry! You lost! Ctrl+I Give In Do you really want to give in? &Throw In The Towel Ctrl+G Sure, You're too weak for me! Ctrl+Shift+R Ctrl+Shift+C Fill Row by Random Duplicate Previous Row Ctrl+D Clear Row &Row About &ColorCode Ctrl+M Show Toolbar Show Menubar Show Statusbar Allow Pegs of the Same Color Level Computer's Guess Ctrl+H Press the Hint Field or Key Enter if You're done. Disallow Pegs of the Same Color Close Rows when the last Peg is placed Ctrl+L Beginner (2 Colors, 2 Slots, Doubles) Easy (4 Colors, 3 Slots, No Doubles) Classic (6 Colors, 4 Slots, Doubles) Challenging (8 Colors, 4 Slots, Doubles) Hard (10 Colors, 5 Slots, Doubles) Level Presets Colors Pegs of Same Color Slots Yes No Reset Color Order Ctrl+Shift+L Online &Help F1 Done Ctrl+Shift+N Rate it for me Human vs Computer Computer vs Human Game Mode Press the button below or Key Enter if You're done. Place Your secret ColorCode ... Please rate the guess. Press OK or Key Enter if You're done. The impossible happened, sorry. Yeah! I guessed it, man! Embarrassing! I lost a game! Nope! Thats impossible! Did you gave me false hints? Don't you like to see me winning? ;-) Set Hints automatically Ctrl+Shift+H Preferences Ctrl+P Show Indicators The chosen settings do not allow pegs of the same color! &Start particular Game Ctrl+B Ctrl+Alt+H &Recent Games Ctrl+Alt+R &Bookmarks Ctrl+Alt+B Ctrl+Shift+S Game &Lists guessed and rated ... Let me think ... Computer vs. Human &Highscores Ctrl+Shift+B Ctrl+Alt+N &Have a Break &Bookmark Current Game Ctrl+Shift+T Show Timer Display Game Number Allow Pegs of Same Color Disallow Pegs of Same Color Ctrl+Alt+C Ctrl+Shift+P &Resume Game Human vs. Computer Game Number Paused &Copy Game Number ColorCode GameTablesDialog ColorCode Games Game Properties User Color Count Slot Count Pegs of Same Color Yes Game Number Date and Time Duration Insert Game Number Play Recent Games Bookmarks Highscores Clear List Close No Message This will permanently remove all entries from the List. Do You want to proceed? Game Number Input Bookmarked Games High Score List Please provide a name! Otherwise your score won't be saved. Insert an arbitrary game number greater than 0 in the input field above. <br><br>The game properties like color count, slot count etc. will be displayed in the corresponding area above.<br><br>Click the Play button or press key Enter, to play the game. If a game is currently running, it will be aborted. Game Lists GamesListModel Yes No Pegs of Same Color Actions Rank User Score Date Time Colors Slots Game No. PrefDialog ... Select from predefined level settings Beginner (2 Colors, 2 Slots, Doubles) Easy (4 Colors, 3 Slots, No Doubles) Classic (6 Colors, 4 Slots, Doubles) Challenging (8 Colors, 4 Slots, Doubles) Hard (10 Colors, 5 Slots, Doubles) Slots Colors Human vs. Computer Computer vs. Human Low Medium High Preferences Controls Show or hide the Menubar. Show Menubar Show or hide the Toolbar. Show Toolbar Show or hide the Statusbar. Show Statusbar Indicators If this option is checked, an indicator inside each peg is displayed. Show Indicators inside pegs Use unique letters as indicators. Letter Indicators Use unique numbers as indicators. Number Indicators Use the same neutral background color for each peg, when indicators are shown. Hide Colors Click here if you have changed the color order and now you want to revert it to it's initial state. Reset Color Order Game Settings Select from predefined combinations of the three different level related settings, the number of colors, the number of slots (columns) and the possibility of pegs of the same color in one row. Number of Slots Number of Colors Number of pegs in a single row. Higher values are harder to guess. Number of all possible colors. Higher values are harder to guess. If this option is checked, the hidden combination may contain one or more (even all would be possible) pegs of the same color. If checked, the combination is generally harder to guess. Allow Pegs of Same Color Game Mode Select from the different game modes. In the 1. mode you have to to guess the hidden, computer generated combination, In the 2. mode your computer will try to guess your own secret combination. If checked, a row is closed as soon as you place the last peg and your guess is submitted immediatly. This option only affects the Human vs. Computer game mode. Close Rows when the last Peg is placed If checked, the computer will determine the corresponding hints for the solver's guess. This option affects only Computer vs. Human games. If checked, you only have to place your secret combination. Then the rest of the game runs automatically until the end. But you can set a delay between the guesses. Set Hints automatically Adjust the delay (in ms) between two guesses. Delay in ms Solver Strength Select from 3 different strength levels for your computer opponent. This option only affects the Computer vs. Human game mode. For the computer's guess in the Human vs. Computer mode always the highest level will be used. Show Game Timer Display Game Number Game Lists Maximum Row Count: Use Highscores Raise the dialog after a game has been won and prompt for the name Automatically insert Highscores using the name below Name (mandatory for the second option) User Interface Display the current game number in the footer. To avoid remembering, you can hide it here. Timer You may hide the timer to keep calm ;-) But note! Even hidden, time's running in the background. Game Properties Select One of the Level Presets: Or Set the Particular Properties: Game Flow Solver Limit the number of rows in game tables like highscores etc. Valid values range from 5 to 50. Use Customized Table Row Highlight Colors Foreground Background Highscores Provide a name with maximum 20 characters here to be used for highscore entries. If you checked the automatic option above, this name is mandatory, otherwise it will be used as proposal which you may change later in the dialog. Uncheck this if you are confused about the time as fast running ;-) Show Tenth and Hundredth RowHint Commit Your solution Click the circles to rate my guess. Hit Ctrl+H or the corresponding toolbar button to let an impartial part of me do this for you ;-) ColorCode-0.8.7/src/background.h0000644000175000017500000000273312610736534015136 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef BACKGROUND_H #define BACKGROUND_H #include #include #include #include #include #include "colorcode.h" class BackGround : public QObject, public QGraphicsItem { Q_OBJECT Q_INTERFACES(QGraphicsItem) public: BackGround(QObject* parent = 0); ~BackGround(); QRectF boundingRect() const; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); private: QRectF outlineRect() const; QBrush mTopGrad; QBrush mBotGrad; QPen mFramePen; QColor mPend; QColor mPenl; QColor mGrad0; QColor mGrad1; }; #endif // BACKGROUND_H ColorCode-0.8.7/src/colorcode.pro0000644000175000017500000000354314527411662015342 0ustar dirkdirklessThan(QT_MAJOR_VERSION, 5): error("This version of ColorCode requires Qt 5. For QT 4 try version 0.7.2: http://colorcode.laebisch.com/download") QMAKE_CFLAGS_DEBUG -= -O2 QMAKE_CFLAGS_RELEASE -= -O2 QMAKE_CXXFLAGS_DEBUG -= -O2 QMAKE_CXXFLAGS_RELEASE -= -O2 QMAKE_CXXFLAGS += -O3 QMAKE_CFLAGS += -O3 TARGET = colorcode TEMPLATE = app QM_FILES_RESOURCE_PREFIX = / CONFIG += lrelease embed_translations QT += widgets # Input HEADERS += about.h \ colorcode.h \ colorpeg.h \ msg.h \ pegrow.h \ rowhint.h \ ccsolver.h \ background.h \ solutionrow.h \ graphicsbtn.h \ settings.h \ prefdialog.h \ pegfactory.h \ gamenodisplay.h \ timedisplay.h \ timedisplaybg.h \ highscore.h \ ccgame.h \ buttonscell.h \ buttondelegate.h \ cellbtn.h \ gametimer.h \ savedgamesmodel.h \ prevgamesmodel.h \ highscoresmodel.h \ gametableview.h \ gametablesdialog.h \ gameslistmodel.h FORMS += about.ui \ prefdialog.ui \ gametablesdialog.ui SOURCES += about.cpp \ colorcode.cpp \ colorpeg.cpp \ main.cpp \ msg.cpp \ pegrow.cpp \ rowhint.cpp \ ccsolver.cpp \ background.cpp \ solutionrow.cpp \ graphicsbtn.cpp \ settings.cpp \ prefdialog.cpp \ pegfactory.cpp \ gamenodisplay.cpp \ timedisplay.cpp \ timedisplaybg.cpp \ highscore.cpp \ ccgame.cpp \ buttonscell.cpp \ buttondelegate.cpp \ cellbtn.cpp \ gametimer.cpp \ savedgamesmodel.cpp \ prevgamesmodel.cpp \ highscoresmodel.cpp \ gametableview.cpp \ gametablesdialog.cpp \ gameslistmodel.cpp RESOURCES += resource.qrc OTHER_FILES += docs/GPL.html win32:RC_FILE = colorcode.rc TRANSLATIONS += trans_de.ts \ trans_en.ts \ trans_cs.ts \ trans_fr.ts \ trans_hu.ts \ trans_es.ts CODECFORTR = UTF-8 CODECFORSRC = UTF-8 ColorCode-0.8.7/src/main.cpp0000644000175000017500000000633114527472435014302 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include #include #include #include #include #include "colorcode.h" int main(int argc, char* argv[]) { using namespace std; string lang(""); if (argc > 1) { string str; for (int i = 1; i < argc; ++i) { str = argv[i]; if (str == "-h" || str == "--help") { cout << "usage: ColorCode [options]" << endl; cout << " options:" << endl; cout << " -l cc, --lang=cc use country code cc instead of system locale, accepted values for cc: en|de|cs|fr|hu|es" << endl; cout << " -h, --help prints this message ;-)" << endl; return 0; } else if (str == "-l" && i < argc - 1) { if (std::string(argv[i + 1]) == "de" || std::string(argv[i + 1]) == "en" || std::string(argv[i + 1]) == "cs" || std::string(argv[i + 1]) == "fr" || std::string(argv[i + 1]) == "hu" || std::string(argv[i + 1]) == "es" ) { std::string test(argv[i]); lang = argv[i + 1]; } } else if ( str.size() == 9 && str.find("--lang=") != string::npos && (str.substr(7) == "en" || str.substr(7) == "de" || str.substr(7) == "cs" || str.substr(7) == "fr" || str.substr(7) == "hu" || str.substr(7) == "es" ) ) { lang = str.substr(7); } } } QApplication app(argc, argv); QTranslator qtTranslator; if (lang == "") { qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); } else { qtTranslator.load("qt_" + QString::fromStdString(lang), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); } app.installTranslator(&qtTranslator); QTranslator appTranslator; if (lang == "") { appTranslator.load(":/trans_" + QLocale::system().name()); } else { appTranslator.load(":/trans_" + QString::fromStdString(lang)); } app.installTranslator(&appTranslator); ColorCode w; w.show(); return app.exec(); } ColorCode-0.8.7/src/colorcode.rc0000644000175000017500000000007312610736534015140 0ustar dirkdirkIDI_ICON1 ICON DISCARDABLE "cc32.ico" ColorCode-0.8.7/src/prefdialog.cpp0000644000175000017500000003477212610736534015476 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #include "prefdialog.h" using namespace std; PrefDialog::PrefDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f) { setupUi(this); setSizeGripEnabled(false); mSuppressSlots = false; InitControls(); } PrefDialog::~PrefDialog() { } void PrefDialog::InitControls() { mLevelPresetsCmb->addItem(tr("... Select from predefined level settings"), -1); mLevelPresetsCmb->addItem(tr("Beginner (2 Colors, 2 Slots, Doubles)"), 0); mLevelPresetsCmb->addItem(tr("Easy (4 Colors, 3 Slots, No Doubles)"), 1); mLevelPresetsCmb->addItem(tr("Classic (6 Colors, 4 Slots, Doubles)"), 2); mLevelPresetsCmb->addItem(tr("Challenging (8 Colors, 4 Slots, Doubles)"), 3); mLevelPresetsCmb->addItem(tr("Hard (10 Colors, 5 Slots, Doubles)"), 4); mPegCntCmb->addItem("2 " + tr("Slots"), 2); mPegCntCmb->addItem("3 " + tr("Slots"), 3); mPegCntCmb->addItem("4 " + tr("Slots"), 4); mPegCntCmb->addItem("5 " + tr("Slots"), 5); mColorCntCmb->addItem("2 " + tr("Colors"), 2); mColorCntCmb->addItem("3 " + tr("Colors"), 3); mColorCntCmb->addItem("4 " + tr("Colors"), 4); mColorCntCmb->addItem("5 " + tr("Colors"), 5); mColorCntCmb->addItem("6 " + tr("Colors"), 6); mColorCntCmb->addItem("7 " + tr("Colors"), 7); mColorCntCmb->addItem("8 " + tr("Colors"), 8); mColorCntCmb->addItem("9 " + tr("Colors"), 9); mColorCntCmb->addItem("10 " + tr("Colors"), 10); mGameModeCmb->addItem(tr("Human vs. Computer"), ColorCode::MODE_HVM); mGameModeCmb->addItem(tr("Computer vs. Human"), ColorCode::MODE_MVH); mStrengthCmb->addItem(tr("Low"), CCSolver::STRENGTH_LOW); mStrengthCmb->addItem(tr("Medium"), CCSolver::STRENGTH_MEDIUM); mStrengthCmb->addItem(tr("High"), CCSolver::STRENGTH_HIGH); mDelaySb->setMaximum(10000); mDelaySb->setMinimum(0); mDelaySb->setSingleStep(100); mUserNameLe->setMaxLength(Settings::MAX_LENGTH_USERNAME); connect(mCustomRowHColorCb, SIGNAL(stateChanged(int)), this, SLOT(CustomRowHColorChangedSlot(int))); connect(mRowHColorFgBtn, SIGNAL(clicked()), this, SLOT(SetBtnColorSlot())); connect(mRowHColorBgBtn, SIGNAL(clicked()), this, SLOT(SetBtnColorSlot())); mRestoreBtn = mButtonBox->button(QDialogButtonBox::RestoreDefaults); mOkBtn = mButtonBox->button(QDialogButtonBox::Ok); mApplyBtn = mButtonBox->button(QDialogButtonBox::Apply); mCancelBtn = mButtonBox->button(QDialogButtonBox::Cancel); connect(mLevelPresetsCmb, SIGNAL(currentIndexChanged(int)), this, SLOT(LevelPresetChangedSlot())); connect(mColorCntCmb, SIGNAL(currentIndexChanged(int)), this, SLOT(ColorCntChangedSlot())); connect(mPegCntCmb, SIGNAL(currentIndexChanged(int)), this, SLOT(PegCntChangedSlot())); connect(mDoublesCb, SIGNAL(stateChanged(int)), this, SLOT(DoublesChangedSlot())); connect(mShowIndicatorsCb, SIGNAL(stateChanged(int)), this, SLOT(ShowIndicatorsChangedSlot(int))); connect(mShowTimerCb, SIGNAL(stateChanged(int)), this, SLOT(ShowTimerChangedSlot(int))); connect(mResetColorOrderBtn, SIGNAL(clicked()), this, SLOT(ResetColorOrderSlot())); connect(mRestoreBtn, SIGNAL(clicked()), this, SLOT(RestoreDefSlot())); connect(mApplyBtn, SIGNAL(clicked()), this, SLOT(ApplySlot())); connect(mCancelBtn, SIGNAL(clicked()), this, SLOT(CancelSlot())); connect(mOkBtn, SIGNAL(clicked()), this, SLOT(OkSlot())); connect(mUseHighscoresCb, SIGNAL(stateChanged(int)), this, SLOT(UseHighscoresChangedSlot(int))); } void PrefDialog::InitSettings() { mSettings = GetSettings(); SetSettings(); } void PrefDialog::SetSettings() { bool sup = SetSuppressSlots(true); mMenuBarCb->setChecked(mSettings->mShowMenuBar); mStatusBarCb->setChecked(mSettings->mShowStatusBar); mToolBarCb->setChecked(mSettings->mShowToolBar); mShowGameNoCb->setChecked(mSettings->mShowGameNo); mShowTimerCb->setChecked(mSettings->mShowTimer); mShowTenthCb->setChecked(mSettings->mShowTenth); ShowTimerChangedSlot(mShowTimerCb->checkState()); mShowIndicatorsCb->setChecked(mSettings->mShowIndicators); if (mSettings->mIndicatorType == Settings::INDICATOR_NUMBER) { mNumbersRb->setChecked(true); } else { mLettersRb->setChecked(true); } mHideColorsCb->setChecked(mSettings->mHideColors); int i; i = mColorCntCmb->findData(mSettings->mColorCnt); if (i != -1 && mColorCntCmb->currentIndex() != i) { mColorCntCmb->setCurrentIndex(i); } i = mPegCntCmb->findData(mSettings->mPegCnt); if (i != -1 && mPegCntCmb->currentIndex() != i) { mPegCntCmb->setCurrentIndex(i); } mDoublesCb->setChecked(mSettings->mDoubles); CheckDoubles(); CheckLevelPresets(); i = mGameModeCmb->findData(mSettings->mGameMode); if (i != -1 && mGameModeCmb->currentIndex() != i) { mGameModeCmb->setCurrentIndex(i); } i = mStrengthCmb->findData(mSettings->mSolverStrength); if (i != -1 && mStrengthCmb->currentIndex() != i) { mStrengthCmb->setCurrentIndex(i); } mAutoCloseCb->setChecked(mSettings->mAutoClose); mAutoHintsCb->setChecked(mSettings->mAutoHints); mDelaySb->setValue(mSettings->mHintsDelay); mGamesListMaxCntSb->setValue(mSettings->mGamesListMaxCnt); mUserNameLe->setText(mSettings->mHighScoreUserName); if (mSettings->mHighScoreHandling == Settings::HIGHSCORE_PROMPT) { mUseHighscoresCb->setChecked(true); mHighscorePromptRb->setChecked(true); } else if(mSettings->mHighScoreHandling == Settings::HIGHSCORE_AUTO) { mUseHighscoresCb->setChecked(true); mHighscoreAutoRb->setChecked(true); } else if (mSettings->mHighScoreHandling == Settings::HIGHSCORE_NO) { mUseHighscoresCb->setChecked(false); } mCustomRowHColorCb->setChecked(mSettings->mCustomRowHColor); CustomRowHColorChangedSlot(mCustomRowHColorCb->checkState()); if (sup) { SetSuppressSlots(false); ShowIndicatorsChangedSlot(mShowIndicatorsCb->checkState()); UseHighscoresChangedSlot(mUseHighscoresCb->checkState()); } } void PrefDialog::LevelPresetChangedSlot() { int ix, i; ix = mLevelPresetsCmb->itemData(mLevelPresetsCmb->currentIndex()).toInt(); if (ix < 0 || ix > 4) { return; } bool sup = SetSuppressSlots(true); i = mColorCntCmb->findData(ColorCode::LEVEL_SETTINGS[ix][0]); if (i != -1 && mColorCntCmb->currentIndex() != i) { mColorCntCmb->setCurrentIndex(i); } i = mPegCntCmb->findData(ColorCode::LEVEL_SETTINGS[ix][1]); if (i != -1 && mPegCntCmb->currentIndex() != i) { mPegCntCmb->setCurrentIndex(i); } mDoublesCb->setChecked((ColorCode::LEVEL_SETTINGS[ix][2] == 1)); if (sup) { SetSuppressSlots(false); } } void PrefDialog::CheckLevelPresets() { int ix = -1; for (int i = 0; i < 5; ++i) { if ( ColorCode::LEVEL_SETTINGS[i][0] == mColorCntCmb->itemData(mColorCntCmb->currentIndex()).toInt() && ColorCode::LEVEL_SETTINGS[i][1] == mPegCntCmb->itemData(mPegCntCmb->currentIndex()).toInt() && ColorCode::LEVEL_SETTINGS[i][2] == (int) mDoublesCb->isChecked() ) { ix = i; break; } } mLevelPresetsCmb->setCurrentIndex(mLevelPresetsCmb->findData(ix)); } void PrefDialog::CheckDoubles() { if (mColorCntCmb->itemData(mColorCntCmb->currentIndex()).toInt() < mPegCntCmb->itemData(mPegCntCmb->currentIndex()).toInt()) { if (!mDoublesCb->isChecked()) { mDoublesCb->setChecked(true); } mDoublesCb->setEnabled(false); } else { mDoublesCb->setEnabled(true); } } void PrefDialog::CustomRowHColorChangedSlot(int state) { bool en = (state == Qt::Checked); mRowHColorFgBtn->setEnabled(en); mRowHColorBgBtn->setEnabled(en); mFgLbl->setEnabled(en); mBgLbl->setEnabled(en); QColor color; color = GetCurBtnColor(mRowHColorFgBtn); if (!en) { color = Desaturate(color); } if (color.isValid()) { SetSwatchStyleSheet(mRowHColorFgBtn, color.name()); } color = GetCurBtnColor(mRowHColorBgBtn); if (!en) { color = Desaturate(color); } if (color.isValid()) { SetSwatchStyleSheet(mRowHColorBgBtn, color.name()); } } QColor PrefDialog::Desaturate(QColor c) { qreal h; qreal s; qreal v; qreal a; c.getHsvF(&h, &s, &v, &a); v = qMin((0.8 + v * 0.2), 1.0); c.setHsvF(h, (s * 0.2), v, 1.0); return c; } void PrefDialog::SetSwatchStyleSheet(QPushButton* btn, const QString colorstr) { btn->setStyleSheet(QString("QPushButton { background-color: " + colorstr + "; border: 1px solid palette(dark) } QPushButton:hover { border: 1px solid palette(highlight) }")); btn->update(); } void PrefDialog::SetBtnColorSlot() { QPushButton* btn = qobject_cast(sender()); SetBtnColor(btn); } void PrefDialog::SetBtnColor(QPushButton* btn) { if (mSettings == NULL || btn == NULL) { return; } QColor curcolor = GetCurBtnColor(btn); if (curcolor.isValid()) { curcolor = QColorDialog::getColor(curcolor, this); } if (curcolor.isValid()) { SetSwatchStyleSheet(btn, curcolor.name()); if (btn == mRowHColorFgBtn) { mSettings->mRowHColorFg = curcolor.name(); } else if (btn == mRowHColorBgBtn) { mSettings->mRowHColorBg = curcolor.name(); } } } QColor PrefDialog::GetCurBtnColor(const QPushButton* btn) { QColor color; if (mSettings != NULL) { if (btn == mRowHColorBgBtn) { color.setNamedColor(mSettings->mRowHColorBg); } else { color.setNamedColor(mSettings->mRowHColorFg); } } if (mSettings == NULL || !color.isValid()) { if (btn == mRowHColorBgBtn) { color = QApplication::palette().color(QPalette::Active, QPalette::Button); } else { color = QApplication::palette().color(QPalette::Active, QPalette::ButtonText); } } return color; } void PrefDialog::ColorCntChangedSlot() { if (!mSuppressSlots) { CheckDoubles(); CheckLevelPresets(); } } void PrefDialog::PegCntChangedSlot() { if (!mSuppressSlots) { CheckDoubles(); CheckLevelPresets(); } } void PrefDialog::DoublesChangedSlot() { if (!mSuppressSlots) { CheckDoubles(); CheckLevelPresets(); } } void PrefDialog::UseHighscoresChangedSlot(int state) { if (!mSuppressSlots) { bool en = (state != Qt::Unchecked); mHighscorePromptRb->setEnabled(en); mHighscoreAutoRb->setEnabled(en); mUserNameLe->setEnabled(en); mUserNameLbl->setEnabled(en); } } void PrefDialog::ShowIndicatorsChangedSlot(int state) { if (!mSuppressSlots) { bool en = (state != Qt::Unchecked); mLettersRb->setEnabled(en); mNumbersRb->setEnabled(en); mHideColorsCb->setEnabled(en); } } void PrefDialog::ShowTimerChangedSlot(int state) { bool en = (state == Qt::Checked); mShowTenthCb->setEnabled(en); } void PrefDialog::ResetColorOrderSlot() { emit ResetColorOrderSignal(); } void PrefDialog::RestoreDefSlot() { mSettings->RestoreDefSettings(); SetSettings(); } void PrefDialog::ApplySlot() { ApplySettings(); setResult(QDialog::Accepted); accept(); } void PrefDialog::OkSlot() { ApplySettings(); setResult(QDialog::Accepted); accept(); } void PrefDialog::CancelSlot() { setResult(QDialog::Rejected); reject(); } bool PrefDialog::SetSuppressSlots(bool b, bool force) { if (mSuppressSlots == b && !force) { return false; } mSuppressSlots = b; return true; } void PrefDialog::ApplySettings() { mSettings->mShowMenuBar = mMenuBarCb->isChecked(); mSettings->mShowStatusBar = mStatusBarCb->isChecked(); mSettings->mShowToolBar = mToolBarCb->isChecked(); mSettings->mShowTimer = mShowTimerCb->isChecked(); mSettings->mShowTenth = mShowTenthCb->isChecked(); mSettings->mShowGameNo = mShowGameNoCb->isChecked(); mSettings->mShowIndicators = mShowIndicatorsCb->isChecked(); if (mNumbersRb->isChecked()) { mSettings->mIndicatorType = Settings::INDICATOR_NUMBER; } else { mSettings->mIndicatorType = Settings::INDICATOR_LETTER; } mSettings->mHideColors = mHideColorsCb->isChecked(); mSettings->mColorCnt = mColorCntCmb->itemData(mColorCntCmb->currentIndex()).toInt(); mSettings->mPegCnt = mPegCntCmb->itemData(mPegCntCmb->currentIndex()).toInt(); mSettings->mDoubles = mDoublesCb->isChecked(); mSettings->mGameMode = mGameModeCmb->itemData(mGameModeCmb->currentIndex()).toInt(); mSettings->mSolverStrength = mStrengthCmb->itemData(mStrengthCmb->currentIndex()).toInt(); mSettings->mAutoClose = mAutoCloseCb->isChecked(); mSettings->mAutoHints = mAutoHintsCb->isChecked(); mSettings->mHintsDelay = mDelaySb->value(); mSettings->mHighScoreUserName = mUserNameLe->text(); mSettings->mGamesListMaxCnt = mGamesListMaxCntSb->value(); if (mUseHighscoresCb->isChecked()) { if (mHighscorePromptRb->isChecked()) { mSettings->mHighScoreHandling = Settings::HIGHSCORE_PROMPT; } else { mSettings->mHighScoreHandling = Settings::HIGHSCORE_AUTO; } } else { mSettings->mHighScoreHandling = Settings::HIGHSCORE_NO; } mSettings->mCustomRowHColor = mCustomRowHColorCb->isChecked(); mSettings->mRowHColorFg = GetCurBtnColor(mRowHColorFgBtn).name(); mSettings->mRowHColorBg = GetCurBtnColor(mRowHColorBgBtn).name(); mSettings->Validate(); } QSize PrefDialog::sizeHint () const { return QSize(500, 400); } ColorCode-0.8.7/src/msg.h0000644000175000017500000000237412610736534013606 0ustar dirkdirk/* ColorCode, a free MasterMind clone with built in solver * Copyright (C) 2009 Dirk Laebisch * http://www.laebisch.com/ * * ColorCode 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. * * ColorCode 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 ColorCode. If not, see . */ #ifndef MSG_H #define MSG_H #include #include #include #include #include #include class Msg : public QGraphicsTextItem { public: Msg(); ~Msg(); void ShowMsg(const QString str); QRectF boundingRect() const; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); private: QTextLayout* mLay; QFont mFont; QRectF mUpdateRect; }; #endif // MSG_H ColorCode-0.8.7/src/buttonscell.cpp0000644000175000017500000000655212610736534015713 0ustar dirkdirk#include "buttonscell.h" const int ButtonsCell::ACTIONID_NONE = 0; const int ButtonsCell::ACTIONID_PLAY = 1; const int ButtonsCell::ACTIONID_SAVE = 2; const int ButtonsCell::ACTIONID_COPY = 4; const int ButtonsCell::ACTIONID_DELETE = 8; ButtonsCell::ButtonsCell(QWidget* parent, int hideBtn) : QWidget(parent) { setAutoFillBackground(false); setMouseTracking(true); setAttribute(Qt::WA_Hover, true); setAttribute(Qt::WA_AlwaysShowToolTips, true); mActionId = ACTIONID_NONE; QHBoxLayout* lay = new QHBoxLayout; lay->setSpacing(0); lay->setContentsMargins(0, 0, 0, 0); lay->setAlignment(Qt::AlignLeft); int hide_cnt = 0; if ((hideBtn & ACTIONID_PLAY) == 0) { mPlayBtn = new CellBtn(parent); mPlayBtn->setIcon(QIcon(":/img/document-new.png")); mPlayBtn->setToolTip(tr("Play this Game again")); mPlayBtn->setFixedSize(QSize(18, 18)); mPlayBtn->setAutoRaise(true); connect(mPlayBtn, SIGNAL(clicked()), this, SLOT(ButtonClickedSlot())); lay->addWidget(mPlayBtn); lay->addSpacing(2); mButtonsList.append(mPlayBtn); } else { ++hide_cnt; } if ((hideBtn & ACTIONID_SAVE) == 0) { mSaveBtn = new CellBtn(parent); mSaveBtn->setIcon(QIcon(":/img/bookmark_add.png")); mSaveBtn->setToolTip(tr("Save this Game as Bookmark")); mSaveBtn->setFixedSize(QSize(18, 18)); mSaveBtn->setAutoRaise(true); connect(mSaveBtn, SIGNAL(clicked()), this, SLOT(ButtonClickedSlot())); lay->addWidget(mSaveBtn); lay->addSpacing(2); mButtonsList.append(mSaveBtn); } else { ++hide_cnt; } if ((hideBtn & ACTIONID_COPY) == 0) { mCopyBtn = new CellBtn(parent); mCopyBtn->setIcon(QIcon(":/img/edit-copy.png")); mCopyBtn->setToolTip(tr("Copy Game Number to Clipboard")); mCopyBtn->setFixedSize(QSize(18, 18)); mCopyBtn->setAutoRaise(true); connect(mCopyBtn, SIGNAL(clicked()), this, SLOT(ButtonClickedSlot())); lay->addWidget(mCopyBtn); lay->addSpacing(2); mButtonsList.append(mCopyBtn); } else { ++hide_cnt; } if ((hideBtn & ACTIONID_DELETE) == 0) { if (hide_cnt > 0) { lay->addSpacing(hide_cnt * 20); } mDeleteBtn = new CellBtn(parent); mDeleteBtn->setIcon(QIcon(":/img/edit-delete.png")); mDeleteBtn->setToolTip(tr("Remove from List")); mDeleteBtn->setFixedSize(QSize(18, 18)); mDeleteBtn->setAutoRaise(true); connect(mDeleteBtn, SIGNAL(clicked()), this, SLOT(ButtonClickedSlot())); lay->addWidget(mDeleteBtn); mButtonsList.append(mDeleteBtn); } setLayout(lay); } int ButtonsCell::GetActionId() { int aid = mActionId; mActionId = ACTIONID_NONE; return aid; } void ButtonsCell::ButtonClickedSlot() { if (sender() == 0) { return; } CellBtn* btn = qobject_cast(sender()); if (btn == mDeleteBtn) { mActionId = ACTIONID_DELETE; } else if (btn == mPlayBtn) { mActionId = ACTIONID_PLAY; } else if (btn == mSaveBtn) { mActionId = ACTIONID_SAVE; } else if (btn == mCopyBtn) { mActionId = ACTIONID_COPY; } emit CellButtonClickedSignal(); } ColorCode-0.8.7/INSTALL0000644000175000017500000000153514526601005013077 0ustar dirkdirk# if you prefer cmake # (tested for linux only, windows probably needs small adjustments) cd build_cmake cmake ../src make # if you prefer qmake: cd build_qmake qmake ../src make # note: maybe your QT installation only provides # qmake-xx (not qmake). That may be ok as long as # qmake-xx -v shows something like: # "Using Qt version 5.2.x" or higher versions # in this case run: # qmake-xx ../src # make # # in case of having multiple QT/qmake versions installed, # and QT5 isn't the default one, choose the QT5 one and run: # /path/to/qt5-version-of/qmake ../src # make # # Windows, QT5/MinGW # after qmake ../src simply run: # mingw32-make # to install: cp colorcode /usr/bin/ # to uninstall: rm /usr/bin/colorcode # If you are still using QT version 4, look # for the latest QT 4 version of ColorCode at: # http://colorcode.laebisch.com/download