From a2cebd100e7d02704a8d69205f1b766147ed1bb6 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Sun, 23 Mar 2014 15:35:11 +0000 Subject: Langman moved to deprecated git-svn-id: http://svn.miranda-ng.org/main/trunk@8705 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/!Deprecated/LangMan/docs/Info_Src.txt | 30 ++ .../!Deprecated/LangMan/docs/LangMan-Developer.txt | 46 ++ .../!Deprecated/LangMan/docs/LangMan-License.txt | 278 ++++++++++ .../!Deprecated/LangMan/docs/LangMan-Readme.txt | 146 +++++ .../!Deprecated/LangMan/docs/License_Appendix.txt | 64 +++ plugins/!Deprecated/LangMan/langman_10.vcxproj | 218 ++++++++ .../!Deprecated/LangMan/langman_10.vcxproj.filters | 61 +++ plugins/!Deprecated/LangMan/langman_12.vcxproj | 221 ++++++++ .../!Deprecated/LangMan/langman_12.vcxproj.filters | 61 +++ plugins/!Deprecated/LangMan/res/reload.ico | Bin 0 -> 1150 bytes plugins/!Deprecated/LangMan/res/resource.rc | 142 +++++ plugins/!Deprecated/LangMan/res/version.rc | 38 ++ plugins/!Deprecated/LangMan/src/common.h | 43 ++ plugins/!Deprecated/LangMan/src/langpack.cpp | 393 ++++++++++++++ plugins/!Deprecated/LangMan/src/langpack.h | 48 ++ plugins/!Deprecated/LangMan/src/main.cpp | 157 ++++++ plugins/!Deprecated/LangMan/src/options.cpp | 588 +++++++++++++++++++++ plugins/!Deprecated/LangMan/src/options.h | 27 + plugins/!Deprecated/LangMan/src/resource.h | 52 ++ plugins/!Deprecated/LangMan/src/stdafx.cpp | 18 + plugins/!Deprecated/LangMan/src/version.h | 14 + 21 files changed, 2645 insertions(+) create mode 100644 plugins/!Deprecated/LangMan/docs/Info_Src.txt create mode 100644 plugins/!Deprecated/LangMan/docs/LangMan-Developer.txt create mode 100644 plugins/!Deprecated/LangMan/docs/LangMan-License.txt create mode 100644 plugins/!Deprecated/LangMan/docs/LangMan-Readme.txt create mode 100644 plugins/!Deprecated/LangMan/docs/License_Appendix.txt create mode 100644 plugins/!Deprecated/LangMan/langman_10.vcxproj create mode 100644 plugins/!Deprecated/LangMan/langman_10.vcxproj.filters create mode 100644 plugins/!Deprecated/LangMan/langman_12.vcxproj create mode 100644 plugins/!Deprecated/LangMan/langman_12.vcxproj.filters create mode 100644 plugins/!Deprecated/LangMan/res/reload.ico create mode 100644 plugins/!Deprecated/LangMan/res/resource.rc create mode 100644 plugins/!Deprecated/LangMan/res/version.rc create mode 100644 plugins/!Deprecated/LangMan/src/common.h create mode 100644 plugins/!Deprecated/LangMan/src/langpack.cpp create mode 100644 plugins/!Deprecated/LangMan/src/langpack.h create mode 100644 plugins/!Deprecated/LangMan/src/main.cpp create mode 100644 plugins/!Deprecated/LangMan/src/options.cpp create mode 100644 plugins/!Deprecated/LangMan/src/options.h create mode 100644 plugins/!Deprecated/LangMan/src/resource.h create mode 100644 plugins/!Deprecated/LangMan/src/stdafx.cpp create mode 100644 plugins/!Deprecated/LangMan/src/version.h (limited to 'plugins/!Deprecated') diff --git a/plugins/!Deprecated/LangMan/docs/Info_Src.txt b/plugins/!Deprecated/LangMan/docs/Info_Src.txt new file mode 100644 index 0000000000..af92c5afb8 --- /dev/null +++ b/plugins/!Deprecated/LangMan/docs/Info_Src.txt @@ -0,0 +1,30 @@ + +Language Pack Manager 1.0.2.2 for Miranda IM 0.6+ +------------------------------------------------------------------------ + Source Code + +Reminder: +'Language Pack Manager' is released under the terms of the +GNU General Public License. +See 'LangMan-License.txt' for more details. +'Language Pack Manager' is copyright 2005-2007 by H. Herkenrath. + +Please notify me of any changes that improve +'Language Pack Manager' or add new features. +If you have any questions on the code, feel free +to contact me at my email address. + + H. Herkenrath (hrathh at users.sourceforge.net) + + +Notes +------------------------------------------------------------------------ +The following files need to be changed to bump the version number: + +Info_Src.txt (1 place) +version.h (4 places) +m_langman.h (1 place) +m_langman.inc (1 place) +docs\LangMan-Readme.txt (3 places) +docs\LangMan-Translation.txt (2 places) +docs\LangMan-Developer.txt (1 place) diff --git a/plugins/!Deprecated/LangMan/docs/LangMan-Developer.txt b/plugins/!Deprecated/LangMan/docs/LangMan-Developer.txt new file mode 100644 index 0000000000..6ce0c8dabb --- /dev/null +++ b/plugins/!Deprecated/LangMan/docs/LangMan-Developer.txt @@ -0,0 +1,46 @@ + +Language Pack Manager 1.0.2.2 for Miranda IM 0.6+ +------------------------------------------------------------------------ + Developer Information + + Contents: ------------------------------- + | Translation, Services (API), Debug Symbols, + | Coding Language, Rebase Info + +Translation +----------------- + Translation strings can be found in 'LangMan-Translation.txt'. + If you are a translator please refer to 'LangMan-Translation.txt' + for more information about how your langpack file info needs to be formated + to be viewable in a nice way. + +Services (API) +----------------- + For more information about which service functions are provided by + 'Language Pack Manager' and about how they can be used by your plugin please + refer to 'm_langman.h'. + If you would like to use Delphi/Pascal please refer to 'm_langman.inc'. + +Debug Symbols +----------------- + Debug symbols are also available for debugging purposes. + Copy the PDB-files in the SDK-zip into the same directory as the + corresponding DLL-files. + +Coding Language +----------------- + 'Language Pack Manager' was written using Microsoft Visual C++ 6.0 SP6 + and the Microsoft Platform SDK shipped along with it. + +Rebase Info +----------------- + 'Language Pack Manager' has set its base address to: + 0x24100000 + + Please avoid using this base address for your plugins because + it will slow down the startup of Miranda IM a little bit. + + Using Microsoft Visual C++, the base address can be configured at: + 'Project' -> 'Settings' -> 'Linker' -> 'Output' -> 'Base Address' + +H. Herkenrath (hrathh at users.sourceforge.net) diff --git a/plugins/!Deprecated/LangMan/docs/LangMan-License.txt b/plugins/!Deprecated/LangMan/docs/LangMan-License.txt new file mode 100644 index 0000000000..a726a52df1 --- /dev/null +++ b/plugins/!Deprecated/LangMan/docs/LangMan-License.txt @@ -0,0 +1,278 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/plugins/!Deprecated/LangMan/docs/LangMan-Readme.txt b/plugins/!Deprecated/LangMan/docs/LangMan-Readme.txt new file mode 100644 index 0000000000..61bc8adc71 --- /dev/null +++ b/plugins/!Deprecated/LangMan/docs/LangMan-Readme.txt @@ -0,0 +1,146 @@ + +Language Pack Manager 1.0.2.2 +------------------------------------------------------------------------ + Plugin for Miranda IM 0.6 and + + + Plugin Info: ---------------------------- + | Version: 1.0.2.2 + | Filename: langman.dll + | Author: H. Herkenrath (hrathh at users.sourceforge.net) + | Description: Helps you manage Language Packs of different languages. + + Contents: ------------------------------- + | Features, Requirements, Usage, Installation, + | Bugs and Wishes, Version History, + | Translation, License and Copyright + +Features +---------------------- + + Allows to switch installed Language Packs easily + + Displays all information about the Language Packs in one place + + Shows which Language Pack includes support for what plugins + + Right-click on a language pack entry to be able to uninstall it + + Auto-Updates for all installed Language Packs + + Wizard helping you to download and install your native language + + Unicode support + + Automatic installation of all files, just unzip into Plugins directory + + Supported plugins: Database Editor, Country Flags + +Requirements +---------------------- + -> Miranda IM 0.6+: + Miranda IM is needed in version 0.6 or greater. + +Usage +---------------------- + The Language Packs can be managed here: + 'Options' -> 'Customize' -> 'Language' + + When you do a right-click on a specific language pack, you are able to + uninstall that file if it is no longer needed. + +Installation +---------------------- + Find 'miranda32.exe' on your computer. + + Just copy all the contents of the zip-file as they are into the 'Plugins' + subdirectory in the Miranda IM folder. + 'Language Pack Manager' will detect the files and move them into the appropriate + directories on it's first run. + + You can also do all the installation by hand, if you want to: + + Main Plugin: Copy the file 'langman.dll' into the 'Plugins' subdirectory + in the Miranda IM folder. + + The Unicode version of the plugin will only work on Windows NT/2000/XP, + Windows Server 2000, Windows Vista or later with an installed + Unicode version of Miranda IM. + To use it on Windows 95/98/Me, please download the ANSI version of the plugin. + + Documentation: The txt-files should be moved along with the SDK-zip into the + 'Docs' directory in the Miranda IM folder. + + That's it! + +Bugs and Wishes +---------------------- + Feel free to mail me your wishes about 'Language Pack Manager' and tell + me all the bugs you may find. + My email address is: hrathh at users.sourceforge.net + +Version History +---------------------- + 1.0.2.2 - try to fix radio buttons on Win9x + - try to fix anything else + - fixed langpack download + - fixed selected flag icon + 1.0.2.1 - added flag icons using flags.dll + - only search for updates if a langpack is present + - better displays incompatible locales + - added v0.8 support + - minor improvements + 1.0.2.0 - fixed langpack removal in context menu + - fixed automatic installaton + - updated to use new miranda headers + - auto-cleanup of langpack info + - support for WinXP style radio buttons in list + - moved options to 'Customize' section + - shows langpack filenames in expert mode + - auto-updates for language packs + - download wizard to install your native language + - other improvements + 1.0.1.1 - minor fixes and adjustments + 1.0.1.0 - minor fixes + - right-click on a language pack entry to uninstall a file + - enlarged not-included list a bit + - del key is shortcut for context menu item 'remove' + 1.0.0.0 - Initial release + +Translation +---------------------- + Translation strings for language pack maintainers can be found + in 'LangMan-Translation.txt' of the SDK package. + +License and Copyright +---------------------- + 'Language Pack Manager' is released under the terms of the + GNU General Public License. + See 'LangMan-License.txt' for more details. + + Copyright (C) 2005-2007 by H. Herkenrath. All rights reserved. + + The included unzip code for ZIP-files is + Copyright (C) 1995-1998 Jean-Loup Gailly and Mark Adler. + It is based on a modification by + Copyright (C) 1998 Gilles Vollant, Lucian Wischik. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +H. Herkenrath (hrathh at users.sourceforge.net) diff --git a/plugins/!Deprecated/LangMan/docs/License_Appendix.txt b/plugins/!Deprecated/LangMan/docs/License_Appendix.txt new file mode 100644 index 0000000000..9ad641dfa0 --- /dev/null +++ b/plugins/!Deprecated/LangMan/docs/License_Appendix.txt @@ -0,0 +1,64 @@ + +Excecpt of GNU General Public License (Appendix): + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + 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 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/plugins/!Deprecated/LangMan/langman_10.vcxproj b/plugins/!Deprecated/LangMan/langman_10.vcxproj new file mode 100644 index 0000000000..74a6331daa --- /dev/null +++ b/plugins/!Deprecated/LangMan/langman_10.vcxproj @@ -0,0 +1,218 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F2ABCBFB-FEB8-49DF-B166-C2FA5148ACE1} + LangMan + + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Level3 + EditAndContinue + Use + common.h + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) + true + 0x24100000 + false + $(IntDir)$(TargetName).lib + Windows + $(ProfileDir)..\..\bin10\lib + + + + + Disabled + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Level3 + Use + common.h + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) + true + 0x24100000 + false + $(IntDir)$(TargetName).lib + Windows + $(ProfileDir)..\..\bin10\lib + + + + + Full + OnlyExplicitInline + Size + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + false + Level3 + Fast + false + false + Use + common.h + true + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) + true + 0x24100000 + false + $(IntDir)$(TargetName).lib + true + true + Windows + $(ProfileDir)..\..\bin10\lib + /PDBALTPATH:%_PDB% + + + + + Full + OnlyExplicitInline + Size + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + false + Level3 + Fast + false + false + Use + common.h + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) + true + 0x24100000 + false + $(IntDir)$(TargetName).lib + true + true + Windows + $(ProfileDir)..\..\bin10\lib + /PDBALTPATH:%_PDB% + + + + + + Create + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/!Deprecated/LangMan/langman_10.vcxproj.filters b/plugins/!Deprecated/LangMan/langman_10.vcxproj.filters new file mode 100644 index 0000000000..2355f86131 --- /dev/null +++ b/plugins/!Deprecated/LangMan/langman_10.vcxproj.filters @@ -0,0 +1,61 @@ + + + + + {3713035e-f4de-4b1b-8c15-b86c77bd853c} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {a70dee03-4c9e-4cc9-ba2d-8bd243a18bf6} + h;hpp;hxx;hm;inl + + + {835877bf-050d-4034-b3fb-78e456d60765} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/plugins/!Deprecated/LangMan/langman_12.vcxproj b/plugins/!Deprecated/LangMan/langman_12.vcxproj new file mode 100644 index 0000000000..3d8e903ae5 --- /dev/null +++ b/plugins/!Deprecated/LangMan/langman_12.vcxproj @@ -0,0 +1,221 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F2ABCBFB-FEB8-49DF-B166-C2FA5148ACE1} + LangMan + + + + DynamicLibrary + Unicode + true + v120_xp + + + DynamicLibrary + Unicode + true + v120_xp + + + DynamicLibrary + Unicode + v120_xp + + + DynamicLibrary + Unicode + v120_xp + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Level3 + EditAndContinue + Use + common.h + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) + true + 0x24100000 + false + $(IntDir)$(TargetName).lib + Windows + $(ProfileDir)..\..\bin12\lib + false + + + + + Disabled + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Level3 + Use + common.h + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) + true + 0x24100000 + false + $(IntDir)$(TargetName).lib + Windows + $(ProfileDir)..\..\bin12\lib + + + + + Full + OnlyExplicitInline + Size + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + false + Level3 + Fast + false + false + Use + common.h + true + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) + true + 0x24100000 + false + $(IntDir)$(TargetName).lib + true + true + Windows + $(ProfileDir)..\..\bin12\lib + + + + + Full + OnlyExplicitInline + Size + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + false + Level3 + Fast + false + false + Use + common.h + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi + + + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) + true + 0x24100000 + false + $(IntDir)$(TargetName).lib + true + true + Windows + $(ProfileDir)..\..\bin12\lib + + + + + + Create + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/!Deprecated/LangMan/langman_12.vcxproj.filters b/plugins/!Deprecated/LangMan/langman_12.vcxproj.filters new file mode 100644 index 0000000000..2355f86131 --- /dev/null +++ b/plugins/!Deprecated/LangMan/langman_12.vcxproj.filters @@ -0,0 +1,61 @@ + + + + + {3713035e-f4de-4b1b-8c15-b86c77bd853c} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {a70dee03-4c9e-4cc9-ba2d-8bd243a18bf6} + h;hpp;hxx;hm;inl + + + {835877bf-050d-4034-b3fb-78e456d60765} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/plugins/!Deprecated/LangMan/res/reload.ico b/plugins/!Deprecated/LangMan/res/reload.ico new file mode 100644 index 0000000000..1a9ce67016 Binary files /dev/null and b/plugins/!Deprecated/LangMan/res/reload.ico differ diff --git a/plugins/!Deprecated/LangMan/res/resource.rc b/plugins/!Deprecated/LangMan/res/resource.rc new file mode 100644 index 0000000000..034f77e1d9 --- /dev/null +++ b/plugins/!Deprecated/LangMan/res/resource.rc @@ -0,0 +1,142 @@ +// Microsoft Visual C++ generated resource script. +// +#include "..\src\resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Neutral resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(1251) + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_OPT_LANG DIALOGEX 0, 0, 301, 232 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_LANGLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_GROUP | WS_TABSTOP,2,43,299,61 + GROUPBOX "",IDC_LANGINFOFRAME,2,108,298,95,WS_GROUP + RTEXT "Author(s):",IDC_LANGAUTHORSLABEL,5,118,76,9,SS_NOPREFIX + EDITTEXT IDC_LANGAUTHORS,86,118,208,18,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL + RTEXT "E-mail:",IDC_LANGEMAILLABEL,5,139,76,8,SS_NOPREFIX + CONTROL "",IDC_LANGEMAIL,"Hyperlink",WS_TABSTOP,86,139,208,10 + RTEXT "Last modified using:",IDC_LANGMODUSINGLABEL,9,152,72,9,SS_NOPREFIX + EDITTEXT IDC_LANGMODUSING,86,152,196,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + RTEXT "Date:",IDC_LANGDATELABEL,5,165,76,9,SS_NOPREFIX + EDITTEXT IDC_LANGDATE,86,165,66,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + RTEXT "Version:",IDC_LANGVERSIONLABEL,161,165,39,9,SS_NOPREFIX | NOT WS_VISIBLE + EDITTEXT IDC_LANGVERSION,205,165,77,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_VISIBLE | NOT WS_BORDER + RTEXT "Locale:",IDC_LANGLOCALELABEL,5,177,76,9,SS_NOPREFIX + EDITTEXT IDC_LANGLOCALE,86,177,196,12,ES_READONLY | NOT WS_BORDER + CONTROL "Download more Language Packs",IDC_MORELANG,"Hyperlink",WS_GROUP | WS_TABSTOP | 0x1,2,207,299,10 + CTEXT "Please restart Miranda NG for your changes to take full effect.",IDC_RESTART,5,218,296,9,SS_NOPREFIX | NOT WS_VISIBLE + LTEXT "Static",IDC_LANGROOTFOLDER,7,10,277,25 + GROUPBOX "Langpack root folder",IDC_STATIC,2,0,299,39 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_OPT_LANG, DIALOG + BEGIN + VERTGUIDE, 2 + VERTGUIDE, 81 + VERTGUIDE, 86 + VERTGUIDE, 282 + VERTGUIDE, 294 + BOTTOMMARGIN, 227 + END +END +#endif // APSTUDIO_INVOKED + +#endif // Neutral resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Russian (Russia) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT +#pragma code_page(1251) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_RELOAD ICON "reload.ico" +#endif // Russian (Russia) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (United Kingdom) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "..\\src\\resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include \r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (United Kingdom) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/plugins/!Deprecated/LangMan/res/version.rc b/plugins/!Deprecated/LangMan/res/version.rc new file mode 100644 index 0000000000..5bfbab4754 --- /dev/null +++ b/plugins/!Deprecated/LangMan/res/version.rc @@ -0,0 +1,38 @@ +// Microsoft Visual C++ generated resource script. +// +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + +#include "afxres.h" +#include "..\src\version.h" + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", __DESCRIPTION + VALUE "InternalName", __PLUGIN_NAME + VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "ProductName", __PLUGIN_NAME + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/plugins/!Deprecated/LangMan/src/common.h b/plugins/!Deprecated/LangMan/src/common.h new file mode 100644 index 0000000000..2afafaff9d --- /dev/null +++ b/plugins/!Deprecated/LangMan/src/common.h @@ -0,0 +1,43 @@ +/* + +'Language Pack Manager'-Plugin for Miranda IM + +Copyright (C) 2005-2007 H. Herkenrath + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program (LangMan-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#define _CRT_SECURE_NO_WARNINGS + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "langpack.h" +#include "options.h" +#include "resource.h" +#include "version.h" + diff --git a/plugins/!Deprecated/LangMan/src/langpack.cpp b/plugins/!Deprecated/LangMan/src/langpack.cpp new file mode 100644 index 0000000000..e292c16c74 --- /dev/null +++ b/plugins/!Deprecated/LangMan/src/langpack.cpp @@ -0,0 +1,393 @@ +/* + +'Language Pack Manager'-Plugin for Miranda IM + +Copyright (C) 2005-2007 H. Herkenrath + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program (LangMan-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "common.h" + +/************************* Load ***************************************/ + +static void TrimString(char *str) +{ + int len, start; + len = lstrlenA(str); + while (str[0]!='\0' && (unsigned char)str[len-1] <= ' ') str[--len] = 0; + for (start = 0; str[start] && (unsigned char)str[start] <= ' '; ++start); + MoveMemory(str, str+start, len-start+1); +} + +static BOOL IsEmpty(const char *str) +{ + int i; + for(i = 0;str[i]!='\0';i++) + if (str[i]!=' ' && str[i]!='\r' && str[i]!='\n') + return FALSE; + return TRUE; +} + +static void CleanupLanguage(char *szLanguage) +{ + char *p; + /* remove any appended ' (default)' */ + p = strstr(szLanguage, " (default)"); + if (p!=NULL) *p = '\0'; +} + +static void CleanupAuthors(char *szAuthors) +{ + char *p, *p2; + /* remove trailing dot (if any) */ + p = &szAuthors[lstrlenA(szAuthors)-1]; + if (*p == '.') *p = '\0'; + /* remove any extra info in parentheses, which is ok + * but makes the list very long for some packs */ + for (;;) { + p = strchr(szAuthors, '('); + p2 = strchr(szAuthors, ')'); + if (p == NULL || p2 == NULL) { + p = strchr(szAuthors, '['); + p2 = strchr(szAuthors, ']'); + if (p == NULL || p2 == NULL) break; + } + if (*(p-1) == ' ') --p; + MoveMemory(p, p2+1, lstrlenA(p2+1)+1); + } +} + +static void CleanupEmail(char *szAuthorEmail) +{ + char c, *p, *pAt; + /* replace ' dot ' with '.' (may be removed) */ + p = strstr(szAuthorEmail, " dot "); + if (p!=NULL) { + *p = '.'; + MoveMemory(p+1, p+5, lstrlenA(p+5)+1); + } + /* also allow ' at ' instead of '@' for obfuscation */ + p = strstr(szAuthorEmail, " at "); + if (p!=NULL) { + *p = '@'; + MoveMemory(p+1, p+4, lstrlenA(p+4)+1); + } + /* is valid? */ + pAt = strchr(szAuthorEmail, '@'); + if (pAt == NULL) { + szAuthorEmail[0] = '\0'; + return; + } + /* strip-off extra text except exactly one email address + * this is needed as a click on the email addres brings up the mail client */ + for(c = ' ';;c = ',') { + p = strchr(pAt, c); + if (p!=NULL) *p = '\0'; + p = strrchr(szAuthorEmail, c); + if (p!=NULL) MoveMemory(szAuthorEmail, p+1, lstrlenA(p+1)+1); + if (c == ',') break; + } + p = strstr(szAuthorEmail, "__"); + if (p!=NULL) MoveMemory(szAuthorEmail, p+2, lstrlenA(p+2)+1); + /* lower case */ + CharLowerA(szAuthorEmail); + /* 'none' specified */ + if (!lstrcmpiA(szAuthorEmail, "none")) szAuthorEmail[0] = '\0'; +} + +static void CleanupLastModifiedUsing(char *szLastModifiedUsing, int nSize) +{ + char *p; + /* remove 'Unicode', as it doesn't matter */ + p = strstr(szLastModifiedUsing, " Unicode"); + if (p!=NULL) MoveMemory(p, p+8, lstrlenA(p+8)+1); + /* use 'Miranda IM' instead of 'Miranda' */ + p = strstr(szLastModifiedUsing, "Miranda"); + if (p!=NULL && strncmp(p+7, " IM", 3)) { + MoveMemory(p+10, p+7, lstrlenA(p+7)+1); + CopyMemory(p+7, " IM", 3); + } + /* use 'Plugin' instead of 'plugin' */ + p = strstr(szLastModifiedUsing, " plugin"); + if (p!=NULL) CopyMemory(p, " Plugin", 7); + /* remove 'v' prefix */ + p = strstr(szLastModifiedUsing, " v0."); + if (p!=NULL) MoveMemory(p+1, p+2, lstrlenA(p+2)+1); + /* default if empty */ + if (!szLastModifiedUsing[0]) { + DWORD v = CallService(MS_SYSTEM_GETVERSION, 0, 0); + mir_snprintf(szLastModifiedUsing, nSize, "%d.%d.%d.%d", ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF), (v & 0xFF)); + } +} + +// pack struct should be initialized to zero before call +// pack->szFileName needs to be filled in before call +static BOOL LoadPackData(LANGPACK_INFO *pack, BOOL useRootFolder, const char *pszFileVersionHeader) +{ + FILE *fp; + TCHAR szFileName[MAX_PATH]; + char line[4096], *pszColon, *buf; + char szLanguageA[64]; /* same size as pack->szLanguage */ + /* + Miranda Language Pack Version 1 + Language: (optional) + Locale: 0809 + Authors: Miranda NG Development Team (multiple tags allowed) + Author-email: project-info at miranda-ng.org (" at " instead of "@" allowed) + Last-Modified-Using: Miranda IM 0.7 + Plugins-included: (multiple tags allowed) + X-FLName: name as used on the file listing (non-standard extension) + X-Version: 1.2.3.4 (non-standard extension) + see 'LangMan-Translation.txt' for some header quidelines + */ + if ( !GetPackPath( szFileName, SIZEOF(szFileName), useRootFolder, pack->szFileName)) + return FALSE; + + fp = _tfopen(szFileName, _T("rt")); + if (fp == NULL) + return FALSE; + + fgets(line, sizeof(line), fp); + TrimString(line); + buf = line; + + if (strlen(line) >= 3 && line[0] == '\xef' && line[1] == '\xbb' && line[2] == '\xbf') { + pack->codepage = CP_UTF8; + buf += 3; + } + + if ( lstrcmpA(buf, pszFileVersionHeader )) { + fclose(fp); + return FALSE; + } + pack->flags = LPF_NOLOCALE; + szLanguageA[0] = '\0'; + while( !feof( fp )) { + if ( fgets(line, sizeof(line), fp) == NULL) break; + TrimString(line); + if ( IsEmpty(line) || line[0] == ';' || line[0] == '\0') continue; + if ( line[0] == '[' ) break; + pszColon = strchr(line, ':'); + if ( pszColon == NULL ) continue; + *pszColon = '\0'; + TrimString(pszColon+1); + if ( !lstrcmpA(line, "Language") && !pack->szLanguage[0] ) + lstrcpynA(szLanguageA, pszColon+1, sizeof(szLanguageA)); /* buffer safe */ + else if ( !lstrcmpA(line, "Last-Modified-Using") && !pack->szLastModifiedUsing[0] ) + lstrcpynA(pack->szLastModifiedUsing, pszColon+1, sizeof(pack->szLastModifiedUsing)); /* buffer safe */ + else if ( !lstrcmpA(line, "Authors")) { + buf = pack->szAuthors+lstrlenA(pack->szAuthors); /* allow multiple tags */ + if ((sizeof(pack->szAuthors)-lstrlenA(pack->szAuthors))>0) /* buffer safe */ + mir_snprintf(buf, sizeof(pack->szAuthors)-lstrlenA(pack->szAuthors), (pack->szAuthors[0] == '\0')?"%s":" %s", pszColon+1); + } else if ( !lstrcmpA(line, "Author-email") && !pack->szAuthorEmail[0]) + lstrcpynA(pack->szAuthorEmail, pszColon+1, sizeof(pack->szAuthorEmail)); /* buffer safe */ + else if ( !lstrcmpA(line, "Locale") && (pack->flags & LPF_NOLOCALE)) { + pack->Locale = MAKELCID((USHORT)strtol(pszColon+1, NULL, 16), SORT_DEFAULT); + if (pack->Locale) pack->flags &= ~LPF_NOLOCALE; + } + else if ( !lstrcmpA(line, "Plugins-included")) { + buf = pack->szPluginsIncluded + lstrlenA(pack->szPluginsIncluded); /* allow multiple tags */ + if (( sizeof(pack->szPluginsIncluded)-lstrlenA(pack->szPluginsIncluded)) > 0 ) /* buffer safe */ + mir_snprintf(buf, sizeof(pack->szPluginsIncluded)-lstrlenA(pack->szPluginsIncluded), (pack->szPluginsIncluded[0] == '\0')?"%s":", %s", CharLowerA(pszColon+1)); + } + else if ( !lstrcmpA(line, "X-Version") && !pack->szVersion[0] ) + lstrcpynA(pack->szVersion, pszColon+1, sizeof(pack->szVersion)); /* buffer safe */ + else if ( !lstrcmpA(line, "X-FLName") && !pack->szFLName[0] ) + lstrcpynA(pack->szFLName, pszColon+1, sizeof(pack->szFLName)); /* buffer safe */ + } + CleanupLanguage(szLanguageA); + CleanupAuthors(pack->szAuthors); + CleanupEmail(pack->szAuthorEmail); + CleanupLastModifiedUsing(pack->szLastModifiedUsing, sizeof(pack->szLastModifiedUsing)); + /* codepage */ + if (!(pack->flags&LPF_NOLOCALE)) + if (GetLocaleInfoA(pack->Locale, LOCALE_IDEFAULTANSICODEPAGE, line, 6)) + pack->codepage = (WORD)atoi(line); /* CP_ACP on error */ + /* language */ + + MultiByteToWideChar(pack->codepage, 0, szLanguageA, -1, pack->szLanguage, SIZEOF(pack->szLanguage)); + + /* ensure the pack always has a language name */ + if (!pack->szLanguage[0] && !GetLocaleInfo(pack->Locale, LOCALE_SENGLANGUAGE, pack->szLanguage, SIZEOF(pack->szLanguage))) { + TCHAR *p; + lstrcpyn(pack->szLanguage, pack->szFileName, SIZEOF(pack->szLanguage)); /* buffer safe */ + p = _tcsrchr(pack->szLanguage, _T('.')); + if (p!=NULL) *p = '\0'; + } + /* ensure the pack always has a filelisting name */ + if (!pack->szFLName[0]) + lstrcatA(lstrcpyA(pack->szFLName, szLanguageA), " Language Pack"); /* buffer safe */ + fclose(fp); + return TRUE; +} + +/************************* Enum ***************************************/ + +BOOL GetPackPath(TCHAR *pszPath, int nSize, BOOL useRootFolder, const TCHAR *pszFile) +{ + TCHAR *p; + /* main path */ + if (!GetModuleFileName(NULL, pszPath, nSize)) return FALSE; + p = _tcsrchr(pszPath, _T('\\')); + if (p!=NULL) *(p+1) = _T('\0'); + /* subdirectory */ + if (!useRootFolder) { + if (nSize<(lstrlen(pszPath)+10)) return FALSE; + lstrcat(pszPath, _T("Languages\\")); + } + /* file name */ + if (pszFile!=NULL) { + if (nSize<(lstrlen(pszFile)+11)) return FALSE; + lstrcat(pszPath, pszFile); + } + return TRUE; +} + +// callback is allowed to be NULL +// returns TRUE if any pack exists except default +BOOL EnumPacks(ENUM_PACKS_CALLBACK callback, const TCHAR *pszFilePattern, const char *pszFileVersionHeader, WPARAM wParam, LPARAM lParam) +{ + BOOL fPackFound = FALSE; + BOOL res = FALSE; + LANGPACK_INFO pack; + WIN32_FIND_DATA wfd; + HANDLE hFind; + + mir_ptr langpack(db_get_tsa(NULL, "LangMan", "Langpack")); + + /* langpacks in root folder */ + if (GetPackPath(pack.szFileName, SIZEOF(pack.szFileName), TRUE, pszFilePattern)) { + hFind = FindFirstFile(pack.szFileName, &wfd); + if (hFind!=INVALID_HANDLE_VALUE) { + do { + if (wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) continue; + if ((lstrlen(wfd.cFileName)<4) || wfd.cFileName[lstrlen(wfd.cFileName)-4]!=_T('.')) continue; + /* get data */ + ZeroMemory(&pack, sizeof(pack)); + lstrcpy(pack.szFileName, CharLower(wfd.cFileName)); /* buffer safe */ + if (LoadPackData(&pack, TRUE, pszFileVersionHeader)) { + pack.ftFileDate = wfd.ftLastWriteTime; + /* enabled? */ + if (!langpack) { + if (!fPackFound) pack.flags |= LPF_ENABLED; + fPackFound = TRUE; + } + /* callback */ + if (callback!=NULL) res = callback(&pack, wParam, lParam); + if (!res) { FindClose(hFind); return FALSE; } + } + } while(FindNextFile(hFind, &wfd)); + FindClose(hFind); + } + } + + /* langpacks in languages folder */ + if (GetPackPath(pack.szFileName, SIZEOF(pack.szFileName), FALSE, pszFilePattern)) { + hFind = FindFirstFile(pack.szFileName, &wfd); + if (hFind!=INVALID_HANDLE_VALUE) { + do { + if (wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) continue; + if (lstrlen(wfd.cFileName)<4 || wfd.cFileName[lstrlen(wfd.cFileName)-4]!=_T('.')) continue; + /* get data */ + ZeroMemory(&pack, sizeof(pack)); + lstrcpy(pack.szFileName, CharLower(wfd.cFileName)); /* buffer safe */ + if (LoadPackData(&pack, FALSE, pszFileVersionHeader)) { + pack.ftFileDate = wfd.ftLastWriteTime; + /* enabled? */ + if (langpack) { + if (!_tcscmp(pack.szFileName, langpack)) { + if (!fPackFound) pack.flags |= LPF_ENABLED; + fPackFound = TRUE; + } + } + /* callback */ + if (callback!=NULL) res = callback(&pack, wParam, lParam); + if (!res) { FindClose(hFind); return FALSE; } + } + } while(FindNextFile(hFind, &wfd)); + FindClose(hFind); + } + } + + /* default: English (GB) */ + if (callback!=NULL) { + ZeroMemory(&pack, sizeof(pack)); + pack.Locale = LOCALE_USER_DEFAULT; /* miranda uses default locale in this case */ + lstrcpy(pack.szLanguage, _T("English (default)")); /* buffer safe */ + lstrcpyA(pack.szAuthors, "Miranda NG Development Team"); /* buffer safe */ + lstrcpyA(pack.szAuthorEmail, "project-info at miranda-ng.org"); /* buffer safe */ + CleanupEmail(pack.szAuthorEmail); /* correct " at " */ + CleanupLastModifiedUsing(pack.szLastModifiedUsing, sizeof(pack.szLastModifiedUsing)); + /* file date */ + if (GetModuleFileName(NULL, pack.szFileName, SIZEOF(pack.szFileName))) { + HANDLE hFile; + hFile = CreateFile(pack.szFileName, 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + if (hFile!=INVALID_HANDLE_VALUE) { + GetFileTime(hFile, NULL, NULL, &pack.ftFileDate); + CloseHandle(hFile); + } + } + pack.flags = LPF_NOLOCALE|LPF_DEFAULT; + pack.Locale = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); + if (!fPackFound) pack.flags |= LPF_ENABLED; + /* callback */ + if (!callback(&pack, wParam, lParam)) return FALSE; + } + + return fPackFound; +} + +void MovePacks(const TCHAR *pszFilePattern) +{ + TCHAR szFrom[MAX_PATH], szDest[MAX_PATH], szDir[MAX_PATH], *pszFile; + BOOL fDirCreated = FALSE; + HANDLE hFind; + WIN32_FIND_DATA wfd; + + /* main path */ + if (!GetModuleFileName(NULL, szDir, SIZEOF(szDir))) return; + pszFile = _tcsrchr(szDir, _T('\\')); + if (pszFile != NULL) *pszFile = _T('\0'); + + if (!GetPackPath(szDest, SIZEOF(szDest), FALSE, _T(""))) return; + + /* move wrongly placed packs from 'root' to 'Language' */ + mir_sntprintf(szFrom, SIZEOF(szFrom), _T("%s\\%s"), szDir, pszFilePattern); + hFind = FindFirstFile(szFrom, &wfd); + if (hFind != INVALID_HANDLE_VALUE) { + do { + if (wfd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) continue; + if (lstrlen(wfd.cFileName)<4 || wfd.cFileName[lstrlen(wfd.cFileName) - 4] != _T('.')) continue; + /* set first lp ad default */ + mir_ptr langpack(db_get_tsa(NULL, "LangMan", "Langpack")); + if (!langpack) + db_set_ws(NULL, "LangMan", "Langpack", wfd.cFileName); + /* ensure dir exists */ + if (!fDirCreated) + fDirCreated = CreateDirectory(szDest, NULL); + /* move file */ + if (GetPackPath(szDest, SIZEOF(szDest), FALSE, wfd.cFileName)) + { + mir_sntprintf(szFrom, SIZEOF(szFrom), _T("%s\\%s"), szDir, wfd.cFileName); + if (!MoveFile(szFrom, szDest) && GetLastError() == ERROR_ALREADY_EXISTS) { + DeleteFile(szDest); + MoveFile(szFrom, szDest); + } + } + } while (FindNextFile(hFind, &wfd)); + FindClose(hFind); + } +} \ No newline at end of file diff --git a/plugins/!Deprecated/LangMan/src/langpack.h b/plugins/!Deprecated/LangMan/src/langpack.h new file mode 100644 index 0000000000..01280c757e --- /dev/null +++ b/plugins/!Deprecated/LangMan/src/langpack.h @@ -0,0 +1,48 @@ +/* + +'Language Pack Manager'-Plugin for Miranda IM + +Copyright (C) 2005-2007 H. Herkenrath + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program (LangMan-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#define LPF_ENABLED 0x01 // pack is enabled +#define LPF_NOLOCALE 0x02 // pack has no valid locale +#define LPF_DEFAULT 0x04 // pack is the english default (no langpack) + +/* Langpack Info */ +typedef struct { + TCHAR szLanguage[64]; + LCID Locale; + WORD codepage; + char szAuthors[1024]; + char szAuthorEmail[128]; + char szLastModifiedUsing[64]; + char szPluginsIncluded[4080]; + char szVersion[21]; + char szFLName[128]; + FILETIME ftFileDate; + TCHAR szFileName[MAX_PATH]; /* just the file name itself */ + BYTE flags; /* see LPIF_* flags */ +} LANGPACK_INFO; + +BOOL GetPackPath(TCHAR *pszPath, int nSize, BOOL useRootFolder, const TCHAR *pszFile); + +void MovePacks(const TCHAR *pszFilePattern); + +/* Enum */ +typedef BOOL (*ENUM_PACKS_CALLBACK)(LANGPACK_INFO *pack, WPARAM wParam, LPARAM lParam); +BOOL EnumPacks(ENUM_PACKS_CALLBACK callback, const TCHAR *pszFilePattern, const char *pszFileVersionHeader, WPARAM wParam, LPARAM lParam); diff --git a/plugins/!Deprecated/LangMan/src/main.cpp b/plugins/!Deprecated/LangMan/src/main.cpp new file mode 100644 index 0000000000..7e471e4849 --- /dev/null +++ b/plugins/!Deprecated/LangMan/src/main.cpp @@ -0,0 +1,157 @@ +/* + +'Language Pack Manager'-Plugin for Miranda IM + +Copyright (C) 2005-2007 H. Herkenrath + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program (LangMan-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "common.h" + +int hLangpack; +HINSTANCE hInst; + +static PLUGININFOEX pluginInfo = { + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + // {D4BDD1EB-56F1-4A87-A187-67246EE919A2} + {0xd4bdd1eb, 0x56f1, 0x4a87, {0xa1, 0x87, 0x67, 0x24, 0x6e, 0xe9, 0x19, 0xa2}}, +}; + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, void*) +{ + hInst = hinstDLL; + return TRUE; +} + +extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfo; +} + +BOOL IsRunAsAdmin() +{ + BOOL fIsRunAsAdmin = FALSE; + DWORD dwError = ERROR_SUCCESS; + PSID pAdministratorsGroup = NULL; + + // Allocate and initialize a SID of the administrators group. + SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY; + if (!AllocateAndInitializeSid( + &NtAuthority, + 2, + SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_ADMINS, + 0, 0, 0, 0, 0, 0, + &pAdministratorsGroup)) + { + dwError = GetLastError(); + goto Cleanup; + } + + // Determine whether the SID of administrators group is enabled in + // the primary access token of the process. + if (!CheckTokenMembership(NULL, pAdministratorsGroup, &fIsRunAsAdmin)) + { + dwError = GetLastError(); + goto Cleanup; + } + +Cleanup: + // Centralized cleanup for all allocated resources. + if (pAdministratorsGroup) + { + FreeSid(pAdministratorsGroup); + pAdministratorsGroup = NULL; + } + + // Throw the error if something failed in the function. + if (ERROR_SUCCESS != dwError) + { + throw dwError; + } + + return fIsRunAsAdmin; +} + +extern "C" __declspec(dllexport) int Load(void) +{ + mir_getLP( &pluginInfo ); + + //if (!IsRunAsAdmin()) + MovePacks(_T("langpack_*.txt")); + + /*INITCOMMONCONTROLSEX icc; + icc.dwSize = sizeof(icc); + icc.dwICC = ICC_TREEVIEW_CLASSES|ICC_USEREX_CLASSES; + InitCommonControlsEx(&icc);*/ + + /* menu item */ + CLISTMENUITEM mi = { sizeof(mi) }; + mi.position = 2000089999; + mi.icolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RELOAD)); + mi.pszName = LPGEN("Reload langpack"); + mi.pszService = MS_LANGPACK_RELOAD; + Menu_AddMainMenuItem(&mi); + + /* reset langpack */ + mir_ptr langpack(db_get_tsa(NULL, "LangMan", "Langpack")); + if (langpack) + { + TCHAR szPath[MAX_PATH]; + GetPackPath(szPath, SIZEOF(szPath), FALSE, langpack); + + DWORD dwAttrib = GetFileAttributes(szPath); + if (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) + CallService(MS_LANGPACK_RELOAD, 0, (LPARAM)szPath); + } + + InitOptions(); + + return 0; +} + +extern "C" __declspec(dllexport) int Unload(void) +{ + UninitOptions(); + + /* move default langpack to root */ + mir_ptr langpack(db_get_tsa(NULL, "LangMan", "Langpack")); + if (langpack) + { + TCHAR szFrom[MAX_PATH], szDest[MAX_PATH]; + GetPackPath(szFrom, SIZEOF(szFrom), FALSE, langpack); + + DWORD dwAttrib = GetFileAttributes(szFrom); + if (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) + { + GetPackPath(szDest, SIZEOF(szDest), TRUE, langpack); + if (!MoveFile(szFrom, szDest) && GetLastError() == ERROR_ALREADY_EXISTS) { + DeleteFile(szDest); + MoveFile(szFrom, szDest); + } + } + } + + return 0; +} \ No newline at end of file diff --git a/plugins/!Deprecated/LangMan/src/options.cpp b/plugins/!Deprecated/LangMan/src/options.cpp new file mode 100644 index 0000000000..6abdf153c5 --- /dev/null +++ b/plugins/!Deprecated/LangMan/src/options.cpp @@ -0,0 +1,588 @@ +/* + +'Language Pack Manager'-Plugin for Miranda IM + +Copyright (C) 2005-2007 H. Herkenrath + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program (LangMan-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "common.h" + +typedef PLUGININFOEX* (__cdecl *pfnMirandaPluginInfo)(DWORD); + +extern HINSTANCE hInst; +static HANDLE hHookOptInit; + +/************************* Utils **************************************/ + +#define BOX(str) BOX2("%s (err:%i)", str, GetLastError()) +#define BOX2(fmt, p1, p2) { char str[256]; mir_snprintf(str, SIZEOF(str), fmt, p1, p2); MessageBoxA(NULL, str, "dbg", 0); } + +// ImageList_Destroy() the return value +// refresh on WM_THEMECHANGED +static HIMAGELIST CreateRadioImages(COLORREF clrBk, COLORREF clrText) +{ + /* draw bitmap */ + HDC hdcScreen = GetDC(NULL); + if (hdcScreen == NULL) + return NULL; + + HIMAGELIST himl = NULL; + HDC hdc = CreateCompatibleDC(NULL); /* compatible to screen */ + if (hdc != NULL) { + SIZE size = { GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON) }; + RECT rc; + SetRect(&rc, 0, 0, 2 * size.cx, size.cy); + HBITMAP hbm = CreateCompatibleBitmap(hdcScreen, rc.right, rc.bottom); + if (hbm != NULL) { + HBITMAP hbmPrev = (HBITMAP)SelectObject(hdc, hbm); + if (hbmPrev != NULL) { /* error on select? */ + HTHEME hTheme = OpenThemeData(NULL, L"Button"); + SetRect(&rc, 0, 0, size.cx, size.cy); + /* unchecked */ + if (!DrawThemeBackground(hTheme, hdc, BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL, &rc, NULL)) { + /* checked */ + OffsetRect(&rc, size.cx, 0); + if (!DrawThemeBackground(hTheme, hdc, BP_RADIOBUTTON, RBS_CHECKEDNORMAL, &rc, NULL)) + himl = ImageList_Create(size.cx, size.cy, ILC_COLOR32 | ILC_MASK, 3, 0); + } + CloseThemeData(hTheme); + + /* the classic way */ + if (himl == NULL) { + RECT rcRadio; + HBRUSH hbrBk = CreateSolidBrush(clrBk); + if (hbrBk != NULL) { + FillRect(hdc, &rc, hbrBk); + DeleteObject(hbrBk); + HDC hdcMono = CreateCompatibleDC(hdc); + if (hdcMono != NULL) { + HBITMAP hbmMono = CreateBitmap(rc.right, rc.bottom, 1, 1, NULL); + if (hbmMono != NULL) { + HBITMAP hbmPrevMono = (HBITMAP)SelectObject(hdcMono, hbmMono); + if (hbmPrevMono != NULL) { /* error on select? */ + /* draws a black-and-white mask (see docs) + * we need to colorize it using BitBlt with text and background color */ + COLORREF clrPrevText = SetTextColor(hdc, clrText); + COLORREF clrPrevBk = SetBkColor(hdc, clrBk); + /* check mark is slightly smaller than icon size */ + SetRect(&rcRadio, 0, 0, GetSystemMetrics(SM_CXMENUCHECK), GetSystemMetrics(SM_CYMENUCHECK)); + if (rcRadio.right > size.cx) rcRadio.right = size.cx; + if (rcRadio.bottom > size.cy) rcRadio.bottom = size.cy; + SetRect(&rc, ((size.cx - rcRadio.right) / 2) + 1, ((size.cy - rcRadio.bottom) / 2) + 1, rcRadio.right + 1, rcRadio.bottom + 1); + /* unchecked */ + if (BitBlt(hdcMono, 0, 0, rcRadio.right, rcRadio.bottom, NULL, 0, 0, WHITENESS)) { /* white back */ + if (DrawFrameControl(hdcMono, &rcRadio, DFC_BUTTON, DFCS_BUTTONRADIO | DFCS_FLAT)) { + if (BitBlt(hdc, rc.left, rc.top, rcRadio.right, rcRadio.bottom, hdcMono, 0, 0, SRCCOPY | NOMIRRORBITMAP)) { + /* checked */ + OffsetRect(&rc, size.cx, 0); + if (BitBlt(hdcMono, 0, 0, rcRadio.right, rcRadio.bottom, NULL, 0, 0, WHITENESS)) {/* white back */ + if (DrawFrameControl(hdcMono, &rcRadio, DFC_BUTTON, DFCS_BUTTONRADIO | DFCS_FLAT | DFCS_CHECKED)) { + if (BitBlt(hdc, rc.left, rc.top, rcRadio.right, rcRadio.bottom, hdcMono, 0, 0, SRCCOPY | NOMIRRORBITMAP)) + himl = ImageList_Create(size.cx, size.cy, ILC_COLOR | ILC_MASK, 3, 0); + } + else BOX("second DrawFrameControl() failed"); + } + else BOX("second BitBlt() failed"); + } + else BOX("intermediate BitBlt() failed"); + } + else BOX("DrawFrameControl() failed"); + } + else BOX("first BitBlt() failed"); + /* restore */ + SetBkColor(hdc, clrPrevBk); + SetTextColor(hdc, clrPrevText); + SelectObject(hdcMono, hbmPrevMono); + } + else BOX("hbmPrevMono == NULL"); + DeleteObject(hbmMono); + } + else BOX("hbmMono == NULL"); + DeleteDC(hdcMono); + } + else BOX("hdcMono == NULL"); + } + } + SelectObject(hdc, hbmPrev); + /* create imagelist */ + if (himl != NULL) { + if (himl == NULL) BOX("img list create failed"); + if (himl != NULL) if (ImageList_AddMasked(himl, hbm, clrBk) == -1) BOX("add failed"); + } + else BOX("Win9x: drawing code not reached"); + } + DeleteObject(hbm); + } + DeleteDC(hdc); + } + ReleaseDC(NULL, hdcScreen); + return himl; +} + +static void CleanupPluginName(char *szShortName) +{ + char *p; + /* strip-off anything in brackets */ + for(p = szShortName;*p!='\0';++p) + if (*p == '(' || *p == '[') { + *p = '\0'; + break; + } + /* remove trailing space */ + int len = lstrlenA(szShortName); + while(szShortName[0]!='\0' && szShortName[len-1] == ' ') + szShortName[--len] = 0; +} + +static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) +{ + /* locale string */ + if (!(pack->flags & LPF_NOLOCALE)) { + TCHAR szLocaleName[128]; + szLocaleName[0] = _T('\0'); + /* can't use LOCALE_SNAME as it is not present on pre WinVista */ + if (!GetLocaleInfo(pack->Locale, LOCALE_SISO639LANGNAME, szLocaleName, SIZEOF(szLocaleName))) { /* Win98/NT4+ */ + if (!GetLocaleInfo(pack->Locale, LOCALE_SLANGUAGE, szLocaleName, SIZEOF(szLocaleName))) /* not unique! */ + szLocaleName[0] = _T('\0'); + } + else { + if (GetLocaleInfo(pack->Locale, LOCALE_SISO3166CTRYNAME, &szLocaleName[3], SIZEOF(szLocaleName) - 3)) /* Win98/NT4+ */ + szLocaleName[2] = _T('-'); + } + /* add some note if its incompatible */ + if (szLocaleName[0]) { + if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) { + TCHAR *pszIncompat; + pszIncompat = TranslateT("(incompatible)"); + szLocaleName[SIZEOF(szLocaleName) - lstrlen(pszIncompat) - 1] = 0; + lstrcat(lstrcat(szLocaleName, _T(" ")), pszIncompat); /* buffer safe */ + } + SetDlgItemText(hwndDlg, IDC_LANGLOCALE, szLocaleName); + } + else SetDlgItemText(hwndDlg, IDC_LANGLOCALE, TranslateT("Unknown")); + } + else SetDlgItemText(hwndDlg, IDC_LANGLOCALE, TranslateT("Current")); + + /* file date */ + SYSTEMTIME stFileDate; + TCHAR szDate[128]; + szDate[0] = _T('\0'); + if (FileTimeToSystemTime(&pack->ftFileDate, &stFileDate)) + GetDateFormat((LCID)CallService(MS_LANGPACK_GETLOCALE, 0, 0), DATE_SHORTDATE, &stFileDate, NULL, szDate, SIZEOF(szDate)); + SetDlgItemText(hwndDlg, IDC_LANGDATE, szDate); + + /* version */ + SetDlgItemTextA(hwndDlg, IDC_LANGVERSION, pack->szVersion); + if (pack->szVersion[0] && pack->szFLName[0]) { + if (!IsWindowVisible(GetDlgItem(hwndDlg, IDC_LANGVERSIONLABEL))) { + ShowWindow(GetDlgItem(hwndDlg, IDC_LANGVERSIONLABEL), SW_SHOW); + ShowWindow(GetDlgItem(hwndDlg, IDC_LANGVERSION), SW_SHOW); + } + } + else { + ShowWindow(GetDlgItem(hwndDlg, IDC_LANGVERSIONLABEL), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg, IDC_LANGVERSION), SW_HIDE); + } + + /* general */ + SetDlgItemTextA(hwndDlg, IDC_LANGMODUSING, pack->szLastModifiedUsing); + SetDlgItemTextA(hwndDlg, IDC_LANGAUTHORS, pack->szAuthors); + SetDlgItemTextA(hwndDlg, IDC_LANGEMAIL, pack->szAuthorEmail); + SetDlgItemText(hwndDlg, IDC_LANGINFOFRAME, TranslateTS(pack->szLanguage)); +} + +/************************* Insert/Delete ******************************/ + +#define M_RELOADLIST (WM_APP+1) +#define M_SHOWFILECOL (WM_APP+2) + +static void DeletePackFile(HWND hwndDlg, HWND hwndList, int iItem, LANGPACK_INFO *pack) +{ + SHFILEOPSTRUCT sfo = { 0 }; + sfo.hwnd = hwndDlg; + sfo.wFunc = FO_DELETE; + sfo.fFlags = FOF_SIMPLEPROGRESS|FOF_SILENT; /* silent = no progress */ + + /* double zero terminated */ + TCHAR szFileName[MAX_PATH]; + if (GetPackPath(szFileName, SIZEOF(szFileName) - 1, pack->flags & LPF_ENABLED, pack->szFileName)) { + szFileName[lstrlen(szFileName)+1] = _T('\0'); + sfo.pFrom = szFileName; + /* ask to delete file */ + if (!SHFileOperation(&sfo) && !sfo.fAnyOperationsAborted) { + LVITEM lvi; + lvi.iItem = iItem; + lvi.iSubItem = 0; + lvi.mask = LVIF_STATE; + lvi.stateMask = LVIS_STATEIMAGEMASK|LVIS_SELECTED|LVIS_FOCUSED; + if (ListView_GetItem(hwndList, &lvi)) { + ListView_DeleteItem(hwndList, iItem); + /* enable/select next item at same position */ + int nCount = ListView_GetItemCount(hwndList); + lvi.iItem = (iItem < nCount) ? iItem : iItem - 1; + ListView_SetItemState(hwndList, lvi.iItem, lvi.state, lvi.stateMask); + if (nCount == 1) + SendMessage(hwndDlg, M_SHOWFILECOL, 0, FALSE); + } + } + } +} + +static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM lParam) +{ + LANGPACK_INFO *pack2 = (LANGPACK_INFO*)mir_alloc(sizeof(LANGPACK_INFO)); + if (pack2 == NULL) return FALSE; + CopyMemory(pack2, pack, sizeof(LANGPACK_INFO)); + + /* country flag icon */ + LVITEM lvi; + lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE; + if ((HIMAGELIST)lParam != NULL) { + HICON hIcon; + if (pack->flags & LPF_DEFAULT) + hIcon = (HICON)CallService(MS_FLAGS_CREATEMERGEDFLAGICON, CTRY_UNITED_STATES, CTRY_UNITED_KINGDOM); + else { + int countryId = 0xFFFF; /* Unknown */ + TCHAR szBuf[6]; + /* get country id from locale */ + if (!(pack->flags & LPF_NOLOCALE)) + if (GetLocaleInfo(pack->Locale, LOCALE_ICOUNTRY, szBuf, SIZEOF(szBuf))) + countryId = _ttoi(szBuf); + hIcon = (HICON)CallService(MS_FLAGS_LOADFLAGICON, countryId, 0); + } + lvi.iImage = (hIcon == NULL) ? -1 : ImageList_AddIcon((HIMAGELIST)lParam, hIcon); + lvi.mask |= LVIF_IMAGE; + } + /* insert */ + lvi.iItem = lvi.iSubItem = 0; + lvi.stateMask = LVIS_STATEIMAGEMASK | LVIS_SELECTED; + lvi.state = INDEXTOSTATEIMAGEMASK((pack->flags & LPF_ENABLED)?2:1); + if (pack->flags & LPF_ENABLED) + lvi.state |= LVIS_SELECTED | LVIS_FOCUSED; + lvi.pszText = TranslateTS(pack->szLanguage); + lvi.lParam = (LPARAM)pack2; + ListView_InsertItem((HWND)wParam, &lvi); + + return TRUE; +} + +static int CALLBACK CompareListItem(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) +{ + int cmp = CompareString((LCID)lParamSort, 0, ((LANGPACK_INFO*)lParam1)->szLanguage, -1, ((LANGPACK_INFO*)lParam2)->szLanguage, -1); + if (cmp != 0) + cmp -= 2; + return cmp; +} + +/************************* Options Page *******************************/ + +static HWND hwndLangOpt; + +static INT_PTR CALLBACK LangOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + HWND hwndList = GetDlgItem(hwndDlg, IDC_LANGLIST); + LVITEM lvi; + + switch(msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + hwndLangOpt = hwndDlg; + ListView_SetExtendedListViewStyle(hwndList, LVS_EX_FULLROWSELECT|LVS_EX_LABELTIP); + ListView_SetImageList(hwndList, CreateRadioImages(ListView_GetBkColor(hwndList), ListView_GetTextColor(hwndList)), LVSIL_STATE); /* auto-destroyed */ + { + LVCOLUMN lvc; + lvc.mask = LVCF_TEXT; + lvc.pszText = TranslateT("Installed Languages"); + ListView_InsertColumn(hwndList, 0, &lvc); + } + if ( ServiceExists(MS_FLAGS_LOADFLAGICON)) + ListView_SetImageList(hwndList, ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR24, 8, 8), LVSIL_SMALL); + + TCHAR szPath[MAX_PATH]; + GetPackPath(szPath, SIZEOF(szPath), FALSE, _T("")); + SetDlgItemText(hwndDlg, IDC_SKINROOTFOLDER, szPath); + + SendMessage(hwndDlg, M_RELOADLIST, 0, 0); + SendMessage(hwndDlg, M_SHOWFILECOL, 0, 1); + return TRUE; + + case M_RELOADLIST: + /* init list */ + ListView_DeleteAllItems(hwndList); + ListView_DeleteColumn(hwndList, 1); /* if present */ + { + HIMAGELIST himl = ListView_GetImageList(hwndList, LVSIL_SMALL); + ImageList_RemoveAll(himl); + /* enum all packs */ + EnumPacks(InsertPackItemEnumProc, _T("langpack_*.txt"), "Miranda Language Pack Version 1", (WPARAM)hwndList, (LPARAM)himl); + /* make it use current langpack locale for sort */ + ListView_SortItems(hwndList, CompareListItem, CallService(MS_LANGPACK_GETLOCALE, 0, 0)); + //CheckDlgButton(hwndDlg, IDC_ENABLEAUTOUPDATES, db_get_b(NULL, "LangMan", "EnableAutoUpdates", SETTING_ENABLEAUTOUPDATES_DEFAULT) != 0); + /* show selection */ + int iItem = ListView_GetNextItem(hwndList, -1, LVNI_SELECTED); + if (iItem != -1) + ListView_EnsureVisible(hwndList, iItem, FALSE); + } + return TRUE; + + case M_SHOWFILECOL: + if ((BOOL)lParam && ListView_GetItemCount(hwndList) > 1) { + /* add column */ + LVCOLUMN lvc; + ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE_USEHEADER); + lvc.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; + lvc.pszText = TranslateT("File"); + lvc.cx = 160; + ListView_InsertColumn(hwndList, lvc.iSubItem = 1, &lvc); + ListView_SetColumnWidth(hwndList, 0, ListView_GetColumnWidth(hwndList, 0) - lvc.cx); + + /* add text */ + lvi.mask = LVIF_PARAM; + lvi.iSubItem = 0; + for (lvi.iItem = 0; ListView_GetItem(hwndList, &lvi); ++lvi.iItem) { + LANGPACK_INFO *pack = (LANGPACK_INFO*)lvi.lParam; + ListView_SetItemText(hwndList, lvi.iItem, 1, (pack->flags&LPF_DEFAULT) ? TranslateT("built-in") : pack->szFileName); + } + } + else { + ListView_DeleteColumn(hwndList, 1); + ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE_USEHEADER); + } + return TRUE; + + case WM_DESTROY: + ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_LANGLIST)); + return TRUE; + + case WM_THEMECHANGED: + case WM_SETTINGCHANGE: + { + HIMAGELIST himl = ListView_SetImageList(hwndList, CreateRadioImages(ListView_GetBkColor(hwndList), ListView_GetTextColor(hwndList)), LVSIL_STATE); /* auto-destroyed */ + if (himl != NULL) + ImageList_Destroy(himl); + } + break; + + case WM_CTLCOLORLISTBOX: /* mimic readonly edit */ + return (BOOL)SendMessage(hwndDlg, WM_CTLCOLORSTATIC, wParam, lParam); + + case WM_COMMAND: + switch(LOWORD(wParam)) { + case IDC_LANGEMAIL: + { + char buf[512]; + lstrcpyA(buf, "mailto:"); + if (GetWindowTextA(GetDlgItem(hwndDlg, LOWORD(wParam)), &buf[7], sizeof(buf)-7)) + CallService(MS_UTILS_OPENURL, FALSE, (LPARAM)buf); + return TRUE; + } + + case IDC_MORELANG: + CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)"http://miranda-ng.org/"); + return TRUE; + } + break; + + case WM_CONTEXTMENU: + if (GetDlgCtrlID((HWND)wParam) == IDC_LANGLIST) { + /* get item */ + LVHITTESTINFO hti; + POINTSTOPOINT(hti.pt, MAKEPOINTS(lParam)); + if (hti.pt.x == -1 && hti.pt.y == -1) { + /* keyboard invoked */ + hti.iItem = ListView_GetNextItem((HWND)wParam, -1, LVNI_SELECTED); + if (hti.iItem != -1) + break; + + RECT rc; + if (!ListView_GetItemRect((HWND)wParam, hti.iItem, &rc, LVIR_SELECTBOUNDS)) + break; + + hti.pt.x = rc.left + (rc.right - rc.left) / 2; + hti.pt.y = rc.top + (rc.bottom - rc.top) / 2; + ClientToScreen((HWND)wParam, &hti.pt); + } + else { + ScreenToClient((HWND)wParam, &hti.pt); + if (ListView_HitTest((HWND)wParam, &hti) == -1 || !(hti.flags&LVHT_ONITEM)) + break; + POINTSTOPOINT(hti.pt, MAKEPOINTS(lParam)); + } + + /* param */ + lvi.iItem = hti.iItem; + lvi.iSubItem = 0; + lvi.mask = LVIF_PARAM; + if (!ListView_GetItem((HWND)wParam, &lvi)) + break; + + /* context menu */ + LANGPACK_INFO *pack = (LANGPACK_INFO*)lvi.lParam; + if (!(pack->flags & LPF_DEFAULT)) { + HMENU hContextMenu = CreatePopupMenu(); + if (hContextMenu != NULL) { + AppendMenu(hContextMenu, MF_STRING, 2, TranslateT("&Remove...")); + if (TrackPopupMenuEx(hContextMenu, TPM_RETURNCMD | TPM_NONOTIFY | TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_HORPOSANIMATION | TPM_VERPOSANIMATION, hti.pt.x, hti.pt.y, (HWND)wParam, NULL)) + DeletePackFile(hwndDlg, (HWND)wParam, hti.iItem, pack); + DestroyMenu(hContextMenu); + } + } + return TRUE; + } + break; + + case WM_NOTIFYFORMAT: + SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, NFR_UNICODE); + return TRUE; + + case WM_NOTIFY: + NMHDR *nmhdr = (NMHDR*)lParam; + switch (nmhdr->idFrom) { + case IDC_LANGLIST: + switch (nmhdr->code) { + case LVN_DELETEITEM: + lvi.iItem = ((NMLISTVIEW*)lParam)->iItem; /* nmlv->lParam is invalid */ + lvi.iSubItem = 0; + lvi.mask = LVIF_PARAM; + if (ListView_GetItem(nmhdr->hwndFrom, &lvi)) + mir_free((LANGPACK_INFO*)lvi.lParam); + break; + + case LVN_ITEMCHANGED: + { + NMLISTVIEW *nmlv = (NMLISTVIEW*)lParam; + if (!(nmlv->uChanged&LVIF_STATE)) + break; + + /* display info and check radio item */ + if (nmlv->uNewState&LVIS_SELECTED && !(nmlv->uOldState&LVIS_SELECTED)) { + ListView_SetItemState(nmhdr->hwndFrom, nmlv->iItem, INDEXTOSTATEIMAGEMASK(2), LVIS_STATEIMAGEMASK); + DisplayPackInfo(hwndDlg, (LANGPACK_INFO*)nmlv->lParam); + } + /* disable all other radio items */ + else if (nmlv->uNewState&INDEXTOSTATEIMAGEMASK(2)) { + for (int iItem = ListView_GetItemCount(nmhdr->hwndFrom) - 1; iItem != -1; --iItem) + if (iItem != nmlv->iItem) + ListView_SetItemState(nmhdr->hwndFrom, iItem, INDEXTOSTATEIMAGEMASK(1), LVIS_STATEIMAGEMASK); + + /* enable apply */ + if (nmlv->uOldState) { + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + ShowWindow(GetDlgItem(hwndDlg, IDC_RESTART), SW_SHOW); + } + } + } + break; + + case LVN_KEYDOWN: + { + int iItem = ListView_GetNextItem(nmhdr->hwndFrom, -1, LVNI_SELECTED); + switch (((NMLVKEYDOWN*)lParam)->wVKey) { + case VK_SPACE: + ListView_SetItemState(nmhdr->hwndFrom, iItem, INDEXTOSTATEIMAGEMASK(2), LVIS_STATEIMAGEMASK); + break; + + case VK_DELETE: + lvi.iItem = iItem; + lvi.iSubItem = 0; + lvi.mask = LVIF_PARAM; + if (ListView_GetItem(nmhdr->hwndFrom, &lvi)) { + LANGPACK_INFO *pack = (LANGPACK_INFO*)lvi.lParam; + if (!(pack->flags&LPF_DEFAULT)) + DeletePackFile(hwndDlg, nmhdr->hwndFrom, iItem, pack); + } + break; + } + } + break; + + case NM_CLICK: + LVHITTESTINFO hti; + lParam = GetMessagePos(); + POINTSTOPOINT(hti.pt, MAKEPOINTS(lParam)); + ScreenToClient(nmhdr->hwndFrom, &hti.pt); + if (ListView_HitTest(nmhdr->hwndFrom, &hti) != -1) + if (hti.flags&(LVHT_ONITEMSTATEICON | LVHT_ONITEMICON)) /* one of them */ + ListView_SetItemState(nmhdr->hwndFrom, hti.iItem, LVIS_SELECTED, LVIS_SELECTED); + } + break; + + case 0: + switch (nmhdr->code) { + case PSN_APPLY: + lvi.mask = LVIF_STATE | LVIF_PARAM; + lvi.stateMask = LVIS_STATEIMAGEMASK; + lvi.iSubItem = 0; + for (lvi.iItem = 0; ListView_GetItem(hwndList, &lvi); ++lvi.iItem) { + LANGPACK_INFO *pack = (LANGPACK_INFO*)lvi.lParam; + if (lvi.state&INDEXTOSTATEIMAGEMASK(2) && !(pack->flags & LPF_ENABLED)) { + if(!(pack->flags & LPF_DEFAULT)) + db_set_ws(NULL, "LangMan", "Langpack", pack->szFileName); + else + db_unset(NULL, "LangMan", "Langpack"); + TCHAR szPath[MAX_PATH]; + GetPackPath(szPath, SIZEOF(szPath), FALSE, pack->szFileName); + CallService(MS_LANGPACK_RELOAD, 0, (LPARAM)szPath); + pack->flags |= LPF_ENABLED; + CloseWindow(GetParent(hwndDlg)); + DestroyWindow(GetParent(hwndDlg)); + } + else pack->flags &= ~LPF_ENABLED; + } + return TRUE; + } + } + break; + } + return FALSE; +} + +void ReloadLangOptList(void) +{ + if (hwndLangOpt != NULL) { + SendMessage(hwndLangOpt, M_RELOADLIST, 0, 0); + SendMessage(hwndLangOpt, M_SHOWFILECOL, 0, 1); + } +} + +static int LangOptInit(WPARAM wParam, LPARAM) +{ + OPTIONSDIALOGPAGE odp = { sizeof(odp) }; + odp.hInstance = hInst; + odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR; + odp.position = 1200000090; + odp.ptszTitle = LPGENT("Languages"); + odp.ptszGroup = LPGENT("Customize"); + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_LANG); + odp.pfnDlgProc = LangOptDlgProc; + Options_AddPage(wParam, &odp); + return 0; +} + +/************************* Misc ***************************************/ + +void InitOptions(void) +{ + hwndLangOpt = NULL; + hHookOptInit = HookEvent(ME_OPT_INITIALISE, LangOptInit); + //CorrectPacks(_T("langpack_*.txt"), FALSE); +} + +void UninitOptions(void) +{ + UnhookEvent(hHookOptInit); +} \ No newline at end of file diff --git a/plugins/!Deprecated/LangMan/src/options.h b/plugins/!Deprecated/LangMan/src/options.h new file mode 100644 index 0000000000..2b9e93b334 --- /dev/null +++ b/plugins/!Deprecated/LangMan/src/options.h @@ -0,0 +1,27 @@ +/* + +'Language Pack Manager'-Plugin for Miranda IM + +Copyright (C) 2005-2007 H. Herkenrath + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program (LangMan-License.txt); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* Options Page */ +void ReloadLangOptList(void); + +/* Misc */ +void InitOptions(void); +void UninitOptions(void); diff --git a/plugins/!Deprecated/LangMan/src/resource.h b/plugins/!Deprecated/LangMan/src/resource.h new file mode 100644 index 0000000000..30e82b3fc0 --- /dev/null +++ b/plugins/!Deprecated/LangMan/src/resource.h @@ -0,0 +1,52 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by d:\Projects\CPlusPlus\MirandaNG\plugins\LangMan\res\resource.rc +// +#define IDD_OPT_LANG 101 +#define IDD_UPDATENOTIFY 102 +#define IDD_DOWNLOADLANG 103 +#define IDI_ICON1 104 +#define IDI_RELOAD 104 +#define IDC_LANGLIST 1001 +#define IDC_LANGINFOFRAME 1002 +#define IDC_LANGAUTHORSLABEL 1003 +#define IDC_LANGAUTHORS 1004 +#define IDC_LANGEMAILLABEL 1005 +#define IDC_LANGEMAIL 1006 +#define IDC_LANGMODUSINGLABEL 1007 +#define IDC_LANGMODUSING 1008 +#define IDC_LANGDATELABEL 1009 +#define IDC_LANGDATE 1010 +#define IDC_LANGVERSIONLABEL 1011 +#define IDC_LANGVERSION 1012 +#define IDC_LANGLOCALELABEL 1013 +#define IDC_LANGLOCALE 1014 +#define IDC_LANGNOTINCLUDEDLABEL 1015 +#define IDC_LANGNOTINCLUDED 1016 +#define IDC_MORELANG 1017 +#define IDC_RESTART 1018 +#define IDC_ENABLEAUTOUPDATES 1019 +#define IDC_DOWNLOADLANG 1020 +#define IDC_LANGCOMBO 1021 +#define IDC_LANGAUTHORS2 1021 +#define IDC_DOWNLOADALL 1022 +#define IDC_LOADING 1023 +#define IDC_LANGUAGELABEL 1024 +#define IDC_LANGUAGE 1025 +#define IDC_CURRENTVERSION 1026 +#define IDC_NEWVERSION 1027 +#define IDC_NEWVERSIONLABEL 1028 +#define IDC_SKINROOTFOLDER 1439 +#define IDC_LANGROOTFOLDER 1439 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 105 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1029 +#define _APS_NEXT_SYMED_VALUE 2001 +#endif +#endif diff --git a/plugins/!Deprecated/LangMan/src/stdafx.cpp b/plugins/!Deprecated/LangMan/src/stdafx.cpp new file mode 100644 index 0000000000..2aa7ce281e --- /dev/null +++ b/plugins/!Deprecated/LangMan/src/stdafx.cpp @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-14 Miranda NG project (http://miranda-ng.org) + +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 version 2 +of the License. + +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 . +*/ + +#include "common.h" \ No newline at end of file diff --git a/plugins/!Deprecated/LangMan/src/version.h b/plugins/!Deprecated/LangMan/src/version.h new file mode 100644 index 0000000000..c95c154578 --- /dev/null +++ b/plugins/!Deprecated/LangMan/src/version.h @@ -0,0 +1,14 @@ +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 11 +#define __RELEASE_NUM 0 +#define __BUILD_NUM 1 + +#include + +#define __PLUGIN_NAME "Language pack manager" +#define __FILENAME "LangMan.dll" +#define __DESCRIPTION "Helps you manage language packs of different languages." +#define __AUTHOR "H. Herkenrath" +#define __AUTHOREMAIL "" +#define __AUTHORWEB "http://miranda-ng.org/p/LangMan/" +#define __COPYRIGHT "© 2005-2007 H. Herkenrath, 2014 Miranda NG project" -- cgit v1.2.3